Panda3D
Public Member Functions | Public Attributes | Static Public Attributes

ClientRepositoryBase Class Reference

Inheritance diagram for ClientRepositoryBase:
OldClientRepository

List of all members.

Public Member Functions

def __init__
def allocateContext
def considerHeartbeat
def disableDoId
def doDeferredGenerate
def doGenerate
def flushGenerates
def generateWithRequiredFields
def generateWithRequiredOtherFields
def generateWithRequiredOtherFieldsOwner
def getObjectsOfClass
def getObjectsOfExactClass
def getServerDelta
def getServerTimeOfDay
def getTables
def getWorld
def handleDelete
def handleGoGetLost
def handleServerHeartbeat
def handleSystemMessage
def handleSystemMessageAknowledge
def handleUpdateField
def isLive
def isLocalId
def printDelayDeletes
def replaceMethod
def replayDeferredGenerate
def sendHeartbeatTask
def setDeferInterval
def setServerDelta
def specialName
 def queryObjectAll(self, doID, context=0): """ Get a one-time snapshot look at the object.
def startHeartbeat
def stopHeartbeat
def waitForNextHeartBeat

Public Attributes

 bootedIndex
 bootedText
 cache
 cacheOwner
 context
 dcSuffix
 deferInterval
 deferredDoIds
 deferredGenerates
 doDataCache
 heartbeatInterval
 heartbeatStarted
 lastGenerate
 lastHeartbeat
 noDefer
 parentMgr
 recorder
 relatedObjectMgr
 serverDelta
 specialNameNumber
 timeManager

Static Public Attributes

tuple notify = DirectNotifyGlobal.directNotify.newCategory("ClientRepositoryBase")

Detailed Description

This maintains a client-side connection with a Panda server.

This base class exists to collect the common code between
ClientRepository, which is the CMU-provided, open-source version
of the client repository code, and OTPClientRepository, which is
the VR Studio's implementation of the same.

Constructor & Destructor Documentation

def __init__ (   self,
  dcFileNames = None,
  dcSuffix = '',
  connectMethod = None,
  threadedNet = None 
)

Member Function Documentation

def allocateContext (   self)
def considerHeartbeat (   self)
Send a heartbeat message if we haven't sent one recently.
def disableDoId (   self,
  doId,
  ownerView = False 
)
def doDeferredGenerate (   self,
  task 
)
This is the task that generates an object on the deferred
queue. 
def doGenerate (   self,
  parentId,
  zoneId,
  classId,
  doId,
  di 
)
def flushGenerates (   self)
Forces all pending generates to be performed immediately. 
def generateWithRequiredFields (   self,
  dclass,
  doId,
  di,
  parentId,
  zoneId 
)
def generateWithRequiredOtherFields (   self,
  dclass,
  doId,
  di,
  parentId = None,
  zoneId = None 
)
def generateWithRequiredOtherFieldsOwner (   self,
  dclass,
  doId,
  di 
)
def getObjectsOfClass (   self,
  objClass 
)
returns dict of doId:object, containing all objects
that inherit from 'class'. returned dict is safely mutable. 
def getObjectsOfExactClass (   self,
  objClass 
)
returns dict of doId:object, containing all objects that
are exactly of type 'class' (neglecting inheritance). returned
dict is safely mutable. 
def getServerDelta (   self)
def getServerTimeOfDay (   self)
Returns the current time of day (seconds elapsed since the
1972 epoch) according to the server's clock.  This is in GMT,
and hence is irrespective of timezones.

The value is computed based on the client's clock and the
known delta from the server's clock, which is not terribly
precisely measured and may drift slightly after startup, but
it should be accurate plus or minus a couple of seconds.
def getTables (   self,
  ownerView 
)
def getWorld (   self,
  doId 
)
def handleDelete (   self,
  di 
)
def handleGoGetLost (   self,
  di 
)
def handleServerHeartbeat (   self,
  di 
)
def handleSystemMessage (   self,
  di 
)
def handleSystemMessageAknowledge (   self,
  di 
)
def handleUpdateField (   self,
  di 
)
This method is called when a CLIENT_OBJECT_UPDATE_FIELD
message is received; it decodes the update, unpacks the
arguments, and calls the corresponding method on the indicated
DistributedObject.

In fact, this method is exactly duplicated by the C++ method
cConnectionRepository::handle_update_field(), which was
written to optimize the message loop by handling all of the
CLIENT_OBJECT_UPDATE_FIELD messages in C++.  That means that
nowadays, this Python method will probably never be called,
since UPDATE_FIELD messages will not even be passed to the
Python message handlers.  But this method remains for
documentation purposes, and also as a "just in case" handler
in case we ever do come across a situation in the future in
which python might handle the UPDATE_FIELD message.
def isLive (   self)
def isLocalId (   self,
  id 
)

Reimplemented in OldClientRepository.

def printDelayDeletes (   self)
def replaceMethod (   self,
  oldMethod,
  newFunction 
)
def replayDeferredGenerate (   self,
  msgType,
  extra 
)
Override this to do something appropriate with deferred
"generate" messages when they are replayed().
def sendHeartbeatTask (   self,
  task 
)
def setDeferInterval (   self,
  deferInterval 
)
Specifies the minimum amount of time, in seconds, that must
elapse before generating any two DistributedObjects whose
class type is marked "deferrable".  Set this to 0 to indicate
no deferring will occur.
def setServerDelta (   self,
  delta 
)
Indicates the approximate difference in seconds between the
client's clock and the server's clock, in universal time (not
including timezone shifts).  This is mainly useful for
reporting synchronization information to the logs; don't
depend on it for any precise timing requirements.

Also see Notify.setServerDelta(), which also accounts for a
timezone shift.
def specialName (   self,
  label 
)

def queryObjectAll(self, doID, context=0): """ Get a one-time snapshot look at the object.

""" assert self.notify.debugStateCall(self) # Create a message datagram = PyDatagram() datagram.addServerHeader( doID, localAvatar.getDoId(), 2020) # A context that can be used to index the response if needed datagram.addUint32(context) self.send(datagram) # Make sure the message gets there. self.flush()

def startHeartbeat (   self)
def stopHeartbeat (   self)
def waitForNextHeartBeat (   self)

Member Data Documentation

tuple notify = DirectNotifyGlobal.directNotify.newCategory("ClientRepositoryBase") [static]

Reimplemented in OldClientRepository.

 All Classes Namespaces Functions Variables Properties