mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-10-18 20:14:31 +00:00
New Plugin format includes multiple API versions
This commit is contained in:
@@ -29,7 +29,7 @@ the Free Software Foundation, either version 3 of the License, or
|
||||
require_once(FILE_PATH."/src/pmf/PMF.php");
|
||||
/***REM_END***/
|
||||
|
||||
define("PMF_CURRENT_PLUGIN_VERSION", 0x00);
|
||||
define("PMF_CURRENT_PLUGIN_VERSION", 0x01);
|
||||
|
||||
class PMFPlugin extends PMF{
|
||||
private $pluginData = array();
|
||||
@@ -52,7 +52,11 @@ class PMFPlugin extends PMF{
|
||||
$this->pluginData["name"] = $this->read(Utils::readShort($this->read(2), false));
|
||||
$this->pluginData["version"] = $this->read(Utils::readShort($this->read(2), false));
|
||||
$this->pluginData["author"] = $this->read(Utils::readShort($this->read(2), false));
|
||||
$this->pluginData["apiversion"] = Utils::readShort($this->read(2), false);
|
||||
if($this->pluginData["fversion"] >= 0x01){
|
||||
$this->pluginData["apiversion"] = $this->read(Utils::readShort($this->read(2), false));
|
||||
}else{
|
||||
$this->pluginData["apiversion"] = Utils::readShort($this->read(2), false);
|
||||
}
|
||||
$this->pluginData["class"] = $this->read(Utils::readShort($this->read(2), false));
|
||||
$this->pluginData["identifier"] = $this->read(Utils::readShort($this->read(2), false)); //Will be used to check for updates
|
||||
$this->pluginData["extra"] = gzinflate($this->read(Utils::readShort($this->read(2), false))); //Additional custom plugin data
|
||||
|
Reference in New Issue
Block a user