You are here: Big Brother Bot ForumAdd-OnsEchelonCommands Log
Pages: [1]   Go Down
  Print  
Author Topic: Commands Log  (Read 507 times) Bookmark and Share
Jr. Member
**
OS: --No B3 installed--
Type: Renting Server with B3
Gameservers: cod4
Posts: 21
Offline Offline
« on: August 30, 2011, 03:40:30 PM »

had a look around the forum but havent really looked into yet myself.
Is there a way to display/log commands used,
 chatlog easily shows commands in a different colour but is there a way to have the commands in a seperate list/table,
and a way to show most popular or commands used by a client, in the same way the last chat messags are displayed under a client.

Just a thought as i believe it would be helpful for moderating immature admins,
and generally seeing what people like to use most, what needs to be developed on.

as always thanks in advance for any replys/information.
Logged

Support Hero
*
OS: Windows
Type: Gameserver Rental Co.
Gameservers: 2x CoD4, 1x BF3
Posts: 2625
Offline Offline
Owner of Host4B3.com - Over 70 bots hosted!
WWW
« Reply #1 on: August 30, 2011, 05:57:09 PM »

Well, echelon 2 has a admin action table, so when visiting a client you can see what he used and when... echelon 2 is in beta though and has broken things...

Aside from that, you could use a .sql query (you would have to make it though) to soft through the database.
Logged

Need B3 Bot hosting? Check out Host4B3.com
Check Twitter.com/Host4B3 for updates if the site it down.

Help will be given to those with a b3.log

System: Python 2.7.1 - B3 Source Code - Locally hosted MySQL & Apache - Win 2k3
Full Member
***
OS: Linux
Type: Owner dedicated server(s)
Gameservers: UrT
Posts: 55
Offline Offline
WWW
« Reply #2 on: August 31, 2011, 12:03:25 AM »

Here is a sql statement to show kill and ban statistics:
http://www.bmamba.de/?p=221
Logged

Jr. Member
**
OS: --No B3 installed--
Type: Renting Server with B3
Gameservers: cod4
Posts: 21
Offline Offline
« Reply #3 on: August 31, 2011, 06:35:54 AM »

Thank you for you replys.
The code you provided will be useful i have no doubt.
I was more looking for all commands used as well as how many times
So a table could be created saying client name, commands used, how many times used,
and then possibly broken down on the clients page underneath last chat messages, last commands used, to clearly display when a command was used and the full criteria whilst using the command.

I did a simple query to find instances when '!' was used this was just to gauge an idea of what needs looking at next, using this:

SELECT *  FROM `chatlog`
WHERE (`msg` LIKE '!%')
ORDER BY `chatlog`.`client_name` ASC

Now working on building upon that to filter out things like !! or ! followed by a space.
I would require some knowledge as to how to go about adding this in a form transferable to a table layout on echelon as described above,
or am i barking up the wrong tree and should try just making a new plugin similar to chatlog which only logs commands, and thn be able to transfer to echelon in a similar way.
ooor
am i just trying to do things that are already being developed in echelon 2 and should hold on until a stable relitivly bug free version is released and see what possibilities have been unlocked?

Sorry for asking for so much, I understand that what im asking may not be all that clear and maybe very far fetched.
I'm fairly new to coding therefore also fairly new to B3 and its workings,
but find it interesting when you have an idea like this and how to overcome the smallest of issues.

as always thanks for taking the time to read and thank you in advance for any replys.
Logged
Senior Dev.
*
OS: Linux
Type: Home user
Posts: 3483
Offline Offline
WWW
Support Specialty: B3-Core, UrT/SmG/BFBC2 parsers, Plugin development
« Reply #4 on: August 31, 2011, 11:27:02 AM »

... a new plugin similar to chatlog which only logs commands

If you want to try that one, then make your plugin listen for the EVT_ADMIN_COMMAND event which is raised by the admin plugin whenever a command is issued. This event is associated to data which is a tuple composed of : (command, data, results).

I guess this could be easily added to the actual chatlogger plugin. If you have the time and feel comfortable, please do so and provide me with a patch. I'll be glad to release a new version of the chatlogger plugin with your changes.
Logged

Jr. Member
**
OS: --No B3 installed--
Type: Renting Server with B3
Gameservers: cod4
Posts: 21
Offline Offline
« Reply #5 on: September 01, 2011, 05:41:29 AM »

If you want to try that one, then make your plugin listen for the EVT_ADMIN_COMMAND event which is raised by the admin plugin whenever a command is issued.
Excelant idea, forgot about the tpe of events i could use
Thanks buddy i will take a look and see what damage i can do.
Logged
Full Member
***
OS: Linux
Type: Owner dedicated server(s)
Gameservers: UrT
Posts: 55
Offline Offline
WWW
« Reply #6 on: September 01, 2011, 10:12:45 AM »

I added some code to chatlogger. Now the plugin logs commands to the database. I added a pull request if you want to add the code, courgette.

(https://github.com/bmamba/b3-plugin-chatlogger)
Logged

Senior Dev.
*
OS: Linux
Type: Home user
Posts: 3483
Offline Offline
WWW
Support Specialty: B3-Core, UrT/SmG/BFBC2 parsers, Plugin development
« Reply #7 on: September 01, 2011, 12:11:05 PM »

Thanks BlackMamba. I've released v1.1.1 of the chatlogger plugin which integrates your changes.
Logged

Jr. Member
**
OS: --No B3 installed--
Type: Renting Server with B3
Gameservers: cod4
Posts: 21
Offline Offline
« Reply #8 on: September 02, 2011, 08:02:06 AM »

Thanks BlackMamba. I've released v1.1.1 of the chatlogger plugin which integrates your changes.
Installed and tested on server.
unfortunatly came up with error when trying to log, this is in short whwat it said.
Code:
110902 16:54:44 ERROR handler ChatloggerPlugin could not handle event Say: NameError: global name 'MySQLdb' is not defined [(\\b3\\extplugins\\chatlogger.py', 303, '_save2db', 'except MySQLdb.ProgrammingError, e:')]

line 303 of chatlogger.py is as follows
Code:
       except MySQLdb.ProgrammingError, e:

how this is relavant
Code:
   def _save2db(self, data):
        q = self._insertquery()
        try:
            cursor = self.plugin.console.storage.query(q, data)
            if (cursor.rowcount > 0):
                self.plugin.debug("rowcount: %s, id:%s" % (cursor.rowcount, cursor.lastrowid))
            else:
                self.plugin.warning("inserting into %s failed" % self._table)
        except MySQLdb.ProgrammingError, e:
            if e[0] == 1146:
                self.plugin.error("Could not save to database : %s" % e[1])
                self.plugin.info("Refer to this plugin readme file for instruction on how to create the required tables")
            else:
                self.plugin.error("Could not save to database : %s" % e)

Any ideas?
Is it relevant that i am running B3 v1.5?
« Last Edit: September 02, 2011, 08:42:48 AM by KaGDeadz » Logged
Support Hero
*
OS: Windows
Type: Gameserver Rental Co.
Gameservers: 2x CoD4, 1x BF3
Posts: 2625
Offline Offline
Owner of Host4B3.com - Over 70 bots hosted!
WWW
« Reply #9 on: September 02, 2011, 09:49:35 AM »


Is it relevant that i am running B3 v1.5?

I thought chatlogger 1.0 and up need b3 1.6.1 and up?
Logged

Need B3 Bot hosting? Check out Host4B3.com
Check Twitter.com/Host4B3 for updates if the site it down.

Help will be given to those with a b3.log

System: Python 2.7.1 - B3 Source Code - Locally hosted MySQL & Apache - Win 2k3
Full Member
***
OS: Linux
Type: Owner dedicated server(s)
Gameservers: UrT
Posts: 55
Offline Offline
WWW
« Reply #10 on: September 02, 2011, 11:10:55 AM »

Did you create the table cmdlog (see chatlogger.sql)? Could you paste the whole log file?
Logged

Tags:
Pages: [1]   Go Up
  Print  
 
Jump to:  


Rate this page +1 at Google Search


SimplePortal 2.3.1 © 2008-2009, SimplePortal