*/
void delete_room(void)
{
- char buf[SIZ];
-
+ StrBuf *Line;
serv_puts("KILL 1");
- serv_getln(buf, sizeof buf);
-
- if (buf[0] != '2') {
- strcpy(WC->ImportantMessage, &buf[4]);
+ StrBuf_ServGetln(Line);
+ if (GetServerStatusMsg(Line, NULL, 1, 2) != 2) {
display_main_menu();
- return;
} else {
StrBuf *Buf;
smart_goto(Buf);
FreeStrBuf(&Buf);
}
+ FreeStrBuf(&Line);
}
/*
int succ1, succ2;
if (!havebstr("ok_button")) {
- strcpy(WC->ImportantMessage,
- _("Cancelled. Changes were not saved."));
+ AppendImportantMessage(_("Cancelled. Changes were not saved."), -1);
http_transmit_thing(ChrPtr(do_template("room_edit")), 0);
return;
}
*/
void entroom(void)
{
- char buf[SIZ];
+ StrBuf *Line;
const StrBuf *er_name;
const StrBuf *er_type;
const StrBuf *er_password;
wcsession *WCC = WC;
if (!havebstr("ok_button")) {
- strcpy(WC->ImportantMessage,
- _("Cancelled. No new room was created."));
+ AppendImportantMessage(_("Cancelled. No new room was created."), -1);
display_main_menu();
return;
}
0,
er_view);
- serv_getln(buf, sizeof buf);
- if (buf[0] != '2') {
- strcpy(WCC->ImportantMessage, &buf[4]);
+ Line = NewStrBuf();
+ StrBuf_ServGetln(Line);
+ if (GetServerStatusMsg(Line, NULL, 1, 2) != 2) {
+ FreeStrBuf(&Line);
display_main_menu();
return;
}
gotoroom(er_name);
serv_printf("VIEW %d", er_view);
- serv_getln(buf, sizeof buf);
+ StrBuf_ServGetln(Line);
+ FreeStrBuf(&Line); /* TODO: should we care about errors? */
WCC->CurRoom.view = er_view;
if ( (WCC != NULL) && ( (WCC->CurRoom.RAFlags & UA_ADMINALLOWED) != 0) ) {
} else {
smart_goto(WCC->CurRoom.name);
}
-
+ FreeStrBuf(&Line);
}
* Set the message expire policy for this room and/or floor
*/
void set_room_policy(void) {
- char buf[SIZ];
+ StrBuf *Line;
if (!havebstr("ok_button")) {
- strcpy(WC->ImportantMessage,
- _("Cancelled. Changes were not saved."));
+ AppendImportantMessage(_("Cancelled. Changes were not saved."), -1);
http_transmit_thing(ChrPtr(do_template("room_edit")), 0);
return;
}
+ Line = NewStrBuf();
serv_printf("SPEX roompolicy|%d|%d", ibstr("roompolicy"), ibstr("roomvalue"));
- serv_getln(buf, sizeof buf);
- strcpy(WC->ImportantMessage, &buf[4]);
-
+ StrBuf_ServGetln(Line);
+ GetServerStatusMsg(Line, NULL, 1, 0);
if (WC->axlevel >= 6) {
- strcat(WC->ImportantMessage, "<br>\n");
serv_printf("SPEX floorpolicy|%d|%d", ibstr("floorpolicy"), ibstr("floorvalue"));
- serv_getln(buf, sizeof buf);
- strcat(WC->ImportantMessage, &buf[4]);
+ StrBuf_ServGetln(Line);
+ GetServerStatusMsg(Line, NULL, 1, 0);
}
+ FreeStrBuf(&Line);
ReloadCurrentRoom();
http_transmit_thing(ChrPtr(do_template("room_edit")), 0);
}