… | |
… | |
30 | /* This loads the settings file. There could be debate whether this should |
30 | /* This loads the settings file. There could be debate whether this should |
31 | * be here or in the common directory - but since only the server needs this |
31 | * be here or in the common directory - but since only the server needs this |
32 | * information, having it here probably makes more sense. |
32 | * information, having it here probably makes more sense. |
33 | */ |
33 | */ |
34 | void |
34 | void |
35 | load_settings (void) |
35 | load_settings () |
36 | { |
36 | { |
37 | char buf[MAX_BUF], *cp; |
37 | char buf[MAX_BUF], *cp; |
38 | int has_val, comp; |
38 | int has_val, comp; |
39 | FILE *fp; |
39 | FILE *fp; |
40 | |
40 | |
… | |
… | |
363 | cfperl_init (); |
363 | cfperl_init (); |
364 | init_done = 1; |
364 | init_done = 1; |
365 | } |
365 | } |
366 | |
366 | |
367 | void |
367 | void |
368 | usage (void) |
368 | usage () |
369 | { |
369 | { |
370 | fprintf (stderr, "Usage: deliantra-server [-h] [-<flags>]...\n"); |
370 | fprintf (stderr, "Usage: deliantra-server [-h] [-<flags>]...\n"); |
371 | } |
371 | } |
372 | |
372 | |
373 | void |
373 | void |
374 | help (void) |
374 | help () |
375 | { |
375 | { |
376 | |
376 | |
377 | /* The information in usage is redundant with what is given below, so why call it? */ |
377 | /* The information in usage is redundant with what is given below, so why call it? */ |
378 | |
378 | |
379 | /* usage();*/ |
379 | /* usage();*/ |
… | |
… | |
463 | signal (SIGINT , SIG_DFL); |
463 | signal (SIGINT , SIG_DFL); |
464 | signal (SIGTERM, SIG_DFL); |
464 | signal (SIGTERM, SIG_DFL); |
465 | } |
465 | } |
466 | |
466 | |
467 | void |
467 | void |
468 | init_signals (void) |
468 | init_signals () |
469 | { |
469 | { |
470 | // large stack, but it's important data we want to save, and it is not usually |
470 | // large stack, but it's important data we want to save, and it is not usually |
471 | // being physically allocated anyways |
471 | // being physically allocated anyways |
472 | const size_t stacksize = 8 * 1024 * 1024 + SIGSTKSZ; |
472 | const size_t stacksize = 8 * 1024 * 1024 + SIGSTKSZ; |
473 | |
473 | |
… | |
… | |
549 | * overwrites old 'race' entries. This routine allow us to quickly |
549 | * overwrites old 'race' entries. This routine allow us to quickly |
550 | * re-configure the 'alignment' of monsters, objects. Useful for |
550 | * re-configure the 'alignment' of monsters, objects. Useful for |
551 | * putting together lists of creatures, etc that belong to gods. |
551 | * putting together lists of creatures, etc that belong to gods. |
552 | */ |
552 | */ |
553 | static void |
553 | static void |
554 | init_races (void) |
554 | init_races () |
555 | { |
555 | { |
556 | FILE *file; |
556 | FILE *file; |
557 | char race[MAX_BUF], fname[MAX_BUF], buf[MAX_BUF], *cp, variable[MAX_BUF]; |
557 | char race[MAX_BUF], fname[MAX_BUF], buf[MAX_BUF], *cp, variable[MAX_BUF]; |
558 | archetype *mon = NULL; |
558 | archetype *mon = NULL; |
559 | static int init_done = 0; |
559 | static int init_done = 0; |
… | |
… | |
634 | fclose (file); |
634 | fclose (file); |
635 | LOG (llevDebug, "done.\n"); |
635 | LOG (llevDebug, "done.\n"); |
636 | } |
636 | } |
637 | |
637 | |
638 | void |
638 | void |
639 | init_beforeplay (void) |
639 | init_beforeplay () |
640 | { |
640 | { |
641 | init_artifacts (); /* If not called before, reads all artifacts from file */ |
641 | init_artifacts (); /* If not called before, reads all artifacts from file */ |
642 | init_races (); /* overwrite race designations using entries in lib/races file */ |
642 | init_races (); /* overwrite race designations using entries in lib/races file */ |
643 | init_gods (); /* init linked list of gods from archs */ |
643 | init_gods (); /* init linked list of gods from archs */ |
644 | init_readable (); /* inits useful arrays for readable texts */ |
644 | init_readable (); /* inits useful arrays for readable texts */ |