Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 28

Thread: [Q3 FIX] Q3 fake clients fix

  1. #11
    Assadministrator IzNoGoD's Avatar
    Join Date
    Aug 2012
    Posts
    1,718
    Thanks
    17
    Thanked 1,068 Times in 674 Posts
    Another thing to consider is that players that have not spawned have classname "noclass".

    Might be useful too, instead of using the waittill begin.
    "Does not work" is an error report for a bug between keyboard and chair.

    All hail Artie Effem

  2. The Following User Says Thank You to IzNoGoD For This Useful Post:

    RobsoN (26th February 2014)

  3. #12
    Global Mossaderator Mitch's Avatar
    Join Date
    Nov 2012
    Posts
    654
    Thanks
    204
    Thanked 450 Times in 305 Posts
    Quote Originally Posted by RobsoN View Post
    Well done, thanks for sharing this Mitch!
    Thanks. I just edit my code so people with a valid guid are always accepted.

    I am now using iptables to limit the number of connect each second. (same rules as limiting getstatus)

    PHP Code:
    iptables -N CQUERY-BLOCK
    iptables 
    -A CQUERY-BLOCK -m recent --set --name cblocked-hosts -j DROP
    iptables 
    -N CQUERY-CHECK
    iptables 
    -A CQUERY-CHECK -p udp -m string ! --string "connect" --algo bm --from 32 --to 39 -RETURN
    iptables -A CQUERY-CHECK -m recent --update --name cblocked-hosts --seconds 30 --hitcount 1 -j DROP
    iptables 
    -A CQUERY-CHECK -m hashlimit --hashlimit-mode srcip --hashlimit-name cod2connect --hashlimit-above 2/second -j CQUERY-BLOCK
    iptables 
    -A INPUT -p udp --dport 27960:29000 -j CQUERY-CHECK 
    Last edited by Mitch; 4th October 2016 at 18:24.

  4. The Following 2 Users Say Thank You to Mitch For This Useful Post:

    RobsoN (26th February 2014),Rocky (15th August 2014)

  5. #13
    Global Mossaderator Mitch's Avatar
    Join Date
    Nov 2012
    Posts
    654
    Thanks
    204
    Thanked 450 Times in 305 Posts
    This is my latest version with the new libcod functions.

    PHP Code:
    kickFakeClients()
    {
        
    self endon("begin");
        
    self endon("disconnect");

        if(
    self getGuid() != 0)
            return; 
    // cd key can only be used once
            
        
    wait 5;

        
    lastconnect self getLastConnectTime();
        
    lastmsg self getLastMSG();
        
        if(
    lastmsg == lastconnect)
        {
            
    ip self getIP();
            
            if(
    isDefined(level.lastconnectedplayerip) && level.lastconnectedplayerip == ip)
                
    self kickFakeClient(iplastconnectlastmsg);
            else 
    // more time when IP isn't the same as previous ip
            
    {
                
    level.lastconnectedplayerip ip;
                
    wait 5;
                
                
    lastconnect self getLastConnectTime();
                
    lastmsg self getLastMSG();
                
                if(
    lastmsg == lastconnect)
                    
    self kickFakeClient(iplastconnectlastmsg);
            }
        }
    }

    kickFakeClient(iplastconnectlastmsg)
    {
        
    printfline("[" ip "] connect: " lastconnect "/" lastmsg " (" self.name ")");
        
    iprintln(self.name "^7 connection timeout.");
        
    kick(self getEntityNumber());

    PHP Code:
    self thread kickFakeClients();

    self.statusicon "hud_status_connecting";
    self waittill("begin");
    self.statusicon ""
    Last edited by Mitch; 14th August 2014 at 14:06.

  6. The Following 3 Users Say Thank You to Mitch For This Useful Post:

    kung foo man (14th August 2014),Ni3ls (15th August 2014),Rocky (15th August 2014)

  7. #14
    Global Mossaderator Mitch's Avatar
    Join Date
    Nov 2012
    Posts
    654
    Thanks
    204
    Thanked 450 Times in 305 Posts
    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(iplastconnectlastmsg);
        }


    kickFakeClient(iplastconnectlastmsg

        
    printfline("[" ip "][" self getClientState() + "] connect: " lastconnect "/" lastmsg " (" self.name ")"); 
        
    iprintln(self.name "^7 connection timeout."); 
        
    kick(self getEntityNumber()); 


  8. The Following User Says Thank You to Mitch For This Useful Post:

    Ni3ls (25th November 2014)

  9. #15
    Corporal guiismiti's Avatar
    Join Date
    Dec 2013
    Location
    Brazil
    Posts
    244
    Thanks
    121
    Thanked 42 Times in 31 Posts
    In Brazil a considerable number of people still play CoD in cyber cafes. If two friends decide to play in a protected server, they won't be able to.

    But it's just a small consequence anyway.
    set logfile 2

  10. #16
    Brigadier General
    Join Date
    Dec 2012
    Posts
    1,012
    Thanks
    440
    Thanked 171 Times in 132 Posts
    Its not working for me. All my servers are being filled with bots. I added the script. THey do get kicked, but they connect faster than they get kicked. So server is still being filled. Any ideas to just prevent them even from connecting? The IP: 94.255.70.95

  11. #17
    Global Mossaderator Mitch's Avatar
    Join Date
    Nov 2012
    Posts
    654
    Thanks
    204
    Thanked 450 Times in 305 Posts
    Quote Originally Posted by Ni3ls View Post
    Its not working for me. All my servers are being filled with bots. I added the script. THey do get kicked, but they connect faster than they get kicked. So server is still being filled. Any ideas to just prevent them even from connecting? The IP: 94.255.70.95
    You could try blocking the connect packets with the iptables from this post:
    http://killtube.org/showthread.php?1...ull=1#post9259

    Or the new challenge rate limiter from this commit:
    https://github.com/M-itch/libcod/com...908ae4ef702581

  12. #18
    Brigadier General
    Join Date
    Dec 2012
    Posts
    1,012
    Thanks
    440
    Thanked 171 Times in 132 Posts
    How can I use/add that commit?

  13. #19
    Global Mossaderator Mitch's Avatar
    Join Date
    Nov 2012
    Posts
    654
    Thanks
    204
    Thanked 450 Times in 305 Posts
    Quote Originally Posted by Ni3ls View Post
    How can I use/add that commit?
    You could try my builds for Ubuntu (they should also work under Debian):
    https://znation.nl/libcod/ubuntu/

    Or checkout my github.
    PHP Code:
    git checkout https://github.com/M-itch/libcod.git libcod
    cd libcod
    ./doit.sh base
    ./doit.sh cod2_1_0 
    Last edited by Mitch; 8th June 2015 at 14:19. Reason: removed './doit.sh clean'

  14. The Following User Says Thank You to Mitch For This Useful Post:

    Ni3ls (8th June 2015)

  15. #20
    Brigadier General
    Join Date
    Dec 2012
    Posts
    1,012
    Thanks
    440
    Thanked 171 Times in 132 Posts
    I added your build + the last script with getState. Still got 10 bots in the server.

    http://service.killtube.org/?ip=46.4...yles/frontpage

    I dont have root access so I cant add the iptables. He is also using different IP's now

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •