support for runtime pstat connections

This commit is contained in:
Darren Ranalli 2007-03-12 23:26:23 +00:00
parent 977061c2aa
commit 611cb9d8e8

View File

@ -1200,11 +1200,18 @@ class ShowBase(DirectObject.DirectObject):
self.physicsMgr.doPhysics(dt)
return Task.cont
def createStats(self):
# You must specify a pstats-host in your Config.prc
def createStats(self, hostname=None, port=None):
# You can specify pstats-host in your Config.prc or use ~pstats/~aipstats
# The default is localhost
if self.wantStats:
PStatClient.connect()
if PStatClient.isConnected():
PStatClient.disconnect()
# these default values match the C++ default values
if hostname is None:
hostname = ''
if port is None:
port = -1
PStatClient.connect(hostname, port)
def addSfxManager(self, extraSfxManager):
# keep a list of sfx manager objects to apply settings to,