changed prompting mechanism, more ui stuff
authorChilly <chilly@uncensored.citadel.org>
Thu, 29 Jul 1999 20:03:09 +0000 (20:03 +0000)
committerChilly <chilly@uncensored.citadel.org>
Thu, 29 Jul 1999 20:03:09 +0000 (20:03 +0000)
shaggy/STATUS
shaggy/citadel.java
shaggy/enterPanel.java
shaggy/expressWindow.java
shaggy/mainPanel.java
shaggy/messagePanel.java

index 25d5017779898509214edc3a46ca170199496aa2..0be01304dd632790a048a62a5f889921560394df 100644 (file)
@@ -6,11 +6,14 @@ Basic:
 - 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
@@ -19,8 +22,10 @@ Basic:
 
 - 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
index 60fcdff4df516484ed8c299ee937ef972671c327..172be7e6107590792db6c6968c3e2b23c5733324 100644 (file)
@@ -3,7 +3,12 @@
  * 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;
@@ -65,7 +70,7 @@ public class citadel {
     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 );
@@ -78,6 +83,24 @@ public class citadel {
     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 "";
@@ -98,6 +121,10 @@ public class citadel {
     cp.mainMenu();
   }
 
+  public boolean floors() {
+    return floors;
+  }
+
   public citReply getReply( String s ) {
     return getReply( s, (String)null );
   }
@@ -108,29 +135,28 @@ public class citadel {
     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() {
index fffae3fd8dc977ec616563c76179516617cb06d7..05dc147461d27c9055ad0709704f98fa9a60d42a 100644 (file)
@@ -54,7 +54,8 @@ public class enterPanel extends Panel {
 
     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;
 
index aea6949a2cadca52716540ee0ee2b511d5e65b72..934a378151a106173848f835cb0be652ee824943 100644 (file)
@@ -28,6 +28,9 @@ public class expressWindow extends Frame {
     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();
   }
index 96ad77a61a676d4e3d996c4693d7a55dec22ec51..499d664385c5dca63af25b3269068ba31292d405 100644 (file)
@@ -43,7 +43,7 @@ public class mainPanel extends Panel {
   }
 
   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 );
index 0f77429c10a36a58d0d6129b0edaa1d5b1402db1..7e47467286ac6720a502cab1254d1479a41b169c 100644 (file)
@@ -8,7 +8,7 @@ public class messagePanel extends Panel {
   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;
@@ -37,6 +37,7 @@ public class messagePanel extends Panel {
     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" ) );
@@ -74,6 +75,8 @@ public class messagePanel extends Panel {
       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();
     }
@@ -82,7 +85,8 @@ public class messagePanel extends Panel {
 
   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 ) );