mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-10-18 04:00:29 +00:00
Merge pull request #1188 from PocketMine/Faster-Network
Merge Faster-Network into master. Added new Networking system, new Event system
This commit is contained in:
@@ -28,7 +28,7 @@ class Cache{
|
||||
|
||||
public static function get($identifier){
|
||||
if(isset(self::$cached[$identifier])){
|
||||
self::$cached[$identifier][1] += $minTTL;
|
||||
self::$cached[$identifier][1] = microtime(true) + self::$cached[$identifier][2];
|
||||
return self::$cached[$identifier][0];
|
||||
}
|
||||
return false;
|
||||
|
@@ -31,6 +31,14 @@ class Utils{
|
||||
return ((@fsockopen("8.8.8.8", 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 getCallableIdentifier(callable $variable){
|
||||
if(is_array($variable)){
|
||||
return sha1(strtolower(get_class($variable))."::".strtolower($variable[1]));
|
||||
}else{
|
||||
return sha1(strtolower($variable));
|
||||
}
|
||||
}
|
||||
|
||||
public static function getUniqueID($raw = false, $extra = ""){
|
||||
$machine = php_uname("a");
|
||||
$machine .= file_exists("/proc/cpuinfo") ? file_get_contents("/proc/cpuinfo") : "";
|
||||
|
Reference in New Issue
Block a user