示例#1
0
 private void accessObservedGame(int observerId, int gameId, ClientCode clientCode, Team team, out Observer observer, out GameModel game)
 {
     lock (_gameLock)
     {
         observer = getObserver(observerId, clientCode);
         game     = getGame(gameId);
         checkGameAccess(game, team);
         game.CheckRunState();
     }
 }
示例#2
0
 private GameModel accessLiveGame(int playerId, ClientCode clientCode)
 {
     lock (_gameLock)
     {
         Player player = getPlayer(playerId);
         checkPlayerAccess(player, clientCode);
         GameModel game = player.Game;
         if (game == null)
         {
             throw new ApplicationException("Player is not in a game");
         }
         game.CheckRunState();
         return(game);
     }
 }