class Server extends UrlModel implements NamedModel

A BZFlag server

Constants

TABLE

The name of the database table used for queries

CREATE_PERMISSION

EDIT_PERMISSION

SOFT_DELETE_PERMISSION

HARD_DELETE_PERMISSION

Methods

static Server
addServer(string $name, string $domain, string $port, int $country, int $owner)

Add a new server

forceUpdate()

Update the server with current bzfquery information return self

bool
isOnline()

Checks if the server is online (listed on the public list server)

bool
hasPlayers()

Checks if the server has players

int
numPlayers()

Gets the number of players on the server

array
getPlayers()

Gets the players on the server

bool
staleInfo()

Checks if the last update is older than or equal to the update interval

CachedModel|int|null|Server
getApiKey()

The ApiKey assigned to this server

string
getServerIp()

Gets the server's ip address

string
getName()

Get the server's name

string
getDomain()

Get the domain of the server

int
getPort()

Get the port of the server

string
getAddress()

Get the server's IP address or hostname

getUpdated()

Get when the server information was last updated

getCountry()

Get the country the server is in

getOwner()

Get the owner of the server

getLastUpdate()

Returns the amount of time passed since the server was last updated

setName(string $name)

Set the name of the server

setAddress(string $address) deprecated

Set the address of the server

setDomain($domain)

Set the domain of the server

setPort($port)

Set the port of the server

setOwner(int $ownerId)

Set the id of the owner of the server

setCountry(int $countryId)

Set the id of the country of the server

static Server[]
getServers()

Get all the servers in the database that have an active status

static QueryBuilder
getQueryBuilder()

Get a query builder for servers

Details

at line line 115
static Server addServer(string $name, string $domain, string $port, int $country, int $owner)

Add a new server

Parameters

string $name The name of the server
string $domain The domain of the server (e.g. server.com)
string $port The port of the server (e.g. 5154)
int $country The ID of the country
int $owner The ID of the server owner

Return Value

Server An object that represents the sent message

at line line 137
forceUpdate()

Update the server with current bzfquery information return self

at line line 166
bool isOnline()

Checks if the server is online (listed on the public list server)

Return Value

bool Whether the server is online

at line line 175
bool hasPlayers()

Checks if the server has players

Return Value

bool Whether the server has any players

at line line 184
int numPlayers()

Gets the number of players on the server

Return Value

int The number of players

at line line 193
array getPlayers()

Gets the players on the server

Return Value

array The players on the server

at line line 206
bool staleInfo()

Checks if the last update is older than or equal to the update interval

Return Value

bool Whether the information is older than the update interval

at line line 219
CachedModel|int|null|Server getApiKey()

The ApiKey assigned to this server

Return Value

CachedModel|int|null|Server

at line line 228
string getServerIp()

Gets the server's ip address

Return Value

string The server's ip address

at line line 237
string getName()

Get the server's name

Return Value

string

at line line 247
string getDomain()

Get the domain of the server

Return Value

string The server's domain

at line line 257
int getPort()

Get the port of the server

Return Value

int The port number

at line line 266
string getAddress()

Get the server's IP address or hostname

Return Value

string

at line line 275
TimeDate getUpdated()

Get when the server information was last updated

Return Value

TimeDate

at line line 284
Country getCountry()

Get the country the server is in

Return Value

Country The country the server is located in

at line line 293
Player getOwner()

Get the owner of the server

Return Value

Player

at line line 302
TimeDate getLastUpdate()

Returns the amount of time passed since the server was last updated

Return Value

TimeDate

at line line 314
Server setName(string $name)

Set the name of the server

Parameters

string $name The new name of the server

Return Value

Server

at line line 328
Server setAddress(string $address) deprecated

deprecated Use setDomain() and setPort() instead

Set the address of the server

Parameters

string $address The new address of the server

Return Value

Server

at line line 345
Server setDomain($domain)

Set the domain of the server

Parameters

$domain string The new domain of the server

Return Value

Server

at line line 357
Server setPort($port)

Set the port of the server

Parameters

$port int The new port of the server

Return Value

Server

at line line 369
Server setOwner(int $ownerId)

Set the id of the owner of the server

Parameters

int $ownerId The ID of the new owner of the server

Return Value

Server

at line line 381
Server setCountry(int $countryId)

Set the id of the country of the server

Parameters

int $countryId The ID of the new country of the server

Return Value

Server

at line line 390
static Server[] getServers()

Get all the servers in the database that have an active status

Return Value

Server[] An array of server objects

at line line 399
static QueryBuilder getQueryBuilder()

Get a query builder for servers

Return Value

QueryBuilder