From: Michael Hampton Date: Tue, 25 Jun 2002 15:13:27 +0000 (+0000) Subject: * gotonext() now uses new IPC code to retrieve room listing X-Git-Tag: v7.86~6353 X-Git-Url: https://code.citadel.org/?a=commitdiff_plain;h=3d9954ed0325b78a8cfb7ab67a8c270aa96cccd6;p=citadel.git * gotonext() now uses new IPC code to retrieve room listing --- diff --git a/citadel/ChangeLog b/citadel/ChangeLog index 701ddf15e..8878cad32 100644 --- a/citadel/ChangeLog +++ b/citadel/ChangeLog @@ -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 Fri Jul 10 1998 Art Cancro * Initial CVS import - diff --git a/citadel/citadel.c b/citadel/citadel.c index 5e23b2514..743bbcded 100644 --- a/citadel/citadel.c +++ b/citadel/citadel.c @@ -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 */ diff --git a/citadel/citadel_ipc.c b/citadel/citadel_ipc.c index e26760fe1..ef3e3cdc0 100644 --- a/citadel/citadel_ipc.c +++ b/citadel/citadel_ipc.c @@ -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; diff --git a/citadel/citadel_ipc.h b/citadel/citadel_ipc.h index 8c1c8270e..81c941297 100644 --- a/citadel/citadel_ipc.h +++ b/citadel/citadel_ipc.h @@ -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,