Go to the documentation of this file.
39 long current_time = time(NULL);
50 && (
map->tmpname != NULL)
51 && (strncmp(
map->path,
"/random", 7))) {
57 fprintf(fp,
"%s:%s:%ld:0:0:%d:0:%d\n",
map->path,
map->tmpname,
58 (
map->reset_time == (uint32_t)-1 ? -1 :
map->reset_time-current_time),
75 int do_los, darkness, lock;
79 if (!(fp = fopen(
buf,
"r"))) {
103 sscanf(
tmp[2],
"%u:%d:%d:%hu:%d:%d\n", &
map->reset_time, &lock, &lock, &
map->difficulty, &do_los, &darkness);
106 map->darkness = darkness;
117 map->reset_time += sec;
141 LOG(
llevError,
"Tried to swap out map which was not in memory.\n");
149 LOG(
llevDebug,
"Wanted to swap out map with player.\n");
156 if (!
map->fixed_resettime)
164 if (
map->reset_time <=
seconds() &&
map->reset_group == NULL) {
167 LOG(
llevDebug,
"Resetting map %s instead of swapping it.\n",
map->path);
179 "Failed to swap map %s!",
map->path);
184 map->timeout = 60 +
rndm(0, 30);
211 if (
map->timeout > 1) {
213 }
else if (num_to_swap > 0 &&
map->timeout == 1) {
242 && (show_all || !
pl->hidden))
255 && (
map->tmpname != NULL)
256 && (current_time >=
map->reset_time);
271 if (
map->reset_group == NULL) {
317 if ((
m->unique ||
m->is_template) &&
m->in_memory ==
MAP_SWAPPED) {
318 LOG(
llevDebug,
"Resetting unique or template map %s.\n",
m->path);
static void write_map_log(void)
void LOG(LogLevel logLevel, const char *format,...)
int of_close(OutputFile *of)
FILE * of_open(OutputFile *of, const char *fname)
#define SAVE_ERROR_NOT_IN_MEMORY
#define QUERY_FLAG(xyz, p)
void set_map_timeout(mapstruct *oldmap)
void draw_ext_info_format(int flags, int pri, const object *pl, uint8_t type, uint8_t subtype, const char *format,...) PRINTF_ARGS(6
int rndm(int min, int max)
static event_registration m
bool map_can_reset(const mapstruct *map, long current_time)
int swap_map(mapstruct *map)
size_t split_string(char *str, char *array[], size_t array_size, char sep)
void check_active_maps(void)
void clean_tmp_map(mapstruct *m)
void free_map(mapstruct *m)
void delete_map(mapstruct *m)
mapstruct * get_linked_map(void)
#define MSG_TYPE_ADMIN_LOADSAVE
void set_map_reset_time(mapstruct *map)
void pets_attempt_follow(object *for_owner, int force)
void flush_old_maps(void)
static bool map_can_reset_no_group(const mapstruct *map, long current_time)
int players_on_map(mapstruct *m, int show_all)
int save_map(mapstruct *m, int flag)
#define SAVE_ERROR_PLAYER
void events_execute_global_event(int eventcode,...)