def __init__(self, baseChannel, stateServerChannel, districtName):
        ToontownInternalRepository.__init__(
            self, baseChannel, stateServerChannel, dcSuffix='AI')

        self.districtName = districtName

        self.notify.setInfo(True)  # Our AI repository should always log info.
        self.hoods = []
        self.cogHeadquarters = []
        self.dnaStoreMap = {}
        self.dnaDataMap = {}
        self.suitPlanners = {}
        self.buildingManagers = {}
        self.factoryMgr = None
        self.mintMgr = None
        self.lawOfficeMgr = None
        self.countryClubMgr = None

        self.zoneAllocator = UniqueIdAllocator(ToontownGlobals.DynamicZonesBegin,
                                               ToontownGlobals.DynamicZonesEnd)
        self.zoneDataStore = AIZoneDataStore()

        self.wantFishing = self.config.GetBool('want-fishing', True)
        self.wantHousing = self.config.GetBool('want-housing', True)
        self.wantPets = self.config.GetBool('want-pets', True)
        self.wantParties = self.config.GetBool('want-parties', True)
        self.wantCogbuildings = self.config.GetBool('want-cogbuildings', True)
        self.wantCogdominiums = self.config.GetBool('want-cogdominiums', True)
        self.doLiveUpdates = self.config.GetBool('want-live-updates', False)
        self.wantTrackClsends = self.config.GetBool('want-track-clsends', False)
        self.wantAchievements = self.config.GetBool('want-achievements', True)
    def handleConnected(self):
        self.notify.info('Yarn. Waking up (This may take a while!).')
        ToontownInternalRepository.handleConnected(self)
        self.districtId = self.allocateChannel()
        self.distributedDistrict = ToontownDistrictAI(self)
        self.distributedDistrict.setName(self.districtName)
        self.distributedDistrict.generateWithRequiredAndId(
            self.districtId, self.getGameDoId(), 2)

        # Claim ownership of that district...
        dg = PyDatagram()
        dg.addServerHeader(
            self.districtId,
            self.ourChannel,
            STATESERVER_OBJECT_SET_AI)
        dg.addChannel(self.ourChannel)
        self.send(dg)

        self.notify.info('Creating Global Managers')
        self.createGlobals()
        self.notify.info('Creating Toontown')
        self.createZones()

        self.statusSender.start()

        self.distributedDistrict.b_setAvailable(1)
        self.notify.info('District is now ready.')
 def __init__(self, baseChannel, serverId, districtName):
     ToontownInternalRepository.__init__(self, baseChannel, serverId, dcSuffix='AI')
     self.districtName = districtName
     self.doLiveUpdates = config.GetBool('want-live-updates', True)
     self.wantCogdominiums = config.GetBool('want-cogdominiums', True)
     self.districtId = None
     self.district = None
     self.districtStats = None
     self.holidayManager = None
     self.zoneDataStore = None
     self.petMgr = None
     self.suitInvasionManager = None
     self.questManager = None
     self.promotionMgr = None
     self.cogPageManager = None
     self.raceMgr = None
     self.timeManager = None
     self.newsManager = None
     self.welcomeValleyManager = None
     self.inGameNewsMgr = None
     self.catalogManager = None
     self.trophyMgr = None
     self.zoneTable = {}
     self.dnaStoreMap = {}
     self.dnaDataMap = {}
     self.hoods = []
     self.buildingManagers = {}
     self.suitPlanners = {}
Exemplo n.º 4
0
    def handleConnected(self):
        ToontownInternalRepository.handleConnected(self)

        # Generate our district...
        self.districtId = self.allocateChannel()
        self.district = ToontownDistrictAI(self)
        self.district.setName(self.districtName)
        self.district.generateWithRequiredAndId(self.districtId,
                                                self.getGameDoId(),
                                                OTP_ZONE_ID_DISTRICTS)

        # Claim ownership of that district...
        self.district.setAI(self.ourChannel)

        # Create our local objects.
        self.createLocals()

        # Create our global objects.
        self.createGlobals()

        # Create our zones.
        self.createZones()

        # Make our district available, and we're done.
        self.district.b_setAvailable(True)
        self.notify.info('Done.')
Exemplo n.º 5
0
    def __init__(self, baseChannel, stateServerChannel, districtName):
        ToontownInternalRepository.__init__(
            self, baseChannel, stateServerChannel, dcSuffix='AI')

        self.districtName = districtName

        self.notify.setInfo(True)  # Our AI repository should always log info.
        self.hoods = []
        self.cogHeadquarters = []
        self.dnaStoreMap = {}
        self.dnaDataMap = {}
        self.suitPlanners = {}
        self.buildingManagers = {}
        self.factoryMgr = None
        self.mintMgr = None
        self.lawOfficeMgr = None
        self.countryClubMgr = None

        self.zoneAllocator = UniqueIdAllocator(ToontownGlobals.DynamicZonesBegin,
                                               ToontownGlobals.DynamicZonesEnd)
        self.zoneDataStore = AIZoneDataStore()

        self.wantFishing = self.config.GetBool('want-fishing', True)
        self.wantHousing = self.config.GetBool('want-housing', True)
        self.wantPets = self.config.GetBool('want-pets', True)
        self.wantParties = self.config.GetBool('want-parties', True)
        self.wantCogbuildings = self.config.GetBool('want-cogbuildings', True)
        self.wantCogdominiums = self.config.GetBool('want-cogdominiums', True)
        self.doLiveUpdates = self.config.GetBool('want-live-updates', False)
        self.wantTrackClsends = self.config.GetBool('want-track-clsends', False)
        self.baseXpMultiplier = self.config.GetFloat('base-xp-multiplier', 1.0)
        self.wantHalloween = self.config.GetBool('want-halloween', False)
        self.wantChristmas = self.config.GetBool('want-christmas', False)

        self.cogSuitMessageSent = False
 def __init__(self, baseChannel, serverId):
     ToontownInternalRepository.__init__(self,
                                         baseChannel,
                                         serverId,
                                         dcSuffix='UD')
     self.__loader = DNALoader.DNALoader()
     self.__dnaMap = {}
 def handleConnected(self):
     ToontownInternalRepository.handleConnected(self)
     if config.GetBool('want-ClientServicesManagerUD', self.wantUD):
         # Only generate the root object once, with the CSMUD.
         rootObj = DistributedDirectoryAI(self)
         rootObj.generateWithRequiredAndId(self.getGameDoId(), 0, 0)
     self.createGlobals()
Exemplo n.º 8
0
    def handleConnected(self):
        self.notify.info('Yarn. Waking up (This may take a while!).')
        ToontownInternalRepository.handleConnected(self)
        self.districtId = self.allocateChannel()
        self.distributedDistrict = ToontownDistrictAI(self)
        self.distributedDistrict.setName(self.districtName)
        self.distributedDistrict.generateWithRequiredAndId(
            self.districtId, self.getGameDoId(), 2)

        # Claim ownership of that district...
        dg = PyDatagram()
        dg.addServerHeader(self.districtId, self.ourChannel,
                           STATESERVER_OBJECT_SET_AI)
        dg.addChannel(self.ourChannel)
        self.send(dg)

        self.notify.info('Creating Global Managers')
        self.createGlobals()
        self.notify.info('Creating Toontown')
        self.createZones()

        self.statusSender.start()

        self.distributedDistrict.b_setAvailable(1)
        self.notify.info('District is now ready.')
    def __init__(self, baseChannel, stateServerChannel, districtName):
        ToontownInternalRepository.__init__(
            self, baseChannel, stateServerChannel, dcSuffix='AI')

        self.districtName = districtName

        self.notify.setInfo(True)  # Our AI repository should always log info.
        self.hoods = []
        self.cogHeadquarters = []
        self.dnaStoreMap = {}
        self.dnaDataMap = {}
        self.suitPlanners = {}
        self.buildingManagers = {}
        self.factoryMgr = None
        self.mintMgr = None
        self.lawOfficeMgr = None
        self.countryClubMgr = None

        self.zoneAllocator = UniqueIdAllocator(ToontownGlobals.DynamicZonesBegin,
                                               ToontownGlobals.DynamicZonesEnd)
        self.zoneDataStore = AIZoneDataStore()

        self.wantFishing = self.config.GetBool('want-fishing', True)
        self.wantHousing = self.config.GetBool('want-housing', True)
        self.wantPets = self.config.GetBool('want-pets', True)
        self.wantKarts = self.config.GetBool('want-karts', True)
        self.wantParties = self.config.GetBool('want-parties', True)
        self.wantEmblems = self.config.GetBool('want-emblems', True)
        self.wantCogbuildings = self.config.GetBool('want-cogbuildings', True)
        self.wantCogdominiums = self.config.GetBool('want-cogdominiums', True)
        self.wantTrackClsends = self.config.GetBool('want-track-clsends', False)
        self.wantTopToons = self.config.GetBool('want-top-toons', True)
        self.baseXpMultiplier = self.config.GetFloat('base-xp-multiplier', 1.0)

        self.cogSuitMessageSent = False
    def __init__(self, baseChannel, serverId):
        ToontownInternalRepository.__init__(self,
                                            baseChannel,
                                            serverId,
                                            dcSuffix='UD')

        self.notify.setInfo(True)
Exemplo n.º 11
0
 def handleConnected(self):
     ToontownInternalRepository.handleConnected(self)
     if config.GetBool('want-ClientServicesManagerUD', self.wantUD):
         rootObj = DistributedDirectoryAI(self)
         rootObj.generateWithRequiredAndId(self.getGameDoId(), 0, 0)
     self.createGlobals()
     self.notify.info('UberDOG has successfully initialized.')
Exemplo n.º 12
0
 def handleConnected(self):
     ToontownInternalRepository.handleConnected(self)
     self.districtId = self.allocateChannel()
     self.notify.info('Creating district (%d)...' % self.districtId)
     self.district = ToontownDistrictAI(self)
     self.district.setName(self.districtName)
     self.district.setDescription(self.districtDescription)
     self.district.generateWithRequiredAndId(self.districtId,
                                             self.getGameDoId(),
                                             OTP_ZONE_ID_MANAGEMENT)
     self.notify.info('Claiming ownership of district (%d)...' %
                      self.districtId)
     datagram = PyDatagram()
     datagram.addServerHeader(self.districtId, self.ourChannel,
                              STATESERVER_OBJECT_SET_AI)
     datagram.addChannel(self.ourChannel)
     self.send(datagram)
     self.notify.info('Creating local objects...')
     self.createLocals()
     self.notify.info('Creating global objects...')
     self.createGlobals()
     self.notify.info('Creating zones (Playgrounds and Cog HQs)...')
     self.createZones()
     self.notify.info('Making district available...')
     self.district.b_setAvailable(1)
     self.notify.info(
         'District is now ready. Have fun in Toontown Offline!')
Exemplo n.º 13
0
 def handleConnected(self):
     ToontownInternalRepository.handleConnected(self)
     if config.GetBool('want-ClientServicesManagerUD', self.wantUD):
         # Only generate the root object once, with the CSMUD.
         rootObj = DistributedDirectoryAI(self)
         rootObj.generateWithRequiredAndId(self.getGameDoId(), 0, 0)
     self.createGlobals()
Exemplo n.º 14
0
 def __init__(self, baseChannel, serverId):
     ToontownInternalRepository.__init__(self,
                                         baseChannel,
                                         serverId,
                                         dcSuffix='UD')
     self.wantUD = config.GetBool('want-ud', True)
     self.adminAccess = 0
    def handleConnected(self):
        ToontownInternalRepository.handleConnected(self)
        self.districtId = self.allocateChannel()
        self.notify.info('Creating new district (%d)...' % self.districtId)
        self.distributedDistrict = ToontownDistrictAI(self)
        self.distributedDistrict.setName(self.districtName)
        self.distributedDistrict.generateWithRequiredAndId(
            self.districtId, self.getGameDoId(), 2)

        # Claim ownership of that district...
        self.notify.info('Claiming ownership of district (%d)...' %
                         self.districtId)
        dg = PyDatagram()
        dg.addServerHeader(self.districtId, self.ourChannel,
                           STATESERVER_OBJECT_SET_AI)
        dg.addChannel(self.ourChannel)
        self.send(dg)
        self.notify.info('Creating global objects...')
        self.createGlobals()
        self.notify.info('Creating zones (Playgrounds and Cog HQs)...')
        self.createZones()

        self.statusSender.start()
        self.notify.info('Making district available to enter...')
        self.distributedDistrict.b_setAvailable(1)
        self.notify.info('District is now ready. Have fun in Toontown!')
Exemplo n.º 16
0
    def __init__(self, baseChannel, serverId):
        ToontownInternalRepository.__init__(self,
                                            baseChannel,
                                            serverId,
                                            dcSuffix='UD')

        self.notify.setInfo(True)
        self.wantTopToons = self.config.GetBool('want-top-toons', True)
    def __init__(self, baseChannel, serverId, districtName):
        ToontownInternalRepository.__init__(self,
                                            baseChannel,
                                            serverId,
                                            dcSuffix='AI')

        self.districtName = districtName

        self.zoneAllocator = UniqueIdAllocator(
            ToontownGlobals.DynamicZonesBegin, ToontownGlobals.DynamicZonesEnd)
        self.zoneId2owner = {}

        NPCToons.generateZone2NpcDict()

        self.hoods = []
        self.zoneDataStore = AIZoneDataStore()
        self.dnaStoreMap = {}
        self.dnaDataMap = {}

        self.currentHour = 0
        self.isRaining = False

        self.useAllMinigames = self.config.GetBool('want-all-minigames', False)
        self.doLiveUpdates = self.config.GetBool('want-live-updates', True)
        self.wantFishing = self.config.GetBool('want-fishing', True)
        self.wantHousing = self.config.GetBool('want-housing', True)
        self.wantPets = self.config.GetBool('want-pets', True)
        self.wantParties = self.config.GetBool('want-parties', True)
        self.wantCogbuildings = self.config.GetBool('want-cogbuildings', True)
        self.wantCogdominiums = self.config.GetBool('want-cogdominiums', True)
        self.doLiveUpdates = self.config.GetBool('want-live-updates', False)
        self.wantTrackClsends = self.config.GetBool('want-track-clsends',
                                                    False)
        self.baseXpMultiplier = self.config.GetFloat('base-xp-multiplier', 1.0)
        self.wantHalloween = self.config.GetBool('want-halloween', False)
        self.wantChristmas = self.config.GetBool('want-christmas', False)

        self.holidayManager = HolidayManagerAI(self)

        self.fishManager = FishManagerAI()
        self.questManager = QuestManagerAI(self)
        self.cogPageManager = CogPageManagerAI()
        self.factoryMgr = FactoryManagerAI(self)
        self.mintMgr = MintManagerAI(self)
        self.lawOfficeMgr = LawOfficeManagerAI(self)
        self.countryClubMgr = CountryClubManagerAI(self)
        self.promotionMgr = PromotionManagerAI(self)
        self.cogSuitMgr = CogSuitManagerAI(self)
        self.suitInvasionManager = SuitInvasionManagerAI(self)
        self.wantCogdominiums = self.config.GetBool('want-cogdominums', False)
        self.temperatureManager = TemperatureManagerAI(self)

        self.statusSender = ShardStatusSender(self)

        self.dnaStoreMap = {}

        self.buildingManagers = {}
        self.suitPlanners = {}
Exemplo n.º 18
0
 def __init__(self, baseChannel, serverId):
     ToontownInternalRepository.__init__(self,
                                         baseChannel,
                                         serverId,
                                         dcSuffix='UD')
     self.gameServicesManager = None
     self.ttoffFriendsManager = None
     self.chatManager = None
     self.deliveryManager = None
Exemplo n.º 19
0
    def handleConnected(self):
        ToontownInternalRepository.handleConnected(self)

        rootObj = DistributedDirectoryAI(self)
        rootObj.generateWithRequiredAndId(self.getGameDoId(), 0, 0)

        self.createGlobals()

        self.notify.info('Done.')
Exemplo n.º 20
0
    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.createGlobals()
        self.notify.info('Done.')
Exemplo n.º 21
0
 def __init__(self, baseChannel, serverId, districtName):
     ToontownInternalRepository.__init__(self,
                                         baseChannel,
                                         serverId,
                                         dcSuffix='AI')
     self.districtName = districtName
     self.doLiveUpdates = self.config.GetBool('want-live-updates', True)
     self.wantCogdominiums = self.config.GetBool('want-cogdominiums', True)
     self.wantEmblems = self.config.GetBool('want-emblems', True)
     self.useAllMinigames = self.config.GetBool('want-all-minigames', True)
     self.districtId = None
     self.district = None
     self.districtStats = None
     self.timeManager = None
     self.newsManager = None
     self.holidayManager = None
     self.welcomeValleyManager = None
     self.catalogManager = None
     self.zoneDataStore = None
     self.inGameNewsMgr = None
     self.trophyMgr = None
     self.petMgr = None
     self.dnaStoreMap = {}
     self.dnaDataMap = {}
     self.zoneTable = {}
     self.hoods = []
     self.buildingManagers = {}
     self.suitPlanners = {}
     self.suitInvasionManager = None
     self.zoneAllocator = None
     self.zoneId2owner = {}
     self.questManager = None
     self.cogPageManager = None
     self.fishManager = None
     self.factoryMgr = None
     self.mintMgr = None
     self.lawMgr = None
     self.countryClubMgr = None
     self.promotionMgr = None
     self.cogSuitMgr = None
     self.partyManager = None
     self.safeZoneManager = None
     self.raceMgr = None
     self.polarPlaceEffectMgr = None
     self.resistanceEmoteMgr = None
     self.tutorialManager = None
     self.friendManager = None
     self.toontownTimeManager = None
     self.estateMgr = None
     self.magicWordManager = None
     self.deliveryManager = None
     self.defaultAccessLevel = OTPGlobals.accessLevelValues.get(
         'TTOFF_DEVELOPER')
Exemplo n.º 22
0
    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.createGlobals()
        self.notify.info('Done.')
    def __init__(self, baseChannel, serverId, districtName):
        ToontownInternalRepository.__init__(self,
                                            baseChannel,
                                            serverId,
                                            dcSuffix='AI')

        self.districtName = districtName

        self.zoneAllocator = UniqueIdAllocator(
            ToontownGlobals.DynamicZonesBegin, ToontownGlobals.DynamicZonesEnd)

        NPCToons.generateZone2NpcDict()

        self.use_libpandadna = simbase.config.GetBool('use-libpandadna', False)

        self.hoods = []
        self._dnaStoreMap = {}

        if self.use_libpandadna:
            self.__loader = DNALoader()

        self.zoneDataStore = AIZoneDataStore()

        self.useAllMinigames = self.config.GetBool('want-all-minigames', False)
        self.doLiveUpdates = True

        self.wantCogdominiums = self.config.GetBool('want-cogdo', False)
        self.wantParties = self.config.GetBool('want-parties', False)
        self.wantEmblems = self.config.GetBool('want-emblems', True)

        self.questManager = QuestManagerAI(self)
        self.promotionMgr = PromotionManagerAI(self)
        self.cogPageManager = CogPageManagerAI(self)
        self.cogSuitMgr = CogSuitManagerAI(self)

        self.trophyMgr = DistributedTrophyMgrAI(self)

        self.fishManager = FishManagerAI()

        self.dnaStoreMap = {}

        self.mintMgr = MintManagerAI.MintManagerAI(self)
        self.factoryMgr = FactoryManagerAI.FactoryManagerAI(self)
        self.lawMgr = LawOfficeManagerAI.LawOfficeManagerAI(self)
        self.countryClubMgr = CountryClubManagerAI.CountryClubManagerAI(self)

        self.buildingManagers = {}
        self.suitPlanners = {}

        self.wantMegaInvasions = str(
            self.ourChannel // 1000000) in self.config.GetString(
                'mega-invasion-shards', '402 403').split()
Exemplo n.º 24
0
    def handleConnected(self):
        ToontownInternalRepository.handleConnected(self)

        # Create our root object.
        self.notify.info('Creating root object (%d)...' % self.getGameDoId())
        rootObj = DistributedDirectoryAI(self)
        rootObj.generateWithRequiredAndId(self.getGameDoId(), 0, 0)

        # Create our global objects.
        self.notify.info('Creating global objects...')
        self.createGlobals()

        self.notify.info('UberDOG server is ready.')
Exemplo n.º 25
0
    def __init__(self, baseChannel, stateServerChannel, districtName, startTime=6):
        ToontownInternalRepository.__init__(self, baseChannel, stateServerChannel, dcSuffix='AI')
        self.districtName = districtName
        self.notify.setInfo(True)
        self.hoods = []
        self.hoodId2Hood = {}
        self.cogHeadquarters = []
        self.dnaStoreMap = {}
        self.dnaDataMap = {}
        self.suitPlanners = {}
        self.buildingManagers = {}
        self.sillyMeterMgr = None
        self.factoryMgr = None
        self.mintMgr = None
        self.lawOfficeMgr = None
        self.countryClubMgr = None
        self.boardofficeMgr = None
        self.startTime = startTime
        import pymongo
        self.isRaining = False
        self.betaEventTTC = None
        self.betaEventBDHQ = None
        self.invLastPop = None
        self.invLastStatus = None

        import pymongo

        # Mongo stuff to store seperate database things
        self.dbConn = pymongo.MongoClient(config.GetString('mongodb-url', 'localhost'))
        self.dbGlobalCursor = self.dbConn.altis
        self.dbCursor = self.dbGlobalCursor['air-%d' % self.ourChannel]
        self.zoneAllocator = UniqueIdAllocator(ToontownGlobals.DynamicZonesBegin,
                                               ToontownGlobals.DynamicZonesEnd)
        self.zoneDataStore = AIZoneDataStore()

        self.wantFishing = self.config.GetBool('want-fishing', True)
        self.wantHousing = self.config.GetBool('want-housing', True)
        self.wantPets = self.config.GetBool('want-pets', True)
        self.wantParties = self.config.GetBool('want-parties', True)
        self.wantCogbuildings = self.config.GetBool('want-cogbuildings', True)
        self.wantCogdominiums = self.config.GetBool('want-cogdominiums', True)
        self.doLiveUpdates = self.config.GetBool('want-live-updates', False)
        self.wantTrackClsends = self.config.GetBool('want-track-clsends', False)
        self.wantAchievements = self.config.GetBool('want-achievements', True)
        self.wantCharityScreen = self.config.GetBool('want-charity-screen', False)
        self.baseXpMultiplier = self.config.GetFloat('base-xp-multiplier', 1.0)
        self.wantHalloween = self.config.GetBool('want-halloween', False)
        self.wantChristmas = self.config.GetBool('want-christmas', False)
        self.wantGardening = self.config.GetBool('want-gardening', False)
        self.cogSuitMessageSent = False
        self.weatherCycleDuration = self.config.GetInt('weather-cycle-duration', 100)
Exemplo n.º 26
0
    def __init__(self, baseChannel, serverId):
        ToontownInternalRepository.__init__(self, baseChannel, serverId, dcSuffix='UD')

        if config.GetBool('want-mongo-client', False):
            url = config.GetString('mongodb-url', 'mongodb://localhost')
            replicaset = config.GetString('mongodb-replicaset', '')
            if replicaset:
                self.mongo = pymongo.MongoClient(url, replicaset=replicaset)
            else:
                self.mongo = pymongo.MongoClient(url)
            db = (urlparse.urlparse(url).path or '/test')[1:]
            self.mongodb = self.mongo[db]

        self.notify.setInfo(True)
Exemplo n.º 27
0
 def __init__(self, baseChannel, serverId):
     ToontownInternalRepository.__init__(self, baseChannel, serverId, dcSuffix='UD')
     self.rpcServer = None
     self.rpcClient = None
     if config.GetBool('want-mongo-client', False):
         url = config.GetString('mongodb-url', 'mongodb://localhost')
         replicaset = config.GetString('mongodb-replicaset', '')
         if replicaset:
             self.mongo = pymongo.MongoClient(url, replicaset=replicaset)
         else:
             self.mongo = pymongo.MongoClient(url)
         db = (urlparse.urlparse(url).path or '/test')[1:]
         self.mongodb = self.mongo[db]
     self.notify.setInfo(True)
Exemplo n.º 28
0
    def handleConnected(self):
        ToontownInternalRepository.handleConnected(self)
        self.notify.info(True)
        if config.GetBool('want-ClientServicesManagerUD', self.wantUD):
            self.notify.info('Creating ClientServicesManagerUD...')
            # Only generate the root object once, with the CSMUD.
            rootObj = DistributedDirectoryAI(self)
            rootObj.generateWithRequiredAndId(self.getGameDoId(), 0, 0)
        self.notify.info('Creating globals...')
        self.createGlobals()

        if config.GetBool('want-rpc-server', False):
            self.notify.info('Starting RPC server...')
            import ToontownRPCHandler
            self.rpcserver = RPCServer(ToontownRPCHandler(self))
        self.notify.info('Done.')
    def __init__(self, baseChannel, serverId, districtName):
        ToontownInternalRepository.__init__(self, baseChannel, serverId, dcSuffix='AI')

        self.districtName = districtName

        self.zoneAllocator = UniqueIdAllocator(ToontownGlobals.DynamicZonesBegin,
                                               ToontownGlobals.DynamicZonesEnd)

        NPCToons.generateZone2NpcDict()
        
        self.use_libpandadna = simbase.config.GetBool('use-libpandadna', False)
        
        self.hoods = []
        self._dnaStoreMap = {}
        
        if self.use_libpandadna:
            self.__loader = DNALoader()
        
        self.zoneDataStore = AIZoneDataStore()

        self.useAllMinigames = self.config.GetBool('want-all-minigames', False)
        self.doLiveUpdates = True
        
        self.wantCogdominiums = self.config.GetBool('want-cogdo', False)
        self.wantParties = self.config.GetBool('want-parties', False)
        self.wantEmblems = self.config.GetBool('want-emblems', True)
        
        self.questManager = QuestManagerAI(self)
        self.promotionMgr = PromotionManagerAI(self)
        self.cogPageManager = CogPageManagerAI(self)
        self.cogSuitMgr = CogSuitManagerAI(self)

        self.trophyMgr = DistributedTrophyMgrAI(self)
        
        self.fishManager = FishManagerAI()
		
        self.dnaStoreMap = {}
        
        self.mintMgr = MintManagerAI.MintManagerAI(self)
        self.factoryMgr = FactoryManagerAI.FactoryManagerAI(self)
        self.lawMgr = LawOfficeManagerAI.LawOfficeManagerAI(self)
        self.countryClubMgr = CountryClubManagerAI.CountryClubManagerAI(self)
        
        self.buildingManagers = {}
        self.suitPlanners = {}
        
        self.wantMegaInvasions = str(self.ourChannel // 1000000) in self.config.GetString('mega-invasion-shards', '402 403').split()            
Exemplo n.º 30
0
    def handleConnected(self):
        ToontownInternalRepository.handleConnected(self)
        self.notify.info(True)
        if config.GetBool("want-ClientServicesManagerUD", self.wantUD):
            self.notify.info("Creating ClientServicesManagerUD...")
            # Only generate the root object once, with the CSMUD.
            rootObj = DistributedDirectoryAI(self)
            rootObj.generateWithRequiredAndId(self.getGameDoId(), 0, 0)
        self.notify.info("Creating globals...")
        self.createGlobals()

        if config.GetBool("want-rpc-server", False):
            self.notify.info("Starting RPC server...")
            import ToontownRPCHandler

            self.rpcserver = RPCServer(ToontownRPCHandler(self))
        self.notify.info("Done.")
Exemplo n.º 31
0
    def __init__(self, baseChannel, serverId, districtName):
        ToontownInternalRepository.__init__(self,
                                            baseChannel,
                                            serverId,
                                            dcSuffix='AI')

        self.dnaSpawner = DNASpawnerAI(self)

        self.districtName = districtName

        self.notify.setInfo(True)  # Our AI repository should always log info.

        self.zoneAllocator = UniqueIdAllocator(
            ToontownGlobals.DynamicZonesBegin, ToontownGlobals.DynamicZonesEnd)
        self.zoneId2owner = {}

        NPCToons.generateZone2NpcDict()

        self.hoods = []
        self.zoneDataStore = AIZoneDataStore()

        self.useAllMinigames = self.config.GetBool('want-all-minigames', False)
        self.doLiveUpdates = self.config.GetBool('want-live-updates', True)

        self.holidayManager = HolidayManagerAI(self)

        self.fishManager = FishManagerAI()
        self.questManager = QuestManagerAI(self)
        self.cogPageManager = CogPageManagerAI()
        self.factoryMgr = FactoryManagerAI(self)
        self.mintMgr = MintManagerAI(self)
        self.lawOfficeMgr = LawOfficeManagerAI(self)
        self.countryClubMgr = CountryClubManagerAI(self)
        self.promotionMgr = PromotionManagerAI(self)
        self.cogSuitMgr = CogSuitManagerAI(self)
        self.suitInvasionManager = SuitInvasionManagerAI(self)

        self.statusSender = ShardStatusSender(self)

        self.dnaStoreMap = {}

        self.buildingManagers = {}
        self.suitPlanners = {}
    def __init__(self, baseChannel, serverId, districtName):
        ToontownInternalRepository.__init__(
            self, baseChannel, serverId, dcSuffix='AI')

        self.dnaSpawner = DNASpawnerAI(self)

        self.districtName = districtName

        self.zoneAllocator = UniqueIdAllocator(
            ToontownGlobals.DynamicZonesBegin,
            ToontownGlobals.DynamicZonesEnd)
        self.zoneId2owner = {}

        NPCToons.generateZone2NpcDict()

        self.hoods = []
        self.zoneDataStore = AIZoneDataStore()

        self.useAllMinigames = self.config.GetBool('want-all-minigames', False)
        self.doLiveUpdates = self.config.GetBool('want-live-updates', True)
        self.baseXpMultiplier = self.config.GetFloat('base-xp-multiplier', 1.0)
        self.wantHalloween = self.config.GetBool('want-halloween', False)
	self.wantChristmas = self.config.GetBool('want-christmas', False)
        self.holidayManager = HolidayManagerAI(self)
        if config.GetBool('want-pets', True):
            self.PetManager = PetManagerAI(self)
        self.fishManager = FishManagerAI()
        self.questManager = QuestManagerAI(self)
        self.cogPageManager = CogPageManagerAI()
        self.factoryMgr = FactoryManagerAI(self)
        self.mintMgr = MintManagerAI(self)
        self.lawOfficeMgr = LawOfficeManagerAI(self)
        self.countryClubMgr = CountryClubManagerAI(self)
        self.promotionMgr = PromotionManagerAI(self)
        self.cogSuitMgr = CogSuitManagerAI(self)
        self.suitInvasionManager = SuitInvasionManagerAI(self)

        self.statusSender = ShardStatusSender(self)

        self.dnaStoreMap = {}

        self.buildingManagers = {}
        self.suitPlanners = {}
Exemplo n.º 33
0
 def __init__(self, baseChannel, serverId, districtName, holidayPasscode,
              serverDescription, miniserverId):
     ToontownInternalRepository.__init__(self,
                                         baseChannel,
                                         serverId,
                                         dcSuffix='AI')
     self.districtName = districtName
     self.holidayPasscode = holidayPasscode
     self.holidayValue = 0
     self.serverDescription = serverDescription
     self.zoneAllocator = UniqueIdAllocator(
         ToontownGlobals.DynamicZonesBegin, ToontownGlobals.DynamicZonesEnd)
     self.zoneId2owner = {}
     NPCToons.generateZone2NpcDict()
     self.zoneTable = {}
     self.hoodArray = []
     self.hoods = []
     self._dnaStoreMap = {}
     self.zoneDataStore = AIZoneDataStore()
     self.useAllMinigames = self.config.GetBool('want-all-minigames', False)
     self.doLiveUpdates = self.config.GetBool('want-live-updates', True)
     self.reachedPlayerLimit = False
     self.fishManager = FishManagerAI()
     self.questManager = QuestManagerAI(self)
     self.cogPageManager = CogPageManagerAI()
     self.factoryMgr = FactoryManagerAI(self)
     self.mintMgr = MintManagerAI(self)
     self.lawOfficeMgr = LawOfficeManagerAI(self)
     self.countryClubMgr = CountryClubManagerAI(self)
     self.promotionMgr = PromotionManagerAI(self)
     self.cogSuitMgr = CogSuitManagerAI(self)
     self.wantCogdominiums = self.config.GetBool('want-cogdominums', False)
     self.buildingManagers = {}
     self.suitPlanners = {}
     self.inEpisode = False
     self.cutsceneActivated = False
     self.currentEpisode = None
     self.wantMiniServer = config.GetBool('want-mini-server', False)
     if not self.wantMiniServer:
         self.wantPrologue = config.GetBool('want-prologue', False)
     else:
         self.wantPrologue = False
     return
    def __init__(self, baseChannel, serverId):
        ToontownInternalRepository.__init__(self, baseChannel, serverId, dcSuffix="UD")

        self.rpcServer = None
        self.webRpc = None

        if config.GetBool("want-mongo-client", False):
            url = config.GetString("mongodb-url", "mongodb://localhost")
            replicaset = config.GetString("mongodb-replicaset", "")
            if replicaset:
                self.mongo = pymongo.MongoClient(url, replicaset=replicaset)
            else:
                self.mongo = pymongo.MongoClient(url)
            db = (urlparse.urlparse(url).path or "/test")[1:]
            self.mongodb = self.mongo[db]
        else:
            self.mongo = None
            self.mongodb = None

        self.notify.setInfo(True)
Exemplo n.º 35
0
    def __init__(self, baseChannel, serverId, districtName):
        ToontownInternalRepository.__init__(self, baseChannel, serverId, dcSuffix='AI')

        self.dnaSpawner = DNASpawnerAI(self)

        self.districtName = districtName
        
        self.notify.setInfo(True)  # Our AI repository should always log info.

        self.zoneAllocator = UniqueIdAllocator(ToontownGlobals.DynamicZonesBegin,
                                               ToontownGlobals.DynamicZonesEnd)
        self.zoneId2owner = {}

        NPCToons.generateZone2NpcDict()

        self.hoods = []
        self.zoneDataStore = AIZoneDataStore()

        self.useAllMinigames = self.config.GetBool('want-all-minigames', False)
        self.doLiveUpdates = self.config.GetBool('want-live-updates', True)

        self.holidayManager = HolidayManagerAI(self)

        self.fishManager = FishManagerAI()
        self.questManager = QuestManagerAI(self)
        self.cogPageManager = CogPageManagerAI()
        self.factoryMgr = FactoryManagerAI(self)
        self.mintMgr = MintManagerAI(self)
        self.lawOfficeMgr = LawOfficeManagerAI(self)
        self.countryClubMgr = CountryClubManagerAI(self)
        self.promotionMgr = PromotionManagerAI(self)
        self.cogSuitMgr = CogSuitManagerAI(self)
        self.suitInvasionManager = SuitInvasionManagerAI(self)

        self.statusSender = ShardStatusSender(self)

        self.dnaStoreMap = {}

        self.buildingManagers = {}
        self.suitPlanners = {}
Exemplo n.º 36
0
    def handleConnected(self):
        ToontownInternalRepository.handleConnected(self)

        # Generate our district...
        self.districtId = self.allocateChannel()
        self.notify.info('Creating district (%d)...' % self.districtId)
        self.district = ToontownDistrictAI(self)
        self.district.setName(self.districtName)
        self.district.generateWithRequiredAndId(self.districtId,
                                                self.getGameDoId(),
                                                OTP_ZONE_ID_MANAGEMENT)

        # Claim ownership of that district...
        self.notify.info('Claiming ownership of district (%d)...' %
                         self.districtId)
        datagram = PyDatagram()
        datagram.addServerHeader(self.districtId, self.ourChannel,
                                 STATESERVER_OBJECT_SET_AI)
        datagram.addChannel(self.ourChannel)
        self.send(datagram)

        # Create our local objects.
        self.notify.info('Creating local objects...')
        self.createLocals()

        # Create our global objects.
        self.notify.info('Creating global objects...')
        self.createGlobals()

        # Create our zones.
        self.notify.info('Creating zones (Playgrounds and Cog HQs)...')
        self.createZones()

        # Make our district available, and we're done.
        self.notify.info('Get your districts in, and...')
        self.district.b_setAvailable(1)
        self.notify.info(
            'Districts are now complete. NOW PLAY TOONTOWN MYSTERY OR ELSE!!!!!!'
        )
Exemplo n.º 37
0
    def __init__(self, baseChannel, serverId, districtName):
        ToontownInternalRepository.__init__(self, baseChannel, serverId, dcSuffix='AI')

        self.districtName = districtName

        self.zoneAllocator = UniqueIdAllocator(ToontownGlobals.DynamicZonesBegin,
                                               ToontownGlobals.DynamicZonesEnd)

        NPCToons.generateZone2NpcDict()

        self.hoods = []
        self.zoneDataStore = AIZoneDataStore()

        self.useAllMinigames = self.config.GetBool('want-all-minigames', False)
        self.doLiveUpdates = False

        self.holidayManager = HolidayManagerAI()
        
        self.fishManager = FishManagerAI()
        
        self.mintMgr = MintManagerAI.MintManagerAI(self)
        self.factoryMgr = FactoryManagerAI.FactoryManagerAI(self)
Exemplo n.º 38
0
 def handleConnected(self):
     ToontownInternalRepository.handleConnected(self)
     if self.holidayPasscode != '':
         self.initServerHoliday()
     self.districtId = self.allocateChannel()
     self.notify.info('Creating district (%d)...' % self.districtId)
     self.distributedDistrict = ToontownDistrictAI(self)
     self.distributedDistrict.setName(self.districtName)
     self.distributedDistrict.setDescription(self.serverDescription)
     self.distributedDistrict.setHolidayPasscode(self.holidayValue)
     self.distributedDistrict.generateWithRequiredAndId(
         self.districtId, self.getGameDoId(), OTP_ZONE_ID_MANAGEMENT)
     self.notify.info('Claiming ownership of district (%d)...' %
                      self.districtId)
     dg = PyDatagram()
     dg.addServerHeader(self.districtId, self.ourChannel,
                        STATESERVER_OBJECT_SET_AI)
     dg.addChannel(self.ourChannel)
     self.send(dg)
     self.notify.info('Creating global objects...')
     self.createGlobals()
     self.notify.info('Creating zones (Playgrounds and Cog HQs)...')
     self.createZones()
Exemplo n.º 39
0
 def __init__(self, baseChannel, serverId, expMultiplier, meritMultiplier,
              doodleMultiplier, defaultMaxToon, defaultZone, districtName,
              districtLimit, districtDescription, districtWebsiteId,
              eventId, defaultAccessLevel):
     ToontownInternalRepository.__init__(self,
                                         baseChannel,
                                         serverId,
                                         dcSuffix='AI')
     self.expMultiplier = expMultiplier
     self.meritMultiplier = meritMultiplier
     self.doodleMultiplier = doodleMultiplier
     self.defaultMaxToon = defaultMaxToon
     self.defaultZone = defaultZone
     self.districtName = districtName
     self.districtLimit = districtLimit
     if self.districtLimit < ToontownGlobals.MIN_POP:
         self.districtLimit = ToontownGlobals.MIN_POP
     elif self.districtLimit > ToontownGlobals.HIGH_POP:
         self.districtLimit = ToontownGlobals.HIGH_POP
     self.districtDescription = districtDescription
     self.districtWebsiteId = districtWebsiteId
     self.eventId = eventId
     self.defaultAccessLevel = defaultAccessLevel
     self.doLiveUpdates = self.config.GetBool('want-live-updates', True)
     self.wantCogdominiums = self.config.GetBool('want-cogdominiums', True)
     self.wantEmblems = self.config.GetBool('want-emblems', True)
     self.useAllMinigames = self.config.GetBool('want-all-minigames', True)
     self.wantEmblems = self.config.GetBool('want-emblems', True)
     self.districtId = None
     self.district = None
     self.districtStats = None
     self.districtFull = False
     self.timeManager = None
     self.newsManager = None
     self.holidayManager = None
     self.welcomeValleyManager = None
     self.catalogManager = None
     self.zoneDataStore = None
     self.inGameNewsMgr = None
     self.trophyMgr = None
     self.petMgr = None
     self.dnaStoreMap = {}
     self.dnaDataMap = {}
     self.zoneTable = {}
     self.hoods = []
     self.buildingManagers = {}
     self.suitPlanners = {}
     self.suitInvasionManager = None
     self.zoneAllocator = None
     self.zoneId2owner = {}
     self.questManager = None
     self.cogPageManager = None
     self.fishManager = None
     self.factoryMgr = None
     self.mintMgr = None
     self.lawMgr = None
     self.countryClubMgr = None
     self.promotionMgr = None
     self.cogSuitMgr = None
     self.partyManager = None
     self.safeZoneManager = None
     self.raceMgr = None
     self.polarPlaceEffectMgr = None
     self.resistanceEmoteMgr = None
     self.tutorialManager = None
     self.friendManager = None
     self.chatManager = None
     self.toontownTimeManager = None
     self.estateMgr = None
     self.magicWordManager = None
     self.deliveryManager = None
     self.cogSuitMessageSent = False
     self.propGenerators = {}
     self.propGeneratorsLocked = False
     self.moddingManager = None
     self.discordManager = None
     return
Exemplo n.º 40
0
    def __init__(self, baseChannel, serverId):
        ToontownInternalRepository.__init__(self, baseChannel, serverId, dcSuffix='UD')

        self.notify.setInfo(True)
        self.wantTopToons = self.config.GetBool('want-top-toons', True)
    def __init__(self, baseChannel, serverId):
        ToontownInternalRepository.__init__(self, baseChannel, serverId, dcSuffix='UD')

        self.notify.setInfo(True)
 def handleConnected(self):
     ToontownInternalRepository.handleConnected(self)
     threading.Thread(target=self.startDistrict).start()
Exemplo n.º 43
0
 def __init__(self, baseChannel, serverId):
     ToontownInternalRepository.__init__(self,
                                         baseChannel,
                                         serverId,
                                         dcSuffix='UD')
 def handleConnected(self):
     ToontownInternalRepository.handleConnected(self)
     threading.Thread(target=self.startDistrict).start()
 def __init__(self, baseChannel, serverId):
     ToontownInternalRepository.__init__(self, baseChannel, serverId, dcSuffix = 'UD')
     self.__loader = DNALoader.DNALoader()
     self.__dnaMap = {}
 def __init__(self, baseChannel, serverId):
     ToontownInternalRepository.__init__(self, baseChannel, serverId, dcSuffix='UD')
 def __init__(self, baseChannel, serverId):
     ToontownInternalRepository.__init__(self, baseChannel, serverId, dcSuffix='UD')
     self.wantUD = config.GetBool('want-ud', True)