コード例 #1
0
 def updateTrainingRoom(self, arena, roundLength, isPrivate, comment):
     settings = TrainingSettingsCtx()
     settings.setArenaTypeID(arena)
     settings.setRoundLen(roundLength * 60)
     settings.setOpened(not isPrivate)
     settings.setComment(comment)
     settings._isRequestToCreate = self.__isCreateRequest
     self.fireEvent(events.TrainingSettingsEvent(events.TrainingSettingsEvent.UPDATE_TRAINING_SETTINGS, ctx={'settings': settings}), scope=EVENT_BUS_SCOPE.LOBBY)
コード例 #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())
     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
コード例 #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())
     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
コード例 #6
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
コード例 #7
0
 def updateTrainingRoom(self, arena, roundLength, isPrivate, comment):
     if self.__isCreateRequest:
         settings = TrainingSettingsCtx(isRequestToCreate=True)
     else:
         settings = TrainingSettingsCtx(isRequestToCreate=False)
     settings.setArenaTypeID(arena)
     settings.setRoundLen(roundLength * 60)
     settings.setOpened(not isPrivate)
     settings.setComment(comment)
     self.fireEvent(events.TrainingSettingsEvent(
         events.TrainingSettingsEvent.UPDATE_TRAINING_SETTINGS,
         ctx={'settings': settings}),
                    scope=EVENT_BUS_SCOPE.LOBBY)