本文整理汇总了PHP中pocketmine\Server::getPocketMineVersion方法的典型用法代码示例。如果您正苦于以下问题:PHP Server::getPocketMineVersion方法的具体用法?PHP Server::getPocketMineVersion怎么用?PHP Server::getPocketMineVersion使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pocketmine\Server
的用法示例。
在下文中一共展示了Server::getPocketMineVersion方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: checkUpdate
protected function checkUpdate()
{
if ($this->updateInfo === \null) {
return;
}
$currentVersion = new VersionString($this->server->getPocketMineVersion());
$newVersion = new VersionString($this->updateInfo["version"]);
if ($currentVersion->compare($newVersion) > 0 and ($currentVersion->get() !== $newVersion->get() or $currentVersion->getBuild() > 0)) {
$this->hasUpdate = \true;
} else {
$this->hasUpdate = \false;
}
}
示例2: __construct
public function __construct(Server $server, $timeout = 5)
{
$this->timeout = $timeout;
$this->serverName = $server->getMotd();
$this->listPlugins = $server->getProperty("settings.query-plugins", true);
$this->plugins = $server->getPluginManager()->getPlugins();
$this->players = [];
foreach ($server->getOnlinePlayers() as $player) {
if ($player->isOnline()) {
$this->players[] = $player;
}
}
if ($server->isDServerEnabled() and $server->dserverConfig["queryMaxPlayers"]) {
$pc = $server->dserverConfig["queryMaxPlayers"];
} elseif ($server->isDServerEnabled() and $server->dserverConfig["queryAllPlayers"]) {
$pc = $server->getDServerMaxPlayers();
} else {
$pc = $server->getMaxPlayers();
}
if ($server->isDServerEnabled() and $server->dserverConfig["queryPlayers"]) {
$poc = $server->getDServerOnlinePlayers();
} else {
$poc = count($this->players);
}
$this->gametype = ($server->getGamemode() & 0x1) === 0 ? "SMP" : "CMP";
$this->version = $server->getVersion();
$this->server_engine = $server->getName() . " " . $server->getPocketMineVersion();
$this->map = $server->getDefaultLevel() === null ? "unknown" : $server->getDefaultLevel()->getName();
$this->numPlayers = $poc;
$this->maxPlayers = $pc;
$this->whitelist = $server->hasWhitelist() ? "on" : "off";
$this->port = $server->getPort();
$this->ip = $server->getIp();
}
示例3: __construct
public function __construct($server)
{
$this->server = $server;
$this->logger = $this->server->getLogger();
$this->logger->info(Terminal::$COLOR_GOLD . "-------------------------------------------------------------------------------------------");
$this->logger->info(Terminal::$COLOR_GOLD . "|" . Terminal::$COLOR_PURPLE . " _ _ _" . Terminal::$COLOR_AQUA . " __ __ _ " . Terminal::$COLOR_GOLD . " |");
$this->logger->info(Terminal::$COLOR_GOLD . "|" . Terminal::$COLOR_PURPLE . " (_) (_) | |" . Terminal::$COLOR_AQUA . " \\/ (_) " . Terminal::$COLOR_GOLD . " |");
$this->logger->info(Terminal::$COLOR_GOLD . "|" . Terminal::$COLOR_PURPLE . " _ _ __ ___ __ _ __ _ _ ___ __ _| |" . Terminal::$COLOR_AQUA . " \\ / |_ _ __ ___ " . Terminal::$COLOR_GOLD . " |");
$this->logger->info(Terminal::$COLOR_GOLD . "|" . Terminal::$COLOR_PURPLE . " | | '_ ` _ \\ / _` |/ _` | |/ __/ _` | |" . Terminal::$COLOR_AQUA . " |\\/| | | '_ \\ / _ \\ " . Terminal::$COLOR_RED . " ImagicalMine " . $this->server->getPocketMineVersion() . Terminal::$COLOR_GOLD . " |");
$this->logger->info(Terminal::$COLOR_GOLD . "|" . Terminal::$COLOR_PURPLE . " | | | | | | | (_| | (_| | | (_| (_| | |" . Terminal::$COLOR_AQUA . " | | | | | | | __/ " . Terminal::$COLOR_GOLD . " |");
$this->logger->info(Terminal::$COLOR_GOLD . "|" . Terminal::$COLOR_PURPLE . " |_|_| |_| |_|\\__,_|\\__, |_|\\___\\__,_|_|" . Terminal::$COLOR_AQUA . "_| |_|_|_| |_|\\___| " . Terminal::$COLOR_WHITE . " for MCPE " . $this->server->getVersion() . Terminal::$COLOR_GOLD . " |");
$this->logger->info(Terminal::$COLOR_GOLD . "|" . Terminal::$COLOR_PURPLE . " __/ |" . Terminal::$COLOR_GOLD . " |");
$this->logger->info(Terminal::$COLOR_GOLD . "|" . Terminal::$COLOR_PURPLE . " |___/" . Terminal::$COLOR_GOLD . " |");
$this->logger->info(Terminal::$COLOR_GOLD . "------------------------------------------------------------------------------------------- ");
$this->logger->info(Terminal::$COLOR_PURPLE . "Imagical" . Terminal::$COLOR_AQUA . "Mine " . Terminal::$COLOR_WHITE . "is a third-party build of " . Terminal::$COLOR_AQUA . "PocketMine-MP" . Terminal::$COLOR_WHITE . ", distributed under the LGPL licence");
}
示例4: __construct
public function __construct($server)
{
$this->server = $server;
$this->getServer()->getLogger()->info(Terminal::$COLOR_GOLD . " ");
$this->getServer()->getLogger()->info(Terminal::$COLOR_BLUE . ",_._._._._._._._._" . Terminal::$COLOR_DARK_BLUE . "|" . Terminal::$COLOR_GRAY . "_________________________________________________,");
$this->getServer()->getLogger()->info(Terminal::$COLOR_BLUE . "|_|_|_|_|_|_|_|_|_" . Terminal::$COLOR_DARK_BLUE . "|" . Terminal::$COLOR_GRAY . "________________________________________________/");
$this->getServer()->getLogger()->info(Terminal::$COLOR_GOLD . " _ " . Terminal::$COLOR_DARK_BLUE . " l");
$this->getServer()->getLogger()->info(Terminal::$COLOR_GOLD . " | | ____ _| |_ __ _ _ __ __ _");
$this->getServer()->getLogger()->info(Terminal::$COLOR_GOLD . " | |/ / _` | __/ _` | '_ \\ / _` | " . Terminal::$COLOR_AQUA . "MCPE " . $this->server->getVersion());
$this->getServer()->getLogger()->info(Terminal::$COLOR_GOLD . " | < (_| | || (_| | | | | (_| | " . Terminal::$COLOR_AQUA . "Katana " . $this->server->getPocketMineVersion());
$this->getServer()->getLogger()->info(Terminal::$COLOR_GOLD . " |_|\\_\\__,_|\\__\\__,_|_| |_|\\__,_|");
$this->getServer()->getLogger()->info(Terminal::$COLOR_GOLD . " ");
$this->getServer()->getLogger()->info(Terminal::$COLOR_GOLD . "Katana " . Terminal::$COLOR_WHITE . "is a fork of " . Terminal::$COLOR_AQUA . "PocketMine-MP" . Terminal::$COLOR_WHITE . ", distributed under the LGPL licence");
$this->initConfig();
$this->initLogger();
$this->initModules();
}
示例5: __construct
public function __construct(Server $server, $timeout = 5)
{
$this->timeout = $timeout;
$this->serverName = $server->getMotd();
$this->listPlugins = $server->getProperty("settings.query-plugins", true);
$this->plugins = str_replace(" ", "_", $server->getPluginManager()->getPlugins());
$this->players = [];
foreach ($server->getOnlinePlayers() as $player) {
if ($player->isOnline()) {
$this->players[] = $player;
}
}
if ($server->isDServerEnabled() and $server->dserverConfig["queryMaxPlayers"]) {
$pc = $server->dserverConfig["queryMaxPlayers"];
} elseif ($server->isDServerEnabled() and $server->dserverConfig["queryAllPlayers"]) {
$pc = $server->getDServerMaxPlayers();
} else {
$pc = $server->getMaxPlayers();
}
if ($server->isDServerEnabled() and $server->dserverConfig["queryPlayers"]) {
$poc = $server->getDServerOnlinePlayers();
} else {
$poc = count($this->players);
}
switch ($server->getGamemode()) {
case 0:
$this->gametype = "Survival";
break;
case 1:
$this->gametype = "Creative";
break;
case 2:
$this->gametype = "Adventure";
break;
case 3:
$this->gametype = "Spectator";
break;
}
$this->version = $server->getVersion();
$this->server_engine = $server->getName() . " " . $server->getPocketMineVersion();
$this->map = $server->getDefaultLevel() === null ? "unknown" : $server->getDefaultLevel()->getName();
$this->numPlayers = $poc;
$this->maxPlayers = $pc;
$this->whitelist = $server->hasWhitelist() ? "on" : "off";
$this->port = $server->getPort();
$this->ip = $server->getIp();
$this->motd_version = $server->getMPVersion();
}
示例6: __construct
public function __construct(Server $server, $timeout = 5)
{
$this->timeout = $timeout;
$this->serverName = $server->getServerName();
$this->listPlugins = $server->getProperty("settings.query-plugins", \true);
$this->plugins = $server->getPluginManager()->getPlugins();
$this->players = [];
foreach ($server->getOnlinePlayers() as $player) {
if ($player->isOnline()) {
$this->players[] = $player;
}
}
$this->gametype = ($server->getGamemode() & 0x1) === 0 ? "SMP" : "CMP";
$this->version = $server->getVersion();
$this->server_engine = $server->getName() . " " . $server->getPocketMineVersion();
$this->map = $server->getDefaultLevel() === \null ? "unknown" : $server->getDefaultLevel()->getName();
$this->numPlayers = \count($this->players);
$this->maxPlayers = $server->getMaxPlayers();
$this->whitelist = $server->hasWhitelist() ? "on" : "off";
$this->port = $server->getPort();
$this->ip = $server->getIp();
}