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
$encoding
protected
string
$encoding
= 'UTF-8'
$host
protected
string
$host
$info
protected
array<string, mixed>
$info
= []
$players
protected
array<string|int, string>
$players
= []
$port
protected
int
$port
$resolveSRV
protected
bool
$resolveSRV
$socket
protected
resource|null
$socket
= null
$timeout
protected
int
$timeout
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
__destruct()
public
__destruct() : mixed
disconnect()
public
disconnect() : void
getEncoding()
public
getEncoding() : string
Return values
stringgetHost()
public
getHost() : string
Return values
stringgetInfo()
Returns the obtained host information
public
getInfo() : array<string, mixed>
Tags
Return values
array<string, mixed>getPlayers()
Returns a potential list of players
public
getPlayers() : array<string|int, string>
Tags
Return values
array<string|int, string>getPort()
public
getPort() : int
Return values
intgetTimeout()
public
getTimeout() : int
Return values
intisConnected()
Returns information about whether the connection was successful, it can also tell if the server is online
public
isConnected() : bool
Tags
Return values
boolisResolveSRV()
public
isResolveSRV() : bool
Return values
boolsetEncoding()
public
setEncoding(string $encoding) : void
Parameters
- $encoding : string
setTimeout()
Sets the time to get resources
public
setTimeout(int $timeout) : void
Parameters
- $timeout : int
Tags
_connect()
protected
_connect(string $host, int $port) : void
Parameters
- $host : string
- $port : int
Tags
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