diff --git a/otp/ai/BanManagerAI.py b/otp/ai/BanManagerAI.py index f66fbe7d..bcc1ce5a 100644 --- a/otp/ai/BanManagerAI.py +++ b/otp/ai/BanManagerAI.py @@ -5,10 +5,10 @@ from direct.directnotify import DirectNotifyGlobal class BanManagerAI: notify = DirectNotifyGlobal.directNotify.newCategory('BanManagerAI') - BanUrl = simbase.config.GetString('ban-base-url', 'http://vapps.disl.starwave.com:8005/dis-hold/action/event') - App = simbase.config.GetString('ban-app-name', 'TTWorldAI') - Product = simbase.config.GetString('ban-product', 'Toontown') - EventName = simbase.config.GetString('ban-event-name', 'tthackattempt') + BanUrl = config.GetString('ban-base-url', 'http://vapps.disl.starwave.com:8005/dis-hold/action/event') + App = config.GetString('ban-app-name', 'TTWorldAI') + Product = config.GetString('ban-product', 'Toontown') + EventName = config.GetString('ban-event-name', 'tthackattempt') def __init__(self): self.curBanRequestNum = 0 @@ -34,7 +34,7 @@ class BanManagerAI: comment, fullUrl)) simbase.air.writeServerEvent('ban-request', avId=avatarId, dislid=dislid, comment=comment, fullUrl=fullUrl) - if simbase.config.GetBool('do-actual-ban', True): + if config.GetBool('do-actual-ban', True): newTaskName = 'ban-task-%d' % self.curBanRequestNum newTask = taskMgr.add(self.doBanUrlTask, newTaskName) newTask.banRequestNum = self.curBanRequestNum diff --git a/otp/level/DistributedLevelAI.py b/otp/level/DistributedLevelAI.py index 5596b575..9cb19f12 100644 --- a/otp/level/DistributedLevelAI.py +++ b/otp/level/DistributedLevelAI.py @@ -125,7 +125,7 @@ class DistributedLevelAI(DistributedObjectAI.DistributedObjectAI, Level.Level): if hash(self.levelSpec) != specHash: self.notify.info('spec hashes do not match, sending our spec') spec = self.levelSpec - useDisk = simbase.config.GetBool('spec-by-disk', 1) + useDisk = config.GetBool('spec-by-disk', 1) else: self.notify.info('spec hashes match, sending null spec') spec = None @@ -151,7 +151,7 @@ class DistributedLevelAI(DistributedObjectAI.DistributedObjectAI, Level.Level): self.modified = 1 self.scheduleAutosave() - AutosavePeriod = simbase.config.GetFloat('level-autosave-period-minutes', 5) + AutosavePeriod = config.GetFloat('level-autosave-period-minutes', 5) def scheduleAutosave(self): if hasattr(self, 'autosaveTask'): diff --git a/otp/otpbase/OTPLocalizer.py b/otp/otpbase/OTPLocalizer.py index 4bee0199..9440d5c1 100644 --- a/otp/otpbase/OTPLocalizer.py +++ b/otp/otpbase/OTPLocalizer.py @@ -1,12 +1,9 @@ from panda3d.core import * import string import types -try: - language = getConfigExpress().GetString('language', 'english') - checkLanguage = getConfigExpress().GetBool('check-language', 0) -except: - language = simbase.config.GetString('language', 'english') - checkLanguage = simbase.config.GetBool('check-language', 0) + +language = config.GetString('language', 'english') +checkLanguage = config.GetBool('check-language', 0) def getLanguage(): return language diff --git a/toontown/ai/ToontownAIRepository.py b/toontown/ai/ToontownAIRepository.py index 919738fc..98714075 100644 --- a/toontown/ai/ToontownAIRepository.py +++ b/toontown/ai/ToontownAIRepository.py @@ -27,7 +27,7 @@ from otp.friends.FriendManagerAI import FriendManagerAI from toontown.estate.EstateManagerAI import EstateManagerAI # Par-tay! -if simbase.config.GetBool('want-parties', True): +if config.GetBool('want-parties', True): from toontown.uberdog.DistributedPartyManagerAI import DistributedPartyManagerAI from otp.distributed.OtpDoGlobals import * @@ -176,7 +176,7 @@ class ToontownAIRepository(ToontownInternalRepository): self.friendManager = FriendManagerAI(self) self.friendManager.generateWithRequired(2) - if simbase.config.GetBool('want-parties', True): + if config.GetBool('want-parties', True): self.partyManager = DistributedPartyManagerAI(self) self.partyManager.generateWithRequired(2) @@ -224,19 +224,19 @@ class ToontownAIRepository(ToontownInternalRepository): self.hoods.append(GZHoodAI.GZHoodAI(self)) clearQueue() - if simbase.config.GetBool('want-sbhq', True): + if config.GetBool('want-sbhq', True): self.hoods.append(SellbotHQAI.SellbotHQAI(self)) clearQueue() - if simbase.config.GetBool('want-cbhq', True): + if config.GetBool('want-cbhq', True): self.hoods.append(CashbotHQAI.CashbotHQAI(self)) clearQueue() - if simbase.config.GetBool('want-lbhq', True): + if config.GetBool('want-lbhq', True): self.hoods.append(LawbotHQAI.LawbotHQAI(self)) clearQueue() - if simbase.config.GetBool('want-bbhq', True): + if config.GetBool('want-bbhq', True): self.hoods.append(BossbotHQAI.BossbotHQAI(self)) clearQueue() diff --git a/toontown/battle/BattleBase.py b/toontown/battle/BattleBase.py index 338b2503..9153ee1a 100644 --- a/toontown/battle/BattleBase.py +++ b/toontown/battle/BattleBase.py @@ -57,10 +57,7 @@ TOON_FIRE_SUIT_DELAY = 1.0 REWARD_TIMEOUT = 120 FLOOR_REWARD_TIMEOUT = 4 BUILDING_REWARD_TIMEOUT = 300 -try: - CLIENT_INPUT_TIMEOUT = base.config.GetFloat('battle-input-timeout', TTLocalizer.BBbattleInputTimeout) -except: - CLIENT_INPUT_TIMEOUT = simbase.config.GetFloat('battle-input-timeout', TTLocalizer.BBbattleInputTimeout) +CLIENT_INPUT_TIMEOUT = config.GetFloat('battle-input-timeout', TTLocalizer.BBbattleInputTimeout) def levelAffectsGroup(track, level): return attackAffectsGroup(track, level) diff --git a/toontown/battle/BattleCalculatorAI.py b/toontown/battle/BattleCalculatorAI.py index 3bd257a9..4c05bdce 100644 --- a/toontown/battle/BattleCalculatorAI.py +++ b/toontown/battle/BattleCalculatorAI.py @@ -26,13 +26,13 @@ class BattleCalculatorAI: KBBONUS_LURED_FLAG = 0 KBBONUS_TGT_LURED = 1 notify = DirectNotifyGlobal.directNotify.newCategory('BattleCalculatorAI') - toonsAlwaysHit = simbase.config.GetBool('toons-always-hit', 0) - toonsAlwaysMiss = simbase.config.GetBool('toons-always-miss', 0) - toonsAlways5050 = simbase.config.GetBool('toons-always-5050', 0) - suitsAlwaysHit = simbase.config.GetBool('suits-always-hit', 0) - suitsAlwaysMiss = simbase.config.GetBool('suits-always-miss', 0) - immortalSuits = simbase.config.GetBool('immortal-suits', 0) - propAndOrganicBonusStack = simbase.config.GetBool('prop-and-organic-bonus-stack', 0) + toonsAlwaysHit = config.GetBool('toons-always-hit', 0) + toonsAlwaysMiss = config.GetBool('toons-always-miss', 0) + toonsAlways5050 = config.GetBool('toons-always-5050', 0) + suitsAlwaysHit = config.GetBool('suits-always-hit', 0) + suitsAlwaysMiss = config.GetBool('suits-always-miss', 0) + immortalSuits = config.GetBool('immortal-suits', 0) + propAndOrganicBonusStack = config.GetBool('prop-and-organic-bonus-stack', 0) def __init__(self, battle, tutorialFlag = 0): self.battle = battle diff --git a/toontown/battle/SuitBattleGlobals.py b/toontown/battle/SuitBattleGlobals.py index 0b5d46db..30337498 100644 --- a/toontown/battle/SuitBattleGlobals.py +++ b/toontown/battle/SuitBattleGlobals.py @@ -72,7 +72,7 @@ def pickSuitAttack(attacks, suitLevel): break index = index + 1 - configAttackName = simbase.config.GetString('attack-type', 'random') + configAttackName = config.GetString('attack-type', 'random') if configAttackName == 'random': return attackNum elif configAttackName == 'sequence': diff --git a/toontown/building/DistributedBBElevatorAI.py b/toontown/building/DistributedBBElevatorAI.py index 458bbd35..3b8bd67e 100644 --- a/toontown/building/DistributedBBElevatorAI.py +++ b/toontown/building/DistributedBBElevatorAI.py @@ -10,7 +10,7 @@ class DistributedBBElevatorAI(DistributedBossElevatorAI.DistributedBossElevatorA def checkBoard(self, av): result = 0 - if simbase.config.GetBool('allow-ceo-elevator', True): + if config.GetBool('allow-ceo-elevator', True): result = DistributedBossElevatorAI.DistributedBossElevatorAI.checkBoard(self, av) else: result = REJECT_NOT_YET_AVAILABLE diff --git a/toontown/building/DistributedBuildingAI.py b/toontown/building/DistributedBuildingAI.py index 27b56120..44d28ecc 100644 --- a/toontown/building/DistributedBuildingAI.py +++ b/toontown/building/DistributedBuildingAI.py @@ -386,7 +386,7 @@ class DistributedBuildingAI(DistributedObjectAI.DistributedObjectAI): def enterToon(self): self.d_setState('toon') exteriorZoneId, interiorZoneId = self.getExteriorAndInteriorZoneId() - if simbase.config.GetBool('want-new-toonhall', 0) and ZoneUtil.getCanonicalZoneId(interiorZoneId) == ToonHall: + if config.GetBool('want-new-toonhall', 0) and ZoneUtil.getCanonicalZoneId(interiorZoneId) == ToonHall: self.interior = DistributedToonHallInteriorAI.DistributedToonHallInteriorAI(self.block, self.air, interiorZoneId, self) else: self.interior = DistributedToonInteriorAI.DistributedToonInteriorAI(self.block, self.air, interiorZoneId, self) diff --git a/toontown/building/DistributedBuildingMgrAI.py b/toontown/building/DistributedBuildingMgrAI.py index 3c1898b4..cf6679a1 100644 --- a/toontown/building/DistributedBuildingMgrAI.py +++ b/toontown/building/DistributedBuildingMgrAI.py @@ -244,7 +244,7 @@ class DistributedBuildingMgrAI: '$set': {'buildings': buildings}}, upsert=True) except AutoReconnect: # Something happened to our DB, but we can reconnect and retry. - taskMgr.doMethodLater(simbase.config.GetInt('mongodb-retry-time', 2), self.save, 'retrySave', extraArgs=[]) + taskMgr.doMethodLater(config.GetInt('mongodb-retry-time', 2), self.save, 'retrySave', extraArgs=[]) def load(self): blocks = {} @@ -260,7 +260,7 @@ class DistributedBuildingMgrAI: doc = self.air.mongodb.toontown.streets.find_one(street) except AutoReconnect: # We're failing over - normally we'd wait to retry, but this is on AI startup so we might want to retry (or refactor the bldgMgr so we can sanely retry). return blocks - + if not doc: return blocks diff --git a/toontown/building/DistributedClubElevatorAI.py b/toontown/building/DistributedClubElevatorAI.py index d5e20dfb..7e52ca45 100644 --- a/toontown/building/DistributedClubElevatorAI.py +++ b/toontown/building/DistributedClubElevatorAI.py @@ -26,7 +26,7 @@ class DistributedClubElevatorAI(DistributedElevatorFSMAI.DistributedElevatorFSMA 'Opening'], 'Closed': ['Opening']} id = 0 - DoBlockedRoomCheck = simbase.config.GetBool('elevator-blocked-rooms-check', 1) + DoBlockedRoomCheck = config.GetBool('elevator-blocked-rooms-check', 1) def __init__(self, air, lawOfficeId, bldg, avIds, markerId = None, numSeats = 4, antiShuffle = 0, minLaff = 0): DistributedElevatorFSMAI.DistributedElevatorFSMAI.__init__(self, air, bldg, numSeats, antiShuffle=antiShuffle, minLaff=minLaff) diff --git a/toontown/building/DistributedDoorAI.py b/toontown/building/DistributedDoorAI.py index 20c1d509..74032c2e 100644 --- a/toontown/building/DistributedDoorAI.py +++ b/toontown/building/DistributedDoorAI.py @@ -95,7 +95,7 @@ class DistributedDoorAI(DistributedObjectAI.DistributedObjectAI): self.lockedDoor = locked def isLockedDoor(self): - if simbase.config.GetBool('no-locked-doors', 0): + if config.GetBool('no-locked-doors', 0): return 0 else: return self.lockedDoor diff --git a/toontown/building/DistributedElevatorIntAI.py b/toontown/building/DistributedElevatorIntAI.py index 01771bde..551715c4 100644 --- a/toontown/building/DistributedElevatorIntAI.py +++ b/toontown/building/DistributedElevatorIntAI.py @@ -14,7 +14,7 @@ class DistributedElevatorIntAI(DistributedElevatorAI.DistributedElevatorAI): def __init__(self, air, bldg, avIds): DistributedElevatorAI.DistributedElevatorAI.__init__(self, air, bldg) - self.countdownTime = simbase.config.GetFloat('int-elevator-timeout', INTERIOR_ELEVATOR_COUNTDOWN_TIME) + self.countdownTime = config.GetFloat('int-elevator-timeout', INTERIOR_ELEVATOR_COUNTDOWN_TIME) self.avIds = copy.copy(avIds) for avId in avIds: self.acceptOnce(self.air.getAvatarExitEvent(avId), self.__handleAllAvsUnexpectedExit, extraArgs=[avId]) diff --git a/toontown/building/SuitPlannerInteriorAI.py b/toontown/building/SuitPlannerInteriorAI.py index f58a6d44..fb1f1557 100644 --- a/toontown/building/SuitPlannerInteriorAI.py +++ b/toontown/building/SuitPlannerInteriorAI.py @@ -15,7 +15,7 @@ class SuitPlannerInteriorAI: self.zoneId = zone self.numFloors = numFloors self.respectInvasions = 1 - dbg_defaultSuitName = simbase.config.GetString('suit-type', 'random') + dbg_defaultSuitName = config.GetString('suit-type', 'random') if dbg_defaultSuitName == 'random': self.dbg_defaultSuitType = None else: diff --git a/toontown/catalog/CatalogAccessoryItem.py b/toontown/catalog/CatalogAccessoryItem.py index 6e702852..d89054e9 100644 --- a/toontown/catalog/CatalogAccessoryItem.py +++ b/toontown/catalog/CatalogAccessoryItem.py @@ -19,7 +19,7 @@ class CatalogAccessoryItem(CatalogItem.CatalogItem): return 1 def notOfferedTo(self, avatar): - if simbase.config.GetBool('want-accessories', 1): + if config.GetBool('want-accessories', 1): article = AccessoryTypes[self.accessoryType][ATArticle] if article in [AHat, AGlasses, diff --git a/toontown/catalog/CatalogFurnitureItem.py b/toontown/catalog/CatalogFurnitureItem.py index 19398acf..621c8025 100644 --- a/toontown/catalog/CatalogFurnitureItem.py +++ b/toontown/catalog/CatalogFurnitureItem.py @@ -1164,7 +1164,7 @@ def getAllClosets(): def get50ItemTrunk(avatar, duplicateItems): - if simbase.config.GetBool('want-accessories', 1): + if config.GetBool('want-accessories', 1): if avatar.getStyle().getGender() == 'm': index = 0 else: diff --git a/toontown/catalog/CatalogGenerator.py b/toontown/catalog/CatalogGenerator.py index 4866beda..172af544 100644 --- a/toontown/catalog/CatalogGenerator.py +++ b/toontown/catalog/CatalogGenerator.py @@ -1586,7 +1586,7 @@ class CatalogGenerator: return itemLists else: self.__releasedItemLists.clear() - testDaysAhead = simbase.config.GetInt('test-server-holiday-days-ahead', 0) + testDaysAhead = config.GetInt('test-server-holiday-days-ahead', 0) nowtuple = time.localtime(weekStart * 60 + testDaysAhead * 24 * 60 * 60) year = nowtuple[0] month = nowtuple[1] @@ -1616,7 +1616,7 @@ class CatalogGenerator: itemLists = self.__itemLists.get(dayNumber) if itemLists != None: return itemLists - testDaysAhead = simbase.config.GetInt('test-server-holiday-days-ahead', 0) + testDaysAhead = config.GetInt('test-server-holiday-days-ahead', 0) nowtuple = time.localtime(weekStart * 60 + testDaysAhead * 24 * 60 * 60) year = nowtuple[0] month = nowtuple[1] diff --git a/toontown/coghq/DistributedInGameEditorAI.py b/toontown/coghq/DistributedInGameEditorAI.py index 3b027508..4e37bb37 100644 --- a/toontown/coghq/DistributedInGameEditorAI.py +++ b/toontown/coghq/DistributedInGameEditorAI.py @@ -43,7 +43,7 @@ class DistributedInGameEditorAI(DistributedObjectAI.DistributedObjectAI): print 'requestCurrentLevelSpec' spec = self.level.levelSpec specStr = repr(spec) - largeBlob = DistributedLargeBlobSenderAI.DistributedLargeBlobSenderAI(self.air, self.zoneId, self.editorAvId, specStr, useDisk=simbase.config.GetBool('spec-by-disk', 1)) + largeBlob = DistributedLargeBlobSenderAI.DistributedLargeBlobSenderAI(self.air, self.zoneId, self.editorAvId, specStr, useDisk=config.GetBool('spec-by-disk', 1)) self.sendUpdateToAvatarId(self.editorAvId, 'setSpecSenderDoId', [largeBlob.doId]) def setEdit(self, entId, attribName, valueStr, username): diff --git a/toontown/coghq/LevelSuitPlannerAI.py b/toontown/coghq/LevelSuitPlannerAI.py index 06588d12..fa42627f 100644 --- a/toontown/coghq/LevelSuitPlannerAI.py +++ b/toontown/coghq/LevelSuitPlannerAI.py @@ -14,7 +14,7 @@ class LevelSuitPlannerAI(DirectObject.DirectObject): self.level = level self.cogCtor = cogCtor self.cogSpecs = cogSpecs - if simbase.config.GetBool('level-reserve-suits', 0): + if config.GetBool('level-reserve-suits', 0): self.reserveCogSpecs = reserveCogSpecs else: self.reserveCogSpecs = [] diff --git a/toontown/election/DistributedElectionEventAI.py b/toontown/election/DistributedElectionEventAI.py index 2abbeedf..dfe535f8 100644 --- a/toontown/election/DistributedElectionEventAI.py +++ b/toontown/election/DistributedElectionEventAI.py @@ -48,7 +48,7 @@ class DistributedElectionEventAI(DistributedObjectAI, FSM): # Pump some self.air into Slappy's Balloon self.balloon = DistributedHotAirBalloonAI(self.air) self.balloon.generateWithRequired(self.zoneId) - if simbase.config.GetBool('want-doomsday', False): + if config.GetBool('want-doomsday', False): # It's Election day! self.balloon.b_setState('ElectionIdle') # Better spawn some cameras @@ -234,7 +234,7 @@ class DistributedElectionEventAI(DistributedObjectAI, FSM): @magicWord(category=CATEGORY_MODERATION, types=[str]) def election(state): - if not simbase.config.GetBool('want-doomsday', False): + if not config.GetBool('want-doomsday', False): simbase.air.writeServerEvent('warning', avId=spellbook.getInvoker().doId, issue='Attempted to change the election state while doomsday is disabled.') return 'ABOOSE! The election is currently disabled. Your request has been logged.' diff --git a/toontown/election/DistributedSafezoneInvasionAI.py b/toontown/election/DistributedSafezoneInvasionAI.py index 47083d41..cf32a1a7 100644 --- a/toontown/election/DistributedSafezoneInvasionAI.py +++ b/toontown/election/DistributedSafezoneInvasionAI.py @@ -31,7 +31,7 @@ class DistributedSafezoneInvasionAI(DistributedObjectAI, FSM): def announceGenerate(self): self.b_setInvasionStarted(True) self.demand('BeginWave', 0) - + # Kill all the butterflies in Toontown Central. #for butterfly in self.air.hoods[0].butterflies: #butterfly.requestDelete() @@ -45,17 +45,17 @@ class DistributedSafezoneInvasionAI(DistributedObjectAI, FSM): self._handleToonEnter(toon) self.accept('toon-entered-%s' % self.zoneId, self._handleToonEnter) self.accept('toon-left-%s' % self.zoneId, self._handleToonExit) - + def b_setInvasionStarted(self, started): self.setInvasionStarted(started) self.d_setInvasionStarted(started) - + def setInvasionStarted(self, started): self.invasionOn = started - + def d_setInvasionStarted(self, started): self.sendUpdate('setInvasionStarted', [started]) - + def getInvasionStarted(self): return self.invasionOn @@ -196,7 +196,7 @@ class DistributedSafezoneInvasionAI(DistributedObjectAI, FSM): def enterFinale(self): self._delay = taskMgr.doMethodLater(20, self.spawnFinaleSuit, self.uniqueName('summon-finale-suit')) - + def spawnFinaleSuit(self, task): self.election.saySurleePhrase('This is it, toons. They\'re sending in the boss! Brace yourselves, this will be the toughest one yet!', 1, True) suit = DistributedInvasionSuitAI(self.air, self) @@ -229,12 +229,12 @@ class DistributedSafezoneInvasionAI(DistributedObjectAI, FSM): def enterVictory(self): self.b_setInvasionStarted(False) - + for toon in self.toons: toon.toonUp(toon.getMaxHp()) for toon in self.sadToons: toon.toonUp(toon.getMaxHp()) - + taskMgr.doMethodLater(65, self.wrapUp, self.uniqueName('WrapUp-Later')) def wrapUp(self, task): @@ -293,7 +293,7 @@ class DistributedSafezoneInvasionAI(DistributedObjectAI, FSM): toon.takeDamage(toonHp) else: toon.takeDamage(damage) - + self.checkToonHp() def pieHitToon(self, doId): @@ -398,7 +398,7 @@ class DistributedSafezoneInvasionAI(DistributedObjectAI, FSM): if self.waveNumber not in SafezoneInvasionGlobals.SuitIntermissionWaves and self.numberOfSuits > 0: self.numberOfSuits = self.numberOfSuits - 1 - # Delay spawing the suits + # Delay spawing the suits taskMgr.doMethodLater(1, self.spawnOne, self.uniqueName('summon-suit-%s' % self.numberOfSuits), extraArgs=[suit.getStyleName(), suit.getLevel()]) self.suits.remove(suit) @@ -407,10 +407,10 @@ class DistributedSafezoneInvasionAI(DistributedObjectAI, FSM): @magicWord(category=CATEGORY_DEBUG, types=[str, str]) def szInvasion(cmd, arg=''): - if not simbase.config.GetBool('want-doomsday', False): + if not config.GetBool('want-doomsday', False): simbase.air.writeServerEvent('warning', avId=spellbook.getInvoker().doId, issue='Attempted to initiate doomsday while it is disabled.') return 'ABOOSE! Doomsday is currently disabled. Your request has been logged.' - + invasion = simbase.air.doFind('SafezoneInvasion') if invasion is None and cmd != 'start': diff --git a/toontown/election/PathPlannerPoolAI.py b/toontown/election/PathPlannerPoolAI.py index 7c653a2e..37e8440f 100644 --- a/toontown/election/PathPlannerPoolAI.py +++ b/toontown/election/PathPlannerPoolAI.py @@ -11,7 +11,7 @@ class PlanD: # I couldn't resist the name. :) pathPath = os.path.join(os.path.dirname(__file__), 'pathd.py') - if not simbase.config.GetBool('want-doomsday', False) and os.name == 'nt': + if not config.GetBool('want-doomsday', False) and os.name == 'nt': # Hack out Windows crash when doomsday is disabled. # If you want to run doomsday on windows (server), you'll need to use the following: # self.sp = subprocess.Popen([r'/path/to/p3d/linked/python.exe', pathPath], stdin=subprocess.PIPE, stdout=subprocess.PIPE) @@ -81,4 +81,4 @@ class PlannerPool: job = PlanJob(callback, navFrom, navTo, radius) self.addJob(job) -pool = PlannerPool(simbase.config.GetInt('doomsday-threads', 0)) +pool = PlannerPool(config.GetInt('doomsday-threads', 0)) diff --git a/toontown/friends/TTRFriendsManagerUD.py b/toontown/friends/TTRFriendsManagerUD.py index 776fc352..f28bdc80 100644 --- a/toontown/friends/TTRFriendsManagerUD.py +++ b/toontown/friends/TTRFriendsManagerUD.py @@ -37,7 +37,7 @@ class GetToonDataFSM(FSM): def enterFinished(self): # We want to cache the basic information we got for GetFriendsListFSM. self.mgr.avBasicInfoCache[self.avId] = { - 'expire' : time() + simbase.config.GetInt('friend-detail-cache-expire', 3600), + 'expire' : time() + config.GetInt('friend-detail-cache-expire', 3600), 'toonInfo' : [self.avId, self.fields['setName'][0], self.fields['setDNAString'][0], self.fields['setPetId'][0]], } self.callback(success=True, requesterId=self.requesterId, fields=self.fields) diff --git a/toontown/golf/DistributedGolfHoleAI.py b/toontown/golf/DistributedGolfHoleAI.py index a7fb9336..d367f752 100644 --- a/toontown/golf/DistributedGolfHoleAI.py +++ b/toontown/golf/DistributedGolfHoleAI.py @@ -213,7 +213,7 @@ class DistributedGolfHoleAI(DistributedPhysicsWorldAI.DistributedPhysicsWorldAI, curNodePath = self.hardSurfaceNodePath.find('**/locator%d' % locatorNum) def loadBlockers(self): - loadAll = simbase.config.GetBool('golf-all-blockers', 0) + loadAll = config.GetBool('golf-all-blockers', 0) self.createLocatorDict() self.blockerNums = self.holeInfo['blockers'] for locatorNum in self.locDict: diff --git a/toontown/hood/CogHoodAI.py b/toontown/hood/CogHoodAI.py index 7f91fe13..7d2f614c 100644 --- a/toontown/hood/CogHoodAI.py +++ b/toontown/hood/CogHoodAI.py @@ -10,19 +10,19 @@ class CogHoodAI(HoodAI): """ This class is an AI-sided representation of a single cog neighborhood in Toontown. - + A sub-class of this class exists for each of the 4 types of cog neighborhoods. CogHoodAIs are responsible for spawning the Cog Elevators, Cog Doors and the SuitPlanners. """ - + def __init__(self, air): HoodAI.__init__(self, air) self.doors = [] self.elevators = [] self.suitPlanners = [] self.lobbyMgr = None - + def createElevator(self, dclass, mgr, extZone, intZone, index=0, minLaff=0, boss=False): if boss: elevator = dclass(self.air, mgr, intZone, antiShuffle=self.air.config.GetInt('want-anti-shuffle', 0), minLaff=minLaff) @@ -31,13 +31,13 @@ class CogHoodAI(HoodAI): elevator.generateWithRequired(extZone) self.elevators.append(elevator) return elevator - + def createDoor(self): # Overridable by sub-class. pass - + def createBoardingGroup(self, air, elevators, zone, maxSize=4): - if simbase.config.GetBool('want-boarding-groups', True): + if config.GetBool('want-boarding-groups', True): boardingGroup = DistributedBoardingPartyAI.DistributedBoardingPartyAI(air, elevators, maxSize) boardingGroup.generateWithRequired(zone) @@ -48,7 +48,7 @@ class CogHoodAI(HoodAI): sp.initTasks() self.air.suitPlanners[zone] = sp self.suitPlanners.append(sp) - + def createLobbyManager(self, boss, zone): self.lobbyMgr = LobbyManagerAI(self.air, boss) self.lobbyMgr.generateWithRequired(zone) diff --git a/toontown/minigame/DistributedCogThiefGameAI.py b/toontown/minigame/DistributedCogThiefGameAI.py index f4ae075c..0ec1c812 100644 --- a/toontown/minigame/DistributedCogThiefGameAI.py +++ b/toontown/minigame/DistributedCogThiefGameAI.py @@ -391,8 +391,8 @@ class DistributedCogThiefGameAI(DistributedMinigameAI.DistributedMinigameAI): numStolen += 1 self.notify.debug('numStolen = %s' % numStolen) - if simbase.config.GetBool('cog-thief-check-barrels', 1): - if not simbase.config.GetBool('cog-thief-endless', 0): + if config.GetBool('cog-thief-check-barrels', 1): + if not config.GetBool('cog-thief-endless', 0): if numStolen == len(self.barrelInfo): self.gameOver() @@ -402,7 +402,7 @@ class DistributedCogThiefGameAI(DistributedMinigameAI.DistributedMinigameAI): return Task.done def getNumCogs(self): - result = simbase.config.GetInt('cog-thief-num-cogs', 0) + result = config.GetInt('cog-thief-num-cogs', 0) if not result: safezone = self.getSafezoneId() result = CTGG.calculateCogs(self.numPlayers, safezone) diff --git a/toontown/minigame/MinigameCreatorAI.py b/toontown/minigame/MinigameCreatorAI.py index 7f3c0afb..f4932de7 100644 --- a/toontown/minigame/MinigameCreatorAI.py +++ b/toontown/minigame/MinigameCreatorAI.py @@ -22,10 +22,10 @@ import DistributedTwoDGameAI import DistributedTravelGameAI import TravelGameGlobals from otp.ai.MagicWordGlobal import * -ALLOW_TEMP_MINIGAMES = simbase.config.GetBool('allow-temp-minigames', False) +ALLOW_TEMP_MINIGAMES = config.GetBool('allow-temp-minigames', False) if ALLOW_TEMP_MINIGAMES: from toontown.minigame.TempMinigameAI import * -simbase.forcedMinigameId = simbase.config.GetInt('minigame-id', 0) +simbase.forcedMinigameId = config.GetInt('minigame-id', 0) RequestMinigame = {} MinigameZoneRefs = {} diff --git a/toontown/minigame/TempMinigameAI.py b/toontown/minigame/TempMinigameAI.py index c5242849..3023993a 100644 --- a/toontown/minigame/TempMinigameAI.py +++ b/toontown/minigame/TempMinigameAI.py @@ -1,5 +1,5 @@ from toontown.toonbase import ToontownGlobals -ALLOW_TEMP_MINIGAMES = simbase.config.GetBool('allow-temp-minigames', False) +ALLOW_TEMP_MINIGAMES = config.GetBool('allow-temp-minigames', False) TEMP_MG_ID_COUNTER = ToontownGlobals.TravelGameId - 1 TempMgCtors = {} diff --git a/toontown/safezone/DistributedGolfKartAI.py b/toontown/safezone/DistributedGolfKartAI.py index 5725b9e7..422d39c8 100644 --- a/toontown/safezone/DistributedGolfKartAI.py +++ b/toontown/safezone/DistributedGolfKartAI.py @@ -39,7 +39,7 @@ class DistributedGolfKartAI(DistributedObjectAI.DistributedObjectAI): else: self.color = (self.color[0], 255, self.color[2]) self.accepting = 0 - self.trolleyCountdownTime = simbase.config.GetFloat('trolley-countdown-time', TROLLEY_COUNTDOWN_TIME) + self.trolleyCountdownTime = config.GetFloat('trolley-countdown-time', TROLLEY_COUNTDOWN_TIME) self.fsm = ClassicFSM.ClassicFSM('DistributedGolfKartAI', [State.State('off', self.enterOff, self.exitOff, ['entering']), State.State('entering', self.enterEntering, self.exitEntering, ['waitEmpty']), State.State('waitEmpty', self.enterWaitEmpty, self.exitWaitEmpty, ['waitCountdown']), diff --git a/toontown/safezone/DistributedPartyGateAI.py b/toontown/safezone/DistributedPartyGateAI.py index 2abe7ec7..d36bfd64 100644 --- a/toontown/safezone/DistributedPartyGateAI.py +++ b/toontown/safezone/DistributedPartyGateAI.py @@ -39,7 +39,7 @@ class DistributedPartyGateAI(DistributedObjectAI): @dnaSpawn(DNAProp, 'prop_party_gate') def spawn(air, zone, element, match): - if not simbase.config.GetBool('want-parties', True): + if not config.GetBool('want-parties', True): # Parties are disabled, don't spawn the gate! return gate = DistributedPartyGateAI(air) diff --git a/toontown/safezone/DistributedTrolleyAI.py b/toontown/safezone/DistributedTrolleyAI.py index 9e1e76d0..daefe7d5 100644 --- a/toontown/safezone/DistributedTrolleyAI.py +++ b/toontown/safezone/DistributedTrolleyAI.py @@ -16,7 +16,7 @@ class DistributedTrolleyAI(DistributedObjectAI, FSM): DistributedObjectAI.__init__(self, air) FSM.__init__(self, 'DistributedTrolleyAI') - self.trolleyCountdownTime = simbase.config.GetFloat('trolley-countdown-time', TROLLEY_COUNTDOWN_TIME) + self.trolleyCountdownTime = config.GetFloat('trolley-countdown-time', TROLLEY_COUNTDOWN_TIME) self.slots = [None, None, None, None] self.boardable = False @@ -80,7 +80,7 @@ class DistributedTrolleyAI(DistributedObjectAI, FSM): if self.isNewbie(avId): newbieIds.append(avId) - + #if len(players) > 1 and not noTravel and not aiNoTravel: # mg = createMinigame(self.air, players, self.zoneId, metagameRound=0) #TODO: use holiday manager instead of this hardcoded shit #else: diff --git a/toontown/shtiker/PurchaseManagerAI.py b/toontown/shtiker/PurchaseManagerAI.py index 046eba66..efcc6338 100644 --- a/toontown/shtiker/PurchaseManagerAI.py +++ b/toontown/shtiker/PurchaseManagerAI.py @@ -285,7 +285,7 @@ class PurchaseManagerAI(DistributedObjectAI.DistributedObjectAI): else: newRound = 0 newVotesArray = [TravelGameGlobals.DefaultStartingVotes] * len(playAgainList) - if len(playAgainList) == 1 and simbase.config.GetBool('metagame-min-2-players', 1): + if len(playAgainList) == 1 and config.GetBool('metagame-min-2-players', 1): newRound = -1 MinigameCreatorAI.createMinigame(self.air, playAgainList, self.trolleyZone, minigameZone=self.zoneId, previousGameId=self.previousMinigameId, newbieIds=newbieIdsToPass, startingVotes=newVotesArray, metagameRound=newRound, desiredNextGame=self.desiredNextGame) else: diff --git a/toontown/suit/DistributedBossbotBossAI.py b/toontown/suit/DistributedBossbotBossAI.py index 8af2bab6..a1615a38 100644 --- a/toontown/suit/DistributedBossbotBossAI.py +++ b/toontown/suit/DistributedBossbotBossAI.py @@ -94,7 +94,7 @@ class DistributedBossbotBossAI(DistributedBossCogAI.DistributedBossCogAI, FSM.FS if battleNumber == 1: weakenedValue = ((1, 1), (2, 2), (2, 2), (1, 1), (1, 1, 1, 1, 1)) listVersion = list(SuitBuildingGlobals.SuitBuildingInfo) - if simbase.config.GetBool('bossbot-boss-cheat', False): + if config.GetBool('bossbot-boss-cheat', False): listVersion[14] = weakenedValue SuitBuildingGlobals.SuitBuildingInfo = tuple(listVersion) retval = self.invokeSuitPlanner(14, 0) @@ -328,7 +328,7 @@ class DistributedBossbotBossAI(DistributedBossCogAI.DistributedBossCogAI, FSM.FS def generateDinerSuits(self): diners = [] for i in xrange(len(self.notDeadList)): - if simbase.config.GetBool('bossbot-boss-cheat', False): + if config.GetBool('bossbot-boss-cheat', False): suit = self.__genSuitObject(self.zoneId, 2, 'c', 2, 0) else: info = self.notDeadList[i] @@ -339,7 +339,7 @@ class DistributedBossbotBossAI(DistributedBossCogAI.DistributedBossCogAI, FSM.FS active = [] for i in xrange(2): - if simbase.config.GetBool('bossbot-boss-cheat', False): + if config.GetBool('bossbot-boss-cheat', False): suit = self.__genSuitObject(self.zoneId, 2, 'c', 2, 0) else: suitType = 8 @@ -424,7 +424,7 @@ class DistributedBossbotBossAI(DistributedBossCogAI.DistributedBossCogAI, FSM.FS self.numToonsAtEnd += 1 toonHps.append(toon.hp) - self.air.writeServerEvent('ceoInfo', doId=self.doId, victory=didTheyWin, + self.air.writeServerEvent('ceoInfo', doId=self.doId, victory=didTheyWin, battleTIme=self.battleFourTimeInMin, difficulty=self.battleDifficulty, numToonsAtStart=self.numToonsAtStart, @@ -470,7 +470,7 @@ class DistributedBossbotBossAI(DistributedBossCogAI.DistributedBossCogAI, FSM.FS return bossDamage *= 2 bossDamage = min(self.getBossDamage() + bossDamage, self.bossMaxDamage) - if simbase.config.GetBool('bossbot-boss-cheat', False): + if config.GetBool('bossbot-boss-cheat', False): bossDamage = bossDamage + 250 self.b_setBossDamage(bossDamage, 0, 0) if self.bossDamage >= self.bossMaxDamage: diff --git a/toontown/suit/DistributedLawbotBossAI.py b/toontown/suit/DistributedLawbotBossAI.py index 886ce808..6ea9d25c 100644 --- a/toontown/suit/DistributedLawbotBossAI.py +++ b/toontown/suit/DistributedLawbotBossAI.py @@ -168,7 +168,7 @@ class DistributedLawbotBossAI(DistributedBossCogAI.DistributedBossCogAI, FSM.FSM def doNextAttack(self, task): for lawyer in self.lawyers: lawyer.doNextAttack(self) - + self.waitForNextAttack(ToontownGlobals.LawbotBossLawyerCycleTime) timeSinceLastAttack = globalClock.getFrameTime() - self.lastAreaAttackTime allowedByTime = 15 < timeSinceLastAttack or self.lastAreaAttackTime == 0 @@ -194,7 +194,7 @@ class DistributedLawbotBossAI(DistributedBossCogAI.DistributedBossCogAI, FSM.FSM ToontownGlobals.BossCogDirectedAttack, ToontownGlobals.BossCogDirectedAttack, ToontownGlobals.BossCogDirectedAttack]) - if attackCode == ToontownGlobals.BossCogAreaAttack: + if attackCode == ToontownGlobals.BossCogAreaAttack: self.__doAreaAttack() elif attackCode == ToontownGlobals.BossCogDirectedAttack: self.__doDirectedAttack() @@ -272,7 +272,7 @@ class DistributedLawbotBossAI(DistributedBossCogAI.DistributedBossCogAI, FSM.FSM (1, 1), (1, 1, 1, 1, 1)) listVersion = list(SuitBuildingGlobals.SuitBuildingInfo) - if simbase.config.GetBool('lawbot-boss-cheat', 0): + if config.GetBool('lawbot-boss-cheat', 0): listVersion[13] = weakenedValue SuitBuildingGlobals.SuitBuildingInfo = tuple(listVersion) return self.invokeSuitPlanner(13, 0) @@ -500,7 +500,7 @@ class DistributedLawbotBossAI(DistributedBossCogAI.DistributedBossCogAI, FSM.FSM jurorsOver = self.numToonJurorsSeated - ToontownGlobals.LawbotBossJurorsForBalancedScale dmgAdjust = jurorsOver * ToontownGlobals.LawbotBossDamagePerJuror self.b_setBossDamage(ToontownGlobals.LawbotBossInitialDamage + dmgAdjust, 0, 0) - if simbase.config.GetBool('lawbot-boss-cheat', 0): + if config.GetBool('lawbot-boss-cheat', 0): self.b_setBossDamage(ToontownGlobals.LawbotBossMaxDamage - 1, 0, 0) self.battleThreeStart = globalClock.getFrameTime() for toonId in self.involvedToons: diff --git a/toontown/suit/DistributedSuitAI.py b/toontown/suit/DistributedSuitAI.py index 56accc17..2d1c8eec 100644 --- a/toontown/suit/DistributedSuitAI.py +++ b/toontown/suit/DistributedSuitAI.py @@ -17,8 +17,8 @@ import random from SuitLegList import * class DistributedSuitAI(DistributedSuitBaseAI.DistributedSuitBaseAI): - SUIT_BUILDINGS = simbase.config.GetBool('want-suit-buildings', 1) - DEBUG_SUIT_POSITIONS = simbase.config.GetBool('debug-suit-positions', 0) + SUIT_BUILDINGS = config.GetBool('want-suit-buildings', 1) + DEBUG_SUIT_POSITIONS = config.GetBool('debug-suit-positions', 0) UPDATE_TIMESTAMP_INTERVAL = 180.0 myId = 0 notify = DirectNotifyGlobal.directNotify.newCategory('DistributedSuitAI') diff --git a/toontown/suit/DistributedSuitPlannerAI.py b/toontown/suit/DistributedSuitPlannerAI.py index b99ee3ed..204aae75 100644 --- a/toontown/suit/DistributedSuitPlannerAI.py +++ b/toontown/suit/DistributedSuitPlannerAI.py @@ -526,7 +526,7 @@ class DistributedSuitPlannerAI(DistributedObjectAI.DistributedObjectAI, SuitPlan TOTAL_BWEIGHT_PER_HEIGHT[3] += weight * heights[3] TOTAL_BWEIGHT_PER_HEIGHT[4] += weight * heights[4] - defaultSuitName = simbase.config.GetString('suit-type', 'random') + defaultSuitName = config.GetString('suit-type', 'random') if defaultSuitName == 'random': defaultSuitName = None notify = DirectNotifyGlobal.directNotify.newCategory('DistributedSuitPlannerAI') @@ -537,7 +537,7 @@ class DistributedSuitPlannerAI(DistributedObjectAI.DistributedObjectAI, SuitPlan self.air = air self.zoneId = zoneId self.canonicalZoneId = ZoneUtil.getCanonicalZoneId(zoneId) - if simbase.config.GetBool('want-cogdos', False): + if config.GetBool('want-cogdos', False): if not hasattr(self.__class__, 'CogdoPopAdjusted'): self.__class__.CogdoPopAdjusted = True for index in xrange(len(self.SuitHoodInfo)): @@ -582,10 +582,10 @@ class DistributedSuitPlannerAI(DistributedObjectAI.DistributedObjectAI, SuitPlan bldg.setSuitPlannerExt(self) self.initBuildingsAndPoints() - numSuits = simbase.config.GetInt('suit-count', -1) + numSuits = config.GetInt('suit-count', -1) if numSuits >= 0: self.currDesired = numSuits - suitHood = simbase.config.GetInt('suits-only-in-hood', -1) + suitHood = config.GetInt('suits-only-in-hood', -1) if suitHood >= 0: if self.SuitHoodInfo[self.hoodInfoIdx][self.SUIT_HOOD_INFO_ZONE] != suitHood: self.currDesired = 0 @@ -1299,7 +1299,7 @@ class DistributedSuitPlannerAI(DistributedObjectAI.DistributedObjectAI, SuitPlan toon.b_setBattleId(toonId) pos = self.battlePosDict[canonicalZoneId] interactivePropTrackBonus = -1 - if simbase.config.GetBool('props-buff-battles', False) and self.cellToGagBonusDict.has_key(canonicalZoneId): + if config.GetBool('props-buff-battles', False) and self.cellToGagBonusDict.has_key(canonicalZoneId): tentativeBonusTrack = self.cellToGagBonusDict[canonicalZoneId] trackToHolidayDict = {ToontownBattleGlobals.SQUIRT_TRACK: ToontownGlobals.HYDRANTS_BUFF_BATTLES, ToontownBattleGlobals.THROW_TRACK: ToontownGlobals.MAILBOXES_BUFF_BATTLES, @@ -1335,7 +1335,7 @@ class DistributedSuitPlannerAI(DistributedObjectAI.DistributedObjectAI, SuitPlan if len(battle.suits) >= 4: return 0 if battle: - if simbase.config.GetBool('suits-always-join', 0): + if config.GetBool('suits-always-join', 0): return 1 jChanceList = self.SuitHoodInfo[self.hoodInfoIdx][self.SUIT_HOOD_INFO_JCHANCE] ratioIdx = len(battle.toons) - battle.numSuitsEver + 2 diff --git a/toontown/toon/DistributedNPCTailorAI.py b/toontown/toon/DistributedNPCTailorAI.py index cfc56cf2..4f40d382 100644 --- a/toontown/toon/DistributedNPCTailorAI.py +++ b/toontown/toon/DistributedNPCTailorAI.py @@ -6,9 +6,9 @@ from toontown.ai import DatabaseObject from toontown.estate import ClosetGlobals class DistributedNPCTailorAI(DistributedNPCToonBaseAI): - freeClothes = simbase.config.GetBool('free-clothes', 0) - housingEnabled = simbase.config.GetBool('want-housing', 1) - useJellybeans = simbase.config.GetBool('want-tailor-jellybeans', False) + freeClothes = config.GetBool('free-clothes', 0) + housingEnabled = config.GetBool('want-housing', 1) + useJellybeans = config.GetBool('want-tailor-jellybeans', False) def __init__(self, air, npcId): DistributedNPCToonBaseAI.__init__(self, air, npcId) diff --git a/toontown/toon/DistributedToonAI.py b/toontown/toon/DistributedToonAI.py index e0e573b0..f5226df4 100644 --- a/toontown/toon/DistributedToonAI.py +++ b/toontown/toon/DistributedToonAI.py @@ -78,14 +78,14 @@ class DistributedToonAI(DistributedPlayerAI.DistributedPlayerAI, DistributedSmoo ToontownGlobals.FT_Torso: (CogDisguiseGlobals.torsoIndex,)} lastFlagAvTime = globalClock.getFrameTime() flagCounts = {} - WantTpTrack = simbase.config.GetBool('want-tptrack', False) - DbCheckPeriodPaid = simbase.config.GetInt('toon-db-check-period-paid', 10 * 60) - DbCheckPeriodUnpaid = simbase.config.GetInt('toon-db-check-period-unpaid', 1 * 60) - BanOnDbCheckFail = simbase.config.GetBool('want-ban-dbcheck', 0) + WantTpTrack = config.GetBool('want-tptrack', False) + DbCheckPeriodPaid = config.GetInt('toon-db-check-period-paid', 10 * 60) + DbCheckPeriodUnpaid = config.GetInt('toon-db-check-period-unpaid', 1 * 60) + BanOnDbCheckFail = config.GetBool('want-ban-dbcheck', 0) DbCheckAccountDateEnable = config.GetBool('account-blackout-enable', 1) DbCheckAccountDateBegin = config.GetString('account-blackout-start', '2013-08-20 12:30:00') DbCheckAccountDateDisconnect = config.GetBool('account-blackout-disconnect', 0) - WantOldGMNameBan = simbase.config.GetBool('want-old-gm-name-ban', 1) + WantOldGMNameBan = config.GetBool('want-old-gm-name-ban', 1) def __init__(self, air): DistributedPlayerAI.DistributedPlayerAI.__init__(self, air) @@ -291,7 +291,7 @@ class DistributedToonAI(DistributedPlayerAI.DistributedPlayerAI, DistributedSmoo # Teleportation access stuff. if 100 <= zoneId < ToontownGlobals.DynamicZonesBegin: hood = ZoneUtil.getHoodId(zoneId) - if not simbase.config.GetBool('want-doomsday', False): + if not config.GetBool('want-doomsday', False): self.sendUpdate('setLastHood', [hood]) self.b_setDefaultZone(hood) @@ -423,7 +423,7 @@ class DistributedToonAI(DistributedPlayerAI.DistributedPlayerAI, DistributedSmoo self.b_setGhostMode(0) # Remove ghost. if self.isPlayerControlled() and self.WantTpTrack: messenger.send(self.staticGetLogicalZoneChangeAllEvent(), [newZoneId, oldZoneId, self]) - if self.cogIndex != -1 and simbase.config.GetBool('cogsuit-hack-prevent', False): + if self.cogIndex != -1 and config.GetBool('cogsuit-hack-prevent', False): if not ToontownAccessAI.canWearSuit(self.doId, newZoneId) and self.getAdminAccess() < 500: self.air.writeServerEvent('suspicious', avId=self.doId, issue='Toon tried to transition while in cog suit with an index of %s to zone %s' % (str(self.cogIndex), str(newZoneId))) self.b_setCogIndex(-1) @@ -431,7 +431,7 @@ class DistributedToonAI(DistributedPlayerAI.DistributedPlayerAI, DistributedSmoo self.notify.warning('%s handleLogicalZoneChange as a suit: %s' % (self.doId, self.cogIndex)) self.air.writeServerEvent('suspicious', avId=self.doId, issue='Toon wearing a cog suit with index: %s in a zone they are not allowed to in. Zone: %s' % (self.cogIndex, newZoneId)) simbase.air.cogSuitMessageSent = True - if simbase.config.GetBool('want-ban-wrong-suit-place', False): + if config.GetBool('want-ban-wrong-suit-place', False): commentStr = 'Toon %s wearing a suit in a zone they are not allowed to in. Zone: %s' % (self.doId, newZoneId) dislId = self.DISLid #simbase.air.banManager.ban(self.doId, dislId, commentStr)''' @@ -475,7 +475,7 @@ class DistributedToonAI(DistributedPlayerAI.DistributedPlayerAI, DistributedSmoo textureIdx, colorIdx)) return 0 - if not simbase.config.GetBool('want-check-accessory-sanity', False): + if not config.GetBool('want-check-accessory-sanity', False): return 1 accessoryItem = CatalogAccessoryItem.CatalogAccessoryItem(accessoryItemId) result = self.air.catalogManager.isItemReleased(accessoryItem) @@ -566,7 +566,7 @@ class DistributedToonAI(DistributedPlayerAI.DistributedPlayerAI, DistributedSmoo def setDNAString(self, string): self.dna.makeFromNetString(string) - if simbase.config.GetBool('adjust-dna', True) and self.verifyDNA() == False: + if config.GetBool('adjust-dna', True) and self.verifyDNA() == False: logStr = 'AvatarHackWarning! invalid dna colors for %s old: %s new: %s' % (self.doId, str(ToonDNA.ToonDNA(string).asTuple()), str(self.dna.asTuple())) self.notify.warning(logStr) self.air.writeServerEvent('suspicious', avId=self.doId, issue=logStr) @@ -745,7 +745,7 @@ class DistributedToonAI(DistributedPlayerAI.DistributedPlayerAI, DistributedSmoo if max & 32768: self.b_setSosPageFlag(1) max &= 32767 - configMax = simbase.config.GetInt('max-sos-cards', 16) + configMax = config.GetInt('max-sos-cards', 16) if configMax != max: if self.sosPageFlag == 0: self.b_setMaxNPCFriends(configMax) @@ -1657,7 +1657,7 @@ class DistributedToonAI(DistributedPlayerAI.DistributedPlayerAI, DistributedSmoo self.d_setCogIndex(self.cogIndex) def setCogIndex(self, index): - if index != -1 and simbase.config.GetBool('cogsuit-hack-prevent', False) and not ToontownAccessAI.canWearSuit(self.doId, self.zoneId) and self.getAdminAccess() < 500: + if index != -1 and config.GetBool('cogsuit-hack-prevent', False) and not ToontownAccessAI.canWearSuit(self.doId, self.zoneId) and self.getAdminAccess() < 500: self.air.writeServerEvent('suspicious', avId=self.doId, issue='Toon tried to set cog suit index to %s in non-HQ zone %s' % (str(index), str(self.zoneId))) index = -1 self.cogIndex = index @@ -2154,7 +2154,7 @@ class DistributedToonAI(DistributedPlayerAI.DistributedPlayerAI, DistributedSmoo def checkTeleportAccess(self, zoneId): if zoneId not in self.getTeleportAccess() and self.teleportOverride != 1: simbase.air.writeServerEvent('suspicious', avId=self.doId, issue='Toon teleporting to zone %s they do not have access to.' % zoneId) - if simbase.config.GetBool('want-ban-teleport', False): + if config.GetBool('want-ban-teleport', False): commentStr = 'Toon %s teleporting to a zone %s they do not have access to' % (self.doId, zoneId) #simbase.air.banManager.ban(self.doId, self.DISLid, commentStr) @@ -2679,7 +2679,7 @@ class DistributedToonAI(DistributedPlayerAI.DistributedPlayerAI, DistributedSmoo money = 0 commentStr = 'User %s has negative money %s' % (self.doId, money) dislId = self.DISLid - if simbase.config.GetBool('want-ban-negative-money', False): + if config.GetBool('want-ban-negative-money', False): #simbase.air.banManager.ban(self.doId, dislId, commentStr) pass self.money = money @@ -3963,14 +3963,14 @@ class DistributedToonAI(DistributedPlayerAI.DistributedPlayerAI, DistributedSmoo if strSearch.search(eventName, 0, 100): self.air.district.recordSuspiciousEventData(len(eventStr)) self.air.writeServerEvent('suspicious', avId=self.doId, issue=eventStr) - if simbase.config.GetBool('want-ban-setSCSinging', True): + if config.GetBool('want-ban-setSCSinging', True): if 'invalid msgIndex in setSCSinging:' in eventName: if senderId == self.doId: commentStr = 'Toon %s trying to call setSCSinging' % self.doId #simbase.air.banManager.ban(self.doId, self.DISLid, commentStr) else: self.notify.warning('logSuspiciousEvent event=%s senderId=%s != self.doId=%s' % (eventName, senderId, self.doId)) - if simbase.config.GetBool('want-ban-setAnimState', True): + if config.GetBool('want-ban-setAnimState', True): if eventName.startswith('setAnimState: '): if senderId == self.doId: commentStr = 'Toon %s trying to call setAnimState' % self.doId @@ -4082,7 +4082,7 @@ class DistributedToonAI(DistributedPlayerAI.DistributedPlayerAI, DistributedSmoo self.sendUpdate('setAccess', [access]) def setAccess(self, access): - paidStatus = simbase.config.GetString('force-paid-status', 'none') + paidStatus = config.GetString('force-paid-status', 'none') if paidStatus == 'unpaid': access = 1 print 'Setting Access %s' % access @@ -4431,7 +4431,7 @@ class DistributedToonAI(DistributedPlayerAI.DistributedPlayerAI, DistributedSmoo if module not in self.moduleWhitelist: if module in self.moduleBlacklist: self.air.writeServerEvent('suspicious', avId=avId, issue='Black List module %s loaded into process.' % module) - if simbase.config.GetBool('want-ban-blacklist-module', False): + if config.GetBool('want-ban-blacklist-module', False): commentStr = 'User has blacklist module: %s attached to their game process' % module dislId = self.DISLid #simbase.air.banManager.ban(self.doId, dislId, commentStr) @@ -4550,7 +4550,7 @@ class DistributedToonAI(DistributedPlayerAI.DistributedPlayerAI, DistributedSmoo isGm) self.notify.info('av %s is consistently in an inappropriate position with %s...' % (av.doId, valStr)) self.air.writeServerEvent('suspicious', avId=avId, issue=' consistently in an inappropriate position with toon %s' % valStr) - response = simbase.config.GetString('toon-pos-hack-response', 'nothing') + response = config.GetString('toon-pos-hack-response', 'nothing') av.handleHacking(response, 'collision and position hacking', [otherAv]) del DistributedToonAI.flagCounts[avPairKey] return diff --git a/toontown/toon/InventoryBase.py b/toontown/toon/InventoryBase.py index 3415a9aa..9b0aed52 100644 --- a/toontown/toon/InventoryBase.py +++ b/toontown/toon/InventoryBase.py @@ -209,7 +209,7 @@ class InventoryBase(DirectObject.DirectObject): if tempInv[track][level] > 0 and not self.toon.hasTrackAccess(track): commentStr = "Player %s trying to purchase gag they don't have track access to. track: %s level: %s" % (self.toon.doId, track, level) dislId = self.toon.DISLid - if simbase.config.GetBool('want-ban-gagtrack', False): + if config.GetBool('want-ban-gagtrack', False): #simbase.air.banManager.ban(self.toon.doId, dislId, commentStr) pass return 0 diff --git a/toontown/toon/ModuleListAI.py b/toontown/toon/ModuleListAI.py index 51dd360c..58963188 100644 --- a/toontown/toon/ModuleListAI.py +++ b/toontown/toon/ModuleListAI.py @@ -1,7 +1,7 @@ import os class ModuleList: - serverDataFolder = simbase.config.GetString('server-data-folder', '') + serverDataFolder = config.GetString('server-data-folder', '') def __init__(self): self.moduleWhitelistFilename = self.getWhitelistFilename() diff --git a/toontown/toon/NPCToons.py b/toontown/toon/NPCToons.py index ee7ed930..18f209f7 100644 --- a/toontown/toon/NPCToons.py +++ b/toontown/toon/NPCToons.py @@ -105,7 +105,7 @@ def createNPC(air, npcId, desc, zoneId, posIndex = 0, questCallback = None): elif type == NPC_KARTCLERK: npc = DistributedNPCKartClerkAI.DistributedNPCKartClerkAI(air, npcId) elif type == NPC_PARTYPERSON: - if not simbase.config.GetBool('want-parties', True): + if not config.GetBool('want-parties', True): return npc = DistributedNPCPartyPersonAI.DistributedNPCPartyPersonAI(air, npcId) elif type == NPC_SPECIALQUESTGIVER: diff --git a/toontown/toon/ToonDNA.py b/toontown/toon/ToonDNA.py index e1c85ab9..d854ad39 100644 --- a/toontown/toon/ToonDNA.py +++ b/toontown/toon/ToonDNA.py @@ -1706,7 +1706,7 @@ TailorCollections = {MAKE_A_TOON: [['bss1', 'bss2'], ['gss13', 'gss15'], ['bbs8'], ['gsk7']]} - + BOY_SHIRTS = 0 GIRL_SHIRTS = 1 BOY_SHORTS = 2 @@ -2541,15 +2541,10 @@ class ToonDNA(AvatarDNA.AvatarDNA): return False if armColor >= len(allColorsList): return False - - # I hate this hacky code... GG TMS. - try: - if gloveColor != 0 and not simbase.config.GetBool('want-glove-colors', False): - return False - except: - if gloveColor != 0 and not base.config.GetBool('want-glove-colors', False): - return False - + + if gloveColor != 0 and not config.GetBool('want-glove-colors', False): + return False + if legColor >= len(allColorsList): return False if headColor >= len(allColorsList): @@ -2869,7 +2864,7 @@ class ToonDNA(AvatarDNA.AvatarDNA): return allColorsList[26] except: return allColorsList[0] - + def getWhiteColor(self): return allColorsList[0] diff --git a/toontown/toonbase/TTLocalizer.py b/toontown/toonbase/TTLocalizer.py index 1d39fb05..066dba95 100644 --- a/toontown/toonbase/TTLocalizer.py +++ b/toontown/toonbase/TTLocalizer.py @@ -1,12 +1,9 @@ from panda3d.core import * import string import types -try: - language = getConfigExpress().GetString('language', 'english') - checkLanguage = getConfigExpress().GetBool('check-language', 0) -except: - language = simbase.config.GetString('language', 'english') - checkLanguage = simbase.config.GetBool('check-language', 0) + +language = config.GetString('language', 'english') +checkLanguage = config.GetBool('check-language', 0) def getLanguage(): return language diff --git a/toontown/toonbase/ToontownAccessAI.py b/toontown/toonbase/ToontownAccessAI.py index e16f409b..eaebabcb 100644 --- a/toontown/toonbase/ToontownAccessAI.py +++ b/toontown/toonbase/ToontownAccessAI.py @@ -9,7 +9,7 @@ def canAccess(avatarId, zoneId, function = ''): if cmp(function, 'DistributedBoardingPartyAI.checkBoard') == 0: return False simbase.air.writeServerEvent('suspicious', avId=avatarId, issue='User with rights: %s requesting enter for paid access content without proper rights in zone %s from %s' % (avatar.getGameAccess(), zoneId, function)) - if simbase.config.GetBool('want-ban-ispaid', True): + if config.GetBool('want-ban-ispaid', True): commentStr = 'User with rights: %s tried to gain access zone %s from function %s, an area they were not allowed to using TTInjector Hack' % (avatar.getGameAccess(), zoneId, function) dislId = avatar.DISLid #simbase.air.banManager.ban(avatarId, dislId, commentStr) diff --git a/toontown/uberdog/ClientServicesManagerUD.py b/toontown/uberdog/ClientServicesManagerUD.py index 7fb796ae..8a48c829 100644 --- a/toontown/uberdog/ClientServicesManagerUD.py +++ b/toontown/uberdog/ClientServicesManagerUD.py @@ -126,7 +126,7 @@ class LoginAccountFSM(OperationFSM): # Binary bitmask in base10 form, added to the adminAccess. # To find out what they have access to, convert the serverAccess to 3-bit binary. # 2^2 = dev, 2^1 = qa, 2^0 = test - serverType = simbase.config.GetString('server-type', 'dev') + serverType = config.GetString('server-type', 'dev') serverAccess = self.adminAccess % 10 # Get the last digit in their access. if (serverType == 'dev' and not serverAccess & 4) or \ (serverType == 'qa' and not serverAccess & 2) or \ @@ -141,7 +141,7 @@ class LoginAccountFSM(OperationFSM): self.csm.air.mongodb.astron.objects.ensure_index('fields.ACCOUNT_ID') account = self.csm.air.mongodb.astron.objects.find_one({'fields.ACCOUNT_ID': self.databaseId}) except AutoReconnect: - taskMgr.doMethodLater(simbase.config.GetInt('mongodb-retry-time', 2), self.__retryLookup, 'retryLookUp-%d' % self.databaseId, extraArgs=[]) + taskMgr.doMethodLater(config.GetInt('mongodb-retry-time', 2), self.__retryLookup, 'retryLookUp-%d' % self.databaseId, extraArgs=[]) return if account: @@ -155,7 +155,7 @@ class LoginAccountFSM(OperationFSM): self.csm.air.mongodb.astron.objects.ensure_index('fields.ACCOUNT_ID') account = self.csm.air.mongodb.astron.objects.find_one({'fields.ACCOUNT_ID': self.databaseId}) except AutoReconnect: - taskMgr.doMethodLater(simbase.config.GetInt('mongodb-retry-time', 2), self.__retryLookup, 'retryLookUp-%d' % self.databaseId, extraArgs=[]) + taskMgr.doMethodLater(config.GetInt('mongodb-retry-time', 2), self.__retryLookup, 'retryLookUp-%d' % self.databaseId, extraArgs=[]) return if account: @@ -836,7 +836,7 @@ class ClientServicesManagerUD(DistributedObjectGlobalUD): self.nameGenerator = NameGenerator() # Instantiate our account DB interface using config: - dbtype = simbase.config.GetString('accountdb-type', 'local') + dbtype = config.GetString('accountdb-type', 'local') if dbtype == 'local': self.accountDB = LocalAccountDB(self) elif dbtype == 'remote': @@ -921,7 +921,7 @@ class ClientServicesManagerUD(DistributedObjectGlobalUD): return # Test the signature - key = simbase.config.GetString('csmud-secret', 'streetlamps') + simbase.config.GetString('server-version', 'no_version_set') + FIXED_KEY + key = config.GetString('csmud-secret', 'streetlamps') + config.GetString('server-version', 'no_version_set') + FIXED_KEY computedSig = hmac.new(key, cookie, hashlib.sha256).digest() if sig != computedSig: self.killConnection(sender, 'The accounts database rejected your cookie')