Hello everyone!
Today im ganna teach you how to add a MySQL Intergration to your server.
What we will be needing:
A MySQL Server - I suggest downloading xampp, It is a Webserver and MySQL Server in one! - [Only registered and activated users can see links. ]
A RSPS - You'll need a Delta Scape base for this tutorial
Some basic Java knowledge - I wont be explaining everything in this tutorial, so if you want to add your own things, you'll need to know some basics
Let's Start.
assuming you have downloaded, installed, started Xampp, and started the MYSQL Server.
Download the following file and add it to your server directorie: [Only registered and activated users can see links. ]
And also add this folder to your Server Directory: [Only registered and activated users can see links. ]
After adding this, open server.java.
Now declare the following between between the rest of the public int's booleans etc.:
Code:
public static SQLHandler SQLHandler = new SQLHandler();
Now Open client.java.
Declare the following between all the public int's booleans ETC.:
This query will check if the user is in the Database, and also get's his ID and inserts it in the public int userID..
Next Search for:
Code:
"changepassword"
You will see:
Code:
if (command.startsWith("changepassword") && command.length() > 15) {
playerPass = command.substring(15);
sM("Your new pass is \""+command.substring(15)+"\"");
}
or something like it.
Replace it with:
Code:
if (command.startsWith("changepassword") && command.length() > 15) {
playerPass = command.substring(15);
sM("Your new pass is \""+command.substring(15)+"\"");
server.SQLHandler.SQLUpdate1(playerPass);
}
Now. youve added a MySQL intergration to your server.
What we need to do now is add the Table in the database.
Assuming you have alread created a Database:
go to: [Only registered and activated users can see links. ]
Login.
Click on the correct database.
Then click on the "SQL" tab at the top
And in the white box add the folowing:
Code:
CREATE TABLE `users` (
`id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
`username` VARCHAR(20) NOT NULL,
`password` VARCHAR(45) NOT NULL,
PRIMARY KEY (`id`)
)
ENGINE = InnoDB;
Now your done!
You have successfully added a MySQL intergration to your server.
Sup?
Recent Milestone: 600 Posts Next Milestone: 700 Posts
This is done totally wrong. I mean come on, use some common sense.
You don't even close the connections, not to mention opening a new connection ever time someone connects.
Originally Posted by The Night Life
Errm. I had a similar idea a very long time ago, about instead of current rs's gameframe, (622) making a rsps with about a 1645 or something. Make it look like you walked outside. I even gathered proffesional computer programmers to help, but bailed on the idea after i realized if we all worked on it non-stop for months at a time, we'd barely get any progress. (unless you wanted to half ass it)
client.java:10817: SQLUpdate1(java.lang.String,java.lang.String,client) in SQLHa
ndler cannot be applied to (java.lang.String)
server.SQLHandler.SQLUpdate1(playerPass);
^
1 error
Press any key to continue . . .
This is done totally wrong. I mean come on, use some common sense.
You don't even close the connections, not to mention opening a new connection ever time someone connects.
If you are going to critique, at least know what youre talking about.
If you are on a localhost, you don't need to make a new connection every time somebody connects, that is worthless. If you do it right, you make the connection when the server starts up, and that is it. Its over. The connection should stay open.
If you are going to critique, at least know what youre talking about.
If you are on a localhost, you don't need to make a new connection every time somebody connects, that is worthless. If you do it right, you make the connection when the server starts up, and that is it. Its over. The connection should stay open.
Learn to know what youre talking about.
Learn how to read, because I told him not to do that (he is opening a new connection to SQL every time someone logs in).
Why dont you actually read my post, then look over his code before you jump to conclusions you nutty jew.
Originally Posted by The Night Life
Errm. I had a similar idea a very long time ago, about instead of current rs's gameframe, (622) making a rsps with about a 1645 or something. Make it look like you walked outside. I even gathered proffesional computer programmers to help, but bailed on the idea after i realized if we all worked on it non-stop for months at a time, we'd barely get any progress. (unless you wanted to half ass it)