def requestResults(self, ctx, callback=None): arenaUniqueID = ctx.getArenaUniqueID() if ctx.needToShowImmediately(): event_dispatcher.showBattleResultsWindow(arenaUniqueID) if not ctx.resetCache() and arenaUniqueID in self.__composers: isSuccess = True def dummy(callback=None): if callback is not None: callback(None) return yield dummy self.__notifyBattleResultsPosted( arenaUniqueID, needToShowUI=ctx.needToShowIfPosted()) else: results = yield BattleResultsGetter(arenaUniqueID).request() if not results.success and ctx.getArenaBonusType( ) == ARENA_BONUS_TYPE.MAPS_TRAINING: results = yield self.waitForBattleResults(arenaUniqueID) isSuccess = results.success if not isSuccess or not self.postResult(results.auxData, ctx.needToShowIfPosted()): self.__composers.pop(arenaUniqueID, None) event_dispatcher.hideBattleResults() if callback is not None: callback(isSuccess) return
def onShowResults(arenaUniqueID): return event_dispatcher.showBattleResultsWindow(arenaUniqueID)
def __notifyBattleResultsPosted(arenaUniqueID, needToShowUI=False): if needToShowUI: event_dispatcher.showBattleResultsWindow(arenaUniqueID) event_dispatcher.notifyBattleResultsPosted(arenaUniqueID)