Unique identifier & reading user
Choosing a unique identifier.
Reading the EQU8 user status
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;
}Last updated