コード例 #1
0
 def getInfo(self):
     settings = TrainingSettingsCtx()
     if not self.__isCreateRequest:
         settings = settings.fetch(self.prbFunctional.getSettings())
     if g_itemsCache.isSynced():
         accountAttrs = g_itemsCache.items.stats.attributes
     else:
         accountAttrs = 0
     _, maxBound = getTrainingBattleRoundLimits(accountAttrs)
     info = {
         "description": settings.getComment(),
         "timeout": settings.getRoundLen() / 60,
         "arena": settings.getArenaTypeID(),
         "privacy": not settings.isOpened(),
         "create": self.__isCreateRequest,
         "canMakeOpenedClosed": True,
         "canChangeComment": True,
         "canChangeArena": True,
         "maxBattleTime": maxBound / 60,
     }
     if not self.__isCreateRequest:
         permissions = self.prbFunctional.getPermissions()
         info["canMakeOpenedClosed"] = permissions.canMakeOpenedClosed()
         info["canChangeComment"] = permissions.canChangeComment()
         info["canChangeArena"] = permissions.canChangeArena()
     return info
コード例 #2
0
 def getInfo(self):
     settings = TrainingSettingsCtx()
     if not self.__isCreateRequest:
         settings = settings.fetch(self.prbFunctional.getSettings())
     if g_itemsCache.isSynced():
         accountAttrs = g_itemsCache.items.stats.attributes
     else:
         accountAttrs = 0
     _, maxBound = getTrainingBattleRoundLimits(accountAttrs)
     info = {
         'description': settings.getComment(),
         'timeout': settings.getRoundLen() / 60,
         'arena': settings.getArenaTypeID(),
         'privacy': not settings.isOpened(),
         'create': self.__isCreateRequest,
         'canMakeOpenedClosed': True,
         'canChangeComment': True,
         'canChangeArena': True,
         'maxBattleTime': maxBound / 60
     }
     if not self.__isCreateRequest:
         permissions = self.prbFunctional.getPermissions()
         info['canMakeOpenedClosed'] = permissions.canMakeOpenedClosed()
         info['canChangeComment'] = permissions.canChangeComment()
         info['canChangeArena'] = permissions.canChangeArena()
     return info
コード例 #3
0
 def getInfo(self):
     settings = TrainingSettingsCtx()
     if not self.__isCreateRequest:
         settings = settings.fetch(self.prbFunctional.getSettings())
     info = {'description': settings.getComment(),
      'timeout': settings.getRoundLen() / 60,
      'arena': settings.getArenaTypeID(),
      'privacy': not settings.isOpened(),
      'create': self.__isCreateRequest,
      'canMakeOpenedClosed': True,
      'canChangeComment': True,
      'canChangeArena': True}
     if not self.__isCreateRequest:
         permissions = self.prbFunctional.getPermissions()
         info['canMakeOpenedClosed'] = permissions.canMakeOpenedClosed()
         info['canChangeComment'] = permissions.canChangeComment()
         info['canChangeArena'] = permissions.canChangeArena()
     return info
コード例 #4
0
 def getInfo(self):
     settings = TrainingSettingsCtx()
     if not self.__isCreateRequest:
         settings = settings.fetch(self.prbFunctional.getSettings())
     info = {
         'description': settings.getComment(),
         'timeout': settings.getRoundLen() / 60,
         'arena': settings.getArenaTypeID(),
         'privacy': not settings.isOpened(),
         'create': self.__isCreateRequest,
         'canMakeOpenedClosed': True,
         'canChangeComment': True,
         'canChangeArena': True
     }
     if not self.__isCreateRequest:
         permissions = self.prbFunctional.getPermissions()
         info['canMakeOpenedClosed'] = permissions.canMakeOpenedClosed()
         info['canChangeComment'] = permissions.canChangeComment()
         info['canChangeArena'] = permissions.canChangeArena()
     return info
コード例 #5
0
 def getInfo(self):
     settings = TrainingSettingsCtx()
     if not self.__isCreateRequest:
         settings = settings.fetch(self.prbFunctional.getSettings())
     if g_itemsCache.isSynced():
         accountAttrs = g_itemsCache.items.stats.attributes
     else:
         accountAttrs = 0
     _, maxBound = getTrainingBattleRoundLimits(accountAttrs)
     info = {'description': settings.getComment(),
      'timeout': settings.getRoundLen() / 60,
      'arena': settings.getArenaTypeID(),
      'privacy': not settings.isOpened(),
      'create': self.__isCreateRequest,
      'canMakeOpenedClosed': True,
      'canChangeComment': True,
      'canChangeArena': True,
      'maxBattleTime': maxBound / 60}
     if not self.__isCreateRequest:
         permissions = self.prbFunctional.getPermissions()
         info['canMakeOpenedClosed'] = permissions.canMakeOpenedClosed()
         info['canChangeComment'] = permissions.canChangeComment()
         info['canChangeArena'] = permissions.canChangeArena()
     return info