Poodletooth-iLand/toontown/catalog/CatalogManager.py

32 lines
1 KiB
Python
Raw Normal View History

2015-03-09 12:33:29 -05:00
from direct.distributed import DistributedObject
from direct.directnotify import DirectNotifyGlobal
2015-03-03 16:10:12 -06:00
2015-03-09 12:33:29 -05:00
class CatalogManager(DistributedObject.DistributedObject):
notify = DirectNotifyGlobal.directNotify.newCategory('CatalogManager')
2015-03-03 16:10:12 -06:00
neverDisable = 1
def __init__(self, cr):
2015-03-09 12:33:29 -05:00
DistributedObject.DistributedObject.__init__(self, cr)
2015-03-03 16:10:12 -06:00
def generate(self):
if base.cr.catalogManager != None:
base.cr.catalogManager.delete()
base.cr.catalogManager = self
2015-03-09 12:33:29 -05:00
DistributedObject.DistributedObject.generate(self)
2015-03-03 16:10:12 -06:00
if hasattr(base.localAvatar, 'catalogScheduleNextTime') and base.localAvatar.catalogScheduleNextTime == 0:
self.d_startCatalog()
2015-03-09 12:33:29 -05:00
return
2015-03-03 16:10:12 -06:00
def disable(self):
base.cr.catalogManager = None
2015-03-09 12:33:29 -05:00
DistributedObject.DistributedObject.disable(self)
return
2015-03-03 16:10:12 -06:00
def delete(self):
base.cr.catalogManager = None
2015-03-09 12:33:29 -05:00
DistributedObject.DistributedObject.delete(self)
return
2015-03-03 16:10:12 -06:00
def d_startCatalog(self):
2015-03-09 12:33:29 -05:00
self.sendUpdate('startCatalog', [])