From 7ce6ca340e0ebb97bfca02cfc613a56208d33134 Mon Sep 17 00:00:00 2001 From: Michael Bayne Date: Mon, 21 Oct 2002 18:04:56 +0000 Subject: [PATCH] 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 --- .../com/threerings/presents/client/Client.java | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/java/com/threerings/presents/client/Client.java b/src/java/com/threerings/presents/client/Client.java index e436f495d..629936c6d 100644 --- a/src/java/com/threerings/presents/client/Client.java +++ b/src/java/com/threerings/presents/client/Client.java @@ -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; @@ -255,8 +255,9 @@ public class Client */ public synchronized boolean isLoggedOn () { - // if we have a communicator, we're logged on - return (_comm != null); + // we're not "logged on" until we're fully done with the + // procedure, meaning we have a client object reference + return (_clobj != null); } /** @@ -290,8 +291,7 @@ public class Client */ public boolean logoff (boolean abortable) { - // if we have no communicator, we're not logged on anyway, so fake - // it + // if we have no communicator, we're not logged on anyway if (_comm == null) { Log.warning("Ignoring request to logoff because we're not " + "logged on."); @@ -370,8 +370,8 @@ public class Client */ protected void clientObjectDidChange (ClientObject clobj) { - // slip the new client object into the business _clobj = clobj; + _cloid = _clobj.getOid(); // report to our observers notifyObservers(Client.CLIENT_OBJECT_CHANGED, null); @@ -414,8 +414,10 @@ public class Client // was dispatched _invoker.invokeLater(new Runnable() { public void run () { - // clear out our communicator reference + // clear out our references _comm = null; + _clobj = null; + _cloid = -1; // and let our invocation director know we're logged off _invdir.cleanup(); } @@ -547,7 +549,7 @@ public class Client protected Invoker _invoker; /** Our client distribted object id. */ - protected int _cloid; + protected int _cloid = -1; /** Our client distributed object. */ protected ClientObject _clobj;