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:
Shoghi Cervantes
2014-02-10 19:07:12 +01:00
93 changed files with 4848 additions and 2866 deletions

View File

@@ -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;

View File

@@ -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") : "";