Browse Source

formatting code blocks

master
poikilos 9 years ago
committed by Jacob Gustafson
parent
commit
45f3a279ff
  1. 80
      README.md

80
README.md

@ -17,11 +17,14 @@ This program comes without any warranty, to the extent permitted by applicable l
# ( to run only once, run: python chunkymap-regen.py --no-loop true ) # ( to run only once, run: python chunkymap-regen.py --no-loop true )
* Change program options (or stop it) while looping or rendering by placing signals.txt in the same directory as chunkymap-regen.py (see signals example files) * Change program options (or stop it) while looping or rendering by placing signals.txt in the same directory as chunkymap-regen.py (see signals example files)
* to maintain stability of your text editor, save the file, close it, then move/copy it to the directory (or save it as something else then rename it to signals.txt). * to maintain stability of your text editor, save the file, close it, then move/copy it to the directory (or save it as something else then rename it to signals.txt).
* alternatively, in *nix do something like: * alternatively, in GNU/Linux systems do something like:
`
echo "refresh_map_enable:False" > $HOME/chunkymap/signals.txt echo "refresh_map_enable:False" > $HOME/chunkymap/signals.txt
sleep 15s sleep 15s
echo "loop_enable:False" > $HOME/chunkymap/signals.txt echo "loop_enable:False" > $HOME/chunkymap/signals.txt
`
* list of signals: * list of signals:
`
loop_enable:True loop_enable:True
loop_enable:False loop_enable:False
#verbose_enable is false for looped (default) mode and true for non-looped mode #verbose_enable is false for looped (default) mode and true for non-looped mode
@ -37,6 +40,7 @@ This program comes without any warranty, to the extent permitted by applicable l
refresh_map_seconds:1 refresh_map_seconds:1
#where 1 is number of seconds: #where 1 is number of seconds:
refresh_players_seconds:1 refresh_players_seconds:1
`
* Save jpg or png named as player's index to the players folder of the world to change player's icon on map (index is a number assigned for use with ajax when $show_player_names_enable is false). The index can be found in the player's yml file generated by chunkymap-regen.py. * Save jpg or png named as player's index to the players folder of the world to change player's icon on map (index is a number assigned for use with ajax when $show_player_names_enable is false). The index can be found in the player's yml file generated by chunkymap-regen.py.
* Can show a static html version of map (echo_chunkymap_table() php function) -- see viewchunkymap.php * Can show a static html version of map (echo_chunkymap_table() php function) -- see viewchunkymap.php
@ -54,6 +58,7 @@ Because of the feature, chunkymap-regen.py must prevent duplicates based on valu
This should be hard to corrupt since id is used as the indexer for the players dict (however, extra files with no matching entry in the dict will still need to be deleted if they exist) This should be hard to corrupt since id is used as the indexer for the players dict (however, extra files with no matching entry in the dict will still need to be deleted if they exist)
* games_path, mods_path, players_path, and other subdirectories of the major ones should not be stored in minetestmeta.yml, since otherwise the values may deviate from the parent directories when the parent directories change. * games_path, mods_path, players_path, and other subdirectories of the major ones should not be stored in minetestmeta.yml, since otherwise the values may deviate from the parent directories when the parent directories change.
To avoid this problem, instead derive the paths from the parent paths using your favorite language such as in the following examples: To avoid this problem, instead derive the paths from the parent paths using your favorite language such as in the following examples:
` `
games_path = os.path.join(minetestinfo.get_var("shared_minetest_path"), "games") games_path = os.path.join(minetestinfo.get_var("shared_minetest_path"), "games")
mods_path = os.path.join(minetestinfo.get_var("game_path"), "mods") mods_path = os.path.join(minetestinfo.get_var("game_path"), "mods")
@ -68,10 +73,13 @@ To avoid this problem, instead derive the paths from the parent paths using your
Yet somehow for everything else, gameid in world.mt is the name of the game FOLDER (NOT the name variable in the folder's game.conf) Yet somehow for everything else, gameid in world.mt is the name of the game FOLDER (NOT the name variable in the folder's game.conf)
* the map update function is only able to detect new chunks, and only checks edge chunks if player is present in one * the map update function is only able to detect new chunks, and only checks edge chunks if player is present in one
* The following are saved to chunkymap.yml (and confirmed interactively if not already set): * The following are saved to chunkymap.yml (and confirmed interactively if not already set):
`www_minetest_path (such as /var/www/html/minetest)`
`user_minetest_path` `
`world_name` www_minetest_path (such as /var/www/html/minetest)
`world_path` user_minetest_path
world_name
world_path
`
## Requirements: ## Requirements:
* A minetest version compatible with minetestmapper-numpy.py Made by Jogge, modified by celeron55 * A minetest version compatible with minetestmapper-numpy.py Made by Jogge, modified by celeron55
@ -84,28 +92,32 @@ To avoid this problem, instead derive the paths from the parent paths using your
* If you are using Ubuntu * If you are using Ubuntu
* Install the git version of minetest (or otherwise install 0.4.13 or other version compatible with the map generators used by chunkymap) * Install the git version of minetest (or otherwise install 0.4.13 or other version compatible with the map generators used by chunkymap)
such as: such as:
`#if you have a version before 2016-03-23:` `
`rm rename-deprecated.sh` #if you have a version before 2016-03-23:
`wget https://github.com/expertmm/minetest-chunkymap/raw/master/rename-deprecated.sh` rm rename-deprecated.sh
`sudo sh rename-deprecated.sh` wget https://github.com/expertmm/minetest-chunkymap/raw/master/rename-deprecated.sh
sudo sh rename-deprecated.sh
`rm install-chunkymap-on-ubuntu-from-web.sh` rm install-chunkymap-on-ubuntu-from-web.sh
`wget https://github.com/expertmm/minetest-chunkymap/raw/master/install-chunkymap-on-ubuntu-from-web.sh` wget https://github.com/expertmm/minetest-chunkymap/raw/master/install-chunkymap-on-ubuntu-from-web.sh
`chmod +x install-chunkymap-on-ubuntu-from-web.sh` chmod +x install-chunkymap-on-ubuntu-from-web.sh
`./install-chunkymap-on-ubuntu-from-web.sh` ./install-chunkymap-on-ubuntu-from-web.sh
`#or later run:` #or later run:
`#rm update-chunkymap-on-ubuntu-from-web.sh` #rm update-chunkymap-on-ubuntu-from-web.sh
`#wget https://github.com/expertmm/minetest-chunkymap/raw/master/update-chunkymap-on-ubuntu-from-web.sh` #wget https://github.com/expertmm/minetest-chunkymap/raw/master/update-chunkymap-on-ubuntu-from-web.sh
`#chmod +x update-chunkymap-on-ubuntu-from-web.sh` #chmod +x update-chunkymap-on-ubuntu-from-web.sh
`#./update-chunkymap-on-ubuntu-from-web.sh` #./update-chunkymap-on-ubuntu-from-web.sh
`sudo python chunkymap/singleimage.py` sudo python chunkymap/singleimage.py
`sudo python chunkymap/generator.py` sudo python chunkymap/generator.py
`
OPTION 2: IF you are using Ubuntu go to a terminal, cd to this directory, OPTION 2: IF you are using Ubuntu go to a terminal, cd to this directory,
then switch user to the one that will run minetestserver then switch user to the one that will run minetestserver
(since install-chunkymap-on-ubuntu.sh DOES replace "/home/owner" with current user's home [replace-with-current-user.py, which is automatically called by install, will change /home/owner to current user's directory in each script that install copies to $HOME/chunkymap]) (since install-chunkymap-on-ubuntu.sh DOES replace "/home/owner" with current user's home [replace-with-current-user.py, which is automatically called by install, will change /home/owner to current user's directory in each script that install copies to $HOME/chunkymap])
then go to Terminal and run: then go to Terminal and run:
`minetestserver` `minetestserver`
then when it is finished loading, press Ctrl C then run: then when it is finished loading, press Ctrl C then run:
`chmod +x install-chunkymap-on-ubuntu.sh && ./install-chunkymap-on-ubuntu.sh` `chmod +x install-chunkymap-on-ubuntu.sh && ./install-chunkymap-on-ubuntu.sh`
Installing as cron job is OPTIONAL (and NOT recommended): Installing as cron job is OPTIONAL (and NOT recommended):
@ -115,13 +127,15 @@ To avoid this problem, instead derive the paths from the parent paths using your
`chmod +x set-minutely-crontab-job.sh && ./set-minutely-crontab-job.sh` `chmod +x set-minutely-crontab-job.sh && ./set-minutely-crontab-job.sh`
* IF you are using Linux * IF you are using Linux
* Rename viewchunkymap.php so it won't be overwritten on update if you want to modify it (or anything you want) then make a link to it on your website or share the link some other way. * Rename viewchunkymap.php so it won't be overwritten on update if you want to modify it (or anything you want) then make a link to it on your website or share the link some other way.
`# The commands below will work if you are using the web installer, or have done mv minetest-chunkymap-master "$HOME/Downloads/minetest-chunkymap" (and if you are using /var/www/html/minetest -- otherwise change that below)` `
`MT_MY_WEBSITE_PATH=/var/www/html/minetest` # The commands below will work if you are using the web installer, or have done mv minetest-chunkymap-master "$HOME/Downloads/minetest-chunkymap" (and if you are using /var/www/html/minetest -- otherwise change that below)
`sudo cp -f "$HOME/Downloads/minetest-chunkymap/web/chunkymap.php" "$MT_MY_WEBSITE_PATH/chunkymap.php"` MT_MY_WEBSITE_PATH=/var/www/html/minetest
`sudo cp -f "$HOME/Downloads/minetest-chunkymap/web/viewchunkymap.php" "$MT_MY_WEBSITE_PATH/viewchunkymap.php"` sudo cp -f "$HOME/Downloads/minetest-chunkymap/web/chunkymap.php" "$MT_MY_WEBSITE_PATH/chunkymap.php"
`sudo cp -R --no-clobber "$HOME/Downloads/minetest-chunkymap/web/images/*" "$MT_MY_WEBSITE_PATH/images/"` sudo cp -f "$HOME/Downloads/minetest-chunkymap/web/viewchunkymap.php" "$MT_MY_WEBSITE_PATH/viewchunkymap.php"
`#--no-clobber: do not overwrite existing` sudo cp -R --no-clobber "$HOME/Downloads/minetest-chunkymap/web/images/*" "$MT_MY_WEBSITE_PATH/images/"
`# after you do this, the update script will do it for you if you are using /var/www/html/minetest, otherwise edit the update script before using it to get these things updated` #--no-clobber: do not overwrite existing
# after you do this, the update script will do it for you if you are using /var/www/html/minetest, otherwise edit the update script before using it to get these things updated
`
* IF you are using Windows * IF you are using Windows
* Install Python 2.7 * Install Python 2.7
* Run install-chunkymap-on-windows.bat * Run install-chunkymap-on-windows.bat
@ -136,17 +150,20 @@ To avoid this problem, instead derive the paths from the parent paths using your
`C:\python27\python -m pip install --upgrade pip wheel setuptools` `C:\python27\python -m pip install --upgrade pip wheel setuptools`
* numpy such as can be installed via the easy unofficial installer wheel at * numpy such as can be installed via the easy unofficial installer wheel at
http://www.lfd.uci.edu/~gohlke/pythonlibs/#numpy http://www.lfd.uci.edu/~gohlke/pythonlibs/#numpy
then: then:
`#cd to the folder where you downloaded the whl file ` `#cd to the folder where you downloaded the whl file `
`C:\python27\python -m pip install "numpy-1.10.4+mkl-cp27-cp27m-win32.whl"` `C:\python27\python -m pip install "numpy-1.10.4+mkl-cp27-cp27m-win32.whl"`
(but put your specific downloaded whl file instead) (but put your specific downloaded whl file instead)
* Pillow (instead of PIL (Python Imaging Library) which is a pain on Windows): there is a PIL installer wheel for Python such as 2.7 here: * Pillow (instead of PIL (Python Imaging Library) which is a pain on Windows): there is a PIL installer wheel for Python such as 2.7 here:
http://www.lfd.uci.edu/~gohlke/pythonlibs/ http://www.lfd.uci.edu/~gohlke/pythonlibs/
as suggested on http://stackoverflow.com/questions/2088304/installing-pil-python-imaging-library-in-win7-64-bits-python-2-6-4 as suggested on http://stackoverflow.com/questions/2088304/installing-pil-python-imaging-library-in-win7-64-bits-python-2-6-4
then: then:
`C:\python27\python -m pip install "Pillow-3.1.1-cp27-none-win32.whl"` `C:\python27\python -m pip install "Pillow-3.1.1-cp27-none-win32.whl"`
(but put your specific downloaded whl file instead, such as Pillow-3.1.1-cp27-none-win_amd64.whl) (but put your specific downloaded whl file instead, such as Pillow-3.1.1-cp27-none-win_amd64.whl)
* run (or if your python executable does not reside in C:\Python27\ then first edit the file): * run (or if your python executable does not reside in C:\Python27\ then first edit the file):
`chunkymap-regen-loop.bat` `chunkymap-regen-loop.bat`
(all the batch does is run C:\Python27\python chunkymap-regen.py) (all the batch does is run C:\Python27\python chunkymap-regen.py)
(chunkymap-regen.py will ask for configuration options on first run and ask for your www root) (chunkymap-regen.py will ask for configuration options on first run and ask for your www root)
@ -156,6 +173,7 @@ To avoid this problem, instead derive the paths from the parent paths using your
* Fix chunk generation and draw decachunks to canvas (so singleimage.py is not required to be run before chunkymap-regen.py) * Fix chunk generation and draw decachunks to canvas (so singleimage.py is not required to be run before chunkymap-regen.py)
* Detect exceptions in mintestmapper (such as database locked) and do NOT mark the chunk as is_empty * Detect exceptions in mintestmapper (such as database locked) and do NOT mark the chunk as is_empty
* Move the following to config dict: * Move the following to config dict:
`python_exe_path` `python_exe_path`
* chunkymap.php should read the size of the chunks -- see near is_file($chunk_genresult_path) in chunkymap.php * chunkymap.php should read the size of the chunks -- see near is_file($chunk_genresult_path) in chunkymap.php
* optionally hide player location * optionally hide player location

Loading…
Cancel
Save