def createManagers(self):
     self.timeManager = TimeManagerAI(self)
     self.timeManager.generateWithRequired(OTP_ZONE_ID_OLD_QUIET_ZONE)
     self.magicWordManager = MagicWordManagerAI(self)
     self.magicWordManager.generateWithRequired(OTP_ZONE_ID_OLD_QUIET_ZONE)
     self.newsManager = NewsManagerAI(self)
     self.newsManager.generateWithRequired(OTP_ZONE_ID_OLD_QUIET_ZONE)
     self.safeZoneManager = SafeZoneManagerAI(self)
     self.safeZoneManager.generateWithRequired(OTP_ZONE_ID_OLD_QUIET_ZONE)
     self.tutorialManager = TutorialManagerAI(self)
     #self.tutorialManager.generateWithRequired(2)
     self.friendManager = FriendManagerAI(self)
     self.friendManager.generateWithRequired(OTP_ZONE_ID_OLD_QUIET_ZONE)
     self.questManager = QuestManagerAI(self)
     #self.banManager = BanManagerAI.BanManagerAI(self)
     #self.achievementsManager = AchievementsManagerAI(self)
     self.suitInvasionManager = SuitInvasionManagerAI(self)
     self.trophyMgr = DistributedTrophyMgrAI(self)
     self.trophyMgr.generateWithRequired(OTP_ZONE_ID_OLD_QUIET_ZONE)
     #self.cogSuitMgr = CogSuitManagerAI.CogSuitManagerAI(self)
     #self.promotionMgr = PromotionManagerAI.PromotionManagerAI(self)
     self.cogPageManager = CogPageManagerAI.CogPageManagerAI()
     #self.bankManager = BankManagerAI.BankManagerAI(self)
     self.holidayManager = HolidayManagerAI(self)
     #if self.wantFishing:
     #    self.fishManager = FishManagerAI(self)
     if self.wantHousing:
         self.estateManager = EstateManagerAI(self)
         self.estateManager.generateWithRequired(OTP_ZONE_ID_OLD_QUIET_ZONE)
    def createLocals(self):
        """
        Creates "local" (non-distributed) objects.
        """

        # Create our holiday manager...
        self.holidayManager = HolidayManagerAI(self)

        # Create our zone data store...
        self.zoneDataStore = AIZoneDataStore()

        # Create our pet manager...
        self.petMgr = PetManagerAI(self)

        # Create our suit invasion manager...
        self.suitInvasionManager = SuitInvasionManagerAI(self)

        # Create our quest manager...
        self.questManager = QuestManagerAI(self)

        # Create our promotion manager...
        self.promotionMgr = PromotionManagerAI(self)

        # Create our Cog page manager...
        self.cogPageManager = CogPageManagerAI(self)

        # Create our race manager...
        self.raceMgr = RaceManagerAI(self)
    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 = {}
    def createLocals(self):
        """
        Creates "local" objects.
        """

        # Create our holiday manager...
        self.holidayManager = HolidayManagerAI(self)

        # Create our zone data store...
        self.zoneDataStore = AIZoneDataStore()

        # Create our pet manager...
        self.petMgr = PetManagerAI(self)

        # Create our suit invasion manager...
        self.suitInvasionManager = SuitInvasionManagerAI(self)

        # Create our zone allocator...
        self.zoneAllocator = UniqueIdAllocator(
            ToontownGlobals.Zones.DynamicZonesBegin,
            ToontownGlobals.Zones.DynamicZonesEnd)

        # Create our quest manager...
        self.questManager = QuestManagerAI(self)

        # Create our Cog page manager...
        self.cogPageManager = CogPageManagerAI(self)

        # Create our fish manager...
        self.fishManager = FishManagerAI(self)

        # Create our factory manager...
        self.factoryMgr = FactoryManagerAI(self)

        # Create our mint manager...
        self.mintMgr = MintManagerAI(self)

        # Create our law office manager...
        self.lawMgr = LawOfficeManagerAI(self)

        # Create our country club manager...
        self.countryClubMgr = CountryClubManagerAI(self)

        # Create our promotion manager...
        self.promotionMgr = PromotionManagerAI(self)

        # Create our Cog suit manager...
        self.cogSuitMgr = CogSuitManagerAI(self)

        # Create our race manager...
        self.raceMgr = RaceManagerAI(self)

        # Create our Toontown time manager...
        self.toontownTimeManager = ToontownTimeManager(
            serverTimeUponLogin=int(time.time()),
            globalClockRealTimeUponLogin=globalClock.getRealTime())
Exemplo n.º 5
0
 def createManagers(self):
     self.timeManager = TimeManagerAI(self)
     self.timeManager.generateWithRequired(2)
     self.magicWordManager = MagicWordManagerAI(self)
     self.magicWordManager.generateWithRequired(2)
     self.newsManager = NewsManagerAI(self)
     self.newsManager.generateWithRequired(2)
     self.safeZoneManager = SafeZoneManagerAI(self)
     self.safeZoneManager.generateWithRequired(2)
     self.tutorialManager = TutorialManagerAI(self)
     self.tutorialManager.generateWithRequired(2)
     self.friendManager = FriendManagerAI(self)
     self.friendManager.generateWithRequired(2)
     self.questManager = QuestManagerAI(self)
     self.banManager = BanManagerAI.BanManagerAI(self)
     self.achievementsManager = AchievementsManagerAI(self)
     self.certManager = CertificateManagerAI(self)
     self.suitInvasionManager = SuitInvasionManagerAI(self)
     self.trophyMgr = DistributedTrophyMgrAI(self)
     self.trophyMgr.generateWithRequired(2)
     self.cogSuitMgr = CogSuitManagerAI.CogSuitManagerAI(self)
     self.promotionMgr = PromotionManagerAI.PromotionManagerAI(self)
     self.experienceMgr = ExperienceRewardManagerAI.ExperienceRewardManagerAI(self)
     self.cogPageManager = CogPageManagerAI.CogPageManagerAI()
     self.sillyMeterMgr = DistributedSillyMeterMgrAI.DistributedSillyMeterMgrAI(self)
     self.sillyMeterMgr.generateWithRequired(2)
     self.hydrantZeroMgr = DistributedHydrantZeroMgrAI.DistributedHydrantZeroMgrAI(self)
     self.hydrantZeroMgr.generateWithRequired(2)
     self.mailboxZeroMgr = DistributedMailboxZeroMgrAI.DistributedMailboxZeroMgrAI(self)
     self.mailboxZeroMgr.generateWithRequired(2)
     self.trashcanZeroMgr = DistributedTrashcanZeroMgrAI.DistributedTrashcanZeroMgrAI(self)
     self.trashcanZeroMgr.generateWithRequired(2)
     self.dialogueManager = DialogueManagerAI(self)
     self.bingoHolidayMgr = BingoHolidayMgrAI(self, ToontownGlobals.FISH_BINGO_NIGHT)
     self.bingoWeekendMgr = BingoWeekendMgrAI(self, ToontownGlobals.SILLY_SATURDAY_BINGO)
     self.trolleyHolidayMgr = TrolleyHolidayMgrAI(self, ToontownGlobals.TROLLEY_HOLIDAY)
     self.trolleyWeekendMgr = TrolleyWeekendMgrAI(self, ToontownGlobals.TROLLEY_WEEKEND)
     self.holidayManager = HolidayManagerAI(self)
     if self.wantFishing:
         self.fishManager = FishManagerAI(self)
     if self.wantHousing:
         self.estateManager = EstateManagerAI(self)
         self.estateManager.generateWithRequired(2)
         self.catalogManager = CatalogManagerAI(self)
         self.catalogManager.generateWithRequired(2)
         self.deliveryManager = self.generateGlobalObject(OTP_DO_ID_TOONTOWN_DELIVERY_MANAGER, 'DistributedDeliveryManager')
         self.mailManager = self.generateGlobalObject(OTP_DO_ID_TOONTOWN_MAIL_MANAGER, 'DistributedMailManager')
     if self.wantPets:
         self.petMgr = PetManagerAI(self)
     if self.wantParties:
         self.partyManager = DistributedPartyManagerAI(self)
         self.partyManager.generateWithRequired(2)
         self.globalPartyMgr = self.generateGlobalObject(OTP_DO_ID_GLOBAL_PARTY_MANAGER, 'GlobalPartyManager')
     self.codeRedemptionMgr = TTCodeRedemptionMgrAI(self)
     self.codeRedemptionMgr.generateWithRequired(2)
     self.chatAgent = simbase.air.generateGlobalObject(OTP_DO_ID_CHAT_MANAGER, 'ChatAgent')
    def createManagers(self):
        self.timeManager = TimeManagerAI(self)
        self.timeManager.generateWithRequired(2)
        self.magicWordManager = MagicWordManagerAI(self)
        self.magicWordManager.generateWithRequired(2)
        self.newsManager = NewsManagerAI(self)
        self.newsManager.generateWithRequired(2)

        self.holidayManager = HolidayManagerAI(self)

        self.safeZoneManager = SafeZoneManagerAI(self)
        self.safeZoneManager.generateWithRequired(2)
        self.tutorialManager = TutorialManagerAI(self)
        self.tutorialManager.generateWithRequired(2)
        self.friendManager = FriendManagerAI(self)
        self.friendManager.generateWithRequired(2)
        self.questManager = QuestManagerAI(self)
        self.banManager = BanManagerAI.BanManagerAI(self)
        self.suitInvasionManager = SuitInvasionManagerAI(self)
        self.trophyMgr = DistributedTrophyMgrAI(self)
        self.trophyMgr.generateWithRequired(2)
        self.cogSuitMgr = CogSuitManagerAI.CogSuitManagerAI(self)
        self.promotionMgr = PromotionManagerAI.PromotionManagerAI(self)
        self.cogPageManager = CogPageManagerAI.CogPageManagerAI()

        if self.wantFishing:
            self.fishManager = FishManagerAI(self)
        if self.wantHousing:
            self.estateManager = EstateManagerAI(self)
            self.estateManager.generateWithRequired(2)
            self.catalogManager = CatalogManagerAI(self)
            self.catalogManager.generateWithRequired(2)
            self.deliveryManager = self.generateGlobalObject(
                OTP_DO_ID_TOONTOWN_DELIVERY_MANAGER,
                'DistributedDeliveryManager')
        if self.wantPets:
            self.petMgr = PetManagerAI(self)

        if self.wantParties:
            self.partyManager = DistributedPartyManagerAI(self)
            self.partyManager.generateWithRequired(2)
            # Setup view of global ub party manager
            self.globalPartyMgr = self.generateGlobalObject(
                OTP_DO_ID_GLOBAL_PARTY_MANAGER, 'GlobalPartyManager')

        self.wantLeaderBoardMgr = True
        if self.wantLeaderBoardMgr:
            self.leaderBoardMgr = DistributedLeaderBoardManagerAI(self)

        # Need work
        self.codeRedemptionManager = TTCodeRedemptionMgrAI(self)
        self.codeRedemptionManager.generateWithRequired(2)
 def createManagers(self):
     self.timeManager = TimeManagerAI(self)
     self.timeManager.generateWithRequired(2)
     self.magicWordManager = MagicWordManagerAI(self)
     self.magicWordManager.generateWithRequired(2)
     self.newsManager = NewsManagerAI(self)
     self.newsManager.generateWithRequired(2)
     self.safeZoneManager = SafeZoneManagerAI(self)
     self.safeZoneManager.generateWithRequired(2)
     self.topToonsMgr = TopToonsManagerAI(self)
     #self.topToonsMgr.generateWithRequired(2)
     self.tutorialManager = TutorialManagerAI(self)
     self.tutorialManager.generateWithRequired(2)
     self.friendManager = FriendManagerAI(self)
     self.friendManager.generateWithRequired(2)
     self.questManager = QuestManagerAI(self)
     self.banManager = BanManagerAI.BanManagerAI(self)
     self.suitInvasionManager = SuitInvasionManagerAI(self)
     self.blackCatMgr = DistributedBlackCatMgrAI(self)
     self.blackCatMgr.generateWithRequired(2)
     self.reportMgr = DistributedReportMgrAI(self)
     self.reportMgr.generateWithRequired(2)
     self.trophyMgr = DistributedTrophyMgrAI(self)
     self.trophyMgr.generateWithRequired(2)
     self.cogSuitMgr = CogSuitManagerAI.CogSuitManagerAI()
     self.promotionMgr = PromotionManagerAI.PromotionManagerAI(self)
     self.cogPageManager = CogPageManagerAI.CogPageManagerAI()
     self.codeRedemptionMgr = TTCodeRedemptionMgrAI(self)
     self.codeRedemptionMgr.generateWithRequired(2)
     self.buildingQueryMgr = DistributedBuildingQueryMgrAI(self)
     self.buildingQueryMgr.generateWithRequired(2)
     if self.wantTopToons:
         self.topToonsMgr = TopToonsManagerAI(self)
     if self.wantKarts:
         self.leaderboardMgr = LeaderboardMgrAI(self)
     if self.wantFishing:
         self.fishManager = FishManagerAI(self)
     if self.wantHousing:
         self.estateManager = EstateManagerAI(self)
         self.estateManager.generateWithRequired(2)
         self.catalogManager = CatalogManagerAI(self)
         self.catalogManager.generateWithRequired(2)
     if self.wantPets:
         self.petMgr = PetManagerAI(self)
     if self.wantParties:
         self.partyManager = DistributedPartyManagerAI(self)
         self.partyManager.generateWithRequired(2)
         self.globalPartyMgr = self.generateGlobalObject(
             OTP_DO_ID_GLOBAL_PARTY_MANAGER, 'GlobalPartyManager')
Exemplo n.º 8
0
 def createGlobals(self):
     self.districtStats = ToontownDistrictStatsAI(self)
     self.districtStats.settoontownDistrictId(self.districtId)
     self.districtStats.generateWithRequiredAndId(self.allocateChannel(),
                                                  self.getGameDoId(),
                                                  OTP_ZONE_ID_DISTRICTS)
     self.notify.info('Created district stats AI (%d).' %
                      self.districtStats.doId)
     self.timeManager = TimeManagerAI(self)
     self.timeManager.generateWithRequired(OTP_ZONE_ID_MANAGEMENT)
     self.newsManager = NewsManagerAI(self)
     self.newsManager.generateWithRequired(OTP_ZONE_ID_MANAGEMENT)
     self.suitInvasionManager = SuitInvasionManagerAI(self)
     self.holidayManager = HolidayManagerAI(self)
     self.magicWordManager = MagicWordManagerAI(self)
     self.magicWordManager.generateWithRequired(OTP_ZONE_ID_MANAGEMENT)
     self.friendManager = FriendManagerAI(self)
     self.friendManager.generateWithRequired(OTP_ZONE_ID_MANAGEMENT)
     self.sillyMeterMgr = DistributedSillyMeterMgrAI(self)
     self.sillyMeterMgr.generateWithRequired(OTP_ZONE_ID_MANAGEMENT)
     if config.GetBool('want-code-redemption', True):
         self.codeRedemptionMgr = TTCodeRedemptionMgrAI(self)
         self.codeRedemptionMgr.generateWithRequired(OTP_ZONE_ID_MANAGEMENT)
     if config.GetBool('want-parties', True):
         self.partyManager = DistributedPartyManagerAI(self)
         self.partyManager.generateWithRequired(OTP_ZONE_ID_MANAGEMENT)
         self.globalPartyMgr = self.generateGlobalObject(
             OTP_DO_ID_GLOBAL_PARTY_MANAGER, 'GlobalPartyManager')
     if config.GetBool('want-estates', True):
         self.estateManager = EstateManagerAI(self)
         self.estateManager.generateWithRequired(OTP_ZONE_ID_MANAGEMENT)
     self.trophyMgr = DistributedTrophyMgrAI(self)
     self.trophyMgr.generateWithRequired(OTP_ZONE_ID_MANAGEMENT)
     if simbase.wantPets:
         self.petMgr = PetManagerAI(self)
     self.tutorialManager = TutorialManagerAI(self)
     self.tutorialManager.generateWithRequired(OTP_ZONE_ID_MANAGEMENT)
     self.catalogManager = CatalogManagerAI(self)
     self.catalogManager.generateWithRequired(OTP_ZONE_ID_MANAGEMENT)
     if config.GetBool('want-event-manager', False):
         self.eventManager = DistributedEventManagerAI(self)
         self.eventManager.generateWithRequired(OTP_ZONE_ID_MANAGEMENT)
     if config.GetBool('want-news-page', False):
         self.inGameNewsMgr = DistributedInGameNewsMgrAI(self)
         self.inGameNewsMgr.setLatestIssueStr('2013-08-22 23:49:46')
         self.inGameNewsMgr.generateWithRequired(OTP_ZONE_ID_MANAGEMENT)
     self.banManager = self.generateGlobalObject(OTP_DO_ID_BAN_MANAGER,
                                                 'BanManager')
Exemplo n.º 9
0
    def createLocals(self):
        """
        Creates "local" (non-distributed) objects.
        """

        # Create our holiday manager...
        self.holidayManager = HolidayManagerAI(self)

        # Create our zone data store...
        self.zoneDataStore = AIZoneDataStore()

        # Create our pet manager...
        self.petMgr = PetManagerAI(self)

        # Create our suit invasion manager...
        self.suitInvasionManager = SuitInvasionManagerAI(self)

        # Create our zone allocator...
        self.zoneAllocator = UniqueIdAllocator(
            ToontownGlobals.DynamicZonesBegin, ToontownGlobals.DynamicZonesEnd)

        # Create our quest manager...
        self.questManager = QuestManagerAI(self)

        # Create our promotion manager...
        self.promotionMgr = PromotionManagerAI(self)

        # Create our Cog page manager...
        self.cogPageManager = CogPageManagerAI(self)

        # Create our race manager...
        self.raceMgr = RaceManagerAI(self)

        # Create our country club manager...
        self.countryClubMgr = CountryClubManagerAI(self)

        # Create our factory manager...
        self.factoryMgr = FactoryManagerAI(self)

        # Create our mint manager...
        self.mintMgr = MintManagerAI(self)

        # Create our law office manager...
        self.lawMgr = LawOfficeManagerAI(self)

        # Create our Cog suit manager...
        self.cogSuitMgr = CogSuitManagerAI(self)
Exemplo n.º 10
0
 def createManagers(self):
     self.timeManager = TimeManagerAI(self)
     self.timeManager.generateWithRequired(2)
     self.magicWordManager = MagicWordManagerAI(self)
     self.magicWordManager.generateWithRequired(2)
     self.newsManager = NewsManagerAI(self)
     self.newsManager.generateWithRequired(2)
     self.safeZoneManager = SafeZoneManagerAI(self)
     self.safeZoneManager.generateWithRequired(2)
     self.tutorialManager = TutorialManagerAI(self)
     self.tutorialManager.generateWithRequired(2)
     self.friendManager = FriendManagerAI(self)
     self.friendManager.generateWithRequired(2)
     self.questManager = QuestManagerAI(self)
     self.banManager = BanManagerAI.BanManagerAI(self)
     self.achievementsManager = AchievementsManagerAI(self)
     self.suitInvasionManager = SuitInvasionManagerAI(self)
     self.codeRedemptionMgr = TTCodeRedemptionMgrAI(self)
     self.codeRedemptionMgr.generateWithRequired(2)
     self.trophyMgr = DistributedTrophyMgrAI(self)
     self.trophyMgr.generateWithRequired(2)
     self.cogSuitMgr = CogSuitManagerAI.CogSuitManagerAI(self)
     self.promotionMgr = PromotionManagerAI.PromotionManagerAI(self)
     self.cogPageManager = CogPageManagerAI.CogPageManagerAI()
     self.bankManager = BankManagerAI.BankManagerAI(self)
     self.holidayManager = HolidayManagerAI(self)
     if self.wantFishing:
         self.fishManager = FishManagerAI(self)
     if self.wantHousing:
         self.estateManager = EstateManagerAI(self)
         self.estateManager.generateWithRequired(2)
         self.catalogManager = CatalogManagerAI(self)
         self.catalogManager.generateWithRequired(2)
         self.popularItemManager = PopularItemManagerAI(self)
         self.deliveryManager = self.generateGlobalObject(
             OTP_DO_ID_TOONTOWN_DELIVERY_MANAGER, 'DistributedDeliveryManager')
     if self.wantPets:
         self.petMgr = PetManagerAI(self)
     if self.wantParties:
         self.partyManager = DistributedPartyManagerAI(self)
         self.partyManager.generateWithRequired(2)
         self.globalPartyMgr = self.generateGlobalObject(
             OTP_DO_ID_GLOBAL_PARTY_MANAGER, 'GlobalPartyManager')
Exemplo 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 = {}
Exemplo n.º 12
0
 def createManagers(self):
     self.timeManager = TimeManagerAI(self)
     self.timeManager.generateWithRequired(2)
     self.magicWordManager = MagicWordManagerAI(self)
     self.magicWordManager.generateWithRequired(2)
     self.newsManager = NewsManagerAI(self)
     self.newsManager.generateWithRequired(2)
     self.holidayManager = HolidayManagerAI(self)
     self.safeZoneManager = SafeZoneManagerAI(self)
     self.safeZoneManager.generateWithRequired(2)
     self.tutorialManager = TutorialManagerAI(self)
     self.tutorialManager.generateWithRequired(2)
     self.friendManager = FriendManagerAI(self)
     self.friendManager.generateWithRequired(2)
     self.questManager = QuestManagerAI(self)
     self.banManager = BanManagerAI.BanManagerAI(self)
     self.achievementsManager = AchievementsManagerAI(self)
     self.suitInvasionManager = SuitInvasionManagerAI(self)
     self.trophyMgr = DistributedTrophyMgrAI(self)
     self.trophyMgr.generateWithRequired(2)
     self.cogSuitMgr = CogSuitManagerAI.CogSuitManagerAI(self)
     self.promotionMgr = PromotionManagerAI.PromotionManagerAI(self)
     self.cogPageManager = CogPageManagerAI.CogPageManagerAI()
     self.bankManager = BankManagerAI.BankManagerAI(self)
     if self.wantFishing:
         self.fishManager = FishManagerAI(self)
     if self.wantHousing:
         self.estateManager = EstateManagerAI(self)
         self.estateManager.generateWithRequired(2)
         self.catalogManager = CatalogManagerAI(self)
         self.catalogManager.generateWithRequired(2)
         self.popularItemManager = PopularItemManagerAI(self)
         self.deliveryManager = self.generateGlobalObject(
             OTP_DO_ID_TOONTOWN_DELIVERY_MANAGER,
             'DistributedDeliveryManager')
     if self.wantPets:
         self.petMgr = PetManagerAI(self)
     if self.wantParties:
         self.partyManager = DistributedPartyManagerAI(self)
         self.partyManager.generateWithRequired(2)
         self.globalPartyMgr = self.generateGlobalObject(
             OTP_DO_ID_GLOBAL_PARTY_MANAGER, 'GlobalPartyManager')
Exemplo n.º 13
0
 def createLocals(self):
     self.holidayManager = HolidayManagerAI(self)
     self.zoneDataStore = AIZoneDataStore()
     self.petMgr = PetManagerAI(self)
     self.suitInvasionManager = SuitInvasionManagerAI(self)
     self.zoneAllocator = UniqueIdAllocator(
         ToontownGlobals.DynamicZonesBegin, ToontownGlobals.DynamicZonesEnd)
     self.questManager = QuestManagerAI(self)
     self.cogPageManager = CogPageManagerAI(self)
     self.fishManager = FishManagerAI(self)
     self.factoryMgr = FactoryManagerAI(self)
     self.mintMgr = MintManagerAI(self)
     self.lawMgr = LawOfficeManagerAI(self)
     self.countryClubMgr = CountryClubManagerAI(self)
     self.promotionMgr = PromotionManagerAI(self)
     self.cogSuitMgr = CogSuitManagerAI(self)
     self.raceMgr = RaceManagerAI(self)
     self.toontownTimeManager = ToontownTimeManager(
         serverTimeUponLogin=int(time.time()),
         globalClockRealTimeUponLogin=globalClock.getRealTime())
Exemplo n.º 14
0
class ToontownAIRepository(ToontownInternalRepository):
    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)
        self.wantYinYang = self.config.GetBool('want-yin-yang', 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 createManagers(self):
        self.timeManager = TimeManagerAI(self)
        self.timeManager.generateWithRequired(2)
        self.magicWordManager = MagicWordManagerAI(self)
        self.magicWordManager.generateWithRequired(2)
        self.newsManager = NewsManagerAI(self)
        self.newsManager.generateWithRequired(2)
        self.safeZoneManager = SafeZoneManagerAI(self)
        self.safeZoneManager.generateWithRequired(2)
        self.tutorialManager = TutorialManagerAI(self)
        self.tutorialManager.generateWithRequired(2)
        self.friendManager = FriendManagerAI(self)
        self.friendManager.generateWithRequired(2)
        self.questManager = QuestManagerAI(self)
        self.banManager = BanManagerAI.BanManagerAI(self)
        self.achievementsManager = AchievementsManagerAI(self)
        self.suitInvasionManager = SuitInvasionManagerAI(self)
        self.codeRedemptionMgr = TTCodeRedemptionMgrAI(self)
        self.codeRedemptionMgr.generateWithRequired(2)
        self.trophyMgr = DistributedTrophyMgrAI(self)
        self.trophyMgr.generateWithRequired(2)
        self.cogSuitMgr = CogSuitManagerAI.CogSuitManagerAI(self)
        self.promotionMgr = PromotionManagerAI.PromotionManagerAI(self)
        self.cogPageManager = CogPageManagerAI.CogPageManagerAI()
        self.bankManager = BankManagerAI.BankManagerAI(self)
        self.holidayManager = HolidayManagerAI(self)
        if self.wantFishing:
            self.fishManager = FishManagerAI(self)
        if self.wantHousing:
            self.estateManager = EstateManagerAI(self)
            self.estateManager.generateWithRequired(2)
            self.catalogManager = CatalogManagerAI(self)
            self.catalogManager.generateWithRequired(2)
            self.popularItemManager = PopularItemManagerAI(self)
            self.deliveryManager = self.generateGlobalObject(
                OTP_DO_ID_TOONTOWN_DELIVERY_MANAGER, 'DistributedDeliveryManager')
        if self.wantPets:
            self.petMgr = PetManagerAI(self)
        if self.wantParties:
            self.partyManager = DistributedPartyManagerAI(self)
            self.partyManager.generateWithRequired(2)
            self.globalPartyMgr = self.generateGlobalObject(
                OTP_DO_ID_GLOBAL_PARTY_MANAGER, 'GlobalPartyManager')

    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 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 handleConnected(self):
        self.districtId = self.allocateChannel()
        self.notify.info('Creating ToontownDistrictAI(%d)...' % self.districtId)
        self.distributedDistrict = ToontownDistrictAI(self)
        self.distributedDistrict.setName(self.districtName)
        self.distributedDistrict.generateWithRequiredAndId(
            self.districtId, self.getGameDoId(), 2)
        self.notify.info('Claiming ownership of channel ID: %d...' % self.districtId)
        self.claimOwnership(self.districtId)

        self.districtStats = ToontownDistrictStatsAI(self)
        self.districtStats.settoontownDistrictId(self.districtId)
        self.districtStats.generateWithRequiredAndId(
            self.allocateChannel(), self.getGameDoId(), 3)
        self.notify.info('Created ToontownDistrictStats(%d)' % self.districtStats.doId)
        self.notify.info('Creating managers...')
        self.createManagers()
        if self.config.GetBool('want-safe-zones', True):
            self.notify.info('Creating safe zones...')
            self.createSafeZones()
        if self.config.GetBool('want-cog-headquarters', True):
            self.notify.info('Creating Cog headquarters...')
            self.createCogHeadquarters()
        self.notify.info('Setting up cog invasions...')
        self.suitInvasionManager.handleInvasions()

        self.notify.info('Making district available...')
        self.distributedDistrict.b_setAvailable(1)
        self.notify.info('Done.')

    def claimOwnership(self, channelId):
        datagram = PyDatagram()
        datagram.addServerHeader(channelId, self.ourChannel, STATESERVER_OBJECT_SET_AI)
        datagram.addChannel(self.ourChannel)
        self.send(datagram)

    def lookupDNAFileName(self, zoneId):
        zoneId = ZoneUtil.getCanonicalZoneId(zoneId)
        hoodId = ZoneUtil.getCanonicalHoodId(zoneId)
        hood = ToontownGlobals.dnaMap[hoodId]
        if hoodId == zoneId:
            zoneId = 'sz'
            phaseNum = ToontownGlobals.phaseMap[hoodId]
        else:
            phaseNum = ToontownGlobals.streetPhaseMap[hoodId]
        return 'phase_%s/dna/%s_%s.pdna' % (phaseNum, hood, zoneId)

    def loadDNAFileAI(self, dnastore, filename):
        return loadDNAFileAI(dnastore, filename)

    def incrementPopulation(self):
        self.districtStats.b_setAvatarCount(self.districtStats.getAvatarCount() + 1)

    def decrementPopulation(self):
        self.districtStats.b_setAvatarCount(self.districtStats.getAvatarCount() - 1)

    def allocateZone(self):
        return self.zoneAllocator.allocate()

    def deallocateZone(self, zone):
        self.zoneAllocator.free(zone)

    def getZoneDataStore(self):
        return self.zoneDataStore

    def getTrackClsends(self):
        return self.wantTrackClsends

    def getAvatarExitEvent(self, avId):
        return 'distObjDelete-%d' % avId

    def trueUniqueName(self, name):
        return self.uniqueName(name)
Exemplo n.º 15
0
    def createManagers(self):
        self.timeManager = TimeManagerAI(self)
        self.timeManager.generateWithRequired(2)
        self.magicWordManager = MagicWordManagerAI(self)
        self.magicWordManager.generateWithRequired(2)
        self.newsManager = NewsManagerAI(self)
        self.newsManager.generateWithRequired(2)
        self.safeZoneManager = SafeZoneManagerAI(self)
        self.safeZoneManager.generateWithRequired(2)
        self.tutorialManager = TutorialManagerAI(self)
        self.tutorialManager.generateWithRequired(2)
        self.friendManager = FriendManagerAI(self)
        self.friendManager.generateWithRequired(2)
        self.questManager = QuestManagerAI(self)
        self.banManager = BanManagerAI.BanManagerAI(self)
        self.achievementsManager = AchievementsManagerAI(self)
        self.suitInvasionManager = SuitInvasionManagerAI(self)
        self.trophyMgr = DistributedTrophyMgrAI(self)
        self.trophyMgr.generateWithRequired(2)
        self.cogSuitMgr = CogSuitManagerAI.CogSuitManagerAI(self)
        self.promotionMgr = PromotionManagerAI.PromotionManagerAI(self)
        self.experienceMgr = ExperienceRewardManagerAI.ExperienceRewardManagerAI(
            self)
        self.cogPageManager = CogPageManagerAI.CogPageManagerAI()
        self.sillyMeterMgr = DistributedSillyMeterMgrAI.DistributedSillyMeterMgrAI(
            self)
        self.sillyMeterMgr.generateWithRequired(2)
        self.hydrantZeroMgr = DistributedHydrantZeroMgrAI.DistributedHydrantZeroMgrAI(
            self)
        self.hydrantZeroMgr.generateWithRequired(2)
        self.mailboxZeroMgr = DistributedMailboxZeroMgrAI.DistributedMailboxZeroMgrAI(
            self)
        self.mailboxZeroMgr.generateWithRequired(2)
        self.trashcanZeroMgr = DistributedTrashcanZeroMgrAI.DistributedTrashcanZeroMgrAI(
            self)
        self.trashcanZeroMgr.generateWithRequired(2)
        self.dialogueManager = DialogueManagerAI(self)
        self.holidayManager = HolidayManagerAI(self)

        if self.wantFishing:
            self.fishManager = FishManagerAI(self)

        if self.wantHousing:
            self.estateManager = EstateManagerAI(self)
            self.estateManager.generateWithRequired(2)
            self.catalogManager = CatalogManagerAI(self)
            self.catalogManager.generateWithRequired(2)
            self.popularItemManager = PopularItemManagerAI(self)
            self.deliveryManager = self.generateGlobalObject(
                OTP_DO_ID_TOONTOWN_DELIVERY_MANAGER,
                'DistributedDeliveryManager')
            self.mailManager = self.generateGlobalObject(
                OTP_DO_ID_TOONTOWN_MAIL_MANAGER, 'DistributedMailManager')

        if self.wantPets:
            self.petMgr = PetManagerAI(self)

        if self.wantParties:
            self.partyManager = DistributedPartyManagerAI(self)
            self.partyManager.generateWithRequired(2)
            self.globalPartyMgr = self.generateGlobalObject(
                OTP_DO_ID_GLOBAL_PARTY_MANAGER, 'GlobalPartyManager')

        if self.wantCharityScreen:
            self.charityCounter = CharityScreenAI(self)
            self.charityCounter.generateWithRequired(2)
            self.charityCounter.start()

        self.codeRedemptionMgr = simbase.air.generateGlobalObject(
            OTP_DO_ID_TOONTOWN_CODE_REDEMPTION_MANAGER, 'TTCodeRedemptionMgr')
        self.chatAgent = simbase.air.generateGlobalObject(
            OTP_DO_ID_CHAT_MANAGER, 'ChatAgent')