Clear out clobj when we're logged off; keep cloid up to date; don't claim
we're logged on until we're fully logged on (meaning we have our clobj reference). git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1818 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
//
|
//
|
||||||
// $Id: Client.java,v 1.31 2002/10/08 22:00:27 mdb Exp $
|
// $Id: Client.java,v 1.32 2002/10/21 18:04:56 mdb Exp $
|
||||||
|
|
||||||
package com.threerings.presents.client;
|
package com.threerings.presents.client;
|
||||||
|
|
||||||
@@ -255,8 +255,9 @@ public class Client
|
|||||||
*/
|
*/
|
||||||
public synchronized boolean isLoggedOn ()
|
public synchronized boolean isLoggedOn ()
|
||||||
{
|
{
|
||||||
// if we have a communicator, we're logged on
|
// we're not "logged on" until we're fully done with the
|
||||||
return (_comm != null);
|
// procedure, meaning we have a client object reference
|
||||||
|
return (_clobj != null);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -290,8 +291,7 @@ public class Client
|
|||||||
*/
|
*/
|
||||||
public boolean logoff (boolean abortable)
|
public boolean logoff (boolean abortable)
|
||||||
{
|
{
|
||||||
// if we have no communicator, we're not logged on anyway, so fake
|
// if we have no communicator, we're not logged on anyway
|
||||||
// it
|
|
||||||
if (_comm == null) {
|
if (_comm == null) {
|
||||||
Log.warning("Ignoring request to logoff because we're not " +
|
Log.warning("Ignoring request to logoff because we're not " +
|
||||||
"logged on.");
|
"logged on.");
|
||||||
@@ -370,8 +370,8 @@ public class Client
|
|||||||
*/
|
*/
|
||||||
protected void clientObjectDidChange (ClientObject clobj)
|
protected void clientObjectDidChange (ClientObject clobj)
|
||||||
{
|
{
|
||||||
// slip the new client object into the business
|
|
||||||
_clobj = clobj;
|
_clobj = clobj;
|
||||||
|
_cloid = _clobj.getOid();
|
||||||
|
|
||||||
// report to our observers
|
// report to our observers
|
||||||
notifyObservers(Client.CLIENT_OBJECT_CHANGED, null);
|
notifyObservers(Client.CLIENT_OBJECT_CHANGED, null);
|
||||||
@@ -414,8 +414,10 @@ public class Client
|
|||||||
// was dispatched
|
// was dispatched
|
||||||
_invoker.invokeLater(new Runnable() {
|
_invoker.invokeLater(new Runnable() {
|
||||||
public void run () {
|
public void run () {
|
||||||
// clear out our communicator reference
|
// clear out our references
|
||||||
_comm = null;
|
_comm = null;
|
||||||
|
_clobj = null;
|
||||||
|
_cloid = -1;
|
||||||
// and let our invocation director know we're logged off
|
// and let our invocation director know we're logged off
|
||||||
_invdir.cleanup();
|
_invdir.cleanup();
|
||||||
}
|
}
|
||||||
@@ -547,7 +549,7 @@ public class Client
|
|||||||
protected Invoker _invoker;
|
protected Invoker _invoker;
|
||||||
|
|
||||||
/** Our client distribted object id. */
|
/** Our client distribted object id. */
|
||||||
protected int _cloid;
|
protected int _cloid = -1;
|
||||||
|
|
||||||
/** Our client distributed object. */
|
/** Our client distributed object. */
|
||||||
protected ClientObject _clobj;
|
protected ClientObject _clobj;
|
||||||
|
|||||||
Reference in New Issue
Block a user