diff --git a/src/pocketmine/Server.php b/src/pocketmine/Server.php index f329854cb..4ff4fe260 100644 --- a/src/pocketmine/Server.php +++ b/src/pocketmine/Server.php @@ -1974,6 +1974,7 @@ class Server{ $this->pluginManager->disablePlugins(); $this->pluginManager->clearPlugins(); + PermissionManager::getInstance()->clearPermissions(); $this->commandMap->clearCommands(); $this->logger->info("Reloading properties..."); diff --git a/src/pocketmine/permission/PermissionManager.php b/src/pocketmine/permission/PermissionManager.php index 5812cce01..b1a701164 100644 --- a/src/pocketmine/permission/PermissionManager.php +++ b/src/pocketmine/permission/PermissionManager.php @@ -212,4 +212,10 @@ class PermissionManager{ public function getPermissions() : array{ return $this->permissions; } + + public function clearPermissions() : void{ + $this->permissions = []; + $this->defaultPerms = []; + $this->defaultPermsOp = []; + } } diff --git a/src/pocketmine/plugin/PluginManager.php b/src/pocketmine/plugin/PluginManager.php index 4449c0e1b..51e0ec917 100644 --- a/src/pocketmine/plugin/PluginManager.php +++ b/src/pocketmine/plugin/PluginManager.php @@ -662,9 +662,6 @@ class PluginManager{ $this->plugins = []; $this->enabledPlugins = []; $this->fileAssociations = []; - $this->permissions = []; - $this->defaultPerms = []; - $this->defaultPermsOp = []; } /** diff --git a/src/pocketmine/utils/Internet.php b/src/pocketmine/utils/Internet.php index 292f269ca..093b3b94f 100644 --- a/src/pocketmine/utils/Internet.php +++ b/src/pocketmine/utils/Internet.php @@ -131,11 +131,11 @@ class Internet{ * * @return array a plain array of three [result body : string, headers : array[], HTTP response code : int]. Headers are grouped by requests with strtolower(header name) as keys and header value as values * - * @throws \RuntimeException if a cURL error occurs + * @throws InternetException if a cURL error occurs */ public static function simpleCurl(string $page, $timeout = 10, array $extraHeaders = [], array $extraOpts = [], callable $onSuccess = null){ if(!self::$online){ - throw new \RuntimeException("Cannot execute web request while offline"); + throw new InternetException("Cannot execute web request while offline"); } $ch = curl_init($page); @@ -157,7 +157,7 @@ class Internet{ $raw = curl_exec($ch); $error = curl_error($ch); if($error !== ""){ - throw new \RuntimeException($error); + throw new InternetException($error); } $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); $headerSize = curl_getinfo($ch, CURLINFO_HEADER_SIZE); diff --git a/src/pocketmine/utils/InternetException.php b/src/pocketmine/utils/InternetException.php new file mode 100644 index 000000000..bc93512b0 --- /dev/null +++ b/src/pocketmine/utils/InternetException.php @@ -0,0 +1,28 @@ +