Donate to the B3 fund!

"even a small donation helps!"
Donate with PayPal!
Most of the plugins here are made by B3 users and the authors may not visit frequently. If you need support for plugins or if questions remain unanswered, you will have to contact the author directly. Read the full Support Disclaimer here

NOTE: Do not attach plugins to your forumtopics! Attachements are periodically removed by maintenance tasks. Upload your plugins to our Downloads section instead!

Author Topic: Logging group_bits  (Read 3006 times)

Offline BlackMamba

  • Moderator
  • Full Member
  • *
  • Posts: 55
    • BlackMamba's Blog
Logging group_bits
« on: October 07, 2010, 04:39:03 PM »
Sometimes I thought it would be nice to know when I gave somebody rights
or when I revoked them. Of course there are a lot of ways to change the
right - ingame, echelon, database directly - which means that it's not enough
to add a logging function to the b3 command !putgroup or to echelon. If you
have mysql 5.0.2 or above it's easy anyway since you can use triggers.

There are two sql files. The first sql file table_create.sql creates a table
group_bits_log where you can see the changes of group_bits in the table
clients. The second file trigger_create.sql creates the triggers, which fill
the table group_bits_log.

Your mysql use must have the right to create new tables and triggers.

Let MYSQLUSER be your mysql user (for example root) and B3DB the database name
of the b3 database.

mysql -u MYSQLUSER -p B3DB < table_create.sql
mysql -u MYSQLUSER -p B3DB < trigger_create.sql

That's all.

If you want to know the group_bits changes of id 42 let's say, just go into
mysql client and type
select * from group_bits_log where client_id = 42 order by time;


(This is not a plugin, so feel free to move this topic where you want. I didn't find a better place.)
« Last Edit: October 30, 2010, 10:18:07 PM by BlackMamba »

Offline grosbedo

  • Former Dev. (senate)
  • Sr. Member
  • *****
  • Posts: 258
Re: Logging group_bits
« Reply #1 on: October 20, 2010, 03:51:44 PM »
Nice addition !

You should add it in the Downloads Misc Files section, here :

I think it can be very useful !

Offline NinjaNife

  • Full Member
  • ***
  • Posts: 80
  • Currently hosting 40+ b3 Bots!!!
    • TheProgressiveClan
Re: Logging group_bits
« Reply #2 on: December 24, 2011, 08:05:32 AM »
I am trying to get this to work, but so far it has not detected any changes I make in-game.  Does this only work for changes made manually in the database, or is it malfunctioning for me?

Brendan West


Rate this page +1 at Google Search