Playerstats
Playerstats - Track player stats like, IP, Last seen, First seen
Version: v1.9
ALL NEW VERSION OF PLAYERSTATS!!! NOW IT ACTUALLY WORKS!!!
This is a simple plugin designed to track player statistics to help with admin work. It records players individual data and allows it to be called up in game with commands.. It is my first plugin with permissions support that I have released.
Features:
Logs First and Last seen
Logs IP
Logs last position when the player logged out
Logs how many times the player has logged in to the server
Custom first join messages with colour support!! (now also standard MC colours are available)
Tells the user what the error is if the log doesn't have the required information
Uses Bukkit Permissions!!
Simple command structure!
Console support!
/ps info <name> is now /ps report <name>
Commands:
Quote:/pstats or /playerstats - Commands can be prefixed with either of these, but i will be using /ps in the command description for simplicity. This command just brings up a chat message with the Plugin name, version and author
/pstats ? - Displays in game help.
/pstats firstseen <name> - Displays the first seen data for the player <name>
/pstats lastseen <name> - Displays the last seen data for the player <name>
/pstats seen <name> - Displays the first and last seen data for the player <name>
/pstats seen <name> - Displays the first and last seen data for the player <name>
/pstats ip <name> - Displays the IP address of the player <name>
/pstats lastpos <name> - Displays the last position of the player <name>
/pstats playtime <name> - How long they have actually played (online) on the server.
/pstats activity <name> - Shows as a percentage how active they are (Playtime/Total Time)
/pstats totaltime <name> - Displays the time the player has been on the server (Time from first seen to last seen, not play time)
/pstats flag - Shows the help for the /ps flag <name> command. (what the flags mean)
/pstats flag <name> - Displays the current flag for the player
/pstats logons <name> - Shows how many times the player has logged on
/pstats report <name> - Displays an info sheet with all the data collected of the player. (Players can do this command about themselves without the permission node)
/pstats updatecheck - Checks to see if there is an update.
/pstats update - Updates the plugin (Server must be reloaded to apply the changes) This Command is Vanilla OP + Console only.
/pstats reload - reloads the config
First Join message Macros
Quote:They support the default minecraft colours. Found here -> http://i.imgur.com/h3CIU.png
Or these ones below.
&AQUA;
&BLACK;
&BLUE;
&DARK_AQUA;
&DARK_BLUE;
&DARK_GRAY;
&DARK_GREEN;
&DARK_PURPLE;
&DARK_RED;
&GOLD;
&GRAY;
&GREEN;
&LIGHT_PURPLE;
&RED;
&WHITE;
&YELLOW;
&PLAYER; (This is where the players name would appear)Example:
"&b Welcome &RED; &PLAYER; &b to the server"this would put the players name (Represented by &PLAYER;) in red. with "Welcome" and "to the server" in aqua (&b)
Permissions
Quote:Permissions are per command.
- No permission for - /pstats, /playerstats, /pstats ?, /pstats report (on themselves)
- playerstats.* - All permissions (yes it works i coded it in)
- playerstats.seen.firstseen - /pstats firstseen
- playerstats.seen.lastseen - /pstats lastseen
- playerstats.seen.seen - /pstats seen
- playerstats.info.ip - /pstats ip
- playerstats.info.lastpos - /pstats lastpos
- playerstats.info.totaltime - /pstats totaltime
- playerstats.info.playtime - /pstats playtime
- playerstats.info.activity - /pstats activity
- playerstats.info.flag - /pstats flag
- playerstats.info.all - /pstats report
- playerstats.info.logons - /pstats logons
- playerstats.reload - /pstats reload
Change log
This will be with the latest file to download
Please note that this plugin submits basic data back to my central database with information such as server name and Ip
Future Changes
- Add Block statistics like; Blocks broken, Placed ect.
- Fight Statistics.
- Kills - Mobs (types of mobs), Players, Weapons - Bow, Sword, Axe, pick Other (Will include weapon type i.e. Stone Sword).
- Deaths - from mobs(Types of mobs), from players. Weapons used to be killed (grouping as above)
- Fight Stats will also allow for things like Kill/death ratio. Player Skill ect.
- Allow players to be listed depending on their flag (I.e list of black flagged people to know who has been away for more than 2 months)
- A command to 'archive' black listed people so that they don't clog up the list, but their details are still there in case they want to log on again
Ok so been having the taking forever on shutdown and startup since I last posted. Then 2 day's ago our RPG server issue went away. But our main server still has the issue. Just sitting at "[INFO] [Playerstats] Submitting useage Data" for over a 2 min. But today I notice this error on our server console.
22:36:28 [INFO] [Playerstats] Saving data.
22:36:28 [SEVERE] Exception in thread "pool-1-thread-268"
22:36:28 [SEVERE] org.apache.commons.lang.UnhandledException: Plugin Playerstats v1.9 generated an exception while executing task 9
at org.bukkit.craftbukkit.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:56)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.NullPointerException
at me.mbl111.Playerstats.Autosave.run(Autosave.java:19)
at org.bukkit.craftbukkit.scheduler.CraftTask.run(CraftTask.java:52)
at org.bukkit.craftbukkit.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:53)
... 3 more
Well when you get back let me know, maybe I can get you console access when you get back. The big pain is the restart issue for me. It also happen today earlier. Big an issue for a long time. I was wondering if the data gets too large and took a shit ton of time to upload. I know it's data usage but not sure how big it gets. Maybe I have just have bad timing with your server going down and me wanting to restart.
EDIT: If the plugin is going to stop everything loading and unloading maybe fine a more reliable server. Everytime I rebooted my servers today I get those long pauses.
@BearFather
Hmm, that could have been when my web server died. As to the other error, I thought I had that fixed. I shall be off on a 1 week holiday as of Sunday. But I will look into it once I get back. The error really shouldn't be an issue it just means that the auto save isn't working.
However with you saying that it after being run for a few days it breaks. Perhaps it has an issue with keeping the database connection. Not Entirely sure however I will be doing tests on that when I get back.
Until Then, Happy Minecrafting
I have noticed when I leave my server running for more then a few days when I goto start and shut down I get like a 2 min pause with this message showing...
[Playerstats] Submitting useage Data
Very annoying. If I remove the plugin for a few days when I re-enable it will work fine till the server runs for a few days.
I just check my logs and found this before the restart last time.
18:06:45 [INFO] [Playerstats] Saving data.
18:06:45 [SEVERE] java.lang.NullPointerException
18:06:45 [SEVERE] at me.mbl111.Playerstats.Autosave.run(Autosave.java:19)
18:06:45 [SEVERE] at org.bukkit.craftbukkit.scheduler.CraftWorker.run(CraftWorker.java:34)
18:06:45 [SEVERE] at java.lang.Thread.run(Thread.java:662)
BTW, I tried to make my own query on the database to get an overview over all current players. How are the ints for first- and last login to be interpreted? Wouldn't it be easier to use DateTime or TimeStamp?
Greetings
@GTach
Ahh yes, The plugin generates the tables by itself. However it assumes that you already have a database.
Hi BearFather, reading your answer it occurred to me I need to create the database given in the config prior usage. That did the trick. I thought the plugin would do it on it's own. Thanks, works now
It looks like it's having SQL issues. Does the user you gave have permissions to use the DB you set to in the settings.
Hi,
I've got the same error as hofikaa
[SEVERE] Error occurred while enabling Playerstats v1.9 (Is it up to date?) java.lang.NullPointerException at me.mbl111.Playerstats.data.Database.Write(Database.java:108) at me.mbl111.Playerstats.data.Database.createStructure(Database.java:47)
running on CB 1.3.1-R1.0
Any news on the bug or should I wait until official 1.3 support comes?
Thanks
@PigPlushy
By all means, Go ahead!! But could I get a copy of the source when your done? :p
Do you mind if I make a web feature for your plugin? I'd like to write it in PHP and just grab the info out of the database. Let me know if that's okay :)
hy, i got this error:
i wrote good sql datas, and i dont know why doesn't it work,
any idea?
@ThisUsernameIsMine
Yeah
Hello,
I run the latest dev-build of CB and when starting the server it throws out the following error:
[SEVERE] Error occurred while enabling Playerstats v1.9 (Is it up to date?)
I've left out the remaining lines of the error but does the plugin need MySQL?
@mbl111
No error's and I get the saving message every hr(set to that). But nothing ever put into the sql table.
@BearFather
and SQL errors on startup??
So the update worked for the loading and unloading issue. But today went to check play time on a user and got "Missing the totaltimerecord". Tried a report and came back with "missing the lastpostrecord". So check the sql and it's empty. Then went to the main server and it only got old data listed from the import of the flatfile. The RPG server is a new server and only been up since the loading issue I was having. And it's has it's default config minus the saving time.
Sorry for not getting back sooner, but been way to busy.
@BearFather
Bug fix for this being loaded up now. Also some of the other issues should be fixed
@BearFather
Has anyone else had this issue? I spent some time playing with this issue. I found that it took 3m 10s, then it would load the server. Each time even on shutdown. After 3m 10s it would stop it's loop or whatever it's doing and it cont on till the next plugin.
I didn't matter what the config or if the SQL server was a local or network connection. The only time it would load in less time is if it couldn't connect to the server. IE. Bad address. Not sure if it saves the data...still waiting for the results.
I have no data in the mysql database too. Config seems ok, so I assume the plugin is broken?
Or does anybody here have a proper mysql usage?