Files
narya/src/java/com/threerings/presents/net/AuthRequest.java
T
Michael Bayne 2f7399ed68 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
2002-10-31 18:44:34 +00:00

85 lines
1.9 KiB
Java

//
// $Id: AuthRequest.java,v 1.9 2002/10/31 18:44:34 mdb Exp $
package com.threerings.presents.net;
import java.io.IOException;
import com.threerings.io.ObjectInputStream;
import com.threerings.io.ObjectOutputStream;
public class AuthRequest extends UpstreamMessage
{
/**
* Zero argument constructor used when unserializing an instance.
*/
public AuthRequest ()
{
super();
}
/**
* Constructs a auth request with the supplied credentials and client
* version information.
*/
public AuthRequest (Credentials creds, String version)
{
_creds = creds;
_version = version;
}
/**
* Returns a reference to the credentials provided with this request.
*/
public Credentials getCredentials ()
{
return _creds;
}
/**
* Returns a reference to the version information provided with this
* request.
*/
public String getVersion ()
{
return _version;
}
/**
* Writes our custom streamable fields.
*/
public void writeObject (ObjectOutputStream out)
throws IOException
{
super.writeObject(out);
out.writeObject(_creds);
out.writeUTF(_version);
}
/**
* Reads our custom streamable fields.
*/
public void readObject (ObjectInputStream in)
throws IOException, ClassNotFoundException
{
super.readObject(in);
_creds = (Credentials)in.readObject();
_version = in.readUTF();
}
/**
* Generates a string representation of this instance.
*/
public String toString ()
{
return "[type=AREQ, msgid=" + messageId + ", creds=" + _creds +
", version=" + _version + "]";
}
/** The credentials associated with this auth request. */
protected Credentials _creds;
/** The version information associated with the client code. */
protected String _version;
}