makeatoon: it loads

This commit is contained in:
Open Toontown 2019-11-10 21:32:17 -05:00
parent 4ae4a6e3e4
commit 140f520d65
4 changed files with 34 additions and 10 deletions

View file

@ -15,3 +15,7 @@ class AstronLoginManager(DistributedObjectGlobal):
def sendRequestLogin(self, playToken): def sendRequestLogin(self, playToken):
self.sendUpdate('requestLogin', [playToken]) self.sendUpdate('requestLogin', [playToken])
def loginResponse(self, responseBlob):
# TODO HANDLE THIS PROPERLY
messenger.send(self.doneEvent, [{'mode': 'success'}])

View file

@ -1,8 +1,34 @@
from direct.directnotify import DirectNotifyGlobal from direct.directnotify import DirectNotifyGlobal
from direct.distributed.DistributedObjectGlobalUD import DistributedObjectGlobalUD from direct.distributed.DistributedObjectGlobalUD import DistributedObjectGlobalUD
from direct.distributed.PyDatagram import *
class AstronLoginManagerUD(DistributedObjectGlobalUD): class AstronLoginManagerUD(DistributedObjectGlobalUD):
notify = DirectNotifyGlobal.directNotify.newCategory('AstronLoginManagerUD') notify = DirectNotifyGlobal.directNotify.newCategory('AstronLoginManagerUD')
def requestLogin(self, playToken): def requestLogin(self, playToken):
print playToken # TODO SET THIS UP PROPERLY.
# AT THE MOMENT EVERYTHING IS HARDCODED
# THIS IS JUST TO GET TO THE PICK A TOON SCREEN
# get the sender
sender = self.air.getMsgSender()
# add connection to account channel
datagram = PyDatagram()
datagram.addServerHeader(sender, self.air.ourChannel, CLIENTAGENT_OPEN_CHANNEL)
datagram.addChannel(self.GetAccountConnectionChannel(1000000000))
self.air.send(datagram)
# set sender channel to represent account affiliation
datagram = PyDatagram()
datagram.addServerHeader(sender, self.air.ourChannel, CLIENTAGENT_SET_CLIENT_ID)
datagram.addChannel(1000000000 << 32) # accountId is in high 32 bits, 0 in low (no avatar).
self.air.send(datagram)
# set client state to established, thus un-sandboxing the sender
self.air.setClientState(sender, 2)
# send dummy login response
import json
a = json.dumps({})
self.sendUpdateToChannel(sender, 'loginResponse', [a])

View file

@ -228,7 +228,7 @@ class MakeAToon(StateData.StateData):
self.spotlight.setHpr(0, 0, 0) self.spotlight.setHpr(0, 0, 0)
smokeSeqNode = SequenceNode('smoke') smokeSeqNode = SequenceNode('smoke')
smokeModel = loader.loadModel('phase_3/models/makeatoon/tt_m_ara_mat_smoke') smokeModel = loader.loadModel('phase_3/models/makeatoon/tt_m_ara_mat_smoke')
smokeFrameList = smokeModel.findAllMatches('**/smoke_*').asList() smokeFrameList = list(smokeModel.findAllMatches('**/smoke_*'))
smokeFrameList.reverse() smokeFrameList.reverse()
for smokeFrame in smokeFrameList: for smokeFrame in smokeFrameList:
smokeSeqNode.addChild(smokeFrame.node()) smokeSeqNode.addChild(smokeFrame.node())

View file

@ -5,7 +5,6 @@ import copy
from toontown.toonbase import ToontownGlobals from toontown.toonbase import ToontownGlobals
from toontown.toonbase import TTLocalizer from toontown.toonbase import TTLocalizer
import os import os
from direct.showbase import AppRunnerGlobal
from direct.directnotify import DirectNotifyGlobal from direct.directnotify import DirectNotifyGlobal
class NameGenerator: class NameGenerator:
@ -37,13 +36,8 @@ class NameGenerator:
self.lastSuffixes = [] self.lastSuffixes = []
self.nameDictionary = {} self.nameDictionary = {}
searchPath = DSearchPath() searchPath = DSearchPath()
if AppRunnerGlobal.appRunner: if __debug__:
searchPath.appendDirectory(Filename.expandFrom('$TT_3_ROOT/phase_3/etc')) searchPath.appendDirectory(Filename('resources/phase_3/etc'))
else:
searchPath.appendDirectory(Filename('phase_3/etc'))
base = os.path.expandvars('$TOONTOWN') or './toontown'
searchPath.appendDirectory(Filename.fromOsSpecific(os.path.expandvars(base + '/src/configfiles')))
searchPath.appendDirectory(Filename('.'))
filename = Filename(TTLocalizer.NameShopNameMaster) filename = Filename(TTLocalizer.NameShopNameMaster)
found = vfs.resolveFilename(filename, searchPath) found = vfs.resolveFilename(filename, searchPath)
if not found: if not found: