ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/utils/cfutil.in
(Generate patch)

Comparing deliantra/server/utils/cfutil.in (file contents):
Revision 1.13 by root, Mon Mar 12 17:33:12 2007 UTC vs.
Revision 1.17 by root, Wed Mar 14 16:23:26 2007 UTC

20use Crossfire; 20use Crossfire;
21use Coro; 21use Coro;
22use Coro::AIO; 22use Coro::AIO;
23use POSIX (); 23use POSIX ();
24use Digest::MD5; 24use Digest::MD5;
25use Storable; $Storable::canonical = 1;
25 26
26sub usage { 27sub usage {
27 warn <<EOF; 28 warn <<EOF;
28Usage: cfutil [-v] [-q] [--force] [--cache] 29Usage: cfutil [-v] [-q] [--force] [--cache]
29 [--install-arch path] 30 [--install-arch path]
75 warn "'$path' does not look like a maps directory ('regions' file is missing).\n"; 76 warn "'$path' does not look like a maps directory ('regions' file is missing).\n";
76 exit 1 unless $FORCE; 77 exit 1 unless $FORCE;
77 } 78 }
78 79
79 system $RSYNC, "-av", "$path/.", "$DATADIR/maps/.", "--delete", "--exclude", "CVS", "--delete-excluded" 80 system $RSYNC, "-av", "$path/.", "$DATADIR/maps/.", "--delete", "--exclude", "CVS", "--delete-excluded"
80 or die "map installation failed.\n"; 81 and die "map installation failed.\n";
81 82
82 print "maps installed successfully.\n"; 83 print "maps installed successfully.\n";
83} 84}
84 85
85{ 86{
87 our %FACEINFO; 88 our %FACEINFO;
88 our @ARC; 89 our @ARC;
89 our $TRS; 90 our $TRS;
90 our $NFILE; 91 our $NFILE;
91 our %ANIM; 92 our %ANIM;
92 our $SMOOTH;
93 93
94 our (@png, @trs, @arc); # files we are interested in 94 our (@png, @trs, @arc); # files we are interested in
95 95
96 sub commit_png { 96 sub commit_png {
97 my ($name, $data) = @_; 97 my ($name, $data) = @_;
257 $info->{visibility} = $visibility if defined $visibility; 257 $info->{visibility} = $visibility if defined $visibility;
258 $info->{magicmap} = $magicmap if defined $magicmap; 258 $info->{magicmap} = $magicmap if defined $magicmap;
259 } 259 }
260 260
261 if (my $smooth = delete $o->{smoothface}) { 261 if (my $smooth = delete $o->{smoothface}) {
262 $SMOOTH .= "$smooth\n"; 262 my ($face, $smooth) = split /\s+/, $smooth;
263 # skip empty_S.x11, it seems to server no purpose whatsoever
264 # but increases bandwidth demands and worse.
265 unless ($smooth eq "empty_S.x11") {
266 $FACEINFO{$face}{smooth} = $smooth;
267 }
263 } 268 }
264 } 269 }
265 } 270 }
266 } 271 }
267 } 272 }
337 substr $_->{editor_folder}, 0, 1 + length $path, "" for @ARC; 342 substr $_->{editor_folder}, 0, 1 + length $path, "" for @ARC;
338 print $fh Crossfire::archlist_to_string \@ARC; 343 print $fh Crossfire::archlist_to_string \@ARC;
339 } 344 }
340 345
341 { 346 {
342 open my $fh, ">:utf8", "$DATADIR/smooth~"
343 or die "$DATADIR/smooth~: $!";
344 print $fh $SMOOTH;
345 }
346
347 {
348 open my $fh, ">:utf8", "$DATADIR/treasures~" 347 open my $fh, ">:utf8", "$DATADIR/treasures~"
349 or die "$DATADIR/treasures~: $!"; 348 or die "$DATADIR/treasures~: $!";
350 print $fh $TRS; 349 print $fh $TRS;
351 } 350 }
352 351
362 } 361 }
363 362
364 open my $fh, ">:perlio", "$DATADIR/faces~" 363 open my $fh, ">:perlio", "$DATADIR/faces~"
365 or die "$DATADIR/faces~: $!"; 364 or die "$DATADIR/faces~: $!";
366 365
366 $FACEINFO{""} = { version => 1};
367 print $fh Storable::nfreeze \%FACEINFO; 367 print $fh Storable::nfreeze \%FACEINFO;
368 } 368 }
369 369
370 for (qw(archetypes faces animations treasures smooth)) { 370 for (qw(archetypes faces animations treasures)) {
371 chmod 0644, "$DATADIR/$_~"; 371 chmod 0644, "$DATADIR/$_~";
372 rename "$DATADIR/$_~", "$DATADIR/$_" 372 rename "$DATADIR/$_~", "$DATADIR/$_"
373 or die "$DATADIR/$_: $!"; 373 or die "$DATADIR/$_: $!";
374 } 374 }
375 375

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines