Exemplo n.º 1
0
 def createByPosition(self, position, name, reloadTime=0.0):
     decorator = None
     if name in BATTLE_CHAT_COMMANDS_BY_NAMES:
         record = struct.pack('<fff', position.x, position.y, position.z)
         msgArgs = messageArgs(strArg2=record)
         if reloadTime > 0.0:
             msgArgs = messageArgs(floatArg1=reloadTime, strArg2=record)
         decorator = _OutCmdDecorator(name, msgArgs)
     return decorator
 def createByBaseIndex(self, idx, name, isAtk):
     decorator = None
     key = 'ATTENTIONTOBASE_ATK' if isAtk else 'ATTENTIONTOBASE_DEF'
     if _MINIMAP_MARK_BASE_IDS:
         decorator = _OutCmdDecorator(
             key, messageArgs(int32Arg1=idx, strArg1=name))
     return decorator
Exemplo n.º 3
0
 def __sendAction(self, actionID, reqID, args=None):
     player = BigWorld.player()
     if not player:
         LOG_ERROR('Player is not defined')
         return False
     player.base.messenger_onActionByClient_chat2(actionID, reqID, args or messageArgs())
     return True
 def createByPosition(self, position):
     decorator = None
     if _MINIMAP_MARK_POSITION_ID:
         decorator = _OutCmdDecorator(
             'ATTENTIONTOPOSITION',
             messageArgs(int32Arg1=position.x, floatArg1=position.z))
     return decorator
Exemplo n.º 5
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
Exemplo n.º 6
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)
Exemplo n.º 7
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)
Exemplo n.º 8
0
 def pushButton(event):
     if inject.g_appLoader().getDefBattleApp():
         if event.key in (Keys.KEY_F5, Keys.KEY_F6) and event.isKeyDown():
             controller = MessengerEntry.g_instance.gui.channelsCtrl.getController(
                 _OutCmdDecorator(44,
                                  messageArgs(strArg1='')).getClientID())
             if controller:
                 controller.sendMessage(
                     config.i18n['UI_messageF5'] if event.key ==
                     Keys.KEY_F5 else config.i18n['UI_messageF6'])
Exemplo n.º 9
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)
Exemplo n.º 10
0
 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
Exemplo n.º 11
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)
Exemplo n.º 12
0
 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
Exemplo n.º 13
0
 def broadcastArgs(self, text, *args):
     return messageArgs(strArg1=text, int32Arg1=args[0] if args else 0)
Exemplo n.º 14
0
 def broadcastArgs(self, text, *args):
     return messageArgs(strArg1=text)
Exemplo n.º 15
0
 def __init__(self, name, args = None):
     super(_OutCmdDecorator, self).__init__(args or messageArgs(), getClientID4BattleChannel(BATTLE_CHANNEL.TEAM.name))
     self._name = name
Exemplo n.º 16
0
 def createByObjectiveIndex(self, idx, isAtk):
     decorator = None
     key = 'ATTENTIONTOOBJECTIVE_ATK' if isAtk else 'ATTENTIONTOOBJECTIVE_DEF'
     if _MINIMAP_MARK_OBJECTIVE_IDS:
         decorator = _OutCmdDecorator(key, messageArgs(int32Arg1=idx))
     return decorator
Exemplo n.º 17
0
 def activate(self):
     super(AdvancedChatComponent, self).activate()
     if self.settingsCore:
         self.settingsCore.onSettingsChanged += self.__onSettingsChanged
     if self.settingsCache:
         if not self.settingsCache.settings.isSynced():
             self.settingsCache.onSyncCompleted += self.__onSettingsReady
         else:
             self.__isEnabled = bool(self.settingsCore.getSetting(BattleCommStorageKeys.ENABLE_BATTLE_COMMUNICATION))
     player = BigWorld.player()
     if player is None:
         return
     elif not player.userSeesWorld():
         g_playerEvents.onAvatarReady += self.__onAvatarReady
         return
     elif not self.__isEnabled:
         return
     else:
         componentSystem = self._componentSystem()
         if componentSystem is not None:
             player.base.messenger_onActionByClient_chat2(_ACTIONS.REINIT_BATTLE_CHAT, 0, messageArgs())
         self.__addEventListeners()
         return
Exemplo n.º 18
0
 def createSPGAimTargetCommand(self, targetID, reloadTime):
     return _OutCmdDecorator(
         BATTLE_CHAT_COMMAND_NAMES.ATTACKING_ENEMY_WITH_SPG,
         messageArgs(int32Arg1=targetID, floatArg1=reloadTime))
Exemplo n.º 19
0
 def createByNameTarget(self, name, targetID):
     decorator = None
     if name in BATTLE_CHAT_COMMANDS_BY_NAMES:
         decorator = _OutCmdDecorator(name, messageArgs(int32Arg1=targetID))
     return decorator
Exemplo n.º 20
0
 def __init__(self, args = None, tail = None):
     super(_ParsingResult, self).__init__()
     self.id = 0
     self.args = args or messageArgs()
     self.tail = tail or []
Exemplo n.º 21
0
 def __init__(self, args=None, tail=None):
     super(_ParsingResult, self).__init__()
     self.id = 0
     self.args = args or messageArgs()
     self.tail = tail or []
Exemplo n.º 22
0
 def createSPGAimTargetCommand(self, targetID, reloadTime):
     return _OutCmdDecorator(
         'ATTACKENEMY', messageArgs(int32Arg1=targetID,
                                    floatArg1=reloadTime))
Exemplo n.º 23
0
 def createByCellIdx(self, cellIdx):
     return _OutCmdDecorator('ATTENTIONTOCELL',
                             messageArgs(int32Arg1=cellIdx))
Exemplo n.º 24
0
 def createByCellIdx(self, cellIdx):
     decorator = None
     if _MINIMAP_CMD_ID:
         decorator = _OutCmdDecorator('ATTENTIONTOCELL',
                                      messageArgs(int32Arg1=cellIdx))
     return decorator
Exemplo n.º 25
0
 def createByMapPos(self, x, y):
     decorator = None
     if _MINIMAP_CMD_ID:
         decorator = _OutCmdDecorator('ATTENTIONTOCELL',
                                      messageArgs(int32Arg1=x, floatArg1=y))
     return decorator
Exemplo n.º 26
0
 def __init__(self, name, args=None):
     super(_OutCmdDecorator, self).__init__(args or messageArgs(), 0)
     self._name = name
Exemplo n.º 27
0
 def __init__(self, name, args=None):
     super(_OutCmdDecorator, self).__init__(
         args or messageArgs(),
         getClientID4BattleChannel(BATTLE_CHANNEL.TEAM.name))
     self._name = name
Exemplo n.º 28
0
 def createCancelReplyByName(self, targetIDOfReply, replyAction, replierID):
     return _OutCmdDecorator(
         BATTLE_CHAT_COMMAND_NAMES.CANCEL_REPLY,
         messageArgs(int32Arg1=targetIDOfReply,
                     int64Arg1=replierID,
                     strArg1=replyAction))
Exemplo n.º 29
0
 def createByGlobalMsgName(self, actionID, baseName=''):
     decorator = None
     if _GLOBAL_MESSAGE_IDS:
         decorator = _OutCmdDecorator(actionID,
                                      messageArgs(strArg1=baseName))
     return decorator
Exemplo n.º 30
0
 def createSPGAimAreaCommand(self, dsp, cellIdx, reloadTime):
     record = struct.pack('<fffif', dsp.x, dsp.y, dsp.z, int(cellIdx),
                          reloadTime)
     return _OutCmdDecorator('SPG_AIM_AREA', messageArgs(strArg1=record))
 def createByObjectiveIndex(self, idx, isAtk, commandName):
     decorator = None
     if _OBJECTIVE_CMD_IDS:
         decorator = _OutCmdDecorator(commandName,
                                      messageArgs(int32Arg1=idx))
     return decorator
Exemplo n.º 32
0
 def createByNameTarget(self, name, targetID):
     decorator = None
     if name in BATTLE_CHAT_COMMANDS_BY_NAMES:
         decorator = _OutCmdDecorator(name, messageArgs(int32Arg1=targetID))
     return decorator
Exemplo n.º 33
0
 def createByBaseIndexAndName(self, baseIdx, commandName, baseName):
     decorator = None
     if commandName in BASE_CMD_NAMES:
         decorator = _OutCmdDecorator(
             commandName, messageArgs(int32Arg1=baseIdx, strArg1=baseName))
     return decorator
Exemplo n.º 34
0
 def createByCellIdx(self, cellIdx):
     decorator = None
     if _MINIMAP_CMD_ID:
         decorator = _OutCmdDecorator('ATTENTIONTOCELL', messageArgs(int32Arg1=cellIdx))
     return decorator
Exemplo n.º 35
0
 def createReplyByName(self, replyID, replyType, replierID):
     return _OutCmdDecorator(
         BATTLE_CHAT_COMMAND_NAMES.REPLY,
         messageArgs(int32Arg1=replyID,
                     int64Arg1=replierID,
                     strArg1=replyType))
Exemplo n.º 36
0
 def broadcastArgs(self, text, *args):
     return messageArgs(strArg1=text)
Exemplo n.º 37
0
 def createClearChatCommandsFromTarget(self, targetID, targetMarkerType):
     return _OutCmdDecorator(
         BATTLE_CHAT_COMMAND_NAMES.CLEAR_CHAT_COMMANDS,
         messageArgs(int32Arg1=targetID, strArg1=targetMarkerType))
Exemplo n.º 38
0
 def broadcastArgs(self, text, *args):
     return messageArgs(strArg1=text, int32Arg1=args[0] if args else 0)