… | |
… | |
35 | |
35 | |
36 | void |
36 | void |
37 | map_info (object *op, char *search) |
37 | map_info (object *op, char *search) |
38 | { |
38 | { |
39 | maptile *m; |
39 | maptile *m; |
40 | char buf[MAX_BUF], map_path[MAX_BUF]; |
40 | char buf[MAX_BUF], map_path[31]; |
41 | long sec = time (0); |
41 | long sec = time (0); |
42 | |
42 | |
43 | new_draw_info_format (NDI_UNIQUE, 0, op, "Current time is: %02ld:%02ld:%02ld.", (sec % 86400) / 3600, (sec % 3600) / 60, sec % 60); |
43 | new_draw_info_format (NDI_UNIQUE, 0, op, "Current time is: %02ld:%02ld:%02ld.", (sec % 86400) / 3600, (sec % 3600) / 60, sec % 60); |
44 | new_draw_info (NDI_UNIQUE, 0, op, "Path Pl PlM IM TO Dif Reset"); |
44 | new_draw_info (NDI_UNIQUE, 0, op, "Path Pl PlM IM TO Dif Reset"); |
45 | |
45 | |
46 | for_all_maps (m) |
46 | for_all_maps (m) |
47 | { |
47 | { |
48 | if (search && !strstr (m->path, search)) |
48 | if (search && !strstr (m->path, search)) |
49 | continue; /* Skip unwanted maps */ |
49 | continue; /* Skip unwanted maps */ |
50 | |
50 | |
51 | /* Print out the last 18 characters of the map name... */ |
51 | /* Print out the last 30 characters of the map name... */ |
52 | if (strlen (m->path) <= 18) |
|
|
53 | strcpy (map_path, m->path); |
|
|
54 | else |
|
|
55 | strcpy (map_path, m->path + strlen (m->path) - 18); |
52 | strcpy (map_path, m->path + max (0, (int)strlen (m->path) - 30)); |
56 | |
53 | |
57 | sprintf (buf, "%-18.18s %2d %2d %1d %4d %2d %02d:%02d:%02d", |
54 | sprintf (buf, "%-30.30s %2d %2d %1d %4d %2d %02d:%02d:%02d", |
58 | map_path, m->players, players_on_map (m, FALSE), |
55 | map_path, m->players, players_on_map (m, FALSE), |
59 | m->in_memory, m->timeout, m->difficulty, |
56 | m->in_memory, m->timeout, m->difficulty, |
60 | (m->reset_time % 86400) / 3600, (m->reset_time % 3600) / 60, m->reset_time % 60); |
57 | (m->reset_time % 86400) / 3600, (m->reset_time % 3600) / 60, m->reset_time % 60); |
61 | new_draw_info (NDI_UNIQUE, 0, op, buf); |
58 | new_draw_info (NDI_UNIQUE, 0, op, buf); |
62 | } |
59 | } |