ClientRepository

Inheritance:

Methods of ClientRepository:

Methods of ConnectionRepository:

Methods of CConnectionRepository:

Methods of DoInterestManager:

Methods of DoCollectionManager:

__init__
def __init__(self, dcFileNames=None)

Undocumented function.

abruptCleanup
def abruptCleanup(self)

Call this method to clean up any pending hooks or tasks on distributed objects, but leave the ClientRepository in a sane state for creating more distributed objects.

allocateContext
def allocateContext(self)

Undocumented function.

considerHeartbeat
def considerHeartbeat(self)

Send a heartbeat message if we haven't sent one recently.

createWithRequired
def createWithRequired(self, className, zoneId=0, optionalFields=None)

Undocumented function.

disableDoId
def disableDoId(self, doId, ownerView=False)

Undocumented function.

generateWithRequiredFields
def generateWithRequiredFields(self, dclass, doId, di, parentId, zoneId)

Undocumented function.

generateWithRequiredOtherFields
def generateWithRequiredOtherFields(self, dclass, doId, di, parentId=None, zoneId=None)

Undocumented function.

generateWithRequiredOtherFieldsOwner
def generateWithRequiredOtherFieldsOwner(self, dclass, doId, di)

Undocumented function.

getObjectsOfClass
def getObjectsOfClass(self, objClass)

returns dict of doId:object, containing all objects that inherit from 'class'. returned dict is safely mutable.

getObjectsOfExactClass
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.

getServerDelta
def getServerDelta(self)

Undocumented function.

getServerTimeOfDay
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.

getTables
def getTables(self, ownerView)

Undocumented function.

getWorld
def getWorld(self, doId)

Undocumented function.

handleDatagram
def handleDatagram(self, di)

Undocumented function.

handleDelete
def handleDelete(self, di)

Undocumented function.

handleDisable
def handleDisable(self, di, ownerView=False)

Undocumented function.

handleGenerateWithRequired
def handleGenerateWithRequired(self, di)

Undocumented function.

handleGenerateWithRequiredOther
def handleGenerateWithRequiredOther(self, di)

Undocumented function.

handleGenerateWithRequiredOtherOwner
def handleGenerateWithRequiredOtherOwner(self, di)

Undocumented function.

handleGoGetLost
def handleGoGetLost(self, di)

Undocumented function.

handleMessageType
def handleMessageType(self, msgType, di)

Undocumented function.

handleQuietZoneGenerateWithRequired
def handleQuietZoneGenerateWithRequired(self, di)

Undocumented function.

handleQuietZoneGenerateWithRequiredOther
def handleQuietZoneGenerateWithRequiredOther(self, di)

Undocumented function.

handleRequestGenerates
def handleRequestGenerates(self, di)

Undocumented function.

handleServerHeartbeat
def handleServerHeartbeat(self, di)

Undocumented function.

handleSetDOIDrange
def handleSetDOIDrange(self, di)

Undocumented function.

handleSystemMessage
def handleSystemMessage(self, di)

Undocumented function.

handleUpdateField
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.

haveCreateAuthority
def haveCreateAuthority(self)

Undocumented function.

isLocalId
def isLocalId(self, id)

Undocumented function.

publicServerDatagramHandler
def publicServerDatagramHandler(self, msgType, di)

Undocumented function.

replaceMethod
def replaceMethod(self, oldMethod, newFunction)

Undocumented function.

sendDeleteMsg
def sendDeleteMsg(self, doId)

Undocumented function.

sendDisableMsg
def sendDisableMsg(self, doId)

Undocumented function.

sendDisconnect
def sendDisconnect(self)

Undocumented function.

sendHeartbeat
def sendHeartbeat(self)

Undocumented function.

sendHeartbeatTask
def sendHeartbeatTask(self, task)

Undocumented function.

sendRemoveZoneMsg
def sendRemoveZoneMsg(self, zoneId, visibleZoneList=None)

Undocumented function.

sendSetLocation
def sendSetLocation(self, doId, parentId, zoneId)

Undocumented function.

sendUpdateZone
def sendUpdateZone(self, obj, zoneId)

Undocumented function.

setServerDelta
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.

startHeartbeat
def startHeartbeat(self)

Undocumented function.

stopHeartbeat
def stopHeartbeat(self)

Undocumented function.

uniqueName
def uniqueName(self, desc)

Undocumented function.

waitForNextHeartBeat
def waitForNextHeartBeat(self)

Undocumented function.

__init__
def __init__(self, config, hasOwnerView=False)

Undocumented function.

checkHttp
def checkHttp(self)

Undocumented function.

connect
def connect(self, serverList, successCallback=None, successArgs=[], failureCallback=None, failureArgs=[])

Attempts to establish a connection to the server. May return before the connection is established. The two callbacks represent the two functions to call (and their arguments) on success or failure, respectively. The failure callback also gets one additional parameter, which will be passed in first: the return status code giving reason for failure, if it is known.

disconnect
def disconnect(self)

Closes the previously-established connection.

generateGlobalObject
def generateGlobalObject(self, doId, dcname, values=None)

Undocumented function.

handleDatagram
def handleDatagram(self, di)

Undocumented function.

handleReaderOverflow
def handleReaderOverflow(self)

Undocumented function.

httpConnectCallback
def httpConnectCallback(self, ch, serverList, serverIndex, successCallback, successArgs, failureCallback, failureArgs)

Undocumented function.

importModule
def importModule(self, dcImports, moduleName, importSymbols)

Imports the indicated moduleName and all of its symbols into the current namespace. This more-or-less reimplements the Python import command.

lostConnection
def lostConnection(self)

Undocumented function.

networkPlugPulled
def networkPlugPulled(self)

Undocumented function.

pullNetworkPlug
def pullNetworkPlug(self)

Undocumented function.

readDCFile
def readDCFile(self, dcFileNames=None)

Reads in the dc files listed in dcFileNames, or if dcFileNames is None, reads in all of the dc files listed in the Configrc file.

readerPollOnce
def readerPollOnce(self)

Undocumented function.

readerPollUntilEmpty
def readerPollUntilEmpty(self, task)

Undocumented function.

restoreNetworkPlug
def restoreNetworkPlug(self)

Undocumented function.

send
def send(self, datagram)

Undocumented function.

startReaderPollTask
def startReaderPollTask(self)

Undocumented function.

stopReaderPollTask
def stopReaderPollTask(self)

Undocumented function.

checkDatagram
bool CConnectionRepository::check_datagram(void);

SIMULATE_NETWORK_DELAY
Description: Returns true if a new datagram is available, false otherwise. If the return value is true, the new datagram may be retrieved via get_datagram(), or preferably, with get_datagram_iterator() and get_msg_type().

considerFlush
bool CConnectionRepository::consider_flush(void);

Description: Sends the most recently queued data if enough time has elapsed. This only has meaning if set_collect_tcp() has been set to true.

disconnect
void CConnectionRepository::disconnect(void);

Description: Closes the connection to the server.

flush
bool CConnectionRepository::flush(void);

Description: Sends the most recently queued data now. This only has meaning if set_collect_tcp() has been set to true.

getClientDatagram
bool CConnectionRepository::get_client_datagram(void) const;

Description: Returns the client_datagram flag.

getCw
ConnectionWriter &CConnectionRepository::get_cw(void);

Description: Returns the ConnectionWriter object associated with the repository.

getDatagram
void CConnectionRepository::get_datagram(Datagram &dg);

HAVE_NSPR
Description: Fills the datagram object with the datagram most recently retrieved by check_datagram().

getDatagramIterator
void CConnectionRepository::get_datagram_iterator(DatagramIterator &di);

Description: Fills the DatagramIterator object with the iterator for the datagram most recently retrieved by check_datagram(). This iterator has already read past the datagram header and the message type, and is positioned at the beginning of data.

getDcFile
DCFile &CConnectionRepository::get_dc_file(void);

Filename: cConnectionRepository.I Created by: drose (17May04)
PANDA 3D SOFTWARE Copyright (c) 2001 - 2004, Disney Enterprises, Inc. All rights reserved
All use of this software is subject to the terms of the Panda 3d Software license. You should have received a copy of this license along with this source code; you will also find a current copy of the license at http://etc.cmu.edu/panda3d/docs/license/ .
To contact the maintainers of this program write to panda3d-general@lists.sourceforge.net .
Description: Returns the DCFile object associated with this repository.

getMsgChannel
unsigned __int64 CConnectionRepository::get_msg_channel(int offset = (0)) const;

Description: Returns the channel from which the current message was sent, according to the datagram headers. This information is not available to the client.

getMsgChannelCount
int CConnectionRepository::get_msg_channel_count(void) const;

Undocumented function.

getMsgSender
unsigned __int64 CConnectionRepository::get_msg_sender(void) const;

Description: Returns the sender ID of the current message, according to the datagram headers. This information is not available to the client.

getMsgType
unsigned int CConnectionRepository::get_msg_type(void) const;

INLINE unsigned char get_sec_code() const;
Description: Returns the security code associated with the current message, according to the datagram headers. This information is not available to the client.
INLINE unsigned char CConnectionRepository:: get_sec_code() const { return _sec_code; }
Description: Returns the type ID of the current message, according to the datagram headers.

getOverflowEventName
static string const &CConnectionRepository::get_overflow_event_name(void);

Description: Returns event string that will be thrown if the datagram reader queue overflows.

getQcm
QueuedConnectionManager &CConnectionRepository::get_qcm(void);

Description: Returns the QueuedConnectionManager object associated with the repository.

getQcr
QueuedConnectionReader &CConnectionRepository::get_qcr(void);

Description: Returns the QueuedConnectionReader object associated with the repository.

getSimulatedDisconnect
bool CConnectionRepository::get_simulated_disconnect(void) const;

Description: Returns the simulated disconnect flag. While this is true, no datagrams will be retrieved from or sent to the server. The idea is to simulate a temporary network outage.

getStream
SocketStream *CConnectionRepository::get_stream(void);

Description: Returns the SocketStream that internally represents the already-established HTTP connection. Returns NULL if there is no current HTTP connection.

getVerbose
bool CConnectionRepository::get_verbose(void) const;

Description: Returns the current setting of the verbose flag. When true, this describes every message going back and forth on the wire.

hasOwnerView
bool CConnectionRepository::has_owner_view(void) const;

Description: Returns true if this repository can have 'owner' views of distributed objects.

isConnected
bool CConnectionRepository::is_connected(void);

Description: Returns true if the connection to the gameserver is established and still good, false if we are not connected. A false value means either (a) we never successfully connected, (b) we explicitly called disconnect(), or (c) we were connected, but the connection was spontaneously lost.

sendDatagram
bool CConnectionRepository::send_datagram(Datagram const &dg);

Description: Queues the indicated datagram for sending to the server. It may not get send immediately if collect_tcp is in effect; call flush() to guarantee it is sent now.

setClientDatagram
void CConnectionRepository::set_client_datagram(bool client_datagram);

Description: Sets the client_datagram flag. If this is true, incoming datagrams are not expected to be prefixed with the server routing information like message sender, channel number, etc.; otherwise, these server fields are parsed and removed from each incoming datagram.

setConnectionHttp
void CConnectionRepository::set_connection_http(HTTPChannel *channel);

Description: Once a connection has been established via the HTTP interface, gets the connection and uses it. The supplied HTTPChannel object must have a connection available via get_connection().

setPythonRepository
void CConnectionRepository::set_python_repository(PyObject *python_repository);

Description: Records the pointer to the Python class that derives from CConnectionRepository. This allows the C++ implementation to directly manipulation some python structures on the repository.

setSimulatedDisconnect
void CConnectionRepository::set_simulated_disconnect(bool simulated_disconnect);

Description: Sets the simulated disconnect flag. While this is true, no datagrams will be retrieved from or sent to the server. The idea is to simulate a temporary network outage.

setVerbose
void CConnectionRepository::set_verbose(bool verbose);

Description: Directly sets the verbose flag. When true, this describes every message going back and forth on the wire.

toggleVerbose
void CConnectionRepository::toggle_verbose(void);

Description: Toggles the current setting of the verbose flag. When true, this describes every message going back and forth on the wire.

tryConnectNspr
bool CConnectionRepository::try_connect_nspr(URLSpec const &url);

Description: Uses NSPR to try to connect to the server and port named in the indicated URL. Returns true if successful, false otherwise.

__init__
def __init__(self)

Undocumented function.

_considerRemoveInterest
def _considerRemoveInterest(self, handle)

Consider whether we should cull the interest set.

_getNextHandle
def _getNextHandle(self)

Undocumented function.

_getNextScopeId
def _getNextScopeId(self)

Undocumented function.

_sendAddInterest
def _sendAddInterest(self, handle, scopeId, parentId, zoneIdList)

Part of the new otp-server code.
handle is a client-side created number that refers to a set of interests. The same handle number doesn't necessarily have any relationship to the same handle on another client.

_sendRemoveInterest
def _sendRemoveInterest(self, handle, scopeId)

handle is a client-side created number that refers to a set of interests. The same handle number doesn't necessarily have any relationship to the same handle on another client.

addInterest
def addInterest(self, parentId, zoneIdList, description, event=None)

Look into a (set of) zone(s).

alterInterest
def alterInterest(self, handle, parentId, zoneIdList, description=None, event=None)

Removes old interests and adds new interests.
Note that when an interest is changed, only the most recent change's event will be triggered. Previous events are abandoned. If this is a problem, consider opening multiple interests.

handleInterestDoneMessage
def handleInterestDoneMessage(self, di)

This handles the interest done messages and may dispatch an event

removeInterest
def removeInterest(self, handle, event=None)

Stop looking in a (set of) zone(s)

__init__
def __init__(self)

Undocumented function.

addDOToTables
def addDOToTables(self, do, location=None, ownerView=False)

Undocumented function.

changeDOZoneInTables
def changeDOZoneInTables(self, do, newParentId, newZoneId, oldParentId, oldZoneId)

Undocumented function.

countObjects
def countObjects(self, classType)

Counts the number of objects of the given type in the repository (for testing purposes)

deleteDistributedObjects
def deleteDistributedObjects(self)

Undocumented function.

deleteObjectLocation
def deleteObjectLocation(self, objId, parentId, zoneId)

Undocumented function.

doFind
def doFind(self, str)

Returns list of distributed objects with matching str in value.

doFindAll
def doFindAll(self, str)

Returns list of distributed objects with matching str in value.

findAnyOfType
def findAnyOfType(self, type)

Undocumented function.

getAllOfType
def getAllOfType(self, type)

Undocumented function.

getDo
def getDo(self, doId)

Undocumented function.

getDoHierarchy
def getDoHierarchy(self)

Undocumented function.

getDoIdList
def getDoIdList(self, parentId, zoneId=None, classType=None)

parentId is any distributed object id. zoneId is a uint32, defaults to None (all zones). Try zone 2 if you're not sure which zone to use (0 is a bad/null zone and 1 has had reserved use in the past as a no messages zone, while 2 has traditionally been a global, uber, misc stuff zone). dclassType is a distributed class type filter, defaults to None (no filter).
If dclassName is None then all objects in the zone are returned; otherwise the list is filtered to only include objects of that type.

getDoList
def getDoList(self, parentId, zoneId=None, classType=None)

parentId is any distributed object id. zoneId is a uint32, defaults to None (all zones). Try zone 2 if you're not sure which zone to use (0 is a bad/null zone and 1 has had reserved use in the past as a no messages zone, while 2 has traditionally been a global, uber, misc stuff zone). dclassType is a distributed class type filter, defaults to None (no filter).
If dclassName is None then all objects in the zone are returned; otherwise the list is filtered to only include objects of that type.

getDoTable
def getDoTable(self, ownerView)

Undocumented function.

getObjectsInZone
def getObjectsInZone(self, location)

call this to get a dict of doId:distObj for a zone. Creates a shallow copy, so you can do whatever you want with the dict.

getObjectsOfClassInZone
def getObjectsOfClassInZone(self, location, objClass)

returns dict of doId:object for a zone, containing all objects that inherit from 'class'. returned dict is safely mutable.

getOwnerView
def getOwnerView(self, doId)

Undocumented function.

handleObjectLocation
def handleObjectLocation(self, di)

Undocumented function.

handleSetLocation
def handleSetLocation(self, di)

Undocumented function.

isValidLocationTuple
def isValidLocationTuple(self, location)

Undocumented function.

removeDOFromTables
def removeDOFromTables(self, do)

Undocumented function.

storeObjectLocation
def storeObjectLocation(self, doId, parentId, zoneId)

Undocumented function.