Atrinik Server  4.0
Typedefs | Functions
server.h File Reference
#include <toolkit/toolkit.h>

Go to the source code of this file.


typedef void(* socket_command_func )(socket_struct *cs, player *pl, uint8_t *data, size_t len, size_t pos)


 TOOLKIT_FUNCS_DECLARE (socket_server)
void socket_server_handle_client (player *pl)
bool socket_server_remove (socket_struct *cs)
void socket_server_process (void)
void socket_server_post_process (void)

Detailed Description

Socket server header file.

Definition in file server.h.

Typedef Documentation

typedef void(* socket_command_func)(socket_struct *cs, player *pl, uint8_t *data, size_t len, size_t pos)

Function to call when a specific command type is received.

csClient socket.
plPlayer associated with the client. May be NULL if the client has not logged in yet.
dataNetwork data buffer that contains the command.
lenNumber of bytes in the command.
posPosition where to start parsing command-specific data.

Definition at line 50 of file server.h.

Function Documentation

void socket_server_handle_client ( player pl)

Handle client commands.

We only get here once there is input, and only do basic connection checking.

plPlayer to handle commands for.

Definition at line 503 of file server.c.

void socket_server_post_process ( void  )

Update player socket-related data, render the map for them, etc. Afterwards, attempt to write to the players' clients.

Definition at line 902 of file server.c.

void socket_server_process ( void  )

Accept incoming connections, read data from clients and write data to clients.

Definition at line 722 of file server.c.

bool socket_server_remove ( socket_struct cs)

Removes the specified client socket from the server's managed list of clients that haven't logged in yet. The client socket remains valid afterwards.

This is used from the login routine, because as soon as the client logs in, they go to the player list, which is also walked through in the server socket code, thus, it needs to be removed from the other list.

csClient socket to remove.
True on success, false on failure (no such client socket).

Definition at line 556 of file server.c.