Check XUID

This commit is contained in:
momo5502 2016-02-23 13:54:26 +01:00
parent 7f3f27bd3c
commit e10a7ef4c8

View File

@ -35,6 +35,14 @@ namespace Components
Game::SV_KickClientError(client, "XUID verification timed out!"); Game::SV_KickClientError(client, "XUID verification timed out!");
} }
else if (info->state == Auth::STATE_UNKNOWN && info->time && (Game::Com_Milliseconds() - info->time) > 1000 * 5) // Wait 5 seconds (error delay) else if (info->state == Auth::STATE_UNKNOWN && info->time && (Game::Com_Milliseconds() - info->time) > 1000 * 5) // Wait 5 seconds (error delay)
{
if ((client->steamid & 0xFFFFFFFF00000000) != 0x110000100000000)
{
info->state = Auth::STATE_INVALID;
info->time = Game::Com_Milliseconds();
Game::SV_KickClientError(client, "Your XUID is invalid!");
}
else
{ {
Logger::Print("Sending XUID authentication request to %s\n", Network::Address(client->adr).GetString()); Logger::Print("Sending XUID authentication request to %s\n", Network::Address(client->adr).GetString());
@ -43,6 +51,7 @@ namespace Components
info->challenge = Utils::VA("%X", Utils::Cryptography::Rand::GenerateInt()); info->challenge = Utils::VA("%X", Utils::Cryptography::Rand::GenerateInt());
Network::SendCommand(client->adr, "xuidAuthReq", info->challenge); Network::SendCommand(client->adr, "xuidAuthReq", info->challenge);
} }
}
else if (info->state == Auth::STATE_UNKNOWN && !info->time) else if (info->state == Auth::STATE_UNKNOWN && !info->time)
{ {
info->time = Game::Com_Milliseconds(); info->time = Game::Com_Milliseconds();