From 5693589721f60d3208640d9cd707863656ff7b60 Mon Sep 17 00:00:00 2001 From: BuildTools Date: Sat, 30 Apr 2016 20:38:14 -0400 Subject: [PATCH] Hmm... --- DEBUG.PROXY.BAT | 1 + DEBUG.TTE.BAT | 1 + bin/x/proxy.bat | 60 +++++++++++++++++++++++++++++++++++++++++++++++ bin/x/server.bat | 61 ++++++++++++++++++++++++++++++++++++++++++++++++ proxy.bat | 40 ++++++++++++++++--------------- server.bat | 56 +++++++++++++++++++++++++++++++++----------- 6 files changed, 187 insertions(+), 32 deletions(-) create mode 100644 DEBUG.PROXY.BAT create mode 100644 DEBUG.TTE.BAT create mode 100644 bin/x/proxy.bat create mode 100644 bin/x/server.bat diff --git a/DEBUG.PROXY.BAT b/DEBUG.PROXY.BAT new file mode 100644 index 0000000..e969c16 --- /dev/null +++ b/DEBUG.PROXY.BAT @@ -0,0 +1 @@ +start "" bin\mintty.exe -o Columns=88 -o Rows=32 -o AllowBlinking=0 -o FontQuality=3 -o Font="DejaVu Sans Mono" -o FontHeight=10 -o CursorType=2 -o CursorBlinks=0 -h error -t "iServer Debug Console" -w max bin\x\proxy.bat --enable-ansi %* \ No newline at end of file diff --git a/DEBUG.TTE.BAT b/DEBUG.TTE.BAT new file mode 100644 index 0000000..d94557d --- /dev/null +++ b/DEBUG.TTE.BAT @@ -0,0 +1 @@ +start "" bin\mintty.exe -o Columns=88 -o Rows=32 -o AllowBlinking=0 -o FontQuality=3 -o Font="DejaVu Sans Mono" -o FontHeight=10 -o CursorType=2 -o CursorBlinks=0 -h error -t "iServer Debug Console" -w max bin\x\server.bat --enable-ansi %* \ No newline at end of file diff --git a/bin/x/proxy.bat b/bin/x/proxy.bat new file mode 100644 index 0000000..b44fd67 --- /dev/null +++ b/bin/x/proxy.bat @@ -0,0 +1,60 @@ +@echo off +TITLE iServer Proxy v1.09b +echo INITIALIZING... +ping 9.9.9.9 -n 2.5>nul +echo LOADING SRC\PROXY\MAIN.SCI +echo LOADING SRC\PROXY\TASKLISTENER\MAIN.SCI +ping 9.9.9.9 -n 3>nul +echo LOADING SOURCES... +ping 6.7.8.9 -n 1>nul +echo DONE! +echo. +if exist HOST_1 ( +echo Loading hosts... +) else ( +echo PLEASE SET UP HOSTS +type /p HOST1_IP="Host 1 IP: " +type /p HOST1_PORT="Host 1 Port: " +type /p HOST2_IP="Host 2 IP: " +type /p HOST2_PORT="Host 2 Port: " +type /p HOST3_IP="Host 3 IP: " +type /p HOST3_PORT="Host 3 Port: " +type /p HOST4_IP="Host 4 IP: " +type /p HOST4_PORT="Host 4 Port: " +type /p HOST5_IP="Host 5 IP: " +type /p HOST5_PORT="Host 5 Port: " +echo ALL LOCATIONS: +echo "%HOST1_IP%:%HOST1_PORT%" +echo "%HOST2_IP%:%HOST2_PORT%" +echo "%HOST3_IP%:%HOST3_PORT%" +echo "%HOST4_IP%:%HOST4_PORT%" +echo "%HOST5_IP%:%HOST5_PORT%" +echo. +echo Writing all data to files... +if exist data\ ( +) else ( +echo Creating directory... +mkdir data +) +echo %HOST1_IP%:%HOST1_PORT%>HOST_1 +echo %HOST2_IP%:%HOST2_PORT%>HOST_2 +echo %HOST3_IP%:%HOST3_PORT%>HOST_3 +echo %HOST4_IP%:%HOST4_PORT%>HOST_4 +echo %HOST5_IP%:%HOST5_PORT%>HOST_5 +echo. +) +echo Checking hosts... +echo. +echo Checking 1... +ping %HOST1_IP%:%HOST1_PORT% +echo Checking 2... +ping %HOST2_IP%:%HOST2_PORT% +echo Checking 3... +ping %HOST3_IP%:%HOST3_PORT% +echo Checking 4... +ping %HOST4_IP%:%HOST4_PORT% +echo Checking 5... +ping %HOST5_IP%:%HOST5_PORT% +echo. +echo Done! +pause \ No newline at end of file diff --git a/bin/x/server.bat b/bin/x/server.bat new file mode 100644 index 0000000..677649a --- /dev/null +++ b/bin/x/server.bat @@ -0,0 +1,61 @@ +@echo off +TITLE iServer Beta Build #13 +echo [INFO] Starting Server on 127.0.0.1:19132 +echo [INFO] Loading assets... +ping 192.0.2.2 -n 5 > nul +echo [NOTICE] Level saving not yet implented. Neither is player data saving, closing the server delets everything. +if exist server.conf ( + echo [INFO] Loading server.conf files... + +) else ( + echo [CRITICAL] server.conf not found, generating new key...> server.motd +) +if exist proxySetup.conf ( + echo [INFO] Loading proxySetup.conf message... + +) else ( + echo [CRITICAL] proxySetup.conf not found, generating new key...> join.msg +) +echo [INFO] Loading plugins... + +if exist task.sci ( + echo [INFO] Loading packaged task file... + +) else ( + echo [WARNING] Non-packaged server installation detected. Not suitable for a production server. + +) +echo [INFO] Loading plugins... + +echo ----------[ Addon Manager ]----------- +echo Loading addons... +if exist addons\MCPETransfer.jfs ( + if exist addons\patches\mct.patch ( + echo [MCPETransfer] MCPETransfer loaded and ready! + ) else ( + echo [CRITICAL] bootstrapProcess failed for loading addon process of MCPETransfer + echo [MCPETransfer] An error ocurred and the process canceled +) + +) else ( + echo No addons to load! +) +echo ----------[ Addon Manager ]----------- +echo [THREAD] ThreadWork Finished! +goto :loop +:loop +set /p CMD="> " +if %CMD% == help ( +echo --- Command Help --- +echo help - Shows a list of commands. +echo sudo - Initiates 'sudo' mode [EXPIERIMENTAL] +echo [NOTICE] Commands have not yet been implented! +) else if %CMD% == sudo ( +echo [ALERT] Attempting to 'sudo' a command // Doesn't seem to be working. +type /p SUDO_CMD="$ " +ping 127.8.0.1 -n 1>nul +%SUDO_CMD% +) else ( +echo [INFO] Failed to execute command +) +goto :loop \ No newline at end of file diff --git a/proxy.bat b/proxy.bat index 889b02d..5894f0d 100644 --- a/proxy.bat +++ b/proxy.bat @@ -1,27 +1,30 @@ @echo off TITLE iServer Proxy v1.09b echo INITIALIZING... -pine 9.9.9.9 -n 2.5>nul +ping 9.9.9.9 -n 2.5>nul echo LOADING SRC\PROXY\MAIN.SCI echo LOADING SRC\PROXY\TASKLISTENER\MAIN.SCI ping 9.9.9.9 -n 3>nul echo LOADING SOURCES... -ping 6.7.8.9 -n 1>nul +ping 6.7.8.9 -n 2>nul echo DONE! echo. echo PLEASE SET UP HOSTS -pause -type /p HOST1_IP="Host 1 IP: " -type /p HOST1_PORT="Host 1 Port: " -type /p HOST2_IP="Host 2 IP: " -type /p HOST2_PORT="Host 2 Port: " -type /p HOST3_IP="Host 3 IP: " -type /p HOST3_PORT="Host 3 Port: " -type /p HOST4_IP="Host 4 IP: " -type /p HOST4_PORT="Host 4 Port: " -type /p HOST5_IP="Host 5 IP: " -type /p HOST5_PORT="Host 5 Port: " -pause +echo Host1 +set /p HOST1_IP=IP: +set /p HOST1_PORT=Port: +echo Host2 +set /p HOST2_IP=IP: +set /p HOST2_PORT=Port: +echo Host3 +set /p HOST3_IP=IP: +set /p HOST3_PORT=Port: +echo Host4 +set /p HOST4_IP=IP: +set /p HOST4_PORT=Port: +echo Host5 +set /p HOST5_IP=IP: +set /p HOST5_PORT=Port: echo ALL LOCATIONS: echo "%HOST1_IP%:%HOST1_PORT%" echo "%HOST2_IP%:%HOST2_PORT%" @@ -30,16 +33,15 @@ echo "%HOST4_IP%:%HOST4_PORT%" echo "%HOST5_IP%:%HOST5_PORT%" echo. echo Writing all data to files... -if exist data\ ( -) else ( -echo Creating directory... -mkdir data -) +cd data +cd proxy echo %HOST1_IP%:%HOST1_PORT%>HOST_1 echo %HOST2_IP%:%HOST2_PORT%>HOST_2 echo %HOST3_IP%:%HOST3_PORT%>HOST_3 echo %HOST4_IP%:%HOST4_PORT%>HOST_4 echo %HOST5_IP%:%HOST5_PORT%>HOST_5 +cd .. +cd .. echo. echo Checking hosts... echo. diff --git a/server.bat b/server.bat index 677649a..565884d 100644 --- a/server.bat +++ b/server.bat @@ -1,4 +1,12 @@ @echo off +if not exist data\server\wizard ( +echo. +echo Welcome to iServer! +echo Website: https://github.com/iServer-Project +echo. +echo. +goto :setup +) TITLE iServer Beta Build #13 echo [INFO] Starting Server on 127.0.0.1:19132 echo [INFO] Loading assets... @@ -43,19 +51,41 @@ if exist addons\MCPETransfer.jfs ( echo ----------[ Addon Manager ]----------- echo [THREAD] ThreadWork Finished! goto :loop +goto :loop2 :loop set /p CMD="> " -if %CMD% == help ( -echo --- Command Help --- -echo help - Shows a list of commands. -echo sudo - Initiates 'sudo' mode [EXPIERIMENTAL] -echo [NOTICE] Commands have not yet been implented! -) else if %CMD% == sudo ( -echo [ALERT] Attempting to 'sudo' a command // Doesn't seem to be working. -type /p SUDO_CMD="$ " -ping 127.8.0.1 -n 1>nul -%SUDO_CMD% -) else ( -echo [INFO] Failed to execute command +if %CMD% == "help" ( +echo [INFO] Commands are not implented yet! +) +goto :loop +:loop2 +set %memory% == %random% / 20 +cd data +cd server +type 2 == %RAM% +TITLE iServer [1 THREADS][%memory% / %RAM%] +ping 9.8.7.6:9076 -n 2.0%random%>nul +:setup +echo Welcome to iServer! +echo There will be a quick set-up wizard. Would you like to skip it? [y/N] +set /p tmp="" +if %tmp% == "y" ( +cd data +cd server +echo ~!@#$%^&*()_+{}|:"<>?`1234567890-=[]\;',./qwertyuiopasdfghjklzxcvbnm > WIZARD +echo %SKIP_WIZARD%==TRUE >> WIZARD +exit +) +echo [*] What is the maximum amount of players aloud? [20] +set /p tmp="" +if %tmp% == "" ( +set %tmp% == "20" +echo %tmp% > 1 +) +echo [*] RAM is the max amount of memory iServer will use. What value would you like to assign to RAM? [128] +set /p tmp="" +if %tmp% == "" ( +set %tmp% == "128" +echo %tmp% > 2 ) -goto :loop \ No newline at end of file +) \ No newline at end of file