Polling client events

Events must be polled often as possible, preferably every “game frame”.

The client-side events are:

  • equ8_event_id_send_request. EQU8 has data to send (same as server).

  • equ8_event_id_error. An error occurred.

If we received a equ8_event_id_send_request event, EQU8 has data that should be sent to the server.

If we received a equ8_event_id_error event, an error was detected. This can be anything for an environmental problem to an internal error. It is recommended that the user is notified and the game is terminated. The error-code should always be saved for debugging purposes.

EQU8 will NEVER send more than 256 (0x100) bytes in a single packet.

equ8_event_t data;
switch(equ8_client_poll_event(&data))
{
    case equ8_event_id_error:
    {
        print_equ8_status_code(data.error.code);
        break;
    }
    case equ8_event_id_send_request:
    {
        packet_equ8_data equ8{
            static_cast<uint8_t *>(data.send_request.payload),
            data.send_request.size };
        send_to_server(&equ8);
        break;
    }
}

Closing the session

Ok, so the last thing left to do code-wise is to close the connection to the EQU8 Anti-Cheat servers when player is no longer in a game.

equ8_client_close_session();

Last updated