From 1f8e25710d44bfac552ca90596e9fbc78d27bbda Mon Sep 17 00:00:00 2001 From: Shoghi Cervantes Date: Sat, 8 Feb 2014 14:46:08 +0100 Subject: [PATCH 1/4] Fixed set up wizard not updating the memory --- src/installer/Installer.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/installer/Installer.php b/src/installer/Installer.php index ac8217134..e7dd1070f 100644 --- a/src/installer/Installer.php +++ b/src/installer/Installer.php @@ -96,7 +96,7 @@ LICENSE; $config->set("server-port", $port); echo "[*] ".$this->lang->ram_warning."\n"; echo "[?] ".$this->lang->server_ram." (".self::DEFAULT_MEMORY."): "; - $config->set("gamemode", ((int) $this->getInput(self::DEFAULT_MEMORY))."M"); + $config->set("memory-limit", ((int) $this->getInput(self::DEFAULT_MEMORY))."M"); echo "[*] ".$this->lang->gamemode_info."\n"; do{ echo "[?] ".$this->lang->default_gamemode.": (".self::DEFAULT_GAMEMODE."): "; @@ -284,4 +284,4 @@ LICENSE; } } -/***REM_END***/ \ No newline at end of file +/***REM_END***/ From c2d4dd093ad64a834cb54e79999b8bf7266085bb Mon Sep 17 00:00:00 2001 From: Shoghi Cervantes Date: Sun, 9 Feb 2014 03:19:39 +0100 Subject: [PATCH 2/4] Updated repo name on installer --- src/build/installer.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/build/installer.sh b/src/build/installer.sh index 67812bbc8..4cba6bcde 100644 --- a/src/build/installer.sh +++ b/src/build/installer.sh @@ -59,7 +59,7 @@ rm -f start.sh rm -f start.bat echo "[1/3] Downloading PocketMine-MP $PMMP_VERSION..." set -e -download_file "https://github.com/shoghicp/PocketMine-MP/archive/$PMMP_VERSION.tar.gz" | tar -zx > /dev/null +download_file "https://github.com/PocketMine/PocketMine-MP/archive/$PMMP_VERSION.tar.gz" | tar -zx > /dev/null mv -f PocketMine-MP-$PMMP_VERSION/* ./ rm -f -r PocketMine-MP-$PMMP_VERSION/ rm -f ./start.cmd From 0e1c0999061f0495b8ccd837a461d27dc8b2f40e Mon Sep 17 00:00:00 2001 From: Shoghi Cervantes Date: Sun, 9 Feb 2014 03:20:09 +0100 Subject: [PATCH 3/4] Added iOS detection to Utils::getOS() --- src/utils/Utils.php | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/utils/Utils.php b/src/utils/Utils.php index a83793fbf..38e625298 100644 --- a/src/utils/Utils.php +++ b/src/utils/Utils.php @@ -90,12 +90,16 @@ class Utils{ } public static function getOS(){ - $uname = trim(strtoupper(php_uname("s"))); - if(strpos($uname, "DARWIN") !== false){ - return "mac"; - }elseif(strpos($uname, "WIN") !== false){ + $uname = php_uname("s"); + if(stripos($uname, "Darwin") !== false){ + if(strpos(php_uname("m"), "iP") === 0){ + return "ios"; + }else{ + return "mac"; + } + }elseif(stripos($uname, "Win") !== false){ return "win"; - }elseif(strpos($uname, "LINUX") !== false){ + }elseif(stripos($uname, "Linux") !== false){ return "linux"; }else{ return "other"; @@ -569,7 +573,7 @@ class Utils{ for($i = 0; $i < 8; $i += 4){ $value = bcmul($value, "4294967296", 0); //4294967296 == 2^32 - $value = bcadd($value, 0x1000000 * ord($x{$i}) + ((ord($x{$i + 1}) << 16) | (ord($x{$i + 2}) << 8) | ord($x{$i + 3})), 0); + $value = bcadd($value, 0x1000000 * ord(@$x{$i}) + ((ord(@$x{$i + 1}) << 16) | (ord(@$x{$i + 2}) << 8) | ord(@$x{$i + 3})), 0); } return ($negative === true ? "-".$value:$value); } From 7ebaf7e55250a01e00c0f2703624e3d2a96a6a8d Mon Sep 17 00:00:00 2001 From: Shoghi Cervantes Date: Sun, 9 Feb 2014 04:44:45 +0100 Subject: [PATCH 4/4] Added Android, BSD detection to Utils::getOS() --- src/utils/Utils.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/utils/Utils.php b/src/utils/Utils.php index 38e625298..9d77a8a63 100644 --- a/src/utils/Utils.php +++ b/src/utils/Utils.php @@ -97,10 +97,16 @@ class Utils{ }else{ return "mac"; } - }elseif(stripos($uname, "Win") !== false){ + }elseif(stripos($uname, "Win") !== false or $uname === "Msys"){ return "win"; }elseif(stripos($uname, "Linux") !== false){ - return "linux"; + if(@file_exists("/system/build.prop")){ + return "android"; + }else{ + return "linux"; + } + }elseif(stripos($uname, "BSD") !== false or $uname === "DragonFly"){ + return "bsd"; }else{ return "other"; }