50 long current_time = time(NULL);
53 if (!(fp = fopen(buf,
"w"))) {
63 && (strncmp(map->
path,
"/random", 7))) {
69 fprintf(fp,
"%s:%s:%ld:0:0:%d:0:%d\n", map->
path, map->
tmpname,
87 int do_los, darkness, lock;
91 if (!(fp = fopen(buf,
"r"))) {
95 while (fgets(buf,
MAX_BUF, fp) != NULL) {
101 cp = strchr(buf,
':');
103 strcpy(map->
path, buf);
104 cp1 = strchr(cp,
':');
112 sscanf(cp1,
"%u:%d:%d:%hu:%d:%d\n", &map->
reset_time, &lock, &lock, &map->
difficulty, &do_los, &darkness);
151 LOG(
llevError,
"Tried to swap out map which was not in memory.\n");
159 LOG(
llevDebug,
"Wanted to swap out map with player.\n");
186 "Failed to swap map %s!", NULL, map->
path);
209 for (map =
first_map; map != NULL; map = next) {
218 #ifndef MAX_OBJECTS_LWM
238 && strcmp(map->
path, except_level)
241 chosen = map, timeout = map->
timeout;
259 #ifdef MAX_OBJECTS_LWM
295 && (show_all || !pl->
hidden))
338 || sec < m->reset_time) {
void set_map_timeout(mapstruct *oldmap)
mapstruct * get_linked_map(void)
void swap_below_max(const char *except_level)
static void write_map_log(void)
void check_active_maps(void)
void free_map(mapstruct *m)
void draw_ext_info_format(int flags, int pri, const object *pl, uint8 type, uint8 subtype, const char *new_format, const char *old_format,...)
int players_on_map(mapstruct *m, int show_all)
static mapstruct * map_least_timeout(const char *except_level)
int execute_global_event(int eventcode,...)
void remove_all_pets(void)
#define QUERY_FLAG(xyz, p)
char * strdup_local(const char *str)
int save_map(mapstruct *m, int flag)
int snprintf(char *dest, int max, const char *format,...)
void set_map_reset_time(mapstruct *map)
void flush_old_maps(void)
int swap_map(mapstruct *map)
void delete_map(mapstruct *m)
EXTERN player * first_player
void LOG(LogLevel logLevel, const char *format,...)
#define MSG_TYPE_ADMIN_LOADSAVE
#define SAVE_ERROR_PLAYER
void clean_tmp_map(mapstruct *m)
EXTERN mapstruct * first_map
#define SAVE_ERROR_NOT_IN_MEMORY