Results 1 to 10 of 28

Thread: [Q3 FIX] Q3 fake clients fix

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #25
    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
    And how to use / add this? :P
    Maybe for now it might be easier to tweak the fake bot kick script.

    Now the server will wait 5 seconds for the first fake client. But after kicking this bot, the server will kick the clients from that IP after 1.5 seconds.
    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)
        
        
    ip self getIP();
        if(
    isDefined(level.lastfakeplayerip) && level.lastfakeplayerip == ip
            
    wait 1.5;
        else 
    // more time when IP isn't the same as previous ip 
            
    wait 5;
        
        if(
    self getClientState() == 2)
        {
            
    lastconnect self getLastConnectTime();
            
    lastmsg self getLastMSG();
            if(
    lastconnect == lastmsg)
            {
                
    level.lastfakeplayerip ip// store ip from fake client
                
    self kickFakeClient(iplastconnectlastmsg);
            }
        }
    }

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

    How to use:
    PHP Code:
    Callback_PlayerConnect()
    {
        
    thread dummy();

        
    self thread kickFakeClients();
        
    self PlayerConnected(); 
    You can add it to CodeCallback_PlayerConnect() when you are use multiple gametypes.
    Last edited by Mitch; 26th August 2016 at 16:28. Reason: added how to use.

Posting Permissions

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