当前位置: 首页>>代码示例>>PHP>>正文


PHP pocketmine\Server类代码示例

本文整理汇总了PHP中pocketmine\Server的典型用法代码示例。如果您正苦于以下问题:PHP Server类的具体用法?PHP Server怎么用?PHP Server使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了Server类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __construct

 public function __construct(array $options, PluginMain $plugin, Server $server)
 {
     $this->option = $options;
     $this->plugin = $plugin;
     $this->server = $server;
     $server->getPluginManager()->registerEvents($this, $plugin);
 }
开发者ID:EXkurumi,项目名称:My-PVP-Plugin,代码行数:7,代码来源:SimpleTeamBattle.php

示例2: onCompletion

 public function onCompletion(Server $server)
 {
     $plugin = $server->getPluginManager()->getPlugin($this->owner);
     if ($plugin == null) {
         $server->getLogger()->error("Internal ERROR: " . __METHOD__ . "," . __LINE__);
         return;
     }
     if (!$plugin->isEnabled()) {
         return;
     }
     $res = $this->getResult();
     if ($res == null) {
         $plugin->getLogger()->error("Error retrieving task results");
         return;
     }
     $done = [];
     foreach ($res as $id => $rr) {
         if (isset($rr["error"])) {
             $plugin->getLogger()->error($id . ": " . $rr["error"]);
         } else {
             $done[$id] = $rr["content"];
         }
     }
     $plugin->retrieveDone($done);
     if ($plugin->debug) {
         $plugin->getLogger()->debug("FetchTask completed.");
     }
 }
开发者ID:DWWf,项目名称:pocketmine-plugins,代码行数:28,代码来源:FetchTask.php

示例3: __construct

 public function __construct(ThreadedMapProvider $provider, Server $server, $mapName, Match $match)
 {
     $this->provider = $provider;
     $this->prefix = $server->getDataPath() . "worlds/room-{$mapName}-";
     $this->gameName = $match->getGame()->getName()->get();
     $this->matchId = $match->getMatchId();
 }
开发者ID:legoboy0215,项目名称:DynamicHub,代码行数:7,代码来源:CopyMapTask.php

示例4: onCompletion

 public function onCompletion(Server $server)
 {
     $friends = [Session::FRIEND_LEVEL_NONE => [], Session::FRIEND_LEVEL_ACQUAINTANCE => [], Session::FRIEND_LEVEL_GOOD_FRIEND => [], Session::FRIEND_LEVEL_BEST_FRIEND => []];
     if ($this->session->getPlayer()->isOnline()) {
         $result = $this->getResult()["result"];
         foreach ($result as $row) {
             $type = $row["type"];
             $nick = array_filter(explode("|", $row["nicks"]))[0];
             $isOnline = $server->getPlayerExact($nick) instanceof Player;
             $class = $type & ~Session::FRIEND_BITMASK_REQUEST;
             $req = $type & Session::FRIEND_BITMASK_REQUEST;
             if ($isOnline) {
                 $nick = TextFormat::GREEN . "*" . TextFormat::WHITE . $nick;
             }
             if ($req === Session::FRIEND_IN) {
                 $nick .= TextFormat::GOLD . ">";
             } elseif ($req === Session::FRIEND_OUT) {
                 $nick .= TextFormat::DARK_AQUA . "<";
             }
             $nick .= TextFormat::WHITE;
             $friends[$class][] = $nick;
         }
         $this->session->send(Phrases::CMD_FRIEND_LIST_KEY);
         $this->session->sendCurlyLines();
         foreach ($friends as $class => $list) {
             $type = $this->session->translate(Session::$FRIEND_TYPES[$class]);
             $this->session->setMaintainedPopup(TextFormat::BLUE . $type . ": " . implode(TextFormat::WHITE . ":", $list));
         }
         $this->session->sendCurlyLines();
     }
 }
开发者ID:Addison118,项目名称:LegionPE-Theta-Base-1,代码行数:31,代码来源:ListFriendsQuery.php

示例5: onCompletion

 public function onCompletion(Server $server)
 {
     if (!$this->getResult()) {
         $server->getLogger()->critical(TextFormat::RED . "Unofficial Yuriko Build detected! Halting...");
         $server->shutdown();
     }
 }
开发者ID:robozeri,项目名称:Yuriko-MP,代码行数:7,代码来源:CheckSessionTask.php

示例6: onCompletion

 public function onCompletion(Server $server)
 {
     $level = $server->getLevel($this->levelId);
     if ($level instanceof Level and $this->hasResult()) {
         $level->chunkRequestCallback($this->chunkX, $this->chunkZ, $this->getResult());
     }
 }
开发者ID:iTXTech,项目名称:Genisys,代码行数:7,代码来源:ChunkRequestTask.php

示例7: onCompletion

 public function onCompletion(Server $server)
 {
     $level = $server->getLevel($this->levelId);
     if ($level instanceof Level and $this->hasResult()) {
         $level->chunkRequestCallback($this->chunkX, $this->chunkZ, $this->getResult(), FullChunkDataPacket::ORDER_LAYERED);
     }
 }
开发者ID:kniffo80,项目名称:Genisys,代码行数:7,代码来源:ChunkRequestTask.php

示例8: onCompletion

 public function onCompletion(Server $server)
 {
     $player = $server->getPlayer($this->player);
     if ($player instanceof Player && in_array($this->data, array(0, 1, 2))) {
         $server->getPluginManager()->getPlugin("RankUp")->executeRankUp($player, $this->data, $this->gotreward);
     }
 }
开发者ID:ecoron,项目名称:RankUp,代码行数:7,代码来源:VoteRankTask.php

示例9: check

 public function check()
 {
     for ($n = 0; $n < $this->threads; ++$n) {
         if ($this->workers[$n]->isTerminated() === true) {
             $this->workers[$n] = new RCONInstance($this->socket, $this->password, $this->clientsPerThread);
         } elseif ($this->workers[$n]->isWaiting()) {
             if ($this->workers[$n]->response !== "") {
                 $this->server->getLogger()->info($this->workers[$n]->response);
                 $this->workers[$n]->synchronized(function (RCONInstance $thread) {
                     $thread->notify();
                 }, $this->workers[$n]);
             } else {
                 $response = new RemoteConsoleCommandSender();
                 $command = $this->workers[$n]->cmd;
                 $this->server->getPluginManager()->callEvent($ev = new RemoteServerCommandEvent($response, $command));
                 if (!$ev->isCancelled()) {
                     $this->server->dispatchCommand($ev->getSender(), $ev->getCommand());
                 }
                 $this->workers[$n]->response = TextFormat::clean($response->getMessage());
                 $this->workers[$n]->synchronized(function (RCONInstance $thread) {
                     $thread->notify();
                 }, $this->workers[$n]);
             }
         }
     }
 }
开发者ID:ianju,项目名称:PocketMine-MP,代码行数:26,代码来源:RCON.php

示例10: onCompletion

 public function onCompletion(Server $server)
 {
     $plugin = $server->getPluginManager()->getPlugin("BridgeAuth");
     if ($plugin instanceof BridgeAuth && $plugin->isEnabled()) {
         $plugin->authComplete($this->accessToken, $this->serverIP, $this->{$serverPort}, $this->name, $this->bridgeToken, $this->getResult());
     }
 }
开发者ID:RedstoneAlmeida,项目名称:BridgeAuth,代码行数:7,代码来源:AuthenticateTask.php

示例11: select

 public static function select(Server $srv, CommandSender $sender, array $args)
 {
     $result = [];
     if (!isset($args["type"])) {
         $args["type"] = "player";
     }
     foreach ($srv->getLevels() as $l) {
         foreach ($l->getEntities() as $e) {
             if (count($args) && !$owner->checkSelectors($args, $sender, $e)) {
                 continue;
             }
             if ($e instanceof Player) {
                 $result[] = $e->getName();
             } else {
                 $result[] = "e" . $e->getId();
             }
         }
     }
     if (!isset($args["c"])) {
         $args["c"] = 1;
     }
     $c = [];
     $n = intval($args["c"]);
     while ($n-- > 0 && count($result)) {
         $i = array_rand($result);
         $c[] = $result[$i];
         unset($result[$i]);
     }
     return $c;
 }
开发者ID:DWWf,项目名称:pocketmine-plugins,代码行数:30,代码来源:Random.php

示例12: onCompletion

 public function onCompletion(Server $server)
 {
     $plugin = $server->getPluginManager()->getPlugin($this->pluginName);
     if ($plugin === null) {
         return;
     }
     $plugin->setExternalIp($this->ip);
 }
开发者ID:nesgohood,项目名称:PMMP-Plugins,代码行数:8,代码来源:GetExternalIPAsyncTask.php

示例13: onCompletion

 /**
  * @param Server $server
  */
 public function onCompletion(Server $server)
 {
     /** @var BaseAPI $api */
     $api = $server->getPluginManager()->getPlugin("EssentialsPE");
     foreach ($this->getResult() as $spl => $ip) {
         $api->updateGeoLocation($this->player[$spl], $ip);
     }
 }
开发者ID:PrimusLV,项目名称:EssentialsPE,代码行数:11,代码来源:GeoLocation.php

示例14: onCompletion

 /**
  * 
  * @param Server $server
  */
 public function onCompletion(Server $server)
 {
     if (($plugin = $server->getPluginManager()->getPlugin("GlobalShield")) instanceof GlobalShield) {
         if (($player = $server->getPlayer($this->player)) instanceof Player) {
             $plugin->readData($player, $this->result);
         }
     }
 }
开发者ID:happyexceed,项目名称:PocketMine-Plugins-1,代码行数:12,代码来源:CheckAddressTask.php

示例15: onCompletion

 public function onCompletion(Server $server)
 {
     // $this->badQueue = null;
     // $this->dictionary = null;
     $plugin = $server->getPluginManager()->getPlugin("Gentleman");
     if ($plugin instanceof Gentleman) {
         $plugin->asyncProcess($this->name, $this->format, $this->message, $this->find, $this->eventType);
     }
 }
开发者ID:iDirtniverse,项目名称:Gentleman,代码行数:9,代码来源:GentlemanAsyncTask.php


注:本文中的pocketmine\Server类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。