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
hey guys I have recently added this plugin to my game. I have mysql running on the same box and the game is successfully linking into the game, however it will not update any info into the db. it did auto create the fields to use. any ideas? Thanks for the advise ahead of time.
im having a bit of trouble installing this. it wont create the save file with database or text file. it says sql exception. also it says failed to enable playerstats 1.6 even though i downloaded 1.8. any ideas on how to get this running?
On the 30th I went to reload one of my servers and it locked up on loading your plugin. Had to kill the process to stop it. I Then tried to restart again it dead as soon as it loaded the plugin again. Removed it and it ran fine. Forgot all about it. Then went to reload my main server today for a plugin change, and it died unloading the same plugin. Had to also kill and remove to the plugin to get it to load.
Here's what I saw on the main one tonight.
Then on the RPG one on the 30th.
Internal error encountered on /pstats report. Ticket filed!
@Wppvater
Uh, make sure the plugin isnt running when you change it?
Whenever i set useDatabase to True (or true) the plugin automaticaly changes to "false" again. Happens everytime. How do i solve this?
Yay, update! *dances on the table*
Thanks mbl111! You rock! =)
@joshcvb
it should refresh the stats when the player leaves
@Marium0505
Yeah, That would be it
@mbl111
I have this all set up correctly and MySQL is working correctly. The plugin properly sets up the database in MySQL but it is not logging to MySQL for any of the stats. I'm not sure this is a problem on my end but a problem with the plugin.
Why do I get this error?
2012-03-09 07:51:26 [INFO] [Playerstats] Enabling Playerstats v1.6 2012-03-09 07:51:26 [INFO] [Playerstats] Enabling database 2012-03-09 07:51:26 [INFO] SQLException: Communications link failure
The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server. 2012-03-09 07:51:26 [INFO] SQLState: 08S01 2012-03-09 07:51:26 [INFO] VendorError: 0 2012-03-09 07:51:26 [SEVERE] Error occurred while enabling Playerstats v1.6 (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) at me.mbl111.Playerstats.Playerstats.onEnable(Playerstats.java:88) at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:215) at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:336) at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:363) at org.bukkit.craftbukkit.CraftServer.loadPlugin(CraftServer.java:250) at org.bukkit.craftbukkit.CraftServer.enablePlugins(CraftServer.java:232) at net.minecraft.server.MinecraftServer.t(MinecraftServer.java:374) at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:361) at net.minecraft.server.MinecraftServer.init(MinecraftServer.java:187) at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:425) at net.minecraft.server.ThreadServerApplication.run(SourceFile:490)
Ugh, I think I found out why I got it, is it cause I have forgotten to add the mysql databse in the config?
Ok It's done.
If a user has logged into the server before you do the php convert there stats will not be transferred.
Hey got most of it coded now just need to know the data structure for the tables. Are they all strings?
Sure can
@BearFather
Hmm, I guess its no big issue that it says 1.6. Although it could be confusing.
The php script sounds great, would you mind sharing when you done?
Ok, I have tomorrow off I might make a php script to convert it. Hate to loose all the info....Now to figure out the tables.
Also I edited my last message and didn't noticed you replied, but it just says its version 1.6 when loading and unloading.
@BearFather
No, Im gonna need to work on coding a conversion tool. Since bukkit removed the old config style its gonna take some time.
Will it convert?
And downloaded it twice its and says it's 1.6 loading.
[INFO] [Playerstats] Enabling Playerstats v1.6
Same here loading up with beta build I get errors, Playerstats 1.7 - dbbeta2.
Must have plugin. Even tho I get a stiffy for the sql, Still able to use this info for our website. Great for admins to check how long a new person plays. Thanks for the work so far.
Playerstats 1.7 - dbbeta2 is not working on R6+ releases. Hope for an update. Love and need that plugin.
Thanks for your dediaction, mbl111!