Server Hooks

Summary
Server Hooks
Functions
mods_console_initTODO
mods_initCalled when the server is started.
mods_shutdownCalled when the server quits.
mods_client_enterCalled when a client has joined the game.
mods_client_dropCalled when a client drops from the server.
mods_client_direct_inputCalled when the server recives new input from a client.
mods_client_predicted_inputCalled when the server applys the predicted input on the client.
mods_tickCalled with a regular interval to progress the gameplay.
mods_presnapCalled before the server starts to construct snapshots for the clients.
mods_snapCalled to create the snapshot for a client.
mods_postsnapCalled after the server is done sending the snapshots.
mods_connectedTODO
mods_net_versionTODO
mods_versionTODO
mods_messageTODO

Functions

mods_console_init

void mods_console_init()

TODO

mods_init

void mods_init()

Called when the server is started.

Remarks

It’s called after the map is loaded so all map items are available.

mods_shutdown

void mods_shutdown()

Called when the server quits.

Remarks

Should be used to clean up all resources used.

mods_client_enter

void mods_client_enter(int cid)

Called when a client has joined the game.

Arguments

cidClient ID.  Is 0 - MAX_CLIENTS.

Remarks

It’s called when the client is finished loading and should enter gameplay.

mods_client_drop

void mods_client_drop(int cid)

Called when a client drops from the server.

Arguments

cidClient ID.  Is 0 - MAX_CLIENTS

mods_client_direct_input

void mods_client_direct_input(int cid,
void *input)

Called when the server recives new input from a client.

Arguments

cidClient ID.  Is 0 - MAX_CLIENTS.
inputPointer to the input data.
sizeSize of the data.  (NOT IMPLEMENTED YET)

mods_client_predicted_input

void mods_client_predicted_input(int cid,
void *input)

Called when the server applys the predicted input on the client.

Arguments

cidClient ID.  Is 0 - MAX_CLIENTS.
inputPointer to the input data.
sizeSize of the data.  (NOT IMPLEMENTED YET)

mods_tick

void mods_tick()

Called with a regular interval to progress the gameplay.

Remarks

The SERVER_TICK_SPEED tells the number of ticks per second.

mods_presnap

void mods_presnap()

Called before the server starts to construct snapshots for the clients.

mods_snap

void mods_snap(int cid)

Called to create the snapshot for a client.

Arguments

cidClient ID.  Is 0 - MAX_CLIENTS.

Remarks

The game should make a series of calls to snap_new_item to construct the snapshot for the client.

mods_postsnap

void mods_postsnap()

Called after the server is done sending the snapshots.

mods_connected

void mods_connected(int client_id)

TODO

Arguments

arg1desc

Returns

See Also

<other_func>

mods_net_version

const char *mods_net_version()

TODO

Arguments

arg1desc

Returns

See Also

<other_func>

mods_version

const char *mods_version()

TODO

Arguments

arg1desc

Returns

See Also

<other_func>

mods_message

void mods_message(int msg,
int client_id)

TODO

Arguments

arg1desc

Returns

See Also

<other_func>

void mods_console_init()
TODO
void mods_init()
Called when the server is started.
void mods_shutdown()
Called when the server quits.
void mods_client_enter(int cid)
Called when a client has joined the game.
void mods_client_drop(int cid)
Called when a client drops from the server.
void mods_client_direct_input(int cid,
void *input)
Called when the server recives new input from a client.
void mods_client_predicted_input(int cid,
void *input)
Called when the server applys the predicted input on the client.
void mods_tick()
Called with a regular interval to progress the gameplay.
void mods_presnap()
Called before the server starts to construct snapshots for the clients.
void mods_snap(int cid)
Called to create the snapshot for a client.
void mods_postsnap()
Called after the server is done sending the snapshots.
void mods_connected(int client_id)
TODO
const char *mods_net_version()
TODO
const char *mods_version()
TODO
void mods_message(int msg,
int client_id)
TODO
void *snap_new_item(int type,
int id,
int size)
Creates a new item that should be sent.
Close