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 Jan 11, 2013Getting this error when shutting down server: http://pastebin.com/rNFnJETd
Also, it keeps spamming the console with people who "havent logged out". When closing server, it should remove the "NULL" users when shutting down server, if they are not logged in.
-
View User Profile
-
Send Message
Posted Jan 9, 2013actually, more importantly, could you update this to the current version of craftbukkit? that seems like the most important thing to do first, because it doesn't work with this version. Or post the source and I could take it on if you don't want to keep maintaining this plugin.
-
View User Profile
-
Send Message
Posted Jan 9, 2013Help. Don't log players online time
-
View User Profile
-
Send Message
Posted Jan 8, 2013could you please add maybe to a separate table a listing of all players that have ever been online? that would be great because I need a way to validate players in-game name on my website.
-
View User Profile
-
Send Message
Posted Dec 10, 2012@ray73864
That would be nice!
-
View User Profile
-
Send Message
Posted Dec 8, 2012@konesmeijer
Just had an extra thought with this. I may be able to make it a soft-dependancy, if it is installed then it will use it, and you would get access to extra information that can only be collected via vault, if not installed, then you just get the basic information that i can get from bukkit itself.
-
View User Profile
-
Send Message
Posted Dec 8, 2012@konesmeijer
No, i use vault to work out what permissions group the player is in, and later on for the economy support.
-
View User Profile
-
Send Message
Posted Dec 8, 2012Does this work without vault?
-
View User Profile
-
Send Message
Posted Dec 6, 2012@giffordj
The example depends on how you've set it up, on our server, the table is labelled 'online_players2' and that's where i got the sample stuff from.
Will update to reflect what the rest of my examples show though.
-
View User Profile
-
Send Message
Posted Dec 6, 2012There is a typo in the example file.
$sqlOnlineList = "SELECT * FROM online_players2";
should be
$sqlOnlineList = "SELECT * FROM online_players";
caught that when I was testing.
-
View User Profile
-
Send Message
Posted Dec 4, 2012New version uploaded, get it here: http://dev.bukkit.org/media/files/654/312/OnlinePlayersSQL.jar
Changes:
- No longer requires Sync
- Connects, runs query, disconnects which should hopefully resolve all timeout issues and make the system run faster since the plugin isn't holding an active connection open.
-
View User Profile
-
Send Message
Posted Dec 4, 2012@konesmeijer
So why can't you use this plugin for that purpose? I think the only issue this plugin has is with whitelists where for whatever reason it stops working or something.
But from what you are asking, this plugin does the things you are asking for.
-
View User Profile
-
Send Message
Posted Dec 4, 2012There will be names in a mysql database, and those have to be whitelisted and behind every name there must be a value wich says if this player is actually on the server
-
View User Profile
-
Send Message
Posted Dec 3, 2012@konesmeijer
Could you elaborate more about what you want?
-
View User Profile
-
Send Message
Posted Dec 3, 2012@waybaker
Darn, i moved away from PatPeters SQL Library since it was a painful beast to work with :(
Will have to look at doing it a better way then.
-
View User Profile
-
Send Message
Posted Dec 2, 2012I will give you $10 if you can make a plugin, that just gives a name a value if it is on the server or not, because I want player names in the database fixed for a whitelist, and in the next row if this player is online or not Contact me! koenmeijer1@hotmail.com
-
View User Profile
-
Send Message
Posted Nov 27, 2012@ray73864
What I am seeing on my server is that the plugin will work fine for a while then all of a sudden it can't connect to the database anymore and throws a huge amount of errors in the console.
If you read through the below pastebin, Sync fails first, causing OnlinePlayers to fail. This particular instance happened right after a player logged in. No other errors were thrown in the console for any other plugins (I use PermissionsEX, MultiInv, MCMMO, and CraftConomy and they all use sql).
http://pastebin.com/ks2thjXP
EDIT: Right after posting the above, I disabled sync and installed Version 1.0. It has been running ever since with no errors.
-
View User Profile
-
Send Message
Posted Nov 26, 2012nvm, everything working fine with 1.4.5. !
-
View User Profile
-
Send Message
Posted Nov 25, 2012@gamx100
It should work fine, i use it on 1.4.5 on my own public server, what parts of it isn't working?
Just looked at what version we are running on my public server, and it appears to be the old 1.2 version, will have to update to the 1.4 version, it's possible i changed something in 1.3 or 1.4 that broke it with bukkit 1.4.5.
Also, if you want to donate, you can, i've added the bukkit donate button to the top of the page.
There's still a few things i need to fix in the plugin, make it work better, etc... time is the thing i have to find first though :(
-
View User Profile
-
Send Message
Posted Nov 25, 2012@rustymetal
I set it up to utilise sync as it was easier than coding my plugin up to use the built-in java sql stuff which would then add extra overhead to my own code.
Sync still works perfectly on 1.4.5, and i don't really plan on removing it just yet. If i had more time outside of working 6 days a week then yes, i probably would remove that dependancy.