* gotonext() now uses new IPC code to retrieve room listing
authorMichael Hampton <io_error@uncensored.citadel.org>
Tue, 25 Jun 2002 15:13:27 +0000 (15:13 +0000)
committerMichael Hampton <io_error@uncensored.citadel.org>
Tue, 25 Jun 2002 15:13:27 +0000 (15:13 +0000)
citadel/ChangeLog
citadel/citadel.c
citadel/citadel_ipc.c
citadel/citadel_ipc.h

index 701ddf15e6ba9b8370a5e9909f3aaa6c31cc7ad8..8878cad325eac36926f50903eb3250ec10f749f1 100644 (file)
@@ -1,4 +1,7 @@
  $Log$
+ Revision 591.56  2002/06/25 15:13:27  error
+ * gotonext() now uses new IPC code to retrieve room listing
+
  Revision 591.55  2002/06/25 14:21:35  error
  * remove a debugging trap I accidentally left in the code
 
@@ -3773,4 +3776,3 @@ Sat Jul 11 00:20:48 EDT 1998 Nathan Bryant <bryant@cs.usm.maine.edu>
 
 Fri Jul 10 1998 Art Cancro <ajc@uncensored.citadel.org>
        * Initial CVS import
-
index 5e23b25145b48daebbf6b30d9fd8b409a9e3d0c4..743bbcded59fdd623ff856d83ab3b2d06cbe6e17 100644 (file)
@@ -472,29 +472,13 @@ void gotonext(void)
        char buf[SIZ];
        struct march *mptr, *mptr2;
        char next_room[ROOMNAMELEN];
+       int r;                          /* IPC response code */
 
        /* Check to see if the march-mode list is already allocated.
         * If it is, pop the first room off the list and go there.
         */
        if (march == NULL) {
-               serv_puts("LKRN");
-               serv_gets(buf);
-               if (buf[0] == '1')
-                       while (serv_gets(buf), strcmp(buf, "000")) {
-                               mptr = (struct march *) malloc(sizeof(struct march));
-                               mptr->next = NULL;
-                               extract(mptr->march_name, buf, 0);
-                               mptr->march_floor = (char) (extract_int(buf, 2) & 0x7F);
-                               mptr->march_order = (char) (extract_int(buf, 3) & 0x7F);
-                               if (march == NULL) {
-                                       march = mptr;
-                               } else {
-                                       mptr2 = march;
-                                       while (mptr2->next != NULL)
-                                               mptr2 = mptr2->next;
-                                       mptr2->next = mptr;
-                               }
-                       }
+               r = CtdlIPCKnownRooms(1, -1, &march, buf);
 /* add _BASEROOM_ to the end of the march list, so the user will end up
  * in the system base room (usually the Lobby>) at the end of the loop
  */
index e26760fe1780201787dcb4bc9c01a284d9352170..ef3e3cdc046905f757064d92122ff7a14fc7d576 100644 (file)
@@ -203,7 +203,7 @@ int CtdlIPCChangePassword(const char *passwd, char *cret)
 /* Caller must free the march list */
 /* which is 0 = LRMS, 1 = LKRN, 2 = LKRO, 3 = LKRA, 4 = LZRM */
 /* floor is -1 for all, or floornum */
-int CtdlIPCKnownRooms(int which, int floor, char *cret, struct march **listing)
+int CtdlIPCKnownRooms(int which, int floor, struct march **listing, char *cret)
 {
        register int ret;
        struct march *march = NULL;
@@ -223,12 +223,12 @@ int CtdlIPCKnownRooms(int which, int floor, char *cret, struct march **listing)
        if (ret / 100 == 1) {
                struct march *mptr;
 
-               while (strlen(bbb)) {
+               while (bbb && strlen(bbb)) {
                        int a;
 
                        extract_token(aaa, bbb, 0, '\n');
                        a = strlen(aaa);
-                       memmove(aaa, bbb + a + 1, strlen(bbb) - a - 1);
+                       memmove(bbb, bbb + a + 1, strlen(bbb) - a);
                        mptr = (struct march *) malloc(sizeof (struct march));
                        if (mptr) {
                                mptr->next = NULL;
index 8c1c8270e3a3361ac83200093bdab7a4a32b6668..81c941297c5619c21ffdeab8d8833ee83178e98f 100644 (file)
@@ -64,7 +64,7 @@ int CtdlIPCTryLogin(const char *username, char *cret);
 int CtdlIPCTryPassword(const char *passwd, char *cret);
 int CtdlIPCCreateUser(const char *username, char *cret);
 int CtdlIPCChangePassword(const char *passwd, char *cret);
-int CtdlIPCKnownRooms(int which, int floor, char *cret, struct march **listing);
+int CtdlIPCKnownRooms(int which, int floor, struct march **listing, char *cret);
 int CtdlIPCGetConfig(struct usersupp **uret, char *cret);
 int CtdlIPCSetConfig(struct usersupp *uret, char *cret);
 int CtdlIPCGotoRoom(const char *room, const char *passwd,