Client Interface

Summary
Client Interface
Constants
Constants
Client States
Image Formats
Texture Loading Flags
Server Browser Sorting
Structures
SERVER_INFO_PLAYER
SERVER_INFO
Functions
Time
client_tickReturns the tick of the current snapshot.
client_prevtickReturns the tick of the previous snapshot.
client_intratickReturns the current intratick.
client_predtickReturns the current predicted tick.
client_predintratickReturns the current preticted intra tick.
client_ticktimeTODO
client_tickspeedReturns how many ticks per second the client is doing.
client_frametimeReturns how long time the last frame took to process.
client_localtimeReturns the clients local time.
Server Browser
client_serverbrowse_refreshIssues a refresh of the server browser.
client_serverbrowse_sorted_getReturns server info from the sorted list.
client_serverbrowse_sorted_numReturns how many servers there are in the sorted list.
client_serverbrowse_getTODO
client_serverbrowse_numTODO
client_serverbrowse_num_requestsTODO
client_serverbrowse_updateTODO
client_serverbrowse_lanTODO
client_serverbrowse_addfavoriteAdds a server to the favorite list
client_serverbrowse_removefavoriteRemoves a server to the favorite list
Actions
client_connectConnects to a server at the specified address.
client_disconnectDisconnects from the current server.
client_quitTells to client to shutdown.
client_rconSends a command to the server to execute on it’s console.
client_rcon_authTODO
client_rcon_authedTODO
Other
client_latestversionReturns 0 if there’s no version difference
client_get_inputTODO
client_direct_inputTODO
client_error_stringTODO
client_connection_problemsReturns 1 if the client is connection problems.
client_stateReturns the state of the client.
client_mapdownload_amountTODO
client_mapdownload_totalsizeTODO
client_save_lineTODO

Constants

Client States

CLIENTSTATE_OFFLINEThe client is offline.
CLIENTSTATE_CONNECTINGThe client is trying to connect to a server.
CLIENTSTATE_LOADINGThe client has connected to a server and is loading resources.
CLIENTSTATE_ONLINEThe client is connected to a server and running the game.
CLIENTSTATE_QUITINGThe client is quiting.

Image Formats

IMG_AUTOLets the engine choose the format.
IMG_RGB8-Bit uncompressed RGB
IMG_RGBA8-Bit uncompressed RGBA
IMG_ALPHA8-Bit uncompressed alpha

Texture Loading Flags

TEXLOAD_NORESAMPLEPrevents the texture from any resampling

Server Browser Sorting

BROWSESORT_NAMESort by name.
BROWSESORT_PINGSort by ping.
BROWSESORT_MAPSort by map
BROWSESORT_GAMETYPESort by game type.  DM, TDM etc.
BROWSESORT_PROGRESSIONSort by progression.
BROWSESORT_NUMPLAYERSSort after how many players there are on the server.

Structures

SERVER_INFO_PLAYER

SERVER_INFO

Functions

Summary
Time
client_tickReturns the tick of the current snapshot.
client_prevtickReturns the tick of the previous snapshot.
client_intratickReturns the current intratick.
client_predtickReturns the current predicted tick.
client_predintratickReturns the current preticted intra tick.
client_ticktimeTODO
client_tickspeedReturns how many ticks per second the client is doing.
client_frametimeReturns how long time the last frame took to process.
client_localtimeReturns the clients local time.
Server Browser
client_serverbrowse_refreshIssues a refresh of the server browser.
client_serverbrowse_sorted_getReturns server info from the sorted list.
client_serverbrowse_sorted_numReturns how many servers there are in the sorted list.
client_serverbrowse_getTODO
client_serverbrowse_numTODO
client_serverbrowse_num_requestsTODO
client_serverbrowse_updateTODO
client_serverbrowse_lanTODO
client_serverbrowse_addfavoriteAdds a server to the favorite list
client_serverbrowse_removefavoriteRemoves a server to the favorite list
Actions
client_connectConnects to a server at the specified address.
client_disconnectDisconnects from the current server.
client_quitTells to client to shutdown.
client_rconSends a command to the server to execute on it’s console.
client_rcon_authTODO
client_rcon_authedTODO
Other
client_latestversionReturns 0 if there’s no version difference
client_get_inputTODO
client_direct_inputTODO
client_error_stringTODO
client_connection_problemsReturns 1 if the client is connection problems.
client_stateReturns the state of the client.
client_mapdownload_amountTODO
client_mapdownload_totalsizeTODO
client_save_lineTODO

Time

client_tick

int client_tick()

Returns the tick of the current snapshot.

client_prevtick

int client_prevtick()

Returns the tick of the previous snapshot.

client_intratick

float client_intratick()

Returns the current intratick.

Remarks

The intratick is how far gone the time is from the previous snapshot to the current.  0.0 means that it on the previous snapshot.  0.5 means that it’s halfway to the current, and 1.0 means that it is on the current snapshot.  It can go beyond 1.0 which means that the client has started to extrapolate due to lack of data from the server.

See Also

client_tick

client_predtick

int client_predtick()

Returns the current predicted tick.

client_predintratick

float client_predintratick()

Returns the current preticted intra tick.

Remarks

This is the same as client_intratick but for the current predicted tick and previous predicted tick.

See Also

client_intratick

client_ticktime

float client_ticktime()

TODO

Arguments

arg1desc

Returns

See Also

<other_func>

client_tickspeed

int client_tickspeed()

Returns how many ticks per second the client is doing.

Remarks

This will be the same as the server tick speed.

client_frametime

float client_frametime()

Returns how long time the last frame took to process.

client_localtime

float client_localtime()

Returns the clients local time.

Remarks

The local time is set to 0 when the client starts and when it connects to a server.  Can be used for client side effects.

Server Browser

client_serverbrowse_refresh

void client_serverbrowse_refresh(int type)

Issues a refresh of the server browser.

Arguments

typeWhat type of servers to browse, internet, lan or favorites.

Remarks

This will cause a broadcast on the local network if the lan argument is set.  Otherwise it call ask all the master servers for their servers lists.

client_serverbrowse_sorted_get

SERVER_INFO *client_serverbrowse_sorted_get(int index)

Returns server info from the sorted list.

Arguments

indexZero based index into the sorted list.

See Also

client_serverbrowse_sorted_num

client_serverbrowse_sorted_num

int client_serverbrowse_sorted_num()

Returns how many servers there are in the sorted list.

See Also

client_serverbrowse_sorted_get

client_serverbrowse_get

SERVER_INFO *client_serverbrowse_get(int index)

TODO

Arguments

arg1desc

Returns

See Also

<other_func>

client_serverbrowse_num

int client_serverbrowse_num()

TODO

Arguments

arg1desc

Returns

See Also

<other_func>

client_serverbrowse_num_requests

int client_serverbrowse_num_requests()

TODO

Arguments

arg1desc

Returns

See Also

<other_func>

client_serverbrowse_update

void client_serverbrowse_update()

TODO

Arguments

arg1desc

Returns

See Also

<other_func>

client_serverbrowse_lan

int client_serverbrowse_lan()

TODO

Arguments

arg1desc

Returns

See Also

<other_func>

client_serverbrowse_addfavorite

void client_serverbrowse_addfavorite(NETADDR addr)

Adds a server to the favorite list

Arguments

addrAddress of the favorite server.

client_serverbrowse_removefavorite

void client_serverbrowse_removefavorite(NETADDR addr)

Removes a server to the favorite list

Arguments

addrAddress of the favorite server.

Actions

client_connect

void client_connect(const char *address)

Connects to a server at the specified address.

Arguments

addressAddress of the server to connect to.

See Also

client_disconnect

client_disconnect

void client_disconnect()

Disconnects from the current server.

Remarks

Does nothing if not connected to a server.

See Also

<client_connect, client_quit>

client_quit

void client_quit()

Tells to client to shutdown.

See Also

client_disconnect

client_rcon

void client_rcon(const char *cmd)

Sends a command to the server to execute on it’s console.

Arguments

cmdThe command to send.

Remarks

The client must have the correct rcon password to connect.

See Also

<client_rcon_auth, client_rcon_authed>

client_rcon_auth

void client_rcon_auth(const char *name,
const char *password)

TODO

Arguments

arg1desc

Returns

See Also

<client_rcon, client_rcon_authed>

client_rcon_authed

int client_rcon_authed()

TODO

Arguments

arg1desc

Returns

See Also

<client_rcon, client_rcon_auth>

Other

client_latestversion

const char *client_latestversion()

Returns 0 if there’s no version difference

Arguments

arg1desc

Returns

See Also

<other_func>

client_get_input

int *client_get_input(int tick)

TODO

Arguments

arg1desc

Returns

See Also

<other_func>

client_direct_input

void client_direct_input(int *input,
int size)

TODO

Arguments

arg1desc

Returns

See Also

<other_func>

client_error_string

const char *client_error_string()

TODO

Arguments

arg1desc

Returns

See Also

<other_func>

client_connection_problems

int client_connection_problems()

Returns 1 if the client is connection problems.

Remarks

Connections problems usually means that the client havn’t recvived any data from the server in a while.

client_state

int client_state()

Returns the state of the client.

See Also

Client States

client_mapdownload_amount

int client_mapdownload_amount()

TODO

Arguments

arg1desc

Returns

See Also

<other_func>

client_mapdownload_totalsize

int client_mapdownload_totalsize()

TODO

Arguments

arg1desc

Returns

See Also

<other_func>

client_save_line

void client_save_line(const char *line)

TODO

Arguments

arg1desc

Returns

See Also

<other_func>

int client_tick()
Returns the tick of the current snapshot.
int client_prevtick()
Returns the tick of the previous snapshot.
float client_intratick()
Returns the current intratick.
int client_predtick()
Returns the current predicted tick.
float client_predintratick()
Returns the current preticted intra tick.
float client_ticktime()
TODO
int client_tickspeed()
Returns how many ticks per second the client is doing.
float client_frametime()
Returns how long time the last frame took to process.
float client_localtime()
Returns the clients local time.
void client_serverbrowse_refresh(int type)
Issues a refresh of the server browser.
SERVER_INFO *client_serverbrowse_sorted_get(int index)
Returns server info from the sorted list.
int client_serverbrowse_sorted_num()
Returns how many servers there are in the sorted list.
SERVER_INFO *client_serverbrowse_get(int index)
TODO
int client_serverbrowse_num()
TODO
int client_serverbrowse_num_requests()
TODO
void client_serverbrowse_update()
TODO
int client_serverbrowse_lan()
TODO
void client_serverbrowse_addfavorite(NETADDR addr)
Adds a server to the favorite list
void client_serverbrowse_removefavorite(NETADDR addr)
Removes a server to the favorite list
void client_connect(const char *address)
Connects to a server at the specified address.
void client_disconnect()
Disconnects from the current server.
void client_quit()
Tells to client to shutdown.
void client_rcon(const char *cmd)
Sends a command to the server to execute on it’s console.
void client_rcon_auth(const char *name,
const char *password)
TODO
int client_rcon_authed()
TODO
const char *client_latestversion()
Returns 0 if there’s no version difference
int *client_get_input(int tick)
TODO
void client_direct_input(int *input,
int size)
TODO
const char *client_error_string()
TODO
int client_connection_problems()
Returns 1 if the client is connection problems.
int client_state()
Returns the state of the client.
int client_mapdownload_amount()
TODO
int client_mapdownload_totalsize()
TODO
void client_save_line(const char *line)
TODO
Close