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.242 by root, Mon Apr 16 12:37:08 2007 UTC

2384 } 2384 }
2385 2385
2386 1 2386 1
2387} 2387}
2388 2388
2389our $archetypes_loaded;
2390
2391sub load_archetypes {
2392 return 1 if $archetypes_loaded++; # current can only load them once
2393# load_archetype_file sprintf "%s/archetypes", cf::datadir;
2394 load_archetype_file sprintf "%s/archetypes", cf::datadir
2395}
2396
2397sub load_treasures {
2398 load_treasure_file sprintf "%s/treasures", cf::datadir
2399}
2400
2389sub reload_resources { 2401sub reload_resources {
2390 load_resource_file sprintf "%s/%s/regions", cf::datadir, cf::mapdir 2402 load_resource_file sprintf "%s/%s/regions", cf::datadir, cf::mapdir
2391 or die "unable to load regions file\n";#d# 2403 or die "unable to load regions file\n";
2392 load_facedata 2404 load_facedata
2393 or die "unable to load facedata\n";#d# 2405 or die "unable to load facedata\n";
2406 load_archetypes
2407 or die "unable to load archetypes\n";
2408 load_treasures
2409 or die "unable to load treasurelists\n";
2394} 2410}
2395 2411
2396sub init { 2412sub init {
2397 reload_resources; 2413 reload_resources;
2398} 2414}
2646 2662
2647our @WAIT_FOR_TICK; 2663our @WAIT_FOR_TICK;
2648our @WAIT_FOR_TICK_BEGIN; 2664our @WAIT_FOR_TICK_BEGIN;
2649 2665
2650sub wait_for_tick { 2666sub wait_for_tick {
2667 return unless $TICK_WATCHER->is_active;
2668 return if $Coro::current == $Coro::main;
2669
2651 my $signal = new Coro::Signal; 2670 my $signal = new Coro::Signal;
2652 push @WAIT_FOR_TICK, $signal; 2671 push @WAIT_FOR_TICK, $signal;
2653 $signal->wait; 2672 $signal->wait;
2654} 2673}
2655 2674
2656sub wait_for_tick_begin { 2675sub wait_for_tick_begin {
2676 return unless $TICK_WATCHER->is_active;
2677 return if $Coro::current == $Coro::main;
2678
2657 my $signal = new Coro::Signal; 2679 my $signal = new Coro::Signal;
2658 push @WAIT_FOR_TICK_BEGIN, $signal; 2680 push @WAIT_FOR_TICK_BEGIN, $signal;
2659 $signal->wait; 2681 $signal->wait;
2660} 2682}
2661 2683

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines