def requestToJoin(self, battleID): currentBattleID = getBattleID() if currentBattleID == battleID: fort_events.showFortBattleRoomWindow() else: battle = self.fortCtrl.getFort().getBattle(battleID) if battle is not None: fort_helpers.tryToConnectFortBattle(battleID, battle.getPeripheryID()) else: SystemMessages.pushI18nMessage(SYSTEM_MESSAGES.FORTIFICATION_ERRORS_BATTLE_DOES_NOT_EXIST, type=SystemMessages.SM_TYPE.Error) return
def requestToJoin(self, battleID): currentBattleID = getBattleID() if currentBattleID == battleID: fort_events.showFortBattleRoomWindow() else: battle = self.fortCtrl.getFort().getBattle(battleID) if battle is not None: fort_helpers.tryToConnectFortBattle(battleID, battle.getPeripheryID()) else: SystemMessages.pushI18nMessage( SYSTEM_MESSAGES.FORTIFICATION_ERRORS_BATTLE_DOES_NOT_EXIST, type=SystemMessages.SM_TYPE.Error) self.destroy()
def handleAction(self, model, entityID, action): super(AcceptPrbFortInviteHandler, self).handleAction(model, entityID, action) notification = model.collection.getItem(NOTIFICATION_TYPE.MESSAGE, entityID) if not notification: LOG_ERROR('Notification not found', NOTIFICATION_TYPE.MESSAGE, entityID) return customData = notification.getSavedData() battleID = customData.get('battleID') peripheryID = customData.get('peripheryID') if battleID is not None and peripheryID is not None: if battleID == getBattleID(): fort_events.showFortBattleRoomWindow() else: fort_helpers.tryToConnectFortBattle(battleID, peripheryID) else: LOG_ERROR('Invalid fort battle data', battleID, peripheryID)