Raised This Month: $32 Target: $400
 8% 

Client Checker (1.0.1) [Update 02-25-2007] SQL Support


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   Counter-Strike        Category:   Server Management        Approver:   Hawk552 (427)
Crazed
Member
Join Date: Oct 2006
Old 10-21-2006 , 06:04   Client Checker (1.0.1) [Update 02-25-2007] SQL Support
Reply With Quote #1

What does it do?

It can check client rates
It can check client CVARS which can be configured in a config file
It can show a (dis)connect message from clients (possibility to show from which country the player connects)
It can kick players with high ping (Used / Modified the HPK code)

CVARS:
  • cc_connectmsg - Shows who is (dis)connecting
  • cc_showgeoip - Shows connecting player country
  • cc_ratecheck - Check client rates
  • cc_cvarcheck - Check client cvars (using the config file)
  • cc_pingcheck - High ping kick
  • cc_writelog - Write invalid client settings and Admin actions to a log file
  • cc_chkdelay - Delay between checks in seconds
  • cc_maxping - Maximum allowed ping
  • cc_maxpingwarns - Ping check cycles before kick
  • cc_minupdaterate - Minimum allowed cl_updaterate
  • cc_mincmdrate - Minimum allowed cl_cmdrate
  • cc_minrate - Minimum allowed rate
  • cc_messagetype - Show message about invalid settings to:
    • 0 = Nobody
    • 1 = AMX Admins
    • 2 = Checked Player + AMX Admins
    • 3 = All players
  • cc_agreemenu - This will show the agreement menu
  • cc_agreetimeout - How long the client has to accept
  • cc_maxitems - This is to set how many cvars will be checked in one check cycle
  • cc_writecfg - Write changes to the client checker config file
  • cc_maxinvalid - Maximum allowed invalid changes of settings from a client before they will be kicked
  • cc_showinfo - Show info about client checker in client console
  • cc_sqlhost - SQL server hostname(:port)
  • cc_sqluser - SQL username
  • cc_sqlpass - SQL password
  • cc_sqldbname - Database to be used (default: ClientChecker)
  • cc_daystosave - How long the agreement of a client should be saved
CVAR Check Config:

cvar {
max_value - Use this for numeric values only
min_value - Use this for numeric values only

set_value - Value that will replace the invalid value (when using '*' as value it will set to the avg of the min and max value)

equal_to - Value can not be equal to this, if it is change it to the set_value
!equal_to - Value must be equal to this, if not change it to the set_value
contains - Value contains this. Change value to set_value (use comma to use spererate values)
!contains - Value does not contain this. Change value to set_value (use comma to use spererate values)
regex - Use a regex pattern (http://www.troubleshooters.com/codec...rl/perlreg.htm
}

Examples:

gl_polyoffset {
max_value 4
set_value 4
}

max_smokepuffs {
min_value 120
set_value 120
}

name {
contains fuck,shit,cunt
set_value BANNED_NAME
}


SQL:
The sql.txt file contains the database structure. The SQL stuff currently only saves the steamids in the database.


Requirements:
This plugin requires amxmodx 1.7 or later to work!

Change log:
1.0.1:
- Changed the CVAR checker config (it will still read its old config)
- Agree save is now using nvault to store steamid's. And it will remove entries older than 14 days by default (only if the SQL version is not used).
1.0.0:
- Added SQL support
0.0.9:
- Bugfix: Always showing agreement menu even while steamid was in saved list!
- Did some optimization 0.0.8 Optimized:
- Optimized the code
- Added option to show the info in console when client joins the server (cc_showinfo)
0.0.8:
- Bugfix: now using get_players instead of get_playersnum so all messages should be working now.
0.0.7:
- Changed the maximum save value to 512 (this is defined in the source code and can be changed to use a low or higher number)
- Added quick cvar check when a client joins the server.
- Added option to auto kick clients that keep changing there settings to an invalid value. (The number of invalid changes can be set in the config. And will only start after the first check).
- Added option to automaticly write admin changes to the config file.
0.0.6:
- Added option to show a agreement menu before the client checker starts. If the user doesnt agree he/she will be removed from the server.
- Added option to keep a little save file of the users who agreed (up to 64 records)
- Added a limit to maximum cvar checks in one check cycle. This is to prevent flooding with big cvar check lists. The maximum items to check can be set with "cc_maxitems".
0.0.5:
- Small bug fix with geoip when a bot joins the server. Also added some code to check if the country isnt matching error.
0.0.4:
- Fixed the cc_showgeoip cvar (it did not check if it was en/dis-abled)
- Added messages for High ping kick
- Added pcvars to make it faster
0.0.3:
- Fixed bug in Cvar checker
- Code revision (cleaned up some of the mess)
0.0.2: Public version
0.0.1: Private test version

Old versions:
The old versions can be found here:
http://crazed.swamo.com/ClientChecker

If you download this plugin please leave some feedback!

Note: The zip file includes the config files and this page as readme!
Attached Files
File Type: sma Get Plugin or Get Source (ClientChecker.sma - 13556 views - 34.3 KB)
File Type: sma Get Plugin or Get Source (ClientChecker_SQL.sma - 7229 views - 34.3 KB)
File Type: txt sql.txt (487 Bytes, 5400 views)
File Type: zip ClientChecker.zip (66.2 KB, 12138 views)

Last edited by Crazed; 05-17-2007 at 04:44. Reason: Optimized code
Crazed is offline
godlike
Senior Member
Join Date: Apr 2005
Old 10-21-2006 , 07:00   Re: Client Checker
Reply With Quote #2

n1 this plugin will be very usefull .
Are you sure this plugin isnt made yet?
__________________
Read the rules before posting something stupid: click here

Any questions about amxx PM me
godlike is offline
Crazed
Member
Join Date: Oct 2006
Old 10-21-2006 , 07:39   Re: Client Checker
Reply With Quote #3

Quote:
Originally Posted by godlike View Post
n1 this plugin will be very usefull .
Are you sure this plugin isnt made yet?
Well there already is a cvar checker that does something similar but at the time I wrote the first version there wasnt. And this also has some other stuff added to it. I had no plans on putting it to public but changed my mind

Last edited by Crazed; 10-21-2006 at 12:28.
Crazed is offline
SweatyBanana
BANNED
Join Date: Sep 2005
Location: LOL
Old 10-21-2006 , 09:26   Re: Client Checker
Reply With Quote #4

Some of your code is very repeticious..

ex:

in cc_messagetype, you use this like 3 times when you can simply put it above all three if() statements..

PHP Code:
new players get_playersnum()
for (
0;<= players;i++)
{
            if (
is_user_admin(i))
            {
                       
//Your client_prints
            
}

I would also suggest changing the if() statements in there to a switch() statement like so:

PHP Code:
    new players get_playersnum()
    for (
0;<= players;i++)

    switch(
type)
    {
        case 
0:
        {
            return 
PLUGIN_HANDLED;
        }
        
        case 
1:
        {
            if(
is_user_admin(i))
            {
                
client_print(iprint_chat"%d %s: %s %s"idnamecvarvalue)
            }
        }
        
        case 
2:
        {
            
client_print(idprint_chat"%d %s: %s %s"idname ,cvarvalue)
            if (
is_user_admin(i))
            {
                
client_print(iprint_chat"%d %s: %s %s"idnamecvarvalue)
            }
        }
        
        case 
3:
        {
            
client_print(iprint_chat"%d %s: %s %s"idnamecvarvalue)
        }
    } 
SweatyBanana is offline
Send a message via AIM to SweatyBanana Send a message via Yahoo to SweatyBanana
Crazed
Member
Join Date: Oct 2006
Old 10-21-2006 , 11:06   Re: Client Checker
Reply With Quote #5

hmm I was already looking for that switch stuff but didnt find it in the functions on the AMX doc. So wasnt sure if I could use it. thx anyway will update it right now

Last edited by Crazed; 10-21-2006 at 11:09.
Crazed is offline
organizedKaoS
Senior Member
Join Date: Feb 2006
Old 10-21-2006 , 20:16   Re: Client Checker
Reply With Quote #6

You don't need
Code:
case 0: {      return PLUGIN_HANDLED }

switch can and will only look for cases you specify.

And if you were to use 0 for type, it will most likely be for the off/disable/etc option, so case 0 can be omitted completely.
organizedKaoS is offline
Crazed
Member
Join Date: Oct 2006
Old 10-22-2006 , 09:09   Re: [Update] Client Checker
Reply With Quote #7

Had a bug while loading the chk_cvars.cfg file. This was because I first didnt had any comments in that file added this later and forgot to update the old code properly.

Old code:
PHP Code:
new fp=fopen(cc_configfile"rt")
    
lines 0
    
new left[64], right[64]
    while  (!
feof(fp)) {
        
fgets(fpbuf63)
        
trim(buf)
        if (
strlen(buf) > 0) {
            
strtok(bufleft63right63' ')
            
// Check if line is not a comment
            
if (strcmp(left"//"))
                
cvars_buf[lines] = buf
        
}
        
lines++
    }
    
fclose(fp
New code:
PHP Code:
new fp=fopen(cc_configfile"rt")
        
cvar_items 0
        
while  (!feof(fp)) 
        {
            
fgets(fpbuf63)
            
trim(buf)
            if (
strlen(buf) > 0
            {
                
// Check if line starts with comment sign
                
if (strfind(buf"//"00) != 0)
                {
                    
cvars_buf[cvar_items] = buf
                    cvar_items
++
                }
            }
        }
        
fclose(fp

Last edited by Crazed; 10-22-2006 at 09:39.
Crazed is offline
SubStream
Veteran Member
Join Date: Aug 2005
Location: USA
Old 10-27-2006 , 22:36   Re: [Update] Client Checker
Reply With Quote #8

Certain CVARS should not be enforced on all clients because some will affect others differently.

If a person wants to enforce CVARS via config file, the client should have the option to accept such changes or decline them as in EKS's CVAR Checker. This allows server owners to choose CVARS and use a config file, but prevents abuse of players by making the changes on them optional.

If the purpose of the CVARS is to even the playing field, and the person wants to force settings upon players, then they should use Force CAL Open Settings [fcos]. This plugin has the option to force players to only play with settings enforced in the CAL Open league. These settings are known by everyone who plays Counter-Strike to be fair and do not affect players negatively.

In my personal opinion, forcing any CVARS other than those known for a fact to be fair is not wise. It may result negatively.

Either way, these two plugins take care of CVARs concerning clients.

As for high ping, Easy to use High Ping Kicker does the job.

I'm not trying to bash this, but the idea of an all encompassing, forcible CVAR plugin is not new and in my opinion leads to admin abuse.

FCOS keeps the playing field level via 79 known tried and true CVAR enforcements--which are 100% reliable, and EKS's CVAR checker can take care of anything else a person wants.

That's just my personal opinion anyhow.
SubStream is offline
Crazed
Member
Join Date: Oct 2006
Old 10-28-2006 , 09:28   Re: [Update] Client Checker
Reply With Quote #9

Well SubStream you got a point with that. But if you rly want to keep your old config you have to set it to read only anyway .. or add all the changes to userconfig.cfg and I think most people already got this.
Crazed is offline
SubStream
Veteran Member
Join Date: Aug 2005
Location: USA
Old 10-28-2006 , 18:53   Re: [Update] Client Checker
Reply With Quote #10

Quote:
Originally Posted by Crazed View Post
Well SubStream you got a point with that. But if you rly want to keep your old config you have to set it to read only anyway .. or add all the changes to userconfig.cfg and I think most people already got this.
FCOS has options to kill, kick, or ban players in addition to a few other options so players who's configs are locked can be kept out of game play regardless of a read-only config or not. Besides read-only config just keeps the config file the same, but it does not keep the value from being changed temporarily while in the server. If they execute their config to override the temporary setting, since its a read-only file and hasn't changed, they would either be killed, kicked, banned or have something else happen to them depending on CVARS settings chosen by the server owner.
SubStream is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 12:50.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode