oldschool-toontown/toontown/uberdog/ToontownUDRepository.py

31 lines
1.2 KiB
Python
Raw Normal View History

2019-11-08 21:20:04 -06:00
from direct.directnotify import DirectNotifyGlobal
from toontown.distributed.ToontownInternalRepository import ToontownInternalRepository
from otp.distributed.DistributedDirectoryAI import DistributedDirectoryAI
2019-11-08 22:55:55 -06:00
from otp.distributed.OtpDoGlobals import *
2019-11-08 21:20:04 -06:00
# TODO: Remove Astron dependence.
class ToontownUDRepository(ToontownInternalRepository):
def __init__(self, baseChannel, serverId):
ToontownInternalRepository.__init__(self, baseChannel, serverId, dcSuffix='UD')
self.astronLoginManager = None
def handleConnected(self):
ToontownInternalRepository.handleConnected(self)
# Create our root object.
self.notify.info('Creating root object (%d)...' % self.getGameDoId())
rootObj = DistributedDirectoryAI(self)
rootObj.generateWithRequiredAndId(self.getGameDoId(), 0, 0)
# Create our global objects.
self.notify.info('Creating global objects...')
self.createGlobals()
self.notify.info('UberDOG server is ready.')
def createGlobals(self):
# Create our Astron login manager...
self.astronLoginManager = self.generateGlobalObject(OTP_DO_ID_ASTRON_LOGIN_MANAGER, 'AstronLoginManager')