diff --git a/src/java/com/threerings/micasa/client/MiCasaApplet.java b/src/java/com/threerings/micasa/client/MiCasaApplet.java index 3f9235e79..76ca4ce49 100644 --- a/src/java/com/threerings/micasa/client/MiCasaApplet.java +++ b/src/java/com/threerings/micasa/client/MiCasaApplet.java @@ -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; @@ -31,17 +31,15 @@ public class MiCasaApplet extends Applet // create our client instance _client = new MiCasaClient(_frame); - String username = getParameter("username"); - if (username == null) { - throw new IOException("Missing username parameter."); - } - String authkey = getParameter("authkey"); - if (authkey == null) { - throw new IOException("Missing authkey parameter."); - } + String username = requireParameter("username"); + String authkey = requireParameter("authkey"); + String server = getCodeBase().getHost(); 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 client.setCredentials( 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. */