… | |
… | |
457 | |
457 | |
458 | PL_exit_flags |= PERL_EXIT_DESTRUCT_END; |
458 | PL_exit_flags |= PERL_EXIT_DESTRUCT_END; |
459 | |
459 | |
460 | if (perl_parse (perl, xs_init, 2, argv, (char **)NULL) || perl_run (perl)) |
460 | if (perl_parse (perl, xs_init, 2, argv, (char **)NULL) || perl_run (perl)) |
461 | { |
461 | { |
462 | printf ("unable to initialize perl-interpreter, continuing without.\n"); |
462 | printf ("unable to initialize perl-interpreter, aborting.\n"); |
463 | |
463 | |
|
|
464 | exit (EXIT_FAILURE); |
464 | perl_destruct (perl); |
465 | //perl_destruct (perl); |
465 | perl_free (perl); |
466 | //perl_free (perl); |
466 | perl = 0; |
467 | //perl = 0; |
467 | } |
468 | } |
468 | else |
469 | else |
469 | { |
470 | { |
470 | obj_cache = newHV (); |
471 | obj_cache = newHV (); |
471 | } |
472 | } |
… | |
… | |
712 | } |
713 | } |
713 | |
714 | |
714 | return 0; |
715 | return 0; |
715 | } |
716 | } |
716 | |
717 | |
717 | void cfperl_sleep (double delta) |
718 | void cfperl_main () |
718 | { |
719 | { |
719 | dSP; |
720 | dSP; |
720 | ENTER; |
|
|
721 | SAVETMPS; |
|
|
722 | |
721 | |
723 | PUSHMARK (SP); |
722 | PUSHMARK (SP); |
724 | XPUSHs (sv_2mortal (newSVnv (delta))); |
|
|
725 | PUTBACK; |
723 | PUTBACK; |
726 | call_pv ("cf::sleep_delta", G_DISCARD | G_VOID | G_EVAL); |
724 | call_pv ("cf::run", G_DISCARD | G_VOID); |
727 | SPAGAIN; |
725 | SPAGAIN; |
728 | |
726 | PUTBACK; |
729 | FREETMPS; |
|
|
730 | LEAVE; |
|
|
731 | } |
727 | } |
732 | |
728 | |
733 | MODULE = cf PACKAGE = cf PREFIX = cf_ |
729 | MODULE = cf PACKAGE = cf PREFIX = cf_ |
734 | |
730 | |
735 | BOOT: |
731 | BOOT: |
… | |
… | |
744 | const_iv (llevError) |
740 | const_iv (llevError) |
745 | const_iv (llevInfo) |
741 | const_iv (llevInfo) |
746 | const_iv (llevDebug) |
742 | const_iv (llevDebug) |
747 | const_iv (llevMonster) |
743 | const_iv (llevMonster) |
748 | |
744 | |
|
|
745 | const_iv (MAX_TIME) |
749 | const_iv (PLAYER) |
746 | const_iv (PLAYER) |
750 | const_iv (TRANSPORT) |
747 | const_iv (TRANSPORT) |
751 | const_iv (ROD) |
748 | const_iv (ROD) |
752 | const_iv (TREASURE) |
749 | const_iv (TREASURE) |
753 | const_iv (POTION) |
750 | const_iv (POTION) |
… | |
… | |
1416 | |
1413 | |
1417 | NV floor (NV x) |
1414 | NV floor (NV x) |
1418 | |
1415 | |
1419 | NV ceil (NV x) |
1416 | NV ceil (NV x) |
1420 | |
1417 | |
|
|
1418 | void server_tick () |
|
|
1419 | |
1421 | void |
1420 | void |
1422 | LOG (int level, char *msg) |
1421 | LOG (int level, char *msg) |
1423 | PROTOTYPE: $$ |
1422 | PROTOTYPE: $$ |
1424 | C_ARGS: (LogLevel)level, "%s", msg |
1423 | C_ARGS: (LogLevel)level, "%s", msg |
1425 | |
1424 | |