mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 02:15:43 -04:00
support for runtime pstat connections
This commit is contained in:
parent
977061c2aa
commit
611cb9d8e8
@ -1200,11 +1200,18 @@ class ShowBase(DirectObject.DirectObject):
|
|||||||
self.physicsMgr.doPhysics(dt)
|
self.physicsMgr.doPhysics(dt)
|
||||||
return Task.cont
|
return Task.cont
|
||||||
|
|
||||||
def createStats(self):
|
def createStats(self, hostname=None, port=None):
|
||||||
# You must specify a pstats-host in your Config.prc
|
# You can specify pstats-host in your Config.prc or use ~pstats/~aipstats
|
||||||
# The default is localhost
|
# The default is localhost
|
||||||
if self.wantStats:
|
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):
|
def addSfxManager(self, extraSfxManager):
|
||||||
# keep a list of sfx manager objects to apply settings to,
|
# keep a list of sfx manager objects to apply settings to,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user