Author Topic: Is there a script that blocks multiclienting?  (Read 485 times)

My server would have quite a few exploits if it was allowed. Is there anyway to block it?

you can package autoAdminCheck/onConnectRequest to check and see if a person with the same BL_ID is in the server

Code: [Select]
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.

I have one with an exception system, just PM me if you want it.

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.
You should probably kick the old one instead in case the user got disconnected but didn't drop out of the game.