def stop(self): self.onBattleSessionStop() g_playerEvents.onBattleResultsReceived -= self.__pe_onBattleResultsReceived if self.__viewComponentsBridge is not None: self.__viewComponentsBridge.clear() self.__viewComponentsBridge = None if self.__invitations is not None: self.__invitations.clear() self.__invitations = None if self.__requestsCtrl is not None: self.__requestsCtrl.fini() self.__requestsCtrl = None if self.__arenaListeners is not None: self.__arenaListeners.stop() self.__arenaListeners = None if self.__arenaDP is not None: self.__arenaDP.clear() self.__arenaDP = None self.__sharedRepo.destroy() self.__dynamicRepo.destroy() self.__arenaVisitor.clear() self.__arenaVisitor = arena_visitor.createSkeleton() self.__battleCache.clear() self.__ctx.stop() return
def __init__(self, arenaTypeID=0, guiType=ARENA_GUI_TYPE.UNKNOWN, bonusType=ARENA_BONUS_TYPE.UNKNOWN, winnerTeam=0, finishReason=FINISH_REASON.UNKNOWN, bots=None, **kwargs): super(CommonInfo, self).__init__() self.__arenaTypeID = arenaTypeID self.__winnerTeam = winnerTeam self.__finishReason = finishReason self.__bots = defaultdict() if bots is not None: for info in bots.iteritems(): if len(info) > 1: botPlayerInfo = PlayerInfo(team=info[1][0], name=preprocessBotName( info[1][1])) self.__bots[info[0]] = botPlayerInfo LOG_ERROR('Bot information can not be unpacked', info) break if self.__arenaTypeID and self.__arenaTypeID in ArenaType.g_cache: arenaType = ArenaType.g_cache[self.__arenaTypeID] else: arenaType = None self.__arenaVisitor = arena_visitor.createSkeleton(arenaType=arenaType, guiType=guiType, bonusType=bonusType) return
def __init__(self, arenaTypeID=0, guiType=ARENA_GUI_TYPE.UNKNOWN, bonusType=ARENA_BONUS_TYPE.UNKNOWN, winnerTeam=0, finishReason=FINISH_REASON.UNKNOWN, bots=None, **kwargs): super(CommonInfo, self).__init__() self.__arenaTypeID = arenaTypeID self.__winnerTeam = winnerTeam self.__finishReason = finishReason self.__bots = defaultdict() self.__extCommon = kwargs.get('extCommon', {}) if bots is not None: allActiveVehicles = kwargs.get('vehicles', {}) for info in bots.iteritems(): if len(info) <= 1: _logger.error('Bot information can not be unpacked: not enough data') break vehicleID = info[0] if vehicleID in allActiveVehicles: team, name = info[1][:2] botPlayerInfo = PlayerInfo(team=team, realName=preprocessBotName(name)) self.__bots[vehicleID] = botPlayerInfo if self.__arenaTypeID and self.__arenaTypeID in ArenaType.g_cache: arenaType = ArenaType.g_cache[self.__arenaTypeID] else: arenaType = None self.__arenaVisitor = arena_visitor.createSkeleton(arenaType=arenaType, guiType=guiType, bonusType=bonusType) return
def __init__(self, arenaTypeID=0, guiType=ARENA_GUI_TYPE.UNKNOWN, bonusType=ARENA_BONUS_TYPE.UNKNOWN, winnerTeam=0, finishReason=FINISH_REASON.UNKNOWN, bots=None, **kwargs): super(CommonInfo, self).__init__() self.__arenaTypeID = arenaTypeID self.__winnerTeam = winnerTeam self.__finishReason = finishReason self.__bots = defaultdict(lambda: _BotInfo(0, '')) if bots is not None: for vehicleID, info in bots.iteritems(): if len(info) > 1: self.__bots[vehicleID] = _BotInfo(*info[:2]) else: LOG_ERROR('Bot information can not be unpacked', info) break if self.__arenaTypeID and self.__arenaTypeID in ArenaType.g_cache: arenaType = ArenaType.g_cache[self.__arenaTypeID] else: arenaType = None self.__arenaVisitor = arena_visitor.createSkeleton(arenaType=arenaType, guiType=guiType, bonusType=bonusType) return
def __init__(self): super(BattleSessionProvider, self).__init__() self.__ctx = BattleContext() self.__sharedRepo = controllers.SharedControllersLocator() self.__dynamicRepo = controllers.DynamicControllersLocator() self.__requestsCtrl = None self.__arenaDP = None self.__arenaVisitor = arena_visitor.createSkeleton() self.__arenaListeners = None self.__viewComponentsBridge = None self.__invitations = None self.__isReplayPlaying = False return
def __init__(self): super(BattleSessionProvider, self).__init__() self.__ctx = BattleContext() self.__sharedRepo = controllers.SharedControllersLocator() self.__dynamicRepo = controllers.DynamicControllersLocator() self.__requestsCtrl = None self.__arenaDP = None self.__arenaVisitor = arena_visitor.createSkeleton() self.__arenaListeners = None self.__viewComponentsBridge = None self.__invitations = None self.__isReplayPlaying = False return
def __init__(self): super(BattleSessionProvider, self).__init__() self.__ctx = BattleContext() self.__sharedRepo = controllers.SharedControllersLocator() self.__dynamicRepo = controllers.DynamicControllersLocator() self.__requestsCtrl = None self.__arenaDP = None self.__arenaVisitor = arena_visitor.createSkeleton() self.__arenaListeners = None self.__viewComponentsBridge = None self.__invitations = None self.__isReplayPlaying = False self.__battleCache = BattleClientCache() self.onBattleSessionStart = Event.Event() self.onBattleSessionStop = Event.Event() self.onUpdateObservedVehicleData = Event.Event() return
def stop(self): g_playerEvents.onBattleResultsReceived -= self.__pe_onBattleResultsReceived if self.__viewComponentsBridge is not None: self.__viewComponentsBridge.clear() self.__viewComponentsBridge = None if self.__invitations is not None: self.__invitations.clear() self.__invitations = None if self.__requestsCtrl is not None: self.__requestsCtrl.fini() self.__requestsCtrl = None if self.__arenaListeners is not None: self.__arenaListeners.stop() self.__arenaListeners = None if self.__arenaDP is not None: self.__arenaDP.clear() self.__arenaDP = None self.__sharedRepo.destroy() self.__dynamicRepo.destroy() self.__arenaVisitor.clear() self.__arenaVisitor = arena_visitor.createSkeleton() self.__ctx.stop() return