Panda3D
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Properties
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
ConnectionRepository Class Reference
Inheritance diagram for ConnectionRepository:
DoInterestManager DoCollectionManager ClientRepositoryBase OldClientRepository

Public Member Functions

def __init__
 
def checkHttp
 
def connect
 
def disconnect
 
def generateGlobalObject
 
def getServerAddress
 
def handleDatagram
 
def handleReaderOverflow
 
def httpConnectCallback
 
def importModule
 
def lostConnection
 
def readDCFile
 
def readerPollOnce
 
def readerPollUntilEmpty
 
def send
 
def shutdown
 
def startReaderPollTask
 
def stopReaderPollTask
 
- Public Member Functions inherited from DoInterestManager
def __init__
 
def addAutoInterest
 
def addInterest
 
def alterInterest
 
def cleanupWaitAllInterestsComplete
 
def closeAutoInterests
 
def getAllInterestsCompleteEvent
 
def handleInterestDoneMessage
 
def isValidInterestHandle
 
def noNewInterests
 
def openAutoInterests
 
def printInterestHistory
 
def printInterests
 
def printInterestSets
 
def printInterestsIfDebug
 
def queueAllInterestsCompleteEvent
 
def removeAIInterest
 
def removeAutoInterest
 
def removeInterest
 
def resetInterestStateForConnectionLoss
 
def setAllInterestsCompleteCallback
 
def setNoNewInterests
 
def updateInterestDescription
 
- Public Member Functions inherited from DoCollectionManager
def __init__
 
def addDOToTables
 
def callbackWithDo
 
def callbackWithOwnerView
 
def countObjects
 
def deleteDistributedObjects
 
def deleteObjectLocation
 
def doByDistance
 
def doFind
 
def doFindAll
 
def doFindAllInstances
 
def doFindAllMatching
 
def doFindAllOfType
 
def dosByDistance
 
def findAnyOfType
 
def getAllOfType
 
def getDo
 
def getDoIdList
 
def getDoList
 
def getDoTable
 
def getGameDoId
 
def getObjectsInZone
 def changeDOZoneInTables(self, do, newParentId, newZoneId, oldParentId, oldZoneId): if 1: self.storeObjectLocation(do.doId, newParentId, newZoneId) else: #assert not hasattr(do, "isQueryAllResponse") or not do.isQueryAllResponse oldLocation = (oldParentId, oldZoneId) newLocation = (newParentId, newZoneId)

HACK: DistributedGuildMemberUD starts in -1, -1, which isnt ever put in the

zoneId2doIds table

if self.isValidLocationTuple(oldLocation): assert self.notify.debugStateCall(self) assert oldLocation in self.zoneId2doIds assert do.doId in self.zoneId2doIds[oldLocation] assert do.doId not in self.zoneId2doIds.get(newLocation, {})

remove from old zone

del(self.zoneId2doIds[oldLocation][do.doId]) if len(self.zoneId2doIds[oldLocation]) == 0: del self.zoneId2doIds[oldLocation] if self.isValidLocationTuple(newLocation):

add to new zone

self.zoneId2doIds.setdefault(newLocation, {}) self.zoneId2doIds[newLocation][do.doId]=do More...
 
def getObjectsOfClassInZone
 
def getOwnerView
 
def getOwnerViewDoIdList
 
def getOwnerViewDoList
 
def handleObjectLocation
 
def handleSetLocation
 
def hasOwnerViewDoId
 
def isInDoTables
 
def isValidLocationTuple
 
def printObjectCount
 
def printObjects
 
def removeDOFromTables
 
def storeObjectLocation
 
def webPrintObjectCount
 

Public Attributes

 bootedIndex
 if self.recorder and self.recorder.isPlaying(): More...
 
 bootedText
 
 config
 
 connectHttp
 
 connectMethod
 
 dclassesByName
 
 dclassesByNumber
 
 dcSuffix
 
 hashVal
 
 http
 
 private__di
 
 readerPollTaskObj
 
 recorder
 
 uniqueId
 
- Public Attributes inherited from DoCollectionManager
 doId2do
 
 doId2ownerView
 self.zoneId2doIds={} More...
 

Static Public Attributes

int CM_HTTP = 0
 
int CM_NATIVE = 2
 
int CM_NET = 1
 
string GarbageCollectTaskName = "allowGarbageCollect"
 
string GarbageThresholdTaskName = "adjustGarbageCollectThreshold"
 
tuple gcNotify = directNotify.newCategory("GarbageCollect")
 
tuple notify = DirectNotifyGlobal.directNotify.newCategory("ConnectionRepository")
 
 taskChain = None
 
int taskPriority = -30
 
- Static Public Attributes inherited from DoInterestManager
tuple InterestDebug = tempbase.config.GetBool('interest-debug', False)
 
tuple notify = directNotify.newCategory("DoInterestManager")
 
 tempbase = base
 

Detailed Description

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.

Constructor & Destructor Documentation

def __init__ (   self,
  connectMethod,
  config,
  hasOwnerView = False,
  threadedNet = None 
)

Member Function Documentation

def checkHttp (   self)
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.
def disconnect (   self)
Closes the previously-established connection.
def generateGlobalObject (   self,
  doId,
  dcname,
  values = None 
)
def getServerAddress (   self)
def handleDatagram (   self,
  di 
)
def handleReaderOverflow (   self)
def httpConnectCallback (   self,
  ch,
  serverList,
  serverIndex,
  successCallback,
  successArgs,
  failureCallback,
  failureArgs 
)
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.
def lostConnection (   self)
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 Config.prc file.
def readerPollOnce (   self)
def readerPollUntilEmpty (   self,
  task 
)
def send (   self,
  datagram 
)
def shutdown (   self)
def startReaderPollTask (   self)
def stopReaderPollTask (   self)

Member Data Documentation

bootedIndex

if self.recorder and self.recorder.isPlaying():

If we have a recorder and it's already in playback mode,

don't actually attempt to connect to a gameserver since

we don't need to. Just let it play back the data.

self.notify.info("Not connecting to gameserver; using playback data instead.") self.connectHttp = 1 self.tcpConn = SocketStreamRecorder() self.recorder.addRecorder('gameserver', self.tcpConn) self.startReaderPollTask() if successCallback: successCallback(*successArgs) return

bootedText
int CM_HTTP = 0
static
int CM_NATIVE = 2
static
int CM_NET = 1
static
config
connectHttp
connectMethod
dclassesByName
dclassesByNumber
dcSuffix
string GarbageCollectTaskName = "allowGarbageCollect"
static
string GarbageThresholdTaskName = "adjustGarbageCollectThreshold"
static
tuple gcNotify = directNotify.newCategory("GarbageCollect")
static
hashVal
http
tuple notify = DirectNotifyGlobal.directNotify.newCategory("ConnectionRepository")
static
private__di
readerPollTaskObj
recorder
taskChain = None
static
int taskPriority = -30
static
uniqueId