OnlinePlayersSQL
Description
This plugin will update a MySQL database table with a list of players as the join and disconnect from your game.
Originally created for the MCAddictGallery server, it was created so that we could have a live player listing on our website with minimal of fuss.
Currently the plugin tracks the following information:
- Player Name
- Previous World (used for when a player warps from one world to another)
- Current World (the current world the player is in)
- IP Address
- Logon Time (stored as seconds since epoch)
- Players permission group
- Flag to say whether the player is online or not.
Required Plugins to use this one
- Vault
Optional Plugins that provide extra features
- SimplyVanish - Not required, but if you want the players list to not show vanished players, then you will likely want this.
Configuration
config.yml
MySQLServer: localhost MySQLPort: '3306' MySQLUsername: <username for db> MySQLPassword: <password for db> MySQLDatabase: <database to use> MySQLTable: <table to use> showDebug: true|false op_only_resync: true|false
eg.
MySQLServer: localhost MySQLPort: '3306' MySQLUsername: player_tracker MySQLPassword: fred123 MySQLDatabase: player_tracker MySQLTable: online_players showDebug: false op_only_resync: false
This plugin will check to see if the necessary table exists in 'MySQLDatabase' and if it doesn't, it will create it.
showDebug will put debug information in the console allowing you to follow along what the plugin does when a player connects/disconnects.
op_only_resync determins if only ops can use '/onl resync' or not.
An example php file can be found here: http://dev.bukkit.org/server-mods/online-players-sql/pages/example-php-file/
It should work just fine, though you will need to change values where necessary for your mysql logon information.
Information about each function used can naturally be found at the php.net website.
@ray73864
That's actually along the lines of what I'm planning as well, looking forward to seeing your next plugin which seems to do the job :)
Didn't get to do much with my other plugin last weekend, had no internet from Friday night till Monday lunchtime due to faults in the line.
Was extremely painful too :(
@Realwarior
OOoh, nice looking. Never really thought of making a more fancy thing like that.
Ye i messed around and tinkered with some code etc... managed to make a small stats page from it. stats.realzserver.com if you are interested to see what I put together.
@iSeven77
Nope, mine isn't even close.
The only things it stores in the database is the playername, the world they were in, and how much time they spent in that world.
@ray73864
so is it kind of like http://dev.bukkit.org/server-mods/performance-monitor/ ? Performance Monitor
Will release the WorldTimeTracker plugin this weekend, just have to clean up one remaining issue it has, which doesn't stop it from working, is just an annoying thing that pops up in the logfile when you first start the server up.
The WTT plugin keeps track of players from the moment they first join, it tracks how long they have been in each world, etc...
To get an overall idea of how long a player has played on your server, you would just sum up all the world times to get the overall time.
@Realwarior
i modified your file a bit http://pastebin.com/AerYP4PE THANKS !! for posting it
Eh. A great plugin, but if that "WorldTimeTracker" isn't released, I'll release a plugin of the same function. :P Would be useful if you released as my intention isn't to "steal", but to help others.
@iSeven77
Yeah, not sure what is up with the first login.
I do have another non-released plugin called 'WorldTimeTracker' which keeps track of the other information though.
@ray73864
Thanks for this plugin :) any way to get more info ? like time user is been playing and/or the first login is always NULL thanks any ways :)
@Realwarior
Thanks You file help me a lot :) i moded a little bit but your file help me a lot THANKS again :P
Now that simplyvanished has been abandoned, can you add support for Vanishnopacket?
I decided to make a php file that will organize people by their rank. I personally made this for a friend liquidiceservers.com/mincraft.php if you would like to see it in action. If you want the code realzserver.com/downloads/online.txt .
@Phyore
I probably could.
It is strange that you would run below 20TPS though. Even when we were on our crappy server it didn't cause any issues like that.
@ray73864
Cool tnx!
Hmm not sure what's happening maybe the constant posting to the database, but my server was starting to run below 20 TPS. Think you could add a customisable option for how long it syncs the players to the database?
New version 1.7.0 posted.
With this version, if you set the 'track_only_allowed_players' config option to 'true' then it will only tack players who have the 'onlineplayerssql.allowed' permission set on them.
@pandapipino
It most certainly could, yes.
It'll be a config option, such as: trackOnlyAllowedPlayers: true/false
That way the system will know which way to go.
Can this have a permission? for whom groups or players allows this plugin to track? Thanks
ex: onlineplayerssql.allow