{ if (($rank & self::RANK_IMPORTANCE_VIP) === self::RANK_IMPORTANCE_VIP) { return 129600; } if (($rank & self::RANK_IMPORTANCE_DONATOR) === self::RANK_IMPORTANCE_DONATOR) { return 216000; } return PHP_INT_MAX; } /** * @param Vector3 $from * @param Vector3 $to * @return mixed */ public static function isLocalChat($from, $to) { return $from->distanceSquared($to) <= 1600; } } $config = new Config("legionpe.yml", Config::YAML, ["localize" => ["id" => 0, "ip" => "pe.legionpvp.eu", "port" => 19132, "class" => "hub"], "system" => ["isTest" => false, "maxPlayers" => 60]]); Settings::$SYSTEM_MAX_PLAYERS = $config->getNested("system.maxPlayers"); Settings::$SYSTEM_IS_TEST = $config->getNested("system.isTest"); Settings::$PROCESS_ID = getmypid(); Settings::$LOCALIZE_ID = $config->getNested("localize.id"); Settings::$LOCALIZE_IP = $config->getNested("localize.ip"); Settings::$LOCALIZE_PORT = $config->getNested("localize.port"); $array = ["hub" => Settings::CLASS_HUB, "pvp" => Settings::CLASS_KITPVP, "kitpvp" => Settings::CLASS_KITPVP, "parkour" => Settings::CLASS_PARKOUR, "spleef" => Settings::CLASS_SPLEEF, "infected" => Settings::CLASS_INFECTED, "classic" => Settings::CLASS_CLASSICAL, "classical" => Settings::CLASS_CLASSICAL]; if (!isset($array[$config->getNested("localize.class")])) { throw new \RuntimeException("Invalid class: " . var_export($config->getNested("localize.class"), true)); } Settings::$LOCALIZE_CLASS = $array[$config->getNested("localize.class")];