- Joined
- Sep 9, 2008
- Messages
- 1,947
- Reaction score
- 390
I know some of you are having trouble getting the source to work so let me make some suggestions on how to get it to work for you.
The files are coded in C++ which a lot of you know. Now, some of you think you need Visual C++. You don't, there are a number of other compilers out there that will work as well as VS. Also you can edit the files directly in notepad, but I don't recommend Word or wordpad as these add unnecessary formatting characters. I will leave it up to you to decide.
Now here is where you go to change the IP address and the database files.
In the login server files, open the MySQLM.cpp file and change the following:
You may edit the red italicized words. But be warned. If you change maple_db. You will need to change all of the instances of it throughout the file or it will not compile.
the rest of the red words are editied to your liking they are in this order: "server location", "user", "pass", "db name". After that there is no need to change anything else. Plus you won't need to change this file in the gameserver because its a shared file.
Next we will look at how to change the starting items for a created character.
Open the Characters.cpp file and edit the following:
As you can see this function adds the equipment to the character based on the gender and then adds a weapon. Change this to whatever you like.
That is all needed to be done to the login/charserver.
Next time we will look at the Gameserver which is where you will spend most of your time.
===============================
Update 11/20/2008
===============================
OK I am getting tired of people asking the same problem for the compile error for the config.h file. Here is the answer to all your problems.
Open your Server.cpp and search for this function
change whatever it is to this
Next look for this
and change it to this:
The problem is the conversion of a string to a char array. I never got around to getting a converter to do it so just leave it out. Everything else should be in order.
And make a backup of your file before you edit the file first.
The files are coded in C++ which a lot of you know. Now, some of you think you need Visual C++. You don't, there are a number of other compilers out there that will work as well as VS. Also you can edit the files directly in notepad, but I don't recommend Word or wordpad as these add unnecessary formatting characters. I will leave it up to you to decide.
Now here is where you go to change the IP address and the database files.
In the login server files, open the MySQLM.cpp file and change the following:
Code:
MYSQL MySQL:[COLOR=Red][I]:maple_db;[/I][/COLOR]
long lastaccess;
int MySQL::connectToMySQL(){
setLastAccess(GetTickCount());
if(!mysql_real_connect(&maple_db,[COLOR=Red] "localhost", "root", "pass", "flyff"[/COLOR], 3306, NULL, 0)){
Log(MSG_ERROR,(char*)(mysql_error(&maple_db)));
printf("\n");
return 0;
}
return 1;
}
You may edit the red italicized words. But be warned. If you change maple_db. You will need to change all of the instances of it throughout the file or it will not compile.
the rest of the red words are editied to your liking they are in this order: "server location", "user", "pass", "db name". After that there is no need to change anything else. Plus you won't need to change this file in the gameserver because its a shared file.
Next we will look at how to change the starting items for a created character.
Open the Characters.cpp file and edit the following:
Code:
void Characters::createEquip(int owner, int gender){
char query[1024];
if(gender) {
sprintf_s(query, 255, "insert into equips(equipid,owner,slot,type,durability,equipped) values(504, %d, 44, 2,9000000,1);", owner);
MySQL::insert(query);
sprintf_s(query, 255, "insert into equips(equipid,owner,slot,type,durability,equipped) values(508, %d, 46, 4,5850000,1);", owner);
MySQL::insert(query);
sprintf_s(query, 255, "insert into equips(equipid,owner,slot,type,durability,equipped) values(512, %d, 47, 5,4500000,1);", owner);
MySQL::insert(query);
} else {
sprintf_s(query, 255, "insert into equips(equipid,owner,slot,type,durability,equipped) values(502, %d, 44, 2,9000000,1);", owner);
MySQL::insert(query);
sprintf_s(query, 255, "insert into equips(equipid,owner,slot,type,durability,equipped) values(506, %d, 46, 4,5850000,1);", owner);
MySQL::insert(query);
sprintf_s(query, 255, "insert into equips(equipid,owner,slot,type,durability,equipped) values(510, %d, 47, 5,4500000,1);", owner);
MySQL::insert(query);
}
sprintf_s(query, 255, "insert into equips(equipid,owner,slot,type,durability,equipped) values(21, %d, 52, 10,7200000,1);", owner);
MySQL::insert(query);
}
As you can see this function adds the equipment to the character based on the gender and then adds a weapon. Change this to whatever you like.
That is all needed to be done to the login/charserver.
Next time we will look at the Gameserver which is where you will spend most of your time.
===============================
Update 11/20/2008
===============================
OK I am getting tired of people asking the same problem for the compile error for the config.h file. Here is the answer to all your problems.
Open your Server.cpp and search for this function
Code:
connectToWorldServer
change whatever it is to this
Code:
connectToWorldServer("127.0.0.1",23000)
Next look for this
Code:
sendWorldServerAuth
and change it to this:
Code:
sendWorldServerAuth("DragonFlyff")
The problem is the conversion of a string to a char array. I never got around to getting a converter to do it so just leave it out. Everything else should be in order.
And make a backup of your file before you edit the file first.
Last edited: