class ToontownUberRepository(ToontownInternalRepository):
    def __init__(self, baseChannel, serverId):
        ToontownInternalRepository.__init__(self, baseChannel, serverId, dcSuffix='UD')

        self.notify.setInfo(True)

    def handleConnected(self):
        ToontownInternalRepository.handleConnected(self)
        rootObj = DistributedDirectoryAI(self)
        rootObj.generateWithRequiredAndId(self.getGameDoId(), 0, 0)

        if config.GetBool('want-rpc-server', False):
            endpoint = config.GetString('rpc-server-endpoint', 'http://localhost:8080/')
            self.rpcServer = ToontownRPCServer(endpoint, ToontownRPCHandler(self))
            self.rpcServer.start(useTaskChain=True)

        self.backups = BackupManager.BackupManager(
            filepath=self.config.GetString('backups-filepath', 'backups/'),
            extension=self.config.GetString('backups-extension', '.json'))

        self.createGlobals()
        self.notify.info('Done.')

    def createGlobals(self):
        """
        Create "global" objects.
        """

        self.csm = simbase.air.generateGlobalObject(OTP_DO_ID_CLIENT_SERVICES_MANAGER, 'ClientServicesManager')
        self.chatAgent = simbase.air.generateGlobalObject(OTP_DO_ID_CHAT_MANAGER, 'ChatAgent')
        self.friendsManager = simbase.air.generateGlobalObject(OTP_DO_ID_ttcy_FRIENDS_MANAGER, 'ttcyFriendsManager')
        self.globalPartyMgr = simbase.air.generateGlobalObject(OTP_DO_ID_GLOBAL_PARTY_MANAGER, 'GlobalPartyManager')
        self.groupManager = simbase.air.generateGlobalObject(OPT_DO_ID_GROUP_MANAGER, 'GroupManager')
        self.megaInvasionManager = simbase.air.generateGlobalObject(
            OTP_DO_ID_MEGA_INVASION_MANAGER, 'MegaInvasionManager')
class ToontownUberRepository(ToontownInternalRepository):
    def __init__(self, baseChannel, serverId):
        ToontownInternalRepository.__init__(self,
                                            baseChannel,
                                            serverId,
                                            dcSuffix='UD')

        self.notify.setInfo(True)

    def handleConnected(self):
        ToontownInternalRepository.handleConnected(self)
        rootObj = DistributedDirectoryAI(self)
        rootObj.generateWithRequiredAndId(self.getGameDoId(), 0, 0)

        if config.GetBool('want-rpc-server', False):
            endpoint = config.GetString('rpc-server-endpoint',
                                        'http://localhost:8080/')
            self.rpcServer = ToontownRPCServer(endpoint,
                                               ToontownRPCHandler(self))
            self.rpcServer.start(useTaskChain=True)

        self.backups = BackupManager.BackupManager(
            filepath=self.config.GetString('backups-filepath', 'backups/'),
            extension=self.config.GetString('backups-extension', '.json'))

        self.createGlobals()
        self.notify.info('Done.')

    def createGlobals(self):
        """
        Create "global" objects.
        """

        self.csm = simbase.air.generateGlobalObject(
            OTP_DO_ID_CLIENT_SERVICES_MANAGER, 'ClientServicesManager')
        self.chatAgent = simbase.air.generateGlobalObject(
            OTP_DO_ID_CHAT_MANAGER, 'ChatAgent')
        self.friendsManager = simbase.air.generateGlobalObject(
            OTP_DO_ID_ttcy_FRIENDS_MANAGER, 'ttcyFriendsManager')
        self.globalPartyMgr = simbase.air.generateGlobalObject(
            OTP_DO_ID_GLOBAL_PARTY_MANAGER, 'GlobalPartyManager')
        self.groupManager = simbase.air.generateGlobalObject(
            OPT_DO_ID_GROUP_MANAGER, 'GroupManager')
        self.megaInvasionManager = simbase.air.generateGlobalObject(
            OTP_DO_ID_MEGA_INVASION_MANAGER, 'MegaInvasionManager')
    def handleConnected(self):
        ToontownInternalRepository.handleConnected(self)
        rootObj = DistributedDirectoryAI(self)
        rootObj.generateWithRequiredAndId(self.getGameDoId(), 0, 0)

        if config.GetBool('want-rpc-server', False):
            endpoint = config.GetString('rpc-server-endpoint',
                                        'http://localhost:8080/')
            self.rpcServer = ToontownRPCServer(endpoint,
                                               ToontownRPCHandler(self))
            self.rpcServer.start(useTaskChain=True)

        self.backups = BackupManager.BackupManager(
            filepath=self.config.GetString('backups-filepath', 'backups/'),
            extension=self.config.GetString('backups-extension', '.json'))

        self.createGlobals()
        self.notify.info('Done.')
    def handleConnected(self):
        ToontownInternalRepository.handleConnected(self)
        rootObj = DistributedDirectoryAI(self)
        rootObj.generateWithRequiredAndId(self.getGameDoId(), 0, 0)

        if config.GetBool('want-rpc-server', False):
            endpoint = config.GetString('rpc-server-endpoint', 'http://localhost:8080/')
            self.rpcServer = ToontownRPCServer(endpoint, ToontownRPCHandler(self))
            self.rpcServer.start(useTaskChain=True)

        self.backups = BackupManager.BackupManager(
            filepath=self.config.GetString('backups-filepath', 'backups/'),
            extension=self.config.GetString('backups-extension', '.json'))

        self.createGlobals()
        self.notify.info('Done.')