Panda3D
Classes | Public Member Functions | Public Attributes | Static Public Attributes | List of all members
ServerRepository Class Reference

Classes

class  Client
 
class  Object
 

Public Member Functions

def __init__ (self, tcpPort, serverAddress=None, udpPort=None, dcFileNames=None, threadedNet=None)
 
def clientHardDisconnectTask (self, task)
 
def flushTask (self, task)
 
def getDoIdBase (self, doId)
 
def getTcpHeaderSize (self)
 
def handleClientCreateObject (self, datagram, dgi)
 
def handleClientDeleteObject (self, datagram, doId)
 
def handleClientDisconnect (self, client)
 
def handleClientObjectSetZone (self, datagram, dgi)
 
def handleClientObjectUpdateField (self, datagram, dgi, targeted=False)
 
def handleClientSetInterest (self, client, dgi)
 
def handleDatagram (self, datagram)
 
def handleMessageType (self, msgType, di)
 
def importModule (self, dcImports, moduleName, importSymbols)
 
def listenerPoll (self, task)
 
def readDCFile (self, dcFileNames=None)
 
def readerPollOnce (self)
 
def readerPollUntilEmpty (self, task)
 
def sendDoIdRange (self, client)
 
def sendToAllExcept (self, datagram, exceptionList)
 
def sendToZoneExcept (self, zoneId, datagram, exceptionList)
 
def setObjectZone (self, owner, object, zoneId)
 
def setTcpHeaderSize (self, headerSize)
 
def updateClientInterestZones (self, client)
 

Public Attributes

 clientsByConnection
 
 clientsByDoIdBase
 
 cw
 
 dcFile
 
 dclassesByName
 
 dclassesByNumber
 
 dcSuffix
 
 doIdRange
 
 hashVal
 
 idAllocator
 
 lastConnection
 
 needsFlush
 
 objectsByZoneId
 
 qcl
 
 qcm
 
 qcr
 
 tcpRendezvous
 
 zonesToClients
 

Static Public Attributes

 notify = DirectNotifyGlobal.directNotify.newCategory("ServerRepository")
 

Detailed Description

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

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self,
  tcpPort,
  serverAddress = None,
  udpPort = None,
  dcFileNames = None,
  threadedNet = None 
)

Member Function Documentation

◆ clientHardDisconnectTask()

def 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()

def 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()

def 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()

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

◆ handleClientCreateObject()

def handleClientCreateObject (   self,
  datagram,
  dgi 
)
client wants to create an object, so we store appropriate
data, and then pass message along to corresponding zones 

◆ handleClientDeleteObject()

def handleClientDeleteObject (   self,
  datagram,
  doId 
)
client deletes an object, let everyone who has interest in
the object's zone know about it. 

◆ handleClientDisconnect()

def handleClientDisconnect (   self,
  client 
)

◆ handleClientObjectSetZone()

def handleClientObjectSetZone (   self,
  datagram,
  dgi 
)
The client is telling us the object is changing to a new
zone. 

◆ handleClientObjectUpdateField()

def handleClientObjectUpdateField (   self,
  datagram,
  dgi,
  targeted = False 
)
Received an update request from a client. 

◆ handleClientSetInterest()

def handleClientSetInterest (   self,
  client,
  dgi 
)
The client is specifying a particular set of zones it is
interested in. 

◆ handleDatagram()

def handleDatagram (   self,
  datagram 
)
switching station for messages 

◆ handleMessageType()

def handleMessageType (   self,
  msgType,
  di 
)

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

◆ listenerPoll()

def listenerPoll (   self,
  task 
)

◆ 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)
checks for available messages to the server 

◆ readerPollUntilEmpty()

def readerPollUntilEmpty (   self,
  task 
)
continuously polls for new messages on the server 

◆ sendDoIdRange()

def sendDoIdRange (   self,
  client 
)
sends the client the range of doid's that the client can
use 

◆ sendToAllExcept()

def sendToAllExcept (   self,
  datagram,
  exceptionList 
)
sends a message to all connected clients, except for
clients on exceptionList. 

◆ sendToZoneExcept()

def sendToZoneExcept (   self,
  zoneId,
  datagram,
  exceptionList 
)
sends a message to everyone who has interest in the
indicated zone, except for the clients on exceptionList.

◆ setObjectZone()

def setObjectZone (   self,
  owner,
  object,
  zoneId 
)

◆ setTcpHeaderSize()

def 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()

def updateClientInterestZones (   self,
  client 
)
Something about the client has caused its set of interest
zones to potentially change.  Recompute them. 

Member Data Documentation

◆ clientsByConnection

clientsByConnection

◆ clientsByDoIdBase

clientsByDoIdBase

◆ cw

cw

◆ dcFile

dcFile

◆ dclassesByName

dclassesByName

◆ dclassesByNumber

dclassesByNumber

◆ dcSuffix

dcSuffix

◆ doIdRange

doIdRange

◆ hashVal

hashVal

◆ idAllocator

idAllocator

◆ lastConnection

lastConnection

◆ needsFlush

needsFlush

◆ notify

notify = DirectNotifyGlobal.directNotify.newCategory("ServerRepository")
static

◆ objectsByZoneId

objectsByZoneId

◆ qcl

qcl

◆ qcm

qcm

◆ qcr

qcr

◆ tcpRendezvous

tcpRendezvous

◆ zonesToClients

zonesToClients