TutorialForceAcknowledge, DownloadForceAcknowledge and the huge launcher is exterminated.

This commit is contained in:
DenialMC 2015-04-08 11:56:49 +03:00
parent 977da9210f
commit d36f957694
53 changed files with 147 additions and 2734 deletions

View file

@ -31,7 +31,6 @@ from otp.distributed import DCClassImports
from otp.distributed import OtpDoGlobals from otp.distributed import OtpDoGlobals
from otp.distributed.OtpDoGlobals import * from otp.distributed.OtpDoGlobals import *
from otp.distributed.TelemetryLimiter import TelemetryLimiter from otp.distributed.TelemetryLimiter import TelemetryLimiter
from otp.login import HTTPUtil
from otp.otpbase import OTPGlobals from otp.otpbase import OTPGlobals
from otp.otpbase import OTPLocalizer from otp.otpbase import OTPLocalizer
from otp.otpgui import OTPDialog from otp.otpgui import OTPDialog
@ -46,29 +45,15 @@ class OTPClientRepository(ClientRepositoryBase):
'Approved', 'Approved',
'Rejected']) 'Rejected'])
def __init__(self, serverVersion, launcher = None, playGame = None): def __init__(self, serverVersion, playGame = None):
ClientRepositoryBase.__init__(self) ClientRepositoryBase.__init__(self)
self.handler = None self.handler = None
self.launcher = launcher
base.launcher = launcher
self.__currentAvId = 0 self.__currentAvId = 0
self.createAvatarClass = None self.createAvatarClass = None
self.systemMessageSfx = None self.systemMessageSfx = None
self.playToken = launcher.getPlayToken()
if self.launcher:
self.playToken = self.launcher.getPlayToken()
else:
self.playToken = None
self.notify.error('The client repository does not have the required playToken login')
self.wantMagicWords = False self.wantMagicWords = False
# TODO: HTTP
if self.launcher and hasattr(self.launcher, 'http'):
self.http = self.launcher.http
else:
self.http = HTTPClient()
self.userSignature = base.config.GetString('signature', 'none') self.userSignature = base.config.GetString('signature', 'none')
self.parentMgr.registerParent(OTPGlobals.SPRender, base.render) self.parentMgr.registerParent(OTPGlobals.SPRender, base.render)
self.parentMgr.registerParent(OTPGlobals.SPHidden, NodePath()) self.parentMgr.registerParent(OTPGlobals.SPHidden, NodePath())
@ -411,7 +396,7 @@ class OTPClientRepository(ClientRepositoryBase):
@report(types=['args', 'deltaStamp'], dConfigParam='teleport') @report(types=['args', 'deltaStamp'], dConfigParam='teleport')
def _handleConnected(self): def _handleConnected(self):
self.launcher.setDisconnectDetailsNormal() launcher.setDisconnectDetailsNormal()
messenger.send(self.getConnectedEvent()) messenger.send(self.getConnectedEvent())
self.gotoFirstScreen() self.gotoFirstScreen()
@ -432,7 +417,6 @@ class OTPClientRepository(ClientRepositoryBase):
def __handleLoginDone(self, doneStatus): def __handleLoginDone(self, doneStatus):
mode = doneStatus['mode'] mode = doneStatus['mode']
if mode == 'success': if mode == 'success':
self.setIsNotNewInstallation()
if hasattr(self, 'toontownTimeManager'): if hasattr(self, 'toontownTimeManager'):
timestamp = time.gmtime(doneStatus['timestamp']) timestamp = time.gmtime(doneStatus['timestamp'])
dateString = time.strftime(self.toontownTimeManager.formatStr, timestamp) dateString = time.strftime(self.toontownTimeManager.formatStr, timestamp)
@ -496,19 +480,6 @@ class OTPClientRepository(ClientRepositoryBase):
def enterFailedToGetServerConstants(self, e): def enterFailedToGetServerConstants(self, e):
self.handler = self.handleMessageType self.handler = self.handleMessageType
messenger.send('connectionIssue') messenger.send('connectionIssue')
statusCode = 0
if isinstance(e, HTTPUtil.ConnectionError):
statusCode = e.statusCode
self.notify.warning('Got status code %s from connection to %s.' % (statusCode, url.cStr()))
else:
self.notify.warning("Didn't get status code from connection to %s." % url.cStr())
if statusCode == 1403 or statusCode == 1400:
message = OTPLocalizer.CRServerConstantsProxyNoPort % (url.cStr(), url.getPort())
style = OTPDialog.CancelOnly
elif statusCode == 1405:
message = OTPLocalizer.CRServerConstantsProxyNoCONNECT % url.cStr()
style = OTPDialog.CancelOnly
else:
message = OTPLocalizer.CRServerConstantsTryAgain % url.cStr() message = OTPLocalizer.CRServerConstantsTryAgain % url.cStr()
style = OTPDialog.TwoChoice style = OTPDialog.TwoChoice
dialogClass = OTPGlobals.getGlobalDialogClass() dialogClass = OTPGlobals.getGlobalDialogClass()
@ -689,7 +660,6 @@ class OTPClientRepository(ClientRepositoryBase):
def enterReject(self): def enterReject(self):
self.handler = self.handleMessageType self.handler = self.handleMessageType
self.notify.warning('Connection Rejected') self.notify.warning('Connection Rejected')
launcher.setPandaErrorCode(13)
sys.exit() sys.exit()
@report(types=['args', 'deltaStamp'], dConfigParam='teleport') @report(types=['args', 'deltaStamp'], dConfigParam='teleport')
@ -719,7 +689,7 @@ class OTPClientRepository(ClientRepositoryBase):
reconnect = 0 reconnect = 0
if self.bootedIndex == 152: if self.bootedIndex == 152:
message = message % {'name': self.bootedText} message = message % {'name': self.bootedText}
self.launcher.setDisconnectDetails(self.bootedIndex, message) launcher.setDisconnectDetails(self.bootedIndex, message)
style = OTPDialog.Acknowledge style = OTPDialog.Acknowledge
if reconnect: if reconnect:
message += OTPLocalizer.CRTryConnectAgain message += OTPLocalizer.CRTryConnectAgain
@ -929,12 +899,6 @@ class OTPClientRepository(ClientRepositoryBase):
'ivalLoop', 'ivalLoop',
'downloadSequence', 'downloadSequence',
'patchAndHash', 'patchAndHash',
'launcher-download',
'launcher-download-multifile',
'launcher-decompressFile',
'launcher-decompressMultifile',
'launcher-extract',
'launcher-patch',
'slowCloseShardCallback', 'slowCloseShardCallback',
'tkLoop', 'tkLoop',
'manager-update', 'manager-update',
@ -980,15 +944,12 @@ class OTPClientRepository(ClientRepositoryBase):
'meta-h', 'meta-h',
'meta-h-repeat', 'meta-h-repeat',
'control-f9', 'control-f9',
'launcherAllPhasesComplete',
'launcherPercentPhaseComplete',
'newDistributedDirectory', 'newDistributedDirectory',
'page_down', 'page_down',
'page_up', 'page_up',
'panda3d-render-error', 'panda3d-render-error',
'PandaPaused', 'PandaPaused',
'PandaRestarted', 'PandaRestarted',
'phaseComplete-3',
'press-mouse2-fade', 'press-mouse2-fade',
'print-fade', 'print-fade',
'release-mouse2-fade', 'release-mouse2-fade',
@ -1427,9 +1388,6 @@ class OTPClientRepository(ClientRepositoryBase):
def __handleCancelWaiting(self, value): def __handleCancelWaiting(self, value):
self.loginFSM.request('shutdown') self.loginFSM.request('shutdown')
def setIsNotNewInstallation(self):
launcher.setIsNotNewInstallation()
def renderFrame(self): def renderFrame(self):
gsg = base.win.getGsg() gsg = base.win.getGsg()
if gsg: if gsg:

View file

@ -1,142 +0,0 @@
from pandac.PandaModules import *
import string
from direct.showbase.MessengerGlobal import *
from direct.showbase.DirectObject import DirectObject
from direct.showbase.EventManagerGlobal import *
from direct.task.TaskManagerGlobal import *
from direct.task.Task import Task
class DummyLauncherBase:
def __init__(self):
self.logPrefix = ''
self._downloadComplete = False
self.phaseComplete = {}
for phase in self.LauncherPhases:
self.phaseComplete[phase] = 0
self.firstPhase = self.LauncherPhases[0]
self.finalPhase = self.LauncherPhases[-1]
self.launcherFileDbHash = HashVal()
self.serverDbFileHash = HashVal()
self.setPandaErrorCode(0)
self.setServerVersion('dev')
def isDummy(self):
return 1
def startFakeDownload(self):
if ConfigVariableBool('fake-downloads', 0).getValue():
duration = ConfigVariableDouble('fake-download-duration', 60).getValue()
self.fakeDownload(duration)
else:
for phase in self.LauncherPhases:
self.phaseComplete[phase] = 100
self.downloadDoneTask(None)
return
def setPhaseCompleteArray(self, newPhaseComplete):
self.phaseComplete = newPhaseComplete
def setPhaseComplete(self, phase, percent):
self.phaseComplete[phase] = percent
def getPhaseComplete(self, phase):
return self.phaseComplete[phase] >= 100
def setPandaWindowOpen(self):
self.windowOpen = 1
def setPandaErrorCode(self, code):
self.pandaErrorCode = code
def getPandaErrorCode(self):
return self.pandaErrorCode
def setDisconnectDetailsNormal(self):
self.disconnectCode = 0
self.disconnectMsg = 'normal'
def setDisconnectDetails(self, newCode, newMsg):
self.disconnectCode = newCode
self.disconnectMsg = newMsg
def setServerVersion(self, version):
self.ServerVersion = version
def getServerVersion(self):
return self.ServerVersion
def getIsNewInstallation(self):
return base.config.GetBool('new-installation', 0)
def setIsNotNewInstallation(self):
pass
def getLastLogin(self):
if hasattr(self, 'lastLogin'):
return self.lastLogin
return ''
def setLastLogin(self, login):
self.lastLogin = login
def setUserLoggedIn(self):
self.userLoggedIn = 1
def getGameServer(self):
return '206.16.11.19'
def getAccountServer(self):
return ''
def getPlayToken(self):
return None
def fakeDownloadPhaseTask(self, task):
percentComplete = min(100, int(round(task.time / float(task.timePerPhase) * 100)))
self.setPhaseComplete(task.phase, percentComplete)
messenger.send('launcherPercentPhaseComplete', [task.phase,
percentComplete,
0,
0])
if percentComplete >= 100.0:
messenger.send('phaseComplete-' + `(task.phase)`)
return Task.done
else:
return Task.cont
def downloadDoneTask(self, task):
self._downloadComplete = True
messenger.send('launcherAllPhasesComplete')
return Task.done
def fakeDownload(self, timePerPhase):
self.phaseComplete = {1: 100,
2: 100,
3: 0,
3.5: 0,
4: 0,
5: 0,
5.5: 0,
6: 0,
7: 0,
8: 0,
9: 0,
10: 0,
11: 0,
12: 0,
13: 0}
phaseTaskList = []
firstPhaseIndex = self.LauncherPhases.index(self.firstPhase)
for phase in self.LauncherPhases[firstPhaseIndex:]:
phaseTask = Task(self.fakeDownloadPhaseTask, 'phaseDownload' + str(phase))
phaseTask.timePerPhase = timePerPhase
phaseTask.phase = phase
phaseTaskList.append(phaseTask)
phaseTaskList.append(Task(self.downloadDoneTask))
downloadSequence = Task.sequence(*phaseTaskList)
taskMgr.remove('downloadSequence')
taskMgr.add(downloadSequence, 'downloadSequence')

File diff suppressed because it is too large Load diff

View file

@ -1,43 +0,0 @@
import ctypes
from ctypes.wintypes import *
TH32CS_SNAPPROCESS = 2
INVALID_HANDLE_VALUE = -1
cwk = ctypes.windll.kernel32
class PROCESSENTRY32(ctypes.Structure):
_fields_ = [('dwSize', DWORD),
('cntUsage', DWORD),
('th32ProcessID', DWORD),
('th32DefaultHeapId', HANDLE),
('th32ModuleID', DWORD),
('cntThreads', DWORD),
('th32ParentProcessID', DWORD),
('pcPriClassBase', LONG),
('dwFlags', DWORD),
('szExeFile', c_char * MAX_PATH)]
class ProcessEntryPY:
def __init__(self, name, pid):
self.name = name
self.pid = pid
def getProcessList():
hProcessSnap = cwk.CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0)
processList = []
if hProcessSnap != INVALID_HANDLE_VALUE:
pe32 = PROCESSENTRY32()
pe32.dwSize = sizeof(pe32)
if cwk.Process32First(hProcessSnap, ctypes.byref(pe32)):
while 1:
processList.append(ProcessEntryPY(pe32.szExeFile.lower(), int(pe32.th32ProcessID)))
if not cwk.Process32Next(hProcessSnap, ctypes.byref(pe32)):
break
cwk.CloseHandle(hProcessSnap)
return processList

View file

@ -1,36 +0,0 @@
from pandac.PandaModules import *
class HTTPUtilException(Exception):
def __init__(self, what):
Exception.__init__(self, what)
class ConnectionError(HTTPUtilException):
def __init__(self, what, statusCode):
HTTPUtilException.__init__(self, what)
self.statusCode = statusCode
class UnexpectedResponse(HTTPUtilException):
def __init__(self, what):
HTTPUtilException.__init__(self, what)
def getHTTPResponse(url, http, body = ''):
if body:
hd = http.postForm(url, body)
else:
hd = http.getDocument(url)
if not hd.isValid():
raise ConnectionError('Unable to reach %s' % url.cStr(), hd.getStatusCode())
stream = hd.openReadBody()
sr = StreamReader(stream, 1)
response = sr.readlines()
for i in xrange(len(response)):
if response[i][-1] == '\n':
response[i] = response[i][:-1]
return response

View file

View file

@ -208,8 +208,6 @@ class OTPBase(ShowBase):
self.errorAccumulatorBuffer += 'file not in phase (%s, %s)\n' % (file, path) self.errorAccumulatorBuffer += 'file not in phase (%s, %s)\n' % (file, path)
return return
basePhase = float(match.groups()[0]) basePhase = float(match.groups()[0])
if not launcher.getPhaseComplete(basePhase):
self.errorAccumulatorBuffer += 'phase is not loaded for this model %s\n' % path
model = loader.loader.loadSync(Filename(path), loaderOptions) model = loader.loader.loadSync(Filename(path), loaderOptions)
if model: if model:
model = NodePath(model) model = NodePath(model)

View file

@ -579,11 +579,6 @@ class ClientRepositoryBase(ConnectionRepository):
return None return None
return worldNP return worldNP
def isLive(self):
if base.config.GetBool('force-live', 0):
return True
return not (__dev__ or launcher.isTestServer())
def isLocalId(self, id): def isLocalId(self, id):
# By default, no ID's are local. See also # By default, no ID's are local. See also
# ClientRepository.isLocalId(). # ClientRepository.isLocalId().

View file

@ -6,7 +6,6 @@ from direct.interval.IntervalGlobal import *
from direct.fsm import ClassicFSM, State from direct.fsm import ClassicFSM, State
from direct.fsm import State from direct.fsm import State
from direct.fsm import StateData from direct.fsm import StateData
from toontown.launcher import DownloadForceAcknowledge
from toontown.toonbase import TTLocalizer from toontown.toonbase import TTLocalizer
from direct.showbase import PythonUtil from direct.showbase import PythonUtil
@ -14,8 +13,7 @@ class Elevator(StateData.StateData):
def __init__(self, elevatorState, doneEvent, distElevator): def __init__(self, elevatorState, doneEvent, distElevator):
StateData.StateData.__init__(self, doneEvent) StateData.StateData.__init__(self, doneEvent)
self.fsm = ClassicFSM.ClassicFSM('Elevator', [State.State('start', self.enterStart, self.exitStart, ['elevatorDFA']), self.fsm = ClassicFSM.ClassicFSM('Elevator', [State.State('start', self.enterStart, self.exitStart, ['requestBoard', 'final']),
State.State('elevatorDFA', self.enterElevatorDFA, self.exitElevatorDFA, ['requestBoard', 'final']),
State.State('requestBoard', self.enterRequestBoard, self.exitRequestBoard, ['boarding']), State.State('requestBoard', self.enterRequestBoard, self.exitRequestBoard, ['boarding']),
State.State('boarding', self.enterBoarding, self.exitBoarding, ['boarded']), State.State('boarding', self.enterBoarding, self.exitBoarding, ['boarded']),
State.State('boarded', self.enterBoarded, self.exitBoarded, ['requestExit', 'elevatorClosing', 'final']), State.State('boarded', self.enterBoarded, self.exitBoarded, ['requestExit', 'elevatorClosing', 'final']),
@ -23,12 +21,10 @@ class Elevator(StateData.StateData):
State.State('elevatorClosing', self.enterElevatorClosing, self.exitElevatorClosing, ['final']), State.State('elevatorClosing', self.enterElevatorClosing, self.exitElevatorClosing, ['final']),
State.State('exiting', self.enterExiting, self.exitExiting, ['final']), State.State('exiting', self.enterExiting, self.exitExiting, ['final']),
State.State('final', self.enterFinal, self.exitFinal, ['start'])], 'start', 'final') State.State('final', self.enterFinal, self.exitFinal, ['start'])], 'start', 'final')
self.dfaDoneEvent = 'elevatorDfaDoneEvent'
self.elevatorState = elevatorState self.elevatorState = elevatorState
self.distElevator = distElevator self.distElevator = distElevator
distElevator.elevatorFSM = self distElevator.elevatorFSM = self
self.reverseBoardingCamera = False self.reverseBoardingCamera = False
self.skipDFABoard = 0
def load(self): def load(self):
self.elevatorState.addChild(self.fsm) self.elevatorState.addChild(self.fsm)
@ -52,7 +48,7 @@ class Elevator(StateData.StateData):
def enter(self): def enter(self):
self.fsm.enterInitialState() self.fsm.enterInitialState()
self.fsm.request('elevatorDFA') self.fsm.request('requestBoard')
def exit(self): def exit(self):
self.ignoreAll() self.ignoreAll()
@ -66,29 +62,6 @@ class Elevator(StateData.StateData):
def exitStart(self): def exitStart(self):
pass pass
def enterElevatorDFA(self):
self.acceptOnce(self.dfaDoneEvent, self.enterDFACallback)
self.dfa = DownloadForceAcknowledge.DownloadForceAcknowledge(self.dfaDoneEvent)
self.dfa.enter(7)
def enterDFACallback(self, DFAdoneStatus):
self.dfa.exit()
del self.dfa
if DFAdoneStatus['mode'] == 'complete':
if self.skipDFABoard:
self.skipDFABoard = 0
else:
self.fsm.request('requestBoard')
elif DFAdoneStatus['mode'] == 'incomplete':
elevatorDoneStatus = {}
elevatorDoneStatus['where'] = 'reject'
messenger.send(self.doneEvent, [elevatorDoneStatus])
else:
self.notify.error('Unrecognized doneStatus: ' + str(DFAdoneStatus))
def exitElevatorDFA(self):
self.ignore(self.dfaDoneEvent)
def enterRequestBoard(self): def enterRequestBoard(self):
messenger.send(self.distElevator.uniqueName('enterElevatorOK')) messenger.send(self.distElevator.uniqueName('enterElevatorOK'))

View file

@ -27,18 +27,14 @@ class SuitInterior(Place.Place):
'sit', 'sit',
'died', 'died',
'teleportOut', 'teleportOut',
'Elevator', 'Elevator']),
'DFA']),
State.State('sit', self.enterSit, self.exitSit, ['walk']), State.State('sit', self.enterSit, self.exitSit, ['walk']),
State.State('stickerBook', self.enterStickerBook, self.exitStickerBook, ['walk', State.State('stickerBook', self.enterStickerBook, self.exitStickerBook, ['walk',
'stopped', 'stopped',
'sit', 'sit',
'died', 'died',
'DFA',
'teleportOut', 'teleportOut',
'Elevator']), 'Elevator']),
State.State('DFA', self.enterDFA, self.exitDFA, ['DFAReject', 'teleportOut']),
State.State('DFAReject', self.enterDFAReject, self.exitDFAReject, ['walk']),
State.State('teleportIn', self.enterTeleportIn, self.exitTeleportIn, ['walk']), State.State('teleportIn', self.enterTeleportIn, self.exitTeleportIn, ['walk']),
State.State('teleportOut', self.enterTeleportOut, self.exitTeleportOut, ['teleportIn']), State.State('teleportOut', self.enterTeleportOut, self.exitTeleportOut, ['teleportIn']),
State.State('stopped', self.enterStopped, self.exitStopped, ['walk', 'elevatorOut']), State.State('stopped', self.enterStopped, self.exitStopped, ['walk', 'elevatorOut']),
@ -97,9 +93,6 @@ class SuitInterior(Place.Place):
self.doneStatus = requestStatus self.doneStatus = requestStatus
messenger.send(self.doneEvent) messenger.send(self.doneEvent)
def doRequestLeave(self, requestStatus):
self.fsm.request('DFA', [requestStatus])
def enterEntrance(self): def enterEntrance(self):
pass pass

View file

@ -30,23 +30,21 @@ class ToonInterior(Place.Place):
Place.Place.__init__(self, loader, doneEvent) Place.Place.__init__(self, loader, doneEvent)
self.dnaFile = 'phase_7/models/modules/toon_interior' self.dnaFile = 'phase_7/models/modules/toon_interior'
self.isInterior = 1 self.isInterior = 1
self.tfaDoneEvent = 'tfaDoneEvent'
self.hfaDoneEvent = 'hfaDoneEvent' self.hfaDoneEvent = 'hfaDoneEvent'
self.npcfaDoneEvent = 'npcfaDoneEvent' self.npcfaDoneEvent = 'npcfaDoneEvent'
self.fsm = ClassicFSM.ClassicFSM('ToonInterior', [State.State('start', self.enterStart, self.exitStart, ['doorIn', 'teleportIn', 'tutorial']), self.fsm = ClassicFSM.ClassicFSM('ToonInterior', [State.State('start', self.enterStart, self.exitStart, ['doorIn', 'teleportIn', 'tutorial']),
State.State('walk', self.enterWalk, self.exitWalk, ['sit', State.State('walk', self.enterWalk, self.exitWalk, ['sit',
'stickerBook', 'stickerBook',
'doorOut', 'doorOut',
'DFA',
'teleportOut', 'teleportOut',
'quest', 'quest',
'purchase', 'purchase',
'phone', 'phone',
'stopped', 'stopped',
'pet']), 'pet',
'NPCFA']),
State.State('sit', self.enterSit, self.exitSit, ['walk']), State.State('sit', self.enterSit, self.exitSit, ['walk']),
State.State('stickerBook', self.enterStickerBook, self.exitStickerBook, ['walk', State.State('stickerBook', self.enterStickerBook, self.exitStickerBook, ['walk',
'DFA',
'sit', 'sit',
'doorOut', 'doorOut',
'teleportOut', 'teleportOut',
@ -54,14 +52,9 @@ class ToonInterior(Place.Place):
'purchase', 'purchase',
'phone', 'phone',
'stopped', 'stopped',
'pet']), 'pet',
State.State('DFA', self.enterDFA, self.exitDFA, ['DFAReject', 'NPCFA']),
'HFA', State.State('NPCFA', self.enterNPCFA, self.exitNPCFA, ['NPCFAReject', 'HFA', 'teleportOut', 'doorOut']),
'NPCFA',
'teleportOut',
'doorOut']),
State.State('DFAReject', self.enterDFAReject, self.exitDFAReject, ['walk']),
State.State('NPCFA', self.enterNPCFA, self.exitNPCFA, ['NPCFAReject', 'HFA', 'teleportOut']),
State.State('NPCFAReject', self.enterNPCFAReject, self.exitNPCFAReject, ['walk']), State.State('NPCFAReject', self.enterNPCFAReject, self.exitNPCFAReject, ['walk']),
State.State('HFA', self.enterHFA, self.exitHFA, ['HFAReject', 'teleportOut', 'tunnelOut']), State.State('HFA', self.enterHFA, self.exitHFA, ['HFAReject', 'teleportOut', 'tunnelOut']),
State.State('HFAReject', self.enterHFAReject, self.exitHFAReject, ['walk']), State.State('HFAReject', self.enterHFAReject, self.exitHFAReject, ['walk']),
@ -124,18 +117,7 @@ class ToonInterior(Place.Place):
pass pass
def doRequestLeave(self, requestStatus): def doRequestLeave(self, requestStatus):
self.fsm.request('DFA', [requestStatus])
def enterDFACallback(self, requestStatus, doneStatus):
self.dfa.exit()
del self.dfa
ds = doneStatus['mode']
if ds == 'complete':
self.fsm.request('NPCFA', [requestStatus]) self.fsm.request('NPCFA', [requestStatus])
elif ds == 'incomplete':
self.fsm.request('DFAReject')
else:
self.notify.error('Unknown done status for DownloadForceAcknowledge: ' + `doneStatus`)
def enterNPCFA(self, requestStatus): def enterNPCFA(self, requestStatus):
self.acceptOnce(self.npcfaDoneEvent, self.enterNPCFACallback, [requestStatus]) self.acceptOnce(self.npcfaDoneEvent, self.enterNPCFACallback, [requestStatus])

View file

@ -38,18 +38,14 @@ class CogdoInterior(Place.Place):
'died', 'died',
'teleportOut', 'teleportOut',
'Elevator', 'Elevator',
'crane', 'crane']),
'DFA']),
State.State('sit', self.enterSit, self.exitSit, ['walk']), State.State('sit', self.enterSit, self.exitSit, ['walk']),
State.State('stickerBook', self.enterStickerBook, self.exitStickerBook, ['walk', State.State('stickerBook', self.enterStickerBook, self.exitStickerBook, ['walk',
'stopped', 'stopped',
'sit', 'sit',
'died', 'died',
'DFA',
'teleportOut', 'teleportOut',
'Elevator']), 'Elevator']),
State.State('DFA', self.enterDFA, self.exitDFA, ['DFAReject', 'teleportOut']),
State.State('DFAReject', self.enterDFAReject, self.exitDFAReject, ['walk']),
State.State('teleportIn', self.enterTeleportIn, self.exitTeleportIn, ['walk']), State.State('teleportIn', self.enterTeleportIn, self.exitTeleportIn, ['walk']),
State.State('teleportOut', self.enterTeleportOut, self.exitTeleportOut, ['teleportIn']), State.State('teleportOut', self.enterTeleportOut, self.exitTeleportOut, ['teleportIn']),
State.State('stopped', self.enterStopped, self.exitStopped, ['walk', 'elevatorOut', 'battle']), State.State('stopped', self.enterStopped, self.exitStopped, ['walk', 'elevatorOut', 'battle']),
@ -105,9 +101,6 @@ class CogdoInterior(Place.Place):
self.doneStatus = requestStatus self.doneStatus = requestStatus
messenger.send(self.doneEvent) messenger.send(self.doneEvent)
def doRequestLeave(self, requestStatus):
self.fsm.request('DFA', [requestStatus])
def enterEntrance(self): def enterEntrance(self):
pass pass

View file

@ -27,11 +27,9 @@ class BossbotHQExterior(CogHQExterior.CogHQExterior):
state = self.fsm.getStateNamed('stickerBook') state = self.fsm.getStateNamed('stickerBook')
state.addTransition('elevator') state.addTransition('elevator')
def enterElevator(self, distElevator, skipDFABoard = 0): def enterElevator(self, distElevator):
self.accept(self.elevatorDoneEvent, self.handleElevatorDone) self.accept(self.elevatorDoneEvent, self.handleElevatorDone)
self.elevator = Elevator.Elevator(self.fsm.getStateNamed('elevator'), self.elevatorDoneEvent, distElevator) self.elevator = Elevator.Elevator(self.fsm.getStateNamed('elevator'), self.elevatorDoneEvent, distElevator)
if skipDFABoard:
self.elevator.skipDFABoard = 1
self.elevator.setReverseBoardingCamera(True) self.elevator.setReverseBoardingCamera(True)
self.elevator.load() self.elevator.load()
self.elevator.enter() self.elevator.enter()

View file

@ -84,11 +84,9 @@ class CashbotHQExterior(CogHQExterior.CogHQExterior):
for train in self.trains: for train in self.trains:
train.hide() train.hide()
def enterElevator(self, distElevator, skipDFABoard = 0): def enterElevator(self, distElevator):
self.accept(self.elevatorDoneEvent, self.handleElevatorDone) self.accept(self.elevatorDoneEvent, self.handleElevatorDone)
self.elevator = Elevator.Elevator(self.fsm.getStateNamed('elevator'), self.elevatorDoneEvent, distElevator) self.elevator = Elevator.Elevator(self.fsm.getStateNamed('elevator'), self.elevatorDoneEvent, distElevator)
if skipDFABoard:
self.elevator.skipDFABoard = 1
self.elevator.load() self.elevator.load()
self.elevator.enter() self.elevator.enter()

View file

@ -31,7 +31,6 @@ class CogHQBossBattle(BattlePlace.BattlePlace):
'teleportOut', 'teleportOut',
'died', 'died',
'tunnelOut', 'tunnelOut',
'DFA',
'battle', 'battle',
'movie', 'movie',
'ouch', 'ouch',
@ -58,7 +57,6 @@ class CogHQBossBattle(BattlePlace.BattlePlace):
'teleportOut', 'teleportOut',
'died', 'died',
'tunnelOut', 'tunnelOut',
'DFA',
'battle', 'battle',
'movie', 'movie',
'ouch', 'ouch',
@ -66,13 +64,12 @@ class CogHQBossBattle(BattlePlace.BattlePlace):
'finalBattle', 'finalBattle',
'WaitForBattle']), 'WaitForBattle']),
State.State('stickerBook', self.enterStickerBook, self.exitStickerBook, ['walk', State.State('stickerBook', self.enterStickerBook, self.exitStickerBook, ['walk',
'DFA',
'WaitForBattle', 'WaitForBattle',
'movie', 'movie',
'battle']), 'battle',
'tunnelOut',
'teleportOut']),
State.State('WaitForBattle', self.enterWaitForBattle, self.exitWaitForBattle, ['battle', 'walk', 'movie']), State.State('WaitForBattle', self.enterWaitForBattle, self.exitWaitForBattle, ['battle', 'walk', 'movie']),
State.State('DFA', self.enterDFA, self.exitDFA, ['DFAReject', 'teleportOut', 'tunnelOut']),
State.State('DFAReject', self.enterDFAReject, self.exitDFAReject, ['walk']),
State.State('teleportIn', self.enterTeleportIn, self.exitTeleportIn, ['walk']), State.State('teleportIn', self.enterTeleportIn, self.exitTeleportIn, ['walk']),
State.State('teleportOut', self.enterTeleportOut, self.exitTeleportOut, ['teleportIn', 'final', 'WaitForBattle']), State.State('teleportOut', self.enterTeleportOut, self.exitTeleportOut, ['teleportIn', 'final', 'WaitForBattle']),
State.State('died', self.enterDied, self.exitDied, ['final']), State.State('died', self.enterDied, self.exitDied, ['final']),

View file

@ -20,7 +20,6 @@ class CogHQExterior(BattlePlace.BattlePlace):
State.State('walk', self.enterWalk, self.exitWalk, ['stickerBook', State.State('walk', self.enterWalk, self.exitWalk, ['stickerBook',
'teleportOut', 'teleportOut',
'tunnelOut', 'tunnelOut',
'DFA',
'doorOut', 'doorOut',
'died', 'died',
'stopped', 'stopped',
@ -32,17 +31,15 @@ class CogHQExterior(BattlePlace.BattlePlace):
State.State('doorIn', self.enterDoorIn, self.exitDoorIn, ['walk', 'stopped']), State.State('doorIn', self.enterDoorIn, self.exitDoorIn, ['walk', 'stopped']),
State.State('doorOut', self.enterDoorOut, self.exitDoorOut, ['walk', 'stopped']), State.State('doorOut', self.enterDoorOut, self.exitDoorOut, ['walk', 'stopped']),
State.State('stickerBook', self.enterStickerBook, self.exitStickerBook, ['walk', State.State('stickerBook', self.enterStickerBook, self.exitStickerBook, ['walk',
'DFA',
'WaitForBattle', 'WaitForBattle',
'battle', 'battle',
'tunnelOut', 'tunnelOut',
'teleportOut',
'doorOut', 'doorOut',
'squished', 'squished',
'died']), 'died']),
State.State('WaitForBattle', self.enterWaitForBattle, self.exitWaitForBattle, ['battle', 'walk']), State.State('WaitForBattle', self.enterWaitForBattle, self.exitWaitForBattle, ['battle', 'walk']),
State.State('battle', self.enterBattle, self.exitBattle, ['walk', 'teleportOut', 'died']), State.State('battle', self.enterBattle, self.exitBattle, ['walk', 'teleportOut', 'died']),
State.State('DFA', self.enterDFA, self.exitDFA, ['DFAReject', 'teleportOut', 'tunnelOut']),
State.State('DFAReject', self.enterDFAReject, self.exitDFAReject, ['walk']),
State.State('squished', self.enterSquished, self.exitSquished, ['walk', 'died', 'teleportOut']), State.State('squished', self.enterSquished, self.exitSquished, ['walk', 'died', 'teleportOut']),
State.State('teleportIn', self.enterTeleportIn, self.exitTeleportIn, ['walk', 'WaitForBattle', 'battle']), State.State('teleportIn', self.enterTeleportIn, self.exitTeleportIn, ['walk', 'WaitForBattle', 'battle']),
State.State('teleportOut', self.enterTeleportOut, self.exitTeleportOut, ['teleportIn', 'final', 'WaitForBattle']), State.State('teleportOut', self.enterTeleportOut, self.exitTeleportOut, ['teleportIn', 'final', 'WaitForBattle']),

View file

@ -19,7 +19,6 @@ class CogHQLobby(Place.Place):
'teleportIn', 'teleportIn',
'doorIn']), 'doorIn']),
State.State('walk', self.enterWalk, self.exitWalk, ['elevator', State.State('walk', self.enterWalk, self.exitWalk, ['elevator',
'DFA',
'doorOut', 'doorOut',
'stopped']), 'stopped']),
State.State('stopped', self.enterStopped, self.exitStopped, ['walk', 'teleportOut', 'elevator']), State.State('stopped', self.enterStopped, self.exitStopped, ['walk', 'teleportOut', 'elevator']),
@ -27,8 +26,6 @@ class CogHQLobby(Place.Place):
State.State('doorOut', self.enterDoorOut, self.exitDoorOut, ['walk']), State.State('doorOut', self.enterDoorOut, self.exitDoorOut, ['walk']),
State.State('teleportIn', self.enterTeleportIn, self.exitTeleportIn, ['walk']), State.State('teleportIn', self.enterTeleportIn, self.exitTeleportIn, ['walk']),
State.State('elevator', self.enterElevator, self.exitElevator, ['walk', 'stopped']), State.State('elevator', self.enterElevator, self.exitElevator, ['walk', 'stopped']),
State.State('DFA', self.enterDFA, self.exitDFA, ['DFAReject']),
State.State('DFAReject', self.enterDFAReject, self.exitDFAReject, ['walk']),
State.State('final', self.enterFinal, self.exitFinal, ['start'])], 'start', 'final') State.State('final', self.enterFinal, self.exitFinal, ['start'])], 'start', 'final')
def load(self): def load(self):
@ -69,11 +66,9 @@ class CogHQLobby(Place.Place):
self.ignore('teleportQuery') self.ignore('teleportQuery')
base.localAvatar.setTeleportAvailable(0) base.localAvatar.setTeleportAvailable(0)
def enterElevator(self, distElevator, skipDFABoard = 0): def enterElevator(self, distElevator):
self.accept(self.elevatorDoneEvent, self.handleElevatorDone) self.accept(self.elevatorDoneEvent, self.handleElevatorDone)
self.elevator = Elevator.Elevator(self.fsm.getStateNamed('elevator'), self.elevatorDoneEvent, distElevator) self.elevator = Elevator.Elevator(self.fsm.getStateNamed('elevator'), self.elevatorDoneEvent, distElevator)
if skipDFABoard:
self.elevator.skipDFABoard = 1
distElevator.elevatorFSM = self.elevator distElevator.elevatorFSM = self.elevator
self.elevator.load() self.elevator.load()
self.elevator.enter() self.elevator.enter()

View file

@ -34,7 +34,6 @@ class CountryClubInterior(BattlePlace.BattlePlace):
'died', 'died',
'teleportOut', 'teleportOut',
'squished', 'squished',
'DFA',
'fallDown', 'fallDown',
'stopped', 'stopped',
'elevator']), 'elevator']),
@ -43,7 +42,6 @@ class CountryClubInterior(BattlePlace.BattlePlace):
State.State('push', self.enterPush, self.exitPush, ['walk', 'died', 'teleportOut']), State.State('push', self.enterPush, self.exitPush, ['walk', 'died', 'teleportOut']),
State.State('stickerBook', self.enterStickerBook, self.exitStickerBook, ['walk', State.State('stickerBook', self.enterStickerBook, self.exitStickerBook, ['walk',
'battle', 'battle',
'DFA',
'WaitForBattle', 'WaitForBattle',
'died', 'died',
'teleportOut']), 'teleportOut']),
@ -62,8 +60,6 @@ class CountryClubInterior(BattlePlace.BattlePlace):
'FLA', 'FLA',
'quietZone', 'quietZone',
'WaitForBattle']), 'WaitForBattle']),
State.State('DFA', self.enterDFA, self.exitDFA, ['DFAReject', 'teleportOut']),
State.State('DFAReject', self.enterDFAReject, self.exitDFAReject, ['walkteleportOut']),
State.State('died', self.enterDied, self.exitDied, ['teleportOut']), State.State('died', self.enterDied, self.exitDied, ['teleportOut']),
State.State('FLA', self.enterFLA, self.exitFLA, ['quietZone']), State.State('FLA', self.enterFLA, self.exitFLA, ['quietZone']),
State.State('quietZone', self.enterQuietZone, self.exitQuietZone, ['teleportIn']), State.State('quietZone', self.enterQuietZone, self.exitQuietZone, ['teleportIn']),
@ -260,11 +256,9 @@ class CountryClubInterior(BattlePlace.BattlePlace):
def detectedElevatorCollision(self, distElevator): def detectedElevatorCollision(self, distElevator):
self.fsm.request('elevator', [distElevator]) self.fsm.request('elevator', [distElevator])
def enterElevator(self, distElevator, skipDFABoard = 0): def enterElevator(self, distElevator):
self.accept(self.elevatorDoneEvent, self.handleElevatorDone) self.accept(self.elevatorDoneEvent, self.handleElevatorDone)
self.elevator = Elevator.Elevator(self.fsm.getStateNamed('elevator'), self.elevatorDoneEvent, distElevator) self.elevator = Elevator.Elevator(self.fsm.getStateNamed('elevator'), self.elevatorDoneEvent, distElevator)
if skipDFABoard:
self.elevator.skipDFABoard = 1
self.elevator.setReverseBoardingCamera(True) self.elevator.setReverseBoardingCamera(True)
distElevator.elevatorFSM = self.elevator distElevator.elevatorFSM = self.elevator
self.elevator.load() self.elevator.load()

View file

@ -27,7 +27,6 @@ class FactoryExterior(BattlePlace.BattlePlace):
State.State('walk', self.enterWalk, self.exitWalk, ['stickerBook', State.State('walk', self.enterWalk, self.exitWalk, ['stickerBook',
'teleportOut', 'teleportOut',
'tunnelOut', 'tunnelOut',
'DFA',
'doorOut', 'doorOut',
'elevator', 'elevator',
'stopped', 'stopped',
@ -35,14 +34,13 @@ class FactoryExterior(BattlePlace.BattlePlace):
'battle']), 'battle']),
State.State('stopped', self.enterStopped, self.exitStopped, ['walk', 'teleportOut', 'elevator']), State.State('stopped', self.enterStopped, self.exitStopped, ['walk', 'teleportOut', 'elevator']),
State.State('stickerBook', self.enterStickerBook, self.exitStickerBook, ['walk', State.State('stickerBook', self.enterStickerBook, self.exitStickerBook, ['walk',
'DFA',
'WaitForBattle', 'WaitForBattle',
'battle', 'battle',
'elevator']), 'elevator',
'tunnelOut',
'teleportOut']),
State.State('WaitForBattle', self.enterWaitForBattle, self.exitWaitForBattle, ['battle', 'walk']), State.State('WaitForBattle', self.enterWaitForBattle, self.exitWaitForBattle, ['battle', 'walk']),
State.State('battle', self.enterBattle, self.exitBattle, ['walk', 'teleportOut', 'died']), State.State('battle', self.enterBattle, self.exitBattle, ['walk', 'teleportOut', 'died']),
State.State('DFA', self.enterDFA, self.exitDFA, ['DFAReject', 'teleportOut', 'tunnelOut']),
State.State('DFAReject', self.enterDFAReject, self.exitDFAReject, ['walk']),
State.State('teleportIn', self.enterTeleportIn, self.exitTeleportIn, ['walk']), State.State('teleportIn', self.enterTeleportIn, self.exitTeleportIn, ['walk']),
State.State('teleportOut', self.enterTeleportOut, self.exitTeleportOut, ['teleportIn', 'final', 'WaitForBattle']), State.State('teleportOut', self.enterTeleportOut, self.exitTeleportOut, ['teleportIn', 'final', 'WaitForBattle']),
State.State('doorIn', self.enterDoorIn, self.exitDoorIn, ['walk']), State.State('doorIn', self.enterDoorIn, self.exitDoorIn, ['walk']),
@ -145,11 +143,9 @@ class FactoryExterior(BattlePlace.BattlePlace):
def exitTeleportOut(self): def exitTeleportOut(self):
BattlePlace.BattlePlace.exitTeleportOut(self) BattlePlace.BattlePlace.exitTeleportOut(self)
def enterElevator(self, distElevator, skipDFABoard = 0): def enterElevator(self, distElevator):
self.accept(self.elevatorDoneEvent, self.handleElevatorDone) self.accept(self.elevatorDoneEvent, self.handleElevatorDone)
self.elevator = Elevator.Elevator(self.fsm.getStateNamed('elevator'), self.elevatorDoneEvent, distElevator) self.elevator = Elevator.Elevator(self.fsm.getStateNamed('elevator'), self.elevatorDoneEvent, distElevator)
if skipDFABoard:
self.elevator.skipDFABoard = 1
distElevator.elevatorFSM = self.elevator distElevator.elevatorFSM = self.elevator
self.elevator.load() self.elevator.load()
self.elevator.enter() self.elevator.enter()

View file

@ -32,7 +32,6 @@ class FactoryInterior(BattlePlace.BattlePlace):
'died', 'died',
'teleportOut', 'teleportOut',
'squished', 'squished',
'DFA',
'fallDown', 'fallDown',
'elevator']), 'elevator']),
State.State('stopped', self.enterStopped, self.exitStopped, ['walk', 'teleportOut']), State.State('stopped', self.enterStopped, self.exitStopped, ['walk', 'teleportOut']),
@ -40,7 +39,6 @@ class FactoryInterior(BattlePlace.BattlePlace):
State.State('push', self.enterPush, self.exitPush, ['walk', 'died', 'teleportOut']), State.State('push', self.enterPush, self.exitPush, ['walk', 'died', 'teleportOut']),
State.State('stickerBook', self.enterStickerBook, self.exitStickerBook, ['walk', State.State('stickerBook', self.enterStickerBook, self.exitStickerBook, ['walk',
'battle', 'battle',
'DFA',
'WaitForBattle', 'WaitForBattle',
'died', 'died',
'teleportOut']), 'teleportOut']),
@ -59,8 +57,6 @@ class FactoryInterior(BattlePlace.BattlePlace):
'FLA', 'FLA',
'quietZone', 'quietZone',
'WaitForBattle']), 'WaitForBattle']),
State.State('DFA', self.enterDFA, self.exitDFA, ['DFAReject', 'teleportOut']),
State.State('DFAReject', self.enterDFAReject, self.exitDFAReject, ['walkteleportOut']),
State.State('died', self.enterDied, self.exitDied, ['teleportOut']), State.State('died', self.enterDied, self.exitDied, ['teleportOut']),
State.State('FLA', self.enterFLA, self.exitFLA, ['quietZone']), State.State('FLA', self.enterFLA, self.exitFLA, ['quietZone']),
State.State('quietZone', self.enterQuietZone, self.exitQuietZone, ['teleportIn']), State.State('quietZone', self.enterQuietZone, self.exitQuietZone, ['teleportIn']),

View file

@ -30,7 +30,6 @@ class MintInterior(BattlePlace.BattlePlace):
'died', 'died',
'teleportOut', 'teleportOut',
'squished', 'squished',
'DFA',
'fallDown', 'fallDown',
'stopped']), 'stopped']),
State.State('stopped', self.enterStopped, self.exitStopped, ['walk', 'teleportOut', 'stickerBook']), State.State('stopped', self.enterStopped, self.exitStopped, ['walk', 'teleportOut', 'stickerBook']),
@ -38,7 +37,6 @@ class MintInterior(BattlePlace.BattlePlace):
State.State('push', self.enterPush, self.exitPush, ['walk', 'died', 'teleportOut']), State.State('push', self.enterPush, self.exitPush, ['walk', 'died', 'teleportOut']),
State.State('stickerBook', self.enterStickerBook, self.exitStickerBook, ['walk', State.State('stickerBook', self.enterStickerBook, self.exitStickerBook, ['walk',
'battle', 'battle',
'DFA',
'WaitForBattle', 'WaitForBattle',
'died', 'died',
'teleportOut']), 'teleportOut']),
@ -57,8 +55,6 @@ class MintInterior(BattlePlace.BattlePlace):
'FLA', 'FLA',
'quietZone', 'quietZone',
'WaitForBattle']), 'WaitForBattle']),
State.State('DFA', self.enterDFA, self.exitDFA, ['DFAReject', 'teleportOut']),
State.State('DFAReject', self.enterDFAReject, self.exitDFAReject, ['walkteleportOut']),
State.State('died', self.enterDied, self.exitDied, ['teleportOut']), State.State('died', self.enterDied, self.exitDied, ['teleportOut']),
State.State('FLA', self.enterFLA, self.exitFLA, ['quietZone']), State.State('FLA', self.enterFLA, self.exitFLA, ['quietZone']),
State.State('quietZone', self.enterQuietZone, self.exitQuietZone, ['teleportIn']), State.State('quietZone', self.enterQuietZone, self.exitQuietZone, ['teleportIn']),

View file

@ -32,14 +32,12 @@ class StageInterior(BattlePlace.BattlePlace):
'died', 'died',
'teleportOut', 'teleportOut',
'squished', 'squished',
'DFA',
'fallDown', 'fallDown',
'elevator']), 'elevator']),
State.State('sit', self.enterSit, self.exitSit, ['walk', 'died', 'teleportOut']), State.State('sit', self.enterSit, self.exitSit, ['walk', 'died', 'teleportOut']),
State.State('push', self.enterPush, self.exitPush, ['walk', 'died', 'teleportOut']), State.State('push', self.enterPush, self.exitPush, ['walk', 'died', 'teleportOut']),
State.State('stickerBook', self.enterStickerBook, self.exitStickerBook, ['walk', State.State('stickerBook', self.enterStickerBook, self.exitStickerBook, ['walk',
'battle', 'battle',
'DFA',
'WaitForBattle', 'WaitForBattle',
'died', 'died',
'teleportOut']), 'teleportOut']),
@ -58,8 +56,6 @@ class StageInterior(BattlePlace.BattlePlace):
'FLA', 'FLA',
'quietZone', 'quietZone',
'WaitForBattle']), 'WaitForBattle']),
State.State('DFA', self.enterDFA, self.exitDFA, ['DFAReject', 'teleportOut']),
State.State('DFAReject', self.enterDFAReject, self.exitDFAReject, ['walkteleportOut']),
State.State('died', self.enterDied, self.exitDied, ['teleportOut']), State.State('died', self.enterDied, self.exitDied, ['teleportOut']),
State.State('FLA', self.enterFLA, self.exitFLA, ['quietZone']), State.State('FLA', self.enterFLA, self.exitFLA, ['quietZone']),
State.State('quietZone', self.enterQuietZone, self.exitQuietZone, ['teleportIn']), State.State('quietZone', self.enterQuietZone, self.exitQuietZone, ['teleportIn']),

View file

@ -219,23 +219,6 @@ class HoodMgr(DirectObject.DirectObject):
self.currentDropPoint = (self.currentDropPoint + 1) % len(dropPointList) self.currentDropPoint = (self.currentDropPoint + 1) % len(dropPointList)
return dropPointList[droppnt] return dropPointList[droppnt]
def getAvailableZones(self):
if base.launcher == None:
return self.getZonesInPhase(4) + self.getZonesInPhase(6) + self.getZonesInPhase(8) + self.getZonesInPhase(9) + self.getZonesInPhase(10) + self.getZonesInPhase(11) + self.getZonesInPhase(12) + self.getZonesInPhase(13)
else:
zones = []
for phase in set(ToontownGlobals.phaseMap.values()):
if base.launcher.getPhaseComplete(phase):
zones = zones + self.getZonesInPhase(phase)
return zones
def getZonesInPhase(self, phase):
p = []
for i in ToontownGlobals.phaseMap.items():
if i[1] == phase:
p.append(i[0])
return p
def getPhaseFromHood(self, hoodId): def getPhaseFromHood(self, hoodId):
hoodId = ZoneUtil.getCanonicalHoodId(hoodId) hoodId = ZoneUtil.getCanonicalHoodId(hoodId)
return ToontownGlobals.phaseMap[hoodId] return ToontownGlobals.phaseMap[hoodId]

View file

@ -16,7 +16,6 @@ from direct.showbase.InputStateGlobal import inputState
from otp.avatar import Avatar from otp.avatar import Avatar
from otp.avatar import DistributedAvatar from otp.avatar import DistributedAvatar
from otp.friends import FriendManager from otp.friends import FriendManager
from otp.login import HTTPUtil
from otp.distributed import OTPClientRepository from otp.distributed import OTPClientRepository
from otp.distributed import PotentialAvatar from otp.distributed import PotentialAvatar
from otp.distributed import PotentialShard from otp.distributed import PotentialShard
@ -28,7 +27,6 @@ from otp.otpbase import OTPLocalizer
from otp.avatar.Avatar import teleportNotify from otp.avatar.Avatar import teleportNotify
from toontown.toonbase.ToonBaseGlobal import * from toontown.toonbase.ToonBaseGlobal import *
from toontown.toonbase.ToontownGlobals import * from toontown.toonbase.ToontownGlobals import *
from toontown.launcher.DownloadForceAcknowledge import *
from toontown.distributed import DelayDelete from toontown.distributed import DelayDelete
from toontown.friends import FriendHandle from toontown.friends import FriendHandle
from toontown.friends import FriendsListPanel from toontown.friends import FriendsListPanel
@ -61,8 +59,8 @@ class ToontownClientRepository(OTPClientRepository.OTPClientRepository):
ClearInterestDoneEvent = 'TCRClearInterestDone' ClearInterestDoneEvent = 'TCRClearInterestDone'
KeepSubShardObjects = False KeepSubShardObjects = False
def __init__(self, serverVersion, launcher = None): def __init__(self, serverVersion):
OTPClientRepository.OTPClientRepository.__init__(self, serverVersion, launcher, playGame=PlayGame.PlayGame) OTPClientRepository.OTPClientRepository.__init__(self, serverVersion, playGame=PlayGame.PlayGame)
self._playerAvDclass = self.dclassesByName['DistributedToon'] self._playerAvDclass = self.dclassesByName['DistributedToon']
setInterfaceFont(TTLocalizer.InterfaceFont) setInterfaceFont(TTLocalizer.InterfaceFont)
setSignFont(TTLocalizer.SignFont) setSignFont(TTLocalizer.SignFont)
@ -71,8 +69,6 @@ class ToontownClientRepository(OTPClientRepository.OTPClientRepository):
setNametagFont(i, TTLocalizer.NametagFonts[i]) setNametagFont(i, TTLocalizer.NametagFonts[i])
self.toons = {} self.toons = {}
if self.http.getVerifySsl() != HTTPClient.VSNoVerify:
self.http.setVerifySsl(HTTPClient.VSNoDateCheck)
self.__forbidCheesyEffects = 0 self.__forbidCheesyEffects = 0
self.friendManager = None self.friendManager = None
self.trophyManager = None self.trophyManager = None
@ -202,7 +198,7 @@ class ToontownClientRepository(OTPClientRepository.OTPClientRepository):
base.playMusic(self.music, looping=1, volume=0.9, interrupt=None) base.playMusic(self.music, looping=1, volume=0.9, interrupt=None)
self.handler = self.handleMessageType self.handler = self.handleMessageType
self.avChoiceDoneEvent = 'avatarChooserDone' self.avChoiceDoneEvent = 'avatarChooserDone'
self.avChoice = AvatarChooser.AvatarChooser(avList, self.loginFSM, self.avChoiceDoneEvent) self.avChoice = AvatarChooser.AvatarChooser(avList, self.avChoiceDoneEvent)
self.avChoice.load() self.avChoice.load()
self.avChoice.enter() self.avChoice.enter()
self.accept(self.avChoiceDoneEvent, self.__handleAvatarChooserDone, [avList]) self.accept(self.avChoiceDoneEvent, self.__handleAvatarChooserDone, [avList])
@ -232,25 +228,11 @@ class ToontownClientRepository(OTPClientRepository.OTPClientRepository):
base.localAvatarStyle = dna base.localAvatarStyle = dna
base.localAvatarName = avatarChoice.name base.localAvatarName = avatarChoice.name
self.loginFSM.request('waitForSetAvatarResponse', [avatarChoice]) self.loginFSM.request('waitForSetAvatarResponse', [avatarChoice])
elif done == 'nameIt':
self.accept('downloadAck-response', self.__handleDownloadAck, [avList, index])
self.downloadAck = DownloadForceAcknowledge('downloadAck-response')
self.downloadAck.enter(4)
elif done == 'create': elif done == 'create':
self.loginFSM.request('createAvatar', [avList, index]) self.loginFSM.request('createAvatar', [avList, index])
elif done == 'delete': elif done == 'delete':
self.loginFSM.request('waitForDeleteAvatarResponse', [avatarChoice]) self.loginFSM.request('waitForDeleteAvatarResponse', [avatarChoice])
def __handleDownloadAck(self, avList, index, doneStatus):
if doneStatus['mode'] == 'complete':
self.goToPickAName(avList, index)
else:
self.loginFSM.request('chooseAvatar', [avList])
self.downloadAck.exit()
self.downloadAck = None
self.ignore('downloadAck-response')
return
def exitChooseAvatar(self): def exitChooseAvatar(self):
self.handler = None self.handler = None
self.avChoice.exit() self.avChoice.exit()
@ -294,14 +276,11 @@ class ToontownClientRepository(OTPClientRepository.OTPClientRepository):
self.loginFSM.request('chooseAvatar', [avList]) self.loginFSM.request('chooseAvatar', [avList])
elif done == 'created': elif done == 'created':
self.avCreate.exit() self.avCreate.exit()
if not base.launcher or base.launcher.getPhaseComplete(3.5):
for i in avList: for i in avList:
if i.position == avPosition: if i.position == avPosition:
newPotAv = i newPotAv = i
self.loginFSM.request('waitForSetAvatarResponse', [newPotAv]) self.loginFSM.request('waitForSetAvatarResponse', [newPotAv])
else:
self.loginFSM.request('chooseAvatar', [avList])
else: else:
self.notify.error('Invalid doneStatus from MakeAToon: ' + str(done)) self.notify.error('Invalid doneStatus from MakeAToon: ' + str(done))

View file

@ -41,7 +41,7 @@ class Estate(Place.Place):
'fishing', 'fishing',
'mailbox', 'mailbox',
'stopped', 'stopped',
'DFA', 'teleportOut',
'doorOut', 'doorOut',
'push', 'push',
'pet']), 'pet']),
@ -57,7 +57,7 @@ class Estate(Place.Place):
'doorOut', 'doorOut',
'push', 'push',
'pet', 'pet',
'DFA']), 'teleportOut']),
State.State('teleportIn', self.enterTeleportIn, self.exitTeleportIn, ['walk', 'petTutorial']), State.State('teleportIn', self.enterTeleportIn, self.exitTeleportIn, ['walk', 'petTutorial']),
State.State('teleportOut', self.enterTeleportOut, self.exitTeleportOut, ['teleportIn', 'walk', 'final']), State.State('teleportOut', self.enterTeleportOut, self.exitTeleportOut, ['teleportIn', 'walk', 'final']),
State.State('doorIn', self.enterDoorIn, self.exitDoorIn, ['walk']), State.State('doorIn', self.enterDoorIn, self.exitDoorIn, ['walk']),
@ -67,9 +67,7 @@ class Estate(Place.Place):
State.State('fishing', self.enterFishing, self.exitFishing, ['walk', 'stopped']), State.State('fishing', self.enterFishing, self.exitFishing, ['walk', 'stopped']),
State.State('mailbox', self.enterMailbox, self.exitMailbox, ['walk', 'stopped']), State.State('mailbox', self.enterMailbox, self.exitMailbox, ['walk', 'stopped']),
State.State('stopped', self.enterStopped, self.exitStopped, ['walk']), State.State('stopped', self.enterStopped, self.exitStopped, ['walk']),
State.State('pet', self.enterPet, self.exitPet, ['walk', 'DFA']), State.State('pet', self.enterPet, self.exitPet, ['walk', 'teleportOut'])], 'init', 'final')
State.State('DFA', self.enterDFA, self.exitDFA, ['DFAReject', 'teleportOut']),
State.State('DFAReject', self.enterDFAReject, self.exitDFAReject, ['walk'])], 'init', 'final')
self.fsm.enterInitialState() self.fsm.enterInitialState()
self.doneEvent = doneEvent self.doneEvent = doneEvent
self.parentFSMState = parentFSMState self.parentFSMState = parentFSMState
@ -173,9 +171,6 @@ class Estate(Place.Place):
if hasattr(self, 'fsm'): if hasattr(self, 'fsm'):
self.fsm.request('walk') self.fsm.request('walk')
def doRequestLeave(self, requestStatus):
self.fsm.request('DFA', [requestStatus])
def enterInit(self): def enterInit(self):
pass pass

View file

@ -3,13 +3,7 @@ from toontown.toonbase.ToontownGlobals import *
from direct.interval.IntervalGlobal import * from direct.interval.IntervalGlobal import *
from direct.fsm import ClassicFSM, State from direct.fsm import ClassicFSM, State
from toontown.safezone import SafeZoneLoader from toontown.safezone import SafeZoneLoader
import random import random, math, House, Estate, HouseGlobals
from toontown.launcher import DownloadForceAcknowledge
import House
import Estate
import HouseGlobals
import random
import math
from toontown.coghq import MovingPlatform from toontown.coghq import MovingPlatform
from direct.directnotify import DirectNotifyGlobal from direct.directnotify import DirectNotifyGlobal

View file

@ -20,13 +20,11 @@ class House(Place.Place):
self.ownersAvId = avId self.ownersAvId = avId
self.dnaFile = 'phase_7/models/modules/toon_interior' self.dnaFile = 'phase_7/models/modules/toon_interior'
self.isInterior = 1 self.isInterior = 1
self.tfaDoneEvent = 'tfaDoneEvent'
self.oldStyle = None self.oldStyle = None
self.fsm = ClassicFSM.ClassicFSM('House', [State.State('start', self.enterStart, self.exitStart, ['doorIn', 'teleportIn', 'tutorial']), self.fsm = ClassicFSM.ClassicFSM('House', [State.State('start', self.enterStart, self.exitStart, ['doorIn', 'teleportIn', 'tutorial']),
State.State('walk', self.enterWalk, self.exitWalk, ['sit', State.State('walk', self.enterWalk, self.exitWalk, ['sit',
'stickerBook', 'stickerBook',
'doorOut', 'doorOut',
'DFA',
'teleportOut', 'teleportOut',
'quest', 'quest',
'purchase', 'purchase',
@ -36,7 +34,6 @@ class House(Place.Place):
'stopped']), 'stopped']),
State.State('sit', self.enterSit, self.exitSit, ['walk']), State.State('sit', self.enterSit, self.exitSit, ['walk']),
State.State('stickerBook', self.enterStickerBook, self.exitStickerBook, ['walk', State.State('stickerBook', self.enterStickerBook, self.exitStickerBook, ['walk',
'DFA',
'sit', 'sit',
'doorOut', 'doorOut',
'teleportOut', 'teleportOut',
@ -46,8 +43,6 @@ class House(Place.Place):
'banking', 'banking',
'phone', 'phone',
'stopped']), 'stopped']),
State.State('DFA', self.enterDFA, self.exitDFA, ['DFAReject', 'teleportOut', 'doorOut']),
State.State('DFAReject', self.enterDFAReject, self.exitDFAReject, ['walk']),
State.State('doorIn', self.enterDoorIn, self.exitDoorIn, ['walk']), State.State('doorIn', self.enterDoorIn, self.exitDoorIn, ['walk']),
State.State('doorOut', self.enterDoorOut, self.exitDoorOut, ['walk']), State.State('doorOut', self.enterDoorOut, self.exitDoorOut, ['walk']),
State.State('teleportIn', self.enterTeleportIn, self.exitTeleportIn, ['walk']), State.State('teleportIn', self.enterTeleportIn, self.exitTeleportIn, ['walk']),

View file

@ -4,7 +4,6 @@ from direct.directnotify import DirectNotifyGlobal
from direct.fsm import StateData from direct.fsm import StateData
from direct.showbase.PythonUtil import PriorityCallbacks from direct.showbase.PythonUtil import PriorityCallbacks
from toontown.safezone import PublicWalk from toontown.safezone import PublicWalk
from toontown.launcher import DownloadForceAcknowledge
import ZoneUtil import ZoneUtil
from toontown.friends import FriendsListManager from toontown.friends import FriendsListManager
from toontown.toonbase import ToontownGlobals from toontown.toonbase import ToontownGlobals
@ -25,7 +24,6 @@ class Place(StateData.StateData, FriendsListManager.FriendsListManager):
StateData.StateData.__init__(self, doneEvent) StateData.StateData.__init__(self, doneEvent)
FriendsListManager.FriendsListManager.__init__(self) FriendsListManager.FriendsListManager.__init__(self)
self.loader = loader self.loader = loader
self.dfaDoneEvent = 'dfaDoneEvent'
self.zoneId = None self.zoneId = None
self._tiToken = None self._tiToken = None
self._leftQuietZoneLocalCallbacks = PriorityCallbacks() self._leftQuietZoneLocalCallbacks = PriorityCallbacks()
@ -413,19 +411,6 @@ class Place(StateData.StateData, FriendsListManager.FriendsListManager):
if hasattr(self, 'fsm'): if hasattr(self, 'fsm'):
self.doRequestLeave(requestStatus) self.doRequestLeave(requestStatus)
def doRequestLeave(self, requestStatus):
teleportDebug(requestStatus, 'requestLeave(%s)' % (requestStatus,))
self.fsm.request('DFA', [requestStatus])
def enterDFA(self, requestStatus):
teleportDebug(requestStatus, 'enterDFA(%s)' % (requestStatus,))
self.acceptOnce(self.dfaDoneEvent, self.enterDFACallback, [requestStatus])
self.dfa = DownloadForceAcknowledge.DownloadForceAcknowledge(self.dfaDoneEvent)
self.dfa.enter(base.cr.hoodMgr.getPhaseFromHood(requestStatus['hoodId']))
def exitDFA(self):
self.ignore(self.dfaDoneEvent)
def handleEnterTunnel(self, requestStatus, collEntry): def handleEnterTunnel(self, requestStatus, collEntry):
if localAvatar.hasActiveBoardingGroup(): if localAvatar.hasActiveBoardingGroup():
rejectText = TTLocalizer.BoardingCannotLeaveZone rejectText = TTLocalizer.BoardingCannotLeaveZone
@ -442,11 +427,7 @@ class Place(StateData.StateData, FriendsListManager.FriendsListManager):
return return
self.requestLeave(requestStatus) self.requestLeave(requestStatus)
def enterDFACallback(self, requestStatus, doneStatus): def doRequestLeave(self, requestStatus):
teleportDebug(requestStatus, 'enterDFACallback%s' % ((requestStatus, doneStatus),))
self.dfa.exit()
del self.dfa
if doneStatus['mode'] == 'complete':
if requestStatus.get('tutorial', 0): if requestStatus.get('tutorial', 0):
out = {'teleportIn': 'tunnelOut'} out = {'teleportIn': 'tunnelOut'}
requestStatus['zoneId'] = 22000 requestStatus['zoneId'] = 22000
@ -455,18 +436,7 @@ class Place(StateData.StateData, FriendsListManager.FriendsListManager):
out = {'teleportIn': 'teleportOut', out = {'teleportIn': 'teleportOut',
'tunnelIn': 'tunnelOut', 'tunnelIn': 'tunnelOut',
'doorIn': 'doorOut'} 'doorIn': 'doorOut'}
teleportDebug(requestStatus, 'requesting %s, requestStatus=%s' % (out[requestStatus['how']], requestStatus))
self.fsm.request(out[requestStatus['how']], [requestStatus]) self.fsm.request(out[requestStatus['how']], [requestStatus])
elif doneStatus['mode'] == 'incomplete':
self.fsm.request('DFAReject')
else:
Place.notify.error('Unknown done status for DownloadForceAcknowledge: ' + `doneStatus`)
def enterDFAReject(self):
self.fsm.request('walk')
def exitDFAReject(self):
pass
def enterDoorIn(self, requestStatus): def enterDoorIn(self, requestStatus):
NametagGlobals.setWant2dNametags(False) NametagGlobals.setWant2dNametags(False)

View file

@ -1,42 +0,0 @@
from pandac.PandaModules import *
from toontown.toontowngui import TTDialog
from toontown.toonbase import TTLocalizer
import random
class DownloadForceAcknowledge:
def __init__(self, doneEvent):
self.doneEvent = doneEvent
self.dialog = None
return
def enter(self, phase):
doneStatus = {}
if launcher.getPhaseComplete(phase):
doneStatus['mode'] = 'complete'
messenger.send(self.doneEvent, [doneStatus])
else:
try:
base.localAvatar.b_setAnimState('neutral', 1)
except:
pass
doneStatus['mode'] = 'incomplete'
self.doneStatus = doneStatus
percentComplete = base.launcher.getPercentPhaseComplete(phase)
phaseName = TTLocalizer.LauncherPhaseNames[phase]
verb = random.choice(TTLocalizer.DownloadForceAcknowledgeVerbList)
msg = TTLocalizer.DownloadForceAcknowledgeMsg % {'phase': phaseName,
'verb': verb}
self.dialog = TTDialog.TTDialog(text=msg, command=self.handleOk, style=TTDialog.Acknowledge)
self.dialog.show()
def exit(self):
if self.dialog:
self.dialog.hide()
self.dialog.cleanup()
self.dialog = None
return
def handleOk(self, value):
messenger.send(self.doneEvent, [self.doneStatus])

View file

@ -1,6 +1,5 @@
from pandac.PandaModules import * from pandac.PandaModules import *
from direct.directnotify import DirectNotifyGlobal from direct.directnotify import DirectNotifyGlobal
from otp.launcher.LauncherBase import LauncherBase
import os, sys, time, argparse import os, sys, time, argparse
class LogAndOutput: class LogAndOutput:
@ -18,8 +17,8 @@ class LogAndOutput:
self.log.flush() self.log.flush()
self.orig.flush() self.orig.flush()
class TTULauncher(LauncherBase): class TTULauncher:
notify = DirectNotifyGlobal.directNotify.newCategory('ToontownDummyLauncher') notify = DirectNotifyGlobal.directNotify.newCategory('TTULauncher')
def __init__(self): def __init__(self):
self.logPrefix = 'united-' self.logPrefix = 'united-'
@ -31,9 +30,7 @@ class TTULauncher(LauncherBase):
self.args = parser.parse_args() self.args = parser.parse_args()
ltime = 1 and time.localtime() ltime = 1 and time.localtime()
logSuffix = '%02d%02d%02d_%02d%02d%02d' % (ltime[0] - 2000, ltime[1], ltime[2], logSuffix = '%02d%02d%02d_%02d%02d%02d' % (ltime[0] - 2000, ltime[1], ltime[2], ltime[3], ltime[4], ltime[5])
ltime[3], ltime[4], ltime[5])
if not os.path.exists('logs/'): if not os.path.exists('logs/'):
os.mkdir('logs/') os.mkdir('logs/')
@ -53,31 +50,12 @@ class TTULauncher(LauncherBase):
def getGameServer(self): def getGameServer(self):
return self.args.server return self.args.server
def setPandaErrorCode(self, code): def setPandaErrorCode(self):
pass pass
def getGame2Done(self): def setDisconnectDetails(self, disconnectCode, disconnectMsg):
return True self.disconnectCode = disconnectCode
self.disconnectMsg = disconnectMsg
def getLogFileName(self): def setDisconnectDetailsNormal(self):
return 'toontown' self.setDisconnectDetails(0, 'normal')
def getValue(self, key, default = None):
return os.environ.get(key, default)
def setValue(self, key, value):
os.environ[key] = str(value)
def getVerifyFiles(self):
return config.GetInt('launcher-verify', 0)
def isDownloadComplete(self):
return 1
def getPhaseComplete(self, phase):
return 1
def startGame(self):
self.newTaskManager()
eventMgr.restart()
from toontown.toonbase import ToontownStart

View file

@ -1,17 +1,14 @@
from pandac.PandaModules import * from pandac.PandaModules import *
from toontown.toonbase import ToontownGlobals from toontown.toonbase import ToontownGlobals
import AvatarChoice
from direct.fsm import StateData
from direct.fsm import ClassicFSM, State
from direct.fsm import State
from toontown.launcher import DownloadForceAcknowledge
from toontown.language import LanguageSelector from toontown.language import LanguageSelector
from direct.fsm import StateData
from direct.gui.DirectGui import * from direct.gui.DirectGui import *
from pandac.PandaModules import * from pandac.PandaModules import *
from toontown.toonbase import TTLocalizer from toontown.toonbase import TTLocalizer
from direct.directnotify import DirectNotifyGlobal from direct.directnotify import DirectNotifyGlobal
from direct.interval.IntervalGlobal import * from direct.interval.IntervalGlobal import *
import random import random, AvatarChoice
MAX_AVATARS = 6 MAX_AVATARS = 6
POSITIONS = (Vec3(-0.840167, 0, 0.359333), POSITIONS = (Vec3(-0.840167, 0, 0.359333),
Vec3(0.00933349, 0, 0.306533), Vec3(0.00933349, 0, 0.306533),
@ -29,14 +26,10 @@ chooser_notify = DirectNotifyGlobal.directNotify.newCategory('AvatarChooser')
class AvatarChooser(StateData.StateData): class AvatarChooser(StateData.StateData):
def __init__(self, avatarList, parentFSM, doneEvent): def __init__(self, avatarList, doneEvent):
StateData.StateData.__init__(self, doneEvent) StateData.StateData.__init__(self, doneEvent)
self.choice = None self.choice = None
self.avatarList = avatarList self.avatarList = avatarList
self.fsm = ClassicFSM.ClassicFSM('AvatarChooser', [State.State('Choose', self.enterChoose, self.exitChoose, ['CheckDownload']), State.State('CheckDownload', self.enterCheckDownload, self.exitCheckDownload, ['Choose'])], 'Choose', 'Choose')
self.fsm.enterInitialState()
self.parentFSM = parentFSM
self.parentFSM.getCurrentState().addChild(self.fsm)
return return
def enter(self): def enter(self):
@ -203,9 +196,6 @@ class AvatarChooser(StateData.StateData):
self.pickAToonBG.removeNode() self.pickAToonBG.removeNode()
del self.pickAToonBG del self.pickAToonBG
del self.avatarList del self.avatarList
self.parentFSM.getCurrentState().removeChild(self.fsm)
del self.parentFSM
del self.fsm
self.ignoreAll() self.ignoreAll()
self.isLoaded = 0 self.isLoaded = 0
ModelPool.garbageCollect() ModelPool.garbageCollect()
@ -220,51 +210,22 @@ class AvatarChooser(StateData.StateData):
if panelDoneStatus == 'chose': if panelDoneStatus == 'chose':
self.__handleChoice() self.__handleChoice()
elif panelDoneStatus == 'nameIt': elif panelDoneStatus == 'nameIt':
self.__handleCreate() self.__handleChoice()
elif panelDoneStatus == 'delete': elif panelDoneStatus == 'delete':
self.__handleDelete() self.__handleChoice()
elif panelDoneStatus == 'create': elif panelDoneStatus == 'create':
self.__handleCreate() self.__handleChoice()
def getChoice(self):
return self.choice
def __handleChoice(self): def __handleChoice(self):
self.fsm.request('CheckDownload')
def __handleCreate(self):
base.transitions.fadeOut(finishIval=EventInterval(self.doneEvent, [self.doneStatus])) base.transitions.fadeOut(finishIval=EventInterval(self.doneEvent, [self.doneStatus]))
def __handleDelete(self):
messenger.send(self.doneEvent, [self.doneStatus])
def __handleQuit(self): def __handleQuit(self):
cleanupDialog('globalDialog') cleanupDialog('globalDialog')
self.doneStatus = {'mode': 'exit'} self.doneStatus = {'mode': 'exit'}
messenger.send(self.doneEvent, [self.doneStatus]) messenger.send(self.doneEvent, [self.doneStatus])
def enterChoose(self): def getChoice(self):
pass return self.choice
def exitChoose(self):
pass
def enterCheckDownload(self):
self.accept('downloadAck-response', self.__handleDownloadAck)
self.downloadAck = DownloadForceAcknowledge.DownloadForceAcknowledge('downloadAck-response')
self.downloadAck.enter(4)
def exitCheckDownload(self):
self.downloadAck.exit()
self.downloadAck = None
self.ignore('downloadAck-response')
return
def __handleDownloadAck(self, doneStatus):
if doneStatus['mode'] == 'complete':
base.transitions.fadeOut(finishIval=EventInterval(self.doneEvent, [self.doneStatus]))
else:
self.fsm.request('Choose')
def openLanguageGui(self): def openLanguageGui(self):
self.exit() self.exit()

View file

@ -915,7 +915,6 @@ class NameShop(StateData.StateData):
self.notify.debug('avatar with default name accepted') self.notify.debug('avatar with default name accepted')
self.avId = avId self.avId = avId
self.avExists = 1 self.avExists = 1
self.logAvatarCreation()
if self.nameAction == 0: if self.nameAction == 0:
self.toon.setName(self.names[0]) self.toon.setName(self.names[0])
newPotAv = PotentialAvatar.PotentialAvatar(self.avId, self.names, self.newDNA, self.index, 1) newPotAv = PotentialAvatar.PotentialAvatar(self.avId, self.names, self.newDNA, self.index, 1)
@ -977,29 +976,3 @@ class NameShop(StateData.StateData):
self.notify.info('QA-REGRESSION: SKIPTUTORIAL: Skip Tutorial') self.notify.info('QA-REGRESSION: SKIPTUTORIAL: Skip Tutorial')
self.__handleSkipTutorial() self.__handleSkipTutorial()
self.promptTutorialDialog.destroy() self.promptTutorialDialog.destroy()
def logAvatarCreation(self):
dislId = 0
try:
dislId = launcher.getValue('GAME_DISL_ID')
except:
pass
if not dislId:
self.notify.warning('No dislId, using 0')
dislId = 0
gameSource = '0'
try:
gameSource = launcher.getValue('GAME_SOURCE')
except:
pass
if not gameSource:
gameSource = '0'
else:
self.notify.info('got GAME_SOURCE=%s' % gameSource)
if self.avId > 0:
base.cr.centralLogger.writeClientEvent('createAvatar %s-%s-%s' % (self.avId, dislId, gameSource))
self.notify.debug('createAvatar %s-%s-%s' % (self.avId, dislId, gameSource))
else:
self.notify.warning('logAvatarCreation got self.avId =%s' % self.avId)

View file

@ -35,13 +35,13 @@ class Party(Place.Place):
'quest', 'quest',
'fishing', 'fishing',
'stopped', 'stopped',
'DFA',
'push', 'push',
'activity']), 'activity',
'teleportOut']),
State.State('stopped', self.enterStopped, self.exitStopped, ['walk', 'teleportOut']), State.State('stopped', self.enterStopped, self.exitStopped, ['walk', 'teleportOut']),
State.State('sit', self.enterSit, self.exitSit, ['walk']), State.State('sit', self.enterSit, self.exitSit, ['walk']),
State.State('push', self.enterPush, self.exitPush, ['walk']), State.State('push', self.enterPush, self.exitPush, ['walk']),
State.State('partyPlanning', self.enterPartyPlanning, self.exitPartyPlanning, ['DFA', 'teleportOut']), State.State('partyPlanning', self.enterPartyPlanning, self.exitPartyPlanning, ['teleportOut']),
State.State('stickerBook', self.enterStickerBook, self.exitStickerBook, ['walk', State.State('stickerBook', self.enterStickerBook, self.exitStickerBook, ['walk',
'sit', 'sit',
'quest', 'quest',
@ -49,7 +49,7 @@ class Party(Place.Place):
'stopped', 'stopped',
'activity', 'activity',
'push', 'push',
'DFA']), 'teleportOut']),
State.State('teleportIn', self.enterTeleportIn, self.exitTeleportIn, ['walk', 'partyPlanning']), State.State('teleportIn', self.enterTeleportIn, self.exitTeleportIn, ['walk', 'partyPlanning']),
State.State('teleportOut', self.enterTeleportOut, self.exitTeleportOut, ['teleportIn', 'walk', 'final']), State.State('teleportOut', self.enterTeleportOut, self.exitTeleportOut, ['teleportIn', 'walk', 'final']),
State.State('died', self.enterDied, self.exitDied, ['walk', 'final']), State.State('died', self.enterDied, self.exitDied, ['walk', 'final']),
@ -57,9 +57,7 @@ class Party(Place.Place):
State.State('quest', self.enterQuest, self.exitQuest, ['walk']), State.State('quest', self.enterQuest, self.exitQuest, ['walk']),
State.State('fishing', self.enterFishing, self.exitFishing, ['walk', 'stopped']), State.State('fishing', self.enterFishing, self.exitFishing, ['walk', 'stopped']),
State.State('activity', self.enterActivity, self.exitActivity, ['walk', 'stopped']), State.State('activity', self.enterActivity, self.exitActivity, ['walk', 'stopped']),
State.State('stopped', self.enterStopped, self.exitStopped, ['walk']), State.State('stopped', self.enterStopped, self.exitStopped, ['walk'])], 'init', 'final')
State.State('DFA', self.enterDFA, self.exitDFA, ['DFAReject', 'teleportOut']),
State.State('DFAReject', self.enterDFAReject, self.exitDFAReject, ['walk'])], 'init', 'final')
self.fsm.enterInitialState() self.fsm.enterInitialState()
self.doneEvent = doneEvent self.doneEvent = doneEvent
self.parentFSMState = parentFSMState self.parentFSMState = parentFSMState
@ -132,9 +130,6 @@ class Party(Place.Place):
def __setZoneId(self, zoneId): def __setZoneId(self, zoneId):
self.zoneId = zoneId self.zoneId = zoneId
def doRequestLeave(self, requestStatus):
self.fsm.request('DFA', [requestStatus])
def enterInit(self): def enterInit(self):
pass pass

View file

@ -42,18 +42,6 @@ class GSPlayground(Playground.Playground):
Playground.Playground.exit(self) Playground.Playground.exit(self)
self.rotateBlimp.finish() self.rotateBlimp.finish()
def doRequestLeave(self, requestStatus):
self.fsm.request('DFA', [requestStatus])
def enterDFA(self, requestStatus):
doneEvent = 'dfaDoneEvent'
self.accept(doneEvent, self.enterDFACallback, [requestStatus])
self.dfa = DownloadForceAcknowledge.DownloadForceAcknowledge(doneEvent)
if requestStatus['hoodId'] == ToontownGlobals.MyEstate:
self.dfa.enter(base.cr.hoodMgr.getPhaseFromHood(ToontownGlobals.MyEstate))
else:
self.dfa.enter(5)
def enterTeleportIn(self, requestStatus): def enterTeleportIn(self, requestStatus):
reason = requestStatus.get('reason') reason = requestStatus.get('reason')
if reason == RaceGlobals.Exit_Barrier: if reason == RaceGlobals.Exit_Barrier:

View file

@ -3,7 +3,6 @@ from direct.fsm import ClassicFSM, State
from direct.fsm import State from direct.fsm import State
from pandac.PandaModules import * from pandac.PandaModules import *
from toontown.hood import ZoneUtil from toontown.hood import ZoneUtil
from toontown.launcher import DownloadForceAcknowledge
from toontown.safezone.SafeZoneLoader import SafeZoneLoader from toontown.safezone.SafeZoneLoader import SafeZoneLoader
from toontown.safezone.GSPlayground import GSPlayground from toontown.safezone.GSPlayground import GSPlayground
from toontown.effects.CarSmoke import CarSmoke from toontown.effects.CarSmoke import CarSmoke

View file

@ -1,7 +1,6 @@
from pandac.PandaModules import * from pandac.PandaModules import *
from toontown.toonbase import ToontownGlobals from toontown.toonbase import ToontownGlobals
import Playground import Playground
from toontown.launcher import DownloadForceAcknowledge
from toontown.building import Elevator from toontown.building import Elevator
from toontown.toontowngui import TTDialog from toontown.toontowngui import TTDialog
from toontown.toonbase import TTLocalizer from toontown.toonbase import TTLocalizer
@ -55,18 +54,6 @@ class GZPlayground(Playground.Playground):
if hasattr(self, 'rotateBlimp'): if hasattr(self, 'rotateBlimp'):
self.rotateBlimp.finish() self.rotateBlimp.finish()
def doRequestLeave(self, requestStatus):
self.fsm.request('DFA', [requestStatus])
def enterDFA(self, requestStatus):
doneEvent = 'dfaDoneEvent'
self.accept(doneEvent, self.enterDFACallback, [requestStatus])
self.dfa = DownloadForceAcknowledge.DownloadForceAcknowledge(doneEvent)
if requestStatus['hoodId'] == ToontownGlobals.MyEstate:
self.dfa.enter(base.cr.hoodMgr.getPhaseFromHood(ToontownGlobals.MyEstate))
else:
self.dfa.enter(5)
def enterTeleportIn(self, requestStatus): def enterTeleportIn(self, requestStatus):
reason = requestStatus.get('reason') reason = requestStatus.get('reason')
if reason == RaceGlobals.Exit_Barrier: if reason == RaceGlobals.Exit_Barrier:

View file

@ -4,7 +4,6 @@ from direct.fsm import ClassicFSM, State
from direct.fsm import State from direct.fsm import State
from pandac.PandaModules import * from pandac.PandaModules import *
from toontown.hood import ZoneUtil from toontown.hood import ZoneUtil
from toontown.launcher import DownloadForceAcknowledge
from toontown.safezone.SafeZoneLoader import SafeZoneLoader from toontown.safezone.SafeZoneLoader import SafeZoneLoader
from toontown.safezone.GZPlayground import GZPlayground from toontown.safezone.GZPlayground import GZPlayground
from toontown.toonbase import TTLocalizer from toontown.toonbase import TTLocalizer

View file

@ -1,7 +1,6 @@
from pandac.PandaModules import * from pandac.PandaModules import *
from toontown.toonbase import ToontownGlobals from toontown.toonbase import ToontownGlobals
import Playground import Playground
from toontown.launcher import DownloadForceAcknowledge
from toontown.building import Elevator from toontown.building import Elevator
from toontown.toontowngui import TTDialog from toontown.toontowngui import TTDialog
from toontown.toonbase import TTLocalizer from toontown.toonbase import TTLocalizer
@ -40,18 +39,6 @@ class OZPlayground(Playground.Playground):
taskMgr.remove('oz-check-cam-underwater') taskMgr.remove('oz-check-cam-underwater')
self.loader.hood.setNoFog() self.loader.hood.setNoFog()
def doRequestLeave(self, requestStatus):
self.fsm.request('DFA', [requestStatus])
def enterDFA(self, requestStatus):
doneEvent = 'dfaDoneEvent'
self.accept(doneEvent, self.enterDFACallback, [requestStatus])
self.dfa = DownloadForceAcknowledge.DownloadForceAcknowledge(doneEvent)
if requestStatus['hoodId'] == ToontownGlobals.MyEstate:
self.dfa.enter(base.cr.hoodMgr.getPhaseFromHood(ToontownGlobals.MyEstate))
else:
self.dfa.enter(5)
def enterStart(self): def enterStart(self):
self.cameraSubmerged = 0 self.cameraSubmerged = 0
self.toonSubmerged = 0 self.toonSubmerged = 0

View file

@ -10,7 +10,6 @@ from direct.fsm import State
from direct.task import Task from direct.task import Task
from toontown.toon import DeathForceAcknowledge from toontown.toon import DeathForceAcknowledge
from toontown.toon import HealthForceAcknowledge from toontown.toon import HealthForceAcknowledge
from toontown.tutorial import TutorialForceAcknowledge
from toontown.toon import NPCForceAcknowledge from toontown.toon import NPCForceAcknowledge
from toontown.trolley import Trolley from toontown.trolley import Trolley
from toontown.toontowngui import TTDialog from toontown.toontowngui import TTDialog
@ -28,7 +27,6 @@ class Playground(Place.Place):
def __init__(self, loader, parentFSM, doneEvent): def __init__(self, loader, parentFSM, doneEvent):
Place.Place.__init__(self, loader, doneEvent) Place.Place.__init__(self, loader, doneEvent)
self.tfaDoneEvent = 'tfaDoneEvent'
self.fsm = ClassicFSM.ClassicFSM('Playground', [ self.fsm = ClassicFSM.ClassicFSM('Playground', [
State.State('start', State.State('start',
self.enterStart, self.enterStart,
@ -43,8 +41,7 @@ class Playground(Place.Place):
'drive', 'drive',
'sit', 'sit',
'stickerBook', 'stickerBook',
'TFA', 'NPCFA',
'DFA',
'trolley', 'trolley',
'final', 'final',
'doorOut', 'doorOut',
@ -57,25 +54,20 @@ class Playground(Place.Place):
self.enterStickerBook, self.enterStickerBook,
self.exitStickerBook, [ self.exitStickerBook, [
'walk', 'walk',
'DFA',
'TFA',
'trolley', 'trolley',
'final', 'final',
'doorOut', 'doorOut',
'quest', 'quest',
'purchase', 'purchase',
'stopped', 'stopped',
'fishing']), 'fishing',
'NPCFA']),
State.State('sit', State.State('sit',
self.enterSit, self.enterSit,
self.exitSit, [ self.exitSit, ['walk']),
'walk',
'DFA']),
State.State('drive', State.State('drive',
self.enterDrive, self.enterDrive,
self.exitDrive, [ self.exitDrive, ['walk']),
'walk',
'DFA']),
State.State('trolley', State.State('trolley',
self.enterTrolley, self.enterTrolley,
self.exitTrolley, [ self.exitTrolley, [
@ -88,25 +80,6 @@ class Playground(Place.Place):
self.enterDoorOut, self.enterDoorOut,
self.exitDoorOut, [ self.exitDoorOut, [
'walk']), 'walk']),
State.State('TFA',
self.enterTFA,
self.exitTFA, [
'TFAReject',
'DFA']),
State.State('TFAReject',
self.enterTFAReject,
self.exitTFAReject, [
'walk']),
State.State('DFA',
self.enterDFA,
self.exitDFA, [
'DFAReject',
'NPCFA',
'HFA']),
State.State('DFAReject',
self.enterDFAReject,
self.exitDFAReject, [
'walk']),
State.State('NPCFA', State.State('NPCFA',
self.enterNPCFA, self.enterNPCFA,
self.exitNPCFA, [ self.exitNPCFA, [
@ -382,27 +355,8 @@ class Playground(Place.Place):
messenger.send(self.doneEvent) messenger.send(self.doneEvent)
return return
def enterTFACallback(self, requestStatus, doneStatus): def doRequestLeave(self, requestStatus):
self.tfa.exit()
del self.tfa
doneStatusMode = doneStatus['mode']
if doneStatusMode == 'complete':
self.requestLeave(requestStatus)
elif doneStatusMode == 'incomplete':
self.fsm.request('TFAReject')
else:
self.notify.error('Unknown mode: %s' % doneStatusMode)
def enterDFACallback(self, requestStatus, doneStatus):
self.dfa.exit()
del self.dfa
ds = doneStatus['mode']
if ds == 'complete':
self.fsm.request('NPCFA', [requestStatus]) self.fsm.request('NPCFA', [requestStatus])
elif ds == 'incomplete':
self.fsm.request('DFAReject')
else:
self.notify.error('Unknown done status for DownloadForceAcknowledge: ' + `doneStatus`)
def enterHFA(self, requestStatus): def enterHFA(self, requestStatus):
self.acceptOnce(self.hfaDoneEvent, self.enterHFACallback, [requestStatus]) self.acceptOnce(self.hfaDoneEvent, self.enterHFACallback, [requestStatus])
@ -647,17 +601,3 @@ class Playground(Place.Place):
npc = self.geom.findAllMatches('**/suit_building_origin') npc = self.geom.findAllMatches('**/suit_building_origin')
for i in xrange(npc.getNumPaths()): for i in xrange(npc.getNumPaths()):
npc.getPath(i).removeNode() npc.getPath(i).removeNode()
def enterTFA(self, requestStatus):
self.acceptOnce(self.tfaDoneEvent, self.enterTFACallback, [requestStatus])
self.tfa = TutorialForceAcknowledge.TutorialForceAcknowledge(self.tfaDoneEvent)
self.tfa.enter()
def exitTFA(self):
self.ignore(self.tfaDoneEvent)
def enterTFAReject(self):
self.fsm.request('walk')
def exitTFAReject(self):
pass

View file

@ -9,10 +9,8 @@ from direct.fsm import StateData
from direct.fsm import ClassicFSM, State from direct.fsm import ClassicFSM, State
from direct.fsm import State from direct.fsm import State
from direct.task import Task from direct.task import Task
from toontown.launcher import DownloadForceAcknowledge
from toontown.toon import HealthForceAcknowledge from toontown.toon import HealthForceAcknowledge
from toontown.toon.Toon import teleportDebug from toontown.toon.Toon import teleportDebug
from toontown.tutorial import TutorialForceAcknowledge
from toontown.toonbase.ToontownGlobals import * from toontown.toonbase.ToontownGlobals import *
from toontown.building import ToonInterior from toontown.building import ToonInterior
from toontown.hood import QuietZoneState from toontown.hood import QuietZoneState

View file

@ -190,13 +190,11 @@ class MapPage(ShtikerPage.ShtikerPage):
else: else:
self.hoodLabel.hide() self.hoodLabel.hide()
safeZonesVisited = base.localAvatar.hoodsVisited safeZonesVisited = base.localAvatar.hoodsVisited
hoodsAvailable = base.cr.hoodMgr.getAvailableZones()
hoodVisibleList = PythonUtil.intersection(safeZonesVisited, hoodsAvailable)
hoodTeleportList = base.localAvatar.getTeleportAccess() hoodTeleportList = base.localAvatar.getTeleportAccess()
for hood in self.allZones: for hood in self.allZones:
label = self.labels[self.allZones.index(hood)] label = self.labels[self.allZones.index(hood)]
clouds = self.clouds[self.allZones.index(hood)] clouds = self.clouds[self.allZones.index(hood)]
if not self.book.safeMode and hood in hoodVisibleList: if not self.book.safeMode and hood in safeZonesVisited:
label['text_fg'] = (0, 0, 0, 1) label['text_fg'] = (0, 0, 0, 1)
label.show() label.show()
for cloud in clouds: for cloud in clouds:
@ -229,7 +227,7 @@ class MapPage(ShtikerPage.ShtikerPage):
messenger.send(self.doneEvent) messenger.send(self.doneEvent)
def __buttonCallback(self, hood): def __buttonCallback(self, hood):
if hood in base.localAvatar.getTeleportAccess() and hood in base.cr.hoodMgr.getAvailableZones(): if hood in base.localAvatar.getTeleportAccess():
base.localAvatar.sendUpdate('checkTeleportAccess', [hood]) base.localAvatar.sendUpdate('checkTeleportAccess', [hood])
self.doneStatus = {'mode': 'teleport', self.doneStatus = {'mode': 'teleport',
'hood': hood} 'hood': hood}

View file

@ -41,10 +41,7 @@ class TrackFrame(DirectFrame):
self.ignore('nametagAmbientLightChanged') self.ignore('nametagAmbientLightChanged')
def play(self, trackId): def play(self, trackId):
if not base.launcher or base.launcher and base.launcher.getPhaseComplete(5):
anim = Track2Anim[trackId] anim = Track2Anim[trackId]
else:
anim = 'neutral'
if self.toon: if self.toon:
numFrames = self.toon.getNumFrames(anim) - 1 numFrames = self.toon.getNumFrames(anim) - 1
fromFrame = 0 fromFrame = 0
@ -55,12 +52,8 @@ class TrackFrame(DirectFrame):
def setTrained(self, trackId): def setTrained(self, trackId):
if self.toon == None: if self.toon == None:
self.makeToon() self.makeToon()
if not base.launcher or base.launcher and base.launcher.getPhaseComplete(5):
anim = Track2Anim[trackId] anim = Track2Anim[trackId]
frame = (self.toon.getNumFrames(anim) - 1) / MAX_FRAMES * self.index frame = (self.toon.getNumFrames(anim) - 1) / MAX_FRAMES * self.index
else:
anim = 'neutral'
frame = 0
self.toon.pose(anim, frame) self.toon.pose(anim, frame)
self.toon.show() self.toon.show()
self.question.hide() self.question.hide()

View file

@ -1395,8 +1395,6 @@ class DistributedToon(DistributedPlayer.DistributedPlayer, Toon.Toon, Distribute
def presentPie(self, x, y, z, h, timestamp32): def presentPie(self, x, y, z, h, timestamp32):
if self.numPies <= 0: if self.numPies <= 0:
return return
if not launcher.getPhaseComplete(5):
return
lastTossTrack = Sequence() lastTossTrack = Sequence()
if self.tossTrack: if self.tossTrack:
lastTossTrack = self.tossTrack lastTossTrack = self.tossTrack
@ -1422,8 +1420,6 @@ class DistributedToon(DistributedPlayer.DistributedPlayer, Toon.Toon, Distribute
if self.numPies != ToontownGlobals.FullPies: if self.numPies != ToontownGlobals.FullPies:
self.setNumPies(self.numPies - 1) self.setNumPies(self.numPies - 1)
self.lastTossedPie = globalClock.getFrameTime() self.lastTossedPie = globalClock.getFrameTime()
if not launcher.getPhaseComplete(5):
return
lastTossTrack = Sequence() lastTossTrack = Sequence()
if self.tossTrack: if self.tossTrack:
lastTossTrack = self.tossTrack lastTossTrack = self.tossTrack
@ -1466,8 +1462,6 @@ class DistributedToon(DistributedPlayer.DistributedPlayer, Toon.Toon, Distribute
elapsed = globalClock.getFrameTime() - self.lastTossedPie elapsed = globalClock.getFrameTime() - self.lastTossedPie
if elapsed > 30: if elapsed > 30:
return return
if not launcher.getPhaseComplete(5):
return
lastPieTrack = Sequence() lastPieTrack = Sequence()
if sequence in self.pieTracks: if sequence in self.pieTracks:
lastPieTrack = self.pieTracks[sequence] lastPieTrack = self.pieTracks[sequence]

View file

@ -105,7 +105,6 @@ class LocalToon(DistributedToon.DistributedToon, LocalAvatar.LocalAvatar):
self.furnitureDirector = None self.furnitureDirector = None
self.gotCatalogNotify = 0 self.gotCatalogNotify = 0
self.__catalogNotifyDialog = None self.__catalogNotifyDialog = None
self.accept('phaseComplete-5.5', self.loadPhase55Stuff)
Toon.loadDialog() Toon.loadDialog()
self.isIt = 0 self.isIt = 0
self.cantLeaveGame = 0 self.cantLeaveGame = 0
@ -412,9 +411,6 @@ class LocalToon(DistributedToon.DistributedToon, LocalAvatar.LocalAvatar):
if self.hasKart(): if self.hasKart():
if hasattr(self, 'kartPage') and self.kartPage != None: if hasattr(self, 'kartPage') and self.kartPage != None:
return return
if not launcher.getPhaseComplete(6):
self.acceptOnce('phaseComplete-6', self.addKartPage)
return
self.kartPage = KartPage.KartPage() self.kartPage = KartPage.KartPage()
self.kartPage.setAvatar(self) self.kartPage.setAvatar(self)
self.kartPage.load() self.kartPage.load()
@ -427,9 +423,6 @@ class LocalToon(DistributedToon.DistributedToon, LocalAvatar.LocalAvatar):
def loadDisguisePages(self): def loadDisguisePages(self):
if self.disguisePage != None: if self.disguisePage != None:
return return
if not launcher.getPhaseComplete(9):
self.acceptOnce('phaseComplete-9', self.loadDisguisePages)
return
self.disguisePage = DisguisePage.DisguisePage() self.disguisePage = DisguisePage.DisguisePage()
self.disguisePage.load() self.disguisePage.load()
self.book.addPage(self.disguisePage, pageName=TTLocalizer.DisguisePageTitle) self.book.addPage(self.disguisePage, pageName=TTLocalizer.DisguisePageTitle)
@ -447,24 +440,11 @@ class LocalToon(DistributedToon.DistributedToon, LocalAvatar.LocalAvatar):
def loadGardenPages(self): def loadGardenPages(self):
if self.gardenPage != None: if self.gardenPage != None:
return return
if not launcher.getPhaseComplete(5.5):
self.acceptOnce('phaseComplete-5.5', self.loadPhase55Stuff)
return
self.gardenPage = GardenPage.GardenPage() self.gardenPage = GardenPage.GardenPage()
self.gardenPage.load() self.gardenPage.load()
self.book.addPage(self.gardenPage, pageName=TTLocalizer.GardenPageTitle) self.book.addPage(self.gardenPage, pageName=TTLocalizer.GardenPageTitle)
return return
def loadPhase55Stuff(self):
if self.gardenPage == None:
self.gardenPage = GardenPage.GardenPage()
self.gardenPage.load()
self.book.addPage(self.gardenPage, pageName=TTLocalizer.GardenPageTitle)
elif not launcher.getPhaseComplete(5.5):
self.acceptOnce('phaseComplete-5.5', self.loadPhase55Stuff)
self.refreshOnscreenButtons()
return
def setAsGM(self, state): def setAsGM(self, state):
self.notify.debug('Setting GM State: %s in LocalToon' % state) self.notify.debug('Setting GM State: %s in LocalToon' % state)
DistributedToon.DistributedToon.setAsGM(self, state) DistributedToon.DistributedToon.setAsGM(self, state)
@ -833,8 +813,6 @@ class LocalToon(DistributedToon.DistributedToon, LocalAvatar.LocalAvatar):
wantButton = 0 wantButton = 0
if self.allowPies and self.numPies > 0: if self.allowPies and self.numPies > 0:
wantButton = 1 wantButton = 1
if not launcher.getPhaseComplete(5):
wantButton = 0
haveButton = self.__pieButton != None haveButton = self.__pieButton != None
if not haveButton and not wantButton: if not haveButton and not wantButton:
return return
@ -1115,7 +1093,7 @@ class LocalToon(DistributedToon.DistributedToon, LocalAvatar.LocalAvatar):
self.accept(ToontownGlobals.FriendsListHotkey, self.sendFriendsListEvent) self.accept(ToontownGlobals.FriendsListHotkey, self.sendFriendsListEvent)
if self.clarabelleButtonObscured <= 0 and self.isTeleportAllowed(): if self.clarabelleButtonObscured <= 0 and self.isTeleportAllowed():
if self.catalogNotify == ToontownGlobals.NewItems or self.mailboxNotify == ToontownGlobals.NewItems or self.simpleMailNotify == ToontownGlobals.NewItems or self.inviteMailNotify == ToontownGlobals.NewItems or self.awardNotify == ToontownGlobals.NewItems: if self.catalogNotify == ToontownGlobals.NewItems or self.mailboxNotify == ToontownGlobals.NewItems or self.simpleMailNotify == ToontownGlobals.NewItems or self.inviteMailNotify == ToontownGlobals.NewItems or self.awardNotify == ToontownGlobals.NewItems:
showClarabelle = not launcher or launcher.getPhaseComplete(5.5) showClarabelle = 1
for quest in self.quests: for quest in self.quests:
if quest[0] in Quests.PreClarabelleQuestIds and self.mailboxNotify != ToontownGlobals.NewItems and self.awardNotify != ToontownGlobals.NewItems: if quest[0] in Quests.PreClarabelleQuestIds and self.mailboxNotify != ToontownGlobals.NewItems and self.awardNotify != ToontownGlobals.NewItems:
showClarabelle = 0 showClarabelle = 0
@ -1158,9 +1136,6 @@ class LocalToon(DistributedToon.DistributedToon, LocalAvatar.LocalAvatar):
def newCatalogNotify(self): def newCatalogNotify(self):
if not self.gotCatalogNotify: if not self.gotCatalogNotify:
return return
hasPhase = not launcher or launcher.getPhaseComplete(5.5)
if not hasPhase:
return
if not self.friendsListButtonActive or self.friendsListButtonObscured > 0: if not self.friendsListButtonActive or self.friendsListButtonObscured > 0:
return return
self.gotCatalogNotify = 0 self.gotCatalogNotify = 0
@ -1748,9 +1723,6 @@ class LocalToon(DistributedToon.DistributedToon, LocalAvatar.LocalAvatar):
if self.hasPlayedGolf(): if self.hasPlayedGolf():
if hasattr(self, 'golfPage') and self.golfPage != None: if hasattr(self, 'golfPage') and self.golfPage != None:
return return
if not launcher.getPhaseComplete(6):
self.acceptOnce('phaseComplete-6', self.addGolfPage)
return
self.golfPage = GolfPage.GolfPage() self.golfPage = GolfPage.GolfPage()
self.golfPage.setAvatar(self) self.golfPage.setAvatar(self)
self.golfPage.load() self.golfPage.load()
@ -1760,9 +1732,6 @@ class LocalToon(DistributedToon.DistributedToon, LocalAvatar.LocalAvatar):
def addEventsPage(self): def addEventsPage(self):
if hasattr(self, 'eventsPage') and self.eventsPage != None: if hasattr(self, 'eventsPage') and self.eventsPage != None:
return return
if not launcher.getPhaseComplete(4):
self.acceptOnce('phaseComplete-4', self.addEventsPage)
return
self.eventsPage = EventsPage.EventsPage() self.eventsPage = EventsPage.EventsPage()
self.eventsPage.load() self.eventsPage.load()
self.book.addPage(self.eventsPage, pageName=TTLocalizer.EventsPageName) self.book.addPage(self.eventsPage, pageName=TTLocalizer.EventsPageName)

View file

@ -2677,8 +2677,6 @@ class Toon(Avatar.Avatar, ToonHead):
def putOnSuit(self, suitType, setDisplayName = True, rental = False): def putOnSuit(self, suitType, setDisplayName = True, rental = False):
if self.isDisguised: if self.isDisguised:
self.takeOffSuit() self.takeOffSuit()
if launcher and not launcher.getPhaseComplete(5):
return
from toontown.suit import Suit from toontown.suit import Suit
deptIndex = suitType deptIndex = suitType
suit = Suit.Suit() suit = Suit.Suit()

View file

@ -430,7 +430,6 @@ class ToonHead(Actor.Actor):
return headHeight return headHeight
def loadPumpkin(self, headStyle, lod, copy): def loadPumpkin(self, headStyle, lod, copy):
if hasattr(base, 'launcher') and (not base.launcher or base.launcher and base.launcher.getPhaseComplete(4)):
if not hasattr(self, 'pumpkins'): if not hasattr(self, 'pumpkins'):
self.pumpkins = NodePathCollection() self.pumpkins = NodePathCollection()
ppath = 'phase_4/models/estate/pumpkin_' ppath = 'phase_4/models/estate/pumpkin_'
@ -461,11 +460,8 @@ class ToonHead(Actor.Actor):
else: else:
del self.pumpkins del self.pumpkins
return False return False
else:
ToonHead.notify.debug('phase_4 not complete yet. Postponing pumpkin head load.')
def loadSnowMan(self, headStyle, lod, copy): def loadSnowMan(self, headStyle, lod, copy):
if hasattr(base, 'launcher') and (not base.launcher or base.launcher and base.launcher.getPhaseComplete(4)):
if not hasattr(self, 'snowMen'): if not hasattr(self, 'snowMen'):
self.snowMen = NodePathCollection() self.snowMen = NodePathCollection()
snowManPath = 'phase_4/models/props/tt_m_efx_snowmanHead_' snowManPath = 'phase_4/models/props/tt_m_efx_snowmanHead_'
@ -487,8 +483,6 @@ class ToonHead(Actor.Actor):
else: else:
del self.snowMen del self.snowMen
return False return False
else:
ToonHead.notify.debug('phase_4 not loaded yet.')
def __fixPumpkin(self, style, lodName = None, copy = 1): def __fixPumpkin(self, style, lodName = None, copy = 1):
if lodName == None: if lodName == None:

View file

@ -123,19 +123,11 @@ import time
import sys import sys
import random import random
import __builtin__ import __builtin__
try: from toontown.launcher.TTULauncher import TTULauncher
launcher
except:
from toontown.launcher.TTULauncher import TTULauncher
launcher = TTULauncher()
__builtin__.launcher = launcher
__builtin__.launcher = TTULauncher()
notify.info('Starting the game...') notify.info('Starting the game...')
if launcher.isDummy():
http = HTTPClient()
else:
http = launcher.http
tempLoader = Loader() tempLoader = Loader()
backgroundNode = tempLoader.loadSync(Filename('phase_3/models/gui/loading-background')) backgroundNode = tempLoader.loadSync(Filename('phase_3/models/gui/loading-background'))
from direct.gui import DirectGuiGlobals from direct.gui import DirectGuiGlobals
@ -143,14 +135,11 @@ from direct.gui.DirectGui import *
notify.info('Setting the default font...') notify.info('Setting the default font...')
import ToontownGlobals import ToontownGlobals
DirectGuiGlobals.setDefaultFontFunc(ToontownGlobals.getInterfaceFont) DirectGuiGlobals.setDefaultFontFunc(ToontownGlobals.getInterfaceFont)
launcher.setPandaErrorCode(7)
import ToonBase import ToonBase
ToonBase.ToonBase() ToonBase.ToonBase()
from pandac.PandaModules import * from pandac.PandaModules import *
if base.win is None: if base.win is None:
notify.error('Unable to open window; aborting.') notify.error('Unable to open window; aborting.')
launcher.setPandaErrorCode(0)
launcher.setPandaWindowOpen()
ConfigVariableDouble('decompressor-step-time').setValue(0.01) ConfigVariableDouble('decompressor-step-time').setValue(0.01)
ConfigVariableDouble('extractor-step-time').setValue(0.01) ConfigVariableDouble('extractor-step-time').setValue(0.01)
backgroundNodePath = aspect2d.attachNewNode(backgroundNode, 0) backgroundNodePath = aspect2d.attachNewNode(backgroundNode, 0)
@ -195,7 +184,7 @@ loader.beginBulkLoad('init', TTLocalizer.LoaderLabel, 138, 0, TTLocalizer.TIP_NO
from ToonBaseGlobal import * from ToonBaseGlobal import *
from direct.showbase.MessengerGlobal import * from direct.showbase.MessengerGlobal import *
from toontown.distributed import ToontownClientRepository from toontown.distributed import ToontownClientRepository
cr = ToontownClientRepository.ToontownClientRepository(serverVersion, launcher) cr = ToontownClientRepository.ToontownClientRepository(serverVersion)
cr.music = music cr.music = music
del music del music
base.initNametagGlobals() base.initNametagGlobals()
@ -204,10 +193,7 @@ loader.endBulkLoad('init')
from otp.friends import FriendManager from otp.friends import FriendManager
from otp.distributed.OtpDoGlobals import * from otp.distributed.OtpDoGlobals import *
cr.generateGlobalObject(OTP_DO_ID_FRIEND_MANAGER, 'FriendManager') cr.generateGlobalObject(OTP_DO_ID_FRIEND_MANAGER, 'FriendManager')
if not launcher.isDummy(): base.startShow(cr)
base.startShow(cr, launcher.getGameServer())
else:
base.startShow(cr)
backgroundNodePath.reparentTo(hidden) backgroundNodePath.reparentTo(hidden)
backgroundNodePath.removeNode() backgroundNodePath.removeNode()
del backgroundNodePath del backgroundNodePath

View file

@ -3328,53 +3328,8 @@ FriendInviterEndFriendshipToon = 'Are you sure you want to stop being toon frien
FriendInviterEndFriendshipPlayer = 'Are you sure you want to stop being player friends with %s?' FriendInviterEndFriendshipPlayer = 'Are you sure you want to stop being player friends with %s?'
FriendInviterRemainToon = '\n(You will still be toon friends with %s)' FriendInviterRemainToon = '\n(You will still be toon friends with %s)'
FriendInviterRemainPlayer = '\n(You will still be player friends with %s)' FriendInviterRemainPlayer = '\n(You will still be player friends with %s)'
DownloadForceAcknowledgeVerbList = ['painted',
'unpacked',
'unfolded',
'drawn',
'inflated',
'built']
DownloadForceAcknowledgeMsg = 'Sorry, the %(phase)s area is still being %(verb)s, and will be ready for you in a minute.'
LauncherPhaseNames = {0: 'Initialization',
1: 'Panda',
2: 'Engine',
3: 'Make-A-Toon',
3.5: 'Toontorial',
4: 'Playground',
5: 'Streets',
5.5: 'Estates',
6: 'Neighborhoods I',
7: Cog + ' Buildings',
8: 'Neighborhoods II',
9: Sellbot + ' HQ',
10: Cashbot + ' HQ',
11: Lawbot + ' HQ',
12: Bossbot + ' HQ',
13: 'Parties'}
LauncherProgress = '%(name)s (%(current)s of %(total)s)'
LauncherStartingMessage = "Starting Toontown United... "
LauncherDownloadFile = 'Downloading update for ' + LauncherProgress + '...'
LauncherDownloadFileBytes = 'Downloading update for ' + LauncherProgress + ': %(bytes)s'
LauncherDownloadFilePercent = 'Downloading update for ' + LauncherProgress + ': %(percent)s%%'
LauncherDecompressingFile = 'Decompressing update for ' + LauncherProgress + '...'
LauncherDecompressingPercent = 'Decompressing update for ' + LauncherProgress + ': %(percent)s%%'
LauncherExtractingFile = 'Extracting update for ' + LauncherProgress + '...'
LauncherExtractingPercent = 'Extracting update for ' + LauncherProgress + ': %(percent)s%%'
LauncherPatchingFile = 'Applying update for ' + LauncherProgress + '...'
LauncherPatchingPercent = 'Applying update for ' + LauncherProgress + ': %(percent)s%%'
LauncherConnectProxyAttempt = 'Connecting to Toontown United: %s (proxy: %s) attempt: %s'
LauncherConnectAttempt = 'Connecting to Toontown United: %s attempt %s'
LauncherDownloadServerFileList = 'Updating Toontown United...'
LauncherCreatingDownloadDb = 'Updating Toontown United...'
LauncherDownloadClientFileList = 'Updating Toontown United...'
LauncherFinishedDownloadDb = 'Updating Toontown United... '
LauncherStartingGame = 'Starting Toontown United...'
LauncherRecoverFiles = 'Updating Toontown United. Recovering files...'
LauncherCheckUpdates = 'Checking for updates for ' + LauncherProgress
LauncherVerifyPhase = 'Updating Toontown United...'
AvatarChoiceMakeAToon = 'Make A\nToon' AvatarChoiceMakeAToon = 'Make A\nToon'
AvatarChoicePlayThisToon = 'Play\nThis Toon' AvatarChoicePlayThisToon = 'Play\nThis Toon'
AvatarChoiceSubscribersOnly = 'Subscribe'
AvatarChoiceDelete = 'Delete' AvatarChoiceDelete = 'Delete'
AvatarChoiceDeleteConfirm = 'This will delete %s forever.' AvatarChoiceDeleteConfirm = 'This will delete %s forever.'
AvatarChoiceNameRejected = 'Name\nRejected' AvatarChoiceNameRejected = 'Name\nRejected'
@ -4372,7 +4327,6 @@ FishPokerPair = 'Pair'
TutorialGreeting1 = 'Hi %s!' TutorialGreeting1 = 'Hi %s!'
TutorialGreeting2 = 'Hi %s!\nCome over here!' TutorialGreeting2 = 'Hi %s!\nCome over here!'
TutorialGreeting3 = 'Hi %s!\nCome over here!\nUse the arrow keys!' TutorialGreeting3 = 'Hi %s!\nCome over here!\nUse the arrow keys!'
TutorialForceAcknowledgeMessage = 'You are going the wrong way! Go find Flippy!'
PetTutorialTitle1 = 'The Doodle Panel' PetTutorialTitle1 = 'The Doodle Panel'
PetTutorialTitle2 = 'Doodle SpeedChat' PetTutorialTitle2 = 'Doodle SpeedChat'
PetTutorialTitle3 = 'Doodle Cattlelog' PetTutorialTitle3 = 'Doodle Cattlelog'
@ -4407,7 +4361,7 @@ ForcedLeaveMintAckMsg = 'The Mint Floor Supervisor was defeated before you could
HeadingToFactoryTitle = '%s' HeadingToFactoryTitle = '%s'
ForemanConfrontedMsg = '%s is battling the ' + Foreman + '!' ForemanConfrontedMsg = '%s is battling the ' + Foreman + '!'
MintBossConfrontedMsg = '%s is battling the Supervisor!' MintBossConfrontedMsg = '%s is battling the Supervisor!'
StageBossConfrontedMsg = '%s is battling the Clerk!' StageBossConfrontedMsg = '%s is battling the District Attorney!'
stageToonEnterElevator = '%s \nhas entered the elevator' stageToonEnterElevator = '%s \nhas entered the elevator'
ForcedLeaveStageAckMsg = 'The Law Clerk was defeated before you could reach him. You did not recover any Jury Notices.' ForcedLeaveStageAckMsg = 'The Law Clerk was defeated before you could reach him. You did not recover any Jury Notices.'
MinigameWaitingForOtherPlayers = 'Waiting for other players to join...' MinigameWaitingForOtherPlayers = 'Waiting for other players to join...'

View file

@ -75,7 +75,6 @@ EHpopupInfo = 0.08
HtitleText = 0.16 HtitleText = 0.16
ACplayThisToon = 0.12 ACplayThisToon = 0.12
ACmakeAToon = 0.12 ACmakeAToon = 0.12
ACsubscribersOnly = 0.115
ACdeleteWithPasswordFrame = 0.06 ACdeleteWithPasswordFrame = 0.06
ACstatusText = 1.0 ACstatusText = 1.0
ACtitle = 0.15 ACtitle = 0.15

View file

@ -138,8 +138,6 @@ class ToonBase(OTPBase.OTPBase):
self.transitions.IrisModelName = 'phase_3/models/misc/iris' self.transitions.IrisModelName = 'phase_3/models/misc/iris'
self.transitions.FadeModelName = 'phase_3/models/misc/fade' self.transitions.FadeModelName = 'phase_3/models/misc/fade'
self.exitFunc = self.userExit self.exitFunc = self.userExit
if 'launcher' in __builtins__ and launcher:
launcher.setPandaErrorCode(11)
globalClock.setMaxDt(0.2) globalClock.setMaxDt(0.2)
if self.config.GetBool('want-particles', 1) == 1: if self.config.GetBool('want-particles', 1) == 1:
self.notify.debug('Enabling particles') self.notify.debug('Enabling particles')
@ -381,10 +379,9 @@ class ToonBase(OTPBase.OTPBase):
cell.setActive(active) cell.setActive(active)
self.marginManager.reorganize() self.marginManager.reorganize()
def startShow(self, cr, launcherServer = None): def startShow(self, cr):
self.cr = cr self.cr = cr
base.graphicsEngine.renderFrame() base.graphicsEngine.renderFrame()
gameServer = launcher.getGameServer()
# Get the base port. # Get the base port.
serverPort = base.config.GetInt('server-port', 7199) serverPort = base.config.GetInt('server-port', 7199)
@ -395,7 +392,7 @@ class ToonBase(OTPBase.OTPBase):
serverPort += (random.randint(0, clientagents) * 100) serverPort += (random.randint(0, clientagents) * 100)
serverList = [] serverList = []
for name in gameServer.split(';'): for name in launcher.getGameServer().split(';'):
url = URLSpec(name, 1) url = URLSpec(name, 1)
if base.config.GetBool('server-force-ssl', False): if base.config.GetBool('server-force-ssl', False):
url.setScheme('s') url.setScheme('s')
@ -445,10 +442,6 @@ class ToonBase(OTPBase.OTPBase):
def exitShow(self, errorCode = None): def exitShow(self, errorCode = None):
self.notify.info('Exiting Toontown: errorCode = %s' % errorCode) self.notify.info('Exiting Toontown: errorCode = %s' % errorCode)
if errorCode:
launcher.setPandaErrorCode(errorCode)
else:
launcher.setPandaErrorCode(0)
sys.exit() sys.exit()
def setExitErrorCode(self, code): def setExitErrorCode(self, code):
@ -485,7 +478,6 @@ class ToonBase(OTPBase.OTPBase):
self.exitShow() self.exitShow()
def panda3dRenderError(self): def panda3dRenderError(self):
launcher.setPandaErrorCode(14)
if self.cr.timeManager: if self.cr.timeManager:
self.cr.timeManager.setDisconnectReason(ToontownGlobals.DisconnectGraphicsError) self.cr.timeManager.setDisconnectReason(ToontownGlobals.DisconnectGraphicsError)
self.cr.sendDisconnect() self.cr.sendDisconnect()

View file

@ -39,7 +39,6 @@ class Street(BattlePlace.BattlePlace):
'stickerBook', 'stickerBook',
'WaitForBattle', 'WaitForBattle',
'battle', 'battle',
'DFA',
'doorOut', 'doorOut',
'elevator', 'elevator',
'tunnelIn', 'tunnelIn',
@ -56,7 +55,6 @@ class Street(BattlePlace.BattlePlace):
'push', 'push',
'sit', 'sit',
'battle', 'battle',
'DFA',
'doorOut', 'doorOut',
'elevator', 'elevator',
'tunnelIn', 'tunnelIn',
@ -73,8 +71,6 @@ class Street(BattlePlace.BattlePlace):
State.State('doorOut', self.enterDoorOut, self.exitDoorOut, ['walk']), State.State('doorOut', self.enterDoorOut, self.exitDoorOut, ['walk']),
State.State('elevatorIn', self.enterElevatorIn, self.exitElevatorIn, ['walk']), State.State('elevatorIn', self.enterElevatorIn, self.exitElevatorIn, ['walk']),
State.State('elevator', self.enterElevator, self.exitElevator, ['walk']), State.State('elevator', self.enterElevator, self.exitElevator, ['walk']),
State.State('DFA', self.enterDFA, self.exitDFA, ['DFAReject', 'teleportOut', 'tunnelOut']),
State.State('DFAReject', self.enterDFAReject, self.exitDFAReject, ['walk']),
State.State('teleportIn', self.enterTeleportIn, self.exitTeleportIn, ['walk', State.State('teleportIn', self.enterTeleportIn, self.exitTeleportIn, ['walk',
'teleportOut', 'teleportOut',
'quietZone', 'quietZone',

View file

@ -1,25 +0,0 @@
from pandac.PandaModules import *
from toontown.toontowngui import TTDialog
from toontown.toonbase import TTLocalizer
class TutorialForceAcknowledge:
def __init__(self, doneEvent):
self.doneEvent = doneEvent
self.dialog = None
return
def enter(self):
base.localAvatar.loop('neutral')
self.doneStatus = {'mode': 'incomplete'}
msg = TTLocalizer.TutorialForceAcknowledgeMessage
self.dialog = TTDialog.TTDialog(text=msg, command=self.handleOk, style=TTDialog.Acknowledge)
def exit(self):
if self.dialog:
self.dialog.cleanup()
self.dialog = None
return
def handleOk(self, value):
messenger.send(self.doneEvent, [self.doneStatus])