Panda3D
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Properties
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__
 
def announceGenerate
 
def delete
 
def disable
 
def doUpdate
 
def generate
 DistributedObject methods ###. More...
 
def handleClockError
 Automatic clock error handling ###. More...
 
def serverTime
 
def startTask
 Task management methods ###. More...
 
def stopTask
 
def synchronize
 Synchronization methods ###. More...
 
- Public Member Functions inherited from DistributedObject
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 execCommand
 
def flushCachedData
 
def generate
 
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 hasCachedData
 
def isDisabled
 
def isGenerated
 
def isGridParent
 
def isLocal
 
def postGenerateMessage
 
def removeInterest
 
def sendDeleteMsg
 
def sendDisableMsg
 
def sendUpdate
 
def setBarrierData
 
def setCacheable
 
def setCachedData
 
def setLocation
 
def setNeverDisable
 
def status
 
def taskName
 
def uniqueName
 
def updateAllRequiredFields
 
def updateRequiredFields
 
def updateRequiredOtherFields
 
- Public Member Functions inherited from DistributedObjectBase
def __init__
 
def getLocation
 
def getParentObj
 
def handleChildArrive
 
def handleChildArriveZone
 
def handleChildLeave
 
def handleChildLeaveZone
 
def handleQueryObjectChildrenLocalDone
 
def hasParentingRules
 
def status
 
- Public Member Functions inherited from DirectObject
def __init__
 
def accept
 
def acceptOnce
 
def addTask
 
def detectLeaks
 
def doMethodLater
 
def getAllAccepting
 
def ignore
 
def ignoreAll
 
def isAccepting
 
def isIgnoring
 
def removeAllTasks
 
def removeTask
 

Public Attributes

 attemptCount
 
 lastAttempt
 
 nextContext
 
 start
 
 talkResult
 
 thisContext
 
- Public Attributes inherited from DistributedObject
 activeState
 
 cacheable
 
 cr
 
 dclass
 
 destroyDoStackTrace
 
 DistributedObject_deleted
 
 DistributedObject_initialized
 
 neverDisable
 
 parentId
 
 zoneId
 
- Public Attributes inherited from DistributedObjectBase
 children
 
 cr
 
 parentId
 
 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)
 
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)
 
- Static Public Attributes inherited from DistributedObject
int neverDisable = 0
 
tuple notify = directNotify.newCategory("DistributedObject")
 
- Static Public Attributes inherited from DistributedObjectBase
tuple notify = directNotify.newCategory("DistributedObjectBase")
 

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 
)

Member Function Documentation

def announceGenerate (   self)
def delete (   self)
This method is called when the DistributedObject is permanently
removed from the world and deleted from the cache.
def disable (   self)
This method is called when the DistributedObject is removed from
active duty and stored in a cache.
def doUpdate (   self,
  task 
)
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.
def handleClockError (   self)

Automatic clock error handling ###.

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 startTask (   self)

Task management methods ###.

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.

Member Data Documentation

attemptCount
tuple extraSkew = base.config.GetInt('time-manager-extra-skew', 0)
static
lastAttempt
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
nextContext
tuple notify = DirectNotifyGlobal.directNotify.newCategory("TimeManager")
static
tuple reportFrameRateInterval = base.config.GetDouble('report-frame-rate-interval', 300.0)
static
start
talkResult
thisContext
tuple updateFreq = base.config.GetFloat('time-manager-freq', 1800)
static