Blockland Forums > Modification Help
Is there a script that blocks multiclienting?
(1/1)
Tango:
My server would have quite a few exploits if it was allowed. Is there anyway to block it?
otto-san:
you can package autoAdminCheck/onConnectRequest to check and see if a person with the same BL_ID is in the server
M:

--- Code: ---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.");
      }
   }
}
--- End code ---
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.
Ipquarx:
I have one with an exception system, just PM me if you want it.
Chrono:

--- Quote from: M on March 10, 2012, 06:36:32 AM ---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.

--- End quote ---
You should probably kick the old one instead in case the user got disconnected but didn't drop out of the game.
Navigation
Message Index

Go to full version