direct.distributed.ConnectionRepository

from direct.distributed.ConnectionRepository import ConnectionRepository, GCTrigger

Inheritance diagram

Inheritance diagram of direct.distributed.ConnectionRepository

class ConnectionRepository(connectMethod, config, hasOwnerView=False, threadedNet=None)[source]

Bases: DoInterestManager, DoCollectionManager, CConnectionRepository

This is a base class for things that know how to establish a connection (and exchange datagrams) with a gameserver. This includes ClientRepository and AIRepository.

CM_HTTP = 0
CM_NATIVE = 2
CM_NET = 1
GarbageCollectTaskName = 'allowGarbageCollect'
GarbageThresholdTaskName = 'adjustGarbageCollectThreshold'
__init__(self, connectMethod, config, hasOwnerView=False, threadedNet=None)[source]
checkHttp(self)[source]
connect(self, serverList, successCallback=None, successArgs=[], failureCallback=None, failureArgs=[])[source]

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

Closes the previously-established connection.

gcNotify = <direct.directnotify.Notifier.Notifier object>
generateGlobalObject(self, doId, dcname, values=None)[source]
getServerAddress(self)[source]
handleDatagram(self, di)[source]
handleReaderOverflow(self)[source]
httpConnectCallback(self, ch, serverList, serverIndex, successCallback, successArgs, failureCallback, failureArgs)[source]
importModule(self, 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.

lostConnection(self)[source]
networkPlugPulled(self)[source]
notify = <direct.directnotify.Notifier.Notifier object>
pullNetworkPlug(self)[source]
readDCFile(self, 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 Config.prc file.

readerPollOnce(self)[source]
readerPollUntilEmpty(self, task)[source]
restoreNetworkPlug(self)[source]
send(self, datagram)[source]
shutdown(self)[source]
startReaderPollTask(self)[source]
stopReaderPollTask(self)[source]
taskChain = None
taskPriority = -30
uniqueName(self, idString)[source]
class GCTrigger[source]

Bases: object