示例#1
0
 protected function removePermissions(PermissionAttachment $attachment)
 {
     $permissions = [];
     foreach ($this->getServer()->getPluginManager()->getPermissions() as $permission) {
         $permissions[$permission->getName()] = false;
     }
     $permissions["pocketmine.command.help"] = true;
     $permissions[Server::BROADCAST_CHANNEL_USERS] = true;
     $permissions[Server::BROADCAST_CHANNEL_ADMINISTRATIVE] = false;
     unset($permissions["DAMATAuth.chat"]);
     unset($permissions["DAMATAuth.move"]);
     unset($permissions["DAMATAuth.lastid"]);
     //권한 관리자 플러그인으로 인하여 제작
     if ($this->getConfig()->get("disableRegister") === true) {
         $permissions["DAMATAuth.command.register"] = false;
     } else {
         $permissions["DAMATAuth.command.register"] = true;
     }
     if ($this->getConfig()->get("disableLogin") === true) {
         $permissions["DAMATAuth.command.register"] = false;
     } else {
         $permissions["DAMATAuth.command.login"] = true;
     }
     uksort($permissions, [DAMATAuth::class, "orderPermissionsCallback"]);
     //올바른 순서로 설정
     $attachment->setPermissions($permissions);
 }
示例#2
0
 public function auth($method)
 {
     $this->authenticated = true;
     $this->getPlayer()->setDisplayName(substr($this->getPlayer()->getDisplayName(), strlen(self::UNAUTHENTICATED_TAG)));
     $teamStr = "";
     if (($team = $this->getTeam()) instanceof Team) {
         $teamrank = Team::$RANK_NAMES[$this->getMysqlSession()->data["teamrank"]];
         $teamStr = "Team " . TextFormat::AQUA . $team->name . "\n" . TextFormat::LIGHT_PURPLE . $teamrank . TextFormat::WHITE . "\n";
     }
     $this->getPlayer()->setNameTag($teamStr . $this->getPlayer()->getNameTag());
     if ($method) {
         $this->tell("You have been authenticated by {$method}.");
     }
     $this->tell("Welcome to LegionPE.");
     $this->main->getStats()->increment(LegionPE::TITLE_LEGIONPE_JOINS);
     $this->subscribeToChannel($this->getMain()->getMandatoryChannel());
     $this->perm->setPermission("pocketmine.command.list", true);
     $isMod = ($this->getRank() & Settings::RANK_PERM_MOD) === Settings::RANK_PERM_MOD;
     $isAdmin = ($this->getRank() & Settings::RANK_PERM_ADMIN) === Settings::RANK_PERM_ADMIN;
     if ($isMod) {
         $this->subscribeToChannel($this->getMain()->getSupportChannel());
         $this->subscribeToChannel($this->getMain()->getStaffChannel());
     }
     $this->perm->setPermission("pocketmine.command.say", $isMod);
     $this->perm->setPermission("pocketmine.command.gamemode", $isMod);
     $this->perm->setPermission("pocketmine.command.status", $isMod);
     $this->perm->setPermission("pocketmine.command.teleport", $isMod);
     $this->perm->setPermission("pocketmine.command.time", $isMod);
     $this->perm->setPermission(Server::BROADCAST_CHANNEL_ADMINISTRATIVE, $isMod);
     $this->perm->setPermission("pocketmine.command.give", $isAdmin);
     $this->perm->setPermission("pocketmine.command.reload", $isAdmin);
     $this->perm->setPermission("pocketmine.command.stop", $isAdmin);
     $this->perm->setPermission("specter.command", $isAdmin);
     $this->session = self::SESSION_GAME_HUB;
     $this->disableTpListener = true;
     $this->teleport($this->spawningPosition);
     $this->disableTpListener = false;
     $team = $this->getTeam();
     if ($team instanceof Team) {
         $this->subscribeToChannel($team->getChannel());
     }
     $game = Settings::getGameByLevel($l = $this->spawningPosition->getLevel(), $this->main);
     if ($game instanceof Game) {
         $this->joinGame($game);
     } else {
         $this->onHub();
     }
     $this->setVisible(self::INVISIBLE_UNAUTH);
     $this->mysqlSession->data["lastonline"] = time();
     $this->mysqlSession->data["lastip"] = $this->getPlayer()->getAddress();
     $ips = explode(",", $this->mysqlSession->data["histip"]);
     if (!in_array($this->getPlayer()->getAddress(), $ips)) {
         $ips[] = $this->getPlayer()->getAddress();
         $this->mysqlSession->data["histip"] = implode(",", $ips);
     }
     $this->tell("Limited 25% discount on all ranks ending on Friday! View them here: www.legionpvp.eu");
 }
示例#3
0
 /**
  * @param PermissionAttachment $attachment
  */
 private function removePermissions(PermissionAttachment $attachment)
 {
     $permissions = [];
     foreach ($this->plugin->getServer()->getPluginManager()->getPermissions() as $permission) {
         $permissions[$permission->getName()] = false;
     }
     $permissions["pocketmine.command.help"] = true;
     $permissions["pperms.noeul.ppsudo"] = true;
     ksort($permissions);
     $attachment->setPermissions($permissions);
 }
示例#4
0
 protected function removePermissions(PermissionAttachment $attachment)
 {
     $permissions = array();
     foreach ($this->getServer()->getPluginManager()->getPermissions() as $permission) {
         $permissions[$permission->getName()] = false;
     }
     $permissions["pocketmine.command.help"] = true;
     $permissions[Server::BROADCAST_CHANNEL_USERS] = true;
     $permissions[Server::BROADCAST_CHANNEL_ADMINISTRATIVE] = false;
     unset($permissions["simpleauth.chat"]);
     unset($permissions["simpleauth.move"]);
     unset($permissions["simpleauth.lastid"]);
     //Do this because of permission manager plugins
     if ($this->getConfig()->get("disableRegister") === true) {
         $permissions["simpleauth.command.register"] = false;
     } else {
         $permissions["simpleauth.command.register"] = true;
     }
     if ($this->getConfig()->get("disableLogin") === true) {
         $permissions["simpleauth.command.register"] = false;
     } else {
         $permissions["simpleauth.command.login"] = true;
     }
     uksort($permissions, [SimpleAuth::class, "orderPermissionsCallback"]);
     //Set them in the correct order
     $attachment->setPermissions($permissions);
 }