2 * Java client for Citadel/UX
3 * Copyright (C) 1997 by Art Cancro - All Rights Reserved
5 * This module is designed to be able to run either as an application or
11 public class wcchat extends Applet {
13 String ServerHost = "uncnsrd.mt-kisco.ny.us";
18 /* Unless overridden, the Citadel server is expected to be
19 * the same as the applet host. In most cases this is all
20 * that's allowed anyway.
22 if (getDocumentBase() != null) {
23 ServerHost = getDocumentBase().getHost();
26 /* The 'host' parameter tells the client to look somewhere other
27 * than the applet host for the Citadel server.
29 if (getParameter("host") != null) {
30 ServerHost = getParameter("host");
33 /* The 'port' parameter tells the client to look on a
34 * nonstandard port for the Citadel server.
36 if (getParameter("port") != null) {
37 ServerPort = Integer.parseInt(getParameter("port"));
43 wcCitServer serv = new wcCitServer();
46 serv.AttachToServer(ServerHost, ServerPort);
47 buf = serv.ServTrans("USER " + getParameter("username"));
48 if (buf.charAt(0) == '3') {
49 buf = serv.ServTrans("PASS "+getParameter("password"));
50 if (buf.charAt(0) == '2') {
51 serv.SetUserName(wcCitUtil.Extract(buf.substring(4), 0));
52 buf = serv.ServTrans("GOTO "+getParameter("roomname"));
53 new MultiUserChat102(serv, this);
57 System.out.println("ooops...");