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.129 by root, Wed Jan 3 00:41:19 2007 UTC vs.
Revision 1.131 by root, Thu Jan 4 00:53:54 2007 UTC

71mkdir cf::localdir . "/" . cf::uniquedir; 71mkdir cf::localdir . "/" . cf::uniquedir;
72mkdir $RANDOM_MAPS; 72mkdir $RANDOM_MAPS;
73 73
74# a special map that is always available 74# a special map that is always available
75our $LINK_MAP; 75our $LINK_MAP;
76 76our $EMERGENCY_POSITION;
77our $EMERGENCY_POSITION = $cf::CFG{emergency_position} || ["/world/world_105_115", 5, 37];
78 77
79############################################################################# 78#############################################################################
80 79
81=head2 GLOBAL VARIABLES 80=head2 GLOBAL VARIABLES
82 81
1322} 1321}
1323 1322
1324sub swap_out { 1323sub swap_out {
1325 my ($self) = @_; 1324 my ($self) = @_;
1326 1325
1326 # save first because save cedes
1327 $self->save;
1328
1327 return if $self->players; 1329 return if $self->players;
1328 return if $self->in_memory != cf::MAP_IN_MEMORY; 1330 return if $self->in_memory != cf::MAP_IN_MEMORY;
1329 return if $self->{deny_save}; 1331 return if $self->{deny_save};
1330 1332
1331 $self->save;
1332 $self->clear; 1333 $self->clear;
1333 $self->in_memory (cf::MAP_SWAPPED); 1334 $self->in_memory (cf::MAP_SWAPPED);
1334} 1335}
1335 1336
1336sub reset_at { 1337sub reset_at {
1986 open my $fh, "<:utf8", cf::confdir . "/config" 1987 open my $fh, "<:utf8", cf::confdir . "/config"
1987 or return; 1988 or return;
1988 1989
1989 local $/; 1990 local $/;
1990 *CFG = YAML::Syck::Load <$fh>; 1991 *CFG = YAML::Syck::Load <$fh>;
1992
1993 $EMERGENCY_POSITION = $CFG{emergency_position} || ["/world/world_105_115", 5, 37];
1994
1995 if (exists $CFG{mlockall}) {
1996 eval {
1997 $CFG{mlockall} ? &mlockall : &munlockall
1998 and die "WARNING: m(un)lockall failed: $!\n";
1999 };
2000 warn $@ if $@;
2001 }
1991} 2002}
1992 2003
1993sub main { 2004sub main {
1994 # we must not ever block the main coroutine 2005 # we must not ever block the main coroutine
1995 local $Coro::idle = sub { 2006 local $Coro::idle = sub {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines