Cleaned up ping response and added missing fields (#1114)

This commit is contained in:
Dylan K. Taylor
2017-07-04 11:17:47 +01:00
committed by GitHub
parent d474f73665
commit 409fc282d2
3 changed files with 29 additions and 8 deletions

View File

@ -165,15 +165,21 @@ class RakLibInterface implements ServerInstance, AdvancedSourceInterface{
}
public function setName($name){
public function setName(string $name){
$info = $this->server->getQueryInformation();
$this->interface->sendOption("name",
"MCPE;" . rtrim(addcslashes($name, ";"), '\\') . ";" .
ProtocolInfo::CURRENT_PROTOCOL . ";" .
ProtocolInfo::MINECRAFT_VERSION_NETWORK . ";" .
$info->getPlayerCount() . ";" .
$info->getMaxPlayerCount()
$this->interface->sendOption("name", implode(";",
[
"MCPE",
rtrim(addcslashes($name, ";"), '\\'),
ProtocolInfo::CURRENT_PROTOCOL,
ProtocolInfo::MINECRAFT_VERSION_NETWORK,
$info->getPlayerCount(),
$info->getMaxPlayerCount(),
"-1",
$this->server->getName(),
Server::getGamemodeName($this->server->getGamemode())
])
);
}