mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-04 00:59:51 +00:00
Added extra machine data to Utils::getUniqueID()
This commit is contained in:
parent
7560a5416e
commit
7403516aab
@ -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;
|
||||
|
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user