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.12 by root, Mon Mar 12 17:26:41 2007 UTC vs.
Revision 1.15 by root, Wed Mar 14 04:12:29 2007 UTC

67} 67}
68 68
69sub inst_maps($) { 69sub inst_maps($) {
70 my (undef, $path) = @_; 70 my (undef, $path) = @_;
71 71
72 print "installing '$path' to '$DATADIR/maps'\n\n"; 72 print "installing '$path' to '$DATADIR/maps'\n";
73 73
74 if (!-f "$path/regions") { 74 if (!-f "$path/regions") {
75 warn "'$path' does not look like a maps directory ('regions' file is missing).\n"; 75 warn "'$path' does not look like a maps directory ('regions' file is missing).\n";
76 exit 1 unless $FORCE; 76 exit 1 unless $FORCE;
77 } 77 }
78 78
79 system $RSYNC, "-av", "$path/.", "$DATADIR/maps/.", "--delete", "--exclude", "CVS", "--delete-excluded"; 79 system $RSYNC, "-av", "$path/.", "$DATADIR/maps/.", "--delete", "--exclude", "CVS", "--delete-excluded"
80 or die "map installation failed.\n";
81
82 print "maps installed successfully.\n";
80} 83}
81 84
82{ 85{
83 our %PNG32; 86 our %PNG32;
84 our %FACEINFO; 87 our %FACEINFO;
85 our @ARC; 88 our @ARC;
86 our $TRS; 89 our $TRS;
87 our $NFILE; 90 our $NFILE;
88 our %ANIM; 91 our %ANIM;
89 our $SMOOTH;
90 92
91 our (@png, @trs, @arc); # files we are interested in 93 our (@png, @trs, @arc); # files we are interested in
92 94
93 sub commit_png { 95 sub commit_png {
94 my ($name, $data) = @_; 96 my ($name, $data) = @_;
254 $info->{visibility} = $visibility if defined $visibility; 256 $info->{visibility} = $visibility if defined $visibility;
255 $info->{magicmap} = $magicmap if defined $magicmap; 257 $info->{magicmap} = $magicmap if defined $magicmap;
256 } 258 }
257 259
258 if (my $smooth = delete $o->{smoothface}) { 260 if (my $smooth = delete $o->{smoothface}) {
259 $SMOOTH .= "$smooth\n"; 261 my ($face, $smooth) = split /\s+/, $smooth;
262 # skip empty_S.x11, it seems to server no purpose whatsoever
263 # but increases bandwidth demands and worse.
264 unless ($smooth eq "empty_S.x11") {
265 $FACEINFO{$face}{smooth} = $smooth;
266 }
260 } 267 }
261 } 268 }
262 } 269 }
263 } 270 }
264 } 271 }
304 } 311 }
305 312
306 sub inst_arch($) { 313 sub inst_arch($) {
307 my (undef, $path) = @_; 314 my (undef, $path) = @_;
308 315
309 print "installing '$path' to '$DATADIR'\n\n"; 316 print "installing '$path' to '$DATADIR'\n";
310 317
311 if (!-d "$path/treasures") { 318 if (!-d "$path/treasures") {
312 warn "'$path' does not look like an arch directory ('treasures' directory is missing).\n"; 319 warn "'$path' does not look like an arch directory ('treasures' directory is missing).\n";
313 exit 1 unless $FORCE; 320 exit 1 unless $FORCE;
314 } 321 }
334 substr $_->{editor_folder}, 0, 1 + length $path, "" for @ARC; 341 substr $_->{editor_folder}, 0, 1 + length $path, "" for @ARC;
335 print $fh Crossfire::archlist_to_string \@ARC; 342 print $fh Crossfire::archlist_to_string \@ARC;
336 } 343 }
337 344
338 { 345 {
339 open my $fh, ">:utf8", "$DATADIR/smooth~"
340 or die "$DATADIR/smooth~: $!";
341 print $fh $SMOOTH;
342 }
343
344 {
345 open my $fh, ">:utf8", "$DATADIR/treasures~" 346 open my $fh, ">:utf8", "$DATADIR/treasures~"
346 or die "$DATADIR/treasures~: $!"; 347 or die "$DATADIR/treasures~: $!";
347 print $fh $TRS; 348 print $fh $TRS;
348 } 349 }
349 350
359 } 360 }
360 361
361 open my $fh, ">:perlio", "$DATADIR/faces~" 362 open my $fh, ">:perlio", "$DATADIR/faces~"
362 or die "$DATADIR/faces~: $!"; 363 or die "$DATADIR/faces~: $!";
363 364
365 $FACEINFO{""} = { version => 1};
364 print $fh Storable::nfreeze \%FACEINFO; 366 print $fh Storable::nfreeze \%FACEINFO;
365 } 367 }
366 368
367 for (qw(archetypes faces animations treasures smooth)) { 369 for (qw(archetypes faces animations treasures)) {
368 chmod 0644, "$DATADIR/$_~"; 370 chmod 0644, "$DATADIR/$_~";
369 rename "$DATADIR/$_~", "$DATADIR/$_"; 371 rename "$DATADIR/$_~", "$DATADIR/$_"
372 or die "$DATADIR/$_: $!";
370 } 373 }
374
375 print "archetype data installed successfully.\n";
371 } 376 }
372} 377}
373 378
374Getopt::Long::Configure ("bundling", "no_ignore_case"); 379Getopt::Long::Configure ("bundling", "no_ignore_case");
375GetOptions ( 380GetOptions (

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines