Fixed invalid worlds property being set by users

This commit is contained in:
Shoghi Cervantes 2014-11-28 12:47:28 +01:00
parent 0bc9a9bdab
commit 3abf36ad07

View File

@ -299,7 +299,7 @@ class Server{
* @return int * @return int
*/ */
public function getViewDistance(){ public function getViewDistance(){
return max(56, $this->getProperty("chunk-sending.max-chunks")); return max(56, $this->getProperty("chunk-sending.max-chunks", 96));
} }
/** /**
@ -313,7 +313,7 @@ class Server{
* @return string * @return string
*/ */
public function getServerName(){ public function getServerName(){
return $this->getConfigString("motd", "Unknown server"); return $this->getConfigString("motd", "Minecraft: PE Server");
} }
/** /**
@ -1622,7 +1622,7 @@ class Server{
return; return;
} }
foreach($this->getProperty("worlds", []) as $name => $worldSetting){ foreach((array) $this->getProperty("worlds", []) as $name => $worldSetting){
if($this->loadLevel($name) === false){ if($this->loadLevel($name) === false){
$seed = $this->getProperty("worlds.$name.seed", time()); $seed = $this->getProperty("worlds.$name.seed", time());
$options = explode(":", $this->getProperty("worlds.$name.generator", Generator::getGenerator("default"))); $options = explode(":", $this->getProperty("worlds.$name.generator", Generator::getGenerator("default")));