diff --git a/.gitignore b/.gitignore index a2caf794..f58527c8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,6 @@ data/players/* data/maps/* *.log -*.bat server.properties white-list.txt banned-ips.txt diff --git a/input.php b/input.php index 7c17ce73..4d4d12d5 100644 --- a/input.php +++ b/input.php @@ -27,5 +27,9 @@ the Free Software Foundation, either version 3 of the License, or $fp = fopen(dirname(__FILE__)."/console.in","wb"); while(true){ - echo "/";fwrite($fp, fgets(STDIN)); + $l = fgets(STDIN); + fwrite($fp, $l); + if(strtolower(trim($l)) === "stop" and isset($argv[1]) and trim($argv[1]) == "1"){ + sleep(5);die(); + } } \ No newline at end of file diff --git a/start.bat b/start.bat new file mode 100644 index 00000000..11992c60 --- /dev/null +++ b/start.bat @@ -0,0 +1,29 @@ +@echo off +TITLE Pocket-Minecraft-PHP Server - by @shoghicp +echo. +echo - +echo / \ +echo / \ +echo / POCKET \ +echo / MINECRAFT PHP \ +echo ^|\ @shoghicp /^| +echo ^|. \ / .^| +echo ^| .. \ / .. ^| +echo ^| .. ^| .. ^| +echo ^| .. ^| .. ^| +echo \ ^| / +echo \ ^| / +echo \ ^| / +echo \ ^| / +echo. +echo. +FOR /F "tokens=*" %%i in ('php.exe -r "echo 1;"') do SET PHPOUTPUT=%%i +if not %PHPOUTPUT%==1 ( +echo [ERROR] Couldn't find PHP in PATH. +pause +exit +) +START /B CMD /C CALL php server.php +START /B /WAIT php input.php 1 +pause +exit \ No newline at end of file