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.302 by root, Tue Jul 10 16:23:59 2007 UTC vs.
Revision 1.304 by root, Wed Jul 11 16:55:18 2007 UTC

1489 my ($path) = @_; 1489 my ($path) = @_;
1490 1490
1491 my ($match, $specificity); 1491 my ($match, $specificity);
1492 1492
1493 for my $region (list) { 1493 for my $region (list) {
1494 if ($region->match && $path =~ $region->match) { 1494 if ($region->{match} && $path =~ $region->{match}) {
1495 ($match, $specificity) = ($region, $region->specificity) 1495 ($match, $specificity) = ($region, $region->specificity)
1496 if $region->specificity > $specificity; 1496 if $region->specificity > $specificity;
1497 } 1497 }
1498 } 1498 }
1499 1499
2764 2764
2765 while (my ($name, $info) = each %$res) { 2765 while (my ($name, $info) = each %$res) {
2766 my $meta = $enc->encode ({ 2766 my $meta = $enc->encode ({
2767 name => $name, 2767 name => $name,
2768 type => $info->{type}, 2768 type => $info->{type},
2769 copyright => $info->{copyright}, 2769 copyright => $info->{copyright}, #TODO#
2770 }); 2770 });
2771 my $data = pack "(w/a*)*", $meta, $info->{data}; 2771 my $data = pack "(w/a*)*", $meta, $info->{data};
2772 my $chk = Digest::MD5::md5 "$info->{chksum},$meta"; # mangle data checksum and metadata 2772 my $chk = Digest::MD5::md5 "$info->{chksum},$meta"; # mangle data checksum and metadata
2773 2773
2774 use Data::Dumper; warn Dumper substr $data, 0, 100;#d#
2775
2776 my $idx = (cf::face::find $name) || cf::face::alloc $name; 2774 my $idx = (cf::face::find $name) || cf::face::alloc $name;
2777 cf::face::set_type $idx, 1; 2775 cf::face::set_type $idx, 1;
2778 cf::face::set_data $idx, 0, $data, $chk; 2776 cf::face::set_data $idx, 0, $data, $chk;
2779 2777
2780 # TODO
2781 cf::cede_to_tick; 2778 cf::cede_to_tick;
2782 } 2779 }
2783 } 2780 }
2784 2781
2785 1 2782 1
2786} 2783}
2787 2784
2788sub reload_regions { 2785sub reload_regions {
2789 load_resource_file "$MAPDIR/regions" 2786 load_resource_file "$MAPDIR/regions"
2790 or die "unable to load regions file\n"; 2787 or die "unable to load regions file\n";
2788
2789 for (cf::region::list) {
2790 $_->{match} = qr/$_->{match}/
2791 if exists $_->{match};
2792 }
2791} 2793}
2792 2794
2793sub reload_facedata { 2795sub reload_facedata {
2794 load_facedata "$DATADIR/facedata" 2796 load_facedata "$DATADIR/facedata"
2795 or die "unable to load facedata\n"; 2797 or die "unable to load facedata\n";

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines