Example #1
0
 def __sendAction(self, actionID, reqID, args = None):
     player = BigWorld.player()
     if player:
         player.base.messenger_onActionByClient_chat2(actionID, reqID, args or messageArgs())
         return True
     else:
         LOG_ERROR('Player is not defined')
         return False
Example #2
0
 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)
Example #3
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)
 def create4Reload(self, isCassetteClip, timeLeft, quantity):
     name = 'RELOADINGGUN'
     args = None
     if timeLeft > 0:
         floatArg1 = timeLeft
         int32Arg1 = 0
         if isCassetteClip:
             if quantity > 0:
                 name = 'RELOADING_CASSETE'
                 int32Arg1 = quantity
         args = messageArgs(int32Arg1=int32Arg1, floatArg1=floatArg1)
     elif quantity == 0:
         name = 'RELOADING_UNAVAILABLE'
     elif isCassetteClip:
         name = 'RELOADING_READY_CASSETE'
         args = messageArgs(int32Arg1=quantity)
     else:
         name = 'RELOADING_READY'
     if name in BATTLE_CHAT_COMMANDS_BY_NAMES:
         decorator = _OutCmdDecorator(name, args)
     else:
         decorator = None
     return decorator
Example #5
0
 def doAction(self, actionID, args = None, response = False, skipCoolDown = False):
     player = BigWorld.player()
     (success, reqID,) = (False, 0)
     if player:
         if self.__coolDown.isInProcess(actionID):
             if not skipCoolDown:
                 g_messengerEvents.onServerErrorReceived(createCoolDownError(actionID))
         elif response:
             reqID = self.__idGen.next()
         player.base.messenger_onActionByClient_chat2(actionID, reqID, args or messageArgs())
         success = True
     else:
         LOG_ERROR('Player is not defined')
     return (success, reqID)
Example #6
0
 def broadcastArgs(self, text, *args):
     return messageArgs(strArg1=text, int32Arg1=args[0] if args else 0)
Example #7
0
 def broadcastArgs(self, text, *args):
     return messageArgs(strArg1=text)
 def __init__(self, name, args = None):
     super(_OutCmdDecorator, self).__init__(args or messageArgs(), getClientID4BattleChannel(BATTLE_CHANNEL.TEAM.name))
     self._name = name
 def createByCellIdx(self, cellIdx):
     decorator = None
     if _MINIMAP_CMD_ID:
         decorator = _OutCmdDecorator('ATTENTIONTOCELL', messageArgs(int32Arg1=cellIdx))
     return decorator
Example #10
0
 def createByNameTarget(self, name, targetID):
     decorator = None
     if name in BATTLE_CHAT_COMMANDS_BY_NAMES:
         decorator = _OutCmdDecorator(name, messageArgs(int32Arg1=targetID))
     return decorator
Example #11
0
 def __init__(self, args = None, tail = None):
     super(_ParsingResult, self).__init__()
     self.id = 0
     self.args = args or messageArgs()
     self.tail = tail or []