Stats & Achievements
This Project is currently abandoned (and probably will forever be). See here for a alternative plugin
2-in-1 Stats and Achievements
This plugin logs various player activity as stats in a MySQL or SQLite database. With the integrated achievement system it is possible to award players when they reached a predefined target.
Features
- Logs block, mob, pvp and miscellaneous player statistics very detailled
- Logs also crafting statistics when spout is installed
- Integrated achievements system
- New database format which is more performant than older databases
- Integrated time delay to reduce server load and the number of SQL queries
- Planned web stats system
- Compatible with every Bukkit version since 1.1-R4
Tools
- You can convert older databases using our utility: http://89.144.25.51:8888/convert.php
- Achievements generator (will be extended soon): http://plugins.maniacraft.de/SaAPlugin/achgen
Requirements
- Vault (Permissions)
- Spout (if you want to get crafting stats)
Commands
- /stats help - General Help
- /stats [<player>] - Shows your stats or stats by <player>.
- /stats block [<player>] <block>[:<data>] - Shows stats for <block>.
- /stats pvp [<player>] [<player2>] - Shows PVP stats.
- /stats mob [<player>] [<mob>] - Shows mob damage stats.
- /achievements help - General Help
- /achievements [<player>] - Shows your obtained achievements or achievements obtained by <player>.
- /achievements list [<page>] - Lists all available achievements.
- /achievements admin add <name> <description> <category> <block> <data> <value> <command> - Adds a new achievement.
- /achievements admin remove <id> - Removes the achievement <id>.
- /achievements admin convert - Convert old achievements.
Achievement Commands
- /give <block>[:<data>] [<amount>] - gives the player the item <block> <data>
- All commands available on your server. Example (Essentials warp): /warp darkroom %player%
Permissions
Permission | Description |
---|---|
stats.show.blocks.own | Show own block stats |
stats.show.blocks.other | Show block stats by others |
stats.show.pvp.own | Show own pvp stats |
stats.show.pvp.other | Show pvp stats by others |
stats.show.mob.own | Show own mob stats |
stats.show.mob.other | Show mob stats by others |
stats.overview.own | Show your overview |
stats.overview.other | Show overview by others |
stats.receive | Log stats at all (for example not for Guests) |
achievements.receive | Gives achievements at all (for example not for Guests) |
achievements.admin.remove | Admin Command Remove |
achievements.admin.add | Admin Command Add |
achievements.admin.convert | Admin Command Convert achievements from old DB |
achievements.list | List all achievements |
achievements.show.own | Show obtained achievements |
achievements.show.other | Show achievements obtained by others |
Config
general: language: en # Language (Available: en/de, other languages can be added in plugins/StatsAndAchievements/lang/) update-delay: 30 # The time interval in seconds how often the stats will be updated in the database (Default and recommended: 30) achievements: true # Activating and deactivating Achievements text_color: '&6' # Color of command texts (1st color) data_color: '&7' # Color of data output (2nd color) debug: false # Debug output (Default and recommended: false) database: type: mysql # Database type, either mysql or sqlite table_prefix: '' # Table prefix to save stats of more than one server in a single database host: localhost # Only MySQL: Database server (Default: localhost) port: 3306 # Only MySQL: Database server port (MySQL default 3306) database: minecraft # Only MySQL: Database name user: root # Only MySQL: Database user password: stats123 # Only MySQL: Database password DisabledWorlds: # In this worlds the stats will be deactivated - disabledworld1 - creative listeners: blockStats: true # Block related stats brewingStats: true # Brewing related stats (maybe bugged) craftingStats: true # Crafting related stats (maybe bugged) enchantingStats: true # Enchanting related stats (maybe bugged) entityStats: true # Entity related stats playerStats: true # Player related stats (Your really should NOT disable this or you'll break everything!) playerMoveStats: true # Player move stats (if you experience lags you should set this to false) vehicleStats: true # Vehicle related stats
Language file formating
{br} - Line break &[0-f] - Color codes (http://img109.imageshack.us/img109/4334/mccolors.png) %[A-Z0-9]% - Internal variables, don't supposed to be translated!
@PainKNero
Not currently, but I have added it into the latest version I'm testing, along with Ocelots and Iron Golems (I can't believe I forgot them) and a few other fixes.
Yes man.... ! The first short test will show: That memory leak seems to be history!
I try that out now by reducing the several restarts during a day and watching the memory management of my server.
Till than,
Ah, just a question: How can i integrate the desciption of an achievement to the anouncement: "PainKNero has got HERO IV: <Kill 1 Chicken>" to the achievements.notifyachwidget or what node ever ?
cu,
Nero
I have uploaded the Version from Wattzy now! Big thanks to him for his great work!
EDIT: Maniac has uploaded the newer version with changes! :D
EDIT2: Probably worth noting, to fix playtime issues. If you are having them, set forcePlayTimeUpdate to true (option in the config file) to ignore permissions and just update a players playtime regardless.
EDIT3: Big thanks from me to ThaMunsta for finding and helping me solve the playtime bug. ;)
@thealmightypsycho
Appologies, It's a bug I missed, involving cetain permissions systems, like permissionsBukkit. Basically the permission check comes back false because the player is offline. I've already made the fix but unfortunatly forgot to change the link.
When I get home later I'll update it and all should be good. (in about 2 hours)
@wattzy
I am using your version and I am getting some complaints from users that their playtime is not updating. Even after logging off and back in.
@wattzy
I'll try your version. Thanks.
@Pr07o7yp3
What version are you using?
1.7 from the download link, or my bug fixed 1.7 (available further down in the comments)
It's safe to ignore, it just thrown out by some random data values with some items in game.
I get this error:
[WARNING] [StatsAndAchievements] [MySQL]: Error in SQL query: Data truncation: Out of range value for column 'data' at row 1
So?
@wattzy
Thank you sooooo much! :D
Well I've made some pretty awesome changes to this now and have now committed the code off to Maniac.
It's been fun, and enlightening, but I really should go and do some 'proper' work now O:)
Hopefully a newer, awesomer, version will be released soon(tm).
Here's a short list of some of the new features I have added,
That is not all!
for the rest you will have to wait for the release, and see :P
NOTE: Some changes I made will help for better achievement giving, BUT unfortunately won't work with what is stored in you current database. Newer stats will be fine however.
A brief description to why,
Beds for example have 4 different data types (direction the bed is placed, north/east/south/west).
In the current version they are stored individually, so, for each orientation of the bed a player places/destroys, it is stored in its own result in the stats table.
This made having an achievement like (place 10 beds) very hard to achieve or get right.
I changed the way the data values are stored (from my changes, so presumably 1.8 onwards) to only store the data value > 0 IF the block being stored REALLY needs the data value...
Logs for example would be a case of this, 0 = standard, 1 = pine, 2 = ..... etc,
I hope this makes sense and is good with with everyone else, it makes achievements easier to manage ;)
Edit: This does not mean you need to wipe your database, it just means that I changed how it gets saved from now on!
@wattzy
Thanks, that's what i was looking for.:)
For memory leak, are you using craftbukkit #2167 (Beta 1.2.5 R1.2) ?
Cause #2149 (1.2.5 R1.0) seems to have memory leak issues...
@ZoRkCreativeCrafts
@ThaMunsta
Here is a google doc with information on the tables, as best I could in a rush.
NOTE: There is an issue with some achievements and the way they are checked. I am working on a fix to try and resolve this.
NOTE2: It seems their may (could be another plugin I'm using) still be a memory leak, just smaller, and takes longer.
This could be an issue with just my version I'm testing on my server (its a newer version than I have linked) or it could be from the version I linked. If that is the case I have some more digging to do.
After 36 hours server uptime I have noticed a slow (very slow) climb in memory usage. It's very slow and hard to pinpoint, basically after 36-48 hours if your version is using more memory than you think it should, let me know!
Mine was using around 3-10% memory when idle (no players) from startup. As of now it's climbed to 23% idle (no players) and doesn't seem to be going down back to what I was seeing.
Again, this could be unrelated to SaA and relate to another plugin or even just my server in specific!
EDIT: Ignore me, it was something else, after playing for a while memory dropped back down to the 10% range ;)
@wattzy
As far as i can see in your commit it looks very good :) Nice work!
@wattzy
Thank you very much. It's all working and I haven't found any glitch yet. I love you :P!
@wattzy
awesome :)
You should become Moderator with Maniac togheter :D
@wattzy
GREAT!!! THANKS
Will try to test it toonight...
Just installed this fantastic plugin two weeks ago.
I've starting to make a web page on my site to display all players's stats. With Global and individual player's pages.
Still work in progress but working good, exept of course fishcaughts, crafts, xp...
But now i need to know what are the corespondances for the achievement_stats table:
Can you tell me what block/mob matching the block row in this table?
I could figure it testing all datas Ingame and looking in the phpmyadmin, but would be easier/faster...
Thanks
EDIT: Removed (waste of space) ;)
@wattzy
Aww man! total life saver bro :D I know Maniac mentioned some real life stuff earlier and I felt bad I couldn't help. Took a look at his source but I'm not nearly fluent enough in java or any of the bukkit API or what ever.
Very excited and truly appreciate the time and effort put into helping :) I agree there isn't a decent stat plugin. I was using Valrix's Netstats but I think he ran into the same issue - real life stuff.
@Gidedin
@Schlumpf9
@ThaMunsta
You're all welcome.
I mostly did this because of the lack of a decent statistics plugins out there and the fact that this included achievements as well, it could quite easily be the best, with a bit of work.
The good news is, I think I got the memory leak.. YAY! Ran my server for 24 hours, memory usage barely peaked above 30% :) ,.....but in my version I introduced a whole load more tracking and recording errors, and have just spent the past few hours attempting to find and fix em.
Now, Maniac is quite busy in real life at the moment and I don't want to pressure them into extra work :p, but when I'm done with all my changes I will be 'sending' off the code to get merged in....if they work (I like to do at least a good 24 hour test on my server before I believe in them :p).
The leak appears to be caused by achievements, so if you don't want your server to keep crashing/slowing down etc, I would advise turning them off in the config options, set 'achievements: false', and all should be good (I say should, because I'm still not 100% sure if I got it all).
@MaxKalus
This isn't my plugin, however I will take a look and see what I might be able to work out. If I can get it, then Maniac might include the changes into the official version ;)
@ThaMunsta
In the latest version Maniac disabled updating of the LASTLOGOUT column. I however have re-enabled it, because quite a few people seem to use it (I was too :p).