Raised This Month: $89 Target: $400
 22% 

[ANY] !COMMAND eater


Post New Thread Reply   
 
Thread Tools Display Modes
Author
Dragokas
Veteran Member
Join Date: Nov 2017
Location: Ukraine on fire
Plugin ID:
6809
Plugin Version:
1.18
Plugin Category:
All
Plugin Game:
Any
Plugin Dependencies:
    Servers with this Plugin:
    9 
    Plugin Description:
    Allows to accept commands entered in chat in uppercase or cyrillic
    Old 11-17-2019 , 20:22   [ANY] !COMMAND eater
    Reply With Quote #1

    Description:
    Allows to accept commands entered in chat in uppercase, without key trigger or in cyrillic (by accident).

    Supported both, chat and console commands.

    Examples:
    Quote:
    !ADMIN
    /ADmin
    !ФВЬШТ
    /фвьшт
    sm_ADMIn
    !SM_Admin
    .ADMIN
    ADMIN
    админ
    Also, plugin allows you to log unknown commands. Location: logs/cmd_unknown.log

    Note: Since SourceMod v1.11.0.6725 this plugin is not much useful for English only servers, because it is already include case insensitive fix for chat commands (Pull #1542).

    Notice for ALL:
    "Eat" != does not mean "Hide". If you need to hide your entered command, set sm_eater_nokey_silent ConVar to 1 - this only applied to command entered without ! or / prefix.

    If you want to hide really ALL commands (even those entered with ! prefix), set up your addons/sourcemod/configs/core.cfg file such a way:
    PHP Code:
    "PublicChatTrigger"        ""
    "SilentChatTrigger"        "/!" 
    then set sm_eater_nokey_silent ConVar to 1 and reboot the server.
    Settings (ConVars):
    Located at: cfg/sourcemod/sm_command_eater.cfg:
    PHP Code:
    // Enable plugin? (1 - Yes / 0 - No)
    sm_eater_enable "1"

    // Do you want to log not recognized commands? (1 - Yes / 0 - No)
    sm_eater_unknown_logging "1"

    // Do you want ability to enter commands without prepending key trigger? (1 - Yes / 0 - No)
    sm_eater_nokey_allow "1"

    // Commands entered without key trigger should be silent? (1 - Yes / 0 - No)
    sm_eater_nokey_silent "0"

    // Minimum allowed length of command entered without key trigger
    sm_eater_nokey_minlength "2" 

    // Enable 'eating' commands entered in console? (1 - Yes / 0 - No)
    sm_eater_eat_console "1"

    // Do we need handle cyrillic letters? (1 - Yes / 0 - No)
    sm_eater_eat_cyrillic "1"

    // Allow to substitute English analogues for Russian letters, e.g. админ -> admin (1 - Yes / 0 - No)
    sm_eater_transliteration "1"

    // Ignore chat processor and intercept 'say' command instead? (1 - Yes / 0 - No)
    sm_eater_ignore_chat_proc "0"

    // Check commands of dynamically loaded plugins. Causes less gaps, but more CPU loading! (1 - Yes / 0 - No)
    sm_eater_track_dyn_load "1" 
    in source code (.sp):
    PHP Code:
    // set to 1 and recompile plugin if you faced with some problems and you need to provide logs for developer (will be saved to "logs/cmd_eater_debug.log")
    #define DEBUG 0

    // set to 0 if want to try compile with CCP support (ccprocessor.inc); only old versions of CCP will compile.
    #define _ccprocessor_disable 1" to 0. 
    Commands:
    PHP Code:
    // Refresh the list of commands. It is recommended to use it in Map Config plugins which dynamically load/unload other plugins
    sm_eater_refresh 
    * For a more elegant and automatic implementation, I am awaiting a solution / implementation from SourceMod team of at least one of these Issues: #1480, #1481, (#890 + #1482)
    Credits:
    - SilverShot - for "Commands enumerator" code and SMC Parser and profiler examples.
    - hmmmmm - for solution to my new debug code style.
    - Ilusion9 - for suggestion the correct replicating of GetCmdReplySource.
    - Bacardi - for suggesting me ReadCommandIterator() to differentiate sm commands.
    - Balimbanana - for suggesting me OnClientCommand() to catch unrecognized console commands.
    Supported:
    - Chat processor by Drixevel: https://github.com/Drixevel/Chat-Processor
    - Simple Chat Processor (Redux) by Mini (minimoney1): https://forums.alliedmods.net/showthread.php?t=198501
    - (support suspended) Color Chat Processor by nullent?: https://github.com/rej-clown/ccprocessor
    - or without chat processor at all (color tags will not be processed in that case).
    Compatiblity:
    - Minimum supported SM v.1.9
    - Recommended SM v.1.11.0.6541+ (crash free)
    Notes:
    1. If you receive false positives, you have such options:
    - increase minimal length of handled commands entered without key trigger !/ see "sm_eater_nokey_minlength" ConVar
    - disable handling commands entered without key trigger !/ see "sm_eater_nokey_allow" ConVar
    - add concrete command to exclude list - add it in file - data/sm_eater_exclude.txt (each command on separate line),
    e.g. sm_lf will prevent replacing "да" with sm_lf (if it would exist on your server).
    - disable handling cyrillic transliteration at all (in case you have no users with Russian keyboard on your server), see "sm_eater_eat_cyrillic" ConVar.

    2. If you receive chat commands flood in console, you have such options:
    - update your Chat Processor to the latest version
    - disable interaction with Chat Processor by set "sm_eater_ignore_chat_proc" ConVar to 1.
    Related plugins:
    - [ANY] [RU] Message Filter (Censor)
    Donate
    Donates are very appreciated and welcomed for further inspiration, make me happy, and make next updates came out more often:
    - Patreon (Paypal)
    - BitCoin
    - Ю.Money
    Attached Files
    File Type: zip CommandEater.zip (98.3 KB, 185 views)
    __________________
    Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch & FreeZone)
    [My plugins] [My tools] [GitHub] [Articles] [HiJackThis+] [Donate]

    Last edited by Dragokas; 07-09-2022 at 15:14.
    Dragokas is offline
    Dragokas
    Veteran Member
    Join Date: Nov 2017
    Location: Ukraine on fire
    Old 12-19-2019 , 22:04   Re: [ANY] !COMMAND eater
    Reply With Quote #2

    Updated.

    Quote:
    1.1 (20-Nov-2019)
    - Added ability to log unknown commands to logs/cmd_unknown.log (identical commands will not be repeated in log)

    1.2 (20-Dec-2019)
    - Fixed bug: color tag is not parsed
    - Added ability to remove <chat-processor> dependency with reduced functionality (by SilverShot request).
    To make so, change #define USE_CHAT_PROCESSOR to 0 and recompile the plugin.
    __________________
    Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch & FreeZone)
    [My plugins] [My tools] [GitHub] [Articles] [HiJackThis+] [Donate]
    Dragokas is offline
    Dragokas
    Veteran Member
    Join Date: Nov 2017
    Location: Ukraine on fire
    Old 12-28-2019 , 19:34   Re: [ANY] !COMMAND eater
    Reply With Quote #3

    Updated.

    Quote:
    1.4 (28-Dec-2019)
    - (dot) .command is now alias to /command, so you can write commands beginning with . (dot)
    - Added "sm_eater_nokey_allow" ConVar - ability to enter commands without prepending key trigger at all, e.g. ADMIN, not !ADMIN (1 - Enable, 0 - Disable, for better performance).
    - Added "sm_eater_nokey_silent" ConVar - Commands entered without key trigger should be silent? (1 - Yes / 0 - No).
    - "sm_unknown_logging" ConVar is renamed to "sm_eater_unknown_logging" to follow naming convention better.
    - Added "Simple Chat Processor (Redux)" support. No need to re-compile the plugin. Processor is detected automatically.
    Note: remove chat-processor.smx from server if you don't use it anymore.
    - Chat processors are stored now in separate "Chat_Processors" folder (use it just in emergency case, e.g. when source code is lost or new version break compatibility...).
    - Fixed color tag bug caused by dependency on plugins load order.
    - potential fix: multiple starting color tags are supported now.
    - unknown command is logged now without normalization, exactly same as it was written by user.
    - in case some problems still persist, you can enable extended debug by #define DEBUG 1 (will be written in "logs/cmd_eater_debug.log")
    __________________
    Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch & FreeZone)
    [My plugins] [My tools] [GitHub] [Articles] [HiJackThis+] [Donate]
    Dragokas is offline
    Dragokas
    Veteran Member
    Join Date: Nov 2017
    Location: Ukraine on fire
    Old 02-15-2020 , 05:59   Re: [ANY] !COMMAND eater
    Reply With Quote #4

    Updated.

    Quote:
    1.6 (12-Feb-2020)

    Features:
    - Added support for !sm_ /sm_ sm_ prefixes entered in chat, including misprinted (wrong letter case and cyrillic).
    - Added "sm_eater_enable" ConVar - to disable plugin in runtime (just in case).
    - Added "sm_eater_eat_cyrillic" ConVar instead of "#define EAT_CYRILLIC".
    - Added "sm_eater_nokey_minlength" ConVar to decrease false positives.
    You can define here minimal length of command (entered without key trigger "!","/") allowed to be handled by "eater". By default: 2.

    - added commands exclusion file: "addons/sourcemod/data/sm_eater_exclude.txt":
    enter each command on the new line you may want to exclude from handling by this plugin to prevent false positives.

    - now, unknown commands are not checked for duplicates anymore (useless thing). Instead, player name, steamid, country, ip are prepended in log.
    - "eater" is now handling ALL in-game commands, registered with sm_ and without. However, YOU can "misprint" them using any variant.

    Other:
    - New dependency: <geoip>
    - RegConsoleCmd() replaced by AddCommandListener() to handle it in correct way and order.
    - Fixed missing CloseHandle of commands enumerator (not critical).
    - Fixed missing ConVar version notify flag.
    - fixed cmd-arg parser is not worked properly with multiple tags of color specified.
    - Added additional check preventing "say" / "say_team" commands to be registered twice.
    - Some simplifications and optimizations:
    * thanks to hmmmmm for helping with my new debug code style.
    * thanks to SilverShot for profiler sample.

    1.7 (15-Feb-2020)
    - FakeClientCommand() is replaced by -Ex variant to prevent beeing networked and fix further issues with some recurse reported.
    __________________
    Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch & FreeZone)
    [My plugins] [My tools] [GitHub] [Articles] [HiJackThis+] [Donate]
    Dragokas is offline
    Psyk0tik
    Veteran Member
    Join Date: May 2012
    Location: Homeless
    Old 02-15-2020 , 06:13   Re: [ANY] !COMMAND eater
    Reply With Quote #5

    PHP Code:
    if ( !(sLine[0] == 's' && sLine[1] == 'm' && sLine[2] == '_') ) // Line 284 
    Why not just use strncmp to check if the first 3 characters contain "sm_"?

    PHP Code:
    if ( strncmpsLine"sm_"3false ) != // This also allows you to ignore case sensitivity. 
    Same with:

    PHP Code:
    if ( !(name[0] == 's' && name[1] == 'm' && name[2] == '_') ) // Line 313 
    __________________

    Last edited by Psyk0tik; 02-15-2020 at 06:16.
    Psyk0tik is offline
    Dragokas
    Veteran Member
    Join Date: Nov 2017
    Location: Ukraine on fire
    Old 02-15-2020 , 06:20   Re: [ANY] !COMMAND eater
    Reply With Quote #6

    Yea, make sense. Thanks.
    __________________
    Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch & FreeZone)
    [My plugins] [My tools] [GitHub] [Articles] [HiJackThis+] [Donate]
    Dragokas is offline
    Dragokas
    Veteran Member
    Join Date: Nov 2017
    Location: Ukraine on fire
    Old 02-16-2020 , 04:42   Re: [ANY] !COMMAND eater
    Reply With Quote #7

    Updated.

    Quote:
    1.8 (16-Feb-2020)
    - Some optimizations (thanks to Crasher for remark).
    - Replicate GetCmdReplySource() to allow plugins understand that command came from chat (thanks to Ilusion9 for solution).
    - appended some debugging code.
    - fixed some mistakes with "." prefix trigger.
    P.S. If you need to add other languages mistakes support, tell me.
    __________________
    Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch & FreeZone)
    [My plugins] [My tools] [GitHub] [Articles] [HiJackThis+] [Donate]

    Last edited by Dragokas; 02-16-2020 at 04:43.
    Dragokas is offline
    Dragokas
    Veteran Member
    Join Date: Nov 2017
    Location: Ukraine on fire
    Old 02-17-2020 , 04:04   Re: [ANY] !COMMAND eater
    Reply With Quote #8

    Updated.

    Quote:
    1.9 (17-Feb-2020)
    - prevented very strange bug with chat procesor when he duplicates forward calling multiple times (skip flood coming < 300 ms.).
    - Added "sm_eater_ignore_chat_proc" ConVar - set 1 if you want ignore handling messages coming from chat processor and use 'say' hook instead (just in case some problems still persists).
    __________________
    Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch & FreeZone)
    [My plugins] [My tools] [GitHub] [Articles] [HiJackThis+] [Donate]
    Dragokas is offline
    Dragokas
    Veteran Member
    Join Date: Nov 2017
    Location: Ukraine on fire
    Old 02-18-2020 , 08:57   Re: [ANY] !COMMAND eater
    Reply With Quote #9

    Updated.
    Quote:
    1.11 (18-Feb-2020)
    - Added support for multiple (or empty) defined chat triggers in core.cfg.
    - Fixed "sm_eater_nokey_minlength" ConVar incorrectly handled when calculated multi-byte characters.
    __________________
    Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch & FreeZone)
    [My plugins] [My tools] [GitHub] [Articles] [HiJackThis+] [Donate]

    Last edited by Dragokas; 02-18-2020 at 08:57.
    Dragokas is offline
    Dragokas
    Veteran Member
    Join Date: Nov 2017
    Location: Ukraine on fire
    Old 04-26-2020 , 14:01   Re: [ANY] !COMMAND eater
    Reply With Quote #10

    Updated.

    Quote:
    1.12 (20-Apr-2020)
    - Added a little delay before loading list of commands to support one loaded with a frame delay or so.
    - Added reloading command list on map start to support commands registered with late loaded plugins.

    1.13 (26-Apr-2020)
    - Fixed false positives for default game commands, like "bind" when they are entered in chat (thanks for help to Bacardi).
    - Added ability to "eat" console commands (thanks for help to Balimbanana):
    * New ConVar added "sm_eater_eat_console" - default: 1 - to enable "eating" commands entered in console.
    - Added ability of reverse Russian transliteration (like replacing "шоп" => "shop", "админ" => "admin" ):
    * New ConVar added "sm_eater_transliteration" - default: 1 - allow to substitute English analogues for Russian letters.
    Also, if you are using Chat processor by Keith Warren (Shaders Allen),
    I'd suggest to update it to a version from my fork, not yet included in basic branch: https://github.com/dragokas/Chat-Processor
    to fix message color problem.
    __________________
    Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch & FreeZone)
    [My plugins] [My tools] [GitHub] [Articles] [HiJackThis+] [Donate]
    Dragokas 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 00:57.


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