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.
-
View User Profile
-
Send Message
Posted Sep 9, 2012Just clearing something up, is logon time the time since a player joined or their total online time?
-
View User Profile
-
Send Message
Posted Sep 8, 2012@Jason0123
The logon time is stored as seconds since epoch (1970's), so you need to convert that to days, hours, minutes and seconds in order to see the actual logon time.
-
View User Profile
-
Send Message
Posted Sep 8, 2012This is a great plugin, but there are a couple more things I think could be added to make it even better! First is tracking of money through vault, because some people don't have their money stored in a database and it's not easy to transfer. I also think PVP deaths and kills would be great, as well as total kills and deaths. This would allow me to make a nice leaderboard to not only show money on my website, but also a PVP table, as well as some individual stats like how many times they've died. The only other thing I can think of would be a first joined and last seen tracker, as this could be used to see how long a player has been a part of the server, and also the last seen tracker could be used so the database could even automatically delete users from the database after a certain time has elapsed sine the last login, or even demote them with a seperate script.
I seem to be having some trouble with the logon time tracker, and all players seem to have ridiculously large 10 digit numbers starting with 13 for this column, even ones who logged in for the first time recently. An example of this large number is: 1344551057. How do I fix this, or is it a bug in the plugin/am I missing something? Thanks.
-
View User Profile
-
Send Message
Posted Sep 4, 2012@ray73864
i have checked the timezone settings and they were set to UTC. I changed this to GMT and still had the same problem.
After some searching i discovered i could put "Europe/London" as a time zone and it is now showing the correct time. im assuming this is due the British Summer Time.
Thought i would let you know for future reference.
-
View User Profile
-
Send Message
Posted Sep 4, 2012@GlabbichRulz
Hrmm, yeah, i should be able to do that just fine.
The health/xp one i'm not sure about, i haven't actually used the scheduler side of bukkit at all yet.
-
View User Profile
-
Send Message
Posted Sep 4, 2012@bjornleijdstrom
Can do on that one. I'm not sure why i didn't think of it before.
-
View User Profile
-
Send Message
Posted Sep 4, 2012@mcbain1992
Check your PHP settings i think, i know when we did it on our server, i had to do something to get it to look right. PHP timezone setting or something.
-
View User Profile
-
Send Message
Posted Sep 3, 2012I have the plugin installed and working fine but when i display the information on my website it is displaying the login time an hour behind. Is there some sort of time zone setting i have set incorrectly? (Using GMT)
thanks
-
View User Profile
-
Send Message
Posted Sep 2, 2012Last logout-time would also be nice (:
-
View User Profile
-
Send Message
Posted Sep 1, 2012Hi, could you please make the Plugin also updating the permissions_group when switching between Worlds? And could you please collect some more data, like for example health or xp level every X minutes?
-
View User Profile
-
Send Message
Posted Aug 29, 2012@ray73864
Great, I have just installed your plugin and it seems like everything is working fine :)
-
View User Profile
-
Send Message
Posted Aug 27, 2012@GlabbichRulz
It logs the permissions group as per what Vault reports when i ask it for the players 'primary group'.
Not sure how i would go about the display name, i assume by 'display name' you mean their nickname when you change it using /nick in essentials? i'm not sure if i can actually retrieve that.
-
View User Profile
-
Send Message
Posted Aug 26, 2012Does this also log the Displayname? (or Permissions Group?)
This would be great!
-
View User Profile
-
Send Message
Posted Aug 24, 20121.2 uploaded waiting on approval. Has been compiled against 1.3.1-R1.0
-
View User Profile
-
Send Message
Posted Aug 14, 2012Working on a 1.3.1 version. The current version should work fine with 1.3.1 i just haven't had time to test it.
-
View User Profile
-
Send Message
Posted Jul 28, 2012Uploaded v1.1 of the plugin, just waiting on approval.
1.1 now requires the plugin 'Sync' to be installed on your server, otherwise it just won't work.
Sync offers a more reliable SQL API interface, which is why i have chosen to use it, it offers other cool features too, but i doubt i would ever use them.
I have looked at 'Vault', and for storing the players permission group in the 'permission_group' field of the SQL table, i use: getPrimaryGroup(world, player);
If this isn't retrieving the players group from group manager, then there isn't much i can do.
-
View User Profile
-
Send Message
Posted Jul 26, 2012@waybaker
Interesting.
Yeah, i need to look at this plugin again this weekend. The SQL Library i am using isn't the most impressive to work with, need to deal with it a better way.
Need to also look at group manager this weekend too so that i can store the group in the database.
-
View User Profile
-
Send Message
Posted Jul 23, 2012Ever since upgrading to v1.0, I am getting this everytime someone logs off:
-
View User Profile
-
Send Message
Posted Jul 23, 2012@oman95891
Strange, is GroupManagers concept of a group different to PermissionsEx's concept of a group?
In my code i get the group the player is in and store it in a field called 'permission_group'.
On our game, that field would store any one of the following values:
- Admin
- Moderator
- VIP
- Member
- Donator
- Player
- Guest
Are group managers groups not permission groups?
Will have to look into it.
@Jason0123
I can indeed store the amount of money that the person has.
If you use Iconomy though, couldn't you just set iconomy up to store the stuff in SQL instead of flatfile? then you have access to everything economy related about that player.
-
View User Profile
-
Send Message
Posted Jul 21, 2012I'm also interested in something similar to the poster below me.
Using vault, could you be able to check what group the player is in, and store it in the database?
For example if I wanted my php player list to display a different color for each rank, like red for people in the group "admin", then I could do so with this application. this would be GREATLY appreciated
:D
- oman