def createCogHeadquarters(self):
     NPCToons.generateZone2NpcDict()
     if self.config.GetBool('want-sellbot-headquarters', True):
         self.factoryMgr = FactoryManagerAI.FactoryManagerAI(self)
         self.cogHeadquarters.append(SellbotHQAI.SellbotHQAI(self))
     if self.config.GetBool('want-cashbot-headquarters', True):
         self.mintMgr = MintManagerAI.MintManagerAI(self)
         self.cogHeadquarters.append(CashbotHQAI.CashbotHQAI(self))
     if self.config.GetBool('want-lawbot-headquarters', True):
         self.lawOfficeMgr = LawOfficeManagerAI.LawOfficeManagerAI(self)
         self.cogHeadquarters.append(LawbotHQAI.LawbotHQAI(self))
     if self.config.GetBool('want-bossbot-headquarters', True):
         self.countryClubMgr = CountryClubManagerAI.CountryClubManagerAI(self)
         self.cogHeadquarters.append(BossbotHQAI.BossbotHQAI(self))
Esempio n. 2
0
 def createCogHeadquarters(self):
     NPCToons.generateZone2NpcDict()
     if self.config.GetBool('want-sellbot-headquarters', True):
         self.factoryMgr = FactoryManagerAI.FactoryManagerAI(self)
         self.cogHeadquarters.append(SellbotHQAI.SellbotHQAI(self))
     if self.config.GetBool('want-cashbot-headquarters', True):
         self.mintMgr = MintManagerAI.MintManagerAI(self)
         self.cogHeadquarters.append(CashbotHQAI.CashbotHQAI(self))
     if self.config.GetBool('want-lawbot-headquarters', True):
         self.lawOfficeMgr = LawOfficeManagerAI.LawOfficeManagerAI(self)
         self.cogHeadquarters.append(LawbotHQAI.LawbotHQAI(self))
     if self.config.GetBool('want-bossbot-headquarters', True):
         self.countryClubMgr = CountryClubManagerAI.CountryClubManagerAI(
             self)
         self.cogHeadquarters.append(BossbotHQAI.BossbotHQAI(self))
    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()            
Esempio n. 4
0
    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 = {}
Esempio n. 5
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, 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 = {}
Esempio n. 7
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 createSafeZones(self):
     NPCToons.generateZone2NpcDict()
     if self.config.GetBool('want-toontown-central', True):
         self.hoods.append(TTHoodAI.TTHoodAI(self))
     if self.config.GetBool('want-donalds-dock', True):
         self.hoods.append(DDHoodAI.DDHoodAI(self))
     if self.config.GetBool('want-daisys-garden', True):
         self.hoods.append(DGHoodAI.DGHoodAI(self))
     if self.config.GetBool('want-minnies-melodyland', True):
         self.hoods.append(MMHoodAI.MMHoodAI(self))
     if self.config.GetBool('want-the-burrrgh', True):
         self.hoods.append(BRHoodAI.BRHoodAI(self))
     if self.config.GetBool('want-donalds-dreamland', True):
         self.hoods.append(DLHoodAI.DLHoodAI(self))
     if self.config.GetBool('want-goofy-speedway', True):
         self.hoods.append(GSHoodAI.GSHoodAI(self))
     if self.config.GetBool('want-outdoor-zone', True):
         self.hoods.append(OZHoodAI.OZHoodAI(self))
     if self.config.GetBool('want-golf-zone', True):
         self.hoods.append(GZHoodAI.GZHoodAI(self))
 def createSafeZones(self):
     NPCToons.generateZone2NpcDict()
     if self.config.GetBool('want-toontown-central', True):
         self.hoods.append(TTHoodAI.TTHoodAI(self))
     if self.config.GetBool('want-donalds-dock', True):
         self.hoods.append(DDHoodAI.DDHoodAI(self))
     if self.config.GetBool('want-daisys-garden', True):
         self.hoods.append(DGHoodAI.DGHoodAI(self))
     if self.config.GetBool('want-minnies-melodyland', True):
         self.hoods.append(MMHoodAI.MMHoodAI(self))
     if self.config.GetBool('want-the-brrrgh', True):
         self.hoods.append(BRHoodAI.BRHoodAI(self))
     if self.config.GetBool('want-donalds-dreamland', True):
         self.hoods.append(DLHoodAI.DLHoodAI(self))
     if self.config.GetBool('want-goofy-speedway', True):
         self.hoods.append(GSHoodAI.GSHoodAI(self))
     if self.config.GetBool('want-outdoor-zone', True):
         self.hoods.append(OZHoodAI.OZHoodAI(self))
     if self.config.GetBool('want-golf-zone', True):
         self.hoods.append(GZHoodAI.GZHoodAI(self))
Esempio n. 10
0
 def createSafeZones(self):
     NPCToons.generateZone2NpcDict()
     if self.config.GetBool('want-toontown-central', True):
         hood = TTHoodAI.TTHoodAI(self)
         self.hoods.append(hood)
         self.hoodId2Hood[hood.zoneId] = hood
     if self.config.GetBool('want-donalds-dock', True):
         hood = DDHoodAI.DDHoodAI(self)
         self.hoods.append(hood)
         self.hoodId2Hood[hood.zoneId] = hood
     if self.config.GetBool('want-daisys-garden', True):
         hood = DGHoodAI.DGHoodAI(self)
         self.hoods.append(hood)
         self.hoodId2Hood[hood.zoneId] = hood
     if self.config.GetBool('want-minnies-melodyland', True):
         hood = MMHoodAI.MMHoodAI(self)
         self.hoods.append(hood)
         self.hoodId2Hood[hood.zoneId] = hood
     if self.config.GetBool('want-the-burrrgh', True):
         hood = BRHoodAI.BRHoodAI(self)
         self.hoods.append(hood)
         self.hoodId2Hood[hood.zoneId] = hood
     if self.config.GetBool('want-donalds-dreamland', True):
         hood = DLHoodAI.DLHoodAI(self)
         self.hoods.append(hood)
         self.hoodId2Hood[hood.zoneId] = hood
     if self.config.GetBool('want-goofy-speedway', True):
         hood = GSHoodAI.GSHoodAI(self)
         self.hoods.append(hood)
         self.hoodId2Hood[hood.zoneId] = hood
     if self.config.GetBool('want-outdoor-zone', True):
         hood = OZHoodAI.OZHoodAI(self)
         self.hoods.append(hood)
         self.hoodId2Hood[hood.zoneId] = hood
     if self.config.GetBool('want-golf-zone', True):
         hood = GZHoodAI.GZHoodAI(self)
         self.hoods.append(hood)
         self.hoodId2Hood[hood.zoneId] = hood
     hood = TTOHoodAI.TTOHoodAI(self)
     self.hoods.append(hood)
     self.hoodId2Hood[hood.zoneId] = hood
Esempio n. 11
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 = {}
Esempio n. 12
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)
 def createCogHeadquarters(self):
     NPCToons.generateZone2NpcDict()
Esempio n. 14
0
    def createZones(self):
        # First, generate our zone2NpcDict...
        NPCToons.generateZone2NpcDict()

        # Toontown Central
        self.zoneTable[ToontownGlobals.ToontownCentral] = (
            (ToontownGlobals.ToontownCentral, 1,
             0), (ToontownGlobals.SillyStreet, 1,
                  1), (ToontownGlobals.LoopyLane, 1,
                       1), (ToontownGlobals.PunchlinePlace, 1, 1))
        self.createHood(TTHoodDataAI, ToontownGlobals.ToontownCentral)

        # Donald's Dock
        self.zoneTable[ToontownGlobals.DonaldsDock] = (
            (ToontownGlobals.DonaldsDock, 1,
             0), (ToontownGlobals.BarnacleBoulevard, 1,
                  1), (ToontownGlobals.SeaweedStreet, 1,
                       1), (ToontownGlobals.LighthouseLane, 1, 1))
        self.createHood(DDHoodDataAI, ToontownGlobals.DonaldsDock)

        # Daisy Gardens
        self.zoneTable[ToontownGlobals.DaisyGardens] = (
            (ToontownGlobals.DaisyGardens, 1,
             0), (ToontownGlobals.ElmStreet, 1,
                  1), (ToontownGlobals.MapleStreet, 1,
                       1), (ToontownGlobals.OakStreet, 1, 1))
        self.createHood(DGHoodDataAI, ToontownGlobals.DaisyGardens)

        # Minnie's Melodyland
        self.zoneTable[ToontownGlobals.MinniesMelodyland] = (
            (ToontownGlobals.MinniesMelodyland, 1,
             0), (ToontownGlobals.AltoAvenue, 1,
                  1), (ToontownGlobals.BaritoneBoulevard, 1,
                       1), (ToontownGlobals.TenorTerrace, 1, 1))
        self.createHood(MMHoodDataAI, ToontownGlobals.MinniesMelodyland)

        # The Brrrgh
        self.zoneTable[ToontownGlobals.TheBrrrgh] = (
            (ToontownGlobals.TheBrrrgh, 1,
             0), (ToontownGlobals.WalrusWay, 1,
                  1), (ToontownGlobals.SleetStreet, 1,
                       1), (ToontownGlobals.PolarPlace, 1, 1))
        self.createHood(BRHoodDataAI, ToontownGlobals.TheBrrrgh)

        # Donald's Dreamland
        self.zoneTable[ToontownGlobals.DonaldsDreamland] = (
            (ToontownGlobals.DonaldsDreamland, 1,
             0), (ToontownGlobals.LullabyLane, 1,
                  1), (ToontownGlobals.PajamaPlace, 1, 1))
        self.createHood(DLHoodDataAI, ToontownGlobals.DonaldsDreamland)

        # Sellbot HQ
        self.zoneTable[ToontownGlobals.SellbotHQ] = (
            (ToontownGlobals.SellbotHQ, 0,
             1), (ToontownGlobals.SellbotFactoryExt, 0, 1))
        self.createHood(CSHoodDataAI, ToontownGlobals.SellbotHQ)

        # Cashbot HQ
        self.zoneTable[ToontownGlobals.CashbotHQ] = ((
            ToontownGlobals.CashbotHQ, 0, 1), )
        self.createHood(CashbotHQDataAI, ToontownGlobals.CashbotHQ)

        # Lawbot HQ
        self.zoneTable[ToontownGlobals.LawbotHQ] = ((ToontownGlobals.LawbotHQ,
                                                     0, 1), )
        self.createHood(LawbotHQDataAI, ToontownGlobals.LawbotHQ)

        # Bossbot HQ
        self.zoneTable[ToontownGlobals.BossbotHQ] = ((
            ToontownGlobals.BossbotHQ, 0, 0), )
        self.createHood(BossbotHQDataAI, ToontownGlobals.BossbotHQ)

        # Goofy Speedway
        self.zoneTable[ToontownGlobals.GoofySpeedway] = ((
            ToontownGlobals.GoofySpeedway, 1, 0), )
        self.createHood(GSHoodDataAI, ToontownGlobals.GoofySpeedway)

        # Chip 'n Dale's Acorn Acres
        self.zoneTable[ToontownGlobals.OutdoorZone] = ((
            ToontownGlobals.OutdoorZone, 1, 0), )
        self.createHood(OZHoodDataAI, ToontownGlobals.OutdoorZone)

        # Chip 'n Dale's MiniGolf
        self.zoneTable[ToontownGlobals.GolfZone] = ((ToontownGlobals.GolfZone,
                                                     1, 0), )
        self.createHood(GZHoodDataAI, ToontownGlobals.GolfZone)

        # Welcome Valley hoods (Toontown Central & Goofy Speedway)
        self.notify.info('Creating ' + TTLocalizer.WelcomeValley[2] + '...')
        self.welcomeValleyManager.createWelcomeValleyHoods()

        # Assign the initial suit buildings.
        self.notify.info(
            'Assigning initial Cog buildings and Field Offices...')
        for suitPlanner in self.suitPlanners.values():
            suitPlanner.assignInitialSuitBuildings()
Esempio n. 15
0
    def __init__(self, *args, **kw):
        AIDistrict.__init__(self, *args, **kw)
        self.setTimeWarning(
            ConfigVariableDouble('aimsg-time-warning', 4).getValue())

        self.dnaSearchPath = DSearchPath()
        if os.getenv('TTMODELS'):
            self.dnaSearchPath.appendDirectory(
                Filename.expandFrom('$TTMODELS/built/phase_3.5/dna'))
            self.dnaSearchPath.appendDirectory(
                Filename.expandFrom('$TTMODELS/built/phase_4/dna'))
            self.dnaSearchPath.appendDirectory(
                Filename.expandFrom('$TTMODELS/built/phase_5/dna'))
            self.dnaSearchPath.appendDirectory(
                Filename.expandFrom('$TTMODELS/built/phase_5.5/dna'))
            self.dnaSearchPath.appendDirectory(
                Filename.expandFrom('$TTMODELS/built/phase_6/dna'))
            self.dnaSearchPath.appendDirectory(
                Filename.expandFrom('$TTMODELS/built/phase_8/dna'))
            self.dnaSearchPath.appendDirectory(
                Filename.expandFrom('$TTMODELS/built/phase_9/dna'))
            self.dnaSearchPath.appendDirectory(
                Filename.expandFrom('$TTMODELS/built/phase_10/dna'))
            self.dnaSearchPath.appendDirectory(
                Filename.expandFrom('$TTMODELS/built/phase_11/dna'))
            self.dnaSearchPath.appendDirectory(
                Filename.expandFrom('$TTMODELS/built/phase_12/dna'))
            self.dnaSearchPath.appendDirectory(
                Filename.expandFrom('$TTMODELS/built/phase_13/dna'))

            # In the publish environment, TTMODELS won't be on the model
            # path by default, so we always add it there.  In the dev
            # environment, it'll be on the model path already, but it
            # doesn't hurt to add it again.
            getModelPath().appendDirectory(Filename.expandFrom("$TTMODELS"))
        else:
            self.dnaSearchPath.appendDirectory(Filename('.'))
            self.dnaSearchPath.appendDirectory(Filename('ttmodels/src/dna'))

        # Initialize our query context.
        self.__queryEstateContext = 0
        self.__queryEstateFuncMap = {}

        # Set a hook so we can process queryToonMaxHp() requests.
        self.accept('queryToonMaxHp', self.__queryToonMaxHpResponse)

        # For debugging
        wantNewToonhall = ConfigVariableBool('want-new-toonhall', 1).getValue()
        if (not wantNewToonhall) or \
            (wantNewToonhall and not ConfigVariableBool('show-scientists', 0).getValue()):
            for i in range(3):
                npcId = 2018 + i
                if npcId in NPCToons.NPCToonDict:
                    del NPCToons.NPCToonDict[npcId]

        NPCToons.generateZone2NpcDict()

        if not ConfigVariableBool('want-suits-everywhere', 1).getValue():
            # This is a special mode for development: we don't want
            # suits walking around all over the world.  Turn off all
            # the SuitPlanner flags.
            for zones in list(self.zoneTable.values()):
                for zone in zones:
                    zone[2] = 0

            if not ConfigVariableBool('want-suits-nowhere', 1).getValue():
                # However, we do want them in at least one street.
                self.zoneTable[ToontownCentral][1][2] = 1

        # minigame debug flags
        self.wantMinigameDifficulty = ConfigVariableBool(
            'want-minigame-difficulty', 0).getValue()

        self.minigameDifficulty = ConfigVariableDouble('minigame-difficulty',
                                                       -1.).getValue()
        if self.minigameDifficulty == -1.:
            del self.minigameDifficulty
        self.minigameSafezoneId = ConfigVariableInt('minigame-safezone-id',
                                                    -1).getValue()
        if self.minigameSafezoneId == -1:
            del self.minigameSafezoneId

        # should we pick from the entire list of minigames regardless of
        # the number of participating toons? (for debugging)
        self.useAllMinigames = ConfigVariableBool('use-all-minigames',
                                                  0).getValue()

        self.wantCogdominiums = ConfigVariableBool('want-cogdominiums',
                                                   0).getValue()

        self.hoods = []
        self.buildingManagers = {}
        self.suitPlanners = {}

        # Guard for publish
        if simbase.wantBingo:
            self.bingoMgr = None

        self.toontownTimeManager = ToontownTimeManager.ToontownTimeManager()
        self.toontownTimeManager.updateLoginTimes(time.time(), time.time(),
                                                  globalClock.getRealTime())

        # turn on garbage-collection debugging to see if it's related
        # to the chugs we're seeing
        # eventually we will probably put in our own gc pump
        if ConfigVariableBool('gc-debug', 0).getValue():
            import gc
            gc.set_debug(gc.DEBUG_STATS)

        self.deliveryManager = self.generateGlobalObject(
            OtpDoGlobals.OTP_DO_ID_TOONTOWN_DELIVERY_MANAGER,
            "DistributedDeliveryManager")

        self.mailManager = self.generateGlobalObject(
            OtpDoGlobals.OTP_DO_ID_TOONTOWN_MAIL_MANAGER,
            "DistributedMailManager")

        #self.partyManager = self.generateGlobalObject(
        #    OtpDoGlobals.OTP_DO_ID_TOONTOWN_PARTY_MANAGER,
        #    "DistributedPartyManager")

        #self.codeRedemptionManager = self.generateGlobalObject(
        #    OtpDoGlobals.OTP_DO_ID_TOONTOWN_CODE_REDEMPTION_MANAGER,
        #    "TTCodeRedemptionMgr")

        #self.randomSourceManager = self.generateGlobalObject(
        #    OtpDoGlobals.OTP_DO_ID_TOONTOWN_NON_REPEATABLE_RANDOM_SOURCE,
        #    "NonRepeatableRandomSource")

        if ConfigVariableBool('want-ddsm', 1).getValue():
            self.dataStoreManager = self.generateGlobalObject(
                OtpDoGlobals.OTP_DO_ID_TOONTOWN_TEMP_STORE_MANAGER,
                "DistributedDataStoreManager")

        self.groupManager = ToontownGroupManager.ToontownGroupManager()
Esempio n. 16
0
 def createZones(self):
     NPCToons.generateZone2NpcDict()
     self.zoneTable[ToontownGlobals.ToontownCentral] = (
         (ToontownGlobals.ToontownCentral, 1,
          0), (ToontownGlobals.SillyStreet, 1,
               1), (ToontownGlobals.LoopyLane, 1,
                    1), (ToontownGlobals.PunchlinePlace, 1, 1))
     self.createHood(TTHoodDataAI, ToontownGlobals.ToontownCentral)
     self.zoneTable[ToontownGlobals.DonaldsDock] = (
         (ToontownGlobals.DonaldsDock, 1,
          0), (ToontownGlobals.BarnacleBoulevard, 1,
               1), (ToontownGlobals.SeaweedStreet, 1,
                    1), (ToontownGlobals.LighthouseLane, 1, 1))
     self.createHood(DDHoodDataAI, ToontownGlobals.DonaldsDock)
     self.zoneTable[ToontownGlobals.DaisyGardens] = (
         (ToontownGlobals.DaisyGardens, 1,
          0), (ToontownGlobals.ElmStreet, 1,
               1), (ToontownGlobals.MapleStreet, 1,
                    1), (ToontownGlobals.OakStreet, 1, 1))
     self.createHood(DGHoodDataAI, ToontownGlobals.DaisyGardens)
     self.zoneTable[ToontownGlobals.MinniesMelodyland] = (
         (ToontownGlobals.MinniesMelodyland, 1,
          0), (ToontownGlobals.AltoAvenue, 1,
               1), (ToontownGlobals.BaritoneBoulevard, 1,
                    1), (ToontownGlobals.TenorTerrace, 1, 1))
     self.createHood(MMHoodDataAI, ToontownGlobals.MinniesMelodyland)
     self.zoneTable[ToontownGlobals.TheBrrrgh] = (
         (ToontownGlobals.TheBrrrgh, 1,
          0), (ToontownGlobals.WalrusWay, 1,
               1), (ToontownGlobals.SleetStreet, 1,
                    1), (ToontownGlobals.PolarPlace, 1, 1))
     self.createHood(BRHoodDataAI, ToontownGlobals.TheBrrrgh)
     self.zoneTable[ToontownGlobals.DonaldsDreamland] = (
         (ToontownGlobals.DonaldsDreamland, 1,
          0), (ToontownGlobals.LullabyLane, 1,
               1), (ToontownGlobals.PajamaPlace, 1, 1))
     self.createHood(DLHoodDataAI, ToontownGlobals.DonaldsDreamland)
     self.zoneTable[ToontownGlobals.SellbotHQ] = (
         (ToontownGlobals.SellbotHQ, 0,
          1), (ToontownGlobals.SellbotFactoryExt, 0, 1))
     self.createHood(CSHoodDataAI, ToontownGlobals.SellbotHQ)
     self.zoneTable[ToontownGlobals.CashbotHQ] = ((
         ToontownGlobals.CashbotHQ, 0, 1), )
     self.createHood(CashbotHQDataAI, ToontownGlobals.CashbotHQ)
     self.zoneTable[ToontownGlobals.LawbotHQ] = ((ToontownGlobals.LawbotHQ,
                                                  0, 1), )
     self.createHood(LawbotHQDataAI, ToontownGlobals.LawbotHQ)
     self.zoneTable[ToontownGlobals.BossbotHQ] = ((
         ToontownGlobals.BossbotHQ, 0, 0), )
     self.createHood(BossbotHQDataAI, ToontownGlobals.BossbotHQ)
     self.zoneTable[ToontownGlobals.GoofySpeedway] = ((
         ToontownGlobals.GoofySpeedway, 1, 0), )
     self.createHood(GSHoodDataAI, ToontownGlobals.GoofySpeedway)
     self.zoneTable[ToontownGlobals.OutdoorZone] = ((
         ToontownGlobals.OutdoorZone, 1, 0), )
     self.createHood(OZHoodDataAI, ToontownGlobals.OutdoorZone)
     self.zoneTable[ToontownGlobals.GolfZone] = ((ToontownGlobals.GolfZone,
                                                  1, 0), )
     self.createHood(GZHoodDataAI, ToontownGlobals.GolfZone)
     self.zoneTable[ToontownGlobals.ToontownOutskirts] = (
         (ToontownGlobals.ToontownOutskirts, 1,
          0), (ToontownGlobals.TutorialTerrace, 1, 1))
     self.createHood(SpecialHoodDataAI, ToontownGlobals.ToontownOutskirts)
     self.zoneTable[ToontownGlobals.ToontownCentralBeta] = ((
         ToontownGlobals.ToontownCentralBeta, 1, 0), )
     self.createHood(TTBetaHoodDataAI, ToontownGlobals.ToontownCentralBeta)
     self.zoneTable[ToontownGlobals.DaisyGardensBeta] = (
         (ToontownGlobals.DaisyGardensBeta, 1,
          0), (ToontownGlobals.OakStreetBeta, 1, 0))
     self.createHood(DGBetaHoodDataAI, ToontownGlobals.DaisyGardensBeta)
     self.notify.info(
         'Assigning initial Cog buildings and Field Offices...')
     for suitPlanner in self.suitPlanners.values():
         suitPlanner.assignInitialSuitBuildings()