mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-22 12:39:43 +00:00
no kb if entity is dead + Utils::getUniqueID change
This commit is contained in:
parent
b1025aa4a3
commit
a3711cfded
2 changed files with 19 additions and 4 deletions
|
|
@ -1434,6 +1434,9 @@ class Entity extends Position
|
||||||
|
|
||||||
public function knockBack($d, $d1)
|
public function knockBack($d, $d1)
|
||||||
{
|
{
|
||||||
|
if($this->closed || $this->dead){
|
||||||
|
return false;
|
||||||
|
}
|
||||||
$f = sqrt($d * $d + $d1 * $d1);
|
$f = sqrt($d * $d + $d1 * $d1);
|
||||||
$f1 = 0.4;
|
$f1 = 0.4;
|
||||||
$this->speedX /= 2;
|
$this->speedX /= 2;
|
||||||
|
|
|
||||||
|
|
@ -99,13 +99,14 @@ class Utils{
|
||||||
|
|
||||||
public static function getUniqueID($raw = false, $extra = ""){
|
public static function getUniqueID($raw = false, $extra = ""){
|
||||||
$machine = php_uname("a");
|
$machine = php_uname("a");
|
||||||
$machine .= file_exists("/proc/cpuinfo") ? file_get_contents("/proc/cpuinfo") : "";
|
$machine .= file_exists("/proc/cpuinfo") ? `cat /proc/cpuinfo | grep "model name"` : "";
|
||||||
$machine .= sys_get_temp_dir();
|
$machine .= sys_get_temp_dir();
|
||||||
$machine .= $extra;
|
$machine .= $extra;
|
||||||
if(Utils::getOS() == "win"){
|
$os = Utils::getOS();
|
||||||
exec("ipconfig /ALL", $mac);
|
if($os === "win"){
|
||||||
|
@exec("ipconfig /ALL", $mac);
|
||||||
$mac = implode("\n", $mac);
|
$mac = implode("\n", $mac);
|
||||||
if(preg_match_all("#Physical Address[. ]{1,}: ([0-9A-F\-]{17})#", $mac, $matches)){
|
if(preg_match_all("#Physical Address[. ]{1,}: ([0-9A-F\\-]{17})#", $mac, $matches)){
|
||||||
foreach($matches[1] as $i => $v){
|
foreach($matches[1] as $i => $v){
|
||||||
if($v == "00-00-00-00-00-00"){
|
if($v == "00-00-00-00-00-00"){
|
||||||
unset($matches[1][$i]);
|
unset($matches[1][$i]);
|
||||||
|
|
@ -113,6 +114,17 @@ class Utils{
|
||||||
}
|
}
|
||||||
$machine .= implode(" ", $matches[1]); //Mac Addresses
|
$machine .= implode(" ", $matches[1]); //Mac Addresses
|
||||||
}
|
}
|
||||||
|
}elseif($os === "linux"){
|
||||||
|
@exec("ifconfig", $mac);
|
||||||
|
$mac = implode("\n", $mac);
|
||||||
|
if(preg_match_all("#HWaddr[ \t]{1,}([0-9a-f:]{17})#", $mac, $matches)){
|
||||||
|
foreach($matches[1] as $i => $v){
|
||||||
|
if($v == "00:00:00:00:00:00"){
|
||||||
|
unset($matches[1][$i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$machine .= implode(" ", $matches[1]); //Mac Addresses
|
||||||
|
}
|
||||||
}
|
}
|
||||||
$data = $machine . PHP_MAXPATHLEN;
|
$data = $machine . PHP_MAXPATHLEN;
|
||||||
$data .= PHP_INT_MAX;
|
$data .= PHP_INT_MAX;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue