direct.distributed.ServerRepository

from direct.distributed.ServerRepository import ServerRepository

ServerRepository module: contains the ServerRepository class

Inheritance diagram

Inheritance diagram of direct.distributed.ServerRepository

class ServerRepository(tcpPort, serverAddress=None, udpPort=None, dcFileNames=None, threadedNet=None)[source]

Bases: object

This maintains the server-side connection with a Panda server. It is only for use with the Panda LAN server provided by CMU.

class Client(connection, netAddress, doIdBase)[source]

Bases: object

This internal class keeps track of the data associated with each connected client.

__init__(connection, netAddress, doIdBase)[source]
class Object(doId, zoneId, dclass)[source]

Bases: object

This internal class keeps track of the data associated with each extent distributed object.

__init__(doId, zoneId, dclass)[source]
__init__(tcpPort, serverAddress=None, udpPort=None, dcFileNames=None, threadedNet=None)[source]
clientHardDisconnectTask(task)[source]

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(task)[source]

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(doId)[source]

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()[source]

Returns the current setting of TCP header size. See setTcpHeaderSize().

handleClientCreateObject(datagram, dgi)[source]

client wants to create an object, so we store appropriate data, and then pass message along to corresponding zones

handleClientDeleteObject(datagram, doId)[source]

client deletes an object, let everyone who has interest in the object’s zone know about it.

handleClientDisconnect(client)[source]
handleClientObjectSetZone(datagram, dgi)[source]

The client is telling us the object is changing to a new zone.

handleClientObjectUpdateField(datagram, dgi, targeted=False)[source]

Received an update request from a client.

handleClientSetInterest(client, dgi)[source]

The client is specifying a particular set of zones it is interested in.

handleDatagram(datagram)[source]

switching station for messages

handleMessageType(msgType, di)[source]
importModule(dcImports, moduleName, importSymbols)[source]

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

listenerPoll(task)[source]
notify = <direct.directnotify.Notifier.Notifier object>
readDCFile(dcFileNames=None)[source]

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()[source]

checks for available messages to the server

readerPollUntilEmpty(task)[source]

continuously polls for new messages on the server

sendDoIdRange(client)[source]

sends the client the range of doid’s that the client can use

sendToAllExcept(datagram, exceptionList)[source]

sends a message to all connected clients, except for clients on exceptionList.

sendToZoneExcept(zoneId, datagram, exceptionList)[source]

sends a message to everyone who has interest in the indicated zone, except for the clients on exceptionList.

setObjectZone(owner, object, zoneId)[source]
setTcpHeaderSize(headerSize)[source]

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(client)[source]

Something about the client has caused its set of interest zones to potentially change. Recompute them.