$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
Fri Jul 10 1998 Art Cancro <ajc@uncensored.citadel.org>
* Initial CVS import
-
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
*/
/* 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;
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;
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,