global: Clean up usage of simbase.config (using builtin config).
This commit is contained in:
parent
b6b8563102
commit
575dded46d
45 changed files with 132 additions and 146 deletions
|
@ -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
|
||||
|
|
|
@ -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'):
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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()
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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':
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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])
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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]
|
||||
|
|
|
@ -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):
|
||||
|
|
|
@ -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 = []
|
||||
|
|
|
@ -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.'
|
||||
|
||||
|
|
|
@ -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':
|
||||
|
|
|
@ -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))
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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 = {}
|
||||
|
||||
|
|
|
@ -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 = {}
|
||||
|
||||
|
|
|
@ -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']),
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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')
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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]
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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')
|
||||
|
|
Loading…
Reference in a new issue