From 9029fd64fc277ec15e2b82ba5f6e6c998f971e6a Mon Sep 17 00:00:00 2001 From: Josh Wilson Date: Mon, 16 Apr 2007 04:24:43 +0000 Subject: [PATCH] "Changed the way interest is maintained in the world by the local avatar (such as when teleporting, using doors or tunnels, or entering the game). Moved tunnels to be peers of the islands, rather than their children (in the interest graph). This enables the player to teleport to any game area. Enabled teleport to a friend (still needs work)" --- direct/src/distributed/DistributedCartesianGrid.py | 14 ++++++++++++++ direct/src/distributed/DoInterestManager.py | 7 +++++++ 2 files changed, 21 insertions(+) diff --git a/direct/src/distributed/DistributedCartesianGrid.py b/direct/src/distributed/DistributedCartesianGrid.py index ee7ed53d5e..66c2795dcb 100755 --- a/direct/src/distributed/DistributedCartesianGrid.py +++ b/direct/src/distributed/DistributedCartesianGrid.py @@ -33,6 +33,7 @@ class DistributedCartesianGrid(DistributedNode, CartesianGridBase): self.visAvatar = None self.gridVisContext = None # Do we have grid lines visualized? + self._onOffState = False if __debug__: self.haveGridLines = 0 @@ -77,6 +78,11 @@ class DistributedCartesianGrid(DistributedNode, CartesianGridBase): @report(types = ['frameCount', 'avLocation'], dConfigParam = 'want-connector-report') def startProcessVisibility(self, avatar): + if not self._onOffState: + # if we've been told that we're OFF, don't try + # to process visibilty + return + assert not self.cr._noNewInterests if self.cr.noNewInterests(): self.notify.warning( @@ -223,9 +229,11 @@ class DistributedCartesianGrid(DistributedNode, CartesianGridBase): def turnOff(self): + self._onOffState = False self.stopProcessVisibility() def turnOn(self, av = None): + self._onOffState = True if av: self.startProcessVisibility(av) @@ -363,3 +371,9 @@ class DistributedCartesianGrid(DistributedNode, CartesianGridBase): if not self.haveGridLines: self.initializeGridLines() self.updateGrid() + + def setWorldContext(self, worldContext): + pass + + def clearWorldContext(self, event = None): + pass diff --git a/direct/src/distributed/DoInterestManager.py b/direct/src/distributed/DoInterestManager.py index 412ced47b6..69bbf6dcb2 100755 --- a/direct/src/distributed/DoInterestManager.py +++ b/direct/src/distributed/DoInterestManager.py @@ -49,6 +49,8 @@ class InterestState: for event in self.events: messenger.send(event) self.clearEvents() + def setDesc(self, desc): + self.desc = desc def isPendingDelete(self): return self.state == InterestState.StatePendingDel def __repr__(self): @@ -149,6 +151,11 @@ class DoInterestManager(DirectObject.DirectObject): return False return DoInterestManager._interests.has_key(handle.asInt()) + def updateInterestDescription(self, handle, desc): + iState = DoInterestManager._interests.get(handle.asInt()) + if iState: + iState.setDesc(desc) + def addInterest(self, parentId, zoneIdList, description, event=None, auto=False): """ Look into a (set of) zone(s).