"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)"

This commit is contained in:
Josh Wilson 2007-04-16 04:24:43 +00:00
parent 259ce0f3e3
commit 9029fd64fc
2 changed files with 21 additions and 0 deletions

View File

@ -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

View File

@ -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).