Panda3D
Public Member Functions | Public Attributes | Static Public Attributes

TimeManager Class Reference

Inheritance diagram for TimeManager:
DistributedObject

List of all members.

Public Member Functions

def __init__
def addInterest
def announceGenerate
def b_setLocation
def d_setLocation
def delete
def deleteOrDelay
def disable
def disableAndAnnounce
def disableAnnounceAndDelete
def doCallbackContext
def doneBarrier
def doUpdate
def execCommand
def flushCachedData
def generate
 DistributedObject methods ###.
def generateInit
def getAutoInterests
def getBarrierData
def getCacheable
def getCachedData
def getCallback
def getCallbackArgs
def getCallbackContext
def getCurrentContexts
def getDelayDeleteCount
def getDelayDeleteEvent
def getDisableEvent
def getDoId
def getLocation
def getNeverDisable
def getParentObj
def handleClockError
 Automatic clock error handling ###.
def hasCachedData
def isDisabled
def isGenerated
def isGridParent
def isLocal
def postGenerateMessage
def removeInterest
def sendDeleteMsg
def sendDisableMsg
def sendUpdate
def serverTime
def setBarrierData
def setCacheable
def setCachedData
def setLocation
def setNeverDisable
def startTask
 Task management methods ###.
def status
def stopTask
def synchronize
 Synchronization methods ###.
def taskName
def uniqueName
def updateAllRequiredFields
def updateRequiredFields
def updateRequiredOtherFields

Public Attributes

 activeState
 attemptCount
 cacheable
 cr
 dclass
 destroyDoStackTrace
 DistributedObject_deleted
 DistributedObject_initialized
 lastAttempt
 neverDisable
 nextContext
 parentId
 start
 talkResult
 thisContext
 zoneId

Static Public Attributes

tuple extraSkew = base.config.GetInt('time-manager-extra-skew', 0)
tuple maxAttempts = base.config.GetInt('time-manager-max-attempts', 5)
tuple maxUncertainty = base.config.GetFloat('time-manager-max-uncertainty', 1)
tuple minWait = base.config.GetFloat('time-manager-min-wait', 10)
int neverDisable = 0
tuple notify = DirectNotifyGlobal.directNotify.newCategory("TimeManager")
tuple reportFrameRateInterval = base.config.GetDouble('report-frame-rate-interval', 300.0)
tuple updateFreq = base.config.GetFloat('time-manager-freq', 1800)

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

def __init__ (   self,
  cr 
)

Reimplemented from DistributedObject.


Member Function Documentation

def addInterest (   self,
  zoneId,
  note = "",
  event = None 
) [inherited]
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.

def b_setLocation (   self,
  parentId,
  zoneId 
) [inherited]
def d_setLocation (   self,
  parentId,
  zoneId 
) [inherited]
def delete (   self)
This method is called when the DistributedObject is permanently
removed from the world and deleted from the cache.

Reimplemented from DistributedObject.

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

Reimplemented from DistributedObject.

def disableAndAnnounce (   self) [inherited]
Inheritors should *not* redefine this function.
def disableAnnounceAndDelete (   self) [inherited]
def doCallbackContext (   self,
  context,
  args 
) [inherited]
def doneBarrier (   self,
  name = None 
) [inherited]
def doUpdate (   self,
  task 
)
def execCommand (   self,
  string,
  mwMgrId,
  avId,
  zoneId 
) [inherited]
def flushCachedData (   self,
  name 
) [inherited]
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.

def generateInit (   self) [inherited]
This method is called when the DistributedObject is first introduced
to the world... Not when it is pulled from the cache.
def getAutoInterests (   self) [inherited]
def getBarrierData (   self) [inherited]
def getCacheable (   self) [inherited]
def getCachedData (   self,
  name 
) [inherited]
def getCallback (   self,
  context 
) [inherited]
def getCallbackArgs (   self,
  context 
) [inherited]
def getCallbackContext (   self,
  callback,
  extraArgs = [] 
) [inherited]
def getCurrentContexts (   self) [inherited]
def getDelayDeleteCount (   self) [inherited]
def getDelayDeleteEvent (   self) [inherited]
def getDisableEvent (   self) [inherited]
def getDoId (   self) [inherited]
Return the distributed object id
def getLocation (   self) [inherited]
def getNeverDisable (   self) [inherited]
def getParentObj (   self) [inherited]
def handleClockError (   self)

Automatic clock error handling ###.

def hasCachedData (   self,
  name 
) [inherited]
def isDisabled (   self) [inherited]
Returns true if the object has been disabled and/or deleted,
or if it is brand new and hasn't yet been generated.
def isGenerated (   self) [inherited]
Returns true if the object has been fully generated by now,
and not yet disabled.
def isGridParent (   self) [inherited]
def isLocal (   self) [inherited]
def postGenerateMessage (   self) [inherited]
def removeInterest (   self,
  handle,
  event = None 
) [inherited]
def sendDeleteMsg (   self) [inherited]
def sendDisableMsg (   self) [inherited]
def sendUpdate (   self,
  fieldName,
  args = [],
  sendToId = None 
) [inherited]
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.
def setBarrierData (   self,
  data 
) [inherited]
def setCacheable (   self,
  bool 
) [inherited]
def setCachedData (   self,
  name,
  data 
) [inherited]
def setLocation (   self,
  parentId,
  zoneId 
) [inherited]
def setNeverDisable (   self,
  bool 
) [inherited]
def startTask (   self)

Task management methods ###.

def status (   self,
  indent = 0 
) [inherited]
print out "doId(parentId, zoneId) className
    and conditionally show generated, disabled, neverDisable,
    or cachable"
def stopTask (   self)
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.
def taskName (   self,
  taskString 
) [inherited]
def uniqueName (   self,
  idString 
) [inherited]
def updateAllRequiredFields (   self,
  dclass,
  di 
) [inherited]
def updateRequiredFields (   self,
  dclass,
  di 
) [inherited]
def updateRequiredOtherFields (   self,
  dclass,
  di 
) [inherited]

Member Data Documentation

activeState [inherited]
cacheable [inherited]
cr [inherited]
dclass [inherited]
destroyDoStackTrace [inherited]
tuple extraSkew = base.config.GetInt('time-manager-extra-skew', 0) [static]
tuple maxAttempts = base.config.GetInt('time-manager-max-attempts', 5) [static]
tuple maxUncertainty = base.config.GetFloat('time-manager-max-uncertainty', 1) [static]
tuple minWait = base.config.GetFloat('time-manager-min-wait', 10) [static]
neverDisable [inherited]
int neverDisable = 0 [static, inherited]
tuple notify = DirectNotifyGlobal.directNotify.newCategory("TimeManager") [static]

Reimplemented from DistributedObject.

parentId [inherited]
tuple reportFrameRateInterval = base.config.GetDouble('report-frame-rate-interval', 300.0) [static]
tuple updateFreq = base.config.GetFloat('time-manager-freq', 1800) [static]
zoneId [inherited]
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties