Author Topic: Script_MultipleClientBlock kicks everyone.  (Read 600 times)

Code: [Select]
package BlockDuplicates
{
    function GameConnection::autoAdminCheck(%client)
    {
        for(%i = 0; %i < clientGroup.getCount(); %i++)
        {
            if(clientGroup.getObject(%i).bl_id $= %client.bl_id)
            {
                %client.delete("No duplicates allowed");
                return;
            }
        }
        parent::autoAdminCheck(%client);
    }
 };
 activatePackage(BlockDuplicates);

Someone made this for me to kick multiple clients, but it kicks everyone. How do I make it so I only bans 1 duplicate?

Because you're comparing the client with itself.
Try something like this

Code: [Select]
package BlockDuplicates
{
function GameConnection::autoAdminCheck(%this)
{
for(%i = 0; %i < clientGroup.getCount(); %i++)
{
%client = clientGroup.getObject(%i);
if(%cliet.bl_id == %this.bl_id && %client != %this)
{
%this.delete("No duplicates allowed");
return;
}
}
parent::autoAdminCheck(%client);
}
};
activatePackage(BlockDuplicates);
« Last Edit: May 20, 2012, 04:42:14 PM by Headcrab Zombie »

I made one of these that blocks them as they request to connect, therefore preventing the connected messages, it also has a exception system. Should I get it for you?

I made one of these that blocks them as they request to connect, therefore preventing the connected messages, it also has a exception system. Should I get it for you?

You could even block them by name instead of ID because names are unique to individual clients, so you don't need to wait until the admin check (this will also help with LAN server compatibility).  Hit them right at the connect request because you can.


package blah
{
    function GameConnection::onConnectRequest(%this, %addr, %lan, %name, %pre, %suf, %rtb)
    {
       for(%i=0;%i<ClientGroup.getCount();%i++)
       {
          %cname = ClientGroup.getObject(%i).name;
          if(%name == %cname)
             %k = true;
       }
       if(%k)
          return "No Multiclienting";
       else
           return Parent::onConnectRequest(%this, %addr, %lan, %name, %pre, %suf, %rtb);
    }
};activatepackage(blah);

knock them out right at the start.

knock them out right at the start.

Critical hit, it's super effective!

Critical hit, it's super effective!
You get 2000cc and you send none of it back to your mom!

Should also mention that all this will really prevent is siblings playing together.
Also if someone crashes or otherwise disconnects from the server in a way that results in their client still being in the server, they will be unable to join until the previous client times out.

You could even block them by name instead of ID because names are unique to individual clients, so you don't need to wait until the admin check (this will also help with LAN server compatibility).  Hit them right at the connect request because you can.
names arn't unique to each ID, i remember somebody managing to have a double feep or something

Should also mention that all this will really prevent is siblings playing together.
Also if someone crashes or otherwise disconnects from the server in a way that results in their client still being in the server, they will be unable to join until the previous client times out.

fuk siblings
o yea add a check to see if a client is currently infinitelagging, and kick the one currently in server in that case.

names arn't unique to each ID, i remember somebody managing to have a double feep or something

Yeah they are, thats just a weird glitch exception

Here is the multi-clienting blocker that I made, it does everything suggested here, kicks only the one already in the server (like if someone was infinitelagging), blocks them as they request to connect, and has an exception system (like if you trusted that someone was just playing with a sibling), It also has a rtb pref for enabling/disabling.