OpenGSQ PHP

EOS extends ProtocolBase
in package

Class EOS

This class is used to interact with the Epic Online Services (EOS) platform.

Table of Contents

Properties

$fullname  : string
$host  : string
$port  : int
$timeout  : int
$accessToken  : string
The access token for the application.
$apiUrl  : string
The base URL for the Epic Games API.
$deploymentId  : string
The deployment ID for the application.

Methods

__construct()  : mixed
EOS constructor.
getAccessToken()  : string
Gets an access token.
getExternalAuthToken()  : string
Retrieves an external authentication token.
getInfo()  : array<string, mixed>
Retrieves the information about the game server.
getMatchmaking()  : Matchmaking
Retrieves matchmaking data.
getIPAddress()  : string
Gets the Internet Protocol (IP) endpoint.
readNullString()  : string
Reads a null-padded string from the binary data string.
readUInt16()  : int
Reads an unsigned 16-bit integer from the binary data string.
readUInt32()  : int
Reads an unsigned 32-bit integer from the binary data string.

Properties

$fullname

public string $fullname = 'Epic Online Services (EOS) Protocol'

The full name of the protocol.

$timeout

public int $timeout

The timeout for the connection in seconds.

$accessToken

The access token for the application.

private string $accessToken

$apiUrl

The base URL for the Epic Games API.

private static string $apiUrl = 'https://api.epicgames.dev'

$deploymentId

The deployment ID for the application.

private string $deploymentId

Methods

__construct()

EOS constructor.

public __construct(string $host, int $port, string $deploymentId, string $accessToken[, int $timeout = 5 ]) : mixed
Parameters
$host : string

The host name of the server.

$port : int

The port number of the server.

$deploymentId : string

The deployment ID for the application.

$accessToken : string

The access token for the application.

$timeout : int = 5

The timeout value for the connection, in seconds. Default is 5.

Tags
throws
Exception

Thrown when either deploymentId or accessToken is null.

getAccessToken()

Gets an access token.

public static getAccessToken(string $clientId, string $clientSecret, string $deploymentId, string $grantType, string $externalAuthType, string $externalAuthToken) : string
Parameters
$clientId : string

The client ID for the application.

$clientSecret : string

The client secret for the application.

$deploymentId : string

The deployment ID for the application.

$grantType : string

The type of grant being requested.

$externalAuthType : string

The type of external authentication being used.

$externalAuthToken : string

The token for the external authentication.

Tags
throws
Exception

Thrown when the access token cannot be retrieved.

Return values
string

The access token.

getExternalAuthToken()

Retrieves an external authentication token.

public static getExternalAuthToken(string $clientId, string $clientSecret, string $externalAuthType) : string
Parameters
$clientId : string

The client ID for the application.

$clientSecret : string

The client secret for the application.

$externalAuthType : string

The type of external authentication being used.

Tags
throws
Exception

Thrown when either clientId or clientSecret is null.

throws
Exception

Thrown when the provided externalAuthType hasn't been implemented yet.

Return values
string

The access token.

getInfo()

Retrieves the information about the game server.

public getInfo() : array<string, mixed>
Tags
throws
Exception

Thrown when the server is not found.

Return values
array<string, mixed>

An array that contains the server information.

getMatchmaking()

Retrieves matchmaking data.

public static getMatchmaking(string $deploymentId, string $accessToken[, array<string|int, mixed> $filter = array("" => "") ]) : Matchmaking
Parameters
$deploymentId : string

The deployment ID for the application.

$accessToken : string

The access token.

$filter : array<string|int, mixed> = array("" => "")

An optional filter for the matchmaking data.

Tags
throws
Exception

Thrown when the matchmaking data cannot be retrieved.

Return values
Matchmaking

The matchmaking data.

getIPAddress()

Gets the Internet Protocol (IP) endpoint.

protected getIPAddress() : string
Return values
string

The IP address of the host.

readNullString()

Reads a null-padded string from the binary data string.

protected readNullString(string &$data) : string
Parameters
$data : string

The binary data string. This parameter is passed by reference, and the function will modify it by removing the read bytes.

Return values
string

The null-padded string read from the binary data string.

readUInt16()

Reads an unsigned 16-bit integer from the binary data string.

protected readUInt16(string &$data) : int
Parameters
$data : string

The binary data string. This parameter is passed by reference, and the function will modify it by removing the read bytes.

Return values
int

The unsigned 16-bit integer read from the binary data string.

readUInt32()

Reads an unsigned 32-bit integer from the binary data string.

protected readUInt32(string &$data) : int
Parameters
$data : string

The binary data string. This parameter is passed by reference, and the function will modify it by removing the read bytes.

Return values
int

The unsigned 32-bit integer read from the binary data string.


        
On this page

Search results