EQU8 Documentation
  • Welcome
  • Integration Guide
    • Examples
    • Download SDK & copy files
    • Server-side configuration
    • Unique identifier & reading user
    • Accepting player and data
    • Polling server events
    • Client-side Configuration
    • Receiving data from the server
    • Polling client events
    • Protecting game resources
    • Protection template file-format
    • Protection Template Example
    • Renaming EQU8 Launcher
    • Configuring EQU8 Launcher
    • Distributing with EQU8
  • Errors
    • Error Status codes
Powered by GitBook
On this page
  • Choosing a unique identifier.
  • Reading the EQU8 user status
  • C/C++

Was this helpful?

  1. Integration Guide

Unique identifier & reading user

Choosing a unique identifier.

EQU8 needs an identifier that is unique across all players. This identifier is used to correlate events in our database with your database. The identifier can be anything from a user name to a database integer; so long as it is unique it will work. So, before we continue, decide on what identifier to use.

Reading the EQU8 user status

Before allowing a client to play, we want to verify that she is well behaved (not banned etc).

In the example server we write a function named user_is_allowed_to_play that talks to the EQU8 user validation API.

Initially, let us just use the predefined actions (ban and timeout 15 minutes). However, using EQU8 you can implement whatever actions you see fit! Be it an all-cheaters server or a virtual jail :)

C/C++

bool user_is_allowed_to_play(const sockaddr_in &from,
    const std::string &unique_id, uint32_t action)
{
    auto from_sa = reinterpret_cast<const sockaddr *>(&from);

    if(equ8_action_ban == action)
    {
        packet_violation pv{ "You are banned." };
        send_packet(from_sa, sizeof(from), &pv);
        return false;
    }
    else if(equ8_action_timeout_15m == action)
    {
        packet_violation pv{ "You are timed-out." };
        send_packet(from_sa, sizeof(from), &pv);
        return false;
    }
    return true;
}
bool user_is_allowed_to_play(IPEndPoint from, string id, UInt32 ac)
{
    var action = (equ8.equ8_action)ac;
    if (equ8.equ8_action.ban == action)
    {
        send_packet(from, new packet_violation("You are banned."));
        return false;
    }
    else if (equ8.equ8_action.timeout_15m == action)
    {
        send_packet(from, new packet_violation("You are timed-out."));
        return false;
    }
    return true;
}
PreviousServer-side configurationNextAccepting player and data

Last updated 4 years ago

Was this helpful?