This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | Last revision Both sides next revision | ||
server:running_the_server:compressed_map_files [2018/04/08 08:23] karl Add Guilds to be omitted for being compressed, fix code syntax for -wholename missing some '/' , spellings, formattings |
server:running_the_server:compressed_map_files [2018/04/09 07:14] karl Add pshops and privateshops to files to be omitted for being compressed |
||
---|---|---|---|
Line 1: | Line 1: | ||
======= Compressed maps files ======= | ======= Compressed maps files ======= | ||
When operating the [[:server]] , the [[:Bigworld]] map files in | When operating the [[:server]] , the [[:Bigworld]] map files in | ||
- | [[environment_variables|CROSSFIRE_LIBDIR]]/maps can take up to 400 MB of space on the harddisk. | + | [[environment_variables|CROSSFIRE_LIBDIR]]**/maps** can take up to 400 MB of space on the hard-disk. |
Until version 1.60.0 and below, the server is able to operate on compressed map files, which | Until version 1.60.0 and below, 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. \\ | would then just take up the space of the compressed tarball they came in. \\ | ||
- | Since around SVN revisions r14859 to r14871 in July 2011 the compression related code has been removed from the source code; saying that since 1.70.0 and beyond the server does not handle compressed maps files anymore. | + | Since around SVN revisions r14859 to r14871 in July 2011 the compression related code has been removed from the source code; \\ |
+ | saying that since 1.70.0 and beyond the server does not handle compressed maps files anymore. | ||
The compression related code is found in //server/common/porting.c// : | The compression related code is found in //server/common/porting.c// : | ||
Line 23: | Line 24: | ||
}; | }; | ||
</code> | </code> | ||
+ | |||
And the functions are : | And the functions are : | ||
* ''static FILE *open_and_uncompress_file(const char *ext, const char *uncompressor, const char *name, int flag, int *compressed, const char *mode)'' | * ''static FILE *open_and_uncompress_file(const char *ext, const char *uncompressor, const char *name, int flag, int *compressed, const char *mode)'' | ||
Line 50: | Line 52: | ||
>[Error] Initial map /HallOfSelection can't be found! Please ensure maps are correctly installed. | >[Error] Initial map /HallOfSelection can't be found! Please ensure maps are correctly installed. | ||
>[Error] Unable to continue without initial map. | >[Error] Unable to continue without initial map. | ||
- | + | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ===== Compression == | ||
When the server supports compressed map files, and it is desired to use compressed map files, \\ | 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, \\ | then some code has to filter out files inside the maps directory, \\ | ||
that are better left uncompressed. \\ | that are better left uncompressed. \\ | ||
:!: By all means, any .sh, .pl and .py script files need to be untouched. | :!: By all means, any .sh, .pl and .py script files need to be untouched. | ||
+ | |||
+ | The below bash 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 omits files, that are (permanent) apartment, private shop and guilds related. \\ | ||
+ | |||
+ | Of course, both //gzip// commands can be replaced by the desired compressor; f.ex //compress// or //bzip2// . | ||
+ | |||
+ | In the below code **gzip** had been selected, since it allows easy recursive decompression of directories by ''gunzip -r *'' . | ||
+ | |||
+ | Jump to [[#End Compression]] . | ||
A shell code script to compress the map file using //gzip// could look as | A shell code script to compress the map file using //gzip// could look as | ||
Line 73: | Line 91: | ||
-a -not -wholename "*/*apartment*" \ | -a -not -wholename "*/*apartment*" \ | ||
-a -not -wholename "*/*Apartment*" \ | -a -not -wholename "*/*Apartment*" \ | ||
- | -a -not -wholename "*/*APARTMENT*" \ | ||
-a -not -wholename "*/*APARTMENT*" \ | -a -not -wholename "*/*APARTMENT*" \ | ||
-a -not -wholename "*/*apart*" \ | -a -not -wholename "*/*apart*" \ | ||
-a -not -wholename "*/villa/*" \ | -a -not -wholename "*/villa/*" \ | ||
- | -a -not -wholename "*/guild/*" \ | + | -a -not -wholename "*/guild/*" \ |
- | -a -not -wholename "*/guilds/*" \ | + | -a -not -wholename "*/guilds/*" \ |
+ | -a -not -whonename "*/pshops/*" \ | ||
+ | -a -not -wholename "*/pshop*" \ | ||
+ | -a -not -wholename "*/privateshop*" \ | ||
-a -not -name "*.sh" \ | -a -not -name "*.sh" \ | ||
-a -not -name "*.pl" \ | -a -not -name "*.pl" \ | ||
Line 97: | Line 117: | ||
-a -not -name "secondfloor" \ | -a -not -name "secondfloor" \ | ||
-a -not -name "hallofjoining" \ | -a -not -name "hallofjoining" \ | ||
+ | -a -not -name "privateshop*" \ | ||
-a -not -name "ChangeLog" \ | -a -not -name "ChangeLog" \ | ||
-a -not -name "Copying" \ | -a -not -name "Copying" \ | ||
Line 103: | Line 124: | ||
</code> | </code> | ||
- | 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 omits files, that are (permanent) apartment and guilds related. \\ | ||
- | Of course, both //gzip// commands can be replaced by the desired compressor; f.ex //compress// or //bzip2// . | + | == End Compression == |
- | In the above code **gzip** had been selected, since it allows easy recursive decompression of directories by ''gunzip -r *'' . | + | Jump up to [[#Compression]] . |