From 67a3dabac2091210c2aebaf0e8ebd68d88a7c265 Mon Sep 17 00:00:00 2001 From: Michael Bayne Date: Tue, 21 Aug 2001 19:33:06 +0000 Subject: [PATCH] Have the invocation manager pass the client object back to the client when it is ready. Then the client hangs on to it because the invocation manager doesn't really need to hang on to the client object. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@288 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- .../com/threerings/presents/client/Client.java | 10 +++++++--- .../presents/client/InvocationDirector.java | 14 ++------------ 2 files changed, 9 insertions(+), 15 deletions(-) diff --git a/src/java/com/threerings/presents/client/Client.java b/src/java/com/threerings/presents/client/Client.java index 6cd99e257..e4310af0c 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.12 2001/08/21 00:58:10 mdb Exp $ +// $Id: Client.java,v 1.13 2001/08/21 19:33:06 mdb Exp $ package com.threerings.cocktail.cher.client; @@ -174,7 +174,7 @@ public class Client */ public ClientObject getClientObject () { - return _invmgr.getClientObject(); + return _clobj; } /** @@ -286,14 +286,18 @@ public class Client // client loose to do things like request invocation services } - void invocationManagerReady () + void invocationManagerReady (ClientObject clobj) { + // keep this around + _clobj = clobj; + // let the client know that logon has now fully succeeded notifyObservers(Client.CLIENT_DID_LOGON, null); } protected Credentials _creds; protected Invoker _invoker; + protected ClientObject _clobj; protected String _hostname; protected int _port; diff --git a/src/java/com/threerings/presents/client/InvocationDirector.java b/src/java/com/threerings/presents/client/InvocationDirector.java index d30322896..44d669e89 100644 --- a/src/java/com/threerings/presents/client/InvocationDirector.java +++ b/src/java/com/threerings/presents/client/InvocationDirector.java @@ -1,5 +1,5 @@ // -// $Id: InvocationDirector.java,v 1.8 2001/08/21 00:58:10 mdb Exp $ +// $Id: InvocationDirector.java,v 1.9 2001/08/21 19:33:06 mdb Exp $ package com.threerings.cocktail.cher.client; @@ -120,7 +120,7 @@ public class InvocationManager { // let the client know that we're ready to go now that we've got // our subscription to the client object - _client.invocationManagerReady(); + _client.invocationManagerReady((ClientObject)object); } public void requestFailed (int oid, ObjectAccessException cause) @@ -250,15 +250,6 @@ public class InvocationManager return _invocationId++; } - /** - * Access to the client object so that the client instance doesn't - * have to subscribe to it just to make it available. - */ - protected ClientObject getClientObject () - { - return _clobj; - } - protected static class Response { public String name; @@ -273,7 +264,6 @@ public class InvocationManager protected Client _client; protected DObjectManager _omgr; protected int _imoid; - protected ClientObject _clobj; protected int _invocationId; protected IntMap _targets = new IntMap();