private IGame GetSessionGame()
        {
            var   sessionId = _operationContextHelper.Instance.SessionId ?? default(Guid);
            IGame game      = null;

            try
            {
                game = _gameSessions.GetGame(sessionId);
            }
            catch (InvalidSessionException invalidSessionException)
            {
                _logger.Error(invalidSessionException);
                throw;
            }
            catch (Exception exp)
            {
                _logger.Error(exp);
                throw new InvalidSessionException("Game session is not found", sessionId);
            }
            return(game);
        }
Exemple #2
0
        private IGame GetSessionGame()
        {
            var   sessionId = _operationContextHelper.Instance.SessionId ?? default(Guid);
            IGame game      = null;

            try
            {
                game = _gameSessions.GetGame(sessionId);
                //TODO: if Game IsFreezed then throw GameFreezedException() that will be caught by wrapping service and return NeedToChangeNode response to Client.
            }
            catch (InvalidSessionException invalidSessionException)
            {
                _logger.Error(invalidSessionException);
                throw;
            }
            catch (Exception exp)
            {
                _logger.Error(exp);
                throw new InvalidSessionException("Game session is not found", sessionId);
            }
            return(game);
        }
 public void WipeUser(string username)
 {
     _gameSessions.GetGame(username).Reset();
 }