poikilos
7 years ago
committed by
Jacob Gustafson
7 changed files with 269 additions and 120 deletions
@ -0,0 +1,17 @@ |
|||
diff -r /home/owner/Backup/fcalocal/usr/share/games/minetest/games/minetest_game-0.4.15-git/mods/bones/init.lua /home/owner/Backup/fcalocal/usr/share/games/minetest/games/minetest_game-0.4.15-git+enliven_patches/mods/bones/init.lua
|
|||
168a169 |
|||
> local pos = vector.round(player:getpos()) |
|||
170a172,173 |
|||
> minetest.log("action", "[bones] " .. player:get_player_name() .. "'s bones do not remain since in creative_mode -- died at " .. minetest.pos_to_string(vector.round(player:getpos()))) |
|||
> minetest.chat_send_player(player:get_player_name(), player:get_player_name() .. "'s bones do not remain since in creative_mode -- died at " .. minetest.pos_to_string(pos)) --formerly ("Bones placed at %s."):format(pos) |
|||
176a180,181 |
|||
> minetest.log("action", "[bones] " .. player:get_player_name() .. "'s bones do not remain since inventory and craft are empty -- died at " .. minetest.pos_to_string(vector.round(player:getpos()))) |
|||
> minetest.chat_send_player(player:get_player_name(), player:get_player_name() .. "'s bones do not remain since inventory and craft are empty -- died at " .. minetest.pos_to_string(pos)) --formerly ("Bones placed at %s."):format(pos) |
|||
207a213,215 |
|||
> |
|||
> minetest.log("action", "[bones] " .. player:get_player_name() .. "'s bones do not remain since area is_protected -- died at " .. minetest.pos_to_string(pos)) |
|||
> minetest.chat_send_player(player:get_player_name(), player:get_player_name() .. "'s do not remain since area is_protected -- died at " .. minetest.pos_to_string(pos)) --formerly ("Bones placed at %s."):format(pos) |
|||
212a221,222 |
|||
> minetest.log("action", "[bones] " .. player:get_player_name() .. "'s bones remain where died at " .. minetest.pos_to_string(pos)) |
|||
> minetest.chat_send_player(player:get_player_name(), player:get_player_name() .. "'s bones remain where died at " .. minetest.pos_to_string(pos)) --formerly ("Bones placed at %s."):format(pos) |
|||
|
@ -1,8 +1,16 @@ |
|||
#!/bin/sh |
|||
echo "WARNING: mts-ENLIVEN script is deprecated--instead, run:" |
|||
echo " python3 mtsenliven.py" |
|||
# sleep 4 |
|||
# exit 1 |
|||
mts=minetestserver |
|||
if [ ! -f "`command -v minetestserver`" ]; then |
|||
mts=$HOME/minetest/bin/minetestserver |
|||
fi |
|||
#BROKEN: screen -t MinetestServer minetestserver --gameid minetest_next --draworigin --drawplayers --world FCAWorldMTNext |
|||
#BROKEN: screen -t MinetestServer minetestserver --gameid ENLIVEN --worldname FCAGameAWorld |
|||
#NOTE: if only title is set, screen -x must be used to resume, so use -S <name> to resume with -r <name> |
|||
#screen -S MinetestServer minetestserver --gameid ENLIVEN --worldname FCAGameAWorld |
|||
#screen -S MinetestServer /home/owner/minetest/bin/minetestserver --gameid ENLIVEN --worldname FCAGameAWorld |
|||
screen -S MinetestServer $HOME/minetest/bin/minetestserver --gameid ENLIVEN --worldname FCAGameAWorld |
|||
screen -S MinetestServer $mts --gameid ENLIVEN --worldname FCAGameAWorld |
|||
|
|||
|
@ -0,0 +1,2 @@ |
|||
#!/usr/bin/env python3 |
|||
print("This doesn't work (not yet implemented)") |
@ -0,0 +1,21 @@ |
|||
#!/usr/bin/env python3 |
|||
import os |
|||
from mtanalyze.minetestinfo import * |
|||
import subprocess, signal |
|||
game_id = "ENLIVEN" |
|||
#screen -S MinetestServer $mts --gameid ENLIVEN --worldname FCAGameAWorld |
|||
|
|||
if not minetestinfo.contains("minetestserver_path"): |
|||
print("[ mtsenliven.py ] ERROR: minetestserver_path" |
|||
"was not found in your version of minetestinfo.py") |
|||
exit(1) |
|||
|
|||
mts = minetestinfo.get_var("system.minetestserver_path") |
|||
if not minetestinfo.contains("primary_world_path"): |
|||
print("[ mtsenliven.py ] ERROR: primary_world_path" |
|||
"was selected by minetestinfo.py") |
|||
exit(2) |
|||
wp = minetestinfo.get_var("primary_world_path") |
|||
wn = os.path.basename(wp) |
|||
p = subprocess.Popen([mts, '--gameid '+game_id, '--worldname '+wn]) |
|||
# stdout=subprocess.PIPE) |
@ -0,0 +1,73 @@ |
|||
# EnlivenMinetest webapp |
|||
EnlivenMinetest Node.js webapp for web management of minetest |
|||
* Must run as same user as minetestserver, and neither as root |
|||
|
|||
Uses passport |
|||
see <https://code.tutsplus.com/tutorials/authenticating-nodejs-applications-with-passport--cms-21619> |
|||
|
|||
Replaces the "write" (stdout) method of the minetest process: |
|||
see <https://stackoverflow.com/questions/18543047/mocha-monitor-application-output> |
|||
## Developer Notes |
|||
|
|||
### Things webapp should deprecate |
|||
* /home/owner/GitHub/EnlivenMinetest/etc/change_hardcoded_world_name_first/eauth |
|||
* shell script which contains only `nano ~/.minetest/worlds/FCAGameAWorld/auth.txt` |
|||
* mts-ENLIVEN and mtsenliven.py (run minetestserver with selected game and world) |
|||
``` |
|||
var path = require('path'); |
|||
|
|||
results = {} |
|||
if (!has_setting("system.minetestserver_path")): |
|||
results.error="[ mtsenliven.py ] ERROR: minetestserver_path was not found in your version of minetestinfo.py"; |
|||
return results; |
|||
var mts = peek_setting("system.minetestserver_path") |
|||
if (!has_setting("owner.primary_world_path")): |
|||
results.error= "[ mtsenliven.py ] ERROR: primary_world_path was selected by minetestinfo.py"; |
|||
return results; |
|||
|
|||
var world_path = peek_setting("owner.primary_world_path"); |
|||
var world_name = path.basename(wp); |
|||
p = subprocess.Popen([mts, '--gameid ENLIVEN', '--worldname ' + world_name], |
|||
stdout=subprocess.PIPE); |
|||
p.write = mts_out; |
|||
return results; |
|||
``` |
|||
|
|||
### Development Log |
|||
```bash |
|||
#!/bin/sh |
|||
sudo apt update |
|||
sudo apt install nodejs npm mongodb |
|||
# NOTE: mongo daemon is called mongod |
|||
target_dir=$HOME/enlivenode |
|||
if [ ! -d "$target_dir" ]; then |
|||
print "ERROR: Nothing done since missing $target_dir" |
|||
exit 1 |
|||
fi |
|||
cd "$target_dir" |
|||
npm init |
|||
#except changed jade to pug |
|||
npm install express static-favicon morgan cookie-parser body-parser debug pug passport passport-local mongoose |
|||
|
|||
``` |
|||
|
|||
### Old (Unused) |
|||
|
|||
``` |
|||
#!/bin/sh |
|||
wget https://raw.githubusercontent.com/ericf/express-handlebars/master/examples/basic/server.js |
|||
wget https://raw.githubusercontent.com/ericf/express-handlebars/master/examples/basic/package.json |
|||
mkdir views |
|||
cd views |
|||
wget https://raw.githubusercontent.com/ericf/express-handlebars/master/examples/basic/views/home.handlebars |
|||
mkdir layouts |
|||
cd layouts |
|||
wget https://raw.githubusercontent.com/ericf/express-handlebars/master/examples/basic/views/layouts/main.handlebars |
|||
|
|||
if [ -d ../layouts ]; then |
|||
cd .. |
|||
fi |
|||
if [ -d ../views ]; then |
|||
cd .. |
|||
fi |
|||
``` |
Loading…
Reference in new issue