chatlogger plugin for Big Brother Bot (www.bigbrotherbot.net)
By Courgette
This plugin logs to database and/or file all clients' messages (chat, team chat, private chat). Forum : http://www.bigbrotherbot.com/forums/index.php?topic=423
- copy chatlogger.py into
b3/extplugins
- copy plugin_chatlogger.ini into into your config directory
- create the chatlog table in your database importing the
chatlogger.sql
file. - update your main b3 config file with :
<plugin name="chatlogger" config="@conf/plugin_chatlogger.ini"/>
NOTE : if you are using the censor plugin, make sure the chatlogger plugin is loaded before the censor plugin or you won't log any messages containing censored words.
- manage say, teamsay and privatesay messages
- fix security issue with player names or messages containing double quote or antislash characters (Thx to Anubis for report and tests)
- option to setup a daily purge of old messages to keep your database size reasonable
- in config, the hour defined for the purge is now understood in the timezone defined in the main B3 config file (before, was understood as UTC time)
- fix mistake in log text
- added missing 'import b3.timezones'
- allow to use a customized table name for storing the log to database. Usefull if multiple instances of the bot share the same database. Thanks to Eire.32 for bringing up the idea and testing.
- update the sql script to use the utf8 charset
- can log to a file instead of logging to db (or both)
- requires B3 1.6+
- log commands to db
- refactoring to reduce code duplication
- better test coverage
- update authors credit
- start without failure even if the plugin is loaded before the admin plugin
- do not fail to handle SQLite database errors
- fixes #2 : Error DELETE FROM cmdlog WHERE msg_time (thanks to Mariodu62)
- add new setting max_age_cmd
- now also log events EVT_CLIENT_RADIO, EVT_CLIENT_CALLVOTE and EVT_CLIENT_VOTE when available
- gracefully fallback on default values when part of the config is missing
- plugin config file is now a .ini file
- can now save SQUAD chat (for games that have squads)
- UPGRADE NOTE: run the
upgrade_1.4.sql
script on your MySQL database