コード例 #1
0
 def _onResponseFailure(self, ids, args):
     command = super(BattleChatCommandHandler, self)._onResponseFailure(ids, args)
     if command:
         if _ACTIONS.isBattleChatAction(command.id):
             self.provider().clearBattleActionCoolDown(ids, command.id)
         else:
             self.provider().clearActionCoolDown(command.id)
         error = errors.createBattleCommandError(args, command)
         if error:
             g_messengerEvents.onErrorReceived(error)
         else:
             _logger.warning('Error is not resolved on the client %d, %r', command.getID(), args)
コード例 #2
0
 def send(self, decorator):
     command = decorator.getCommand()
     if command:
         provider = self.provider()
         success, reqID = provider.doAction(command.id, decorator.getProtoData(), True, not GUI_SETTINGS.isBattleCmdCoolDownVisible)
         if reqID:
             self.pushRq(reqID, command)
         if success:
             if decorator.isEnemyTarget():
                 self.__targetIDs.append(decorator.getTargetID())
             if _ACTIONS.isBattleChatAction(command.id):
                 cooldownConfig = getCooldownGameModeDataForGameMode(self.__sessionProvider.arenaVisitor.getArenaBonusType())
                 provider.setBattleActionCoolDown(reqID, command.id, decorator.getTargetID(), cooldownConfig)
             else:
                 provider.setActionCoolDown(command.id, command.cooldownPeriod)
     else:
         _logger.error('Battle command is not found %r', decorator)