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.550 by root, Fri May 14 22:56:47 2010 UTC vs.
Revision 1.555 by root, Wed Jun 30 01:32:56 2010 UTC

1863 1863
1864 my $lock = cf::lock_acquire "generate_random_map"; # the random map generator is NOT reentrant ATM 1864 my $lock = cf::lock_acquire "generate_random_map"; # the random map generator is NOT reentrant ATM
1865 1865
1866 # mit "rum" bekleckern, nicht 1866 # mit "rum" bekleckern, nicht
1867 $self->_create_random_map ( 1867 $self->_create_random_map (
1868 $rmp->{wallstyle}, $rmp->{wall_name}, $rmp->{floorstyle}, $rmp->{monsterstyle}, 1868 $rmp, $rmp->{total_map_hp},
1869 $rmp->{treasurestyle}, $rmp->{layoutstyle}, $rmp->{doorstyle}, $rmp->{decorstyle}, $rmp->{miningstyle},
1870 $rmp->{origin_map}, $rmp->{final_map}, $rmp->{exitstyle}, $rmp->{this_map},
1871 $rmp->{exit_on_final_map},
1872 $rmp->{xsize}, $rmp->{ysize},
1873 $rmp->{expand2x}, $rmp->{layoutoptions1}, $rmp->{layoutoptions2}, $rmp->{layoutoptions3},
1874 $rmp->{symmetry}, $rmp->{difficulty}, $rmp->{difficulty_given}, $rmp->{difficulty_increase},
1875 $rmp->{dungeon_level}, $rmp->{dungeon_depth}, $rmp->{decoroptions}, $rmp->{orientation},
1876 $rmp->{origin_y}, $rmp->{origin_x}, $rmp->{random_seed}, $rmp->{total_map_hp},
1877 $rmp->{map_layout_style}, $rmp->{treasureoptions}, $rmp->{symmetry_used},
1878 (cf::region::find $rmp->{region}), $rmp->{custom} 1869 (cf::region::find $rmp->{region})
1879 ) 1870 )
1880} 1871}
1881 1872
1882=item cf::map->register ($regex, $prio) 1873=item cf::map->register ($regex, $prio)
1883 1874
1935 $base =~ s{[^/]+/?$}{}; 1926 $base =~ s{[^/]+/?$}{};
1936 $path = "$base/$path"; 1927 $path = "$base/$path";
1937 } 1928 }
1938 1929
1939 for ($path) { 1930 for ($path) {
1940 redo if s{//}{/};
1941 redo if s{/\.?/}{/}; 1931 redo if s{/\.?/}{/};
1942 redo if s{/[^/]+/\.\./}{/}; 1932 redo if s{/[^/]+/\.\./}{/};
1943 } 1933 }
1944 1934
1945 $path 1935 $path
2187 2177
2188 $self->in_memory (cf::MAP_ACTIVE); 2178 $self->in_memory (cf::MAP_ACTIVE);
2189 } 2179 }
2190 2180
2191 $self->post_load; 2181 $self->post_load;
2182
2183 1
2192} 2184}
2193 2185
2194# customize the map for a given player, i.e. 2186# customize the map for a given player, i.e.
2195# return the _real_ map. used by e.g. per-player 2187# return the _real_ map. used by e.g. per-player
2196# maps to change the path to ~playername/mappath 2188# maps to change the path to ~playername/mappath
4150 IO::AIO::min_parallel 8; 4142 IO::AIO::min_parallel 8;
4151 IO::AIO::max_poll_time $TICK * 0.1; 4143 IO::AIO::max_poll_time $TICK * 0.1;
4152 undef $AnyEvent::AIO::WATCHER; 4144 undef $AnyEvent::AIO::WATCHER;
4153} 4145}
4154 4146
4155my $_log_backtrace; 4147our $_log_backtrace;
4148our $_log_backtrace_last;
4156 4149
4157sub _log_backtrace { 4150sub _log_backtrace {
4158 my ($msg, @addr) = @_; 4151 my ($msg, @addr) = @_;
4159 4152
4160 $msg =~ s/\n//; 4153 $msg =~ s/\n$//;
4161 4154
4155 if ($_log_backtrace_last eq $msg) {
4156 LOG llevInfo, "[ABT] $msg\n";
4157 LOG llevInfo, "[ABT] [duplicate, suppressed]\n";
4162 # limit the # of concurrent backtraces 4158 # limit the # of concurrent backtraces
4163 if ($_log_backtrace < 2) { 4159 } elsif ($_log_backtrace < 2) {
4160 $_log_backtrace_last = $msg;
4164 ++$_log_backtrace; 4161 ++$_log_backtrace;
4165 my $perl_bt = Carp::longmess $msg; 4162 my $perl_bt = Carp::longmess $msg;
4166 async { 4163 async {
4167 $Coro::current->{desc} = "abt $msg"; 4164 $Coro::current->{desc} = "abt $msg";
4168 4165
4188 LOG llevInfo, "[ABT] $_\n" for @bt; 4185 LOG llevInfo, "[ABT] $_\n" for @bt;
4189 --$_log_backtrace; 4186 --$_log_backtrace;
4190 }; 4187 };
4191 } else { 4188 } else {
4192 LOG llevInfo, "[ABT] $msg\n"; 4189 LOG llevInfo, "[ABT] $msg\n";
4193 LOG llevInfo, "[ABT] [suppressed]\n"; 4190 LOG llevInfo, "[ABT] [overload, suppressed]\n";
4194 } 4191 }
4195} 4192}
4196 4193
4197# load additional modules 4194# load additional modules
4198require "cf/$_.pm" for @EXTRA_MODULES; 4195require "cf/$_.pm" for @EXTRA_MODULES;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines