Connect to the server specified by our codebase host.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@574 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
//
|
//
|
||||||
// $Id: MiCasaApplet.java,v 1.3 2001/10/25 23:29:00 mdb Exp $
|
// $Id: MiCasaApplet.java,v 1.4 2001/10/25 23:43:02 mdb Exp $
|
||||||
|
|
||||||
package com.threerings.micasa.client;
|
package com.threerings.micasa.client;
|
||||||
|
|
||||||
@@ -31,17 +31,15 @@ public class MiCasaApplet extends Applet
|
|||||||
// create our client instance
|
// create our client instance
|
||||||
_client = new MiCasaClient(_frame);
|
_client = new MiCasaClient(_frame);
|
||||||
|
|
||||||
String username = getParameter("username");
|
String username = requireParameter("username");
|
||||||
if (username == null) {
|
String authkey = requireParameter("authkey");
|
||||||
throw new IOException("Missing username parameter.");
|
String server = getCodeBase().getHost();
|
||||||
}
|
|
||||||
String authkey = getParameter("authkey");
|
|
||||||
if (authkey == null) {
|
|
||||||
throw new IOException("Missing authkey parameter.");
|
|
||||||
}
|
|
||||||
|
|
||||||
Client client = _client.getContext().getClient();
|
Client client = _client.getContext().getClient();
|
||||||
|
|
||||||
|
// indicate which server to which we should connect
|
||||||
|
client.setServer(server, Client.DEFAULT_SERVER_PORT);
|
||||||
|
|
||||||
// create and set our credentials
|
// create and set our credentials
|
||||||
client.setCredentials(
|
client.setCredentials(
|
||||||
new UsernamePasswordCreds(username, authkey));
|
new UsernamePasswordCreds(username, authkey));
|
||||||
@@ -60,6 +58,16 @@ public class MiCasaApplet extends Applet
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected String requireParameter (String name)
|
||||||
|
throws IOException
|
||||||
|
{
|
||||||
|
String value = getParameter(name);
|
||||||
|
if (value == null) {
|
||||||
|
throw new IOException("Applet missing '" + name + "' parameter.");
|
||||||
|
}
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Display the client frame and really get things going.
|
* Display the client frame and really get things going.
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user