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.75 by root, Mon Oct 12 14:00:59 2009 UTC vs.
Revision 1.79 by root, Fri Nov 6 13:31:47 2009 UTC

26#include <loader.h> 26#include <loader.h>
27#include <sproto.h> 27#include <sproto.h>
28 28
29/* Handles misc. input request - things like hash table, malloc, maps, etc */ 29/* Handles misc. input request - things like hash table, malloc, maps, etc */
30 30
31int
32command_motd (object *op, char *params)
33{
34 display_motd (op);
35 return 1;
36}
37
38typedef struct 31typedef struct
39{ 32{
40 char namebuf[MAX_BUF]; 33 char namebuf[MAX_BUF];
41 int login_order; 34 int login_order;
42} chars_names; 35} chars_names;
65 58
66 sprintf (buf, "Set debug level to %d.", i); 59 sprintf (buf, "Set debug level to %d.", i);
67 new_draw_info (NDI_UNIQUE, 0, op, buf); 60 new_draw_info (NDI_UNIQUE, 0, op, buf);
68 return 1; 61 return 1;
69} 62}
70
71 63
72/* 64/*
73 * Those dumps should be just one dump with good parser 65 * Those dumps should be just one dump with good parser
74 */ 66 */
75 67
273 op->contr->infobox (MSG_CHANNEL ("resistances"), msg); 265 op->contr->infobox (MSG_CHANNEL ("resistances"), msg);
274 266
275 return 0; 267 return 0;
276} 268}
277 269
278/*
279 * Actual commands.
280 * Those should be in small separate files (c_object.c, c_wiz.c, cmove.c,...)
281 */
282
283int
284onoff_value (const char *line)
285{
286 int i;
287
288 if (sscanf (line, "%d", &i))
289 return (i != 0);
290 switch (line[0])
291 {
292 case 'o':
293 switch (line[1])
294 {
295 case 'n':
296 return 1; /* on */
297 default:
298 return 0; /* o[ff] */
299 }
300 case 'y': /* y[es] */
301 case 'k': /* k[ylla] */
302 case 's':
303 case 'd':
304 return 1;
305 case 'n': /* n[o] */
306 case 'e': /* e[i] */
307 case 'u':
308 default:
309 return 0;
310 }
311}
312
313int 270int
314command_title (object *op, char *params) 271command_title (object *op, char *params)
315{ 272{
316 char buf[MAX_BUF]; 273 char buf[MAX_BUF];
317 274

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines