Added -file (-f) option to start.ps1

This allows specifying a PocketMine-MP PHP file to execute (phar or source) to use to run the server, like start.sh. If not specified, auto-detection is used.
This commit is contained in:
Dylan K. Taylor 2017-12-11 19:40:02 +00:00
parent 98cb7f2e10
commit a5fc77749f

View File

@ -2,6 +2,7 @@
param (
[string]$php = "",
[switch]$Loop = $false,
[string]$file = "",
[string][Parameter(ValueFromRemainingArguments)]$extraPocketMineArgs
)
@ -14,14 +15,16 @@ if($php -ne ""){
$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
if($file -eq ""){
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{