Skip to content

ProxyNetwork 5.46.0 ​

interface · pocketmine\network\proxy\ProxyNetwork · source

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 ​

php
public const STYLE_CINEMATIC = "cinematic"

Transfer style: like seamless, with the camera flying up and down (GTA V style).

STYLE_DIMENSION ​

php
public const STYLE_DIMENSION = "dimension"

Transfer style: a dimension change with its loading screen.

STYLE_SEAMLESS ​

php
public const STYLE_SEAMLESS = "seamless"

Transfer style: no loading screen, the terrain is replaced (same dimension only, else dimension).

TARGET_HUB ​

php
public const TARGET_HUB = "@hub"

Transfer target meaning the lobby (the proxy's fallback groups).

Methods ​

broadcastAlert() ​

php
public function broadcastAlert(string $message) : void

Shows a chat message to every player of the network.

findPlayer() ​

php
public function findPlayer(string $name) : ?string

The server a player of the network is on (name matched without case), or null if not online.

getGlobalPlayerCount() ​

php
public function getGlobalPlayerCount() : int

Players on the whole network.

getGroups() ​

php
public function getGroups() : array

Groups of servers of the network (a group sends players to its least busy server).

getOnlinePlayers() ​

php
public function getOnlinePlayers() : array

Every player of the network, with the server it is on ("" while changing server).

getServerName() ​

php
public function getServerName() : string

Name of this server in the network (network.proxy.server-name).

getServerPlayerCount() ​

php
public function getServerPlayerCount(string $server) : int

Players on a server of the network (0 for unknown servers).

getServers() ​

php
public function getServers() : array

Servers of the network.

isConnected() ​

php
public function isConnected() : bool

Whether the proxy is linked right now. While it is not, players cannot join and nothing is sent.

isNetworkTarget() ​

php
public function isNetworkTarget(string $name) : bool

Whether a name is a server or a group of the network.

isServerOnline() ​

php
public function isServerOnline(string $server) : bool

Whether the proxy has a working link to a server of the network.

sendMessage() ​

php
public function sendMessage(string $channel, string $data, ?string $server = null) : void

Sends 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() ​

php
public function sendPlayer(string $name, string $target, string $style = "") : void

Moves a player of any server of the network, by name ("*" for everyone).

transfer() ​

php
public function transfer(\pocketmine\player\Player $player, string $target, string $style = "") : bool

Moves a player of this server to a server or group of the network (or self::TARGET_HUB), without reconnecting. Calls \pocketmine\event\player\PlayerProxyTransferEvent.

VanillaMine is a fork of PocketMine-MP, maintained by Luxury Nodes. Not affiliated with the PMMP team or Mojang.