Phpcraft
Public Member Functions | Static Public Member Functions | List of all members
Phpcraft\ProxyServer Class Reference
Inheritance diagram for Phpcraft\ProxyServer:
Inheritance graph
[legend]
Collaboration diagram for Phpcraft\ProxyServer:
Collaboration graph
[legend]

Public Member Functions

 getPlayers ()
 
 connectDownstream (ClientConnection $con, string $address, Account $account=null, array $join_specs=[])
 
 connectToIntegratedServer (ClientConnection $con)
 
- Public Member Functions inherited from Phpcraft\IntegratedServer
 __construct (?string $name=null, array $custom_config_defaults=[], ?UserInterface $ui=null, $private_key=null)
 
 reloadConfig ()
 
 saveConfig ()
 
- Public Member Functions inherited from Phpcraft\Server
 __construct (array $streams=[], $private_key=null)
 
 isOpen ()
 
 setGroups (array $groups)
 
 getGroup (string $name)
 
 isListening ()
 
 getPorts ()
 
 getMotd ()
 
 isOnlineMode ()
 
 broadcast ($msg, int $position=ChatPosition::SYSTEM)
 
 adminBroadcast ($msg, string $permission="everything")
 
 permissionBroadcast (string $permission, $msg, int $position=ChatPosition::SYSTEM)
 
 sendAdminBroadcast ($message, string $permission="everything")
 
 getOfflinePlayer (string $name_or_uuid)
 
 getPlayer ($name_or_uuid)
 
 getName ()
 
 sendMessage ($message)
 
 close ($reason=null)
 
 softClose ()
 
 hasPermission (string $permission)
 
 hasServer ()
 
 getServer ()
 
 hasPosition ()
 
 getPosition ()
 

Static Public Member Functions

static getDefaultName ()
 
- Static Public Member Functions inherited from Phpcraft\IntegratedServer
static cliStart (?string $name=null, array $custom_config_defaults=[])
 
static start (?string $name=null, bool $offline=false, bool $plain=false, array $custom_config_defaults=[])
 

Additional Inherited Members

- Public Attributes inherited from Phpcraft\IntegratedServer
 $name
 
 $ui
 
 $config
 
 $custom_config_defaults
 
 $config_reloaded_function
 
 $spawn_position
 
- Public Attributes inherited from Phpcraft\Server
 $streams
 
 $private_key
 
 $clients
 
 $persist_configs = false
 
 $compression_threshold = 256
 
 $groups = []
 
 $join_function = null
 
 $packet_function = null
 
 $disconnect_function = null
 
 $list_ping_function = null
 
 $allow_incompatible_versions = false
 
 $open_condition
 
- Public Attributes inherited from Phpcraft\BareServer
 $worlds = []
 
 $eidCounter
 
- Protected Attributes inherited from Phpcraft\Server
 $tick_loop
 

Detailed Description

Since
0.3

Member Function Documentation

◆ connectDownstream()

Phpcraft\ProxyServer::connectDownstream ( ClientConnection  $con,
string  $address,
Account  $account = null,
array  $join_specs = [] 
)

Attempts to connect the given client to the given server.

Parameters
ClientConnection$con
string$address
Account | null$account
array$join_specs
Returns
string|null Error message or null on success.
Exceptions
IOException

◆ connectToIntegratedServer()

Phpcraft\ProxyServer::connectToIntegratedServer ( ClientConnection  $con)

"Connects" the given client to the underlying integrated server.

Parameters
ClientConnection$con
Exceptions
IOException

◆ getDefaultName()

static Phpcraft\ProxyServer::getDefaultName ( )
static

Reimplemented from Phpcraft\IntegratedServer.

◆ getPlayers()

Phpcraft\ProxyServer::getPlayers ( )

Returns all players that are not connected to a downstream server.

Returns
ClientConnection[]

Reimplemented from Phpcraft\Server.