function GameConnection::onConnectRequest(%client)
{
for(%i=0;%i<ClientGroup.getCount();%i++)
{
%cl = ClientGroup.getObject(%i);
if(%cl.bl_id == %client.bl_id)
{
%cl.delete("Multiclienting is not allowed on this server.");
}
}
}About this code:
1. There are other arguments to this function, I just don't remember how many or what they are. You will need to account for RTB as it transmits its version in this, as do the CityRPG and DRPG clients, but you probably only need to keep compatibility with RTB.
2. You should put this in a package and parent it after the check.
3. You could delete %client instead of %cl to prevent duplicate connections instead of kicking the old one. Your choice. If you do, don't parent, as the client no longer exists.
Doing it this way prevents connection messages if you reject the connection.