Raised This Month: $51 Target: $400
 12% 

Command Logging with SQL v1.4(Updated 08/02/05)


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   ALL        Category:   Server Management        Approver:   Johnny got his gun (102)
Xanimos
Veteran Member
Join Date: Apr 2005
Location: Florida
Old 07-23-2005 , 22:26   Command Logging with SQL v1.4(Updated 08/02/05)
Reply With Quote #1

This logs all commands done by admins.
Stored in .log file(s) or SQL depending on how you have the cvars/.sma set up.

Required Modules:
<dbi> if using SQL

This is an important update if you were using files instead of SQL.

Code:
/* * * * * * * * * * * * * * *  * Amx Mod X Script *   Command Logging. *                              * Plugin is used to Log all admin commands. * ******************************************* * Created by: $uicid3 V1.4 * * V1.0 - First creation. * V1.1 - Added DB support.(never released) * V1.2 - Added clcmd support. *   - Made SQL more advanced *   - Added example php files. *   - Added blockcmdlist.ini *   - Added Time to logs * V1.3 - Change code for less db calls. *   - Changed blockcmdlist.ini to log_cmdlist.ini *   - Added cvar: amx_cmd_list. *   - Cleaned up code again. Changed so plugin makes less db calls. *   - No longer Logs commands twice. * V1.4 - <font color="red">Fixed Bug in File Log with Steam ID.</font> * * This file is provided as is (no warranties).              * * This file is free software you can redistribute this as * you please. * ******************************************** * Credits: *    Idea/Concept : Everyone on the Forums who has asked for this. * ****************************************** * Cvar: amx_cmd_list * Sets how to use the log_cmdlist.ini file * 0 - Dont use file. (Log all cmds) * 1 - Use as a Block list. (Dont use commands listed in file) * 2 - Use as an Allow list. (Only use commands listed in file) * * Default is 1 ******** If Not using DataBases ****** * Everything gets logged into folder amxmodx/logs/Cmds/ * * Logged according to cvar: amx_cmd_log_file * 0 - One big file * 1 - By Admin Name * 2 - By Admin AuthID * 3 - By Date * 4 - By Map * * Default is 2 ******************************************** * In File Logging according to cvar: amx_cmd_logging * Cvar Value - Example Line: * --------------------------- * 0 - ADMIN [Time of Day] 'Name here' used 'cmd_here all "args here"' * 1 - ADMIN [Time of Day] 'Name here'<STEAM_ID_HERE> used 'cmd_here all "args here"' * 2 - ADMIN [Time of Day] 'Name here' used Cmd 'cmd_here' with args 'all "args here"' * 3 - ADMIN [Time of Day] 'Name here'<STEAM_ID_HERE> used Cmd 'cmd_here' with args 'all "args here"' * * Default is 3 ***** If using DataBases ******** * Just load plugin and change map. Everything will be done for you. * * Sql variables read out of amxmodx/configs/sql.cfg * * If any errors occur while using SQL it stops logging so you dont get the error for every command used. ;p ********************************************/ //Uncomment to use SQL //#define SQL_MODE

You NEED to have the directory amxmodx/logs/Cmds/ if not the plugin wont log the command and the commands dont work.
You need to have a log_cmdlist.ini. I Highly recommend using it. Which ever way you want as long as its there.

Please Note: A new cvar has been added. With regards to log_cmdlist.ini

I have included example PHP read-out pages. Feel free to use them or just use as a reference to make your own.

There is more information in the ReadMe files in the zip.
Attached Files
File Type: sma Get Plugin or Get Source (command_logger.sma - 3011 views - 8.9 KB)
File Type: zip command_logger_v1.4.zip (10.7 KB, 1722 views)
Xanimos is offline
Send a message via AIM to Xanimos Send a message via MSN to Xanimos
Damocles
Member
Join Date: Jan 2005
Old 07-24-2005 , 08:03  
Reply With Quote #2

Good work suicide, see my post in the requests section about DB support....

Another point to ask.

Hows this going to work in terms of creating new files. If i set the logging format to date, i take it it will create a new file when a 'new' day begins?

Also what happens if the server goes down? Will it resume the file from the last entered data, create a new file or use the same file and just overwrite all the existing data?
Damocles is offline
Xanimos
Veteran Member
Join Date: Apr 2005
Location: Florida
Old 07-24-2005 , 11:34  
Reply With Quote #3

Q:Hows this going to work in terms of creating new files. If i set the logging format to date, i take it it will create a new file when a 'new' day begins?
A: Yes. But it will log by the date that the server has.

Q:Also what happens if the server goes down? Will it resume the file from the last entered data, create a new file or use the same file and just overwrite all the existing data?
A: If the server goes down. If you mean not by having to rebuild it from scratch. It wont rewrite any data.But if you have to rebuild it then the previous files would have been deleted.

Q: Can you make it support DB?
A: Yes I will work on that. It will take a little longer but it will be done by the end of the week. Hopefully.
Xanimos is offline
Send a message via AIM to Xanimos Send a message via MSN to Xanimos
XxKpAznGuyxX
Senior Member
Join Date: Dec 2004
Location: EARTH!!
Old 07-25-2005 , 11:10  
Reply With Quote #4

Nice plugin.. but one problem, everytime when it logs texts it seems to like duplicate the text. Its only the Text it doesn't duplicate the command or anything else but the Text hope you can fix it, not a big problem.
__________________
24/7 Chicago Terror-8.9.2.120:27015
XxKpAznGuyxX is offline
Send a message via AIM to XxKpAznGuyxX Send a message via MSN to XxKpAznGuyxX
Xanimos
Veteran Member
Join Date: Apr 2005
Location: Florida
Old 07-25-2005 , 11:34  
Reply With Quote #5

give me an example of the text that duplicates...and give me your cvar values.

[EDIT] Ill just fix this in the next release. Almost done with the sql.
Xanimos is offline
Send a message via AIM to Xanimos Send a message via MSN to Xanimos
XxKpAznGuyxX
Senior Member
Join Date: Dec 2004
Location: EARTH!!
Old 07-25-2005 , 17:27  
Reply With Quote #6

I will post just incase.

ADMIN 'Carlos Oliveria'<STEAM_0:0:523371> used Command 'say' with Args '"=P"'
ADMIN 'Carlos Oliveria'<STEAM_0:0:523371> used Command 'say' with Args '"=P"'
ADMIN 'Carlos Oliveria'<STEAM_0:0:523371> used Command 'say' with Args '" 2 shots and yer dead"'
ADMIN 'Carlos Oliveria'<STEAM_0:0:523371> used Command 'say' with Args '" 2 shots and yer dead"'
ADMIN 'Carlos Oliveria'<STEAM_0:0:523371> used Command 'say' with Args '"lol shitty ass auto sniper"'
ADMIN 'Carlos Oliveria'<STEAM_0:0:523371> used Command 'say' with Args '"lol shitty ass auto sniper"'
ADMIN 'Carlos Oliveria'<STEAM_0:0:523371> used Command 'say_team' with Args '"pit"'
ADMIN 'Carlos Oliveria'<STEAM_0:0:523371> used Command 'say_team' with Args '"pit"'

I am using the default cvars.
__________________
24/7 Chicago Terror-8.9.2.120:27015
XxKpAznGuyxX is offline
Send a message via AIM to XxKpAznGuyxX Send a message via MSN to XxKpAznGuyxX
WaZZeR++
Veteran Member
Join Date: Mar 2005
Location: Sweden
Old 07-25-2005 , 18:38  
Reply With Quote #7

i think the command is send 2 times, it looks like that if you look in the console....
and i dont think it's supose to log say commands, but i think it take it as amx_say or something...
WaZZeR++ is offline
Send a message via MSN to WaZZeR++
XxKpAznGuyxX
Senior Member
Join Date: Dec 2004
Location: EARTH!!
Old 07-25-2005 , 18:43  
Reply With Quote #8

yes it suppose to do that.. ADMIN 'Name here'<STEAM_ID_HERE> used Cmd 'cmd_here' with args 'all "args here"'

and say is a command...
__________________
24/7 Chicago Terror-8.9.2.120:27015
XxKpAznGuyxX is offline
Send a message via AIM to XxKpAznGuyxX Send a message via MSN to XxKpAznGuyxX
Xanimos
Veteran Member
Join Date: Apr 2005
Location: Florida
Old 07-25-2005 , 22:47  
Reply With Quote #9

The only way it does that is if you have a plugin that hooks say using admin levels like:
register_concmd("say","hooksay",ADMIN_KICK)
so if you have a plugin like that you can change it if you want...but i will block it from saying someone used say or say_team hardcoded so this wont be a problem. The next releaes will be out tomarrow it suppors register_clcmd now and SQL.
Xanimos is offline
Send a message via AIM to Xanimos Send a message via MSN to Xanimos
Xanimos
Veteran Member
Join Date: Apr 2005
Location: Florida
Old 07-26-2005 , 17:29  
Reply With Quote #10

Update: I got the SQL working and running still testing. Ive blocked the use of say and say_team showing as command logs. And now im just putting finishing touches on the plugin and adding a blockcommand.ini...any command you have in there wont be used.

These are two pics of my example read-out pages.
The first one shows all commands done by all admins with a search feature and a sort by feature with all read-outs links to show only the specific cmd or name...which is the second pic, having a sort by feature on it as well.

and
Xanimos is offline
Send a message via AIM to Xanimos Send a message via MSN to Xanimos
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 11:22.


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