ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/server/c_misc.C
(Generate patch)

Comparing deliantra/server/server/c_misc.C (file contents):
Revision 1.28 by root, Sat Dec 23 15:49:40 2006 UTC vs.
Revision 1.31 by root, Wed Dec 27 09:28:02 2006 UTC

40 char buf[MAX_BUF], map_path[MAX_BUF]; 40 char buf[MAX_BUF], map_path[MAX_BUF];
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 for (m = first_map; m != NULL; m = m->next)
46 {
47 45
46 for_all_maps (m)
47 {
48 if (search && strstr (m->path, search) == NULL) 48 if (search && !strstr (m->path, search))
49 continue; /* Skip unwanted maps */ 49 continue; /* Skip unwanted maps */
50
50 /* Print out the last 18 characters of the map name... */ 51 /* Print out the last 18 characters of the map name... */
51 if (strlen (m->path) <= 18) 52 if (strlen (m->path) <= 18)
52 strcpy (map_path, m->path); 53 strcpy (map_path, m->path);
53 else 54 else
54 strcpy (map_path, m->path + strlen (m->path) - 18); 55 strcpy (map_path, m->path + strlen (m->path) - 18);
56
55 sprintf (buf, "%-18.18s %2d %2d %1d %4d %2d %02d:%02d:%02d", 57 sprintf (buf, "%-18.18s %2d %2d %1d %4d %2d %02d:%02d:%02d",
56 map_path, m->players, players_on_map (m, FALSE), 58 map_path, m->players, players_on_map (m, FALSE),
57 m->in_memory, m->timeout, m->difficulty, 59 m->in_memory, m->timeout, m->difficulty,
58 (MAP_WHEN_RESET (m) % 86400) / 3600, (MAP_WHEN_RESET (m) % 3600) / 60, MAP_WHEN_RESET (m) % 60); 60 (m->reset_time % 86400) / 3600, (m->reset_time % 3600) / 60, m->reset_time % 60);
59 new_draw_info (NDI_UNIQUE, 0, op, buf); 61 new_draw_info (NDI_UNIQUE, 0, op, buf);
60 } 62 }
61} 63}
62 64
63/* This command dumps the body information for object *op. 65/* This command dumps the body information for object *op.
155 157
156 if (QUERY_FLAG (op, FLAG_WIZ)) 158 if (QUERY_FLAG (op, FLAG_WIZ))
157 { 159 {
158 new_draw_info_format (NDI_UNIQUE, 0, op, 160 new_draw_info_format (NDI_UNIQUE, 0, op,
159 "players:%d difficulty:%d size:%dx%d start:%dx%d timeout %ld", 161 "players:%d difficulty:%d size:%dx%d start:%dx%d timeout %ld",
160 m->players, m->difficulty, MAP_WIDTH (m), MAP_HEIGHT (m), MAP_ENTER_X (m), MAP_ENTER_Y (m), MAP_TIMEOUT (m)); 162 m->players, m->difficulty, m->width, m->height, m->enter_x, m->enter_y, m->timeout);
161 163
162 } 164 }
163 if (m->msg) 165 if (m->msg)
164 new_draw_info (NDI_UNIQUE, NDI_NAVY, op, m->msg); 166 new_draw_info (NDI_UNIQUE, NDI_NAVY, op, m->msg);
165} 167}
1328 object *tmp; 1330 object *tmp;
1329 1331
1330 for (mp = styles; mp != NULL; mp = mp->next) 1332 for (mp = styles; mp != NULL; mp = mp->next)
1331 { 1333 {
1332 maps_used++; 1334 maps_used++;
1333 mapmem += MAP_WIDTH (mp) * MAP_HEIGHT (mp) * (sizeof (object *) + sizeof (mapspace)) + sizeof (maptile); 1335 mapmem += mp->width * mp->height * (sizeof (object *) + sizeof (mapspace)) + sizeof (maptile);
1334 for (x = 0; x < MAP_WIDTH (mp); x++) 1336 for (x = 0; x < mp->width; x++)
1335 { 1337 {
1336 for (y = 0; y < MAP_HEIGHT (mp); y++) 1338 for (y = 0; y < mp->height; y++)
1337 { 1339 {
1338 for (tmp = GET_MAP_OB (mp, x, y); tmp != NULL; tmp = tmp->above) 1340 for (tmp = GET_MAP_OB (mp, x, y); tmp != NULL; tmp = tmp->above)
1339 objects_used++; 1341 objects_used++;
1340 } 1342 }
1341 } 1343 }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines