- can log off (shows goodbye, and in application lets you connect to a
different server)
-- can recieve express messages (GEXP style, though don't get for multiple
- messages yet)
+- can recieve express messages (GEXP style, will get all messages that
+ are there.
- can send and "reply" to express messages, uses either single or multi
depending on server support.
- who is online (double clicking on list will send express msg to user)
+- supports the IDEN command
+* can't change password or other config stuff
+
"main"
- Splits rooms up into new and no-new
- Go to next room with messages
- go to any old room by double-clicking from list
- * can't get to hidden or guessable-named rooms
-- can go to password protected rooms (untested)
+- can get to hidden or guessable-named rooms
+- can go to password protected rooms (tested)
+- can zap rooms
+ * can't list zapped rooms
"message"
- read new, all, or last-5 message in a room
* the "main" object
*/
+import java.util.*;
+import java.net.InetAddress;
+
public class citadel {
+ public static String VERSION="0.0";
+
String host;
boolean applet;
net theNet;
if( theNet.connect(host) ) {
System.out.println( "Connected to server." );
- getReply( "IDEN 0|7|0.0|Shaggy|err.ahh.umm.com" );
+ getReply( "IDEN 0|7|" + VERSION + "|Shaggy " + VERSION + " (" + getArch() + ")|" + getHostName() );
citReply rep = theNet.getReply( "INFO" );
if( rep.listingFollows() )
serverInfo = new server( rep );
return false;
}
+ public String getArch() {
+ try {
+ Properties p = System.getProperties();
+ return p.get( "os.name" ) + "/" + p.get( "os.arch" );
+ } catch( SecurityException se ) {
+ return "<unknown>";
+ }
+ }
+
+ public String getHostName() {
+ try {
+ InetAddress me = InetAddress.getLocalHost();
+ return me.getHostName();
+ } catch( Exception e ) {
+ return "dunno";
+ }
+ }
+
public String getBlurb() {
if( serverInfo != null ) return serverInfo.blurb;
return "";
cp.mainMenu();
}
+ public boolean floors() {
+ return floors;
+ }
+
public citReply getReply( String s ) {
return getReply( s, (String)null );
}
return theNet.getReply( s,d );
}
- public void enterRoom( String room ) {
- enterRoom( room, null );
- }
-
public void gotoRoom( ) {
gotoRoom( null, false );
}
public void gotoRoom( String name, boolean flag ) {
- /* TODO: prompt for room name */
- System.out.println( "This is where I would ask you for the room's name" );
+ new promptWindow( new gotoPrompt( name ) );
+ }
+
+ public void enterRoom( String room ) {
+ enterRoom( room, null );
}
public void enterRoom( String room, String pass ) {
String cmd = "GOTO " + room;
if( pass != null )
- cmd = cmd + " " + pass;
+ cmd = cmd + "|" + pass;
citReply r=getReply( cmd );
if( r.ok() ) {
rooms.visited( room );
cp.enterRoom( r );
} else if( r.res_code == 540 ) /* ERROR+PASSWORD_REQUIRED */
- new passwordWindow( room );
+ new promptWindow( new roomPassPrompt( room ) );
}
public void showMsgPane() {
msg.setText( "" );
- np.setLabel( room + " (" + citadel.me.rooms.getRoomsFloorName( room )+")" );
+ np.setLabel( room + (citadel.me.floors() ?
+ " (" + citadel.me.rooms.getRoomsFloorName( room )+")" : "" ) );
this.room = room;
this.recip = r;
p.add( ok = new Button( "OK" ) );
add( "South", p );
+ int more = citadel.atoi( r.getArg( 0 ) );
+ if( more != 0 ) new expressWindow( citadel.me.getReply( "GEXP" ) );
+
resize( 300, 300 );
show();
}
}
public boolean action( Event e, Object o ) {
- if( (e.target == newL) || (e.target == oldL) || (e.target == goto_room)) {
+ if( (e.target == newL) || (e.target == oldL) ) {
String room = getRoom();
if( room != null )
citadel.me.enterRoom( room );
Choice reading;
Button who_is_online, room_info;
Button next_room, goto_room, page_user;
- Button next_msg, prev_msg, enter_msg, back;
+ Button next_msg, prev_msg, enter_msg, zap_room, back;
TextField msgInfo;
TextArea theMsg;
NamedPanel np;
vp.add( next_room = new Button( "Next Room" ) );
vp.add( goto_room = new Button( "Goto Room" ) );
vp.add( room_info = new Button( "Room Info" ) );
+ vp.add( zap_room = new Button( "Zap Room" ) );
vp.add( who_is_online = new Button( "Who is Online" ) );
vp.add( page_user = new Button( "Page User" ) );
vp.add( back = new Button( "Back" ) );
citadel.me.nextNewRoom();
} else if( e.target == goto_room ) {
citadel.me.gotoRoom();
+ } else if( e.target == zap_room ) {
+ new promptWindow( new zapPrompt( name ) );
} else if( e.target == back ) {
citadel.me.mainMenu();
}
public void refresh( citReply r ) {
name = r.getArg( 0 );
- np.setLabel( name + " (" + citadel.me.rooms.getRoomsFloorName( name )+")" );
+ np.setLabel( name + (citadel.me.floors() ?
+ " (" + citadel.me.rooms.getRoomsFloorName( name )+")" : "" ) );
total = citadel.atoi( r.getArg( 1 ) );
unread = citadel.atoi( r.getArg( 2 ) );
info = citadel.atoi( r.getArg( 3 ) );