Let's not freak out if our caller disappears while we're off resolving a

scene.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2834 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Michael Bayne
2003-10-25 00:10:35 +00:00
parent 5272911863
commit 0fc8813314
3 changed files with 37 additions and 14 deletions
@@ -1,5 +1,5 @@
//
// $Id: SceneProvider.java,v 1.17 2003/06/11 02:48:07 mdb Exp $
// $Id: SceneProvider.java,v 1.18 2003/10/25 00:10:35 mdb Exp $
package com.threerings.whirled.server;
@@ -46,17 +46,22 @@ public class SceneProvider
// create a callback object that will handle the resolution or
// failed resolution of the scene
SceneRegistry.ResolutionListener rl =
new SceneRegistry.ResolutionListener()
{
public void sceneWasResolved (SceneManager scmgr)
{
SceneRegistry.ResolutionListener rl = null;
rl = new SceneRegistry.ResolutionListener() {
public void sceneWasResolved (SceneManager scmgr) {
// make sure our caller is still around; under heavy load,
// clients might end their session while the scene is
// resolving
if (!source.isActive()) {
Log.info("Abandoning scene move, client gone " +
"[who=" + source.who() +
", dest=" + scmgr.where() + "].");
return;
}
finishMoveToRequest(source, scmgr, sceneVer, listener);
}
public void sceneFailedToResolve (
int rsceneId, Exception reason)
{
public void sceneFailedToResolve (int rsceneId, Exception reason) {
Log.warning("Unable to resolve scene [sceneid=" + rsceneId +
", reason=" + reason + "].");
// pretend like the scene doesn't exist to the client
@@ -1,5 +1,5 @@
//
// $Id: SpotProvider.java,v 1.20 2003/08/13 00:11:03 mdb Exp $
// $Id: SpotProvider.java,v 1.21 2003/10/25 00:10:35 mdb Exp $
package com.threerings.whirled.spot.server;
@@ -108,6 +108,16 @@ public class SpotProvider
SceneRegistry.ResolutionListener rl =
new SceneRegistry.ResolutionListener() {
public void sceneWasResolved (SceneManager scmgr) {
// make sure our caller is still around; under heavy
// load, clients might end their session while the
// scene is resolving
if (!fsource.isActive()) {
Log.info("Abandoning portal traversal, client gone " +
"[who=" + fsource.who() +
", dest=" + scmgr.where() + "].");
return;
}
// let the source manager know that this guy is
// departing via the specified portal
srcmgr.willTraversePortal(fsource, fdest);
@@ -1,5 +1,5 @@
//
// $Id: ZoneProvider.java,v 1.15 2003/06/11 02:48:07 mdb Exp $
// $Id: ZoneProvider.java,v 1.16 2003/10/25 00:10:35 mdb Exp $
package com.threerings.whirled.zone.server;
@@ -115,10 +115,18 @@ public class ZoneProvider
// create a callback object that will handle the resolution or
// failed resolution of the scene
SceneRegistry.ResolutionListener rl =
new SceneRegistry.ResolutionListener()
{
SceneRegistry.ResolutionListener rl = null;
rl = new SceneRegistry.ResolutionListener() {
public void sceneWasResolved (SceneManager scmgr) {
// make sure our caller is still around; under heavy load,
// clients might end their session while the scene is
// resolving
if (!fsource.isActive()) {
Log.info("Abandoning zone move, client gone " +
"[who=" + fsource.who() +
", dest=" + scmgr.where() + "].");
return;
}
finishMoveTo(fsource, fsum, scmgr, fsceneVer, flistener);
}