… | |
… | |
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 | |
31 | int |
|
|
32 | command_motd (object *op, char *params) |
|
|
33 | { |
|
|
34 | display_motd (op); |
|
|
35 | return 1; |
|
|
36 | } |
|
|
37 | |
|
|
38 | typedef struct |
31 | typedef 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 | |
|
|
283 | int |
|
|
284 | onoff_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 | |
|
|
313 | int |
270 | int |
314 | command_title (object *op, char *params) |
271 | command_title (object *op, char *params) |
315 | { |
272 | { |
316 | char buf[MAX_BUF]; |
273 | char buf[MAX_BUF]; |
317 | |
274 | |