mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-10-15 19:46:20 +00:00
Isolate config casting nastiness in one place
this doesn't solve the underlying problem, but it does reduce the amount of noise made by PHPStan about it, as well as avoiding code litter.
This commit is contained in:
@@ -595,7 +595,7 @@ class NetworkSession{
|
||||
}
|
||||
$this->logger->debug("Xbox Live authenticated: " . ($this->authenticated ? "YES" : "NO"));
|
||||
|
||||
$checkXUID = (bool) $this->server->getConfigGroup()->getProperty("player.verify-xuid", true);
|
||||
$checkXUID = $this->server->getConfigGroup()->getPropertyBool("player.verify-xuid", true);
|
||||
$myXUID = $this->info instanceof XboxLivePlayerInfo ? $this->info->getXuid() : "";
|
||||
$kickForXUIDMismatch = function(string $xuid) use ($checkXUID, $myXUID) : bool{
|
||||
if($checkXUID && $myXUID !== $xuid){
|
||||
|
@@ -103,7 +103,7 @@ class RakLibInterface implements ServerEventListener, AdvancedNetworkInterface{
|
||||
$threadToMainBuffer,
|
||||
new InternetAddress($this->server->getIp(), $this->server->getPort(), 4),
|
||||
$this->rakServerId,
|
||||
(int) $this->server->getConfigGroup()->getProperty("network.max-mtu-size", 1492),
|
||||
$this->server->getConfigGroup()->getPropertyInt("network.max-mtu-size", 1492),
|
||||
self::MCPE_RAKNET_PROTOCOL_VERSION,
|
||||
$this->sleeper
|
||||
);
|
||||
|
@@ -77,7 +77,7 @@ final class QueryInfo{
|
||||
|
||||
public function __construct(Server $server){
|
||||
$this->serverName = $server->getMotd();
|
||||
$this->listPlugins = (bool) $server->getConfigGroup()->getProperty("settings.query-plugins", true);
|
||||
$this->listPlugins = $server->getConfigGroup()->getPropertyBool("settings.query-plugins", true);
|
||||
$this->plugins = $server->getPluginManager()->getPlugins();
|
||||
$this->players = $server->getOnlinePlayers();
|
||||
|
||||
|
Reference in New Issue
Block a user