MySQL Register
MySQL Register
A simple plugin that allows your users to /register. Please note that this is not a in-game registration plugin, it is made specifically for those who want a website for their server, and want to make sure their players cannot steal another's IGN.
This plugin uses SQLibrary, and I greatly appreciate PatPeter, who created it. It is included in the JAR, and you don't need to install it as a separate plugin.
Usage: /register [Email] [Password] [Password Confirmation]
Setup: Simply put this plugin in your plugins folder, launch your server, and a default config file should be generated. It will try to connect using the default details, and will print a bunch of errors to console. Stop your server, and follow the below instructions to set up your connection.
The config file:
connection: hostname: localhost #The hostname/IP of the MySQL server, defaults to localhost port: 3306 #The port for the MySQL connection (don't change this if you don't know why you need to,) defaults to 3306 name: minecraft #The database that is contains the table containing usernames, passwords, and emails, defaults to minecraft username: plugin #The username for the connection, defaults to plugin password: password #The password for the connection, defaults to password database: table-name: users #The table name that the data is going to be stored in, defaults to users user-column: username #The name of the column that the username of a player that registers is going to be stored in, defaults to username password-column: password #The name of the column that the password is going to be stored in (needs to be accept at least 32 characters, since the password is hashed in MD5,) defaults to password email-column: email #The name of the column that the email is going to be stored in, defaults to email hashing: md5 #The hashing to be used, options are md5, sha1, or none. Defaults to none, anything that is not md5 or sha1 will also default to none.
Permissions: This plugin uses the default Bukkit Permissions API, which may not work with some plugins. The permissions node that gives access to the register command is
mysqlregister.register
Current Features:
- Simple register format
- Email verification
- Table name customization
- Column name customization
Planned Features:
- Confirmation Email
- Localization (Plans for Russian, Spanish, French)
- Different password encryption settings
GitHub: Follow the project's development over at GitHub
@msalihov
Please can you answer me ?
Is it possible to get rid of the [email] option, I just want it to log the username and pass ! :)
@WeiUberstriker
Incorrect database details
Your database might also only allow certain IPs to connect to it. Please make sure that it allows your server's IP to connect/you are putting in the correct details in config.
Can you support wordpress please ?
Why do I always get this error?
13:19:58 [INFO] [MySQL Register] Connecting to database... 13:20:09 [SEVERE] [MySQL Register] Could not connect to database! 13:20:09 [SEVERE] com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionExc eption: Could not create connection to database server. Attempted reconnect 3 ti mes. Giving up. 13:20:09 [SEVERE] at sun.reflect.NativeConstructorAccessorImpl.newInstance 0(Native Method) 13:20:09 [SEVERE] at sun.reflect.NativeConstructorAccessorImpl.newInstance (Unknown Source) 13:20:09 [SEVERE] at sun.reflect.DelegatingConstructorAccessorImpl.newInst ance(Unknown Source) 13:20:09 [SEVERE] at java.lang.reflect.Constructor.newInstance(Unknown Sou rce) 13:20:09 [SEVERE] at com.mysql.jdbc.Util.handleNewInstance(Util.java:407) 13:20:09 [SEVERE] at com.mysql.jdbc.Util.getInstance(Util.java:382) 13:20:09 [SEVERE] at com.mysql.jdbc.SQLError.createSQLException(SQLError.j ava:1013) 13:20:09 [SEVERE] at com.mysql.jdbc.SQLError.createSQLException(SQLError.j ava:987) 13:20:09 [SEVERE] at com.mysql.jdbc.SQLError.createSQLException(SQLError.j ava:982) 13:20:09 [SEVERE] at com.mysql.jdbc.SQLError.createSQLException(SQLError.j ava:927) 13:20:09 [SEVERE] at com.mysql.jdbc.ConnectionImpl.connectWithRetries(Conn ectionImpl.java:2239) 13:20:09 [SEVERE] at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionI mpl.java:2168) 13:20:09 [SEVERE] at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.j ava:794) 13:20:09 [SEVERE] at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection .java:47) 13:20:09 [SEVERE] at sun.reflect.NativeConstructorAccessorImpl.newInstance 0(Native Method) 13:20:09 [SEVERE] at sun.reflect.NativeConstructorAccessorImpl.newInstance (Unknown Source) 13:20:09 [SEVERE] at sun.reflect.DelegatingConstructorAccessorImpl.newInst ance(Unknown Source) 13:20:09 [SEVERE] at java.lang.reflect.Constructor.newInstance(Unknown Sou rce) 13:20:09 [SEVERE] at com.mysql.jdbc.Util.handleNewInstance(Util.java:407) 13:20:09 [SEVERE] at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionI mpl.java:378) 13:20:09 [SEVERE] at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegist eringDriver.java:305) 13:20:09 [SEVERE] at java.sql.DriverManager.getConnection(Unknown Source) 13:20:09 [SEVERE] at java.sql.DriverManager.getConnection(Unknown Source) 13:20:09 [SEVERE] at com.msalihov.plugins.register.MySQL.connect(MySQL.jav a:60) 13:20:09 [SEVERE] at com.msalihov.plugins.register.Register.onEnable(Regis ter.java:63) 13:20:09 [SEVERE] at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlug in.java:217) 13:20:09 [SEVERE] at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin( JavaPluginLoader.java:457) 13:20:09 [SEVERE] at org.bukkit.plugin.SimplePluginManager.enablePlugin(Si mplePluginManager.java:381) 13:20:09 [SEVERE] at org.bukkit.craftbukkit.v1_5_R3.CraftServer.loadPlugin (CraftServer.java:282) 13:20:09 [SEVERE] at org.bukkit.craftbukkit.v1_5_R3.CraftServer.enablePlug ins(CraftServer.java:264) 13:20:09 [SEVERE] at org.bukkit.craftbukkit.v1_5_R3.CraftServer.reload(Cra ftServer.java:605) 13:20:09 [SEVERE] at org.bukkit.Bukkit.reload(Bukkit.java:185) 13:20:09 [SEVERE] at org.bukkit.command.defaults.ReloadCommand.execute(Rel oadCommand.java:23) 13:20:09 [SEVERE] at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCo mmandMap.java:189) 13:20:09 [SEVERE] at org.bukkit.craftbukkit.v1_5_R3.CraftServer.dispatchCo mmand(CraftServer.java:523) 13:20:09 [SEVERE] at org.bukkit.craftbukkit.v1_5_R3.CraftServer.dispatchSe rverCommand(CraftServer.java:512) 13:20:09 [SEVERE] at net.minecraft.server.v1_5_R3.DedicatedServer.an(Dedic atedServer.java:262) 13:20:09 [SEVERE] at net.minecraft.server.v1_5_R3.DedicatedServer.r(Dedica tedServer.java:227) 13:20:09 [SEVERE] at net.minecraft.server.v1_5_R3.MinecraftServer.q(Minecr aftServer.java:477) 13:20:09 [SEVERE] at net.minecraft.server.v1_5_R3.MinecraftServer.run(Mine craftServer.java:410) 13:20:09 [SEVERE] at net.minecraft.server.v1_5_R3.ThreadServerApplication. run(SourceFile:573) 13:20:09 [SEVERE] Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsExcep tion: Communications link failure
The last packet sent successfully to the server was 0 milliseconds ago. The driv er has not received any packets from the server. 13:20:09 [SEVERE] at sun.reflect.NativeConstructorAccessorImpl.newInstance 0(Native Method) 13:20:09 [SEVERE] at sun.reflect.NativeConstructorAccessorImpl.newInstance (Unknown Source) 13:20:09 [SEVERE] at sun.reflect.DelegatingConstructorAccessorImpl.newInst ance(Unknown Source) 13:20:09 [SEVERE] at java.lang.reflect.Constructor.newInstance(Unknown Sou rce) 13:20:09 [SEVERE] at com.mysql.jdbc.Util.handleNewInstance(Util.java:407) 13:20:09 [SEVERE] at com.mysql.jdbc.SQLError.createCommunicationsException (SQLError.java:1116) 13:20:09 [SEVERE] at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:343) 13:20:09 [SEVERE] at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionI mpl.java:2334) 13:20:09 [SEVERE] at com.mysql.jdbc.ConnectionImpl.connectWithRetries(Conn ectionImpl.java:2186) 13:20:09 [SEVERE] ... 30 more 13:20:09 [SEVERE] Caused by: java.net.ConnectException: Connection refused: conn ect 13:20:09 [SEVERE] at java.net.DualStackPlainSocketImpl.connect0(Native Met hod) 13:20:09 [SEVERE] at java.net.DualStackPlainSocketImpl.socketConnect(Unkno wn Source) 13:20:09 [SEVERE] at java.net.AbstractPlainSocketImpl.doConnect(Unknown So urce) 13:20:09 [SEVERE] at java.net.AbstractPlainSocketImpl.connectToAddress(Unk nown Source) 13:20:09 [SEVERE] at java.net.AbstractPlainSocketImpl.connect(Unknown Sour ce) 13:20:09 [SEVERE] at java.net.PlainSocketImpl.connect(Unknown Source) 13:20:09 [SEVERE] at java.net.SocksSocketImpl.connect(Unknown Source) 13:20:09 [SEVERE] at java.net.Socket.connect(Unknown Source) 13:20:09 [SEVERE] at java.net.Socket.connect(Unknown Source) 13:20:09 [SEVERE] at java.net.Socket.<init>(Unknown Source) 13:20:09 [SEVERE] at java.net.Socket.<init>(Unknown Source) 13:20:09 [SEVERE] at com.mysql.jdbc.StandardSocketFactory.connect(Standard SocketFactory.java:254) 13:20:09 [SEVERE] at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:292) 13:20:09 [SEVERE] ... 32 more 13:20:09 [SEVERE] Error occurred while enabling MySQL Register v0.5 (Is it up to date?) java.lang.NullPointerException at com.msalihov.plugins.register.MySQL.isTable(MySQL.java:154) at com.msalihov.plugins.register.Register.onEnable(Register.java:64) at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:217) at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader .java:457) at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManage r.java:381) at org.bukkit.craftbukkit.v1_5_R3.CraftServer.loadPlugin(CraftServer.jav a:282) at org.bukkit.craftbukkit.v1_5_R3.CraftServer.enablePlugins(CraftServer. java:264) at org.bukkit.craftbukkit.v1_5_R3.CraftServer.reload(CraftServer.java:60 5) at org.bukkit.Bukkit.reload(Bukkit.java:185) at org.bukkit.command.defaults.ReloadCommand.execute(ReloadCommand.java: 23) at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:18 9) at org.bukkit.craftbukkit.v1_5_R3.CraftServer.dispatchCommand(CraftServe r.java:523) at org.bukkit.craftbukkit.v1_5_R3.CraftServer.dispatchServerCommand(Craf tServer.java:512) at net.minecraft.server.v1_5_R3.DedicatedServer.an(DedicatedServer.java: 262) at net.minecraft.server.v1_5_R3.DedicatedServer.r(DedicatedServer.java:2 27) at net.minecraft.server.v1_5_R3.MinecraftServer.q(MinecraftServer.java:4 77) at net.minecraft.server.v1_5_R3.MinecraftServer.run(MinecraftServer.java :410) at net.minecraft.server.v1_5_R3.ThreadServerApplication.run(SourceFile:5 73)
@MiamXD
It should have been, but now I uploaded a version compiled with the 1.5.2 Bukkit API. It should be approved soon.
If you have any further issues, do not hesitate to contact me.
Is this Plugin compatible with 1.5.2? I but the .jar in /plugins, but it wont create a config file?!?
@wazoomie
That is a brilliant idea!
I will get to it at some point, when I have more free time.
I've been looking for a plugin like this for quite a long time now. But I can't use it because the server I have doesn't have a local database and I don't want to share the login info of my own database with the other server admins.
Could you make an option like the ServerStatus plugin, which sends the variables to a PHP file (local or remote) using GET headers?
@RIP230
I don't think you understood the purpose of this plugin. You don't login on the server. This is so that you can insert details from players into your website's database, and later use them to allow the players to log into forums, or an equivalent. I know you can always simply allow your users to register the normal way, but then they could name themselves Notch on the forums.
Compatible with 1.4.7? UPD: How players will login in the server? /login [email] [password]? If so then the plugin will not stand on my serv
@Acrynios_
Yes, this can be done. Just specify the correct table and column names.
@bubblecon11
This means that the plugin couldn't connect to MySQL, for a generic reason. Please make sure your database allows logins from your server's IPs, also update the plugin to the latest version.
21.04 09:41:05 [Server] INFO at net.minecraft.server.v1_5_R2.ThreadServerApplication.run(SourceFile:573)
21.04 09:41:05 [Server] INFO at net.minecraft.server.v1_5_R2.MinecraftServer.run(MinecraftServer.java:381) 21.04 09:41:05 [Server] INFO at net.minecraft.server.v1_5_R2.DedicatedServer.init(DedicatedServer.java:150) 21.04 09:41:05 [Server] INFO at net.minecraft.server.v1_5_R2.MinecraftServer.a(MinecraftServer.java:242) 21.04 09:41:05 [Server] INFO at net.minecraft.server.v1_5_R2.MinecraftServer.e(MinecraftServer.java:282) 21.04 09:41:05 [Server] INFO at net.minecraft.server.v1_5_R2.MinecraftServer.j(MinecraftServer.java:303) 21.04 09:41:05 [Server] INFO at org.bukkit.craftbukkit.v1_5_R2.CraftServer.enablePlugins(CraftServer.java:264) 21.04 09:41:05 [Server] INFO at org.bukkit.craftbukkit.v1_5_R2.CraftServer.loadPlugin(CraftServer.java:282) 21.04 09:41:05 [Server] INFO at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:381) 21.04 09:41:05 [Server] INFO at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:457) 21.04 09:41:05 [Server] INFO at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:217) 21.04 09:41:05 [Server] INFO at com.msalihov.plugins.register.Register.onEnable(Register.java:76) 21.04 09:41:05 [Server] INFO at lib.PatPeter.SQLibrary.MySQL.isTable(MySQL.java:240) 21.04 09:41:05 [Server] INFO java.lang.NullPointerException 21.04 09:41:05 [Server] SEVERE Error occurred while enabling MySQL Register v0.3 (Is it up to date?) 21.04 09:41:05 [Server] SEVERE [MySQL Register] Could not connect to database! 21.04 09:41:05 [Server] INFO The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server. 21.04 09:41:05 [Server] SEVERE MySQL Register[MySQL] Could not establish a MySQL connection, SQLException: Communications link failure ======
Although I am almost sure this is a host problem, could this be a misconfiguration of the plugin?
@Acrynios_
Yes, that is one of the main parts of this plugin! You can make the login script check the database that you connected to the plugin to, then log them in.
Hi,
I was just wondering, if i connect this plugin to my mySQL database that holds my forum's user's information, such as login and passwords, would a player from my server be able to register from within the server, and have his account ready for use when he logs into our forum?
In summary,
If a player registers on the server, will he/she be able to log into select websites with the information they provided?
And yes, I've read the OP.
This is an awesome plugin!
@sonofchocula
I am rather unclear on the issue you are having, as I was not able to replicate it. Please attempt to start completely clean, with a new directory, and a new version of your Bukkit server. If you get the issue again, a complete list of steps that lead to it would be helpful, as again, I was not able to reproduce it.
Regarding bcrypt, I will attempt to implement it once I figure out how to use it, as I've never before done it.
EDIT: Oops, I just realized that I had the wrong version of the plugin promoted as the official, and therefore, people were getting the bad version. Version 0.3 should fix most bugs that have occurred before.
This is a great plugin and saved me the time writing my own version, I am having a problem though. Everytime the plugin is loaded it creates a new config.yml file thus erasing my specific settings. I have copied the error below (it does attempt a valid and proper login but the credentials are incorrect as they have been reset).
17:48:43 [SEVERE] [MySQL Register] Could not connect to database! 17:48:43 [SEVERE] Error occurred while enabling MySQL Register v0.3 (Is it up to date?) java.lang.NullPointerException at lib.PatPeter.SQLibrary.MySQL.isTable(MySQL.java:240) at com.msalihov.plugins.register.Register.onEnable(Register.java:76) at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:217) at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:457) at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:381) at org.bukkit.craftbukkit.v1_5_R2.CraftServer.loadPlugin(CraftServer.java:282) at org.bukkit.craftbukkit.v1_5_R2.CraftServer.enablePlugins(CraftServer.java:264) at org.bukkit.craftbukkit.v1_5_R2.CraftServer.reload(CraftServer.java:605) at org.bukkit.Bukkit.reload(Bukkit.java:185) at org.bukkit.command.defaults.ReloadCommand.execute(ReloadCommand.java:23) at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:189) at org.bukkit.craftbukkit.v1_5_R2.CraftServer.dispatchCommand(CraftServer.java:523) at org.bukkit.craftbukkit.v1_5_R2.CraftServer.dispatchServerCommand(CraftServer.java:512) at net.minecraft.server.v1_5_R2.DedicatedServer.am(DedicatedServer.java:261) at net.minecraft.server.v1_5_R2.DedicatedServer.r(DedicatedServer.java:226) at net.minecraft.server.v1_5_R2.MinecraftServer.q(MinecraftServer.java:476) at net.minecraft.server.v1_5_R2.MinecraftServer.run(MinecraftServer.java:409) at net.minecraft.server.v1_5_R2.ThreadServerApplication.run(SourceFile:573)
Edit: It's a long shot but have you considered implementing bcrypt as a form of encryption?
@TanveerGT5
What exactly do you mean by that? If you mean supporting the correct table names, and column names, that can already be done inside of the config. I am not fully aware of the way PHPBB works.