本文整理汇总了Python中messenger.ext.channel_num_gen.getClientID4Prebattle函数的典型用法代码示例。如果您正苦于以下问题:Python getClientID4Prebattle函数的具体用法?Python getClientID4Prebattle怎么用?Python getClientID4Prebattle使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getClientID4Prebattle函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
def __init__(self):
super(BWBattleChannelFindCriteria, self).__init__()
self.__ids = []
for item in BATTLE_CHANNEL.ALL:
clientID = channel_num_gen.getClientID4BattleChannel(item.name)
if clientID:
self.__ids.append(clientID)
clientID = channel_num_gen.getClientID4Prebattle(PREBATTLE_TYPE.SQUAD)
if clientID:
self.__ids.append(clientID)
clientID = channel_num_gen.getClientID4Prebattle(PREBATTLE_TYPE.EVENT_SQUAD)
if clientID:
self.__ids.append(clientID)
示例2: addSquadToCarousel
def addSquadToCarousel(self, isReady = False):
clientID = channel_num_gen.getClientID4Prebattle(PREBATTLE_TYPE.SQUAD)
if not clientID:
LOG_ERROR('Client ID not found', 'addSquadToCarousel')
return
currCarouselItemCtx = _defCarouselItemCtx._replace(label=CHAT.CHANNELS_SQUAD, icon=RES_ICONS.MAPS_ICONS_MESSENGER_SQUAD_ICON, criteria={POP_UP_CRITERIA.VIEW_ALIAS: PREBATTLE_ALIASES.SQUAD_WINDOW_PY}, openHandler=self.showSquadWindow, readyData=self.__getReadyPrbData(isReady), tooltipData=self.__getTooltipPrbData(CHAT.CHANNELS_SQUADREADY_TOOLTIP if isReady else CHAT.CHANNELS_SQUADNOTREADY_TOOLTIP))
self._handleAddPreBattleRequest(clientID, currCarouselItemCtx._asdict())
示例3: setSquadTeamReadyInCarousel
def setSquadTeamReadyInCarousel(self, prbType, isTeamReady):
clientID = channel_num_gen.getClientID4Prebattle(prbType)
if not clientID:
LOG_ERROR("Client ID not found", "setSquadTeamReadyInCarousel", prbType)
return
readyData = self.__getReadyPrbData(isTeamReady)
g_eventBus.handleEvent(
events.ChannelManagementEvent(
clientID,
events.ChannelManagementEvent.REQUEST_TO_CHANGE,
{"key": "readyData", "value": readyData, "isShowByReq": False, "showIfClosed": True},
),
scope=EVENT_BUS_SCOPE.LOBBY,
)
g_eventBus.handleEvent(
events.ChannelManagementEvent(
clientID,
events.ChannelManagementEvent.REQUEST_TO_CHANGE,
{
"key": "tooltipData",
"value": self.__getTooltipPrbData(
CHAT.CHANNELS_SQUADREADY_TOOLTIP if isTeamReady else CHAT.CHANNELS_SQUADNOTREADY_TOOLTIP
),
"isShowByReq": False,
"showIfClosed": True,
},
),
scope=EVENT_BUS_SCOPE.LOBBY,
)
示例4: _showUnitProgress
def _showUnitProgress(self, prbType, show):
clientID = channel_num_gen.getClientID4Prebattle(prbType)
if not clientID:
LOG_ERROR("Client ID not found", "_showUnitStatus", prbType)
return
self._fireEvent(
events.ChannelManagementEvent(clientID, events.ChannelManagementEvent.REQUEST_TO_SHOW, {"show": show})
)
示例5: setUnitProgressInCarousel
def setUnitProgressInCarousel(self, prbType, isInProgress):
clientID = channel_num_gen.getClientID4Prebattle(prbType)
if not clientID:
LOG_ERROR('Client ID not found', 'setUnitProgressInCarousel', prbType)
return
self._fireEvent(events.ChannelManagementEvent(clientID, events.ChannelManagementEvent.REQUEST_TO_CHANGE, {'key': 'isInProgress',
'value': isInProgress,
'isShowByReq': isInProgress,
'showIfClosed': True}))
示例6: setUnitProgressInCarousel
def setUnitProgressInCarousel(self, prbType, isInProgress):
if prbType in PREBATTLE_TYPE.SQUAD_PREBATTLES:
LOG_DEBUG('No unit progress for squad.')
return
clientID = channel_num_gen.getClientID4Prebattle(prbType)
if not clientID:
LOG_ERROR('Client ID not found', 'setUnitProgressInCarousel', prbType)
return
self._fireEvent(events.ChannelManagementEvent(clientID, events.ChannelManagementEvent.REQUEST_TO_CHANGE, {'key': 'isInProgress',
'value': isInProgress,
'isShowByReq': isInProgress,
'showIfClosed': True}))
示例7: setUnitProgressInCarousel
def setUnitProgressInCarousel(self, prbType, isInProgress):
clientID = channel_num_gen.getClientID4Prebattle(prbType)
if not clientID:
LOG_ERROR("Client ID not found", "setUnitProgressInCarousel", prbType)
return
self._fireEvent(
events.ChannelManagementEvent(
clientID,
events.ChannelManagementEvent.REQUEST_TO_CHANGE,
{"key": "isInProgress", "value": isInProgress, "isShowByReq": isInProgress, "showIfClosed": True},
)
)
示例8: addSquadToCarousel
def addSquadToCarousel():
clientID = channel_num_gen.getClientID4Prebattle(PREBATTLE_TYPE.SQUAD)
if not clientID:
LOG_ERROR('Client ID not found', 'addSquadToCarousel')
return
g_eventBus.handleEvent(ChannelManagementEvent(clientID, ChannelManagementEvent.REQUEST_TO_ADD, {'label': CHAT.CHANNELS_SQUAD,
'canClose': False,
'isNotified': False,
'icon': '../maps/icons/messenger/squad_icon.png',
'order': channel_num_gen.getOrder4Prebattle(),
'criteria': {POP_UP_CRITERIA.VIEW_ALIAS: guiFactory.getAliasByEvent(events.ShowWindowEvent.SHOW_SQUAD_WINDOW)},
'openHandler': _showSquadWindow}), scope=EVENT_BUS_SCOPE.LOBBY)
示例9: addCompanyToCarousel
def addCompanyToCarousel():
clientID = channel_num_gen.getClientID4Prebattle(PREBATTLE_TYPE.COMPANY)
if not clientID:
LOG_ERROR('Client ID not found', 'addCompanyToCarousel')
return
else:
g_eventBus.handleEvent(ChannelManagementEvent(clientID, ChannelManagementEvent.REQUEST_TO_ADD, {'label': CHAT.CHANNELS_TEAM,
'canClose': False,
'isNotified': False,
'icon': None,
'order': channel_num_gen.getOrder4Prebattle(),
'criteria': {POP_UP_CRITERIA.VIEW_ALIAS: guiFactory.getAliasByEvent(events.ShowWindowEvent.SHOW_COMPANY_WINDOW)},
'openHandler': _showCompanyWindow}), scope=EVENT_BUS_SCOPE.LOBBY)
return
示例10: setSquadTeamReadyInCarousel
def setSquadTeamReadyInCarousel(self, prbType, isTeamReady):
clientID = channel_num_gen.getClientID4Prebattle(prbType)
if not clientID:
LOG_ERROR('Client ID not found', 'setSquadTeamReadyInCarousel', prbType)
return
readyData = self.__getReadyPrbData(isTeamReady)
g_eventBus.handleEvent(events.ChannelManagementEvent(clientID, events.ChannelManagementEvent.REQUEST_TO_CHANGE, {'key': 'readyData',
'value': readyData,
'isShowByReq': False,
'showIfClosed': True}), scope=EVENT_BUS_SCOPE.LOBBY)
g_eventBus.handleEvent(events.ChannelManagementEvent(clientID, events.ChannelManagementEvent.REQUEST_TO_CHANGE, {'key': 'tooltipData',
'value': self.__getTooltipPrbData(CHAT.CHANNELS_SQUADREADY_TOOLTIP if isTeamReady else CHAT.CHANNELS_SQUADNOTREADY_TOOLTIP),
'isShowByReq': False,
'showIfClosed': True}), scope=EVENT_BUS_SCOPE.LOBBY)
示例11: addSpecBattleToCarousel
def addSpecBattleToCarousel(self, prbType):
clientID = channel_num_gen.getClientID4Prebattle(prbType)
if not clientID:
LOG_ERROR('Client ID not found', 'addSpecBattleToCarousel')
return
if prbType is PREBATTLE_TYPE.CLAN:
label = CHAT.CHANNELS_CLAN
elif prbType is PREBATTLE_TYPE.TOURNAMENT:
label = CHAT.CHANNELS_TOURNAMENT
else:
LOG_ERROR('Prebattle type is not valid', prbType)
return
currCarouselItemCtx = _defCarouselItemCtx._replace(label=label, criteria={POP_UP_CRITERIA.VIEW_ALIAS: PREBATTLE_ALIASES.BATTLE_SESSION_ROOM_WINDOW_PY}, openHandler=self.showBattleSessionWindow)
self._handleAddPreBattleRequest(clientID, currCarouselItemCtx._asdict())
示例12: setUnitProgressInCarousel
def setUnitProgressInCarousel(self, prbType, isInProgress):
if prbType in (PREBATTLE_TYPE.SQUAD, PREBATTLE_TYPE.FALLOUT):
LOG_DEBUG("No unit progress for squad.")
return
clientID = channel_num_gen.getClientID4Prebattle(prbType)
if not clientID:
LOG_ERROR("Client ID not found", "setUnitProgressInCarousel", prbType)
return
self._fireEvent(
events.ChannelManagementEvent(
clientID,
events.ChannelManagementEvent.REQUEST_TO_CHANGE,
{"key": "isInProgress", "value": isInProgress, "isShowByReq": isInProgress, "showIfClosed": True},
)
)
示例13: addUnitToCarousel
def addUnitToCarousel():
from gui.Scaleform.locale.CYBERSPORT import CYBERSPORT
clientID = channel_num_gen.getClientID4Prebattle(PREBATTLE_TYPE.UNIT)
if not clientID:
LOG_ERROR('Client ID not found', 'addUnitToCarousel')
return
else:
g_eventBus.handleEvent(ChannelManagementEvent(clientID, ChannelManagementEvent.REQUEST_TO_ADD, {'label': CYBERSPORT.WINDOW_TITLE,
'canClose': False,
'isNotified': False,
'icon': None,
'order': channel_num_gen.getOrder4Prebattle(),
'criteria': {POP_UP_CRITERIA.VIEW_ALIAS: guiFactory.getAliasByEvent(events.ShowWindowEvent.SHOW_UNIT_WINDOW)},
'openHandler': showUnitWindow}), scope=EVENT_BUS_SCOPE.LOBBY)
return
示例14: addUnitToCarousel
def addUnitToCarousel(self, prbType):
clientID = channel_num_gen.getClientID4Prebattle(prbType)
if not clientID:
LOG_ERROR('Client ID not found', 'addUnitToCarousel')
return
if prbType in (PREBATTLE_TYPE.SORTIE, PREBATTLE_TYPE.FORT_BATTLE):
from gui.Scaleform.locale.FORTIFICATIONS import FORTIFICATIONS
from gui.Scaleform.genConsts.FORTIFICATION_ALIASES import FORTIFICATION_ALIASES
label = FORTIFICATIONS.SORTIE_INTROVIEW_TITLE
criteria = {POP_UP_CRITERIA.VIEW_ALIAS: FORTIFICATION_ALIASES.FORT_BATTLE_ROOM_WINDOW_ALIAS}
else:
from gui.Scaleform.locale.CYBERSPORT import CYBERSPORT
label = CYBERSPORT.WINDOW_TITLE
criteria = {POP_UP_CRITERIA.VIEW_ALIAS: CYBER_SPORT_ALIASES.CYBER_SPORT_WINDOW_PY}
currCarouselItemCtx = _defCarouselItemCtx._replace(label=label, criteria=criteria, viewType=ViewTypes.WINDOW, openHandler=lambda : self.showUnitWindow(prbType))
self._handleAddPreBattleRequest(clientID, currCarouselItemCtx._asdict())
示例15: addSpecBattleToCarousel
def addSpecBattleToCarousel(prbType):
clientID = channel_num_gen.getClientID4Prebattle(prbType)
if not clientID:
LOG_ERROR('Client ID not found', 'addSpecBattleToCarousel')
return
else:
if prbType is PREBATTLE_TYPE.CLAN:
label = CHAT.CHANNELS_CLAN
elif prbType is PREBATTLE_TYPE.TOURNAMENT:
label = CHAT.CHANNELS_TOURNAMENT
else:
LOG_ERROR('Prebattle type is not valid', prbType)
return
g_eventBus.handleEvent(ChannelManagementEvent(clientID, ChannelManagementEvent.REQUEST_TO_ADD, {'label': label,
'canClose': False,
'isNotified': False,
'icon': None,
'order': channel_num_gen.getOrder4Prebattle(),
'criteria': {POP_UP_CRITERIA.VIEW_ALIAS: guiFactory.getAliasByEvent(events.ShowWindowEvent.SHOW_BATTLE_SESSION_WINDOW)},
'openHandler': _showBattleSessionWindow}), scope=EVENT_BUS_SCOPE.LOBBY)
return