store timeManager

This commit is contained in:
David Rose 2009-12-15 18:36:49 +00:00
parent 15e2d85115
commit c279dedce1
2 changed files with 6 additions and 0 deletions

View File

@ -63,6 +63,9 @@ class ClientRepositoryBase(ConnectionRepository):
# other.
self.relatedObjectMgr = RelatedObjectMgr.RelatedObjectMgr(self)
# This will be filled in when a TimeManager is created.
self.timeManager = None
# Keep track of how recently we last sent a heartbeat message.
# We want to keep these coming at heartbeatInterval seconds.
self.heartbeatInterval = base.config.GetDouble('heartbeat-interval', 10)

View File

@ -70,6 +70,7 @@ class TimeManager(DistributedObject.DistributedObject):
def announceGenerate(self):
DistributedObject.DistributedObject.announceGenerate(self)
self.cr.timeManager = self
self.synchronize("TimeManager.announceGenerate")
def disable(self):
@ -80,6 +81,8 @@ class TimeManager(DistributedObject.DistributedObject):
self.ignore('clock_error')
self.stopTask()
taskMgr.remove('frameRateMonitor')
if self.cr.timeManager is self:
self.cr.timeManager = None
DistributedObject.DistributedObject.disable(self)
def delete(self):