mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-20 16:00:20 +00:00
Added PowerShell start script with loop capability, mainly useful for Win10 users (#240)
This commit is contained in:
parent
2e865a3af9
commit
67940ad6ab
40
start.ps1
Normal file
40
start.ps1
Normal file
@ -0,0 +1,40 @@
|
||||
param (
|
||||
[switch]$Loop = $false
|
||||
)
|
||||
|
||||
if(Test-Path "bin\php\php.exe"){
|
||||
$env:PHPRC = ""
|
||||
$binary = "bin\php\php.exe"
|
||||
}else{
|
||||
$binary = "php"
|
||||
}
|
||||
|
||||
if(Test-Path "PocketMine-MP.phar"){
|
||||
$file = "PocketMine-MP.phar"
|
||||
}elseif(Test-Path "src\pocketmine\PocketMine.php"){
|
||||
$file = "src\pocketmine\PocketMine.php"
|
||||
}else{
|
||||
echo "Couldn't find a valid PocketMine-MP installation"
|
||||
pause
|
||||
exit 1
|
||||
}
|
||||
|
||||
function StartServer{
|
||||
$command = $binary + " " + $file + " --enable-ansi"
|
||||
iex $command
|
||||
}
|
||||
|
||||
$loops = 0
|
||||
|
||||
StartServer
|
||||
|
||||
while($Loop){
|
||||
if($loops -ne 0){
|
||||
echo ("Restarted " + $loops + " times")
|
||||
}
|
||||
$loops++
|
||||
echo "To escape the loop, press CTRL+C now. Otherwise, wait 5 seconds for the server to restart."
|
||||
echo ""
|
||||
Start-Sleep 5
|
||||
StartServer
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user