#where -t chunkymapregen just names the screen chunkymapregen
#Then if you are using screen and want to leave the output without terminating the process press Ctrl a d
#NOTE: now that loop is default, cron job scripts, which now disable loop for compatibility with new version, are ALL optional and NOT recommended
# ( to run only once, run: python chunkymap-regen.py --no-loop true )
* Change program options (or stop it) while looping or rendering by placing chunkymap-signals.txt in the same directory as chunkymap-regen.py (see chunkymap-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 chunkymap-signals.txt).
* Has static html version of map (echo_chunkymap_table() php function) -- see example.php
* Zoom in and out
* optionally echo name of world that was detected by the scheduled py file
* shows player location (and only first 2 characters of name, for privacy; there is no saved setting yet, so to adjust, you must change the value of $nonprivate_name_beginning_char_count in chunkymap.php)
* shows player location (can optionally show only first characters of name, for privacy; there is no saved setting yet, so to adjust, you must change the value of $nonprivate_name_beginning_char_count in chunkymap.php)
* Ghost players if they stay in one spot long enough (see $player_file_age_idle_max_seconds in chunkymap.php)
* Hide players if they stay in one spot long enough (see $player_file_age_expired_max_seconds in chunkymap.php) avoiding logout detection, and not requiring mods
* Has optional script to add crontab entry (to schedule update script every minute that runs the py file unless the py file is not complete [took longer than 1 minute])
## Developer Notes:
@ -28,24 +34,26 @@ This program comes without any warranty, to the extent permitted by applicable l
* Other requirements for Windows are below; other requirements for GNU/Linux are flock command (only if you schedule the chunkymap-cronjob script), and anything installed by install-chunkymap-on-ubuntu.sh (for other distros, modify it and send me a copy as a GitHub issue as described below in the Installation section)
## Installation
(NOTE: map refresh skips existing tiles unless you delete the related png and text files in your chunkymapdata folder)
(NOTE: map refresh skips existing tiles unless you delete the related png and text files in your chunkymapdata directory)
* If you are not using Ubuntu, first edit the installer for your distro (and please send the modified file to me [submit as new issue named such as: DISTRONAME installer except instead of DISTRONAME put the distro you made work])
* 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)
OPTION 2: IF you are using Ubuntu go to a terminal, cd to this folder,
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
(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 folder in each script that install copies to $HOME/minetest/util])
(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/minetest/util])
then go to Terminal and run:
`minetestserver`
then when it is finished loading, press Ctrl C then run:
* IF you are using a distro such as Ubuntu 14.04 where first line of /etc/crontab is "m h dom mon dow user command" then if you want regular refresh of map then run
Installing as cron job is OPTIONAL (and NOT recommended):
* IF you are using a distro such as Ubuntu 14.04 where first line of /etc/crontab is "m h dom mon dow user command" then if you want regular refresh of map then run:
(otherwise first edit the script to fit your crontab then)
(if you are not using /var/www/html/minetest/chunkymapdata, edit chunkymap-cronjob script to use the correct folder, then)
(if you are not using /var/www/html/minetest/chunkymapdata, edit chunkymap-cronjob script to use the correct directory, then)
* Either copy your code to example.php and use it, or just rename it to map.php (or anything you want) then link to it.
# 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)
# 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)
@ -54,7 +62,6 @@ This program comes without any warranty, to the extent permitted by applicable l
# 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
* put these files anywhere
* manually schedule a task in Task Scheduler to run C:\Python27\python chunkymap-regen.py every minute
* python 2.7.x such as from python.org
* run get_python_architecture.py to make sure you know whether to download the following in 32-bit or 64-bit
Administrator Command Prompt (to find it in Win 10, right-click windows menu)
@ -74,7 +81,9 @@ This program comes without any warranty, to the extent permitted by applicable l
(but put your specific downloaded whl file instead, such as Pillow-3.1.1-cp27-none-win_amd64.whl)
* edit chunkymap_regen.py and uncomment website_root="/var/www/html/minetest" then change the value in quotes to your web server's htdocs folder such as, if you are using Apache, can be found as the value of the DocumentRoot variable in httpd.conf in the Apache folder in Program Files
* edit chunkymap_regen.py and change world_name to your world name
* run (or if your python executable does not reside in C:\Python27\ then first edit the file):
chunkymap-regen-loop.bat
* copy example.php and chunkymap.php (and optionally browser.php) to your DocumentRoot or whatever folder will contain the chunkymapdata folder
## Known Issues
* chunkymap.php should read the size of the chunks -- see near is_file($chunk_genresult_path) in chunkymap.php
self.is_save_output_ok=True# Keeping output after analyzing it is no longer necessary since results are saved to YAML, but keeping output provides debug info since is the output of minetestmapper-numpy.py
print("RECEIVED SIGNAL "+str(this_key)+":"+str(signals[this_key]))
ifthis_key=="loop_enable":
ifnotsignals[this_key]:
self.loop_enable=False
@ -961,15 +975,15 @@ class MTChunks:
else:
print("ERROR: unknown signal '"+this_key+"'")
else:
print("WARNING: blank '"+signal_path+"'")
try:
os.remove()
os.remove(signal_path)
except:
print("FATAL ERROR: "+__file__+" must have permission to remove '"+signal_path+"' so exiting to avoid inability to avoid repeating commands at next launch.")
self.loop_enable=False
print("ERROR: "+__file__+" must have permission to remove '"+signal_path+"'. Commands will be repeated unless command was loop_enable:false.")# so exiting to avoid inability to avoid repeating commands at next launch.")
#to stop checking for map updates (NOTE: the map update function is only able to detect new chunks, and only checks edge chunks if player is present in one)
refresh_map_enable:False
# ALSO stops map generation early if still processing chunks
#to stop checking for player movements (players will timeout and the php will stop showing the players due to old file modified times)
refresh_players_enable:False
#to stop checking for map updates (NOTE: the map update function is only able to detect new chunks, and only checks edge chunks if player is present in one)
echo"To see what needs to be in your $MT_MY_WEBSITE_PATH directory (if you don't use that directory, modify chunkymap-regen.py to use your directory):"
echo"cd $CHUNKYMAP_DEST/web"
echo""
echo"To view helpful scripts:"
echo"cd $CHUNKYMAP_DEST"
echo""
echo"To learn more about chunkymap:"
echo"nano $CHUNKYMAP_DEST/README.md"
echo
# NOTE: colors.txt should ALREADY be in $HOME/minetest/util
print"FAILED to rewrite the file '"+file_path+"' (to change minetest util path to '"+home_minetest_chunkymap_path+"')--perhaps it is in use. Make the file writeable then try running "+__FILE__+" again."
input("Press enter to continue...")
ifos.path.isfile(file_path):
temp_path=file_path+".tmp"
os.rename(file_path,temp_path)
ifnotos.path.isfile(file_path):
ins=open(temp_path,'r')
outs=open(file_path,'w')
line=True
whileline:
line=ins.readline()
ifline:
line=line.replace("/home/owner",home_path)
outs.write(line+"\n")
outs.close()
os.remove(temp_path)
ins.close()
else:
print"FAILED to rewrite the file '"+file_path+"' (to change minetest util path to '"+home_minetest_chunkymap_path+"')--perhaps it is in use. Make the file writeable then try running "+__FILE__+" again."
input("Press enter to continue...")
else:
print"SKIPPED "+filename+" since not installed (probably ok since deprecated files are still listed here)"
else:
print"FAILED to find '"+home_minetest_chunkymap_path+"'"
print"Please install a compatible version of minetest-server package, run minetestserver once, then if you were running a chunkymap installer that called this py file, re-run that installer (otherwise re-run this script if you are sure that installer was successful)."
input("Press enter to continue...")
else:
print"This script only works on GNU/Linux systems (it is not needed on Windows, since on Windows, chunkymap will detect the scripts and colors.txt in the same folder as itself instead of using the minecraftserver minetest/util folder)"
print"This script only works on GNU/Linux systems (it is not needed on Windows, since on Windows, chunkymap will detect the scripts and colors.txt in the same directory as itself instead of using the minecraftserver minetest/util directory)"