This repository was archived by the owner on Mar 28, 2022. It is now read-only.
forked from Hydreon/Steadfast2
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathalways-online.cmd
More file actions
106 lines (68 loc) · 2.24 KB
/
always-online.cmd
File metadata and controls
106 lines (68 loc) · 2.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
@echo off
::
:: _____ _ _ __ _ _____
:: / ____| | | |/ _| | | | ____|
:: | (___ | |_ ___ __ _ __| | |_ __ _ ___| |_| |__
:: \___ \| __/ _ \/ _` |/ _` | _/ _` / __| __|___ \
:: ____) | || __/ (_| | (_| | || (_| \__ \ |_ ___) |
:: |_____/ \__\___|\__,_|\__,_|_| \__,_|___/\__|____/
::
:: This program is free software: you can redistribute it and/or modify
:: it under the terms of the GNU Lesser General Public License as published by
:: the Free Software Foundation, either version 3 of the License, or
:: (at your option) any later version.
::
:: @author Steadfast5 Team
:: @link https://steadfast5.tk
::
REM Set TIMEOUT to how many seconds you want in between when the server stops to when the next restart takes place
set TIMEOUT=3
cd /d %~dp0
netstat -o -n -a | findstr 0.0.0.0:19132 > NUL
if %ERRORLEVEL% equ 0 (
goto :loop
) else (
echo "Script has been initialized."
goto :start
)
:loop
ping 127.0.0.1 -n %TIMEOUT% > NUL
netstat -o -n -a | findstr 0.0:19132 > NUL
if %ERRORLEVEL% equ 0 (
goto :loop
) else (
ping 127.0.0.1 -n %TIMEOUT% > NUL
echo "Server stopped. It'll be restarted in %TIMEOUT% second(s). You can press Ctrl+C to stop the restart process if you don't want to restart."
goto :start
)
:start
if exist bin\php\php.exe (
set PHP_BINARY=bin\php\php.exe
) else (
set PHP_BINARY=php
)
if exist Steadfast5.phar (
set POCKETMINE_FILE=Steadfast5.phar
) else (
if exist PocketMine-MP.phar (
set POCKETMINE_FILE=PocketMine-MP.phar
) else (
if exist src\pocketmine\PocketMine.php (
set POCKETMINE_FILE=src\pocketmine\PocketMine.php
) else (
echo "Couldn't find a valid Steadfast5 installation"
pause
exit 1
)
)
)
rem if exist bin\php\php_wxwidgets.dll (
rem %PHP_BINARY% %POCKETMINE_FILE% --enable-gui %*
rem ) else (
if exist bin\mintty.exe (
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=0 -o CursorBlinks=1 -h error -t "PocketMine-MP" -i bin/pocketmine.ico -w max %PHP_BINARY% %POCKETMINE_FILE% --enable-ansi %*
) else (
%PHP_BINARY% -c bin\php %POCKETMINE_FILE% %*
)
rem )
goto :loop