Raised This Month: $193 Target: $400
 48% 

Force CAL Open Settings [fcos] - v2.9 - 2007-04-06


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   Counter-Strike        Category:   Server Management        Approver:   BAILOPAN (72)
SubStream
Veteran Member
Join Date: Aug 2005
Location: USA
Old 03-23-2006 , 19:26   Force CAL Open Settings [fcos] - v2.9 - 2007-04-06
Reply With Quote #1

Force CAL Open Settings [fcos]

This plugin will force a player's settings when they enter the server to comply with CAL Open required settings (except for the 32-bit video setting). Using an in-game menu, Admin with ADMIN_CVAR access can configure CVARS of this plugin to make it even more useful. In addition, there is a help page for Admin to better understand the options on the menu. To access the menu type amx_fcosmenu in console or type /fcosmenu in chat. From the menu you can enable repeat checking, Admin console notification of changes forced on players, player warning configurations, change name configurations, and other punishment configurations that take affect if a player attempts to change settings back mid-game. To view the fcos menu help page type /fcoshelp in console or chat.

Tested Incompatibility
It should be noted that this plugin is not compatible with people rendering video in Software Mode. If someone enters your server and continually gets kicked, tell them to switch to D3D or Open GL. Any video rendering other than Software Mode is compatible.

CAL RESTRICTED COMMANDS
There are some commands (not settings) that are forbidden by CAL in all CAL matches. I was unable to find a way to block these commands.

These commands include gl_dump, gl_texels, gl_texturemode, stopsound, timerefresh, and viewframe. For various reasons CAL has forbidden these commands from being used during matches. They are not recognized by register_clcmd like commands such as "say" and "say_team" are.

There also some commands/settings listed on the CAL website which showed up as invalid commands or were not compatible with this plugin. These commands include gl_wireframe, r_detailtexturessupported, ex_maxerrordistance, ex_maxspeed, gl_smoothmodels, gl_texsort and gl_zmax. I removed these commands from this plugin because they were either showing up as invalid, had too many Alt Values, or caused an error to occur.

To view the official CAL required settings, please visit the following URL:
CAL URL = ftp://ftp.caleague.com/league_cs/CVAR-list.txt

PROBLEM CVARS
Some of these are intended to improve the "look" of the game. That is why they are enforced in CAL. If a player's computer is slow, these settings will not work for them. I am not sure why, but some player's settings default back to another value automatically after being changed. While changing maps, I experienced this as well. I did not go in console and change the value of the CVARS, rather, the value was changed automatically, which then caused it to be changed to the CAL value again. It had (before version 1.4) caused some other people to time-out because of reliable channel overflow and, on a few occasions, me as well.

The values that these PROBLEM CVARS automatically switch back to will be called "Alt Values" because they are alternative values to the CAL required values. Every player, including me, that had CVAR values automatically changed had the value changed to the same thing. Here is a line copied from my console to serve as an example:
Code:
"Player" changed "r_decals" from illegal value "300.000000" to CAL required value "4096.000000"
Everyone (including me) who had r_decals changed from the CAL Open required value of 4096 all had it changed to Alt Value 300. My computer will not allow me to run r_decals at the CAL Open required value of 4096 consistently. I did not change the value on my own. The value went back to the Alt Value 300 by itself. If it was only me having the CAL Open required value change back to the Alt Value of 300, then I would see no reason to enforce the CVAR at any value because it could essentially be anything, making it useless to enforce. Enforcing Alt Values, at the very least, allows some control of the CVAR to keep it from being any value a person wants. Here is a list of the problem CVARS and their Alt Values:

Video Settings
gl_max_size - sets the maximum texture size
Alt Value: 256

r_decals - Sets the amount of decals that stay on objects to the max amount.
Alt Value: 300

It is possible that some people simply cannot play with CAL required values for these CVARS because their computer's video and/or sound card may not be up to the specifications required to do so. This would explain why these CVARS' values automatically switch back to another value. The bottom line is that CAL required values for these CVARS are simply not possible for all players.

Misc
cl_bob - This has to do with the amount a player bobs up and down while moving. The CAL Open required value for cl_bob is 0.01. When you set cl_bob 0, the plugin had been resetting it to 0.00999, instead of 0.01. To fix this problem, all values between 0.009998 and 0.01 will be Alt Values.

HLGUARD CVARS
I have found that versions 1.7 and below of this plugin are NOT compatible with HLGUARD because HLGUARD enforces a value for one of the CVARS enforced by this plugin.

The CVAR and Value enforced by HLGUARD which is conflicting with the CAL required value in version 1.7 and below is s_min_distance 5. CAL, at that time, only allowed a value of 8 for this CVAR, but now the value of 5 is permitted.

To view HLGUARD forced CVARS, you must download HLGUARD.
HLGUARD URL = http://www.thezproject.org/projects.php?pid=1


Installation
File Locations:
  • .\configs\fcos.cfg
  • .\data\lang\fcos.txt
  • .\data\lang\fcoscfg.txt
  • .\plugins\fcos.amxx
  • .\plugins\fcoscfg.amxx
Admin Commands

amx_fcosmenu - Brings up the FCOS Configuration Menu
say /fcosmenu - Brings up the FCOS Configuration Menu (just type /fcosmenu in chat)
say /fcoshelp - Shows FCOS Menu Help Page (just type /fcoshelp in chat)
/fcoshelp - Shows FCOS Menu Help Page

Plugin CVARS

Note:
It is recommended that you change CVARS using the in-game menu.

By default, all CVARS are set to 0 except for Attempt Number CVARS which are set to 1.

fcos_repeat_check <0|1>
Repeat checking of CVARS
  • 0: Only check CVAR values of players one time when they connect. Player's CVAR values changed mid-game will not be forced back to CAL required settings.
    1: Repeat checking CVAR values continuously while players are connected until they disconnect. Player's CVAR values will be forced back to CAL required settings if changed mid-game.
Note: fcos_repeat_check must be set to 1 for fcos_warn, fcos_change_name, fcos_slay, OR fcos_kick_or_ban to be used.
_________________________________________

fcos_show_admin_forced_msg <0|1>
Show Admin a message via console
  • 0: Do not show Admin a message via console of the changes forced upon players.
    1: Show Admin a message via console of the changes forced upon players.
Note: setting fcos_show_admin_forced_msg to 1 may cause Admin to disconnect due to reliable channel overflow if too many forced changes take place at once causing an overflow of messages in all Admin consoles. This is most common in servers with 20 or more slots or lots of frequenting cheaters with many illegal values. If you have a smaller server or only use this during matches, this shouldn't be a problem unless you come across someone who has every single CVAR set to an illegal value.
_________________________________________

fcos_warn <0|1>
Warn a player for changing settings mid-game.
  • 0: Don't warn a player when they change a setting mid-game.
    1: Warn a player if they change a setting mid-game.
Note: fcos_warn must be set to 1 for fcos_attempt_num_warn or fcos_repeat_warning to be used.
_________________________________________

fcos_attempt_num_warn <ATTEMPT NUMBER>
Number of attempts by a player to change their settings mid-game before a player is warned

Note: fcos_attempt_num_warn must be > 0 to warn a player
_________________________________________

fcos_repeat_warning <0|1>
Repeat Warning
  • 0: Only warn a player once
    1: Repeat warning a player for every attempt after the first warning
    _________________________________________
fcos_change_name <0|1>
Change a player's name
  • 0: Do not change a player's name to when they change a CVAR value mid-game.
    1: Change a player's name to [fcos] CVARNAMECHANGEDHERE when they change a CVAR value mid-game.
Note: fcos_change_name must be set to 1 for fcos_attempt_num_namechange to be used.
_________________________________________

fcos_attempt_num_namechange <0|1>
Number of attempts by a player to change their settings mid-game before a player's name is changed

Note: fcos_attempt_num_namechange must be > 0 to change a player's name
_________________________________________

fcos_slay <0|1>
Slay a player for changing settings mid-game.
  • 0: Don't slay a player when they change a setting mid-game.
    1: Slay a player if they change a setting mid-game.
Note: fcos_slay must be set to 1 for fcos_attempt_num_slay or fcos_repeat_slaying to be used.
_________________________________________

fcos_attempt_num_slay <ATTEMPT NUMBER>
Number of attempts by a player to change their settings mid-game before a player is slayed

Note: fcos_attempt_num_slay must be > 0 to slay a player
_________________________________________

fcos_repeat_slaying <0|1>
Repeat Slaying
  • 0: Only Slay a player once
    1: Repeat Slaying a player for every attempt after the first slaying
    _________________________________________
fcos_kick_or_ban <0|1|2>
Kick Or Ban
  • 0: OFF - Players are not kicked or banned.
    1: Kick a player for changing a CVAR value mid-game.
    2: Ban a player for changing a CVAR value mid-game.
Note: fcos_kick_or_ban must be set to 1 or 2 for fcos_attempt_num_kickorban to be used. fcos_ban_time and fcos_use_amx_bans can only be used when fcos_kick_or_ban is set to 2.
_________________________________________

fcos_attempt_num_kickorban <ATTEMPT NUMBER>
Number of attempts by a player to change their settings mid-game before a player is kicked or banned

Note: fcos_attempt_num_kickorban must be > 0 to kick or ban a player
_________________________________________

fcos_ban_time <Time To Ban>
Time a player is banned for
  • This CVAR should equal the amount of time that you want a player banned. If this equals 0 then the player will be banned permanently.
    _________________________________________
fcos_use_amx_bans <0|1>
Ban method
  • 0: Use rcon command banid.
    1: Use amx_ban (must have the AMX BANS plugin installed)
    _________________________________________
Note: Warning, Name Change, Slaying, and Kick Or Ban only take place if player's change their settings mid-game. Upon entering the server, ALL PLAYERS SETTINGS ARE CHECKED and ALL PLAYERS SETTINGS are forced to CAL required settings. Players will not be punished simply for entering the server with settings that do not comply with CAL required settings. Player's will only be warned, have their name changed, or be punished if they try to change their settings BACK mid-game. So if a player comes in with gl_polyoffset 9999 it will be changed to 0.1. If 5 seconds later they figure out their settings were changed and go in console to change gl_polyoffset back to 9999, that will count as the first mid-game attempt. For every CVAR value they try to change that conflicts with CAL Open required settings, an attempt will be added. When they reach the Attempt Number for an action, that action will be executed. In addition, as long as Repeat Checking is ON, no person will be able to play with non-CAL required settings. Players can go in console and type gl_polyoffset 99999 until they are blue in the face, but every 5 seconds the plugin checks every CVAR value to be sure it equals the CAL required value. If gl_polyoffset does not = 0.1 mid-game, then the plugin forces gl_polyoffset to 0.1 for that player (in addition to adding an attempt to them which may result in warning, name change, or a punishment). I hope this clarifies better how the plugin works.
_________________________________________

Credits/Thanks
Thanks to all the people who helped me at one point or another in the scripting forums. Thanks to Brad and the Sticky in Scripting Help forums about "Good Programming Habits" for providing a model of how good programming is written and organized. I benefited greatly by looking at Brad's style of organization within the forums and his scripting of plugins.

Translations:
  • Curryking - German Translation
  • Doombringer - Swedish Translation
  • *<3* - Danish Translation
  • trawiator and dzek - Polish Translation
  • Janet Jackson - Dutch Translation
  • lubb - Bulgarian Translation
Outside Credit: I used the code from amxx_atac_cfg.sma version 1.1.06 written by f117bomb & T(+)rget as an outline for restrictcommandscfg.sma which I then used as an outline for fcoscfg.sma and give full credit to f117bomb & T(+)rget who wrote amxx_atac_cfg.sma version 1.1.06 for the code I used as an example when writing restrictcommandscfg.sma.
[ATAC] Plugin URL = http://forums.alliedmods.net/showthread.php?p=157579

My idea for this plugin stemmed partly from CVAR Checker written by EKS.
CVAR Checker URL = http://forums.alliedmods.net/showthread.php?t=18377

The other factor for the idea was my desire to have fair scrims in my server against other clans without worrying about their settings. I also use this during regular game play because these settings prevent some wall hacks, as well as other cheats, from working. It also prevents players from viewing tunnels in maps like de_dust and de_dust2 without any shadows whatsoever. In fact, there are CVARS which even brighten the entire map and the tunnel above what is normal, thus allowing players to see farther distances in dark places completely clear and bright. This plugin prevents such cheap, game-play cheats from being possible. At no point is this plugin meant to be used for admin abuse, which is why it does not have an admin immunity CVAR. I believe in playing fair and this plugin enforces it strongly. For this reason, I will not be adding anymore forced settings/commands beyond what CAL has deemed proper; nor will I be adding an outside file to add CVARS in for this plugin because that would make it too easy for people to add their own little tweaks with CVARS which may not be fair to all players. The settings forced by this plugin are enforced in all CAL Open matches. I personally looked into each and everyone one of them to figure out what they did and to understand why CAL requires these settings. After looking into all of them, I see why they enforce these settings. These settings truly do help to make the game fair for everyone.

Plugin History

[2007-04-06] v2.9
  • Updated CAL CVARS and values according to the most recent CAL illegal CVAR list update done in March 2007. This includes the removal of bottomcolor, cl_timeout, r_mirroralpha, s_eax, topcolor, and gl_wateramp. This also includes the added allowed value of gl_polyoffset 4 (CAL now allows 2 values for this CVAR--0.1 and 4). I also rewrote the plugin with a new array model that is more efficient than the first array model I previously used. This array model checks all CVARS in intervals of 0.14 seconds and completes a cycle of checking in under 10.5 seconds. This time is acceptable to me and therefore this array model will be a permanent addition. I recommend all people update to this version as it will remove all possible instances of reliable channel overflow for all clients, run smoother, and take up less CPU. By far this is the most efficient version up to date. In this release, the code size was lowered by another 122 lines. I also changed a few things on the menu to be more consistent with the CVARS.
[2007-01-02] v2.8
  • Updated CAL CVARS and Values according to the most recent CAL illegal CVAR list update done in August 2006. This includes the removal of ex_interp and cl_weather enforcement because I was informed by CAL Admin that there is no CAL required value for these CVARS.
[2006-07-24] v2.7
  • Changed instances of #define macros for strings to new const string variables. Changed instances of format to formatex. Changed instances of cvar natives to pcvar natives. These minor coding changes increase the speed of the plugin significantly and I recommend that people using a lower version update to this version to benefit from this increase in performance.
[2006-05-04] v2.6
  • Renamed a few CVARS. Added attempt options. Integrated all options into a configuration menu. Added a menu help page. Reorganized some of the code.
[2006-04-30] v2.5
  • Added checks and if statement to ensure that no checking would be done after a client has been kicked or banned because amx_bans takes five seconds to ban a player.
[2006-04-28] v2.4
  • Re-wrote the entire plugin from scratch. Did away with the array model as arrays did not check all 79 required CVARS quick enough. Using arrays took 15-20 seconds to cycle through and check and force player's CVAR values that did not comply with CAL Open required settings to values that did comply with CAL Open requirements. This gap of time (15-20 seconds), allowed too big of a window of time for players to cheat. Using individual cases of query_client_cvar allows for simultaneous queries and checking of player's CVAR values against the CAL Open required values and also simultaneous action to change a player's CVAR values to comply with CAL Open requirements (vs. using arrays which must cycle through each CVAR one at a time, checking, forcing, then checking the next CVAR one at a time). So by using individual cases of query_client_cvar, the plugin checks and forces CVARS simultaneously instead of one-by-one, thus resulting in all player's CVARS being checked and changed in under five seconds. All CVARS and SV specialized logging was removed. Alt Values and HLGUARD Values are now automatically accepted. Added new CVARS to change the player's name or punish them. Made re-checking of CVARS after the first time optional for server owners who just want to set the player's settings once. Made the Admin console notification optional. Optimized coding by writing it neater and more concise. File size is nearly the same size as 2.3 even with added features.
[2006-04-20] v2.3
  • Fixed the plugin to work with arrays at 100% proficiency.
[2006-04-20] v2.2
  • Added flag FCVAR_SERVER to CVAR fcos_version.
[2006-04-14] v2.1
  • Removed gl_zmax from the plugin because a third Alt Value of 9999.9999 was found. With three Alt Values it becomes pointless to enforce.
[2006-04-11] v2.0
  • Shortened size 24kb by passing all logging and Admin console notifications to only 4 functions.
[2006-04-09] v1.9
  • Added gf_altfloatvalue for cl_bob.
[2006-04-06] v1.8
  • Added gf_altfloatvalue2 for gl_zmax because it was found to be an Alt Value that was needed as well. Fixed plugin to be compatible with HLGUARD when CVAR fcos_allow_hlguard_values is set to 1. Took out some of the server startup messages to improve the appearance of the plugin. Added client_disconnect function to remove task.
[2006-04-04] v1.7
  • Added FCOS_ to each LANG message to make it more unique. This also means that I had to update the fcos.txt data/lang file so please update this as well with 1.7.
[2006-04-01] v1.6
  • Deleted server_print occurrences found to be redundant after changes made in version 1.5. Changed the first server_print to read from fcos.txt.
[2006-03-30] v1.5
  • Added GNU documentation and server startup message. Awaiting translations before using fcos.txt %L for the server message. Changed all instances of log_to_file to log_amx. All logging will be done to the current AMXx log file and not to a separate log file.
[2006-03-30] v1.4
  • Added CVAR fcos_allow_alt_values which allows Alt Values for Problem CVARS if desired. Added new server messages based upon the fcos_allow_alt_values CVAR. Added sv (Strict Value) messages for logging and Admin notification if fcos_allow_alt_values is set to 0. Added variable gf_altfloatvalue to represent the Alt Values..
[2006-03-28] v1.3
  • Re-named gs_PLUGIN from fcos to Force CAL Open Settings and fixed a few comments to be more consistent with the coding.
[2006-03-28] v1.2
  • Re-named some functions to be more appropriate. Made float values global to shorten length of code. Added ex_interp to the cvar list. Added a notification to all Admin consoles when a player's value is changed for a cvar. Added log file to keep track of what changes were forced on which players.
[2006-03-24] v1.1
  • Fixed if() statements and fn_cvar function parameters. Converted value to floats to properly compare to the CAL value as I found out in 1.0 they did not properly do this.
[2006-03-23] v1.0
  • Initial release.
Attached Files
File Type: sma Get Plugin or Get Source (fcos.sma - 2611 views - 13.7 KB)
File Type: sma Get Plugin or Get Source (fcoscfg.sma - 2343 views - 17.6 KB)
File Type: zip fcos.zip (33.6 KB, 2198 views)

Last edited by SubStream; 07-23-2015 at 20:30. Reason: Incompatibility Notice Update
SubStream is offline
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 03-23-2006 , 19:32  
Reply With Quote #2

You're the first other person to prefix functions with fn other than me.

Anyways, have you tried hooking the commands (I assume stopsound can be an example?) with register_clcmd?

Ex:
Code:
register_clcmd("stopsound","block") //... public fn_block(id)     return PLUGIN_HANDLED
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
SubStream
Veteran Member
Join Date: Aug 2005
Location: USA
Old 03-23-2006 , 19:37  
Reply With Quote #3

Quote:
Originally Posted by Hawk552
You're the first other person to prefix functions with fn other than me.

Anyways, have you tried hooking the commands (I assume stopsound can be an example?) with register_clcmd?

Ex:
Code:
register_clcmd("stopsound","block") //... public fn_block(id)     return PLUGIN_HANDLED
Yes, if you read the first post I state that they can't be hooked like regular commands. I tried every single method I could think of. I spent 3 days straight for 12 hours a day trying to find a way to block those commands. I did absolutely everything I could think of to block them. You can test a script of your own and if you get stopsound or of the other commands I listed blocked let me know; but it will not work by register_clcmd. To make sure it wasn't an error on my end, I replaced stopsound with say, say_team, and other commands and successfully blocked them. I did this to make sure that it was the command that didn't work, and not an error in the code. If you find out how to block those commands let me know. And I use fn because the forum sticky on good programming habits said to look at hungarian page so I did and it made since. After finding out what fn_ meant it is easier to read my own script for me; and I assume it would be easier to read your script as well for me.
SubStream is offline
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 03-23-2006 , 19:45  
Reply With Quote #4

Alright, sounds cool then. Looks like good work. Good job.
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
capndurk
Senior Member
Join Date: Feb 2006
Old 03-23-2006 , 19:48  
Reply With Quote #5

ex_interp isn't a value enforced by CAL-o? Hmm... interesting. But it should be, because it really isn't a fair command to change during a CAL match.

Anyway, nice plugin
capndurk is offline
Jordan
Veteran Member
Join Date: Aug 2005
Old 03-23-2006 , 19:48  
Reply With Quote #6

J/W, what does the fn stand for?
Jordan is offline
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 03-23-2006 , 19:50  
Reply With Quote #7

WOW, after looking at this, the entire thing could probably be shortened to at least 20% the size. You should probably cut down on the size a bit.
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
SubStream
Veteran Member
Join Date: Aug 2005
Location: USA
Old 03-23-2006 , 19:51  
Reply With Quote #8

Quote:
Originally Posted by capndurk
ex_interp isn't a value enforced by CAL-o? Hmm... interesting. But it should be, because it really isn't a fair command to change during a CAL match.

Anyway, nice plugin
I didn't notice that until now. If others request it and a moderator, amxx beta tester, amxx experienced, amxx helper or plugin approver think it should be on there then I will add it. It does help to keep the game fair.
SubStream is offline
SubStream
Veteran Member
Join Date: Aug 2005
Location: USA
Old 03-23-2006 , 19:53  
Reply With Quote #9

Quote:
Originally Posted by ^_^Satan^_^
J/W, what does the fn stand for?
I got the link for Hungarian Notation from the sticky post Good Programming Habits. In the Hungarian Notation it has a list of things that can be used to identify what things are what in a more efficient way.
SubStream is offline
SubStream
Veteran Member
Join Date: Aug 2005
Location: USA
Old 03-23-2006 , 19:54  
Reply With Quote #10

Quote:
Originally Posted by Hawk552
WOW, after looking at this, the entire thing could probably be shortened to at least 20% the size. You should probably cut down on the size a bit.
If you can find a way to shorten the code and still do what it does please let me know how I would go about doing this. I realize it is long, but that is mainly because of how many commands/settings are required.
SubStream is offline
Reply


Thread Tools
Display Modes

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 01:28.


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