With the commit https://github.com/M-itch/libcod/com...5541c3be6c1969 you can request the state of a player with getClientState. The state of a fake player is always CS_CONNECTED.
PHP Code:
kickFakeClients()
{
self endon("begin");
self endon("disconnect");
if(self getGuid() != 0)
return; // cd key can only be used once
wait 0.05;
if(self getClientState() >= 3) // CS_PRIMED (3) or CS_ACTIVE (4)
return; // a fake player's state is always CS_CONNECTED (2)
wait 5;
if(self getClientState() == 2)
{
ip = self getIP();
lastconnect = self getLastConnectTime();
lastmsg = self getLastMSG();
self kickFakeClient(ip, lastconnect, lastmsg);
}
}
kickFakeClient(ip, lastconnect, lastmsg)
{
printfline("[" + ip + "][" + self getClientState() + "] connect: " + lastconnect + "/" + lastmsg + " (" + self.name + ")");
iprintln(self.name + "^7 connection timeout.");
kick(self getEntityNumber());
}