Documentation

AbstractStatus
in package
implements StatusInterface Uses ResolveSRVTrait

AbstractYes

Table of Contents

Interfaces

StatusInterface
Interface StatusInterface

Properties

$encoding  : string
$host  : string
$info  : array<string, mixed>
$players  : array<string|int, string>
$port  : int
$resolveSRV  : bool
$socket  : resource|null
$timeout  : int

Methods

__construct()  : mixed
__destruct()  : mixed
disconnect()  : void
getEncoding()  : string
getHost()  : string
getInfo()  : array<string, mixed>
Returns the obtained host information
getPlayers()  : array<string|int, string>
Returns a potential list of players
getPort()  : int
getTimeout()  : int
isConnected()  : bool
Returns information about whether the connection was successful, it can also tell if the server is online
isResolveSRV()  : bool
setEncoding()  : void
setTimeout()  : void
Sets the time to get resources
_connect()  : void
encoding()  : array<string|int, mixed>
resolveSRV()  : array<string, string|null>

Properties

Methods

__construct()

public __construct(string $host[, int $port = 25565 ][, int $timeout = 3 ][, bool $resolveSRV = true ]) : mixed
Parameters
$host : string
$port : int = 25565
$timeout : int = 3
$resolveSRV : bool = true
Tags
throws
InvalidArgumentException

The $timeout must be a positive integer

getEncoding()

public getEncoding() : string
Return values
string

getPlayers()

Returns a potential list of players

public getPlayers() : array<string|int, string>
Tags
inheritDoc
throws
NotConnectedException
Return values
array<string|int, string>

isConnected()

Returns information about whether the connection was successful, it can also tell if the server is online

public isConnected() : bool
Tags
inheritDoc
Return values
bool

setEncoding()

public setEncoding(string $encoding) : void
Parameters
$encoding : string

setTimeout()

Sets the time to get resources

public setTimeout(int $timeout) : void
Parameters
$timeout : int
Tags
inheritDoc
throws
InvalidArgumentException

The timeout must be a positive integer.

_connect()

protected _connect(string $host, int $port) : void
Parameters
$host : string
$port : int
Tags
throws
ConnectionException

Thrown when failed to connect to resource

encoding()

protected encoding(array<string|int, mixed> $data) : array<string|int, mixed>
Parameters
$data : array<string|int, mixed>
Return values
array<string|int, mixed>

resolveSRV()

protected resolveSRV(string $host) : array<string, string|null>
Parameters
$host : string
Return values
array<string, string|null>

        
On this page

Search results