From 078e131c16b6f7b7aae0dde811ca9f1c54e049ff Mon Sep 17 00:00:00 2001 From: Ray Greenwell Date: Wed, 12 Oct 2005 19:12:37 +0000 Subject: [PATCH] Force us to unsubscribe to our cluster when we log off. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3727 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- .../whirled/spot/client/SpotSceneDirector.java | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/java/com/threerings/whirled/spot/client/SpotSceneDirector.java b/src/java/com/threerings/whirled/spot/client/SpotSceneDirector.java index 4fde28293..57435a038 100644 --- a/src/java/com/threerings/whirled/spot/client/SpotSceneDirector.java +++ b/src/java/com/threerings/whirled/spot/client/SpotSceneDirector.java @@ -313,7 +313,7 @@ public class SpotSceneDirector extends BasicDirector // documentation inherited from interface public void objectAvailable (DObject object) { - clearCluster(); + clearCluster(false); int oid = object.getOid(); if (oid != _self.getClusterOid()) { // we got it too late, just unsubscribe @@ -380,7 +380,7 @@ public class SpotSceneDirector extends BasicDirector _location = null; _pendingLoc = null; _sservice = null; - clearCluster(); + clearCluster(true); // stop listening to the client object client.getClientObject().removeListener(this); @@ -416,7 +416,7 @@ public class SpotSceneDirector extends BasicDirector } // clear out any old cluster object - clearCluster(); + clearCluster(false); // if there's a new cluster object, subscribe to it if (_chatdir != null && cloid > 0) { @@ -429,10 +429,13 @@ public class SpotSceneDirector extends BasicDirector /** * Convenience routine to unwire chat for and unsubscribe from our * current cluster, if any. + * + * @param force clear the cluster even if we're still apparently in it. */ - protected void clearCluster () + protected void clearCluster (boolean force) { - if (_clobj != null && _clobj.getOid() != _self.getClusterOid()) { + if (_clobj != null && + (force || (_clobj.getOid() != _self.getClusterOid()))) { if (_chatdir != null) { _chatdir.removeAuxiliarySource(_clobj); }