Our invocation adapters now expect success first.

git-svn-id: svn+ssh://src.earth.threerings.net/vilya/trunk@790 c613c5cb-e716-0410-b11b-feb51c14d237
This commit is contained in:
Ray Greenwell
2008-12-09 02:21:40 +00:00
parent 011ce82736
commit 7148e78405
2 changed files with 12 additions and 16 deletions
@@ -325,15 +325,11 @@ public class SceneDirector extends BasicDirector
var pendingData :PendingData = _pendingData; var pendingData :PendingData = _pendingData;
// ship on over to the other server // ship on over to the other server
_wctx.getClient().moveToServer(hostname, ports, new ConfirmAdapter( _wctx.getClient().moveToServer(hostname, ports, new ConfirmAdapter(
function (reason :String) :void { // failed
requestFailed(reason);
},
function () :void { // succeeded function () :void { // succeeded
// resend our move request now that we're connected to the new server // resend our move request now that we're connected to the new server
_pendingData = pendingData; _pendingData = pendingData;
sendMoveRequest(); sendMoveRequest();
} }, requestFailed));
));
} }
// from interface SceneService_SceneMoveListener // from interface SceneService_SceneMoveListener
@@ -213,18 +213,18 @@ public class SpotSceneDirector extends BasicDirector
_pendingLoc = (loc.clone() as Location); _pendingLoc = (loc.clone() as Location);
var clist :ConfirmAdapter = new ConfirmAdapter( var clist :ConfirmAdapter = new ConfirmAdapter(
function (reason :String) :void {
_pendingLoc = null;
if (listener != null) {
listener.requestFailed(new Error(reason));
}
},
function () :void { function () :void {
_location = _pendingLoc; _location = _pendingLoc;
_pendingLoc = null; _pendingLoc = null;
if (listener != null) { if (listener != null) {
listener.requestCompleted(_location); listener.requestCompleted(_location);
} }
},
function (reason :String) :void {
_pendingLoc = null;
if (listener != null) {
listener.requestFailed(new Error(reason));
}
}); });
_sservice.changeLocation(_wctx.getClient(), sceneId, loc, clist); _sservice.changeLocation(_wctx.getClient(), sceneId, loc, clist);
} }
@@ -252,15 +252,15 @@ public class SpotSceneDirector extends BasicDirector
log.info("Joining cluster [friend=" + froid + "]."); log.info("Joining cluster [friend=" + froid + "].");
_sservice.joinCluster(_wctx.getClient(), froid, new ConfirmAdapter( _sservice.joinCluster(_wctx.getClient(), froid, new ConfirmAdapter(
function (reason :String) :void {
if (listener != null) {
listener.requestFailed(new Error(reason));
}
},
function () :void { function () :void {
if (listener != null) { if (listener != null) {
listener.requestCompleted(null); listener.requestCompleted(null);
} }
},
function (reason :String) :void {
if (listener != null) {
listener.requestFailed(new Error(reason));
}
})); }));
} }