#include <string.h>
#include <sys/stat.h>
#include <time.h>
+#include <limits.h>
#include <pthread.h>
#include "citadel.h"
#include "server.h"
char newroom[256];
char buf[256];
int a;
- int target_room = (-1);
struct quickroom qrbuf;
extract(filename,cmdbuf,0);
return;
}
- for (a=0; a<MAXROOMS; ++a) {
- getroom(&qrbuf,a);
- if (!strcasecmp(qrbuf.QRname,newroom)) target_room = a;
- }
- if (target_room < 0) {
- cprintf("%d Room '%s' not found.\n",
- ERROR+ROOM_NOT_FOUND,newroom);
+ if (getroom(&qrbuf, newroom)!=0) {
+ cprintf("%d '%s' does not exist.\n",
+ ERROR, newroom);
return;
}
- getroom(&qrbuf, target_room);
if ((qrbuf.QRflags & QR_DIRECTORY) == 0) {
cprintf("%d '%s' is not a directory room.\n",
ERROR+NOT_HERE,qrbuf.QRname);
sprintf(pathname, "./images/floor.%d.gif", which_floor);
}
else if (!strcasecmp(filename, "_roompic_")) {
- sprintf(pathname, "./images/room.%d.gif", CC->curr_rm);
+ assoc_file_name(pathname, &CC->quickroom, "images");
}
else {
for (a=0; a<strlen(filename); ++a) {
}
if ( (!strcasecmp(basenm, "_roompic_")) && (is_room_aide()) ) {
- sprintf(CC->upl_path, "./images/room.%d.gif", CC->curr_rm);
+ assoc_file_name(CC->upl_path, &CC->quickroom, "images");
}
if (strlen(CC->upl_path) == 0) {