ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/lib/cf.pm
(Generate patch)

Comparing deliantra/server/lib/cf.pm (file contents):
Revision 1.239 by root, Mon Apr 16 06:23:42 2007 UTC vs.
Revision 1.244 by root, Mon Apr 16 13:28:00 2007 UTC

9use Event; 9use Event;
10use Opcode; 10use Opcode;
11use Safe; 11use Safe;
12use Safe::Hole; 12use Safe::Hole;
13 13
14use Coro 3.52 (); 14use Coro 3.61 ();
15use Coro::State; 15use Coro::State;
16use Coro::Event; 16use Coro::Event;
17use Coro::Timer; 17use Coro::Timer;
18use Coro::Signal; 18use Coro::Signal;
19use Coro::Semaphore; 19use Coro::Semaphore;
2384 } 2384 }
2385 2385
2386 1 2386 1
2387} 2387}
2388 2388
2389sub load_archetypes {
2390 load_archetype_file sprintf "%s/archetypes", cf::datadir; # remove when stable
2391 load_archetype_file sprintf "%s/archetypes", cf::datadir
2392}
2393
2394sub load_treasures {
2395 load_treasure_file sprintf "%s/treasures", cf::datadir
2396}
2397
2389sub reload_resources { 2398sub reload_resources {
2390 load_resource_file sprintf "%s/%s/regions", cf::datadir, cf::mapdir 2399 load_resource_file sprintf "%s/%s/regions", cf::datadir, cf::mapdir
2391 or die "unable to load regions file\n";#d# 2400 or die "unable to load regions file\n";
2392 load_facedata 2401 load_facedata
2393 or die "unable to load facedata\n";#d# 2402 or die "unable to load facedata\n";
2403 load_archetypes
2404 or die "unable to load archetypes\n";
2405 load_treasures
2406 or die "unable to load treasurelists\n";
2394} 2407}
2395 2408
2396sub init { 2409sub init {
2397 reload_resources; 2410 reload_resources;
2398} 2411}
2646 2659
2647our @WAIT_FOR_TICK; 2660our @WAIT_FOR_TICK;
2648our @WAIT_FOR_TICK_BEGIN; 2661our @WAIT_FOR_TICK_BEGIN;
2649 2662
2650sub wait_for_tick { 2663sub wait_for_tick {
2664 return unless $TICK_WATCHER->is_active;
2665 return if $Coro::current == $Coro::main;
2666
2651 my $signal = new Coro::Signal; 2667 my $signal = new Coro::Signal;
2652 push @WAIT_FOR_TICK, $signal; 2668 push @WAIT_FOR_TICK, $signal;
2653 $signal->wait; 2669 $signal->wait;
2654} 2670}
2655 2671
2656sub wait_for_tick_begin { 2672sub wait_for_tick_begin {
2673 return unless $TICK_WATCHER->is_active;
2674 return if $Coro::current == $Coro::main;
2675
2657 my $signal = new Coro::Signal; 2676 my $signal = new Coro::Signal;
2658 push @WAIT_FOR_TICK_BEGIN, $signal; 2677 push @WAIT_FOR_TICK_BEGIN, $signal;
2659 $signal->wait; 2678 $signal->wait;
2660} 2679}
2661 2680

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines