Results 1 to 10 of 28

Thread: [Q3 FIX] Q3 fake clients fix

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #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()); 


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

    Ni3ls (25th November 2014)

Posting Permissions

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