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

Comparing deliantra/server/server/cfperl.xs (file contents):
Revision 1.301 by root, Mon Sep 22 23:56:14 2008 UTC vs.
Revision 1.303 by root, Tue Sep 23 04:29:11 2008 UTC

627 PL_exit_flags |= PERL_EXIT_DESTRUCT_END; 627 PL_exit_flags |= PERL_EXIT_DESTRUCT_END;
628 628
629 const char *argv[] = { 629 const char *argv[] = {
630 settings.argv [0], 630 settings.argv [0],
631 "-e" 631 "-e"
632 "use EV; use Coro;" // required for bootstrap 632 "use EV ();"
633 "cf->bootstrap;" // required for datadir :*> 633 "use Coro ();"
634 "cf->bootstrap;"
634 "unshift @INC, cf::datadir ();" 635 "unshift @INC, cf::datadir ();"
635 "require cf;" 636 "require cf;"
636 }; 637 };
637 638
638 if (perl_parse (perl, xs_init, 2, (char **)argv, environ) 639 if (perl_parse (perl, xs_init, 2, (char **)argv, environ)
639 || perl_run (perl)) 640 || perl_run (perl))
640 { 641 {
641 printf ("unable to initialize perl-interpreter, aborting.\n"); 642 printf ("unable to initialize perl-interpreter, aborting.\n");
642 exit (EXIT_FAILURE); 643 exit (EXIT_FAILURE);
643 } 644 }
644
645 {
646 dSP;
647
648 PUSHMARK (SP);
649 PUTBACK;
650 call_pv ("cf::init", G_DISCARD | G_VOID);
651 }
652} 645}
653 646
654void cfperl_main () 647void cfperl_main ()
655{ 648{
656 dSP; 649 dSP;
1521 f (GvGP (gv)->gp_cv); 1514 f (GvGP (gv)->gp_cv);
1522 GvCVGEN (gv) = 0; 1515 GvCVGEN (gv) = 0;
1523 GvMULTI_off (gv); 1516 GvMULTI_off (gv);
1524# undef f 1517# undef f
1525 1518
1526
1527void _connect_to_perl () 1519void _connect_to_perl ()
1528 1520
1529void _recalc_want () 1521void _recalc_want ()
1530 1522
1531void _global_reattach () 1523void _global_reattach ()
1578 len -= 3; 1570 len -= 3;
1579 } 1571 }
1580 1572
1581 SvCUR_set (data_sv, dst - SvPVX (data_sv)); 1573 SvCUR_set (data_sv, dst - SvPVX (data_sv));
1582} 1574}
1575
1576void init_anim ()
1577
1578void init_globals ()
1579
1580void init_experience ()
1581
1582void init_attackmess ()
1583
1584void init_dynamic ()
1585
1586void init_block ()
1587
1588void load_settings ()
1589
1590void load_materials ()
1591
1592void init_uuid ()
1593 CODE:
1594 UUID::init ();
1595
1596void init_signals ()
1597
1598void init_commands ()
1599
1600void init_skills ()
1601
1602void init_beforeplay ()
1583 1603
1584void evthread_start (int aiofd) 1604void evthread_start (int aiofd)
1585 1605
1586void cede_to_tick () 1606void cede_to_tick ()
1587 CODE: 1607 CODE:
2395} 2415}
2396 2416
2397void 2417void
2398maptile::create_region_treasure () 2418maptile::create_region_treasure ()
2399 CODE: 2419 CODE:
2400{
2401 for (int x = 0; x < THIS->width; ++x) 2420 for (int x = 0; x < THIS->width; ++x)
2402 for (int y = 0; y < THIS->height; ++y) 2421 for (int y = 0; y < THIS->height; ++y)
2403 { 2422 {
2404 region *rgn = THIS->region (x, y); 2423 region *rgn = THIS->region (x, y);
2405 2424
2406 //fprintf (stderr, "%d,%d %f %p\n", x, y, rgn->treasure_density,rgn->treasure);//D 2425 //fprintf (stderr, "%d,%d %f %p\n", x, y, rgn->treasure_density,rgn->treasure);//D
2407 if (object *op = THIS->at (x, y).top) 2426 if (object *op = THIS->at (x, y).top)
2408 if (rgn->treasure && rndm () < rgn->treasure_density) 2427 if (rgn->treasure && rndm () < rgn->treasure_density)
2409 create_treasure (rgn->treasure, op, GT_ENVIRONMENT, THIS->difficulty); 2428 create_treasure (rgn->treasure, op, GT_ENVIRONMENT, THIS->difficulty);
2410 } 2429 }
2411}
2412 2430
2413int out_of_map (maptile *map, int x, int y) 2431int out_of_map (maptile *map, int x, int y)
2414 2432
2415void 2433void
2416trigger (maptile *map, long connection, bool state = true) 2434trigger (maptile *map, long connection, bool state = true)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines