astron: astronSupport -> __astron__

This commit is contained in:
John Cote 2021-06-29 13:57:22 -04:00
parent 7195618d93
commit 092f6611cc
15 changed files with 56 additions and 55 deletions

View file

@ -22,7 +22,7 @@ class AIBase:
def __init__(self): def __init__(self):
self.config = getConfigShowbase() self.config = getConfigShowbase()
__builtins__['__dev__'] = self.config.GetBool('want-dev', 0) __builtins__['__dev__'] = self.config.GetBool('want-dev', 0)
__builtins__['astronSupport'] = self.config.GetBool('astron-support', True) __builtins__['__astron__'] = self.config.GetBool('astron-support', 1)
logStackDump = (self.config.GetBool('log-stack-dump', (not __dev__)) or self.config.GetBool('ai-log-stack-dump', (not __dev__))) logStackDump = (self.config.GetBool('log-stack-dump', (not __dev__)) or self.config.GetBool('ai-log-stack-dump', (not __dev__)))
uploadStackDump = self.config.GetBool('upload-stack-dump', 0) uploadStackDump = self.config.GetBool('upload-stack-dump', 0)
if logStackDump or uploadStackDump: if logStackDump or uploadStackDump:
@ -57,6 +57,7 @@ class AIBase:
__builtins__['vfs'] = vfs __builtins__['vfs'] = vfs
__builtins__['hidden'] = self.hidden __builtins__['hidden'] = self.hidden
AIBase.notify.info('__dev__ == %s' % __dev__) AIBase.notify.info('__dev__ == %s' % __dev__)
AIBase.notify.info('__astron__ == %s' % __astron__)
PythonUtil.recordFunctorCreationStacks() PythonUtil.recordFunctorCreationStacks()
__builtins__['wantTestObject'] = self.config.GetBool('want-test-object', 0) __builtins__['wantTestObject'] = self.config.GetBool('want-test-object', 0)
self.wantStats = self.config.GetBool('want-pstats', 0) self.wantStats = self.config.GetBool('want-pstats', 0)

View file

@ -175,8 +175,7 @@ class OTPClientRepository(ClientRepositoryBase):
self.accountOldAuth = config.GetBool('%s-account-old-auth' % game.name, self.accountOldAuth = config.GetBool('%s-account-old-auth' % game.name,
self.accountOldAuth) self.accountOldAuth)
self.useNewTTDevLogin = base.config.GetBool('use-tt-specific-dev-login', False) self.useNewTTDevLogin = base.config.GetBool('use-tt-specific-dev-login', False)
astronSupport = config.GetBool('astron-support', True) if __astron__:
if astronSupport:
self.loginInterface = LoginAstronAccount.LoginAstronAccount(self) self.loginInterface = LoginAstronAccount.LoginAstronAccount(self)
self.notify.info('loginInterface: LoginAstronAccount') self.notify.info('loginInterface: LoginAstronAccount')
elif self.useNewTTDevLogin: elif self.useNewTTDevLogin:
@ -426,7 +425,7 @@ class OTPClientRepository(ClientRepositoryBase):
self.__pendingMessages = {} self.__pendingMessages = {}
self.__doId2pendingInterest = {} self.__doId2pendingInterest = {}
self.centralLogger = self.generateGlobalObject(OtpDoGlobals.OTP_DO_ID_CENTRAL_LOGGER, 'CentralLogger') self.centralLogger = self.generateGlobalObject(OtpDoGlobals.OTP_DO_ID_CENTRAL_LOGGER, 'CentralLogger')
if astronSupport: if __astron__:
self.astronLoginManager = self.generateGlobalObject(OtpDoGlobals.OTP_DO_ID_ASTRON_LOGIN_MANAGER, 'AstronLoginManager') self.astronLoginManager = self.generateGlobalObject(OtpDoGlobals.OTP_DO_ID_ASTRON_LOGIN_MANAGER, 'AstronLoginManager')
def startLeakDetector(self): def startLeakDetector(self):
@ -524,7 +523,7 @@ class OTPClientRepository(ClientRepositoryBase):
return return
self.startReaderPollTask() self.startReaderPollTask()
if not astronSupport: if not __astron__:
self.startHeartbeat() self.startHeartbeat()
newInstall = launcher.getIsNewInstallation() newInstall = launcher.getIsNewInstallation()
newInstall = base.config.GetBool('new-installation', newInstall) newInstall = base.config.GetBool('new-installation', newInstall)
@ -946,7 +945,7 @@ class OTPClientRepository(ClientRepositoryBase):
@report(types=['args', 'deltaStamp'], dConfigParam='teleport') @report(types=['args', 'deltaStamp'], dConfigParam='teleport')
def enterWaitForAvatarList(self): def enterWaitForAvatarList(self):
if not astronSupport: if not __astron__:
self.handler = self.handleWaitForAvatarList self.handler = self.handleWaitForAvatarList
self._requestAvatarList() self._requestAvatarList()
@ -958,7 +957,7 @@ class OTPClientRepository(ClientRepositoryBase):
@report(types=['args', 'deltaStamp'], dConfigParam='teleport') @report(types=['args', 'deltaStamp'], dConfigParam='teleport')
def sendGetAvatarsMsg(self): def sendGetAvatarsMsg(self):
if astronSupport: if __astron__:
self.astronLoginManager.sendRequestAvatarList() self.astronLoginManager.sendRequestAvatarList()
else: else:
datagram = PyDatagram() datagram = PyDatagram()
@ -1035,7 +1034,7 @@ class OTPClientRepository(ClientRepositoryBase):
self.loginFSM.request('shutdown') self.loginFSM.request('shutdown')
return return
if config.GetBool('astron-support', True): if __astron__:
@report(types=['args', 'deltaStamp'], dConfigParam='teleport') @report(types=['args', 'deltaStamp'], dConfigParam='teleport')
def handleAvatarListResponse(self, avatarList): def handleAvatarListResponse(self, avatarList):
avList = [] avList = []
@ -1077,7 +1076,7 @@ class OTPClientRepository(ClientRepositoryBase):
@report(types=['args', 'deltaStamp'], dConfigParam='teleport') @report(types=['args', 'deltaStamp'], dConfigParam='teleport')
def sendCreateAvatarMsg(self, avDNA, avName, avPosition): def sendCreateAvatarMsg(self, avDNA, avName, avPosition):
if astronSupport: if __astron__:
self.astronLoginManager.sendCreateAvatar(avDNA, avName, avPosition) self.astronLoginManager.sendCreateAvatar(avDNA, avName, avPosition)
else: else:
datagram = PyDatagram() datagram = PyDatagram()
@ -1106,14 +1105,14 @@ class OTPClientRepository(ClientRepositoryBase):
@report(types=['args', 'deltaStamp'], dConfigParam='teleport') @report(types=['args', 'deltaStamp'], dConfigParam='teleport')
def enterWaitForDeleteAvatarResponse(self, potAv): def enterWaitForDeleteAvatarResponse(self, potAv):
if not astronSupport: if not __astron__:
self.handler = self.handleWaitForDeleteAvatarResponse self.handler = self.handleWaitForDeleteAvatarResponse
self.sendDeleteAvatarMsg(potAv.id) self.sendDeleteAvatarMsg(potAv.id)
self.waitForDatabaseTimeout(requestName='WaitForDeleteAvatarResponse') self.waitForDatabaseTimeout(requestName='WaitForDeleteAvatarResponse')
@report(types=['args', 'deltaStamp'], dConfigParam='teleport') @report(types=['args', 'deltaStamp'], dConfigParam='teleport')
def sendDeleteAvatarMsg(self, avId): def sendDeleteAvatarMsg(self, avId):
if astronSupport: if __astron__:
self.astronLoginManager.sendRequestRemoveAvatar(avId) self.astronLoginManager.sendRequestRemoveAvatar(avId)
else: else:
datagram = PyDatagram() datagram = PyDatagram()
@ -1157,7 +1156,7 @@ class OTPClientRepository(ClientRepositoryBase):
@report(types=['args', 'deltaStamp'], dConfigParam='teleport') @report(types=['args', 'deltaStamp'], dConfigParam='teleport')
def enterWaitForSetAvatarResponse(self, potAv): def enterWaitForSetAvatarResponse(self, potAv):
if not astronSupport: if not __astron__:
self.handler = self.handleWaitForSetAvatarResponse self.handler = self.handleWaitForSetAvatarResponse
self.sendSetAvatarMsg(potAv) self.sendSetAvatarMsg(potAv)
self.waitForDatabaseTimeout(requestName='WaitForSetAvatarResponse') self.waitForDatabaseTimeout(requestName='WaitForSetAvatarResponse')
@ -1177,7 +1176,7 @@ class OTPClientRepository(ClientRepositoryBase):
def sendSetAvatarIdMsg(self, avId): def sendSetAvatarIdMsg(self, avId):
if avId != self.__currentAvId: if avId != self.__currentAvId:
self.__currentAvId = avId self.__currentAvId = avId
if astronSupport: if __astron__:
self.astronLoginManager.sendRequestPlayAvatar(avId) self.astronLoginManager.sendRequestPlayAvatar(avId)
else: else:
datagram = PyDatagram() datagram = PyDatagram()
@ -1189,7 +1188,7 @@ class OTPClientRepository(ClientRepositoryBase):
else: else:
self.startPeriodTimer() self.startPeriodTimer()
if not config.GetBool('astron-support', True): if not __astron__:
@report(types=['args', 'deltaStamp'], dConfigParam='teleport') @report(types=['args', 'deltaStamp'], dConfigParam='teleport')
def handleAvatarResponseMsg(self, di): def handleAvatarResponseMsg(self, di):
pass pass
@ -1446,7 +1445,7 @@ class OTPClientRepository(ClientRepositoryBase):
@report(types=['args', 'deltaStamp'], dConfigParam='teleport') @report(types=['args', 'deltaStamp'], dConfigParam='teleport')
def enterWaitOnEnterResponses(self, shardId, hoodId, zoneId, avId): def enterWaitOnEnterResponses(self, shardId, hoodId, zoneId, avId):
self.cleanGameExit = False self.cleanGameExit = False
if not astronSupport: if not __astron__:
self.handler = self.handleWaitOnEnterResponses self.handler = self.handleWaitOnEnterResponses
self.handlerArgs = {'hoodId': hoodId, self.handlerArgs = {'hoodId': hoodId,
'zoneId': zoneId, 'zoneId': zoneId,
@ -1669,7 +1668,7 @@ class OTPClientRepository(ClientRepositoryBase):
else: else:
self.gameFSM.request('playGame', [hoodId, zoneId, avId]) self.gameFSM.request('playGame', [hoodId, zoneId, avId])
if not config.GetBool('astron-support', True): if not __astron__:
def handlePlayGame(self, msgType, di): def handlePlayGame(self, msgType, di):
if self.notify.getDebug(): if self.notify.getDebug():
self.notify.debug('handle play game got message type: ' + repr(msgType)) self.notify.debug('handle play game got message type: ' + repr(msgType))
@ -1993,7 +1992,7 @@ class OTPClientRepository(ClientRepositoryBase):
messenger.send('periodTimerExpired') messenger.send('periodTimerExpired')
return Task.done return Task.done
if not config.GetBool('astron-support', True): if not __astron__:
def handleMessageType(self, msgType, di): def handleMessageType(self, msgType, di):
if msgType == CLIENT_GO_GET_LOST: if msgType == CLIENT_GO_GET_LOST:
self.handleGoGetLost(di) self.handleGoGetLost(di)
@ -2078,7 +2077,7 @@ class OTPClientRepository(ClientRepositoryBase):
di = DatagramIterator(dg, di.getCurrentIndex()) di = DatagramIterator(dg, di.getCurrentIndex())
self.deferredGenerates.append((CLIENT_DONE_INTEREST_RESP, (dg, di))) self.deferredGenerates.append((CLIENT_DONE_INTEREST_RESP, (dg, di)))
else: else:
if astronSupport: if __astron__:
# Play back generates, if necessary. # Play back generates, if necessary.
# First, create a new DatagramIterator using # First, create a new DatagramIterator using
# the Datagram from DatagramIterator di, and # the Datagram from DatagramIterator di, and
@ -2232,7 +2231,7 @@ class OTPClientRepository(ClientRepositoryBase):
return True return True
return False return False
if not config.GetBool('astron-support', True): if not __astron__:
def handleGenerateWithRequired(self, di): def handleGenerateWithRequired(self, di):
parentId = di.getUint32() parentId = di.getUint32()
zoneId = di.getUint32() zoneId = di.getUint32()

View file

@ -234,7 +234,7 @@ class LoginScreen(StateData.StateData, GuiScreen.GuiScreen):
def exitShowConnectionProblemDialog(self): def exitShowConnectionProblemDialog(self):
pass pass
if not config.GetBool('astron-support', True): if not __astron__:
def handleWaitForLoginResponse(self, msgType, di): def handleWaitForLoginResponse(self, msgType, di):
if msgType == CLIENT_LOGIN_2_RESP: if msgType == CLIENT_LOGIN_2_RESP:
self.handleLoginResponseMsg2(di) self.handleLoginResponseMsg2(di)
@ -495,7 +495,7 @@ class LoginScreen(StateData.StateData, GuiScreen.GuiScreen):
self.notify.debug('result=%s' % result) self.notify.debug('result=%s' % result)
return result return result
if not config.GetBool('astron-support', True): if not __astron__:
def handleLoginToontownResponse(self, di): def handleLoginToontownResponse(self, di):
self.notify.debug("handleLoginToontownResponse") self.notify.debug("handleLoginToontownResponse")
if 1: if 1:

View file

@ -96,7 +96,7 @@ class BattlePlace(Place.Place):
def doEnterZone(self, newZoneId): def doEnterZone(self, newZoneId):
if newZoneId != self.zoneId: if newZoneId != self.zoneId:
if newZoneId != None: if newZoneId != None:
if astronSupport: if __astron__:
if hasattr(self, 'zoneVisDict'): if hasattr(self, 'zoneVisDict'):
visList = self.zoneVisDict[newZoneId] visList = self.zoneVisDict[newZoneId]
else: else:
@ -112,7 +112,7 @@ class BattlePlace(Place.Place):
self.zoneId = newZoneId self.zoneId = newZoneId
return return
if config.GetBool('astron-support', True): if __astron__:
def genDNAFileName(self, zoneId): def genDNAFileName(self, zoneId):
zoneId = ZoneUtil.getCanonicalZoneId(zoneId) zoneId = ZoneUtil.getCanonicalZoneId(zoneId)
hoodId = ZoneUtil.getCanonicalHoodId(zoneId) hoodId = ZoneUtil.getCanonicalHoodId(zoneId)

View file

@ -76,7 +76,7 @@ class CogHQExterior(BattlePlace.BattlePlace):
self.tunnelOriginList = base.cr.hoodMgr.addLinkTunnelHooks(self, self.nodeList, self.zoneId) self.tunnelOriginList = base.cr.hoodMgr.addLinkTunnelHooks(self, self.nodeList, self.zoneId)
how = requestStatus['how'] how = requestStatus['how']
self.fsm.request(how, [requestStatus]) self.fsm.request(how, [requestStatus])
if base.cr.astronSupport and self.zoneId != ToontownGlobals.BossbotHQ: if __astron__ and self.zoneId != ToontownGlobals.BossbotHQ:
self.handleInterests() self.handleInterests()
def exit(self): def exit(self):
@ -139,7 +139,7 @@ class CogHQExterior(BattlePlace.BattlePlace):
taskMgr.remove(base.localAvatar.uniqueName('finishSquishTask')) taskMgr.remove(base.localAvatar.uniqueName('finishSquishTask'))
base.localAvatar.laffMeter.stop() base.localAvatar.laffMeter.stop()
if config.GetBool('astron-support', True): if __astron__:
def handleInterests(self): def handleInterests(self):
# First, we need to load the DNA file for this Cog HQ. # First, we need to load the DNA file for this Cog HQ.
dnaStore = DNAStorage() dnaStore = DNAStorage()

View file

@ -74,7 +74,7 @@ class FactoryExterior(BattlePlace.BattlePlace):
self.tunnelOriginList = base.cr.hoodMgr.addLinkTunnelHooks(self, self.nodeList, self.zoneId) self.tunnelOriginList = base.cr.hoodMgr.addLinkTunnelHooks(self, self.nodeList, self.zoneId)
how = requestStatus['how'] how = requestStatus['how']
self.fsm.request(how, [requestStatus]) self.fsm.request(how, [requestStatus])
if base.cr.astronSupport and self.zoneId != ToontownGlobals.LawbotOfficeExt: if __astron__ and self.zoneId != ToontownGlobals.LawbotOfficeExt:
self.handleInterests() self.handleInterests()
def exit(self): def exit(self):
@ -158,7 +158,7 @@ class FactoryExterior(BattlePlace.BattlePlace):
else: else:
self.notify.error('Unknown mode: ' + where + ' in handleElevatorDone') self.notify.error('Unknown mode: ' + where + ' in handleElevatorDone')
if config.GetBool('astron-support', True): if __astron__:
def handleInterests(self): def handleInterests(self):
# First, we need to load the DNA file for this Cog HQ. # First, we need to load the DNA file for this Cog HQ.
dnaStore = DNAStorage() dnaStore = DNAStorage()

View file

@ -178,7 +178,7 @@ class ToontownClientRepository(OTPClientRepository.OTPClientRepository):
del self.okButton del self.okButton
del self.acceptedText del self.acceptedText
del self.acceptedBanner del self.acceptedBanner
if not astronSupport: if not __astron__:
datagram = PyDatagram() datagram = PyDatagram()
datagram.addUint16(CLIENT_SET_WISHNAME_CLEAR) datagram.addUint16(CLIENT_SET_WISHNAME_CLEAR)
datagram.addUint32(avatarChoice.id) datagram.addUint32(avatarChoice.id)
@ -198,7 +198,7 @@ class ToontownClientRepository(OTPClientRepository.OTPClientRepository):
def __handleReject(self, avList, index): def __handleReject(self, avList, index):
self.rejectDialog.cleanup() self.rejectDialog.cleanup()
if not astronSupport: if not __astron__:
datagram = PyDatagram() datagram = PyDatagram()
datagram.addUint16(CLIENT_SET_WISHNAME_CLEAR) datagram.addUint16(CLIENT_SET_WISHNAME_CLEAR)
avid = 0 avid = 0
@ -208,7 +208,7 @@ class ToontownClientRepository(OTPClientRepository.OTPClientRepository):
if avid == 0: if avid == 0:
self.notify.error('Avatar rejected not found in avList. Index is: ' + str(index)) self.notify.error('Avatar rejected not found in avList. Index is: ' + str(index))
if not astronSupport: if not __astron__:
datagram.addUint32(avid) datagram.addUint32(avid)
datagram.addUint8(0) datagram.addUint8(0)
self.send(datagram) self.send(datagram)
@ -321,7 +321,7 @@ class ToontownClientRepository(OTPClientRepository.OTPClientRepository):
self.avCreate = MakeAToon.MakeAToon(self.loginFSM, avList, 'makeAToonComplete', index, self.isPaid()) self.avCreate = MakeAToon.MakeAToon(self.loginFSM, avList, 'makeAToonComplete', index, self.isPaid())
self.avCreate.load() self.avCreate.load()
self.avCreate.enter() self.avCreate.enter()
if not astronSupport: if not __astron__:
self.handler = self.handleCreateAvatar self.handler = self.handleCreateAvatar
self.accept('makeAToonComplete', self.__handleMakeAToon, [avList, index]) self.accept('makeAToonComplete', self.__handleMakeAToon, [avList, index])
self.accept('nameShopCreateAvatar', self.sendCreateAvatarMsg) self.accept('nameShopCreateAvatar', self.sendCreateAvatarMsg)
@ -369,7 +369,7 @@ class ToontownClientRepository(OTPClientRepository.OTPClientRepository):
del self.newPotAv del self.newPotAv
return return
if not config.GetBool('astron-support', True): if not __astron__:
def handleAvatarResponseMsg(self, di): def handleAvatarResponseMsg(self, di):
self.cleanupWaitingForDatabase() self.cleanupWaitingForDatabase()
avatarId = di.getUint32() avatarId = di.getUint32()
@ -523,7 +523,7 @@ class ToontownClientRepository(OTPClientRepository.OTPClientRepository):
self.handlerArgs = {'hoodId': hoodId, self.handlerArgs = {'hoodId': hoodId,
'zoneId': zoneId, 'zoneId': zoneId,
'avId': avId} 'avId': avId}
if not astronSupport: if not __astron__:
self.handler = self.handleTutorialQuestion self.handler = self.handleTutorialQuestion
self.__requestSkipTutorial(hoodId, zoneId, avId) self.__requestSkipTutorial(hoodId, zoneId, avId)
@ -551,7 +551,7 @@ class ToontownClientRepository(OTPClientRepository.OTPClientRepository):
return return
def enterTutorialQuestion(self, hoodId, zoneId, avId): def enterTutorialQuestion(self, hoodId, zoneId, avId):
if not astronSupport: if not __astron__:
self.handler = self.handleTutorialQuestion self.handler = self.handleTutorialQuestion
self.__requestTutorial(hoodId, zoneId, avId) self.__requestTutorial(hoodId, zoneId, avId)
@ -611,7 +611,7 @@ class ToontownClientRepository(OTPClientRepository.OTPClientRepository):
self.handler = self.handleCloseShard self.handler = self.handleCloseShard
self._removeLocalAvFromStateServer() self._removeLocalAvFromStateServer()
if not config.GetBool('astron-support', True): if not __astron__:
def handleCloseShard(self, msgType, di): def handleCloseShard(self, msgType, di):
if msgType == CLIENT_CREATE_OBJECT_REQUIRED: if msgType == CLIENT_CREATE_OBJECT_REQUIRED:
di2 = PyDatagramIterator(di) di2 = PyDatagramIterator(di)
@ -870,7 +870,7 @@ class ToontownClientRepository(OTPClientRepository.OTPClientRepository):
self.friendsListError = 0 self.friendsListError = 0
def sendGetFriendsListRequest(self): def sendGetFriendsListRequest(self):
if astronSupport: if __astron__:
print('sendGetFriendsListRequest TODO') print('sendGetFriendsListRequest TODO')
else: else:
self.friendsMapPending = 1 self.friendsMapPending = 1
@ -1097,12 +1097,12 @@ class ToontownClientRepository(OTPClientRepository.OTPClientRepository):
return True return True
def sendQuietZoneRequest(self): def sendQuietZoneRequest(self):
if astronSupport: if __astron__:
self.sendSetZoneMsg(OTPGlobals.QuietZone, []) self.sendSetZoneMsg(OTPGlobals.QuietZone, [])
else: else:
self.sendSetZoneMsg(OTPGlobals.QuietZone) self.sendSetZoneMsg(OTPGlobals.QuietZone)
if not config.GetBool('astron-support', True): if not __astron__:
def handleQuietZoneGenerateWithRequired(self, di): def handleQuietZoneGenerateWithRequired(self, di):
parentId = di.getUint32() parentId = di.getUint32()
zoneId = di.getUint32() zoneId = di.getUint32()

View file

@ -138,7 +138,7 @@ class QuietZoneState(StateData.StateData):
self._setZoneCompleteCallbacks.remove(token) self._setZoneCompleteCallbacks.remove(token)
return return
if not config.GetBool('astron-support', True): if not __astron__:
def handleWaitForQuietZoneResponse(self, msgType, di): def handleWaitForQuietZoneResponse(self, msgType, di):
# self.notify.debug('handleWaitForQuietZoneResponse(' + 'msgType=' + str(msgType) + ', di=' + str(di) + ')') # self.notify.debug('handleWaitForQuietZoneResponse(' + 'msgType=' + str(msgType) + ', di=' + str(di) + ')')
if msgType == CLIENT_CREATE_OBJECT_REQUIRED: if msgType == CLIENT_CREATE_OBJECT_REQUIRED:
@ -165,7 +165,7 @@ class QuietZoneState(StateData.StateData):
else: else:
base.cr.handlePlayGame(msgType, di) base.cr.handlePlayGame(msgType, di)
if not config.GetBool('astron-support', True): if not __astron__:
def handleWaitForZoneRedirect(self, msgType, di): def handleWaitForZoneRedirect(self, msgType, di):
# self.notify.debug('handleWaitForZoneRedirect(' + 'msgType=' + str(msgType) + ', di=' + str(di) + ')') # self.notify.debug('handleWaitForZoneRedirect(' + 'msgType=' + str(msgType) + ', di=' + str(di) + ')')
if msgType == CLIENT_CREATE_OBJECT_REQUIRED: if msgType == CLIENT_CREATE_OBJECT_REQUIRED:

View file

@ -865,7 +865,7 @@ class NameShop(StateData.StateData):
def checkNamePattern(self): def checkNamePattern(self):
self.notify.debug('checkNamePattern') self.notify.debug('checkNamePattern')
if astronSupport: if __astron__:
base.cr.astronLoginManager.sendSetNamePattern(self.avId, base.cr.astronLoginManager.sendSetNamePattern(self.avId,
self.nameIndices[0], self.nameFlags[0], self.nameIndices[0], self.nameFlags[0],
self.nameIndices[1], self.nameFlags[1], self.nameIndices[1], self.nameFlags[1],
@ -887,7 +887,7 @@ class NameShop(StateData.StateData):
messenger.send('nameShopPost', [datagram]) messenger.send('nameShopPost', [datagram])
self.waitForServer() self.waitForServer()
if not config.GetBool('astron-support', True): if not __astron__:
def handleSetNamePatternAnswerMsg(self, di): def handleSetNamePatternAnswerMsg(self, di):
self.notify.debug('handleSetNamePatternAnswerMsg') self.notify.debug('handleSetNamePatternAnswerMsg')
self.cleanupWaitForServer() self.cleanupWaitForServer()
@ -953,14 +953,14 @@ class NameShop(StateData.StateData):
self.notify.debug('checkNameTyped') self.notify.debug('checkNameTyped')
if self._submitTypeANameAsPickAName(): if self._submitTypeANameAsPickAName():
return return
if not astronSupport: if not __astron__:
datagram = PyDatagram() datagram = PyDatagram()
datagram.addUint16(CLIENT_SET_WISHNAME) datagram.addUint16(CLIENT_SET_WISHNAME)
if justCheck: if justCheck:
avId = 0 avId = 0
else: else:
avId = self.avId avId = self.avId
if not astronSupport: if not __astron__:
datagram.addUint32(avId) datagram.addUint32(avId)
datagram.addString(self.nameEntry.get()) datagram.addString(self.nameEntry.get())
messenger.send('nameShopPost', [datagram]) messenger.send('nameShopPost', [datagram])
@ -968,7 +968,7 @@ class NameShop(StateData.StateData):
base.cr.astronLoginManager.sendSetNameTyped(avId, self.nameEntry.get(), self.handleSetNameTypedAnswerMsg) base.cr.astronLoginManager.sendSetNameTyped(avId, self.nameEntry.get(), self.handleSetNameTypedAnswerMsg)
self.waitForServer() self.waitForServer()
if not config.GetBool('astron-support', True): if not __astron__:
def handleSetNameTypedAnswerMsg(self, di): def handleSetNameTypedAnswerMsg(self, di):
self.notify.debug('handleSetNameTypedAnswerMsg') self.notify.debug('handleSetNameTypedAnswerMsg')
self.cleanupWaitForServer() self.cleanupWaitForServer()
@ -1082,14 +1082,14 @@ class NameShop(StateData.StateData):
self.requestingSkipTutorial = False self.requestingSkipTutorial = False
if not self.avExists or self.avExists and self.avId == 'deleteMe': if not self.avExists or self.avExists and self.avId == 'deleteMe':
messenger.send('nameShopCreateAvatar', [style, '', self.index]) messenger.send('nameShopCreateAvatar', [style, '', self.index])
if astronSupport: if __astron__:
self.accept('nameShopCreateAvatarDone', self.handleCreateAvatarResponseMsg) self.accept('nameShopCreateAvatarDone', self.handleCreateAvatarResponseMsg)
else: else:
self.checkNameTyped() self.checkNameTyped()
self.notify.debug('Ending Make A Toon: %s' % self.toon.style) self.notify.debug('Ending Make A Toon: %s' % self.toon.style)
base.cr.centralLogger.writeClientEvent('MAT - endingMakeAToon: %s' % self.toon.style) base.cr.centralLogger.writeClientEvent('MAT - endingMakeAToon: %s' % self.toon.style)
if not config.GetBool('astron-support', True): if not __astron__:
def handleCreateAvatarResponseMsg(self, di): def handleCreateAvatarResponseMsg(self, di):
self.notify.debug('handleCreateAvatarResponseMsg') self.notify.debug('handleCreateAvatarResponseMsg')
echoContext = di.getUint16() echoContext = di.getUint16()

View file

@ -229,7 +229,7 @@ class DistributedToonAI(DistributedPlayerAI.DistributedPlayerAI, DistributedSmoo
if self.WantOldGMNameBan: if self.WantOldGMNameBan:
self._checkOldGMName() self._checkOldGMName()
messenger.send('avatarEntered', [self]) messenger.send('avatarEntered', [self])
if config.GetBool('astron-support', True): if __astron__:
self.sendUpdate('setDefaultShard', [self.air.districtId]) self.sendUpdate('setDefaultShard', [self.air.districtId])
if hasattr(self, 'gameAccess') and self.gameAccess != 2: if hasattr(self, 'gameAccess') and self.gameAccess != 2:
if self.hat[0] != 0: if self.hat[0] != 0:
@ -250,7 +250,7 @@ class DistributedToonAI(DistributedPlayerAI.DistributedPlayerAI, DistributedSmoo
self.b_setShoes(0, 0, 0) self.b_setShoes(0, 0, 0)
self.startPing() self.startPing()
if config.GetBool('astron-support', True): if __astron__:
def setLocation(self, parentId, zoneId): def setLocation(self, parentId, zoneId):
DistributedPlayerAI.DistributedPlayerAI.setLocation(self, parentId, zoneId) DistributedPlayerAI.DistributedPlayerAI.setLocation(self, parentId, zoneId)
if self.isPlayerControlled(): if self.isPlayerControlled():

View file

@ -52,6 +52,8 @@ class ToonBase(OTPBase.OTPBase):
sys.exit(1) sys.exit(1)
self.disableShowbaseMouse() self.disableShowbaseMouse()
base.debugRunningMultiplier /= OTPGlobals.ToonSpeedFactor base.debugRunningMultiplier /= OTPGlobals.ToonSpeedFactor
__builtins__['__astron__'] = self.config.GetBool('astron-support', 1)
ToonBase.notify.info('__astron__ == %s' % __astron__)
self.toonChatSounds = self.config.GetBool('toon-chat-sounds', 1) self.toonChatSounds = self.config.GetBool('toon-chat-sounds', 1)
self.placeBeforeObjects = config.GetBool('place-before-objects', 1) self.placeBeforeObjects = config.GetBool('place-before-objects', 1)
self.endlessQuietZone = False self.endlessQuietZone = False

View file

@ -82,7 +82,6 @@ version = OnscreenText(serverVersion, pos=(-1.3, -0.975), scale=0.06, fg=Vec4(0,
loader.beginBulkLoad('init', TTLocalizer.LoaderLabel, 138, 0, TTLocalizer.TIP_NONE) loader.beginBulkLoad('init', TTLocalizer.LoaderLabel, 138, 0, TTLocalizer.TIP_NONE)
from .ToonBaseGlobal import * from .ToonBaseGlobal import *
from direct.showbase.MessengerGlobal import * from direct.showbase.MessengerGlobal import *
builtins.astronSupport = base.config.GetBool('astron-support', True)
from toontown.distributed import ToontownClientRepository from toontown.distributed import ToontownClientRepository
cr = ToontownClientRepository.ToontownClientRepository(serverVersion, launcher) cr = ToontownClientRepository.ToontownClientRepository(serverVersion, launcher)
cr.music = music cr.music = music

View file

@ -355,7 +355,7 @@ class Street(BattlePlace.BattlePlace):
if newZoneId != None: if newZoneId != None:
self.loader.zoneDict[newZoneId].setColor(0, 0, 1, 1, 100) self.loader.zoneDict[newZoneId].setColor(0, 0, 1, 1, 100)
if newZoneId != None: if newZoneId != None:
if not astronSupport: if not __astron__:
base.cr.sendSetZoneMsg(newZoneId) base.cr.sendSetZoneMsg(newZoneId)
else: else:
visZones = [self.loader.node2zone[x] for x in self.loader.nodeDict[newZoneId]] visZones = [self.loader.node2zone[x] for x in self.loader.nodeDict[newZoneId]]

View file

@ -73,7 +73,7 @@ class TownLoader(StateData.StateData):
del self.hood del self.hood
del self.nodeDict del self.nodeDict
del self.zoneDict del self.zoneDict
if astronSupport: if __astron__:
del self.node2zone del self.node2zone
del self.fadeInDict del self.fadeInDict
del self.fadeOutDict del self.fadeOutDict
@ -229,7 +229,7 @@ class TownLoader(StateData.StateData):
def makeDictionaries(self, dnaStore): def makeDictionaries(self, dnaStore):
self.nodeDict = {} self.nodeDict = {}
self.zoneDict = {} self.zoneDict = {}
if astronSupport: if __astron__:
self.node2zone = {} self.node2zone = {}
self.nodeList = [] self.nodeList = []
self.fadeInDict = {} self.fadeInDict = {}
@ -254,7 +254,7 @@ class TownLoader(StateData.StateData):
self.nodeDict[zoneId] = [] self.nodeDict[zoneId] = []
self.nodeList.append(groupNode) self.nodeList.append(groupNode)
self.zoneDict[zoneId] = groupNode self.zoneDict[zoneId] = groupNode
if astronSupport: if __astron__:
self.node2zone[groupNode] = zoneId self.node2zone[groupNode] = zoneId
fadeDuration = 0.5 fadeDuration = 0.5
self.fadeOutDict[groupNode] = Sequence(Func(groupNode.setTransparency, 1), LerpColorScaleInterval(groupNode, fadeDuration, a0, startColorScale=a1), Func(groupNode.clearColorScale), Func(groupNode.clearTransparency), Func(groupNode.stash), name='fadeZone-' + str(zoneId), autoPause=1) self.fadeOutDict[groupNode] = Sequence(Func(groupNode.setTransparency, 1), LerpColorScaleInterval(groupNode, fadeDuration, a0, startColorScale=a1), Func(groupNode.clearColorScale), Func(groupNode.clearTransparency), Func(groupNode.stash), name='fadeZone-' + str(zoneId), autoPause=1)

View file

@ -42,6 +42,6 @@ class ToontownUDRepository(ToontownInternalRepository):
globalClockRealTimeUponLogin=globalClock.getRealTime()) globalClockRealTimeUponLogin=globalClock.getRealTime())
def createGlobals(self): def createGlobals(self):
if astronSupport: if __astron__:
# Create our Astron login manager... # Create our Astron login manager...
self.astronLoginManager = self.generateGlobalObject(OTP_DO_ID_ASTRON_LOGIN_MANAGER, 'AstronLoginManager') self.astronLoginManager = self.generateGlobalObject(OTP_DO_ID_ASTRON_LOGIN_MANAGER, 'AstronLoginManager')