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

Public Member Functions

 __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)
 
 getPlayers ()
 
 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 cliStart (?string $name=null, array $custom_config_defaults=[])
 
static start (?string $name=null, bool $offline=false, bool $plain=false, array $custom_config_defaults=[])
 

Public Attributes

 $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
 

Additional Inherited Members

- Protected Attributes inherited from Phpcraft\Server
 $tick_loop
 

Constructor & Destructor Documentation

◆ __construct()

Phpcraft\IntegratedServer::__construct ( ?string  $name = null,
array  $custom_config_defaults = [],
?UserInterface  $ui = null,
  $private_key = null 
)
Parameters
string | null$name
array$custom_config_defaults
UserInterface | null$ui
resource | null$private_keyA private key generated using openssl_pkey_new(["private_key_bits" => 1024, "private_key_type" => OPENSSL_KEYTYPE_RSA]) to use for online mode, or null to use offline mode.

Member Function Documentation

◆ cliStart()

static Phpcraft\IntegratedServer::cliStart ( ?string  $name = null,
array  $custom_config_defaults = [] 
)
static

Starts the integrated server using $argv.

Parameters
string | null$name
array$custom_config_defaults
Returns
IntegratedServer

◆ getDefaultName()

static Phpcraft\IntegratedServer::getDefaultName ( )
static

Reimplemented in Phpcraft\ProxyServer.

◆ reloadConfig()

Phpcraft\IntegratedServer::reloadConfig ( )
Returns
void

◆ saveConfig()

Phpcraft\IntegratedServer::saveConfig ( )
Returns
void

◆ start()

static Phpcraft\IntegratedServer::start ( ?string  $name = null,
bool  $offline = false,
bool  $plain = false,
array  $custom_config_defaults = [] 
)
static

Starts the integrated server using the given settings.

Parameters
string | null$name
bool$offline
bool$plain
array$custom_config_defaults
Returns
IntegratedServer

Member Data Documentation

◆ $config

array< string, mixed > Phpcraft\IntegratedServer::$config

◆ $config_reloaded_function

callable null Phpcraft\IntegratedServer::$config_reloaded_function

The function called after the config has been reloaded.

◆ $custom_config_defaults

array< string, mixed > Phpcraft\IntegratedServer::$custom_config_defaults

◆ $name

string Phpcraft\IntegratedServer::$name

◆ $spawn_position

Point3D Phpcraft\IntegratedServer::$spawn_position

The position where clients will spawn at. Defaults to

new Point3D(0, 16, 0)

.

◆ $ui

PlainUserInterface Phpcraft\IntegratedServer::$ui