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.228 by root, Mon Mar 26 16:53:33 2007 UTC vs.
Revision 1.230 by root, Mon Apr 2 18:04:46 2007 UTC

371 371
372 aio_rename "$runtime~", $runtime 372 aio_rename "$runtime~", $runtime
373 and return; 373 and return;
374 374
375 1 375 1
376}
377
378=item cf::datalog type => key => value, ...
379
380Log a datalog packet of the given type with the given key-value pairs.
381
382=cut
383
384sub datalog($@) {
385 my ($type, %kv) = @_;
386 warn "DATALOG ", JSON::XS->new->ascii->encode ({ %kv, type => $type });
376} 387}
377 388
378=back 389=back
379 390
380=cut 391=cut
2258} 2269}
2259 2270
2260############################################################################# 2271#############################################################################
2261# the server's init and main functions 2272# the server's init and main functions
2262 2273
2263sub load_faces { 2274sub load_facedata {
2264 my $path = sprintf "%s/faces", cf::datadir; 2275 my $path = sprintf "%s/facedata", cf::datadir;
2265 2276
2266 warn "loading faces from $path\n"; 2277 warn "loading facedata from $path\n";
2267 2278
2268 my $faces; 2279 my $faces;
2269 0 < aio_load $path, $faces 2280 0 < aio_load $path, $faces
2270 or die "$path: $!"; 2281 or die "$path: $!";
2271 2282
2279 2290
2280 while (my ($face, $info) = each %$faces) { 2291 while (my ($face, $info) = each %$faces) {
2281 my $idx = (cf::face::find $face) || cf::face::alloc $face; 2292 my $idx = (cf::face::find $face) || cf::face::alloc $face;
2282 cf::face::set $idx, $info->{visibility}, $info->{magicmap}; 2293 cf::face::set $idx, $info->{visibility}, $info->{magicmap};
2283 cf::face::set_data $idx, 0, $info->{data32}, $info->{chksum32}; 2294 cf::face::set_data $idx, 0, $info->{data32}, $info->{chksum32};
2295 cf::face::set_data $idx, 1, $info->{data64}, $info->{chksum64};
2284 Coro::cede; 2296 Coro::cede;
2285 } 2297 }
2286 2298
2287 while (my ($face, $info) = each %$faces) { 2299 while (my ($face, $info) = each %$faces) {
2288 next unless $info->{smooth}; 2300 next unless $info->{smooth};
2300} 2312}
2301 2313
2302sub reload_resources { 2314sub reload_resources {
2303 load_resource_file sprintf "%s/%s/regions", cf::datadir, cf::mapdir 2315 load_resource_file sprintf "%s/%s/regions", cf::datadir, cf::mapdir
2304 or die "unable to load regions file\n";#d# 2316 or die "unable to load regions file\n";#d#
2305 load_faces 2317 load_facedata
2306 or die "unable to load faces\n";#d# 2318 or die "unable to load facedata\n";#d#
2307} 2319}
2308 2320
2309sub init { 2321sub init {
2310 reload_resources; 2322 reload_resources;
2311} 2323}

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines