本文整理汇总了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)
示例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)
示例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
示例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)
示例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)
示例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
示例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()
示例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
示例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)
示例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
示例11: filter
def filter(self, senderID, text):
if isCurrentPlayer(senderID):
return text
return g_olDictionary.searchAndReplace(text)
示例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')
示例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())
示例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)