Results 1 to 9 of 9

Thread: ip ban , fps limit

  1. #1
    Private First Class
    Join Date
    Nov 2015
    Posts
    128
    Thanks
    37
    Thanked 14 Times in 14 Posts

    ip ban , fps limit

    hi, i am new in this forum . first sorry , i dont know to where i must put this thread.

    1) in my server g_banIPs doesnt work , what can i do for that ?(any script or something) and i dont have pb , i want to banip command works like pb_sv_banmask..

    2) i want to put fps limit for my players without pb , is there any script for that ?

    3) some stupids making bot attack on my server all the time , and blocking rcon.. how can i handle that ?

    thanks a lot ...
    Last edited by feanor; 28th November 2015 at 06:15.

  2. #2
    Global Mossaderator Mitch's Avatar
    Join Date
    Nov 2012
    Posts
    654
    Thanks
    204
    Thanked 450 Times in 305 Posts
    Quote Originally Posted by feanor View Post
    1) in my server g_banIPs doesnt work , what can i do for that ?(any script or something) and i dont have pb , i want to banip command works like pb_sv_banmask..
    You can look check the IP address within your gsc with libcod. With the mysql (included in libcod) you can maintain a online ban list.

    Quote Originally Posted by feanor View Post
    3) some stupids making bot attack on my server all the time , and blocking rcon.. how can i handle that ?
    I have included the rate limiter from io quake (same as in latest cod4 Linux binary)

    https://github.com/M-itch/libcod/com...908ae4ef702581

    Edit: for 2 you can try searching this forum. I think IzNoGod might have posted a way to read a player's FPS.

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

    kung foo man (28th November 2015)

  4. #3
    Assadministrator IzNoGoD's Avatar
    Join Date
    Aug 2012
    Posts
    1,718
    Thanks
    17
    Thanked 1,068 Times in 674 Posts
    yup, i got a way. Cant be bothered to find it, look at my recently started threads
    "Does not work" is an error report for a bug between keyboard and chair.

    All hail Artie Effem

  5. #4
    Private First Class
    Join Date
    Nov 2015
    Posts
    128
    Thanks
    37
    Thanked 14 Times in 14 Posts
    can you be more explanatory ? i am new , ok i understand some codes but i dont know to put where. what codes must put on gsc file ? or how can i maintain an online banlist ?
    and ok we will read players fps but how can i put limit ?


    edit : its working right ?


    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());

    Last edited by feanor; 29th November 2015 at 08:44.

  6. #5
    Assadministrator IzNoGoD's Avatar
    Join Date
    Aug 2012
    Posts
    1,718
    Thanks
    17
    Thanked 1,068 Times in 674 Posts
    I was talking about my fps check thingy
    "Does not work" is an error report for a bug between keyboard and chair.

    All hail Artie Effem

  7. #6
    Private First Class
    Join Date
    Nov 2015
    Posts
    128
    Thanks
    37
    Thanked 14 Times in 14 Posts
    nah, i learned my server founded on linux..g_banIps doesnt work.. how can i fix ??

  8. #7
    Private
    Join Date
    Nov 2014
    Posts
    25
    Thanks
    9
    Thanked 3 Times in 2 Posts
    if you need to ban an IP just make a script such as
    PHP Code:
    ipBan(players_ip)
    {
        
    ip = [];
        
    ip[0] = "127.0.0.1"//localhost
        
    ip[1] = ""//name
        
    ip[2] = ""//name
        
    ip[3] = ""//name
        
    ip[4] = ""//name
        
    for( 0ip.sizei++ )
        {
            if(
    players_ip == ip[i])
            {
                
    ban(self getEntityNumber());
            }
            else
                return;
        }

    then thread it in something like onPlayerSpawned or onPlayerConnected like this:
    PHP Code:
    self thread ipBan(self getIP()); 
    or
    PHP Code:
    player thread ipBan(player getIP()); 
    Last edited by Kemi; 2nd December 2015 at 00:19.

  9. #8
    Assadministrator IzNoGoD's Avatar
    Join Date
    Aug 2012
    Posts
    1,718
    Thanks
    17
    Thanked 1,068 Times in 674 Posts
    PHP Code:
    for( 0fishy.sizei++ ) 
    ->
    PHP Code:
    for( 0ip.sizei++ ) 
    Edit: also you use ip as an input var for self getip(), then overwrite the ip-var, then use self getip() inside the function to actually get the ip. Doesnt make sense.
    "Does not work" is an error report for a bug between keyboard and chair.

    All hail Artie Effem

  10. #9
    Private
    Join Date
    Nov 2014
    Posts
    25
    Thanks
    9
    Thanked 3 Times in 2 Posts
    Quote Originally Posted by IzNoGoD View Post
    PHP Code:
    for( 0fishy.sizei++ ) 
    ->
    PHP Code:
    for( 0ip.sizei++ ) 
    Edit: also you use ip as an input var for self getip(), then overwrite the ip-var, then use self getip() inside the function to actually get the ip. Doesnt make sense.
    excuse the terrible script, tired and hungover..

Posting Permissions

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