Exemple #1
0
 def remote_move(self, playerName, command, *dummyArgs, **kwargs):
     """the server sends us info or a question and always wants us to answer"""
     if Internal.scene and not isAlive(Internal.scene):
         return fail()
     if self.game:
         player = self.game.playerByName(playerName)
     elif playerName:
         player = PlayingPlayer(None, playerName)
     else:
         player = None
     move = Move(player, command, kwargs)
     if Debug.traffic:
         if self.isHumanClient():
             if self.game:
                 self.game.debug('got Move: %s' % move)
             else:
                 logDebug('got Move: %s' % move)
     if self.game:
         if move.token:
             if move.token != self.game.handId.token():
                 logException('wrong token: %s, we have %s' %
                              (move.token, self.game.handId.token()))
     with Duration('Move %s:' % move):
         return self.exec_move(move).addCallback(self.__jellyMessage)