From ccce88790abd905abcb84f1034827783b7b883d7 Mon Sep 17 00:00:00 2001 From: Mike Thomas Date: Tue, 14 Feb 2006 21:46:28 +0000 Subject: [PATCH] Function wasn't informing listener of failures. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3850 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- .../spot/client/SpotSceneDirector.java | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/src/java/com/threerings/whirled/spot/client/SpotSceneDirector.java b/src/java/com/threerings/whirled/spot/client/SpotSceneDirector.java index 57435a038..6df443e6c 100644 --- a/src/java/com/threerings/whirled/spot/client/SpotSceneDirector.java +++ b/src/java/com/threerings/whirled/spot/client/SpotSceneDirector.java @@ -196,9 +196,21 @@ public class SpotSceneDirector extends BasicDirector { // refuse if there's a pending location change or if we're already // at the specified location - if (loc.equivalent(_location) || (_pendingLoc != null)) { + if (loc.equivalent(_location)) { Log.info("Not going to " + loc + "; we're at " + _location + " and we're headed to " + _pendingLoc + "."); + if (listener != null) { + listener.requestFailed(new Exception(ALREADY_THERE)); + } + return; + } + + if (_pendingLoc != null) { + Log.info("Not going to " + loc + "; we're at " + _location + + " and we're headed to " + _pendingLoc + "."); + if (listener != null) { + listener.requestFailed(new Exception(MOVE_IN_PROGRESS)); + } return; } @@ -206,6 +218,9 @@ public class SpotSceneDirector extends BasicDirector if (scene == null) { Log.warning("Requested to change locations, but we're not " + "currently in any scene [loc=" + loc + "]."); + if (listener != null) { + listener.requestFailed(new Exception(NO_SUCH_PLACE)); + } return; } @@ -247,6 +262,9 @@ public class SpotSceneDirector extends BasicDirector if (scene == null) { Log.warning("Requested to join cluster, but we're not " + "currently in any scene [froid=" + froid + "]."); + if (listener != null) { + listener.requestFailed(new Exception(NO_SUCH_PLACE)); + } return; }