User Tools

Site Tools


server:running_the_server:compressed_map_files

This is an old revision of the document!


Compressed maps files

When operating the server , the Bigworld map files in CROSSFIRE_LIBDIR/maps can take up to 400 MB of space on the harddisk.

The server is able to operate on compressed map files, which would then just take up the space of the compressed tarball they came in.

But it needs to find out, if the server actually is able to open such compressed map files.

The simple test would be to compress the early map files HallOfSelection and probably the files in the start folder.
On Linux it would be

  • compress HallOfSelection to create a .Z file
  • bzip2 HallOfSelection to create a .bz2 file
  • gzip HallOfSelection to create a .gz file
  • TODO : check for lzip, lzop, lzma, xz compressions

Either the server keeps going, or would abort and send a message to the logfile as

[Error] Can't open SRC_PATH/crossfire-1.70.0/_install/share/crossfire/maps/HallOfSelection: No such file or directory
[Error] Initial map /HallOfSelection can't be found! Please ensure maps are correctly installed.
[Error] Unable to continue without initial map.

and when creating a link HallOfSelection to point to the HallOfSelection.gz telling

[Error] Error loading map header - did not find a newline - perhaps file is truncated? Buf=BZh91AY&SY[GARBLED_STREAM]
[Error] Error loading map header for /HallOfSelection, flags=0
[Error] Initial map /HallOfSelection can't be found! Please ensure maps are correctly installed.
[Error] Unable to continue without initial map.
[Error] Can't open SRC_PATH/crossfire-1.70.0/_install/share/crossfire/maps/HallOfSelection: No such file or directory
[Error] Initial map /HallOfSelection can't be found! Please ensure maps are correctly installed.
[Error] Unable to continue without initial map.

When the server supports compressed map files, and it is desired to use compressed map files, then some code has to filter out files inside the maps directory, that are better left uncompressed.
:!: By all means, any .sh, .pl and .py script files need to be untouched.

A shell code script to compress the map file using gzip could look as

#!/bin/bash
 
which gzip || exit
tty || exit  # exit if clicked on it in the filer
 
find . -type f \( -not       -name README          \
               -a -not  -wholename "*.svn/*"       \
               -a -not  -wholename "*python/*"     \
               -a -not  -wholename "*templates/*"  \
               -a -not  -wholename "*editor/*"     \
               -a -not  -wholename "*test/*"       \
               -a -not  -wholename "*styles/*"     \
               -a -not  -wholename "*Info/*"       \
               -a -not  -wholename "*apartment*"   \
               -a -not  -wholename "*Apartment*"   \
               -a -not  -wholename "*APARTMENT*"   \
               -a -not   -name "*.sh" \
               -a -not   -name "*.pl" \
               -a -not   -name "*.py" \
               -a -not   -name "*.gz" \
               -a -not  -name "*.bz2" \
               -a -not    -name "*.Z" \
               -a -not   -name "luxhouse"    \
               -a -not   -name "housebrxzl"  \
               -a -not   -name "keysale"     \
               -a -not   -name "ChangeLog"   \
               -a -not   -name "Copying"     \
               -a -not   -name "regions*" \) \
                -exec gzip {} \;

The above code assumes that the script needs to run from a controlling terminal, and that it would be located in the top level of the maps directory among the many folders and files like HallOfSelection , regions | regions.reg , HallOfDMs . Furthermore it omitts (for now) files, that are (permanent) apartment related.

Of course, both gzip commands can be replaced by the desired compressor; f.ex compress or bzip2 .

server/running_the_server/compressed_map_files.1520928423.txt.gz · Last modified: (external edit)

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki