MySQL-Register Reloaded
MySQL-Register Reloaded
MySQL-Register Reloaded is a remake of an outdated plugin named 'MySQL-Register', this plugin allows you to let your players register. You can do a lot with this information, as example you can create a login scrips with PHP for your website based on the information in the database. It's specialy made for premium servers, if you have suggestions for this project just tell it.
Please read this: Version 1.4B contains a custom writed Metrics that sends your server information to my website. It's not working yet, so I removed it in 1.4C. Thank you for reading.
Github Link: https://github.com/Shadow48402/MySQL-Register
# Commands #
/register <email> <password> <password>
# Permissions #
MysqlRegister.register
# Default config.yml #
Hash: MD5
# Default database.yml #
Host: localhost Port: '3306' Database: Database Username: User Password: Password Options: table-name: users user-column: Username uuid-column: UUID email-column: Email password-column: Password
# Default message.yml #
WRONG_ARGUMENTS: '&c/register [Email] [Password] [Password Confirmation]' ALREADY_REGISTERED: '&cYou are already registered!' PASSWORDS_NOT_EQUAL: '&cThe two passwords supplied do not match!' REGISTER_NOW: '&aRegister now an account for more features!' REGISTER_SUCCESS: '&aRegistration successful!' INVALID_EMAIL: '&cPlease enter a valid email!' NO_PERMISSION: '&cYou are not allowed to do that!'
PHP Examples
I made some PHP examples to show you guys what you can create with this plugin, you also can use it to create one of your projects (user page) or something else like that. You can find the PHP examples here. Here a snippet of what you can find:
/* * Config Parts */ $_config['host'] = '127.0.0.1'; $_config['username'] = 'Root'; $_config['password'] = 'Password'; $_config['database'] = 'Database'; try { $pdo = new PDO ('mysql:host=' . $_config['host'] . ';dbname=' . $_config['database'], $_config['username'], $_config['password']); } catch (PDOException $ex) { die ('Could not connect with the database!'); }
@raldo94
No, it is not possible but it's a very good feature to add thank you! I'm thinking about adding a login function, what do you think of that?
Consider using https://github.com/brettwooldridge/HikariCP For Data source using mysql, That way you do not need to handle the connections manually, But in this case there is not much activity for the sql.
You could also run
or remake it to run before trying to execute an query, (So you don't forget to check).
+ for sharing the code :)
An interesting thing about this plugin is that you could replace the /register and show an link to an website, Then let the user register on the website. Then save the account in the db the plugin is using. That way you have linked the minecraft user to the website.
Just a taught, Is it possible to change the table column names after it has been created, while not changing the table name?
@DerkoFR
Can I see the line 14, 15 and 16 of the index.php file please?
Hello i have a problem in php.. parse error: syntax error, unexpected '{' in C:\wamp\www\login\index.php on line 15
help me
When I use this plugin, it works the first 5/10 hours after a server restart well, then I get this error: http://pastebin.com/1jUpkWJ8
Can this please be solved!
Thanks,
CooleChriz
I have a Problem, after 48hrs ist the Plugin Buggy than i must the Server restartet. If the error recurs , is chatting the message that I can register even though I 'm already registered . It appears that is no longer linked up to about 48 hours to the database . The part from the Serverlog: [16:34:09] [Server thread/INFO]: Darivo issued server command: /register [email protected] test123 test123 [16:34:09] [Server thread/WARN]: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: No operations allowed after connection closed.Connection was implicitly closed by the driver. [16:34:09] [Server thread/WARN]: at sun.reflect.GeneratedConstructorAccessor286.newInstance(Unknown Source) [16:34:09] [Server thread/WARN]: at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) [16:34:09] [Server thread/WARN]: at java.lang.reflect.Constructor.newInstance(Constructor.java:422) [16:34:09] [Server thread/WARN]: at com.mysql.jdbc.Util.handleNewInstance(Util.java:407) [16:34:09] [Server thread/WARN]: at com.mysql.jdbc.Util.getInstance(Util.java:382) [16:34:09] [Server thread/WARN]: at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1013) [16:34:09] [Server thread/WARN]: at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:987) [16:34:09] [Server thread/WARN]: at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:982) [16:34:09] [Server thread/WARN]: at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:927) [16:34:09] [Server thread/WARN]: at com.mysql.jdbc.ConnectionImpl.throwConnectionClosedException(ConnectionImpl.java:1213) [16:34:09] [Server thread/WARN]: at com.mysql.jdbc.ConnectionImpl.checkClosed(ConnectionImpl.java:1200) [16:34:09] [Server thread/WARN]: at com.mysql.jdbc.ConnectionImpl.createStatement(ConnectionImpl.java:2485) [16:34:09] [Server thread/WARN]: at com.mysql.jdbc.ConnectionImpl.createStatement(ConnectionImpl.java:2467) [16:34:09] [Server thread/WARN]: at com.nielsha.plugins.mysqlregister.commands.RegisterCommand.onCommand(RegisterCommand.java:51) [16:34:09] [Server thread/WARN]: at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44) [16:34:09] [Server thread/WARN]: at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:141) [16:34:09] [Server thread/WARN]: at org.bukkit.craftbukkit.v1_8_R2.CraftServer.dispatchCommand(CraftServer.java:646) [16:34:09] [Server thread/WARN]: at net.minecraft.server.v1_8_R2.PlayerConnection.handleCommand(PlayerConnection.java:1133) [16:34:09] [Server thread/WARN]: at net.minecraft.server.v1_8_R2.PlayerConnection.a(PlayerConnection.java:968) [16:34:09] [Server thread/WARN]: at net.minecraft.server.v1_8_R2.PacketPlayInChat.a(PacketPlayInChat.java:45) [16:34:09] [Server thread/WARN]: at net.minecraft.server.v1_8_R2.PacketPlayInChat.a(PacketPlayInChat.java:1) [16:34:09] [Server thread/WARN]: at net.minecraft.server.v1_8_R2.PlayerConnectionUtils$1.run(SourceFile:13) [16:34:09] [Server thread/WARN]: at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [16:34:09] [Server thread/WARN]: at java.util.concurrent.FutureTask.run(FutureTask.java:266) [16:34:09] [Server thread/WARN]: at net.minecraft.server.v1_8_R2.SystemUtils.a(SourceFile:60) [16:34:09] [Server thread/WARN]: at net.minecraft.server.v1_8_R2.MinecraftServer.A(MinecraftServer.java:710) [16:34:09] [Server thread/WARN]: at net.minecraft.server.v1_8_R2.DedicatedServer.A(DedicatedServer.java:368) [16:34:09] [Server thread/WARN]: at net.minecraft.server.v1_8_R2.MinecraftServer.z(MinecraftServer.java:651) [16:34:09] [Server thread/WARN]: at net.minecraft.server.v1_8_R2.MinecraftServer.run(MinecraftServer.java:554) [16:34:09] [Server thread/WARN]: at java.lang.Thread.run(Thread.java:745) [16:34:09] [Server thread/WARN]: Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: The last packet successfully received from the server was 41,722,129 milliseconds ago. The last packet sent successfully to the server was 41,722,129 milliseconds ago. is longer than the server configured value of 'wait_timeout'. You should consider either expiring and/or testing connection validity before use in your application, increasing the server configured values for client timeouts, or using the Connector/J connection property 'autoReconnect=true' to avoid this problem. [16:34:09] [Server thread/WARN]: at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) [16:34:09] [Server thread/WARN]: at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) [16:34:09] [Server thread/WARN]: at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) [16:34:09] [Server thread/WARN]: at java.lang.reflect.Constructor.newInstance(Constructor.java:422) [16:34:09] [Server thread/WARN]: at com.mysql.jdbc.Util.handleNewInstance(Util.java:407) [16:34:09] [Server thread/WARN]: at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1116) [16:34:09] [Server thread/WARN]: at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:3348) [16:34:09] [Server thread/WARN]: at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1967) [16:34:09] [Server thread/WARN]: at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2140) [16:34:09] [Server thread/WARN]: at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2620) [16:34:09] [Server thread/WARN]: at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2570) [16:34:09] [Server thread/WARN]: at com.mysql.jdbc.StatementImpl.executeQuery(StatementImpl.java:1474) [16:34:09] [Server thread/WARN]: at com.nielsha.plugins.mysqlregister.listeners.JoinEvent.onJoin(JoinEvent.java:28) [16:34:09] [Server thread/WARN]: at sun.reflect.GeneratedMethodAccessor458.invoke(Unknown Source) [16:34:09] [Server thread/WARN]: at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [16:34:09] [Server thread/WARN]: at java.lang.reflect.Method.invoke(Method.java:497) [16:34:09] [Server thread/WARN]: at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:301) [16:34:09] [Server thread/WARN]: at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) [16:34:09] [Server thread/WARN]: at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:502) [16:34:09] [Server thread/WARN]: at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:487) [16:34:09] [Server thread/WARN]: at net.minecraft.server.v1_8_R2.PlayerList.onPlayerJoin(PlayerList.java:296) [16:34:09] [Server thread/WARN]: at net.minecraft.server.v1_8_R2.PlayerList.a(PlayerList.java:156) [16:34:09] [Server thread/WARN]: at net.minecraft.server.v1_8_R2.LoginListener.b(LoginListener.java:144) [16:34:09] [Server thread/WARN]: at net.minecraft.server.v1_8_R2.LoginListener.c(LoginListener.java:54) [16:34:09] [Server thread/WARN]: at net.minecraft.server.v1_8_R2.NetworkManager.a(NetworkManager.java:231) [16:34:09] [Server thread/WARN]: at net.minecraft.server.v1_8_R2.ServerConnection.c(ServerConnection.java:148) [16:34:09] [Server thread/WARN]: at net.minecraft.server.v1_8_R2.MinecraftServer.A(MinecraftServer.java:809) [16:34:09] [Server thread/WARN]: ... 4 more [16:34:09] [Server thread/WARN]: Caused by: java.net.SocketException: Broken pipe [16:34:09] [Server thread/WARN]: at java.net.SocketOutputStream.socketWrite0(Native Method) [16:34:09] [Server thread/WARN]: at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:109) [16:34:09] [Server thread/WARN]: at java.net.SocketOutputStream.write(SocketOutputStream.java:153) [16:34:09] [Server thread/WARN]: at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:82) [16:34:09] [Server thread/WARN]: at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:140) [16:34:09] [Server thread/WARN]: at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:3329) [16:34:09] [Server thread/WARN]: ... 24 more
No Problem, at morning i have this take from test to my OnlineServer. It works so... User Ingame (IP: mc.minelegend.de) register with /register Data gos in DB from Game. User open website minelegend.de, works in background sync skript. It take new user from GameDB and wirte it into the WebDB. and now User can Login into the Website. Sry my english, iam German and my Gameserver too. Please wisite me in my server.
@Darivo
Thanks for downloading this plugin! Can you send you server ip in a PM. I will check the plugin in your server!
Yeaaaahh, thx it works now. I need it for register into my forum and now its save the user regisered. For me was importend user registered with the minecraft name for indentifikation, thx
@Darivo
Hello,
Do you get this error while running the 'register' command? Can you show the whole error or tell me when you get this error? Are you also sure that you are running V1.4 of this plugin?Never mind, I see the bug, I fixed the bug and uploaded the bugfix http://dev.bukkit.org/bukkit-plugins/mysql-register-reloaded/files/7-mys-ql-register-v1-4c/.
Download it on own risk, it's not approved by the Bukkit staff yet.Good morning, i need this Plugin but it didnt work (v 1.4). Log Say:
[09:54:00] [Server thread/WARN]: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'FROMtestos WHERE uuid='10a24cc5-4497-4945-861d-c2aee186e62a'' at line 1 [09:54:00] [Server thread/WARN]: at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) [09:54:00] [Server thread/WARN]: at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) [09:54:00] [Server thread/WARN]: at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
V1.0 works but i dont have custom Massages. Please Help. I need it for Ingame register for my forum... My Server runs with Spigot 1.8.3
V1.2 is a reprogrammed version of the plugin, it's published too on my Github page check it above. There are some PHP examples coming soon too.
@Xaniumer Thanks! If you have an idea please tell.
Smart idea!