/* A basic extension of the java.awt.Frame class */ import java.awt.*; import java.util.*; import twinfeats.io.*; import twinfeats.chat.*; import twinfeats.conf.core.*; import twinfeats.awt.*; import twinfeats.jar.*; import java.io.*; import twinfeats.util.*; import java.awt.event.*; import twinfeats.awt.TFTreeView; public class ConfServer extends Frame implements ConfMaster, FilenameFilter, SelectionListener, PopupTrigger, ActionListener { public static String VERSION = "TFC v1.1"; String name; int port; Comm comm; Hashtable users = new Hashtable(); static Class[] serverBeans; static Profile profile; Image redball,greenball,blueball; Vector publicConfs = new Vector(); PopupMenu popup; Hashtable confs = new Hashtable(); Hashtable recorders = new Hashtable(); Hashtable players = new Hashtable(); public final String USERSCONNECTING = "Users connecting"; public Comm getComm() { return comm; } public void record(String conf, CommMessage msg) { msg.setStamp(System.currentTimeMillis()); ConfRecorder r = (ConfRecorder)recorders.get(conf); if (r != null) r.record(msg); } class HandleLogon implements twinfeats.io.GenericMessageListener { HandleLogon() { } /** * CommMessageListener: A message has been received */ public void message(CommMessageEvent cme) { CommMessage cm = cme.getCommMessage(); String src = cm.getHeader().getSource(); MsgLogon body = (MsgLogon)cm.getBody(); if (!body.getVersion().equals(VERSION)) { body.setSuccess(false); body.setResult("Version mismatch, please download"); comm.reply(cm,body); return; } if (body.isNewUser()) { SecureUser su = SecureUser.findUser(src); if (su != null) { body.setSuccess(false); body.setResult("Duplicate User name"); } else { String pw = ""+(int)((Math.random()*899999)+100000); try { su = SecureUser.addUser(src,body.getEncodedPassword(),pw,"New"); SMTP mail = new SMTP("smtp.tconl.com","TwinFeats"); String[] sa = new String[1]; for (int i=0;i 0) { MsgConfInProgress[] ip = new MsgConfInProgress[l]; i = 0; String s; /* if (publicConfs != null) { for (;i