def tryToConnectFortBattle(battleID, peripheryID): from gui.prb_control.dispatcher import g_prbLoader from gui import DialogsInterface, SystemMessages yield lambda callback: callback(None) if g_lobbyContext.isAnotherPeriphery(peripheryID): if g_lobbyContext.isPeripheryAvailable(peripheryID): result = yield DialogsInterface.showDialog( UnitConfirmDialogMeta( PREBATTLE_TYPE.FORT_BATTLE, 'changePeriphery', messageCtx={ 'host': g_lobbyContext.getPeripheryName(peripheryID) })) if result: g_prbLoader.getPeripheriesHandler().join( peripheryID, CreateOrJoinFortBattleCtx( battleID, waitingID='fort/fortBattle/createOrJoin')) else: SystemMessages.pushI18nMessage( '#system_messages:periphery/errors/isNotAvailable', type=SystemMessages.SM_TYPE.Error) else: yield g_prbLoader.getDispatcher().join( CreateOrJoinFortBattleCtx( battleID, waitingID='fort/fortBattle/createOrJoin'))
def tryToConnectClubBattle(club, joinTime): from gui import DialogsInterface, SystemMessages from gui.prb_control.dispatcher import g_prbLoader from gui.Scaleform.daapi.view.dialogs.rally_dialog_meta import UnitConfirmDialogMeta yield lambda callback: callback(None) if not club: LOG_ERROR('Invalid club info to join unit', club, joinTime) return clubDbID = club.getClubDbID() if club.hasActiveUnit(): peripheryID = club.getUnitInfo().peripheryID if g_lobbyContext.isAnotherPeriphery(peripheryID): if g_lobbyContext.isPeripheryAvailable(peripheryID): result = yield DialogsInterface.showDialog( UnitConfirmDialogMeta( PREBATTLE_TYPE.CLUBS, 'changePeriphery', messageCtx={ 'host': g_lobbyContext.getPeripheryName(peripheryID) })) if result: g_prbLoader.getPeripheriesHandler().join( peripheryID, JoinClubBattleCtx(clubDbID, joinTime, allowDelay=True, waitingID='clubs/joinClubUnit')) else: SystemMessages.pushI18nMessage( '#system_messages:periphery/errors/isNotAvailable', type=SystemMessages.SM_TYPE.Error) return yield g_prbLoader.getDispatcher().join( JoinClubBattleCtx(clubDbID, joinTime, waitingID='clubs/joinClubUnit'))
def tryToConnectFortBattle(battleID, peripheryID): from gui.prb_control.dispatcher import g_prbLoader yield lambda callback: callback(None) if g_lobbyContext.isAnotherPeriphery(peripheryID): if g_lobbyContext.isPeripheryAvailable(peripheryID): result = yield DialogsInterface.showDialog(UnitConfirmDialogMeta(PREBATTLE_TYPE.FORT_BATTLE, 'changePeriphery', messageCtx={'host': g_lobbyContext.getPeripheryName(peripheryID)})) if result: g_prbLoader.getPeripheriesHandler().join(peripheryID, CreateOrJoinFortBattleCtx(battleID, waitingID='fort/fortBattle/createOrJoin')) else: SystemMessages.pushI18nMessage('#system_messages:periphery/errors/isNotAvailable', type=SystemMessages.SM_TYPE.Error) else: yield g_prbLoader.getDispatcher().join(CreateOrJoinFortBattleCtx(battleID, waitingID='fort/fortBattle/createOrJoin'))
def tryToConnectClubBattle(club, joinTime): from gui import DialogsInterface, SystemMessages from gui.prb_control.dispatcher import g_prbLoader from gui.Scaleform.daapi.view.dialogs.rally_dialog_meta import UnitConfirmDialogMeta yield lambda callback: callback(None) if not club: LOG_ERROR('Invalid club info to join unit', club, joinTime) return clubDbID = club.getClubDbID() if club.hasActiveUnit(): peripheryID = club.getUnitInfo().peripheryID if g_lobbyContext.isAnotherPeriphery(peripheryID): if g_lobbyContext.isPeripheryAvailable(peripheryID): result = yield DialogsInterface.showDialog(UnitConfirmDialogMeta(PREBATTLE_TYPE.CLUBS, 'changePeriphery', messageCtx={'host': g_lobbyContext.getPeripheryName(peripheryID)})) if result: g_prbLoader.getPeripheriesHandler().join(peripheryID, JoinClubBattleCtx(clubDbID, joinTime, allowDelay=True, waitingID='clubs/joinClubUnit')) else: SystemMessages.pushI18nMessage('#system_messages:periphery/errors/isNotAvailable', type=SystemMessages.SM_TYPE.Error) return yield g_prbLoader.getDispatcher().join(JoinClubBattleCtx(clubDbID, joinTime, waitingID='clubs/joinClubUnit'))
def __get__(self, obj, objType=None): """ Getter for property. Args: obj: decorated object objType: decorated object's class Returns: peripheries handler """ from gui.prb_control.dispatcher import g_prbLoader return g_prbLoader.getPeripheriesHandler()
def __get__(self, obj, objType = None): from gui.prb_control.dispatcher import g_prbLoader return g_prbLoader.getPeripheriesHandler()
def __get__(self, obj, objType = None): return g_prbLoader.getPeripheriesHandler()