Added extra machine data to Utils::getUniqueID()

This commit is contained in:
Shoghi Cervantes 2014-01-30 01:13:58 +01:00
parent 7560a5416e
commit 7403516aab
2 changed files with 3 additions and 2 deletions

View File

@ -36,7 +36,7 @@ class PocketMinecraftServer{
}*/
console("[INFO] Starting Minecraft PE server on ".($this->serverip === "0.0.0.0" ? "*":$this->serverip).":".$this->port);
define("BOOTUP_RANDOM", Utils::getRandomBytes(16));
$this->serverID = $this->serverID === false ? Utils::readLong(substr(Utils::getUniqueID(true), 8)):$this->serverID;
$this->serverID = $this->serverID === false ? Utils::readLong(substr(Utils::getUniqueID(true, $this->serverip . $this->port), 8)):$this->serverID;
$this->seed = $this->seed === false ? Utils::readInt(Utils::getRandomBytes(4, false)):$this->seed;
$this->startDatabase();
$this->api = false;

View File

@ -31,10 +31,11 @@ class Utils{
return ((@fsockopen("google.com", 80, $e = null, $n = null, 2) !== false or @fsockopen("www.linux.org", 80, $e = null, $n = null, 2) !== false or @fsockopen("www.php.net", 80, $e = null, $n = null, 2) !== false) ? true:false);
}
public static function getUniqueID($raw = false){
public static function getUniqueID($raw = false, $extra = ""){
$machine = php_uname("a");
$machine .= file_exists("/proc/cpuinfo") ? file_get_contents("/proc/cpuinfo") : "";
$machine .= sys_get_temp_dir();
$machine .= $extra;
if(Utils::getOS() == "win"){
exec("ipconfig /ALL", $mac);
$mac = implode("\n", $mac);