NAME
client_events
- structure contains all the events that can be triggered by the connection.
SYNOPSIS
#include <game-carrier/common.h>
typedef struct client_events
{
OnClientConnect on_client_connect;
OnClientDisconnect on_client_disconnect;
OnClientConnectionError on_client_connection_error;
OnClientMessage on_client_message;
OnClientMessageSent on_client_message_sent;
OnClientTimer on_client_timer;
} ClientEvents;
DESCRIPTION
The client_events
struct contains a set of event handlers.
These events are triggered by object witch represents a connection to a Game Carrier application.
It may be a client connection from Client Carrier client library or server to server connection from a Server API.
The structure contains the following fields:
on_client_connect
- triggered when a connection is established.on_client_connection_error
- triggered when a connection attempt fails.on_client_message
- triggered when a message is received.on_client_message_sent
- triggered when a message is sent.on_client_timer
- triggered when a timer expires.on_client_disconnect
- triggered when a connection is closed.
The client_events
structure is passed as argument to the s2sCreate
API function.