当前位置: 首页>>代码示例>>Python>>正文


Python player_helpers.isCurrentPlayer函数代码示例

本文整理汇总了Python中messenger.ext.player_helpers.isCurrentPlayer函数的典型用法代码示例。如果您正苦于以下问题:Python isCurrentPlayer函数的具体用法?Python isCurrentPlayer怎么用?Python isCurrentPlayer使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了isCurrentPlayer函数的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: addCommand

 def addCommand(self, command):
     cmdData = command.getProtoData()
     isCurrent = isCurrentPlayer(cmdData.originator)
     text = self._format(cmdData, command.getCommandText())
     if BattleReplay.g_replayCtrl.isRecording:
         BattleReplay.g_replayCtrl.onBattleChatMessage(text, isCurrent)
     if self._view:
         self._view.addMessage(text, isCurrentPlayer=isCurrent)
开发者ID:webiumsk,项目名称:WoT,代码行数:8,代码来源:battle_controllers.py

示例2: _format

 def _format(self, message):
     group = message.group
     dbID = message.originator
     if CHAT_MEMBER_GROUP.member.index() == group or isCurrentPlayer(dbID):
         key = self.usersStorage.getUserGuiType(dbID)
     else:
         key = CHAT_MEMBER_GROUP[group].name()
     playerName = g_lobbyContext.getPlayerFullName(message.originatorNickName, pDBID=dbID)
     return g_settings.lobby.getMessageFormat(key).format(playerName, TimeFormatter.getMessageTimeFormat(message.time), message.data)
开发者ID:19colt87,项目名称:WOTDecompiled,代码行数:9,代码来源:bw_lobby_controllers.py

示例3: setColors

 def setColors(self, dbID):
     pColorScheme = g_settings.getColorScheme('battle/player')
     pColor = pColorScheme.getHexStr('squadman')
     if isCurrentPlayer(dbID):
         pColor = pColorScheme.getHexStr('himself')
     elif g_sessionProvider.getCtx().isTeamKiller(accID=dbID):
         pColor = pColorScheme.getHexStr('teamkiller')
     self._ctx['playerColor'] = pColor
     self._ctx['messageColor'] = g_settings.getColorScheme('battle/message').getHexStr('squad')
     return self
开发者ID:webiumsk,项目名称:WOT-0.9.12-CT,代码行数:10,代码来源:chat_message.py

示例4: getMessageColors

 def getMessageColors(self, message):
     dbID = message.originator
     mColor = g_settings.getColorScheme('battle/message').getHexStr('squad')
     pColorScheme = g_settings.getColorScheme('battle/player')
     pColor = pColorScheme.getHexStr('squadman')
     if isCurrentPlayer(dbID):
         pColor = pColorScheme.getHexStr('himself')
     elif g_sessionProvider.getCtx().isTeamKiller(accID=dbID):
         pColor = pColorScheme.getHexStr('teamkiller')
     return (pColor, mColor)
开发者ID:webiumsk,项目名称:WoT,代码行数:10,代码来源:battle_controllers.py

示例5: getMessageColors

 def getMessageColors(self, message):
     dbID = message.originator
     mColor = g_settings.getColorScheme("battle/message").getHexStr("squad")
     pColorScheme = g_settings.getColorScheme("battle/player")
     pColor = pColorScheme.getHexStr("squadman")
     if isCurrentPlayer(dbID):
         pColor = pColorScheme.getHexStr("himself")
     elif g_battleContext.isTeamKiller(accID=dbID):
         pColor = pColorScheme.getHexStr("teamkiller")
     return (pColor, mColor)
开发者ID:19colt87,项目名称:WOTDecompiled,代码行数:10,代码来源:bw_battle_controllers.py

示例6: addMessage

 def addMessage(self, message, doFormatting = True):
     isCurrent = isCurrentPlayer(message.originator)
     if doFormatting:
         text = self._format(message, message.data)
     else:
         text = message.data
     if BattleReplay.g_replayCtrl.isRecording:
         BattleReplay.g_replayCtrl.onBattleChatMessage(text, isCurrent)
     if self._view:
         self._view.addMessage(text, isCurrentPlayer=isCurrent)
     return True
开发者ID:webiumsk,项目名称:WoT,代码行数:11,代码来源:battle_controllers.py

示例7: _format

 def _format(self, message, doFormatting = True):
     isString = type(message) is types.StringType
     if not doFormatting or isString:
         if isString:
             return message
         return message.data
     group = message.group
     dbID = message.originator
     if CHAT_MEMBER_GROUP.member.index() == group or isCurrentPlayer(dbID):
         self._mBuilder.setGuiType(dbID)
     else:
         self._mBuilder.setGroup(CHAT_MEMBER_GROUP[group].name())
     return self._mBuilder.setName(dbID, message.originatorNickName).setTime(message.time).setText(message.data).build()
开发者ID:webiumsk,项目名称:WOT-0.9.12,代码行数:13,代码来源:lobby_controllers.py

示例8: filter

    def filter(self, senderID, text):
        if isCurrentPlayer(senderID):
            return text
        userHistory = self.__history.get(senderID)
        if userHistory is None:
            userHistory = self.__history[senderID] = []
        currTime = BigWorld.time()
        recentCount = len(userHistory) + 1
        for msgTime, msgText in userHistory:
            if currTime - msgTime > MESSAGE_FLOOD_COOLDOWN:
                recentCount -= 1
            elif text == msgText:
                text = ''
                break

        userHistory.append((currTime, text))
        if recentCount < len(userHistory):
            self.__history[senderID] = userHistory[-recentCount:]
        return text
开发者ID:kblw,项目名称:wot_client,代码行数:19,代码来源:_collection.py

示例9: getMessageColors

 def getMessageColors(self, message):
     dbID = message.originator
     mColor = g_settings.getColorScheme('battle/message').getHexStr('common')
     pColorScheme = g_settings.getColorScheme('battle/player')
     pColor = pColorScheme.getHexStr('unknown')
     if isCurrentPlayer(dbID):
         pColor = pColorScheme.getHexStr('himself')
     else:
         channel = self.channelsStorage.getChannel(self._teamChannel)
         if channel and channel.hasMember(dbID):
             if g_battleContext.isTeamKiller(accID=dbID):
                 pColor = pColorScheme.getHexStr('teamkiller')
             elif g_battleContext.isSquadMan(accID=dbID):
                 pColor = pColorScheme.getHexStr('squadman')
             else:
                 pColor = pColorScheme.getHexStr('teammate')
         elif self._channel.hasMember(dbID):
             pColor = pColorScheme.getHexStr('enemy')
     return (pColor, mColor)
开发者ID:sgoldenb,项目名称:siemafilter,代码行数:19,代码来源:bw_battle_controllers.py

示例10: addMessage

    def addMessage(self, message, doFormatting = True):
        isCurrent = isCurrentPlayer(message.originator)
        
        if doFormatting:
            text = self._format(message, message.data)
        else:
            text = message.data

        """
        if testIfEnglish(message.data):
            text = text + " en"
        else:
            text = text + " nonEn"
        """
        
        if testIfEnglish(message.data):
            self._channel.addMessage(text)
            if self._view:
                self._view.addMessage(text, isCurrentPlayer=isCurrent)
            
        if BattleReplay.g_replayCtrl.isRecording:
            BattleReplay.g_replayCtrl.onBattleChatMessage(text, isCurrent)
  
        return True
开发者ID:sgoldenb,项目名称:siemafilter,代码行数:24,代码来源:bw_battle_controllers.py

示例11: filter

 def filter(self, senderID, text):
     if isCurrentPlayer(senderID):
         return text
     return g_olDictionary.searchAndReplace(text)
开发者ID:webiumsk,项目名称:WOT-0.9.12-CT,代码行数:4,代码来源:_collection.py

示例12: __onConnectStateChanged

 def __onConnectStateChanged(self, channel):
     if channel.isJoined() and channel.getProtoType() is PROTO_TYPE.BW:
         data = channel.getProtoData()
         if not isCurrentPlayer(data.owner) and channel.isPrivate():
             g_instance.execEffect('channelOpenedEffect')
开发者ID:webiumsk,项目名称:WOT-0.9.12,代码行数:5,代码来源:__init__.py

示例13: _formatMessage

 def _formatMessage(self, message, doFormatting = True):
     dbID = message.accountDBID
     isCurrent = isCurrentPlayer(message.accountDBID)
     if not doFormatting:
         return (isCurrent, message.text)
     return (isCurrent, self._mBuilder.setColors(dbID).setName(dbID, message.accountName).setText(message.text).build())
开发者ID:aevitas,项目名称:wotsdk,代码行数:6,代码来源:bw_chat2battle_controllers.py

示例14: __onConnectStateChanged

 def __onConnectStateChanged(self, channel):
     if channel.isJoined() and channel.getProtoType() is PROTO_TYPE.BW:
         data = channel.getProtoData()
         if not isCurrentPlayer(data.owner) and channel.isPrivate():
             g_instance.startLightEffect(GameLights.CHAT_CHANNEL_OPENED_EFFECT)
开发者ID:webiumsk,项目名称:WOT-0.9.12-CT,代码行数:5,代码来源:lightmanager.py


注:本文中的messenger.ext.player_helpers.isCurrentPlayer函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。