Add a hack so the 'All' room isn't display for hosting

This commit is contained in:
James R 2020-04-13 22:31:11 -07:00
parent 4fd707984b
commit eac7b2e060

View file

@ -201,6 +201,8 @@ HMS_fetch_rooms (int joining)
char *title; char *title;
char *motd; char *motd;
int id_no;
char *p; char *p;
char *end; char *end;
@ -212,7 +214,7 @@ HMS_fetch_rooms (int joining)
{ {
p = hms->buffer; p = hms->buffer;
for (i = 0; i < NUM_LIST_ROOMS && ( end = strstr(p, "\n\n\n") ); ++i) for (i = 0; i < NUM_LIST_ROOMS && ( end = strstr(p, "\n\n\n") );)
{ {
*end = '\0'; *end = '\0';
@ -221,13 +223,24 @@ HMS_fetch_rooms (int joining)
motd = strtok(0, ""); motd = strtok(0, "");
if (id && title && motd) if (id && title && motd)
{
id_no = atoi(id);
/*
Don't show the 'All' room if hosting. And it's a hack like this
because I'm way too lazy to add another feature to the MS.
*/
if (joining || id_no != 0)
{ {
room_list[i].header.buffer[0] = 1; room_list[i].header.buffer[0] = 1;
room_list[i].id = atoi(id); room_list[i].id = id_no;
strlcpy(room_list[i].name, title, sizeof room_list[i].name); strlcpy(room_list[i].name, title, sizeof room_list[i].name);
strlcpy(room_list[i].motd, motd, sizeof room_list[i].motd); strlcpy(room_list[i].motd, motd, sizeof room_list[i].motd);
i++;
}
p = ( end + 3 );/* skip the three linefeeds */ p = ( end + 3 );/* skip the three linefeeds */
} }
else else