mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-22 10:56:35 +00:00
Added a pocketmine.yml kill switch for development builds
This commit is contained in:
parent
8a9af7bf2f
commit
b5da6b1591
@ -38,6 +38,7 @@ namespace pocketmine {
|
|||||||
const NAME = "PocketMine-MP";
|
const NAME = "PocketMine-MP";
|
||||||
const VERSION = "1.7dev";
|
const VERSION = "1.7dev";
|
||||||
const API_VERSION = "3.0.0";
|
const API_VERSION = "3.0.0";
|
||||||
|
const IS_DEVELOPMENT_BUILD = true;
|
||||||
|
|
||||||
const MIN_PHP_VERSION = "7.2.0";
|
const MIN_PHP_VERSION = "7.2.0";
|
||||||
|
|
||||||
|
@ -1452,6 +1452,19 @@ class Server{
|
|||||||
|
|
||||||
define('pocketmine\DEBUG', (int) $this->getProperty("debug.level", 1));
|
define('pocketmine\DEBUG', (int) $this->getProperty("debug.level", 1));
|
||||||
|
|
||||||
|
$this->forceLanguage = (bool) $this->getProperty("settings.force-language", false);
|
||||||
|
$this->baseLang = new BaseLang($this->getProperty("settings.language", BaseLang::FALLBACK_LANGUAGE));
|
||||||
|
$this->logger->info($this->getLanguage()->translateString("language.selected", [$this->getLanguage()->getName(), $this->getLanguage()->getLang()]));
|
||||||
|
|
||||||
|
if(\pocketmine\IS_DEVELOPMENT_BUILD and !((bool) $this->getProperty("settings.enable-dev-builds", false))){
|
||||||
|
$this->logger->emergency($this->baseLang->translateString("pocketmine.server.devBuild.error1", [\pocketmine\NAME]));
|
||||||
|
$this->logger->emergency($this->baseLang->translateString("pocketmine.server.devBuild.error2"));
|
||||||
|
$this->logger->emergency($this->baseLang->translateString("pocketmine.server.devBuild.error3"));
|
||||||
|
$this->logger->emergency($this->baseLang->translateString("pocketmine.server.devBuild.error4", ["settings.enable-dev-builds"]));
|
||||||
|
$this->forceShutdown();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if(((int) ini_get('zend.assertions')) > 0 and ((bool) $this->getProperty("debug.assertions.warn-if-enabled", true)) !== false){
|
if(((int) ini_get('zend.assertions')) > 0 and ((bool) $this->getProperty("debug.assertions.warn-if-enabled", true)) !== false){
|
||||||
$this->logger->warning("Debugging assertions are enabled, this may impact on performance. To disable them, set `zend.assertions = -1` in php.ini.");
|
$this->logger->warning("Debugging assertions are enabled, this may impact on performance. To disable them, set `zend.assertions = -1` in php.ini.");
|
||||||
}
|
}
|
||||||
@ -1490,10 +1503,6 @@ class Server{
|
|||||||
"xbox-auth" => true
|
"xbox-auth" => true
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$this->forceLanguage = (bool) $this->getProperty("settings.force-language", false);
|
|
||||||
$this->baseLang = new BaseLang($this->getProperty("settings.language", BaseLang::FALLBACK_LANGUAGE));
|
|
||||||
$this->logger->info($this->getLanguage()->translateString("language.selected", [$this->getLanguage()->getName(), $this->getLanguage()->getLang()]));
|
|
||||||
|
|
||||||
$this->memoryManager = new MemoryManager($this);
|
$this->memoryManager = new MemoryManager($this);
|
||||||
|
|
||||||
$this->logger->info($this->getLanguage()->translateString("pocketmine.server.start", [TextFormat::AQUA . $this->getVersion() . TextFormat::RESET]));
|
$this->logger->info($this->getLanguage()->translateString("pocketmine.server.start", [TextFormat::AQUA . $this->getVersion() . TextFormat::RESET]));
|
||||||
|
@ -1 +1 @@
|
|||||||
Subproject commit 0d93f4e8a9fd5f4e0cb779d83358fb2df6c48611
|
Subproject commit 5e6ccee0c1962c8b28491212c3a947fb2036e4a4
|
@ -23,6 +23,9 @@ settings:
|
|||||||
#Set this approximately to your number of cores.
|
#Set this approximately to your number of cores.
|
||||||
#If set to auto, it'll try to detect the number of cores (or use 2)
|
#If set to auto, it'll try to detect the number of cores (or use 2)
|
||||||
async-workers: auto
|
async-workers: auto
|
||||||
|
#Whether to allow running development builds. Dev builds might crash, break your plugins, corrupt your world and more.
|
||||||
|
#It is recommended to avoid using development builds where possible.
|
||||||
|
enable-dev-builds: false
|
||||||
|
|
||||||
memory:
|
memory:
|
||||||
#Global soft memory limit in megabytes. Set to 0 to disable
|
#Global soft memory limit in megabytes. Set to 0 to disable
|
||||||
|
@ -48,7 +48,7 @@ mkdir "$DATA_DIR"
|
|||||||
mkdir "$PLUGINS_DIR"
|
mkdir "$PLUGINS_DIR"
|
||||||
mv DevTools.phar "$PLUGINS_DIR"
|
mv DevTools.phar "$PLUGINS_DIR"
|
||||||
cp -r tests/plugins/PocketMine-TesterPlugin "$PLUGINS_DIR"
|
cp -r tests/plugins/PocketMine-TesterPlugin "$PLUGINS_DIR"
|
||||||
echo -e "stop\n" | "$PHP_BINARY" PocketMine-MP.phar --no-wizard --disable-ansi --disable-readline --debug.level=2 --data="$DATA_DIR" --plugins="$PLUGINS_DIR" --anonymous-statistics.enabled=0 --settings.async-workers="$PM_WORKERS"
|
echo -e "stop\n" | "$PHP_BINARY" PocketMine-MP.phar --no-wizard --disable-ansi --disable-readline --debug.level=2 --data="$DATA_DIR" --plugins="$PLUGINS_DIR" --anonymous-statistics.enabled=0 --settings.async-workers="$PM_WORKERS" --settings.enable-dev-builds=1
|
||||||
|
|
||||||
output=$(grep '\[TesterPlugin\]' "$DATA_DIR/server.log")
|
output=$(grep '\[TesterPlugin\]' "$DATA_DIR/server.log")
|
||||||
if [ "$output" == "" ]; then
|
if [ "$output" == "" ]; then
|
||||||
|
Loading…
x
Reference in New Issue
Block a user