Skip to content
Permalink
Browse files

game: distinguish bots from anonymous players flags, refs #1312

  • Loading branch information...
rmarquis committed Jun 29, 2019
1 parent 6bc21dd commit 8c541ee04533c5a535724b2b32c34d904247bde2
Showing with 7 additions and 3 deletions.
  1. +7 −3 src/game/g_client.c
@@ -2206,25 +2206,29 @@ char *ClientConnect(int clientNum, qboolean firstTime, qboolean isBot)
client->sess.uci = 0;
}
}
else if (isBot)
{
client->sess.uci = 0; // bots
}
else
{
client->sess.uci = 0; // localhost players
client->sess.uci = 246; // localhost players
}
}
else
{
unsigned long ip = GeoIP_addr_to_num(cs_ip);

// 10.0.0.0/8 [RFC1918]
// 172.16.0.0/12 [RFC1918]
// 172.16.0.0/12 [RFC1918]
// 192.168.0.0/16 [RFC1918]
// 169.254.0.0/16 [RFC3330] we need this ?
if (((ip & 0xFF000000) == 0x0A000000) ||
((ip & 0xFFF00000) == 0xAC100000) ||
((ip & 0xFFFF0000) == 0xC0A80000) ||
(ip == 0x7F000001)) // recognise also 127.0.0.1
{
client->sess.uci = 0;
client->sess.uci = 246;
}
else if (allowGeoIP)
{

0 comments on commit 8c541ee

Please sign in to comment.
You can’t perform that action at this time.