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.552 by root, Mon May 17 21:12:59 2010 UTC vs.
Revision 1.559 by root, Sat Feb 26 12:50:27 2011 UTC

93our @EVENT; 93our @EVENT;
94our @REFLECT; # set by XS 94our @REFLECT; # set by XS
95our %REFLECT; # set by us 95our %REFLECT; # set by us
96 96
97our $CONFDIR = confdir; 97our $CONFDIR = confdir;
98
98our $DATADIR = datadir; 99our $DATADIR = datadir;
99our $LIBDIR = "$DATADIR/ext"; 100our $LIBDIR = "$DATADIR/ext";
100our $PODDIR = "$DATADIR/pod"; 101our $PODDIR = "$DATADIR/pod";
101our $MAPDIR = "$DATADIR/" . mapdir; 102our $MAPDIR = "$DATADIR/" . mapdir;
103
102our $LOCALDIR = localdir; 104our $LOCALDIR = localdir;
103our $TMPDIR = "$LOCALDIR/" . tmpdir; 105our $TMPDIR = "$LOCALDIR/" . tmpdir;
104our $UNIQUEDIR = "$LOCALDIR/" . uniquedir; 106our $UNIQUEDIR = "$LOCALDIR/" . uniquedir;
105our $PLAYERDIR = "$LOCALDIR/" . playerdir; 107our $PLAYERDIR = "$LOCALDIR/" . playerdir;
106our $RANDOMDIR = "$LOCALDIR/random"; 108our $RANDOMDIR = "$LOCALDIR/random";
1861sub generate_random_map { 1863sub generate_random_map {
1862 my ($self, $rmp) = @_; 1864 my ($self, $rmp) = @_;
1863 1865
1864 my $lock = cf::lock_acquire "generate_random_map"; # the random map generator is NOT reentrant ATM 1866 my $lock = cf::lock_acquire "generate_random_map"; # the random map generator is NOT reentrant ATM
1865 1867
1866 # mit "rum" bekleckern, nicht
1867 $self->_create_random_map ( 1868 $self->_create_random_map ($rmp);
1868 $rmp->{wallstyle}, $rmp->{wall_name}, $rmp->{floorstyle}, $rmp->{monsterstyle},
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}
1879 )
1880} 1869}
1881 1870
1882=item cf::map->register ($regex, $prio) 1871=item cf::map->register ($regex, $prio)
1883 1872
1884Register a handler for the map path matching the given regex at the 1873Register a handler for the map path matching the given regex at the
2186 2175
2187 $self->in_memory (cf::MAP_ACTIVE); 2176 $self->in_memory (cf::MAP_ACTIVE);
2188 } 2177 }
2189 2178
2190 $self->post_load; 2179 $self->post_load;
2180
2181 1
2191} 2182}
2192 2183
2193# customize the map for a given player, i.e. 2184# customize the map for a given player, i.e.
2194# return the _real_ map. used by e.g. per-player 2185# return the _real_ map. used by e.g. per-player
2195# maps to change the path to ~playername/mappath 2186# maps to change the path to ~playername/mappath
3437 3428
3438 cf::face::set_visibility $idx, $info->{visibility}; 3429 cf::face::set_visibility $idx, $info->{visibility};
3439 cf::face::set_magicmap $idx, $info->{magicmap}; 3430 cf::face::set_magicmap $idx, $info->{magicmap};
3440 cf::face::set_data $idx, 0, $info->{data32}, $info->{hash32}; 3431 cf::face::set_data $idx, 0, $info->{data32}, $info->{hash32};
3441 cf::face::set_data $idx, 1, $info->{data64}, $info->{hash64}; 3432 cf::face::set_data $idx, 1, $info->{data64}, $info->{hash64};
3433 cf::face::set_data $idx, 2, $info->{glyph} , $info->{glyph} ;
3442 3434
3443 cf::cede_to_tick; 3435 cf::cede_to_tick;
3444 } 3436 }
3445 3437
3446 while (my ($face, $info) = each %$faces) { 3438 while (my ($face, $info) = each %$faces) {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines