LBStats
LBStats by aciid
Get player LogBlock data such as first seen, last seen, play time, IP and more
Commands & permissions & config: CLICK HERE
#
BEFORE USING!!!
FIRST MAKE SURE TO EDIT THIS LINE IN LOGBLOCK CONFIG: logPlayerInfo: true
#
LBStats was written as a replacement for the inactive LogBlockStats plugin, the features are effectively the same. The plugin will read the data in your LogBlock MySQL database and provide players/console with simple commands to display the data.
Features include:
- See a players play time
- List x players with the highest play time
- See a players join date
- See a players last played date
- Show player's last recorded IP
- Easily match a player's last recorded ip to other players
- Custom messages with wildcards so compatible with any language!
+ More to come
Changelog:
Quote from LBStats v0.8:YOU MUST REGENERATE (delete) YOUR CONFIG TO UPDATE WITH NEW FEATURES!!
+ Fixed keepalive opening too many connections
+ Added configurable messages in config.yml
+ Added reload command
+ Tweaked some more things
Quote from LBStats v0.7:+ Fixed keepalive opening too many connections (edit: failed)
+ Added ip match command.
+ Parsed IP to display more friendly
+ Tweaked some things
Quote from LBStats v0.6:REGENERATE CONFIG OR ADD THE FOLLOWING LINE:
KeepAlive: 600Added keep alive thread (keepalive value in ticks, will check sql connection at each interval)
+Many small tweaks
Quote from LBStats v0.4:If no name is provided then use command sender's name for lookups
Added even more catches and warning messages for bad commands and exceptions
Changed info command to be uglier but far more stable, saved rewriting a lot of code.
Quote from LBStats v0.3:Added more catches and warning messages for bad commands
Hopefully now schedules sql calls so database lookups should not lag the server
Quote from LBStats v0.2:Added /lbs info <player> to print all information on the player
Tweaked things here and there, fixed typos, etc.
Quote from LBStats v0.1:Created plugin!
please tell me what do i need write in there: SQLHost: - SQLPort: - SQLUsername: - SQLPassword: - SQLDatabase: - KeepAlive: -
@StuckingFoned
I want to show /lbs top 10 on my website... but I haven't got any idea how to get the data from the Database. Could you or somebody else code this in php please?
ps: Sorry for my bad english but I'm form Germany
@Legendrunner
I'll take a look at this plugin tonight or tomorrow, IIRC I also need to touch up on the error messages.
First and foremost: Awesome plugin. I'm really happy with it. Shows exactly what I need to see and also shows the players some nice extra info in their online player hub on our community's website.
One thng though: In-game the command /lbs max shows the time like hh:mm:sshh:mm:s for some reason almost a complete duplicate besides the last second is printed after what should be the end of the line.
@StuckingFoned
sorry, I couldnt find it when i went to the tickets page, thats why i posted it again =/
@John__B
Read my reply to your ticket http://dev.bukkit.org/server-mods/lbstats/tickets/5-logoff-errors/
why am i getting this for "almost" every logoff
<<code>>
2013-01-27 08:32:46 [SEVERE] [Consumer] SQL exception on UPDATE `lb-players` SET onlinetime = onlinetime + TIMESTAMPDIFF(SECOND, lastlogin, FROM_UNIXTIME('1359293564')) WHERE lastlogin > 0 && playerid = 47;:
com.mysql.jdbc.MysqlDataTruncation Data truncation: Incorrect time value: '15361' for column 'onlinetime' at row 1
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3591)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3525)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1986)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2140)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2620)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2570)
at com.mysql.jdbc.StatementImpl.execute(StatementImpl.java:779)
at com.mysql.jdbc.StatementImpl.execute(StatementImpl.java:622)
at de.diddiz.LogBlock.Consumer.run(Consumer.java:300)
at org.bukkit.craftbukkit.v1_4_6.scheduler.CraftTask.run(CraftTask.java:53)
at org.bukkit.craftbukkit.v1_4_6.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:53)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
<</code>>
@StuckingFoned
Awesome man, that's exactly what I needed!
@GnomeffinWay
The player details are stored in a table named "lb-players" containing the following columns in order: playerid, playername, firstlogin, lastlogin, ip, onlinetime
To get playtime I use the following SQL query:
Then you'd need to do the following
@StuckingFoned
Thanks for the quick response. I'm trying to tell what players on my server have been online for 30 hours or more, but seeing as I don't know what tables to access, how to access them, or how to query for the data, getting some assistance with that code would be very much appreciated :P
@GnomeffinWay
I'm not at that point with Java (yet) but you don't actually need an API since lbstats just grabs data from sql which any plugin can access :p I'll provide you with some of the code to do this if you let me know what you need to do exactly
This plugin is very cool; especially given the fact that it utilizes information that you'd think LogBlock would freely give out!
I'm currently interested in hooking into LBStats via an external plugin, just to get players' playtime and whatnot, but I'm having trouble finding an efficient way to access this information by referencing the plugin itself. Are there any hopes for some API or, dare I say, some source code to look at?
I'm sure you have your reasons for operating as you do, but I believe much of the potential for this plugin is lost if the data can only be accessed in command form. All I'd need would be for a simple getTime(String plrName) method or something of the sort to be added in there.
Thanks!
@senotajs
Plugin failed to connect to your sql database.
Make sure you enter the exact same database details as your logblock config has.
It's not the plugin's fault!
how to fix that 01.01 11:08:14 [Server] INFO [LBStats] Disabling LBStats v0.8 01.01 11:08:14 [Server] INFO [LBStats] ERROR CONNECTING TO LOGBLOCK DATABASE! CHECK YOUR CONFIG!
@CubieX
This was my original config though after I wrote it I thought to myself "will make a new connection to the database on every command" sounds more bad than good and also thought opening a new connection would be slower so in the end I just went with 1 connection
ex config:
I'm reading those "keep alive thread" info and I'm wondering, why you are using a permanent connection to the database in a command-driven plugin?
Wouldn't it be more reliable to connect to the DB only, when someone issues a command to lookup a player, querying the data and then close the connection? It should be sufficient to check if the connection is open just before querying. I would keep things as simple as possible. No offence. Just a thought.
Aside from that: Thanks for taking over and maintaining this!
@SwiftSwamp
Because as I've said, this plugin purely reads data recorded by LOGBLOCK and doesn't track anything itself
The plugin http://dev.bukkit.org/server-mods/xray-informer/ can display the total amount of blocks broken so why wouldn't something like this?
@SwiftSwamp
Not unless LogBlock decides to start tracking total blocks broken
Will this ever become like a 'high scores' page of some sort or something to display on a website? Like total blocks destroyed and such.