ProxyNetwork 5.46.0
The pm-proxy network this server belongs to (network.proxy in pocketmine.yml), for plugins. Get it with \pocketmine\Server::getProxyNetwork(), which returns null when the server is not behind pm-proxy.
What it knows about other servers comes from the proxy about once a second, so it can be slightly out of date.
Constants
STYLE_CINEMATIC
public const STYLE_CINEMATIC = "cinematic"Transfer style: like seamless, with the camera flying up and down (GTA V style).
STYLE_DIMENSION
public const STYLE_DIMENSION = "dimension"Transfer style: a dimension change with its loading screen.
STYLE_SEAMLESS
public const STYLE_SEAMLESS = "seamless"Transfer style: no loading screen, the terrain is replaced (same dimension only, else dimension).
TARGET_HUB
public const TARGET_HUB = "@hub"Transfer target meaning the lobby (the proxy's fallback groups).
Methods
broadcastAlert()
public function broadcastAlert(string $message) : voidShows a chat message to every player of the network.
findPlayer()
public function findPlayer(string $name) : ?stringThe server a player of the network is on (name matched without case), or null if not online.
getGlobalPlayerCount()
public function getGlobalPlayerCount() : intPlayers on the whole network.
getGroups()
public function getGroups() : arrayGroups of servers of the network (a group sends players to its least busy server).
getOnlinePlayers()
public function getOnlinePlayers() : arrayEvery player of the network, with the server it is on ("" while changing server).
getServerName()
public function getServerName() : stringName of this server in the network (network.proxy.server-name).
getServerPlayerCount()
public function getServerPlayerCount(string $server) : intPlayers on a server of the network (0 for unknown servers).
getServers()
public function getServers() : arrayServers of the network.
isConnected()
public function isConnected() : boolWhether the proxy is linked right now. While it is not, players cannot join and nothing is sent.
isNetworkTarget()
public function isNetworkTarget(string $name) : boolWhether a name is a server or a group of the network.
isServerOnline()
public function isServerOnline(string $server) : boolWhether the proxy has a working link to a server of the network.
sendMessage()
public function sendMessage(string $channel, string $data, ?string $server = null) : voidSends a plugin message to another server (or to every other server when $server is null). It arrives there as a \pocketmine\event\server\ProxyMessageReceiveEvent.
sendPlayer()
public function sendPlayer(string $name, string $target, string $style = "") : voidMoves a player of any server of the network, by name ("*" for everyone).
transfer()
public function transfer(\pocketmine\player\Player $player, string $target, string $style = "") : boolMoves a player of this server to a server or group of the network (or self::TARGET_HUB), without reconnecting. Calls \pocketmine\event\player\PlayerProxyTransferEvent.
