Phpcraft Realms Module
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
Phpcraft\Realms\Server Class Reference

Public Member Functions

 __construct (Account $account, array $data)
 
 join (bool $await_start=true)
 

Static Public Member Functions

static getRealmsServers (Account $account)
 

Public Attributes

 $account
 
 $id
 
 $name
 
 $description
 
 $owner_name
 
 $owner_uuid
 
 $state
 
 $days_left
 
 $expired
 
 $expired_trial
 
 $world_type
 
 $players
 
 $max_players
 
 $minigame_name
 
 $minigame_id
 
 $minigame_image
 

Constructor & Destructor Documentation

◆ __construct()

Phpcraft\Realms\Server::__construct ( Account  $account,
array  $data 
)
Parameters
Account$account
array$data

Member Function Documentation

◆ getRealmsServers()

static Phpcraft\Realms\Server::getRealmsServers ( Account  $account)
static

Returns all servers the given account has joined or owns.

Parameters
Account$account
Returns
array<RealmsServer>

◆ join()

Phpcraft\Realms\Server::join ( bool  $await_start = true)

Returns information required to join the server.

Parameters
bool$await_start
Returns
array<string,string|null>|null An array containing "address" (in [host]:[port] format), "resourcePackUrl" (string|null), and "resourcePackHash" (string|null). If $await_start is false and the realms server is not online, null is returned.

Member Data Documentation

◆ $account

Account Phpcraft\Realms\Server::$account

◆ $days_left

int Phpcraft\Realms\Server::$days_left

◆ $description

string Phpcraft\Realms\Server::$description

◆ $expired

bool Phpcraft\Realms\Server::$expired

◆ $expired_trial

bool Phpcraft\Realms\Server::$expired_trial

◆ $id

int Phpcraft\Realms\Server::$id

◆ $max_players

int Phpcraft\Realms\Server::$max_players

◆ $minigame_id

int null Phpcraft\Realms\Server::$minigame_id

◆ $minigame_image

string null Phpcraft\Realms\Server::$minigame_image

The base64-encoded image for the minigame that is currently active or null if not applicable.

◆ $minigame_name

string null Phpcraft\Realms\Server::$minigame_name

The name of the minigame that is currently active or null if not applicable.

◆ $name

string Phpcraft\Realms\Server::$name

◆ $owner_name

string Phpcraft\Realms\Server::$owner_name

◆ $owner_uuid

UUID Phpcraft\Realms\Server::$owner_uuid

◆ $players

array< string > Phpcraft\Realms\Server::$players

◆ $state

string Phpcraft\Realms\Server::$state

The state of the realm. Can be ADMIN_LOCK, CLOSED, OPEN, or UNINITIALIZED.

◆ $world_type

string Phpcraft\Realms\Server::$world_type

The type of the world. Can be NORMAL, MINIGAME, ADVENTUREMAP, EXPERIENCE, or INSPIRATION.