mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-30 16:58:40 -04:00
asserting notify statements to clean up the game logs
This commit is contained in:
parent
d2e689f8d3
commit
a480d86b62
@ -483,7 +483,7 @@ class Actor(DirectObject, NodePath):
|
||||
|
||||
def removeNode(self):
|
||||
if self.__geomNode and (self.__geomNode.getNumChildren() > 0):
|
||||
self.notify.warning("called actor.removeNode() on %s without calling cleanup()" % self.getName())
|
||||
assert self.notify.warning("called actor.removeNode() on %s without calling cleanup()" % self.getName())
|
||||
NodePath.removeNode(self)
|
||||
|
||||
def clearPythonData(self):
|
||||
|
@ -22,7 +22,6 @@ class ControlManager:
|
||||
wantWASD = config.GetBool('want-WASD', 0)
|
||||
|
||||
def __init__(self, enable=True, passMessagesThrough = False):
|
||||
print ("init control manager %s" % (passMessagesThrough))
|
||||
assert self.notify.debugCall(id(self))
|
||||
self.passMessagesThrough = passMessagesThrough
|
||||
self.inputStateTokens = []
|
||||
|
@ -7,6 +7,7 @@ from direct.task import Task
|
||||
from direct.gui import DirectGuiGlobals
|
||||
from direct.showbase.EventGroup import EventGroup
|
||||
from direct.showbase.PythonUtil import report
|
||||
from direct.distributed.GridParent import GridParent
|
||||
|
||||
if __debug__:
|
||||
# For grid drawing
|
||||
@ -76,6 +77,31 @@ class DistributedCartesianGrid(DistributedNode, CartesianGridBase):
|
||||
def getCenterPos(self):
|
||||
return self.centerPos
|
||||
|
||||
def handleChildArrive(self, child, zoneId):
|
||||
DistributedNode.handleChildArrive(self, child, zoneId)
|
||||
if (zoneId >= self.startingZone):
|
||||
if not child.gridParent:
|
||||
child.gridParent = GridParent(child)
|
||||
child.gridParent.setGridParent(self, zoneId)
|
||||
elif child.gridParent:
|
||||
child.gridParent.delete()
|
||||
child.gridParent = None
|
||||
|
||||
def handleChildArriveZone(self, child, zoneId):
|
||||
DistributedNode.handleChildArrive(self, child, zoneId)
|
||||
if (zoneId >= self.startingZone):
|
||||
if not child.gridParent:
|
||||
child.gridParent = GridParent(child)
|
||||
child.gridParent.setGridParent(self, zoneId)
|
||||
elif child.gridParent:
|
||||
child.gridParent.delete()
|
||||
child.gridParent = None
|
||||
|
||||
def handleChildLeave(self, child, zoneId):
|
||||
if child.gridParent:
|
||||
child.gridParent.delete()
|
||||
child.gridParent = None
|
||||
|
||||
@report(types = ['deltaStamp', 'avLocation', 'args'], dConfigParam = ['want-connector-report','want-shipboard-report'])
|
||||
def startProcessVisibility(self, avatar):
|
||||
if not self._onOffState:
|
||||
@ -234,7 +260,7 @@ class DistributedCartesianGrid(DistributedNode, CartesianGridBase):
|
||||
# zones.
|
||||
# Make sure this is a valid zone
|
||||
if not self.isValidZone(zoneId):
|
||||
self.notify.warning("handleAvatarZoneChange: not a valid zone (%s)" % zoneId)
|
||||
assert self.notify.warning("handleAvatarZoneChange: not a valid zone (%s)" % zoneId)
|
||||
return
|
||||
|
||||
# Set the location on the server
|
||||
|
@ -292,7 +292,7 @@ class DistributedSmoothNode(DistributedNode.DistributedNode,
|
||||
self.lastSuggestResync = realTime
|
||||
timestampB = globalClockDelta.localToNetworkTime(realTime)
|
||||
serverTime = realTime - globalClockDelta.getDelta()
|
||||
self.notify.info(
|
||||
assert self.notify.info(
|
||||
"Suggesting resync for %s, with discrepency %s; local time is %s and server time is %s." % (
|
||||
self.doId, howFarFuture - chug,
|
||||
realTime, serverTime))
|
||||
@ -364,12 +364,12 @@ class DistributedSmoothNode(DistributedNode.DistributedNode,
|
||||
globalClockDelta.getUncertainty() != None:
|
||||
other = self.cr.doId2do.get(avId)
|
||||
if (not other):
|
||||
self.notify.info(
|
||||
assert self.notify.info(
|
||||
"Warning: couldn't find the avatar %d" % (avId))
|
||||
elif hasattr(other, "d_returnResync"):
|
||||
realTime = globalClock.getRealTime()
|
||||
serverTime = realTime - globalClockDelta.getDelta()
|
||||
self.notify.info(
|
||||
assert self.notify.info(
|
||||
"Returning resync for %s; local time is %s and server time is %s." % (
|
||||
self.doId, realTime, serverTime))
|
||||
other.d_returnResync(
|
||||
|
@ -259,8 +259,8 @@ class DoInterestManager(DirectObject.DirectObject):
|
||||
# we're not pending a removal, but we have outstanding events?
|
||||
# probably we are waiting for an add/alter complete.
|
||||
# should we send those events now?
|
||||
self.notify.warning('removeInterest: abandoning events: %s' %
|
||||
intState.events)
|
||||
assert self.notify.warning('removeInterest: abandoning events: %s' %
|
||||
intState.events)
|
||||
intState.clearEvents()
|
||||
intState.state = InterestState.StatePendingDel
|
||||
contextId = self._getNextContextId()
|
||||
|
@ -505,7 +505,7 @@ class TaskManager:
|
||||
def doMethodLater(self, delayTime, funcOrTask, name, extraArgs=None,
|
||||
priority=0, uponDeath=None, appendTask=False, owner = None):
|
||||
if delayTime < 0:
|
||||
self.notify.warning('doMethodLater: added task: %s with negative delay: %s' % (name, delayTime))
|
||||
assert self.notify.warning('doMethodLater: added task: %s with negative delay: %s' % (name, delayTime))
|
||||
if isinstance(funcOrTask, Task):
|
||||
task = funcOrTask
|
||||
elif callable(funcOrTask):
|
||||
@ -747,7 +747,7 @@ class TaskManager:
|
||||
# warn if the task took too long
|
||||
if self.warnTaskDuration:
|
||||
if dt >= self.taskDurationWarningThreshold:
|
||||
TaskManager.notify.warning('task %s ran for %.2f seconds' % (
|
||||
assert TaskManager.notify.warning('task %s ran for %.2f seconds' % (
|
||||
task.name, dt))
|
||||
|
||||
return ret
|
||||
|
Loading…
x
Reference in New Issue
Block a user