generated from VLADIMIR/template
up
This commit is contained in:
@@ -123,14 +123,17 @@ func (s *server) BindScreen(ctx context.Context, req *proto.BindScreenReq) (*pro
|
||||
return nil, status.Error(codes.NotFound, "игра не найдена")
|
||||
}
|
||||
hash := hashScreenToken(req.AccessToken)
|
||||
if err = s.screenService.Bind(ctx, id, int(req.GameID), hash); err != nil {
|
||||
isNewBinding, err := s.screenService.Bind(ctx, id, int(req.GameID), hash, req.GetInitializeAudio())
|
||||
if err != nil {
|
||||
if errors.Is(err, screen_service.ErrScreenNotFound) {
|
||||
return nil, status.Error(codes.Unauthenticated, "недействительная сессия экрана")
|
||||
}
|
||||
return nil, status.Error(codes.Internal, "не удалось привязать экран")
|
||||
}
|
||||
if err := s.screenPlanService.ApplyCurrent(ctx, int(req.GameID)); err != nil {
|
||||
return nil, status.Error(codes.Internal, "не удалось применить план экранов")
|
||||
if isNewBinding {
|
||||
if err := s.screenPlanService.ApplyCurrent(ctx, int(req.GameID), id); err != nil {
|
||||
return nil, status.Error(codes.Internal, "не удалось применить план экранов")
|
||||
}
|
||||
}
|
||||
session, err := s.screenService.Get(ctx, id, hash)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user