mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 09:56:06 +00:00
Move MOTD game mode stringifying to RakLibInterface
since this is contextless (there's no way to know the version of the client requesting the MOTD), we can safely assume that this is not going to vary between protocol versions.
This commit is contained in:
@ -26,7 +26,6 @@ namespace pocketmine\network\mcpe\raklib;
|
||||
use pocketmine\lang\KnownTranslationFactory;
|
||||
use pocketmine\network\AdvancedNetworkInterface;
|
||||
use pocketmine\network\mcpe\compression\ZlibCompressor;
|
||||
use pocketmine\network\mcpe\convert\TypeConverter;
|
||||
use pocketmine\network\mcpe\EntityEventBroadcaster;
|
||||
use pocketmine\network\mcpe\NetworkSession;
|
||||
use pocketmine\network\mcpe\PacketBroadcaster;
|
||||
@ -36,6 +35,7 @@ use pocketmine\network\mcpe\protocol\serializer\PacketSerializerContext;
|
||||
use pocketmine\network\Network;
|
||||
use pocketmine\network\NetworkInterfaceStartException;
|
||||
use pocketmine\network\PacketHandlingException;
|
||||
use pocketmine\player\GameMode;
|
||||
use pocketmine\Server;
|
||||
use pocketmine\snooze\SleeperNotifier;
|
||||
use pocketmine\timings\Timings;
|
||||
@ -255,7 +255,11 @@ class RakLibInterface implements ServerEventListener, AdvancedNetworkInterface{
|
||||
$info->getMaxPlayerCount(),
|
||||
$this->rakServerId,
|
||||
$this->server->getName(),
|
||||
TypeConverter::getInstance()->protocolGameModeName($this->server->getGamemode())
|
||||
match($this->server->getGamemode()){
|
||||
GameMode::SURVIVAL() => "Survival",
|
||||
GameMode::ADVENTURE() => "Adventure",
|
||||
default => "Creative"
|
||||
}
|
||||
]) . ";"
|
||||
);
|
||||
}
|
||||
|
Reference in New Issue
Block a user