本文整理汇总了PHP中pocketmine\utils\MainLogger::debug方法的典型用法代码示例。如果您正苦于以下问题:PHP MainLogger::debug方法的具体用法?PHP MainLogger::debug怎么用?PHP MainLogger::debug使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pocketmine\utils\MainLogger
的用法示例。
在下文中一共展示了MainLogger::debug方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: handleDataPacket
public function handleDataPacket(DataPacket $pk)
{
$this->logger->debug("Received packet " . $pk::NETWORK_ID . " from {$this->serverIp}:{$this->port}");
switch ($pk::NETWORK_ID) {
case Info::INFORMATION_PACKET:
/** @var InformationPacket $pk */
switch ($pk->type) {
case InformationPacket::TYPE_LOGIN:
if ($pk->message == InformationPacket::INFO_LOGIN_SUCCESS) {
$this->logger->info("Login success to {$this->serverIp}:{$this->port}");
$this->verified = true;
} elseif ($pk->message == InformationPacket::INFO_LOGIN_FAILED) {
$this->logger->info("Login failed to {$this->serverIp}:{$this->port}");
}
break;
case InformationPacket::TYPE_CLIENT_DATA:
$this->clientData = json_decode($pk->message, true);
$this->lastRecvInfo = microtime();
break;
}
break;
case Info::PLAYER_LOGIN_PACKET:
/** @var PlayerLoginPacket $pk */
$player = new Player($this->synLibInterface, mt_rand(0, PHP_INT_MAX), $pk->address, $pk->port);
$player->setUniqueId($pk->uuid);
$this->server->addPlayer(spl_object_hash($player), $player);
$this->players[$pk->uuid->toBinary()] = $player;
$player->handleLoginPacket($pk);
break;
case Info::REDIRECT_PACKET:
/** @var RedirectPacket $pk */
if (isset($this->players[$uuid = $pk->uuid->toBinary()])) {
$pk = $this->getPacket($pk->mcpeBuffer);
$pk->decode();
$this->players[$uuid]->handleDataPacket($pk);
}
break;
case Info::PLAYER_LOGOUT_PACKET:
/** @var PlayerLogoutPacket $pk */
if (isset($this->players[$uuid = $pk->uuid->toBinary()])) {
$this->players[$uuid]->setConnected(false);
$this->players[$uuid]->close("", $pk->reason);
$this->removePlayer($this->players[$uuid]);
}
break;
}
}
示例2: Installer
//Found Git information!
\define("pocketmine\\GIT_COMMIT", \strtolower(\trim(\file_get_contents(\pocketmine\PATH . ".git/refs/heads/master"))));
} else {
//Unknown :(
\define("pocketmine\\GIT_COMMIT", \str_repeat("00", 20));
}
@\define("ENDIANNESS", \pack("d", 1) === "?ð" ? Binary::BIG_ENDIAN : Binary::LITTLE_ENDIAN);
@\define("INT32_MASK", \is_int(4294967295.0) ? 4294967295.0 : -1);
@\ini_set("opcache.mmap_base", \bin2hex(Utils::getRandomBytes(8, \false)));
//Fix OPCache address errors
if (!\file_exists(\pocketmine\DATA . "server.properties") and !isset($opts["no-wizard"])) {
new Installer();
}
if (\Phar::running(\true) === "") {
$logger->warning("Non-packaged PocketMine-MP installation detected, do not use on production.");
}
ThreadManager::init();
$server = new Server($autoloader, $logger, \pocketmine\PATH, \pocketmine\DATA, \pocketmine\PLUGIN_PATH);
$logger->info("Stopping other threads");
foreach (ThreadManager::getInstance()->getAll() as $id => $thread) {
$logger->debug("Stopping " . (new \ReflectionClass($thread))->getShortName() . " thread");
$thread->quit();
}
$killer = new ServerKiller(8);
$killer->start();
$killer->detach();
$logger->shutdown();
$logger->join();
echo Terminal::$FORMAT_RESET . "\n";
exit(0);
}
示例3: define
if (file_exists(\pocketmine\PATH . ".git/refs/heads/master")) {
//Found Git information!
define('pocketmine\\GIT_COMMIT', strtolower(trim(file_get_contents(\pocketmine\PATH . ".git/refs/heads/master"))));
} else {
//Unknown :(
define('pocketmine\\GIT_COMMIT', str_repeat("00", 20));
}
@define("ENDIANNESS", pack("d", 1) === "?ð" ? Binary::BIG_ENDIAN : Binary::LITTLE_ENDIAN);
@define("INT32_MASK", is_int(0xffffffff) ? 0xffffffff : -1);
@ini_set("opcache.mmap_base", bin2hex(Utils::getRandomBytes(8, false)));
//Fix OPCache address errors
if (!file_exists(\pocketmine\DATA . "server.properties") and !isset($opts["no-wizard"])) {
new Installer();
}
if (\Phar::running(true) === "") {
$logger->warning("Non-packaged ClearSky installation detected, do not use on production.");
}
ThreadManager::init();
$server = new Server($autoloader, $logger, \pocketmine\PATH, \pocketmine\DATA, \pocketmine\PLUGIN_PATH);
$logger->info("Stopping other threads");
$killer = new ServerKiller(8);
$killer->start();
foreach (ThreadManager::getInstance()->getAll() as $id => $thread) {
$logger->debug("Stopping " . $thread->getThreadName() . " thread");
$thread->quit();
}
$logger->shutdown();
$logger->join();
echo Terminal::$FORMAT_RESET . "\n";
exit(0);
}