Skip to content

Commit

Permalink
Some api updates
Browse files Browse the repository at this point in the history
  • Loading branch information
falkirks committed Aug 26, 2018
1 parent eb2f34a commit 4ea1d81
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/falkirks/simplewarp/permission/SimpleWarpPermissions.php
Expand Up @@ -4,6 +4,7 @@

use falkirks\simplewarp\Warp;
use pocketmine\permission\Permission;
use pocketmine\permission\PermissionManager;
use pocketmine\Server;

class SimpleWarpPermissions {
Expand All @@ -23,9 +24,9 @@ class SimpleWarpPermissions {
static private $baseWarpPerm = null;

static public function setupPermission(Warp $warp){
if(self::$baseWarpPerm == null) self::$baseWarpPerm = Server::getInstance()->getPluginManager()->getPermission("simplewarp.warp");
if(self::$baseWarpPerm == null) self::$baseWarpPerm = PermissionManager::getInstance()->getPermission("simplewarp.warp");
$permission = new Permission(self::BASE_WARP_PERMISSION . "." . $warp->getName(), "Allow use of " . $warp->getName()); //TODO correct default value
Server::getInstance()->getPluginManager()->addPermission($permission);
PermissionManager::getInstance()->addPermission($permission);
self::$baseWarpPerm->getChildren()[$permission->getName()] = true;
}
}
3 changes: 2 additions & 1 deletion src/falkirks/simplewarp/utils/ChecksumVerify.php
Expand Up @@ -4,6 +4,7 @@

use pocketmine\plugin\PharPluginLoader;
use pocketmine\plugin\PluginBase;
use pocketmine\utils\Internet;
use pocketmine\utils\Utils;

class ChecksumVerify {
Expand All @@ -14,7 +15,7 @@ class ChecksumVerify {
*/
public static function isValid(PluginBase $pluginBase){
$url = ChecksumVerify::POGGIT_ENDPOINT . $pluginBase->getDescription()->getName() . "/" . $pluginBase->getDescription()->getVersion();
$hash = Utils::getURL($url);
$hash = Internet::getURL($url);
if($pluginBase->getPluginLoader() instanceof PharPluginLoader){
$reflect = new \ReflectionClass($pluginBase);
$method = $reflect->getMethod("getFile");
Expand Down

0 comments on commit 4ea1d81

Please sign in to comment.