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
I tried localhost, tried 127.0.0.1 nothing works fine!
Can you copy your config here?
@KrustyLv
Try 'localhost' instead of '127.0.0.1'. Do up a ticket for all the errors that you receive, it could be a config issue.
You have an error in your SQL syntax to use near '127.0.0.1' ...
And a lot of errors
@KrustyLv
What exactly is the error? just saying something like that is useless to me as i have nothing to go on for finding the problem.
Lol it says i have error in syntax but evertthing in config is right..
@Iveyz
Please try this bugfix version, i've fixed up the SQL Query issue that you posted.
http://dev.bukkit.org/media/files/772/71/OnlinePlayersSQL.v1.9.1.jar
Also, are you using CB 1.7.2R0.2 Beta? That's the version i compiled this against i believe.
Hey, I like your plugin. I'm using it on my website to make an online players list, and this plugin does just that. I just get an error on the startup, and I think this is the plugin that is causing lag when someone connects to the server. I have tried both the beta you just released, and the old one. Yes, the MySQL Information is all correct. It's writing to the tables and I'm able to retrieve the data.
Any help is appreciated!
New v1.9.0 build posted waiting on approval. This version has been compiled to the last beta build of CB that was released.
Marked as Beta because it very much is a beta build until someone reports back saying that it works fine.
If you don't want to wait for the bukkit approval team, you can get it here: http://dev.bukkit.org/media/files/772/37/OnlinePlayersSQL.v1.9.0.jar
I plan on fixing the plugin up (with the Citizens issue) and updating it to 1.7.2 (it should already work on it) in the next couple of weeks when i will have free time thanks to taking annual leave from work :)
Just gonna say. This is a wonderful, and very useful, plugin to use. I managed to hook up my Minecraft.net API system with this, and another plugin, to achieve a userinfo board on my website. (Links Below)
Online: image
Offline: image
So, thanks for such an awesome plugin.
Rogue out...
@fungreenfox
Do you know if playerA or playerB was a brand new player when this occurred? or have they died/killed someone before?
I have seen a few other occasions today, where only a player has to die, for triggering it. [16:30:12 INFO]: [PvP] "playerA" sliced through "playerB" with a diamond_sword [16:30:24 WARN]: java.sql.SQLException: Illegal operation on empty result set.
@fungreenfox
I see what the issue is, now it's just a matter of fixing it, i'm guessing what is happening is that with citizens, when a citizen dies, the plugin probably runs the death event on them to do stuff.
I still get this problem when i install the latest onlineplayerssql and citizens. -(i do not have citizens NpC )
http://issues.citizensnpcs.co/browse/CITIZENS-700?filter=-2
http://dev.bukkit.org/paste/9090/
@fungreenfox
The MySQL stuff in the code can't find the database. According to the error, it is looking for a database called 'db' which doesn't appear to exist.
Make sure you have the config settings all correct for it.
im using this with no problems for 1.7.2 maybe its vault ? idk
It does'nt seem to touch citizens anymore, but i get this http://dev.bukkit.org/paste/9048/ in 172.
Actually, onlineplayerssql starts up in 172 but does not do its function. I have an online page where i would
like it to work.
I am using spigot, else i will get errors in Craftbook which i don't have now.
I haven't tried it, but this should also in theory work for the 1.7.2 bukkit stuff.
I don't use anything outside of the bukkit API, and even then it is just a few events (join, quit, world change).
no, i dont have the old paste. I can try the plugin again and paste it, but we are using bukkit 172 now.
@fungreenfox
What's the error that is returned?