Track that we're switching servers so that the client can differentiate during

did logoff between a real logoff and a server switch.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4894 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Michael Bayne
2007-12-03 21:21:50 +00:00
parent 289475b253
commit 635bb0a13f
@@ -183,6 +183,17 @@ public class Client extends EventDispatcher
return _invdir;
}
/**
* Returns true if we're in the process of switching servers, false if we're not. This will
* only return true following the call to {@link #switchServers}, through the did logoff
* notification and the did clear notification. During the did logon notification for the new
* server or logon failure for same, we will not show as switching.
*/
public function isSwitchingServers () :Boolean
{
return _switcher != null;
}
/**
* Returns the set of bootstrap service groups needed by this client.
*/
@@ -290,7 +301,8 @@ public class Client extends EventDispatcher
obs :InvocationService_ConfirmListener) :void
{
// the server switcher will take care of everything for us
new ServerSwitcher(this, hostname, ports, obs).switchServers();
_switcher = new ServerSwitcher(this, hostname, ports, obs);
_switcher.switchServers();
}
/**
@@ -407,6 +419,9 @@ public class Client extends EventDispatcher
} else {
notifyObservers(ClientEvent.CLIENT_DID_CLEAR, null);
}
// clear out any server switcher reference
_switcher = null;
}
/**
@@ -473,6 +488,10 @@ public class Client extends EventDispatcher
/** Ticks. */
protected var _tickInterval :Timer;
/** Used to temporarily track our server switcher so that we can tell when we're logging off
* whether or not we're switching servers or actually ending our session. */
protected var _switcher :ServerSwitcher;
// client observer constants
/*
internal static const CLIENT_DID_LOGON :int = 0;