mirror of
https://github.com/Sneed-Group/Poodletooth-iLand
synced 2024-12-24 04:02:40 -06:00
TutorialForceAcknowledge, DownloadForceAcknowledge and the huge launcher is exterminated.
This commit is contained in:
parent
977da9210f
commit
d36f957694
53 changed files with 147 additions and 2734 deletions
|
@ -31,7 +31,6 @@ from otp.distributed import DCClassImports
|
|||
from otp.distributed import OtpDoGlobals
|
||||
from otp.distributed.OtpDoGlobals import *
|
||||
from otp.distributed.TelemetryLimiter import TelemetryLimiter
|
||||
from otp.login import HTTPUtil
|
||||
from otp.otpbase import OTPGlobals
|
||||
from otp.otpbase import OTPLocalizer
|
||||
from otp.otpgui import OTPDialog
|
||||
|
@ -46,29 +45,15 @@ class OTPClientRepository(ClientRepositoryBase):
|
|||
'Approved',
|
||||
'Rejected'])
|
||||
|
||||
def __init__(self, serverVersion, launcher = None, playGame = None):
|
||||
def __init__(self, serverVersion, playGame = None):
|
||||
ClientRepositoryBase.__init__(self)
|
||||
self.handler = None
|
||||
self.launcher = launcher
|
||||
base.launcher = launcher
|
||||
self.__currentAvId = 0
|
||||
self.createAvatarClass = None
|
||||
self.systemMessageSfx = None
|
||||
|
||||
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.playToken = launcher.getPlayToken()
|
||||
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.parentMgr.registerParent(OTPGlobals.SPRender, base.render)
|
||||
self.parentMgr.registerParent(OTPGlobals.SPHidden, NodePath())
|
||||
|
@ -411,7 +396,7 @@ class OTPClientRepository(ClientRepositoryBase):
|
|||
|
||||
@report(types=['args', 'deltaStamp'], dConfigParam='teleport')
|
||||
def _handleConnected(self):
|
||||
self.launcher.setDisconnectDetailsNormal()
|
||||
launcher.setDisconnectDetailsNormal()
|
||||
messenger.send(self.getConnectedEvent())
|
||||
self.gotoFirstScreen()
|
||||
|
||||
|
@ -432,7 +417,6 @@ class OTPClientRepository(ClientRepositoryBase):
|
|||
def __handleLoginDone(self, doneStatus):
|
||||
mode = doneStatus['mode']
|
||||
if mode == 'success':
|
||||
self.setIsNotNewInstallation()
|
||||
if hasattr(self, 'toontownTimeManager'):
|
||||
timestamp = time.gmtime(doneStatus['timestamp'])
|
||||
dateString = time.strftime(self.toontownTimeManager.formatStr, timestamp)
|
||||
|
@ -496,21 +480,8 @@ class OTPClientRepository(ClientRepositoryBase):
|
|||
def enterFailedToGetServerConstants(self, e):
|
||||
self.handler = self.handleMessageType
|
||||
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()
|
||||
style = OTPDialog.TwoChoice
|
||||
message = OTPLocalizer.CRServerConstantsTryAgain % url.cStr()
|
||||
style = OTPDialog.TwoChoice
|
||||
dialogClass = OTPGlobals.getGlobalDialogClass()
|
||||
self.failedToGetConstantsBox = dialogClass(message=message, doneEvent='failedToGetConstantsAck', text_wordwrap=18, style=style)
|
||||
self.failedToGetConstantsBox.show()
|
||||
|
@ -689,7 +660,6 @@ class OTPClientRepository(ClientRepositoryBase):
|
|||
def enterReject(self):
|
||||
self.handler = self.handleMessageType
|
||||
self.notify.warning('Connection Rejected')
|
||||
launcher.setPandaErrorCode(13)
|
||||
sys.exit()
|
||||
|
||||
@report(types=['args', 'deltaStamp'], dConfigParam='teleport')
|
||||
|
@ -719,7 +689,7 @@ class OTPClientRepository(ClientRepositoryBase):
|
|||
reconnect = 0
|
||||
if self.bootedIndex == 152:
|
||||
message = message % {'name': self.bootedText}
|
||||
self.launcher.setDisconnectDetails(self.bootedIndex, message)
|
||||
launcher.setDisconnectDetails(self.bootedIndex, message)
|
||||
style = OTPDialog.Acknowledge
|
||||
if reconnect:
|
||||
message += OTPLocalizer.CRTryConnectAgain
|
||||
|
@ -929,12 +899,6 @@ class OTPClientRepository(ClientRepositoryBase):
|
|||
'ivalLoop',
|
||||
'downloadSequence',
|
||||
'patchAndHash',
|
||||
'launcher-download',
|
||||
'launcher-download-multifile',
|
||||
'launcher-decompressFile',
|
||||
'launcher-decompressMultifile',
|
||||
'launcher-extract',
|
||||
'launcher-patch',
|
||||
'slowCloseShardCallback',
|
||||
'tkLoop',
|
||||
'manager-update',
|
||||
|
@ -980,15 +944,12 @@ class OTPClientRepository(ClientRepositoryBase):
|
|||
'meta-h',
|
||||
'meta-h-repeat',
|
||||
'control-f9',
|
||||
'launcherAllPhasesComplete',
|
||||
'launcherPercentPhaseComplete',
|
||||
'newDistributedDirectory',
|
||||
'page_down',
|
||||
'page_up',
|
||||
'panda3d-render-error',
|
||||
'PandaPaused',
|
||||
'PandaRestarted',
|
||||
'phaseComplete-3',
|
||||
'press-mouse2-fade',
|
||||
'print-fade',
|
||||
'release-mouse2-fade',
|
||||
|
@ -1427,9 +1388,6 @@ class OTPClientRepository(ClientRepositoryBase):
|
|||
def __handleCancelWaiting(self, value):
|
||||
self.loginFSM.request('shutdown')
|
||||
|
||||
def setIsNotNewInstallation(self):
|
||||
launcher.setIsNotNewInstallation()
|
||||
|
||||
def renderFrame(self):
|
||||
gsg = base.win.getGsg()
|
||||
if gsg:
|
||||
|
|
|
@ -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
|
@ -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
|
|
@ -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
|
|
@ -208,8 +208,6 @@ class OTPBase(ShowBase):
|
|||
self.errorAccumulatorBuffer += 'file not in phase (%s, %s)\n' % (file, path)
|
||||
return
|
||||
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)
|
||||
if model:
|
||||
model = NodePath(model)
|
||||
|
|
|
@ -579,11 +579,6 @@ class ClientRepositoryBase(ConnectionRepository):
|
|||
return None
|
||||
return worldNP
|
||||
|
||||
def isLive(self):
|
||||
if base.config.GetBool('force-live', 0):
|
||||
return True
|
||||
return not (__dev__ or launcher.isTestServer())
|
||||
|
||||
def isLocalId(self, id):
|
||||
# By default, no ID's are local. See also
|
||||
# ClientRepository.isLocalId().
|
||||
|
|
|
@ -6,7 +6,6 @@ from direct.interval.IntervalGlobal import *
|
|||
from direct.fsm import ClassicFSM, State
|
||||
from direct.fsm import State
|
||||
from direct.fsm import StateData
|
||||
from toontown.launcher import DownloadForceAcknowledge
|
||||
from toontown.toonbase import TTLocalizer
|
||||
from direct.showbase import PythonUtil
|
||||
|
||||
|
@ -14,8 +13,7 @@ class Elevator(StateData.StateData):
|
|||
|
||||
def __init__(self, elevatorState, doneEvent, distElevator):
|
||||
StateData.StateData.__init__(self, doneEvent)
|
||||
self.fsm = ClassicFSM.ClassicFSM('Elevator', [State.State('start', self.enterStart, self.exitStart, ['elevatorDFA']),
|
||||
State.State('elevatorDFA', self.enterElevatorDFA, self.exitElevatorDFA, ['requestBoard', 'final']),
|
||||
self.fsm = ClassicFSM.ClassicFSM('Elevator', [State.State('start', self.enterStart, self.exitStart, ['requestBoard', 'final']),
|
||||
State.State('requestBoard', self.enterRequestBoard, self.exitRequestBoard, ['boarding']),
|
||||
State.State('boarding', self.enterBoarding, self.exitBoarding, ['boarded']),
|
||||
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('exiting', self.enterExiting, self.exitExiting, ['final']),
|
||||
State.State('final', self.enterFinal, self.exitFinal, ['start'])], 'start', 'final')
|
||||
self.dfaDoneEvent = 'elevatorDfaDoneEvent'
|
||||
self.elevatorState = elevatorState
|
||||
self.distElevator = distElevator
|
||||
distElevator.elevatorFSM = self
|
||||
self.reverseBoardingCamera = False
|
||||
self.skipDFABoard = 0
|
||||
|
||||
def load(self):
|
||||
self.elevatorState.addChild(self.fsm)
|
||||
|
@ -52,7 +48,7 @@ class Elevator(StateData.StateData):
|
|||
|
||||
def enter(self):
|
||||
self.fsm.enterInitialState()
|
||||
self.fsm.request('elevatorDFA')
|
||||
self.fsm.request('requestBoard')
|
||||
|
||||
def exit(self):
|
||||
self.ignoreAll()
|
||||
|
@ -66,29 +62,6 @@ class Elevator(StateData.StateData):
|
|||
def exitStart(self):
|
||||
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):
|
||||
messenger.send(self.distElevator.uniqueName('enterElevatorOK'))
|
||||
|
||||
|
|
|
@ -27,18 +27,14 @@ class SuitInterior(Place.Place):
|
|||
'sit',
|
||||
'died',
|
||||
'teleportOut',
|
||||
'Elevator',
|
||||
'DFA']),
|
||||
'Elevator']),
|
||||
State.State('sit', self.enterSit, self.exitSit, ['walk']),
|
||||
State.State('stickerBook', self.enterStickerBook, self.exitStickerBook, ['walk',
|
||||
'stopped',
|
||||
'sit',
|
||||
'died',
|
||||
'DFA',
|
||||
'teleportOut',
|
||||
'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('teleportOut', self.enterTeleportOut, self.exitTeleportOut, ['teleportIn']),
|
||||
State.State('stopped', self.enterStopped, self.exitStopped, ['walk', 'elevatorOut']),
|
||||
|
@ -97,9 +93,6 @@ class SuitInterior(Place.Place):
|
|||
self.doneStatus = requestStatus
|
||||
messenger.send(self.doneEvent)
|
||||
|
||||
def doRequestLeave(self, requestStatus):
|
||||
self.fsm.request('DFA', [requestStatus])
|
||||
|
||||
def enterEntrance(self):
|
||||
pass
|
||||
|
||||
|
|
|
@ -30,23 +30,21 @@ class ToonInterior(Place.Place):
|
|||
Place.Place.__init__(self, loader, doneEvent)
|
||||
self.dnaFile = 'phase_7/models/modules/toon_interior'
|
||||
self.isInterior = 1
|
||||
self.tfaDoneEvent = 'tfaDoneEvent'
|
||||
self.hfaDoneEvent = 'hfaDoneEvent'
|
||||
self.npcfaDoneEvent = 'npcfaDoneEvent'
|
||||
self.fsm = ClassicFSM.ClassicFSM('ToonInterior', [State.State('start', self.enterStart, self.exitStart, ['doorIn', 'teleportIn', 'tutorial']),
|
||||
State.State('walk', self.enterWalk, self.exitWalk, ['sit',
|
||||
'stickerBook',
|
||||
'doorOut',
|
||||
'DFA',
|
||||
'teleportOut',
|
||||
'quest',
|
||||
'purchase',
|
||||
'phone',
|
||||
'stopped',
|
||||
'pet']),
|
||||
'pet',
|
||||
'NPCFA']),
|
||||
State.State('sit', self.enterSit, self.exitSit, ['walk']),
|
||||
State.State('stickerBook', self.enterStickerBook, self.exitStickerBook, ['walk',
|
||||
'DFA',
|
||||
'sit',
|
||||
'doorOut',
|
||||
'teleportOut',
|
||||
|
@ -54,14 +52,9 @@ class ToonInterior(Place.Place):
|
|||
'purchase',
|
||||
'phone',
|
||||
'stopped',
|
||||
'pet']),
|
||||
State.State('DFA', self.enterDFA, self.exitDFA, ['DFAReject',
|
||||
'HFA',
|
||||
'NPCFA',
|
||||
'teleportOut',
|
||||
'doorOut']),
|
||||
State.State('DFAReject', self.enterDFAReject, self.exitDFAReject, ['walk']),
|
||||
State.State('NPCFA', self.enterNPCFA, self.exitNPCFA, ['NPCFAReject', 'HFA', 'teleportOut']),
|
||||
'pet',
|
||||
'NPCFA']),
|
||||
State.State('NPCFA', self.enterNPCFA, self.exitNPCFA, ['NPCFAReject', 'HFA', 'teleportOut', 'doorOut']),
|
||||
State.State('NPCFAReject', self.enterNPCFAReject, self.exitNPCFAReject, ['walk']),
|
||||
State.State('HFA', self.enterHFA, self.exitHFA, ['HFAReject', 'teleportOut', 'tunnelOut']),
|
||||
State.State('HFAReject', self.enterHFAReject, self.exitHFAReject, ['walk']),
|
||||
|
@ -124,18 +117,7 @@ class ToonInterior(Place.Place):
|
|||
pass
|
||||
|
||||
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])
|
||||
elif ds == 'incomplete':
|
||||
self.fsm.request('DFAReject')
|
||||
else:
|
||||
self.notify.error('Unknown done status for DownloadForceAcknowledge: ' + `doneStatus`)
|
||||
self.fsm.request('NPCFA', [requestStatus])
|
||||
|
||||
def enterNPCFA(self, requestStatus):
|
||||
self.acceptOnce(self.npcfaDoneEvent, self.enterNPCFACallback, [requestStatus])
|
||||
|
|
|
@ -38,18 +38,14 @@ class CogdoInterior(Place.Place):
|
|||
'died',
|
||||
'teleportOut',
|
||||
'Elevator',
|
||||
'crane',
|
||||
'DFA']),
|
||||
'crane']),
|
||||
State.State('sit', self.enterSit, self.exitSit, ['walk']),
|
||||
State.State('stickerBook', self.enterStickerBook, self.exitStickerBook, ['walk',
|
||||
'stopped',
|
||||
'sit',
|
||||
'died',
|
||||
'DFA',
|
||||
'teleportOut',
|
||||
'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('teleportOut', self.enterTeleportOut, self.exitTeleportOut, ['teleportIn']),
|
||||
State.State('stopped', self.enterStopped, self.exitStopped, ['walk', 'elevatorOut', 'battle']),
|
||||
|
@ -105,9 +101,6 @@ class CogdoInterior(Place.Place):
|
|||
self.doneStatus = requestStatus
|
||||
messenger.send(self.doneEvent)
|
||||
|
||||
def doRequestLeave(self, requestStatus):
|
||||
self.fsm.request('DFA', [requestStatus])
|
||||
|
||||
def enterEntrance(self):
|
||||
pass
|
||||
|
||||
|
|
|
@ -27,11 +27,9 @@ class BossbotHQExterior(CogHQExterior.CogHQExterior):
|
|||
state = self.fsm.getStateNamed('stickerBook')
|
||||
state.addTransition('elevator')
|
||||
|
||||
def enterElevator(self, distElevator, skipDFABoard = 0):
|
||||
def enterElevator(self, distElevator):
|
||||
self.accept(self.elevatorDoneEvent, self.handleElevatorDone)
|
||||
self.elevator = Elevator.Elevator(self.fsm.getStateNamed('elevator'), self.elevatorDoneEvent, distElevator)
|
||||
if skipDFABoard:
|
||||
self.elevator.skipDFABoard = 1
|
||||
self.elevator.setReverseBoardingCamera(True)
|
||||
self.elevator.load()
|
||||
self.elevator.enter()
|
||||
|
|
|
@ -84,11 +84,9 @@ class CashbotHQExterior(CogHQExterior.CogHQExterior):
|
|||
for train in self.trains:
|
||||
train.hide()
|
||||
|
||||
def enterElevator(self, distElevator, skipDFABoard = 0):
|
||||
def enterElevator(self, distElevator):
|
||||
self.accept(self.elevatorDoneEvent, self.handleElevatorDone)
|
||||
self.elevator = Elevator.Elevator(self.fsm.getStateNamed('elevator'), self.elevatorDoneEvent, distElevator)
|
||||
if skipDFABoard:
|
||||
self.elevator.skipDFABoard = 1
|
||||
self.elevator.load()
|
||||
self.elevator.enter()
|
||||
|
||||
|
|
|
@ -31,7 +31,6 @@ class CogHQBossBattle(BattlePlace.BattlePlace):
|
|||
'teleportOut',
|
||||
'died',
|
||||
'tunnelOut',
|
||||
'DFA',
|
||||
'battle',
|
||||
'movie',
|
||||
'ouch',
|
||||
|
@ -58,7 +57,6 @@ class CogHQBossBattle(BattlePlace.BattlePlace):
|
|||
'teleportOut',
|
||||
'died',
|
||||
'tunnelOut',
|
||||
'DFA',
|
||||
'battle',
|
||||
'movie',
|
||||
'ouch',
|
||||
|
@ -66,13 +64,12 @@ class CogHQBossBattle(BattlePlace.BattlePlace):
|
|||
'finalBattle',
|
||||
'WaitForBattle']),
|
||||
State.State('stickerBook', self.enterStickerBook, self.exitStickerBook, ['walk',
|
||||
'DFA',
|
||||
'WaitForBattle',
|
||||
'movie',
|
||||
'battle']),
|
||||
'battle',
|
||||
'tunnelOut',
|
||||
'teleportOut']),
|
||||
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('teleportOut', self.enterTeleportOut, self.exitTeleportOut, ['teleportIn', 'final', 'WaitForBattle']),
|
||||
State.State('died', self.enterDied, self.exitDied, ['final']),
|
||||
|
|
|
@ -20,7 +20,6 @@ class CogHQExterior(BattlePlace.BattlePlace):
|
|||
State.State('walk', self.enterWalk, self.exitWalk, ['stickerBook',
|
||||
'teleportOut',
|
||||
'tunnelOut',
|
||||
'DFA',
|
||||
'doorOut',
|
||||
'died',
|
||||
'stopped',
|
||||
|
@ -32,17 +31,15 @@ class CogHQExterior(BattlePlace.BattlePlace):
|
|||
State.State('doorIn', self.enterDoorIn, self.exitDoorIn, ['walk', 'stopped']),
|
||||
State.State('doorOut', self.enterDoorOut, self.exitDoorOut, ['walk', 'stopped']),
|
||||
State.State('stickerBook', self.enterStickerBook, self.exitStickerBook, ['walk',
|
||||
'DFA',
|
||||
'WaitForBattle',
|
||||
'battle',
|
||||
'tunnelOut',
|
||||
'teleportOut',
|
||||
'doorOut',
|
||||
'squished',
|
||||
'died']),
|
||||
State.State('WaitForBattle', self.enterWaitForBattle, self.exitWaitForBattle, ['battle', 'walk']),
|
||||
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('teleportIn', self.enterTeleportIn, self.exitTeleportIn, ['walk', 'WaitForBattle', 'battle']),
|
||||
State.State('teleportOut', self.enterTeleportOut, self.exitTeleportOut, ['teleportIn', 'final', 'WaitForBattle']),
|
||||
|
|
|
@ -19,7 +19,6 @@ class CogHQLobby(Place.Place):
|
|||
'teleportIn',
|
||||
'doorIn']),
|
||||
State.State('walk', self.enterWalk, self.exitWalk, ['elevator',
|
||||
'DFA',
|
||||
'doorOut',
|
||||
'stopped']),
|
||||
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('teleportIn', self.enterTeleportIn, self.exitTeleportIn, ['walk']),
|
||||
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')
|
||||
|
||||
def load(self):
|
||||
|
@ -69,11 +66,9 @@ class CogHQLobby(Place.Place):
|
|||
self.ignore('teleportQuery')
|
||||
base.localAvatar.setTeleportAvailable(0)
|
||||
|
||||
def enterElevator(self, distElevator, skipDFABoard = 0):
|
||||
def enterElevator(self, distElevator):
|
||||
self.accept(self.elevatorDoneEvent, self.handleElevatorDone)
|
||||
self.elevator = Elevator.Elevator(self.fsm.getStateNamed('elevator'), self.elevatorDoneEvent, distElevator)
|
||||
if skipDFABoard:
|
||||
self.elevator.skipDFABoard = 1
|
||||
distElevator.elevatorFSM = self.elevator
|
||||
self.elevator.load()
|
||||
self.elevator.enter()
|
||||
|
|
|
@ -34,7 +34,6 @@ class CountryClubInterior(BattlePlace.BattlePlace):
|
|||
'died',
|
||||
'teleportOut',
|
||||
'squished',
|
||||
'DFA',
|
||||
'fallDown',
|
||||
'stopped',
|
||||
'elevator']),
|
||||
|
@ -43,7 +42,6 @@ class CountryClubInterior(BattlePlace.BattlePlace):
|
|||
State.State('push', self.enterPush, self.exitPush, ['walk', 'died', 'teleportOut']),
|
||||
State.State('stickerBook', self.enterStickerBook, self.exitStickerBook, ['walk',
|
||||
'battle',
|
||||
'DFA',
|
||||
'WaitForBattle',
|
||||
'died',
|
||||
'teleportOut']),
|
||||
|
@ -62,8 +60,6 @@ class CountryClubInterior(BattlePlace.BattlePlace):
|
|||
'FLA',
|
||||
'quietZone',
|
||||
'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('FLA', self.enterFLA, self.exitFLA, ['quietZone']),
|
||||
State.State('quietZone', self.enterQuietZone, self.exitQuietZone, ['teleportIn']),
|
||||
|
@ -260,11 +256,9 @@ class CountryClubInterior(BattlePlace.BattlePlace):
|
|||
def detectedElevatorCollision(self, distElevator):
|
||||
self.fsm.request('elevator', [distElevator])
|
||||
|
||||
def enterElevator(self, distElevator, skipDFABoard = 0):
|
||||
def enterElevator(self, distElevator):
|
||||
self.accept(self.elevatorDoneEvent, self.handleElevatorDone)
|
||||
self.elevator = Elevator.Elevator(self.fsm.getStateNamed('elevator'), self.elevatorDoneEvent, distElevator)
|
||||
if skipDFABoard:
|
||||
self.elevator.skipDFABoard = 1
|
||||
self.elevator.setReverseBoardingCamera(True)
|
||||
distElevator.elevatorFSM = self.elevator
|
||||
self.elevator.load()
|
||||
|
|
|
@ -27,7 +27,6 @@ class FactoryExterior(BattlePlace.BattlePlace):
|
|||
State.State('walk', self.enterWalk, self.exitWalk, ['stickerBook',
|
||||
'teleportOut',
|
||||
'tunnelOut',
|
||||
'DFA',
|
||||
'doorOut',
|
||||
'elevator',
|
||||
'stopped',
|
||||
|
@ -35,14 +34,13 @@ class FactoryExterior(BattlePlace.BattlePlace):
|
|||
'battle']),
|
||||
State.State('stopped', self.enterStopped, self.exitStopped, ['walk', 'teleportOut', 'elevator']),
|
||||
State.State('stickerBook', self.enterStickerBook, self.exitStickerBook, ['walk',
|
||||
'DFA',
|
||||
'WaitForBattle',
|
||||
'battle',
|
||||
'elevator']),
|
||||
'elevator',
|
||||
'tunnelOut',
|
||||
'teleportOut']),
|
||||
State.State('WaitForBattle', self.enterWaitForBattle, self.exitWaitForBattle, ['battle', 'walk']),
|
||||
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('teleportOut', self.enterTeleportOut, self.exitTeleportOut, ['teleportIn', 'final', 'WaitForBattle']),
|
||||
State.State('doorIn', self.enterDoorIn, self.exitDoorIn, ['walk']),
|
||||
|
@ -145,11 +143,9 @@ class FactoryExterior(BattlePlace.BattlePlace):
|
|||
def exitTeleportOut(self):
|
||||
BattlePlace.BattlePlace.exitTeleportOut(self)
|
||||
|
||||
def enterElevator(self, distElevator, skipDFABoard = 0):
|
||||
def enterElevator(self, distElevator):
|
||||
self.accept(self.elevatorDoneEvent, self.handleElevatorDone)
|
||||
self.elevator = Elevator.Elevator(self.fsm.getStateNamed('elevator'), self.elevatorDoneEvent, distElevator)
|
||||
if skipDFABoard:
|
||||
self.elevator.skipDFABoard = 1
|
||||
distElevator.elevatorFSM = self.elevator
|
||||
self.elevator.load()
|
||||
self.elevator.enter()
|
||||
|
|
|
@ -32,7 +32,6 @@ class FactoryInterior(BattlePlace.BattlePlace):
|
|||
'died',
|
||||
'teleportOut',
|
||||
'squished',
|
||||
'DFA',
|
||||
'fallDown',
|
||||
'elevator']),
|
||||
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('stickerBook', self.enterStickerBook, self.exitStickerBook, ['walk',
|
||||
'battle',
|
||||
'DFA',
|
||||
'WaitForBattle',
|
||||
'died',
|
||||
'teleportOut']),
|
||||
|
@ -59,8 +57,6 @@ class FactoryInterior(BattlePlace.BattlePlace):
|
|||
'FLA',
|
||||
'quietZone',
|
||||
'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('FLA', self.enterFLA, self.exitFLA, ['quietZone']),
|
||||
State.State('quietZone', self.enterQuietZone, self.exitQuietZone, ['teleportIn']),
|
||||
|
|
|
@ -30,7 +30,6 @@ class MintInterior(BattlePlace.BattlePlace):
|
|||
'died',
|
||||
'teleportOut',
|
||||
'squished',
|
||||
'DFA',
|
||||
'fallDown',
|
||||
'stopped']),
|
||||
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('stickerBook', self.enterStickerBook, self.exitStickerBook, ['walk',
|
||||
'battle',
|
||||
'DFA',
|
||||
'WaitForBattle',
|
||||
'died',
|
||||
'teleportOut']),
|
||||
|
@ -57,8 +55,6 @@ class MintInterior(BattlePlace.BattlePlace):
|
|||
'FLA',
|
||||
'quietZone',
|
||||
'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('FLA', self.enterFLA, self.exitFLA, ['quietZone']),
|
||||
State.State('quietZone', self.enterQuietZone, self.exitQuietZone, ['teleportIn']),
|
||||
|
|
|
@ -32,14 +32,12 @@ class StageInterior(BattlePlace.BattlePlace):
|
|||
'died',
|
||||
'teleportOut',
|
||||
'squished',
|
||||
'DFA',
|
||||
'fallDown',
|
||||
'elevator']),
|
||||
State.State('sit', self.enterSit, self.exitSit, ['walk', 'died', 'teleportOut']),
|
||||
State.State('push', self.enterPush, self.exitPush, ['walk', 'died', 'teleportOut']),
|
||||
State.State('stickerBook', self.enterStickerBook, self.exitStickerBook, ['walk',
|
||||
'battle',
|
||||
'DFA',
|
||||
'WaitForBattle',
|
||||
'died',
|
||||
'teleportOut']),
|
||||
|
@ -58,8 +56,6 @@ class StageInterior(BattlePlace.BattlePlace):
|
|||
'FLA',
|
||||
'quietZone',
|
||||
'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('FLA', self.enterFLA, self.exitFLA, ['quietZone']),
|
||||
State.State('quietZone', self.enterQuietZone, self.exitQuietZone, ['teleportIn']),
|
||||
|
|
|
@ -219,23 +219,6 @@ class HoodMgr(DirectObject.DirectObject):
|
|||
self.currentDropPoint = (self.currentDropPoint + 1) % len(dropPointList)
|
||||
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):
|
||||
hoodId = ZoneUtil.getCanonicalHoodId(hoodId)
|
||||
return ToontownGlobals.phaseMap[hoodId]
|
||||
|
|
|
@ -16,7 +16,6 @@ from direct.showbase.InputStateGlobal import inputState
|
|||
from otp.avatar import Avatar
|
||||
from otp.avatar import DistributedAvatar
|
||||
from otp.friends import FriendManager
|
||||
from otp.login import HTTPUtil
|
||||
from otp.distributed import OTPClientRepository
|
||||
from otp.distributed import PotentialAvatar
|
||||
from otp.distributed import PotentialShard
|
||||
|
@ -28,7 +27,6 @@ from otp.otpbase import OTPLocalizer
|
|||
from otp.avatar.Avatar import teleportNotify
|
||||
from toontown.toonbase.ToonBaseGlobal import *
|
||||
from toontown.toonbase.ToontownGlobals import *
|
||||
from toontown.launcher.DownloadForceAcknowledge import *
|
||||
from toontown.distributed import DelayDelete
|
||||
from toontown.friends import FriendHandle
|
||||
from toontown.friends import FriendsListPanel
|
||||
|
@ -61,8 +59,8 @@ class ToontownClientRepository(OTPClientRepository.OTPClientRepository):
|
|||
ClearInterestDoneEvent = 'TCRClearInterestDone'
|
||||
KeepSubShardObjects = False
|
||||
|
||||
def __init__(self, serverVersion, launcher = None):
|
||||
OTPClientRepository.OTPClientRepository.__init__(self, serverVersion, launcher, playGame=PlayGame.PlayGame)
|
||||
def __init__(self, serverVersion):
|
||||
OTPClientRepository.OTPClientRepository.__init__(self, serverVersion, playGame=PlayGame.PlayGame)
|
||||
self._playerAvDclass = self.dclassesByName['DistributedToon']
|
||||
setInterfaceFont(TTLocalizer.InterfaceFont)
|
||||
setSignFont(TTLocalizer.SignFont)
|
||||
|
@ -71,8 +69,6 @@ class ToontownClientRepository(OTPClientRepository.OTPClientRepository):
|
|||
setNametagFont(i, TTLocalizer.NametagFonts[i])
|
||||
|
||||
self.toons = {}
|
||||
if self.http.getVerifySsl() != HTTPClient.VSNoVerify:
|
||||
self.http.setVerifySsl(HTTPClient.VSNoDateCheck)
|
||||
self.__forbidCheesyEffects = 0
|
||||
self.friendManager = None
|
||||
self.trophyManager = None
|
||||
|
@ -202,7 +198,7 @@ class ToontownClientRepository(OTPClientRepository.OTPClientRepository):
|
|||
base.playMusic(self.music, looping=1, volume=0.9, interrupt=None)
|
||||
self.handler = self.handleMessageType
|
||||
self.avChoiceDoneEvent = 'avatarChooserDone'
|
||||
self.avChoice = AvatarChooser.AvatarChooser(avList, self.loginFSM, self.avChoiceDoneEvent)
|
||||
self.avChoice = AvatarChooser.AvatarChooser(avList, self.avChoiceDoneEvent)
|
||||
self.avChoice.load()
|
||||
self.avChoice.enter()
|
||||
self.accept(self.avChoiceDoneEvent, self.__handleAvatarChooserDone, [avList])
|
||||
|
@ -232,25 +228,11 @@ class ToontownClientRepository(OTPClientRepository.OTPClientRepository):
|
|||
base.localAvatarStyle = dna
|
||||
base.localAvatarName = avatarChoice.name
|
||||
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':
|
||||
self.loginFSM.request('createAvatar', [avList, index])
|
||||
elif done == 'delete':
|
||||
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):
|
||||
self.handler = None
|
||||
self.avChoice.exit()
|
||||
|
@ -294,14 +276,11 @@ class ToontownClientRepository(OTPClientRepository.OTPClientRepository):
|
|||
self.loginFSM.request('chooseAvatar', [avList])
|
||||
elif done == 'created':
|
||||
self.avCreate.exit()
|
||||
if not base.launcher or base.launcher.getPhaseComplete(3.5):
|
||||
for i in avList:
|
||||
if i.position == avPosition:
|
||||
newPotAv = i
|
||||
for i in avList:
|
||||
if i.position == avPosition:
|
||||
newPotAv = i
|
||||
|
||||
self.loginFSM.request('waitForSetAvatarResponse', [newPotAv])
|
||||
else:
|
||||
self.loginFSM.request('chooseAvatar', [avList])
|
||||
self.loginFSM.request('waitForSetAvatarResponse', [newPotAv])
|
||||
else:
|
||||
self.notify.error('Invalid doneStatus from MakeAToon: ' + str(done))
|
||||
|
||||
|
|
|
@ -41,7 +41,7 @@ class Estate(Place.Place):
|
|||
'fishing',
|
||||
'mailbox',
|
||||
'stopped',
|
||||
'DFA',
|
||||
'teleportOut',
|
||||
'doorOut',
|
||||
'push',
|
||||
'pet']),
|
||||
|
@ -57,7 +57,7 @@ class Estate(Place.Place):
|
|||
'doorOut',
|
||||
'push',
|
||||
'pet',
|
||||
'DFA']),
|
||||
'teleportOut']),
|
||||
State.State('teleportIn', self.enterTeleportIn, self.exitTeleportIn, ['walk', 'petTutorial']),
|
||||
State.State('teleportOut', self.enterTeleportOut, self.exitTeleportOut, ['teleportIn', 'walk', 'final']),
|
||||
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('mailbox', self.enterMailbox, self.exitMailbox, ['walk', 'stopped']),
|
||||
State.State('stopped', self.enterStopped, self.exitStopped, ['walk']),
|
||||
State.State('pet', self.enterPet, self.exitPet, ['walk', 'DFA']),
|
||||
State.State('DFA', self.enterDFA, self.exitDFA, ['DFAReject', 'teleportOut']),
|
||||
State.State('DFAReject', self.enterDFAReject, self.exitDFAReject, ['walk'])], 'init', 'final')
|
||||
State.State('pet', self.enterPet, self.exitPet, ['walk', 'teleportOut'])], 'init', 'final')
|
||||
self.fsm.enterInitialState()
|
||||
self.doneEvent = doneEvent
|
||||
self.parentFSMState = parentFSMState
|
||||
|
@ -173,9 +171,6 @@ class Estate(Place.Place):
|
|||
if hasattr(self, 'fsm'):
|
||||
self.fsm.request('walk')
|
||||
|
||||
def doRequestLeave(self, requestStatus):
|
||||
self.fsm.request('DFA', [requestStatus])
|
||||
|
||||
def enterInit(self):
|
||||
pass
|
||||
|
||||
|
|
|
@ -3,13 +3,7 @@ from toontown.toonbase.ToontownGlobals import *
|
|||
from direct.interval.IntervalGlobal import *
|
||||
from direct.fsm import ClassicFSM, State
|
||||
from toontown.safezone import SafeZoneLoader
|
||||
import random
|
||||
from toontown.launcher import DownloadForceAcknowledge
|
||||
import House
|
||||
import Estate
|
||||
import HouseGlobals
|
||||
import random
|
||||
import math
|
||||
import random, math, House, Estate, HouseGlobals
|
||||
from toontown.coghq import MovingPlatform
|
||||
from direct.directnotify import DirectNotifyGlobal
|
||||
|
||||
|
|
|
@ -20,13 +20,11 @@ class House(Place.Place):
|
|||
self.ownersAvId = avId
|
||||
self.dnaFile = 'phase_7/models/modules/toon_interior'
|
||||
self.isInterior = 1
|
||||
self.tfaDoneEvent = 'tfaDoneEvent'
|
||||
self.oldStyle = None
|
||||
self.fsm = ClassicFSM.ClassicFSM('House', [State.State('start', self.enterStart, self.exitStart, ['doorIn', 'teleportIn', 'tutorial']),
|
||||
State.State('walk', self.enterWalk, self.exitWalk, ['sit',
|
||||
'stickerBook',
|
||||
'doorOut',
|
||||
'DFA',
|
||||
'teleportOut',
|
||||
'quest',
|
||||
'purchase',
|
||||
|
@ -36,7 +34,6 @@ class House(Place.Place):
|
|||
'stopped']),
|
||||
State.State('sit', self.enterSit, self.exitSit, ['walk']),
|
||||
State.State('stickerBook', self.enterStickerBook, self.exitStickerBook, ['walk',
|
||||
'DFA',
|
||||
'sit',
|
||||
'doorOut',
|
||||
'teleportOut',
|
||||
|
@ -46,8 +43,6 @@ class House(Place.Place):
|
|||
'banking',
|
||||
'phone',
|
||||
'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('doorOut', self.enterDoorOut, self.exitDoorOut, ['walk']),
|
||||
State.State('teleportIn', self.enterTeleportIn, self.exitTeleportIn, ['walk']),
|
||||
|
|
|
@ -4,7 +4,6 @@ from direct.directnotify import DirectNotifyGlobal
|
|||
from direct.fsm import StateData
|
||||
from direct.showbase.PythonUtil import PriorityCallbacks
|
||||
from toontown.safezone import PublicWalk
|
||||
from toontown.launcher import DownloadForceAcknowledge
|
||||
import ZoneUtil
|
||||
from toontown.friends import FriendsListManager
|
||||
from toontown.toonbase import ToontownGlobals
|
||||
|
@ -25,7 +24,6 @@ class Place(StateData.StateData, FriendsListManager.FriendsListManager):
|
|||
StateData.StateData.__init__(self, doneEvent)
|
||||
FriendsListManager.FriendsListManager.__init__(self)
|
||||
self.loader = loader
|
||||
self.dfaDoneEvent = 'dfaDoneEvent'
|
||||
self.zoneId = None
|
||||
self._tiToken = None
|
||||
self._leftQuietZoneLocalCallbacks = PriorityCallbacks()
|
||||
|
@ -413,19 +411,6 @@ class Place(StateData.StateData, FriendsListManager.FriendsListManager):
|
|||
if hasattr(self, 'fsm'):
|
||||
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):
|
||||
if localAvatar.hasActiveBoardingGroup():
|
||||
rejectText = TTLocalizer.BoardingCannotLeaveZone
|
||||
|
@ -442,31 +427,16 @@ class Place(StateData.StateData, FriendsListManager.FriendsListManager):
|
|||
return
|
||||
self.requestLeave(requestStatus)
|
||||
|
||||
def enterDFACallback(self, requestStatus, doneStatus):
|
||||
teleportDebug(requestStatus, 'enterDFACallback%s' % ((requestStatus, doneStatus),))
|
||||
self.dfa.exit()
|
||||
del self.dfa
|
||||
if doneStatus['mode'] == 'complete':
|
||||
if requestStatus.get('tutorial', 0):
|
||||
out = {'teleportIn': 'tunnelOut'}
|
||||
requestStatus['zoneId'] = 22000
|
||||
requestStatus['hoodId'] = 22000
|
||||
else:
|
||||
out = {'teleportIn': 'teleportOut',
|
||||
'tunnelIn': 'tunnelOut',
|
||||
'doorIn': 'doorOut'}
|
||||
teleportDebug(requestStatus, 'requesting %s, requestStatus=%s' % (out[requestStatus['how']], requestStatus))
|
||||
self.fsm.request(out[requestStatus['how']], [requestStatus])
|
||||
elif doneStatus['mode'] == 'incomplete':
|
||||
self.fsm.request('DFAReject')
|
||||
def doRequestLeave(self, requestStatus):
|
||||
if requestStatus.get('tutorial', 0):
|
||||
out = {'teleportIn': 'tunnelOut'}
|
||||
requestStatus['zoneId'] = 22000
|
||||
requestStatus['hoodId'] = 22000
|
||||
else:
|
||||
Place.notify.error('Unknown done status for DownloadForceAcknowledge: ' + `doneStatus`)
|
||||
|
||||
def enterDFAReject(self):
|
||||
self.fsm.request('walk')
|
||||
|
||||
def exitDFAReject(self):
|
||||
pass
|
||||
out = {'teleportIn': 'teleportOut',
|
||||
'tunnelIn': 'tunnelOut',
|
||||
'doorIn': 'doorOut'}
|
||||
self.fsm.request(out[requestStatus['how']], [requestStatus])
|
||||
|
||||
def enterDoorIn(self, requestStatus):
|
||||
NametagGlobals.setWant2dNametags(False)
|
||||
|
|
|
@ -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])
|
|
@ -1,6 +1,5 @@
|
|||
from pandac.PandaModules import *
|
||||
from direct.directnotify import DirectNotifyGlobal
|
||||
from otp.launcher.LauncherBase import LauncherBase
|
||||
import os, sys, time, argparse
|
||||
|
||||
class LogAndOutput:
|
||||
|
@ -18,8 +17,8 @@ class LogAndOutput:
|
|||
self.log.flush()
|
||||
self.orig.flush()
|
||||
|
||||
class TTULauncher(LauncherBase):
|
||||
notify = DirectNotifyGlobal.directNotify.newCategory('ToontownDummyLauncher')
|
||||
class TTULauncher:
|
||||
notify = DirectNotifyGlobal.directNotify.newCategory('TTULauncher')
|
||||
|
||||
def __init__(self):
|
||||
self.logPrefix = 'united-'
|
||||
|
@ -31,9 +30,7 @@ class TTULauncher(LauncherBase):
|
|||
self.args = parser.parse_args()
|
||||
|
||||
ltime = 1 and time.localtime()
|
||||
logSuffix = '%02d%02d%02d_%02d%02d%02d' % (ltime[0] - 2000, ltime[1], ltime[2],
|
||||
ltime[3], ltime[4], ltime[5])
|
||||
|
||||
logSuffix = '%02d%02d%02d_%02d%02d%02d' % (ltime[0] - 2000, ltime[1], ltime[2], ltime[3], ltime[4], ltime[5])
|
||||
|
||||
if not os.path.exists('logs/'):
|
||||
os.mkdir('logs/')
|
||||
|
@ -53,31 +50,12 @@ class TTULauncher(LauncherBase):
|
|||
def getGameServer(self):
|
||||
return self.args.server
|
||||
|
||||
def setPandaErrorCode(self, code):
|
||||
def setPandaErrorCode(self):
|
||||
pass
|
||||
|
||||
def getGame2Done(self):
|
||||
return True
|
||||
def setDisconnectDetails(self, disconnectCode, disconnectMsg):
|
||||
self.disconnectCode = disconnectCode
|
||||
self.disconnectMsg = disconnectMsg
|
||||
|
||||
def getLogFileName(self):
|
||||
return 'toontown'
|
||||
|
||||
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
|
||||
def setDisconnectDetailsNormal(self):
|
||||
self.setDisconnectDetails(0, 'normal')
|
|
@ -1,17 +1,14 @@
|
|||
from pandac.PandaModules import *
|
||||
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 direct.fsm import StateData
|
||||
from direct.gui.DirectGui import *
|
||||
from pandac.PandaModules import *
|
||||
from toontown.toonbase import TTLocalizer
|
||||
from direct.directnotify import DirectNotifyGlobal
|
||||
from direct.interval.IntervalGlobal import *
|
||||
import random
|
||||
import random, AvatarChoice
|
||||
|
||||
MAX_AVATARS = 6
|
||||
POSITIONS = (Vec3(-0.840167, 0, 0.359333),
|
||||
Vec3(0.00933349, 0, 0.306533),
|
||||
|
@ -29,14 +26,10 @@ chooser_notify = DirectNotifyGlobal.directNotify.newCategory('AvatarChooser')
|
|||
|
||||
class AvatarChooser(StateData.StateData):
|
||||
|
||||
def __init__(self, avatarList, parentFSM, doneEvent):
|
||||
def __init__(self, avatarList, doneEvent):
|
||||
StateData.StateData.__init__(self, doneEvent)
|
||||
self.choice = None
|
||||
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
|
||||
|
||||
def enter(self):
|
||||
|
@ -203,9 +196,6 @@ class AvatarChooser(StateData.StateData):
|
|||
self.pickAToonBG.removeNode()
|
||||
del self.pickAToonBG
|
||||
del self.avatarList
|
||||
self.parentFSM.getCurrentState().removeChild(self.fsm)
|
||||
del self.parentFSM
|
||||
del self.fsm
|
||||
self.ignoreAll()
|
||||
self.isLoaded = 0
|
||||
ModelPool.garbageCollect()
|
||||
|
@ -220,51 +210,22 @@ class AvatarChooser(StateData.StateData):
|
|||
if panelDoneStatus == 'chose':
|
||||
self.__handleChoice()
|
||||
elif panelDoneStatus == 'nameIt':
|
||||
self.__handleCreate()
|
||||
self.__handleChoice()
|
||||
elif panelDoneStatus == 'delete':
|
||||
self.__handleDelete()
|
||||
self.__handleChoice()
|
||||
elif panelDoneStatus == 'create':
|
||||
self.__handleCreate()
|
||||
|
||||
def getChoice(self):
|
||||
return self.choice
|
||||
self.__handleChoice()
|
||||
|
||||
def __handleChoice(self):
|
||||
self.fsm.request('CheckDownload')
|
||||
|
||||
def __handleCreate(self):
|
||||
base.transitions.fadeOut(finishIval=EventInterval(self.doneEvent, [self.doneStatus]))
|
||||
|
||||
def __handleDelete(self):
|
||||
messenger.send(self.doneEvent, [self.doneStatus])
|
||||
|
||||
def __handleQuit(self):
|
||||
cleanupDialog('globalDialog')
|
||||
self.doneStatus = {'mode': 'exit'}
|
||||
messenger.send(self.doneEvent, [self.doneStatus])
|
||||
|
||||
def enterChoose(self):
|
||||
pass
|
||||
|
||||
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 getChoice(self):
|
||||
return self.choice
|
||||
|
||||
def openLanguageGui(self):
|
||||
self.exit()
|
||||
|
|
|
@ -915,7 +915,6 @@ class NameShop(StateData.StateData):
|
|||
self.notify.debug('avatar with default name accepted')
|
||||
self.avId = avId
|
||||
self.avExists = 1
|
||||
self.logAvatarCreation()
|
||||
if self.nameAction == 0:
|
||||
self.toon.setName(self.names[0])
|
||||
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.__handleSkipTutorial()
|
||||
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)
|
||||
|
|
|
@ -35,13 +35,13 @@ class Party(Place.Place):
|
|||
'quest',
|
||||
'fishing',
|
||||
'stopped',
|
||||
'DFA',
|
||||
'push',
|
||||
'activity']),
|
||||
'activity',
|
||||
'teleportOut']),
|
||||
State.State('stopped', self.enterStopped, self.exitStopped, ['walk', 'teleportOut']),
|
||||
State.State('sit', self.enterSit, self.exitSit, ['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',
|
||||
'sit',
|
||||
'quest',
|
||||
|
@ -49,7 +49,7 @@ class Party(Place.Place):
|
|||
'stopped',
|
||||
'activity',
|
||||
'push',
|
||||
'DFA']),
|
||||
'teleportOut']),
|
||||
State.State('teleportIn', self.enterTeleportIn, self.exitTeleportIn, ['walk', 'partyPlanning']),
|
||||
State.State('teleportOut', self.enterTeleportOut, self.exitTeleportOut, ['teleportIn', '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('fishing', self.enterFishing, self.exitFishing, ['walk', 'stopped']),
|
||||
State.State('activity', self.enterActivity, self.exitActivity, ['walk', 'stopped']),
|
||||
State.State('stopped', self.enterStopped, self.exitStopped, ['walk']),
|
||||
State.State('DFA', self.enterDFA, self.exitDFA, ['DFAReject', 'teleportOut']),
|
||||
State.State('DFAReject', self.enterDFAReject, self.exitDFAReject, ['walk'])], 'init', 'final')
|
||||
State.State('stopped', self.enterStopped, self.exitStopped, ['walk'])], 'init', 'final')
|
||||
self.fsm.enterInitialState()
|
||||
self.doneEvent = doneEvent
|
||||
self.parentFSMState = parentFSMState
|
||||
|
@ -132,9 +130,6 @@ class Party(Place.Place):
|
|||
def __setZoneId(self, zoneId):
|
||||
self.zoneId = zoneId
|
||||
|
||||
def doRequestLeave(self, requestStatus):
|
||||
self.fsm.request('DFA', [requestStatus])
|
||||
|
||||
def enterInit(self):
|
||||
pass
|
||||
|
||||
|
|
|
@ -42,18 +42,6 @@ class GSPlayground(Playground.Playground):
|
|||
Playground.Playground.exit(self)
|
||||
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):
|
||||
reason = requestStatus.get('reason')
|
||||
if reason == RaceGlobals.Exit_Barrier:
|
||||
|
|
|
@ -3,7 +3,6 @@ from direct.fsm import ClassicFSM, State
|
|||
from direct.fsm import State
|
||||
from pandac.PandaModules import *
|
||||
from toontown.hood import ZoneUtil
|
||||
from toontown.launcher import DownloadForceAcknowledge
|
||||
from toontown.safezone.SafeZoneLoader import SafeZoneLoader
|
||||
from toontown.safezone.GSPlayground import GSPlayground
|
||||
from toontown.effects.CarSmoke import CarSmoke
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
from pandac.PandaModules import *
|
||||
from toontown.toonbase import ToontownGlobals
|
||||
import Playground
|
||||
from toontown.launcher import DownloadForceAcknowledge
|
||||
from toontown.building import Elevator
|
||||
from toontown.toontowngui import TTDialog
|
||||
from toontown.toonbase import TTLocalizer
|
||||
|
@ -55,18 +54,6 @@ class GZPlayground(Playground.Playground):
|
|||
if hasattr(self, 'rotateBlimp'):
|
||||
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):
|
||||
reason = requestStatus.get('reason')
|
||||
if reason == RaceGlobals.Exit_Barrier:
|
||||
|
|
|
@ -4,7 +4,6 @@ from direct.fsm import ClassicFSM, State
|
|||
from direct.fsm import State
|
||||
from pandac.PandaModules import *
|
||||
from toontown.hood import ZoneUtil
|
||||
from toontown.launcher import DownloadForceAcknowledge
|
||||
from toontown.safezone.SafeZoneLoader import SafeZoneLoader
|
||||
from toontown.safezone.GZPlayground import GZPlayground
|
||||
from toontown.toonbase import TTLocalizer
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
from pandac.PandaModules import *
|
||||
from toontown.toonbase import ToontownGlobals
|
||||
import Playground
|
||||
from toontown.launcher import DownloadForceAcknowledge
|
||||
from toontown.building import Elevator
|
||||
from toontown.toontowngui import TTDialog
|
||||
from toontown.toonbase import TTLocalizer
|
||||
|
@ -40,18 +39,6 @@ class OZPlayground(Playground.Playground):
|
|||
taskMgr.remove('oz-check-cam-underwater')
|
||||
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):
|
||||
self.cameraSubmerged = 0
|
||||
self.toonSubmerged = 0
|
||||
|
|
|
@ -10,7 +10,6 @@ from direct.fsm import State
|
|||
from direct.task import Task
|
||||
from toontown.toon import DeathForceAcknowledge
|
||||
from toontown.toon import HealthForceAcknowledge
|
||||
from toontown.tutorial import TutorialForceAcknowledge
|
||||
from toontown.toon import NPCForceAcknowledge
|
||||
from toontown.trolley import Trolley
|
||||
from toontown.toontowngui import TTDialog
|
||||
|
@ -28,7 +27,6 @@ class Playground(Place.Place):
|
|||
|
||||
def __init__(self, loader, parentFSM, doneEvent):
|
||||
Place.Place.__init__(self, loader, doneEvent)
|
||||
self.tfaDoneEvent = 'tfaDoneEvent'
|
||||
self.fsm = ClassicFSM.ClassicFSM('Playground', [
|
||||
State.State('start',
|
||||
self.enterStart,
|
||||
|
@ -43,8 +41,7 @@ class Playground(Place.Place):
|
|||
'drive',
|
||||
'sit',
|
||||
'stickerBook',
|
||||
'TFA',
|
||||
'DFA',
|
||||
'NPCFA',
|
||||
'trolley',
|
||||
'final',
|
||||
'doorOut',
|
||||
|
@ -57,25 +54,20 @@ class Playground(Place.Place):
|
|||
self.enterStickerBook,
|
||||
self.exitStickerBook, [
|
||||
'walk',
|
||||
'DFA',
|
||||
'TFA',
|
||||
'trolley',
|
||||
'final',
|
||||
'doorOut',
|
||||
'quest',
|
||||
'purchase',
|
||||
'stopped',
|
||||
'fishing']),
|
||||
'fishing',
|
||||
'NPCFA']),
|
||||
State.State('sit',
|
||||
self.enterSit,
|
||||
self.exitSit, [
|
||||
'walk',
|
||||
'DFA']),
|
||||
self.exitSit, ['walk']),
|
||||
State.State('drive',
|
||||
self.enterDrive,
|
||||
self.exitDrive, [
|
||||
'walk',
|
||||
'DFA']),
|
||||
self.exitDrive, ['walk']),
|
||||
State.State('trolley',
|
||||
self.enterTrolley,
|
||||
self.exitTrolley, [
|
||||
|
@ -88,25 +80,6 @@ class Playground(Place.Place):
|
|||
self.enterDoorOut,
|
||||
self.exitDoorOut, [
|
||||
'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',
|
||||
self.enterNPCFA,
|
||||
self.exitNPCFA, [
|
||||
|
@ -382,27 +355,8 @@ class Playground(Place.Place):
|
|||
messenger.send(self.doneEvent)
|
||||
return
|
||||
|
||||
def enterTFACallback(self, requestStatus, doneStatus):
|
||||
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])
|
||||
elif ds == 'incomplete':
|
||||
self.fsm.request('DFAReject')
|
||||
else:
|
||||
self.notify.error('Unknown done status for DownloadForceAcknowledge: ' + `doneStatus`)
|
||||
def doRequestLeave(self, requestStatus):
|
||||
self.fsm.request('NPCFA', [requestStatus])
|
||||
|
||||
def enterHFA(self, requestStatus):
|
||||
self.acceptOnce(self.hfaDoneEvent, self.enterHFACallback, [requestStatus])
|
||||
|
@ -647,17 +601,3 @@ class Playground(Place.Place):
|
|||
npc = self.geom.findAllMatches('**/suit_building_origin')
|
||||
for i in xrange(npc.getNumPaths()):
|
||||
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
|
||||
|
|
|
@ -9,10 +9,8 @@ from direct.fsm import StateData
|
|||
from direct.fsm import ClassicFSM, State
|
||||
from direct.fsm import State
|
||||
from direct.task import Task
|
||||
from toontown.launcher import DownloadForceAcknowledge
|
||||
from toontown.toon import HealthForceAcknowledge
|
||||
from toontown.toon.Toon import teleportDebug
|
||||
from toontown.tutorial import TutorialForceAcknowledge
|
||||
from toontown.toonbase.ToontownGlobals import *
|
||||
from toontown.building import ToonInterior
|
||||
from toontown.hood import QuietZoneState
|
||||
|
|
|
@ -190,13 +190,11 @@ class MapPage(ShtikerPage.ShtikerPage):
|
|||
else:
|
||||
self.hoodLabel.hide()
|
||||
safeZonesVisited = base.localAvatar.hoodsVisited
|
||||
hoodsAvailable = base.cr.hoodMgr.getAvailableZones()
|
||||
hoodVisibleList = PythonUtil.intersection(safeZonesVisited, hoodsAvailable)
|
||||
hoodTeleportList = base.localAvatar.getTeleportAccess()
|
||||
for hood in self.allZones:
|
||||
label = self.labels[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.show()
|
||||
for cloud in clouds:
|
||||
|
@ -229,7 +227,7 @@ class MapPage(ShtikerPage.ShtikerPage):
|
|||
messenger.send(self.doneEvent)
|
||||
|
||||
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])
|
||||
self.doneStatus = {'mode': 'teleport',
|
||||
'hood': hood}
|
||||
|
|
|
@ -41,10 +41,7 @@ class TrackFrame(DirectFrame):
|
|||
self.ignore('nametagAmbientLightChanged')
|
||||
|
||||
def play(self, trackId):
|
||||
if not base.launcher or base.launcher and base.launcher.getPhaseComplete(5):
|
||||
anim = Track2Anim[trackId]
|
||||
else:
|
||||
anim = 'neutral'
|
||||
anim = Track2Anim[trackId]
|
||||
if self.toon:
|
||||
numFrames = self.toon.getNumFrames(anim) - 1
|
||||
fromFrame = 0
|
||||
|
@ -55,12 +52,8 @@ class TrackFrame(DirectFrame):
|
|||
def setTrained(self, trackId):
|
||||
if self.toon == None:
|
||||
self.makeToon()
|
||||
if not base.launcher or base.launcher and base.launcher.getPhaseComplete(5):
|
||||
anim = Track2Anim[trackId]
|
||||
frame = (self.toon.getNumFrames(anim) - 1) / MAX_FRAMES * self.index
|
||||
else:
|
||||
anim = 'neutral'
|
||||
frame = 0
|
||||
anim = Track2Anim[trackId]
|
||||
frame = (self.toon.getNumFrames(anim) - 1) / MAX_FRAMES * self.index
|
||||
self.toon.pose(anim, frame)
|
||||
self.toon.show()
|
||||
self.question.hide()
|
||||
|
|
|
@ -1395,8 +1395,6 @@ class DistributedToon(DistributedPlayer.DistributedPlayer, Toon.Toon, Distribute
|
|||
def presentPie(self, x, y, z, h, timestamp32):
|
||||
if self.numPies <= 0:
|
||||
return
|
||||
if not launcher.getPhaseComplete(5):
|
||||
return
|
||||
lastTossTrack = Sequence()
|
||||
if self.tossTrack:
|
||||
lastTossTrack = self.tossTrack
|
||||
|
@ -1422,8 +1420,6 @@ class DistributedToon(DistributedPlayer.DistributedPlayer, Toon.Toon, Distribute
|
|||
if self.numPies != ToontownGlobals.FullPies:
|
||||
self.setNumPies(self.numPies - 1)
|
||||
self.lastTossedPie = globalClock.getFrameTime()
|
||||
if not launcher.getPhaseComplete(5):
|
||||
return
|
||||
lastTossTrack = Sequence()
|
||||
if self.tossTrack:
|
||||
lastTossTrack = self.tossTrack
|
||||
|
@ -1466,8 +1462,6 @@ class DistributedToon(DistributedPlayer.DistributedPlayer, Toon.Toon, Distribute
|
|||
elapsed = globalClock.getFrameTime() - self.lastTossedPie
|
||||
if elapsed > 30:
|
||||
return
|
||||
if not launcher.getPhaseComplete(5):
|
||||
return
|
||||
lastPieTrack = Sequence()
|
||||
if sequence in self.pieTracks:
|
||||
lastPieTrack = self.pieTracks[sequence]
|
||||
|
|
|
@ -105,7 +105,6 @@ class LocalToon(DistributedToon.DistributedToon, LocalAvatar.LocalAvatar):
|
|||
self.furnitureDirector = None
|
||||
self.gotCatalogNotify = 0
|
||||
self.__catalogNotifyDialog = None
|
||||
self.accept('phaseComplete-5.5', self.loadPhase55Stuff)
|
||||
Toon.loadDialog()
|
||||
self.isIt = 0
|
||||
self.cantLeaveGame = 0
|
||||
|
@ -412,9 +411,6 @@ class LocalToon(DistributedToon.DistributedToon, LocalAvatar.LocalAvatar):
|
|||
if self.hasKart():
|
||||
if hasattr(self, 'kartPage') and self.kartPage != None:
|
||||
return
|
||||
if not launcher.getPhaseComplete(6):
|
||||
self.acceptOnce('phaseComplete-6', self.addKartPage)
|
||||
return
|
||||
self.kartPage = KartPage.KartPage()
|
||||
self.kartPage.setAvatar(self)
|
||||
self.kartPage.load()
|
||||
|
@ -427,9 +423,6 @@ class LocalToon(DistributedToon.DistributedToon, LocalAvatar.LocalAvatar):
|
|||
def loadDisguisePages(self):
|
||||
if self.disguisePage != None:
|
||||
return
|
||||
if not launcher.getPhaseComplete(9):
|
||||
self.acceptOnce('phaseComplete-9', self.loadDisguisePages)
|
||||
return
|
||||
self.disguisePage = DisguisePage.DisguisePage()
|
||||
self.disguisePage.load()
|
||||
self.book.addPage(self.disguisePage, pageName=TTLocalizer.DisguisePageTitle)
|
||||
|
@ -447,24 +440,11 @@ class LocalToon(DistributedToon.DistributedToon, LocalAvatar.LocalAvatar):
|
|||
def loadGardenPages(self):
|
||||
if self.gardenPage != None:
|
||||
return
|
||||
if not launcher.getPhaseComplete(5.5):
|
||||
self.acceptOnce('phaseComplete-5.5', self.loadPhase55Stuff)
|
||||
return
|
||||
self.gardenPage = GardenPage.GardenPage()
|
||||
self.gardenPage.load()
|
||||
self.book.addPage(self.gardenPage, pageName=TTLocalizer.GardenPageTitle)
|
||||
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):
|
||||
self.notify.debug('Setting GM State: %s in LocalToon' % state)
|
||||
DistributedToon.DistributedToon.setAsGM(self, state)
|
||||
|
@ -833,8 +813,6 @@ class LocalToon(DistributedToon.DistributedToon, LocalAvatar.LocalAvatar):
|
|||
wantButton = 0
|
||||
if self.allowPies and self.numPies > 0:
|
||||
wantButton = 1
|
||||
if not launcher.getPhaseComplete(5):
|
||||
wantButton = 0
|
||||
haveButton = self.__pieButton != None
|
||||
if not haveButton and not wantButton:
|
||||
return
|
||||
|
@ -1115,7 +1093,7 @@ class LocalToon(DistributedToon.DistributedToon, LocalAvatar.LocalAvatar):
|
|||
self.accept(ToontownGlobals.FriendsListHotkey, self.sendFriendsListEvent)
|
||||
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:
|
||||
showClarabelle = not launcher or launcher.getPhaseComplete(5.5)
|
||||
showClarabelle = 1
|
||||
for quest in self.quests:
|
||||
if quest[0] in Quests.PreClarabelleQuestIds and self.mailboxNotify != ToontownGlobals.NewItems and self.awardNotify != ToontownGlobals.NewItems:
|
||||
showClarabelle = 0
|
||||
|
@ -1158,9 +1136,6 @@ class LocalToon(DistributedToon.DistributedToon, LocalAvatar.LocalAvatar):
|
|||
def newCatalogNotify(self):
|
||||
if not self.gotCatalogNotify:
|
||||
return
|
||||
hasPhase = not launcher or launcher.getPhaseComplete(5.5)
|
||||
if not hasPhase:
|
||||
return
|
||||
if not self.friendsListButtonActive or self.friendsListButtonObscured > 0:
|
||||
return
|
||||
self.gotCatalogNotify = 0
|
||||
|
@ -1748,9 +1723,6 @@ class LocalToon(DistributedToon.DistributedToon, LocalAvatar.LocalAvatar):
|
|||
if self.hasPlayedGolf():
|
||||
if hasattr(self, 'golfPage') and self.golfPage != None:
|
||||
return
|
||||
if not launcher.getPhaseComplete(6):
|
||||
self.acceptOnce('phaseComplete-6', self.addGolfPage)
|
||||
return
|
||||
self.golfPage = GolfPage.GolfPage()
|
||||
self.golfPage.setAvatar(self)
|
||||
self.golfPage.load()
|
||||
|
@ -1760,9 +1732,6 @@ class LocalToon(DistributedToon.DistributedToon, LocalAvatar.LocalAvatar):
|
|||
def addEventsPage(self):
|
||||
if hasattr(self, 'eventsPage') and self.eventsPage != None:
|
||||
return
|
||||
if not launcher.getPhaseComplete(4):
|
||||
self.acceptOnce('phaseComplete-4', self.addEventsPage)
|
||||
return
|
||||
self.eventsPage = EventsPage.EventsPage()
|
||||
self.eventsPage.load()
|
||||
self.book.addPage(self.eventsPage, pageName=TTLocalizer.EventsPageName)
|
||||
|
|
|
@ -2677,8 +2677,6 @@ class Toon(Avatar.Avatar, ToonHead):
|
|||
def putOnSuit(self, suitType, setDisplayName = True, rental = False):
|
||||
if self.isDisguised:
|
||||
self.takeOffSuit()
|
||||
if launcher and not launcher.getPhaseComplete(5):
|
||||
return
|
||||
from toontown.suit import Suit
|
||||
deptIndex = suitType
|
||||
suit = Suit.Suit()
|
||||
|
|
|
@ -430,65 +430,59 @@ class ToonHead(Actor.Actor):
|
|||
return headHeight
|
||||
|
||||
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'):
|
||||
self.pumpkins = NodePathCollection()
|
||||
ppath = 'phase_4/models/estate/pumpkin_'
|
||||
if headStyle is 'l':
|
||||
if copy:
|
||||
pmodel = loader.loadModel(ppath + 'tall')
|
||||
else:
|
||||
pmodel = loader.loadModel(ppath + 'tall')
|
||||
ptype = 'tall'
|
||||
if not hasattr(self, 'pumpkins'):
|
||||
self.pumpkins = NodePathCollection()
|
||||
ppath = 'phase_4/models/estate/pumpkin_'
|
||||
if headStyle is 'l':
|
||||
if copy:
|
||||
pmodel = loader.loadModel(ppath + 'tall')
|
||||
else:
|
||||
if copy:
|
||||
pmodel = loader.loadModel(ppath + 'short')
|
||||
else:
|
||||
pmodel = loader.loadModel(ppath + 'short')
|
||||
ptype = 'short'
|
||||
if pmodel:
|
||||
p = pmodel.find('**/pumpkin_' + ptype + '*')
|
||||
p.setScale(0.5)
|
||||
p.setZ(-0.5)
|
||||
p.setH(180)
|
||||
if lod:
|
||||
p.reparentTo(self.find('**/' + lod + '/**/__Actor_head'))
|
||||
else:
|
||||
p.reparentTo(self.find('**/__Actor_head'))
|
||||
self.pumpkins.addPath(p)
|
||||
pmodel.removeNode()
|
||||
return True
|
||||
else:
|
||||
del self.pumpkins
|
||||
return False
|
||||
pmodel = loader.loadModel(ppath + 'tall')
|
||||
ptype = 'tall'
|
||||
else:
|
||||
ToonHead.notify.debug('phase_4 not complete yet. Postponing pumpkin head load.')
|
||||
if copy:
|
||||
pmodel = loader.loadModel(ppath + 'short')
|
||||
else:
|
||||
pmodel = loader.loadModel(ppath + 'short')
|
||||
ptype = 'short'
|
||||
if pmodel:
|
||||
p = pmodel.find('**/pumpkin_' + ptype + '*')
|
||||
p.setScale(0.5)
|
||||
p.setZ(-0.5)
|
||||
p.setH(180)
|
||||
if lod:
|
||||
p.reparentTo(self.find('**/' + lod + '/**/__Actor_head'))
|
||||
else:
|
||||
p.reparentTo(self.find('**/__Actor_head'))
|
||||
self.pumpkins.addPath(p)
|
||||
pmodel.removeNode()
|
||||
return True
|
||||
else:
|
||||
del self.pumpkins
|
||||
return False
|
||||
|
||||
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'):
|
||||
self.snowMen = NodePathCollection()
|
||||
snowManPath = 'phase_4/models/props/tt_m_efx_snowmanHead_'
|
||||
if headStyle is 'l':
|
||||
snowManPath = snowManPath + 'tall'
|
||||
else:
|
||||
snowManPath = snowManPath + 'short'
|
||||
model = loader.loadModel(snowManPath)
|
||||
if model:
|
||||
model.setZ(-0.5)
|
||||
model.setH(180)
|
||||
if lod:
|
||||
model.reparentTo(self.getPart('head', lod))
|
||||
else:
|
||||
model.reparentTo(self.find('**/__Actor_head'))
|
||||
self.snowMen.addPath(model)
|
||||
model.stash()
|
||||
return True
|
||||
else:
|
||||
del self.snowMen
|
||||
return False
|
||||
if not hasattr(self, 'snowMen'):
|
||||
self.snowMen = NodePathCollection()
|
||||
snowManPath = 'phase_4/models/props/tt_m_efx_snowmanHead_'
|
||||
if headStyle is 'l':
|
||||
snowManPath = snowManPath + 'tall'
|
||||
else:
|
||||
ToonHead.notify.debug('phase_4 not loaded yet.')
|
||||
snowManPath = snowManPath + 'short'
|
||||
model = loader.loadModel(snowManPath)
|
||||
if model:
|
||||
model.setZ(-0.5)
|
||||
model.setH(180)
|
||||
if lod:
|
||||
model.reparentTo(self.getPart('head', lod))
|
||||
else:
|
||||
model.reparentTo(self.find('**/__Actor_head'))
|
||||
self.snowMen.addPath(model)
|
||||
model.stash()
|
||||
return True
|
||||
else:
|
||||
del self.snowMen
|
||||
return False
|
||||
|
||||
def __fixPumpkin(self, style, lodName = None, copy = 1):
|
||||
if lodName == None:
|
||||
|
|
|
@ -123,19 +123,11 @@ import time
|
|||
import sys
|
||||
import random
|
||||
import __builtin__
|
||||
try:
|
||||
launcher
|
||||
except:
|
||||
from toontown.launcher.TTULauncher import TTULauncher
|
||||
launcher = TTULauncher()
|
||||
__builtin__.launcher = launcher
|
||||
from toontown.launcher.TTULauncher import TTULauncher
|
||||
|
||||
__builtin__.launcher = TTULauncher()
|
||||
|
||||
notify.info('Starting the game...')
|
||||
if launcher.isDummy():
|
||||
http = HTTPClient()
|
||||
else:
|
||||
http = launcher.http
|
||||
tempLoader = Loader()
|
||||
backgroundNode = tempLoader.loadSync(Filename('phase_3/models/gui/loading-background'))
|
||||
from direct.gui import DirectGuiGlobals
|
||||
|
@ -143,14 +135,11 @@ from direct.gui.DirectGui import *
|
|||
notify.info('Setting the default font...')
|
||||
import ToontownGlobals
|
||||
DirectGuiGlobals.setDefaultFontFunc(ToontownGlobals.getInterfaceFont)
|
||||
launcher.setPandaErrorCode(7)
|
||||
import ToonBase
|
||||
ToonBase.ToonBase()
|
||||
from pandac.PandaModules import *
|
||||
if base.win is None:
|
||||
notify.error('Unable to open window; aborting.')
|
||||
launcher.setPandaErrorCode(0)
|
||||
launcher.setPandaWindowOpen()
|
||||
ConfigVariableDouble('decompressor-step-time').setValue(0.01)
|
||||
ConfigVariableDouble('extractor-step-time').setValue(0.01)
|
||||
backgroundNodePath = aspect2d.attachNewNode(backgroundNode, 0)
|
||||
|
@ -195,7 +184,7 @@ loader.beginBulkLoad('init', TTLocalizer.LoaderLabel, 138, 0, TTLocalizer.TIP_NO
|
|||
from ToonBaseGlobal import *
|
||||
from direct.showbase.MessengerGlobal import *
|
||||
from toontown.distributed import ToontownClientRepository
|
||||
cr = ToontownClientRepository.ToontownClientRepository(serverVersion, launcher)
|
||||
cr = ToontownClientRepository.ToontownClientRepository(serverVersion)
|
||||
cr.music = music
|
||||
del music
|
||||
base.initNametagGlobals()
|
||||
|
@ -204,10 +193,7 @@ loader.endBulkLoad('init')
|
|||
from otp.friends import FriendManager
|
||||
from otp.distributed.OtpDoGlobals import *
|
||||
cr.generateGlobalObject(OTP_DO_ID_FRIEND_MANAGER, 'FriendManager')
|
||||
if not launcher.isDummy():
|
||||
base.startShow(cr, launcher.getGameServer())
|
||||
else:
|
||||
base.startShow(cr)
|
||||
base.startShow(cr)
|
||||
backgroundNodePath.reparentTo(hidden)
|
||||
backgroundNodePath.removeNode()
|
||||
del backgroundNodePath
|
||||
|
|
|
@ -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?'
|
||||
FriendInviterRemainToon = '\n(You will still be toon 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'
|
||||
AvatarChoicePlayThisToon = 'Play\nThis Toon'
|
||||
AvatarChoiceSubscribersOnly = 'Subscribe'
|
||||
AvatarChoiceDelete = 'Delete'
|
||||
AvatarChoiceDeleteConfirm = 'This will delete %s forever.'
|
||||
AvatarChoiceNameRejected = 'Name\nRejected'
|
||||
|
@ -4372,7 +4327,6 @@ FishPokerPair = 'Pair'
|
|||
TutorialGreeting1 = 'Hi %s!'
|
||||
TutorialGreeting2 = 'Hi %s!\nCome over here!'
|
||||
TutorialGreeting3 = 'Hi %s!\nCome over here!\nUse the arrow keys!'
|
||||
TutorialForceAcknowledgeMessage = 'You are going the wrong way! Go find Flippy!'
|
||||
PetTutorialTitle1 = 'The Doodle Panel'
|
||||
PetTutorialTitle2 = 'Doodle SpeedChat'
|
||||
PetTutorialTitle3 = 'Doodle Cattlelog'
|
||||
|
@ -4407,7 +4361,7 @@ ForcedLeaveMintAckMsg = 'The Mint Floor Supervisor was defeated before you could
|
|||
HeadingToFactoryTitle = '%s'
|
||||
ForemanConfrontedMsg = '%s is battling the ' + Foreman + '!'
|
||||
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'
|
||||
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...'
|
||||
|
|
|
@ -75,7 +75,6 @@ EHpopupInfo = 0.08
|
|||
HtitleText = 0.16
|
||||
ACplayThisToon = 0.12
|
||||
ACmakeAToon = 0.12
|
||||
ACsubscribersOnly = 0.115
|
||||
ACdeleteWithPasswordFrame = 0.06
|
||||
ACstatusText = 1.0
|
||||
ACtitle = 0.15
|
||||
|
|
|
@ -138,8 +138,6 @@ class ToonBase(OTPBase.OTPBase):
|
|||
self.transitions.IrisModelName = 'phase_3/models/misc/iris'
|
||||
self.transitions.FadeModelName = 'phase_3/models/misc/fade'
|
||||
self.exitFunc = self.userExit
|
||||
if 'launcher' in __builtins__ and launcher:
|
||||
launcher.setPandaErrorCode(11)
|
||||
globalClock.setMaxDt(0.2)
|
||||
if self.config.GetBool('want-particles', 1) == 1:
|
||||
self.notify.debug('Enabling particles')
|
||||
|
@ -381,10 +379,9 @@ class ToonBase(OTPBase.OTPBase):
|
|||
cell.setActive(active)
|
||||
self.marginManager.reorganize()
|
||||
|
||||
def startShow(self, cr, launcherServer = None):
|
||||
def startShow(self, cr):
|
||||
self.cr = cr
|
||||
base.graphicsEngine.renderFrame()
|
||||
gameServer = launcher.getGameServer()
|
||||
# Get the base port.
|
||||
serverPort = base.config.GetInt('server-port', 7199)
|
||||
|
||||
|
@ -395,7 +392,7 @@ class ToonBase(OTPBase.OTPBase):
|
|||
serverPort += (random.randint(0, clientagents) * 100)
|
||||
|
||||
serverList = []
|
||||
for name in gameServer.split(';'):
|
||||
for name in launcher.getGameServer().split(';'):
|
||||
url = URLSpec(name, 1)
|
||||
if base.config.GetBool('server-force-ssl', False):
|
||||
url.setScheme('s')
|
||||
|
@ -445,10 +442,6 @@ class ToonBase(OTPBase.OTPBase):
|
|||
|
||||
def exitShow(self, errorCode = None):
|
||||
self.notify.info('Exiting Toontown: errorCode = %s' % errorCode)
|
||||
if errorCode:
|
||||
launcher.setPandaErrorCode(errorCode)
|
||||
else:
|
||||
launcher.setPandaErrorCode(0)
|
||||
sys.exit()
|
||||
|
||||
def setExitErrorCode(self, code):
|
||||
|
@ -485,7 +478,6 @@ class ToonBase(OTPBase.OTPBase):
|
|||
self.exitShow()
|
||||
|
||||
def panda3dRenderError(self):
|
||||
launcher.setPandaErrorCode(14)
|
||||
if self.cr.timeManager:
|
||||
self.cr.timeManager.setDisconnectReason(ToontownGlobals.DisconnectGraphicsError)
|
||||
self.cr.sendDisconnect()
|
||||
|
|
|
@ -39,7 +39,6 @@ class Street(BattlePlace.BattlePlace):
|
|||
'stickerBook',
|
||||
'WaitForBattle',
|
||||
'battle',
|
||||
'DFA',
|
||||
'doorOut',
|
||||
'elevator',
|
||||
'tunnelIn',
|
||||
|
@ -56,7 +55,6 @@ class Street(BattlePlace.BattlePlace):
|
|||
'push',
|
||||
'sit',
|
||||
'battle',
|
||||
'DFA',
|
||||
'doorOut',
|
||||
'elevator',
|
||||
'tunnelIn',
|
||||
|
@ -73,8 +71,6 @@ class Street(BattlePlace.BattlePlace):
|
|||
State.State('doorOut', self.enterDoorOut, self.exitDoorOut, ['walk']),
|
||||
State.State('elevatorIn', self.enterElevatorIn, self.exitElevatorIn, ['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',
|
||||
'teleportOut',
|
||||
'quietZone',
|
||||
|
|
|
@ -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])
|
Loading…
Reference in a new issue