mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-22 08:44:01 +00:00
Added API Version check
This commit is contained in:
parent
4f0517a5a7
commit
719dff6e3c
@ -84,8 +84,11 @@ class PluginAPI extends stdClass{
|
||||
console("[ERROR] [PluginAPI] Failed loading plugin: evaluation error");
|
||||
}
|
||||
$className = trim($info["class"]);
|
||||
if(!isset($info["apiversion"]) or intval($info["apiversion"]) < CURRENT_API_VERSION){
|
||||
console("[ERROR] [PluginAPI] Plugin \"".$info["name"]."\" uses an outdated API! It can crash or corrupt the server!");
|
||||
}
|
||||
if(isset($info["api"]) and $info["api"] !== true){
|
||||
console("[NOTICE] [PluginAPI] Plugin \"\x1b[36m".$info["name"]."\x1b[0m\" got raw access to Server methods");
|
||||
console("[INFO] [PluginAPI] Plugin \"\x1b[36m".$info["name"]."\x1b[0m\" got raw access to Server methods");
|
||||
}
|
||||
$object = new $className($this->server->api, ((isset($info["api"]) and $info["api"] !== true) ? $this->server:false));
|
||||
if(!($object instanceof Plugin)){
|
||||
|
@ -42,4 +42,5 @@ define("MAJOR_VERSION", "Alpha_1.2dev");
|
||||
define("CURRENT_STRUCTURE", 5);
|
||||
define("CURRENT_PROTOCOL", 9);
|
||||
define("CURRENT_MINECRAFT_VERSION", "v0.6.1 alpha");
|
||||
define("CURRENT_API_VERSION", 1);
|
||||
define("CURRENT_PHP_VERSION", "5.4.11");
|
Loading…
x
Reference in New Issue
Block a user