Added support for specifying a version string during the client

authentication process.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1870 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Michael Bayne
2002-10-31 18:44:34 +00:00
parent f1c8ccd347
commit 2f7399ed68
3 changed files with 55 additions and 12 deletions
@@ -1,5 +1,5 @@
//
// $Id: Client.java,v 1.33 2002/10/29 23:51:26 mdb Exp $
// $Id: Client.java,v 1.34 2002/10/31 18:44:34 mdb Exp $
package com.threerings.presents.client;
@@ -155,6 +155,24 @@ public class Client
_creds = creds;
}
/**
* Returns the version string configured for this client.
*/
public String getVersion ()
{
return _version;
}
/**
* Sets the version string reported to the server during
* authentication. Some server implementations may wish to refuse
* connections by old or invalid client versions.
*/
public void setVersion (String version)
{
_version = version;
}
/**
* Returns the distributed object manager associated with this
* session. This reference is only valid for the duration of the
@@ -545,6 +563,9 @@ public class Client
/** The credentials we used to authenticate with the server. */
protected Credentials _creds;
/** The version string reported to the server at auth time. */
protected String _version = "";
/** An entity that gives us the ability to process events on the main
* client thread (which is also the AWT thread). */
protected Invoker _invoker;
@@ -1,5 +1,5 @@
//
// $Id: Communicator.java,v 1.23 2002/10/30 18:46:33 mdb Exp $
// $Id: Communicator.java,v 1.24 2002/10/31 18:44:34 mdb Exp $
package com.threerings.presents.client;
@@ -401,7 +401,8 @@ public class Communicator
throws IOException, LogonException
{
// construct an auth request and send it
AuthRequest req = new AuthRequest(_client.getCredentials());
AuthRequest req = new AuthRequest(_client.getCredentials(),
_client.getVersion());
sendMessage(req);
// now wait for the auth response