|
Panda3D
|
Classes | |
| class | Client |
| class | Object |
Public Member Functions | |
| __init__ (self, tcpPort, serverAddress=None, udpPort=None, dcFileNames=None, threadedNet=None) | |
| clientHardDisconnectTask (self, task) | |
| flushTask (self, task) | |
| getDoIdBase (self, doId) | |
| getTcpHeaderSize (self) | |
| handleClientCreateObject (self, datagram, dgi) | |
| handleClientDeleteObject (self, datagram, doId) | |
| handleClientDisconnect (self, client) | |
| handleClientObjectSetZone (self, datagram, dgi) | |
| handleClientObjectUpdateField (self, datagram, dgi, targeted=False) | |
| handleClientSetInterest (self, client, dgi) | |
| handleDatagram (self, datagram) | |
| handleMessageType (self, msgType, di) | |
| importModule (self, dcImports, moduleName, importSymbols) | |
| listenerPoll (self, task) | |
| readDCFile (self, dcFileNames=None) | |
| readerPollOnce (self) | |
| readerPollUntilEmpty (self, task) | |
| sendDoIdRange (self, client) | |
| sendToAllExcept (self, datagram, exceptionList) | |
| sendToZoneExcept (self, zoneId, datagram, exceptionList) | |
| setObjectZone (self, owner, object, zoneId) | |
| setTcpHeaderSize (self, headerSize) | |
| updateClientInterestZones (self, client) | |
Public Attributes | |
| clientHardDisconnectTask | |
| dict | clientsByConnection = {} |
| dict | clientsByDoIdBase = {} |
| cw = ConnectionWriter(self.qcm, numThreads) | |
| dcFile = DCFile() | |
| dict | dclassesByName = {} |
| dict | dclassesByNumber = {} |
| str | dcSuffix = '' |
| doIdRange = base.config.GetInt('server-doid-range', 1000000) | |
| flushTask = ConfigVariableDouble('collect-tcp-interval').getValue() | |
| int | hashVal = 0 |
| idAllocator = UniqueIdAllocator(0, 0xffffffff // self.doIdRange) | |
| lastConnection = newConnection | |
| listenerPoll | |
| needsFlush = set() | |
| dict | objectsByZoneId = {} |
| qcl = QueuedConnectionListener(self.qcm, numThreads) | |
| qcm = QueuedConnectionManager() | |
| qcr = QueuedConnectionReader(self.qcm, numThreads) | |
| readerPollUntilEmpty | |
| tcpRendezvous | |
| dict | zonesToClients = {} |
Static Public Attributes | |
| notify = DirectNotifyGlobal.directNotify.newCategory("ServerRepository") | |
This maintains the server-side connection with a Panda server. It is only for use with the Panda LAN server provided by CMU.
| __init__ | ( | self, | |
| tcpPort, | |||
| serverAddress = None, | |||
| udpPort = None, | |||
| dcFileNames = None, | |||
| threadedNet = None ) |
| clientHardDisconnectTask | ( | self, | |
| task ) |
client did not tell us he was leaving but we lost connection to him, so we need to update our data and tell others
| flushTask | ( | self, | |
| task ) |
This task is run periodically to flush any connections that might need it. It's only necessary in cases where collect-tcp is set true (if this is false, messages are sent immediately and do not require periodic flushing).
| getDoIdBase | ( | self, | |
| doId ) |
Given a doId, return the corresponding doIdBase. This will be the owner of the object (clients may only create object doId's within their assigned range).
| getTcpHeaderSize | ( | self | ) |
Returns the current setting of TCP header size. See setTcpHeaderSize().
| handleClientCreateObject | ( | self, | |
| datagram, | |||
| dgi ) |
client wants to create an object, so we store appropriate data, and then pass message along to corresponding zones
| handleClientDeleteObject | ( | self, | |
| datagram, | |||
| doId ) |
client deletes an object, let everyone who has interest in the object's zone know about it.
| handleClientDisconnect | ( | self, | |
| client ) |
| handleClientObjectSetZone | ( | self, | |
| datagram, | |||
| dgi ) |
The client is telling us the object is changing to a new zone.
| handleClientObjectUpdateField | ( | self, | |
| datagram, | |||
| dgi, | |||
| targeted = False ) |
Received an update request from a client.
| handleClientSetInterest | ( | self, | |
| client, | |||
| dgi ) |
The client is specifying a particular set of zones it is interested in.
| handleDatagram | ( | self, | |
| datagram ) |
switching station for messages
| handleMessageType | ( | self, | |
| msgType, | |||
| di ) |
| 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.
| listenerPoll | ( | self, | |
| task ) |
| 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 | ( | self | ) |
checks for available messages to the server
| readerPollUntilEmpty | ( | self, | |
| task ) |
continuously polls for new messages on the server
| sendDoIdRange | ( | self, | |
| client ) |
sends the client the range of doid's that the client can use
| sendToAllExcept | ( | self, | |
| datagram, | |||
| exceptionList ) |
sends a message to all connected clients, except for clients on exceptionList.
| sendToZoneExcept | ( | self, | |
| zoneId, | |||
| datagram, | |||
| exceptionList ) |
sends a message to everyone who has interest in the indicated zone, except for the clients on exceptionList.
| setObjectZone | ( | self, | |
| owner, | |||
| object, | |||
| zoneId ) |
| setTcpHeaderSize | ( | self, | |
| headerSize ) |
Sets the header size of TCP packets. At the present, legal values for this are 0, 2, or 4; this specifies the number of bytes to use encode the datagram length at the start of each TCP datagram. Sender and receiver must independently agree on this.
| updateClientInterestZones | ( | self, | |
| client ) |
Something about the client has caused its set of interest zones to potentially change. Recompute them.
| clientHardDisconnectTask |
| dict clientsByConnection = {} |
| dict clientsByDoIdBase = {} |
| cw = ConnectionWriter(self.qcm, numThreads) |
| dcFile = DCFile() |
| dict dclassesByName = {} |
| dict dclassesByNumber = {} |
| str dcSuffix = '' |
| doIdRange = base.config.GetInt('server-doid-range', 1000000) |
| flushTask = ConfigVariableDouble('collect-tcp-interval').getValue() |
| int hashVal = 0 |
| idAllocator = UniqueIdAllocator(0, 0xffffffff // self.doIdRange) |
| lastConnection = newConnection |
| listenerPoll |
| needsFlush = set() |
|
static |
| dict objectsByZoneId = {} |
| qcl = QueuedConnectionListener(self.qcm, numThreads) |
| qcm = QueuedConnectionManager() |
| qcr = QueuedConnectionReader(self.qcm, numThreads) |
| readerPollUntilEmpty |
| tcpRendezvous |
| dict zonesToClients = {} |