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

Comparing deliantra/server/server/c_wiz.C (file contents):
Revision 1.14 by root, Sat Sep 16 22:24:13 2006 UTC vs.
Revision 1.15 by root, Sun Oct 1 23:44:36 2006 UTC

73 { 73 {
74 new_draw_info (NDI_UNIQUE, 0, op, "That player is in no state for that right now."); 74 new_draw_info (NDI_UNIQUE, 0, op, "That player is in no state for that right now.");
75 return NULL; 75 return NULL;
76 } 76 }
77 return pl; 77 return pl;
78}
79
80/**
81 * This command will stress server.
82 */
83int
84command_loadtest (object *op, char *params)
85{
86 uint32 x, y;
87 char buf[1024];
88
89 new_draw_info (NDI_UNIQUE, 0, op, "loadtest will stress server through teleporting");
90 new_draw_info (NDI_UNIQUE, 0, op, "at different map places.");
91 new_draw_info (NDI_UNIQUE, 0, op, "use at your own risks.");
92 new_draw_info (NDI_UNIQUE, 0, op, "Very long loop used so server may have to be reset.");
93 new_draw_info (NDI_UNIQUE, 0, op, "type loadtest TRUE to run");
94 new_draw_info_format (NDI_UNIQUE, 0, op, "{%s}", params);
95
96 if (!params)
97 return 0;
98
99 if (strncmp (params, "TRUE", 4))
100 return 0;
101
102 new_draw_info_format (NDI_UNIQUE, 0, op, "gogogo");
103
104 for (x = 0; x < settings.worldmaptilesx; x++)
105 {
106 for (y = 0; y < settings.worldmaptilesy; y++)
107 {
108 sprintf (buf, "/world/world_%d_%d", x + settings.worldmapstartx, y + settings.worldmapstarty);
109 command_goto (op, buf);
110 }
111 }
112
113 return 0;
114} 78}
115 79
116/** 80/**
117 * Actually hides specified player (obviously a DM). 81 * Actually hides specified player (obviously a DM).
118 * If 'silent_dm' is non zero, other players are informed of DM entering/leaving, 82 * If 'silent_dm' is non zero, other players are informed of DM entering/leaving,
317 return 1; 281 return 1;
318 } 282 }
319 283
320 cleanup (); 284 cleanup ();
321 /* not reached */ 285 /* not reached */
322 return 1;
323}
324
325int
326command_goto (object *op, char *params)
327{
328 char *name;
329 object *dummy;
330
331 if (!op)
332 return 0;
333
334 if (params == NULL)
335 {
336 new_draw_info (NDI_UNIQUE, 0, op, "Go to what level?");
337 return 1;
338 }
339
340 name = params;
341 dummy = get_object ();
342 dummy->map = op->map;
343 EXIT_PATH (dummy) = name;
344 dummy->name = name;
345
346 enter_exit (op, dummy);
347 free_object (dummy);
348 if (op->contr->loading == NULL)
349 {
350 new_draw_info_format (NDI_UNIQUE, 0, op, "Difficulty: %d.", op->map->difficulty);
351 }
352
353 return 1;
354}
355
356/* is this function called from somewhere ? -Tero */
357int
358command_generate (object *op, char *params)
359{
360 object *tmp;
361 int nr = 1, i, retry;
362
363 if (!op)
364 return 0;
365
366 if (params != NULL)
367 sscanf (params, "%d", &nr);
368 for (i = 0; i < nr; i++)
369 {
370 retry = 50;
371 while ((tmp = generate_treasure (0, op->map->difficulty)) == NULL && --retry)
372 ;
373 if (tmp != NULL)
374 {
375 tmp = insert_ob_in_ob (tmp, op);
376 if (op->type == PLAYER)
377 esrv_send_item (op, tmp);
378 }
379 }
380
381 return 1; 286 return 1;
382} 287}
383 288
384int 289int
385command_freeze (object *op, char *params) 290command_freeze (object *op, char *params)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines