Panda3D
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
TimeManager Class Reference
Inheritance diagram for TimeManager:
DistributedObject DistributedObjectBase DirectObject

Public Member Functions

def __init__ (self, cr)
 
def announceGenerate (self)
 
def delete (self)
 
def disable (self)
 
def doUpdate (self, task)
 
def generate (self)
 DistributedObject methods ###. More...
 
def handleClockError (self)
 Automatic clock error handling ###. More...
 
def serverTime (self, context, timestamp)
 
def startTask (self)
 Task management methods ###. More...
 
def stopTask (self)
 
def synchronize (self, description)
 Synchronization methods ###. More...
 
- Public Member Functions inherited from DistributedObject
def addInterest (self, zoneId, note="", event=None)
 
def b_setLocation (self, parentId, zoneId)
 
def d_setLocation (self, parentId, zoneId)
 
def deleteOrDelay (self)
 
def disableAndAnnounce (self)
 
def disableAnnounceAndDelete (self)
 
def doCallbackContext (self, context, args)
 
def doneBarrier (self, name=None)
 
def execCommand (self, string, mwMgrId, avId, zoneId)
 
def flushCachedData (self, name)
 
def generateInit (self)
 
def getAutoInterests (self)
 
def getBarrierData (self)
 
def getCacheable (self)
 
def getCachedData (self, name)
 
def getCallback (self, context)
 
def getCallbackArgs (self, context)
 
def getCallbackContext (self, callback, extraArgs=[])
 
def getCurrentContexts (self)
 
def getDelayDeleteCount (self)
 
def getDelayDeleteEvent (self)
 
def getDisableEvent (self)
 
def getDoId (self)
 
def getLocation (self)
 
def getNeverDisable (self)
 
def getParentObj (self)
 
def hasCachedData (self, name)
 
def isDisabled (self)
 
def isGenerated (self)
 
def isGridParent (self)
 
def isLocal (self)
 
def postGenerateMessage (self)
 
def removeInterest (self, handle, event=None)
 
def sendDeleteMsg (self)
 
def sendDisableMsg (self)
 
def sendUpdate (self, fieldName, args=[], sendToId=None)
 
def setBarrierData (self, data)
 
def setCacheable (self, bool)
 
def setCachedData (self, name, data)
 
def setLocation (self, parentId, zoneId)
 
def setNeverDisable (self, bool)
 
def status (self, indent=0)
 
def taskName (self, taskString)
 
def uniqueName (self, idString)
 
def updateAllRequiredFields (self, dclass, di)
 
def updateRequiredFields (self, dclass, di)
 
def updateRequiredOtherFields (self, dclass, di)
 
- Public Member Functions inherited from DistributedObjectBase
def handleChildArrive (self, childObj, zoneId)
 
def handleChildArriveZone (self, childObj, zoneId)
 
def handleChildLeave (self, childObj, zoneId)
 
def handleChildLeaveZone (self, childObj, zoneId)
 
def handleQueryObjectChildrenLocalDone (self, context)
 
def hasParentingRules (self)
 
- Public Member Functions inherited from DirectObject
def __init__ (self)
 
def accept (self, event, method, extraArgs=[])
 
def acceptOnce (self, event, method, extraArgs=[])
 
def addTask (self, *args, **kwargs)
 
def detectLeaks (self)
 
def doMethodLater (self, *args, **kwargs)
 
def getAllAccepting (self)
 
def ignore (self, event)
 
def ignoreAll (self)
 
def isAccepting (self, event)
 
def isIgnoring (self, event)
 
def removeAllTasks (self)
 
def removeTask (self, taskOrName)
 

Public Attributes

 attemptCount
 
 lastAttempt
 
 nextContext
 
 start
 
 talkResult
 
 thisContext
 
- Public Attributes inherited from DistributedObject
 activeState
 
 autoInterests
 
 cacheable
 
 cr
 
 dclass
 
 destroyDoStackTrace
 
 DistributedObject_deleted
 
 DistributedObject_initialized
 
 neverDisable
 
 parentId
 
 zoneId
 
- Public Attributes inherited from DistributedObjectBase
 cr
 
 parentId
 
 zoneId
 

Static Public Attributes

 extraSkew = ConfigVariableInt('time-manager-extra-skew', 0).getValue()
 
 maxAttempts = ConfigVariableInt('time-manager-max-attempts', 5).getValue()
 
 maxUncertainty = ConfigVariableDouble('time-manager-max-uncertainty', 1).getValue()
 
 minWait = ConfigVariableDouble('time-manager-min-wait', 10).getValue()
 
 notify = DirectNotifyGlobal.directNotify.newCategory("TimeManager")
 
 reportFrameRateInterval = ConfigVariableDouble('report-frame-rate-interval', 300.0).getValue()
 
 updateFreq = ConfigVariableDouble('time-manager-freq', 1800).getValue()
 
- Static Public Attributes inherited from DistributedObject
int neverDisable = 0
 
 notify = directNotify.newCategory("DistributedObject")
 
- Static Public Attributes inherited from DistributedObjectBase
 notify = directNotify.newCategory("DistributedObjectBase")
 
- Static Public Attributes inherited from DirectObject
def accept_once = acceptOnce
 
def add_task = addTask
 
def detect_leaks = detectLeaks
 
def do_method_later = doMethodLater
 
def get_all_accepting = getAllAccepting
 
def ignore_all = ignoreAll
 
def is_accepting = isAccepting
 
def is_ignoring = isIgnoring
 
def remove_all_tasks = removeAllTasks
 
def remove_task = removeTask
 

Detailed Description

This DistributedObject lives on the AI and on the client side, and
serves to synchronize the time between them so they both agree, to
within a few hundred milliseconds at least, what time it is.

It uses a pull model where the client can request a
synchronization check from time to time.  It also employs a
round-trip measurement to minimize the effect of latency.

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self,
  cr 
)

Reimplemented from DistributedObject.

Member Function Documentation

◆ announceGenerate()

def announceGenerate (   self)
Sends a message to the world after the object has been
generated and all of its required fields filled in.

Reimplemented from DistributedObject.

◆ delete()

def delete (   self)
This method is called when the DistributedObject is permanently
removed from the world and deleted from the cache.

Reimplemented from DistributedObject.

◆ disable()

def disable (   self)
This method is called when the DistributedObject is removed from
active duty and stored in a cache.

Reimplemented from DistributedObject.

◆ doUpdate()

def doUpdate (   self,
  task 
)

◆ generate()

def generate (   self)

DistributedObject methods ###.

This method is called when the DistributedObject is reintroduced
to the world, either for the first time or from the cache.

Reimplemented from DistributedObject.

◆ handleClockError()

def handleClockError (   self)

Automatic clock error handling ###.

◆ serverTime()

def serverTime (   self,
  context,
  timestamp 
)
serverTime(self, int8 context, int32 timestamp)

This message is sent from the AI to the client in response to
a previous requestServerTime.  It contains the time as
observed by the AI.

The client should use this, in conjunction with the time
measurement taken before calling requestServerTime (above), to
determine the clock delta between the AI and the client
machines.

◆ startTask()

def startTask (   self)

Task management methods ###.

◆ stopTask()

def stopTask (   self)

◆ synchronize()

def synchronize (   self,
  description 
)

Synchronization methods ###.

synchronize(self, string description)

Call this function from time to time to synchronize watches
with the server.  This initiates a round-trip transaction;
when the transaction completes, the time will be synced.

The description is the string that will be written to the log
file regarding the reason for this synchronization attempt.

The return value is true if the attempt is made, or false if
it is too soon since the last attempt.

Member Data Documentation

◆ attemptCount

attemptCount

◆ extraSkew

extraSkew = ConfigVariableInt('time-manager-extra-skew', 0).getValue()
static

◆ lastAttempt

lastAttempt

◆ maxAttempts

maxAttempts = ConfigVariableInt('time-manager-max-attempts', 5).getValue()
static

◆ maxUncertainty

maxUncertainty = ConfigVariableDouble('time-manager-max-uncertainty', 1).getValue()
static

◆ minWait

minWait = ConfigVariableDouble('time-manager-min-wait', 10).getValue()
static

◆ nextContext

nextContext

◆ notify

notify = DirectNotifyGlobal.directNotify.newCategory("TimeManager")
static

◆ reportFrameRateInterval

reportFrameRateInterval = ConfigVariableDouble('report-frame-rate-interval', 300.0).getValue()
static

◆ start

start

◆ talkResult

talkResult

◆ thisContext

thisContext

◆ updateFreq

updateFreq = ConfigVariableDouble('time-manager-freq', 1800).getValue()
static