コード例 #1
0
ファイル: voipchatprovider.py プロジェクト: Infernux/Projects
 def requestCredentials(self, reset = 0):
     provider = self.provider()
     actionID = _ACTIONS.GET_VOIP_CREDENTIALS
     (success, reqID,) = provider.doAction(actionID, messageArgs(int32Arg1=reset), True)
     if reqID:
         self.pushRq(reqID, actionID)
     if success:
         provider.setActionCoolDown(actionID, _LIMITS.VOIP_CREDENTIALS_REQUEST_COOLDOWN_SEC)
コード例 #2
0
ファイル: chat_handlers.py プロジェクト: webiumsk/WOT-0.9.12
 def send(self, decorator):
     provider = self.provider()
     commandID = decorator.getID()
     success, reqID = provider.doAction(commandID, decorator.getProtoData(), True)
     if reqID:
         self.pushRq(reqID, decorator)
     if success:
         provider.setActionCoolDown(commandID, _LIMITS.ADMIN_COMMANDS_FROM_CLIENT_COOLDOWN_SEC)
     return success
コード例 #3
0
 def send(self, decorator):
     provider = self.provider()
     commandID = decorator.getID()
     success, reqID = provider.doAction(commandID, decorator.getProtoData(), True)
     if reqID:
         self.pushRq(reqID, decorator)
     if success:
         provider.setActionCoolDown(commandID, _LIMITS.ADMIN_COMMANDS_FROM_CLIENT_COOLDOWN_SEC)
     return success
コード例 #4
0
 def requestCredentials(self, reset = 0):
     provider = self.provider()
     actionID = _ACTIONS.GET_VOIP_CREDENTIALS
     if reset:
         provider.clearActionCoolDown(actionID)
     success, reqID = provider.doAction(actionID, messageArgs(int32Arg1=reset), True)
     if reqID:
         self.pushRq(reqID, actionID)
     if success:
         provider.setActionCoolDown(actionID, _LIMITS.VOIP_CREDENTIALS_REQUEST_COOLDOWN_SEC)
コード例 #5
0
 def findUsers(self, namePattern, searchOnlineOnly = None):
     provider = self.provider()
     if searchOnlineOnly is None:
         searchOnlineOnly = False
     success, reqID = provider.doAction(_ACTIONS.FIND_USERS_BY_NAME, messageArgs(strArg1=namePattern, int32Arg1=self.__limits.getMaxResultSize(), int64Arg1=searchOnlineOnly), response=True)
     if reqID:
         self.pushRq(reqID, _ACTIONS.FIND_USERS_BY_NAME)
     if success:
         cooldown = self.__limits.getRequestCooldown()
         provider.setActionCoolDown(_ACTIONS.FIND_USERS_BY_NAME, cooldown)
     return (success, reqID)
コード例 #6
0
 def send(self, decorator):
     command = decorator.getCommand()
     if command:
         provider = self.provider()
         success, reqID = provider.doAction(command.id, decorator.getProtoData(), True, True)
         if success:
             if reqID:
                 self.pushRq(reqID, command)
             provider.setActionCoolDown(command.id, command.cooldownPeriod)
     else:
         LOG_ERROR('Unit command not found', decorator)
コード例 #7
0
ファイル: chat_handlers.py プロジェクト: webiumsk/WOT-0.9.12
 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())
             provider.setActionCoolDown(command.id, command.cooldownPeriod)
     else:
         LOG_ERROR('Battle command is not found', decorator)
コード例 #8
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())
             provider.setActionCoolDown(command.id, command.cooldownPeriod)
     else:
         LOG_ERROR('Battle command is not found', decorator)
コード例 #9
0
ファイル: chat_handlers.py プロジェクト: webiumsk/WOT-0.9.12
 def broadcast(self, text, *args):
     if self.__isInited:
         provider = self.provider()
         text = provider.filterOutMessage(text, self.__limits)
         if not text:
             return
         result, cmd = self.__adminChat.parseLine(text)
         if result:
             if cmd:
                 cmd.setClientID(self._getClientIDForCommand())
             return
         actionID = self.__actions.broadcastID
         success, reqID = provider.doAction(actionID, self.__factory.broadcastArgs(text, *args), True)
         if reqID:
             self.pushRq(reqID)
         if success:
             cooldown = self.__limits.getBroadcastCoolDown()
             provider.setActionCoolDown(actionID, cooldown)
     else:
         LOG_WARNING('TODO: Adds error message')
コード例 #10
0
 def broadcast(self, text, *args):
     if self.__isInited:
         provider = self.provider()
         text = provider.filterOutMessage(text, self.__limits)
         if not text:
             return
         result, cmd = self.__adminChat.parseLine(text)
         if result:
             if cmd:
                 cmd.setClientID(self._getClientIDForCommand())
             return
         actionID = self.__actions.broadcastID
         success, reqID = provider.doAction(actionID, self.__factory.broadcastArgs(text, *args), True)
         if reqID:
             self.pushRq(reqID)
         if success:
             cooldown = self.__limits.getBroadcastCoolDown()
             provider.setActionCoolDown(actionID, cooldown)
     else:
         LOG_WARNING('TODO: Adds error message')