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.27 by root, Fri Dec 22 16:34:00 2006 UTC vs.
Revision 1.30 by root, Mon Dec 25 14:54:44 2006 UTC

53 else 53 else
54 strcpy (map_path, m->path + strlen (m->path) - 18); 54 strcpy (map_path, m->path + strlen (m->path) - 18);
55 sprintf (buf, "%-18.18s %2d %2d %1d %4d %2d %02d:%02d:%02d", 55 sprintf (buf, "%-18.18s %2d %2d %1d %4d %2d %02d:%02d:%02d",
56 map_path, m->players, players_on_map (m, FALSE), 56 map_path, m->players, players_on_map (m, FALSE),
57 m->in_memory, m->timeout, m->difficulty, 57 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); 58 (m->reset_time % 86400) / 3600, (m->reset_time % 3600) / 60, m->reset_time % 60);
59 new_draw_info (NDI_UNIQUE, 0, op, buf); 59 new_draw_info (NDI_UNIQUE, 0, op, buf);
60 } 60 }
61} 61}
62 62
63/* This command dumps the body information for object *op. 63/* This command dumps the body information for object *op.
155 155
156 if (QUERY_FLAG (op, FLAG_WIZ)) 156 if (QUERY_FLAG (op, FLAG_WIZ))
157 { 157 {
158 new_draw_info_format (NDI_UNIQUE, 0, op, 158 new_draw_info_format (NDI_UNIQUE, 0, op,
159 "players:%d difficulty:%d size:%dx%d start:%dx%d timeout %ld", 159 "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)); 160 m->players, m->difficulty, m->width, m->height, m->enter_x, m->enter_y, m->timeout);
161 161
162 } 162 }
163 if (m->msg) 163 if (m->msg)
164 new_draw_info (NDI_UNIQUE, NDI_NAVY, op, m->msg); 164 new_draw_info (NDI_UNIQUE, NDI_NAVY, op, m->msg);
165} 165}
192 */ 192 */
193 for (reg = first_region; reg != NULL; reg = reg->next) 193 for (reg = first_region; reg != NULL; reg = reg->next)
194 { 194 {
195 reg->counter = 0; 195 reg->counter = 0;
196 } 196 }
197 for (pl = first_player; pl != NULL; pl = pl->next) 197 for_all_players (pl)
198 if (pl->ob->map != NULL) 198 if (pl->ob->map != NULL)
199 get_region_by_map (pl->ob->map)->counter++; 199 get_region_by_map (pl->ob->map)->counter++;
200 200
201 /* we only want to print out by places with a 'longname' field... */ 201 /* we only want to print out by places with a 'longname' field... */
202 for (reg = first_region; reg != NULL; reg = reg->next) 202 for (reg = first_region; reg != NULL; reg = reg->next)
226} chars_names; 226} chars_names;
227 227
228int 228int
229command_afk (object *op, char *params) 229command_afk (object *op, char *params)
230{ 230{
231 if (QUERY_FLAG (op, FLAG_AFK)) 231 if ((op->contr->ns->afk = !op->contr->ns->afk))
232 {
233 CLEAR_FLAG (op, FLAG_AFK);
234 new_draw_info (NDI_UNIQUE, 0, op, "You are no longer AFK"); 232 new_draw_info (NDI_UNIQUE, 0, op, "You are no longer AFK");
235 }
236 else 233 else
237 {
238 SET_FLAG (op, FLAG_AFK);
239 new_draw_info (NDI_UNIQUE, 0, op, "You are now AFK"); 234 new_draw_info (NDI_UNIQUE, 0, op, "You are now AFK");
240 }
241 235
242 return 1; 236 return 1;
243} 237}
244 238
245int 239int
1334 object *tmp; 1328 object *tmp;
1335 1329
1336 for (mp = styles; mp != NULL; mp = mp->next) 1330 for (mp = styles; mp != NULL; mp = mp->next)
1337 { 1331 {
1338 maps_used++; 1332 maps_used++;
1339 mapmem += MAP_WIDTH (mp) * MAP_HEIGHT (mp) * (sizeof (object *) + sizeof (mapspace)) + sizeof (maptile); 1333 mapmem += mp->width * mp->height * (sizeof (object *) + sizeof (mapspace)) + sizeof (maptile);
1340 for (x = 0; x < MAP_WIDTH (mp); x++) 1334 for (x = 0; x < mp->width; x++)
1341 { 1335 {
1342 for (y = 0; y < MAP_HEIGHT (mp); y++) 1336 for (y = 0; y < mp->height; y++)
1343 { 1337 {
1344 for (tmp = GET_MAP_OB (mp, x, y); tmp != NULL; tmp = tmp->above) 1338 for (tmp = GET_MAP_OB (mp, x, y); tmp != NULL; tmp = tmp->above)
1345 objects_used++; 1339 objects_used++;
1346 } 1340 }
1347 } 1341 }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines