예제 #1
0
 def _addMoneyResults(self, connector, results):
     if 'creditsReplay' in results and results['creditsReplay'] is not None:
         replay = ValueReplay(connector,
                              recordName='credits',
                              replay=results['creditsReplay'])
         if 'appliedPremiumCreditsFactor10' in replay:
             replay[
                 'appliedPremiumCreditsFactor10'] = FACTOR_VALUE.BASE_CREDITS_FACTOR
         self._baseCredits.addRecords(
             _CreditsReplayRecords(replay, results['originalCreditsToDraw'],
                                   results['achievementCredits']))
         if 'appliedPremiumCreditsFactor10' in replay:
             replay[
                 'appliedPremiumCreditsFactor10'] = FACTOR_VALUE.PREMUIM_CREDITS_FACTOR
         self._premiumCredits.addRecords(
             _CreditsReplayRecords(replay, results['originalCreditsToDraw'],
                                   results['achievementCredits']))
     else:
         LOG_ERROR('Credits replay is not found', results)
     if 'goldReplay' in results and results['goldReplay'] is not None:
         replay = ValueReplay(connector,
                              recordName='gold',
                              replay=results['goldReplay'])
         self._goldRecords.addRecords(records.ReplayRecords(replay, 'gold'))
     else:
         LOG_ERROR('Gold replay is not found', results)
     self._autoRecords.addRecords(_AutoCompletionRecords(results))
     return
예제 #2
0
 def _addMoneyResults(self, connector, results):
     if 'creditsReplay' in results and results['creditsReplay'] is not None:
         replay = ValueReplay(connector,
                              recordName='credits',
                              replay=results['creditsReplay'])
         appliedPremiumCreditsFactor100Exists = 'appliedPremiumCreditsFactor100' in replay
         if appliedPremiumCreditsFactor100Exists:
             replay[
                 'appliedPremiumCreditsFactor100'] = FACTOR_VALUE.BASE_CREDITS_FACTOR
         self._baseCredits.addRecords(
             self.__buildCreditsReplayForPremType(PREMIUM_TYPE.NONE,
                                                  results, replay))
         if appliedPremiumCreditsFactor100Exists:
             replay['appliedPremiumCreditsFactor100'] = results[
                 'premiumCreditsFactor100']
         self._premiumCredits.addRecords(
             self.__buildCreditsReplayForPremType(PREMIUM_TYPE.BASIC,
                                                  results, replay))
         if appliedPremiumCreditsFactor100Exists:
             replay['appliedPremiumCreditsFactor100'] = results[
                 'premiumPlusCreditsFactor100']
         self._premiumPlusCredits.addRecords(
             self.__buildCreditsReplayForPremType(PREMIUM_TYPE.PLUS,
                                                  results, replay))
     else:
         LOG_ERROR('Credits replay is not found', results)
     if 'goldReplay' in results and results['goldReplay'] is not None:
         replay = ValueReplay(connector,
                              recordName='gold',
                              replay=results['goldReplay'])
         self._goldRecords.addRecords(records.ReplayRecords(replay, 'gold'))
     else:
         LOG_ERROR('Gold replay is not found', results)
     self._additionalRecords.addRecords(_AdditionalRecords(results))
     return
예제 #3
0
 def _addCrystalResults(self, connector, results):
     if Currency.CRYSTAL in results and results[Currency.CRYSTAL] is not None:
         replay = ValueReplay(connector, recordName=Currency.CRYSTAL, replay=results['crystalReplay'])
         self._crystal.addRecords(records.ReplayRecords(replay, Currency.CRYSTAL))
         self._addCrystalDetails(replay)
     else:
         LOG_ERROR('crystal replay is not found', results)
     return