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.346 by root, Tue Aug 28 19:38:40 2007 UTC vs.
Revision 1.348 by root, Thu Aug 30 08:34:40 2007 UTC

271 271
272Wait until the given lock is available and then acquires it and returns 272Wait until the given lock is available and then acquires it and returns
273a Coro::guard object. If the guard object gets destroyed (goes out of scope, 273a Coro::guard object. If the guard object gets destroyed (goes out of scope,
274for example when the coroutine gets canceled), the lock is automatically 274for example when the coroutine gets canceled), the lock is automatically
275returned. 275returned.
276
277Locks are *not* recursive, locking from the same coro twice results in a
278deadlocked coro.
276 279
277Lock names should begin with a unique identifier (for example, cf::map::find 280Lock names should begin with a unique identifier (for example, cf::map::find
278uses map_find and cf::map::load uses map_load). 281uses map_find and cf::map::load uses map_load).
279 282
280=item $locked = cf::lock_active $string 283=item $locked = cf::lock_active $string
2833# the server's init and main functions 2836# the server's init and main functions
2834 2837
2835sub load_facedata($) { 2838sub load_facedata($) {
2836 my ($path) = @_; 2839 my ($path) = @_;
2837 2840
2841 # HACK to clear player env face cache, we need some signal framework
2842 # for this (global event?)
2843 %ext::player_env::MUSIC_FACE_CACHE = ();
2844
2838 my $enc = JSON::XS->new->utf8->canonical->relaxed; 2845 my $enc = JSON::XS->new->utf8->canonical->relaxed;
2839 2846
2840 warn "loading facedata from $path\n"; 2847 warn "loading facedata from $path\n";
2841 2848
2842 my $facedata; 2849 my $facedata;
2953 $ns->fx_want ($k, $v); 2960 $ns->fx_want ($k, $v);
2954 } 2961 }
2955}; 2962};
2956 2963
2957sub reload_regions { 2964sub reload_regions {
2965 # HACK to clear player env face cache, we need some signal framework
2966 # for this (global event?)
2967 %ext::player_env::MUSIC_FACE_CACHE = ();
2968
2958 load_resource_file "$MAPDIR/regions" 2969 load_resource_file "$MAPDIR/regions"
2959 or die "unable to load regions file\n"; 2970 or die "unable to load regions file\n";
2960 2971
2961 for (cf::region::list) { 2972 for (cf::region::list) {
2962 $_->{match} = qr/$_->{match}/ 2973 $_->{match} = qr/$_->{match}/

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines