Exemplo n.º 1
0
 def postResult(self, result, needToShowUI=True):
     reusableInfo = reusable.createReusableInfo(result)
     if reusableInfo is None:
         SystemMessages.pushI18nMessage(BATTLE_RESULTS.NODATA, type=SystemMessages.SM_TYPE.Warning)
         return False
     else:
         arenaUniqueID = reusableInfo.arenaUniqueID
         reusableInfo.premiumState = self.__makePremiumState(arenaUniqueID)
         reusableInfo.clientIndex = self.lobbyContext.getClientIDByArenaUniqueID(arenaUniqueID)
         composerObj = composer.createComposer(reusableInfo)
         composerObj.setResults(result, reusableInfo)
         self.__composers[arenaUniqueID] = composerObj
         self.onResultPosted(reusableInfo, composerObj)
         self.__notifyBattleResultsPosted(arenaUniqueID, needToShowUI=needToShowUI)
         return True
 def __updateComposer(self, arenaUniqueID, xpBonusData, callback):
     results = yield BattleResultsGetter(arenaUniqueID).request()
     if results.success:
         result = results.auxData
         reusableInfo = reusable.createReusableInfo(result)
         if reusableInfo is None:
             SystemMessages.pushI18nMessage(
                 BATTLE_RESULTS.NODATA, type=SystemMessages.SM_TYPE.Warning)
             callback(False)
         self.__updateReusableInfo(reusableInfo, xpBonusData)
         arenaUniqueID = reusableInfo.arenaUniqueID
         composerObj = composer.createComposer(reusableInfo)
         composerObj.setResults(result, reusableInfo)
         self.__composers[arenaUniqueID] = composerObj
     callback(True)
     return
Exemplo n.º 3
0
 def postResult(self, result, needToShowUI=True):
     reusableInfo = reusable.createReusableInfo(result)
     if reusableInfo is None:
         SystemMessages.pushI18nMessage(BATTLE_RESULTS.NODATA, type=SystemMessages.SM_TYPE.Warning)
         return False
     else:
         self.__updateReusableInfo(reusableInfo)
         self.__updateBattlePassInfo(reusableInfo)
         arenaUniqueID = reusableInfo.arenaUniqueID
         composerObj = composer.createComposer(reusableInfo)
         composerObj.setResults(result, reusableInfo)
         self.__composers[arenaUniqueID] = composerObj
         resultsWindow = self.__notifyBattleResultsPosted(arenaUniqueID, needToShowUI=needToShowUI)
         self.onResultPosted(reusableInfo, composerObj, resultsWindow)
         self.__postStatistics(reusableInfo, result)
         return True