View Single Post
Author Message
El Diablo War3Evo
Veteran Member
Join Date: Jun 2013
Old 11-07-2014 , 12:41   [ANY] Admin RegAdminCmd Logging (version 1.3) 10 Nov 2014
Reply With Quote #1

Pretty simple plug-in that hooks all RegAdminCmd commands via their own default flags, and logs every time it is used.

A Sample file name format created by this plugin:

admin_STEAM_0-1-35173666_W3EElDiablo.log

It will put the command between brackets [] and the whole command after the brackets.

It also records the date and time in the log.


Hopefully this plug-in will help you know if any admins are using commands they shouldn't be allowed to use.


When I first created this, I found that I actually have 326 hooked commands! OMG.. 326??? So yeah.. if you check your log file, this plug-in will also tell you how many hooked RegAdminCmds that it has hooked.


Let me know if this plug-in has helped you or if you have any problems or suggestions for it


Changelog

version - description

1.0 - inital

1.1 - bug fixes
- fixed handle leak CommandIterator
- fixed capturing all commands (now only captures admin commands greater than ADMFLAG_RESERVATION)
- now using a while command like PowerLord described
- removed hard coded client name array
- now uses AddCommandListener instead of RegAdminCmd for hooking

1.2 - more bug fixes (24 views)
- includes a IgnoreCommands list which filters commands via ADMFLAG_ROOT check, because for some reason if a command registers via RegConsoleCmd without any flags, it is considered ADMFLAG_ROOT when checked using (flags & ADMFLAG_ROOT)??
- added CheckCommandAccess on callback just for extra security against logging a wrong admin command.

1.3 - If you find a that your "missing" hooked commands, then you may want to download this updated copy. It will allow you to "add" commands. Currently it is setup to "add" war3source commands as an example. Like if the command is war3_givegold, or war3_something.... you can just use "war3" to allow all war3 commands to be included in the hooking of commands.


Known bugs:
- may log some commands that are not assoicated with any flags at all ?? If you find any of these, just add to the IgnoreCommands list inside the sourcecode and recompile.
Attached Files
File Type: sp Get Plugin or Get Source (admin_regadmincmd_logging.sp - 1294 views - 5.4 KB)
__________________

Last edited by El Diablo War3Evo; 11-14-2014 at 20:29. Reason: updated s
El Diablo War3Evo is offline