[Share] Some things to Dragon Source UPDATE # 7
Here I will post somethings to this source file: http://forum.ragezone.com/f457/drago...leased-495167/
Use them as a learn to keep on developing it.
_______________________________________________________________________________________________
Contents:
"Fixing" the mp, hp and fp recovery(it runs once in a second);
Giving Skill Points when level Up;
Ban command;
Saving on logout;
UPDATE #1 First step into fixing memory leaks problem;
UPDATE #2 Error "This id has been blocked" instead of "Your time is up";
UPDATE #2 Not crashing client when GameServer isnt online;
UPDATE #2 Login Error IDs;
UPDATE #3 Changing exes place;
UPDATE #4 First step into not allowing login if account is logged;
UPDATE #4 3 tryies to login;
UPDATE #4 How to see the server and cluster;
UPDATE #4 Loading things(mobs for example);
UPDATE #5 Showing a [NOTICE]: <message> to players that login;
UPDATE #5 Optimazing time checks;
UPDATE #6 Item command;
UPDATE #6 Saving Incoming and Outgoing packets into log files;
UPDATE #7 Item command(updated);
_______________________________________________________________________________________________
"Fixing" the mp, hp and fp recovery(it runs once in a second):
go into Player.h, put this after "public:" inside "class Player: public Mover, public AbstractPlayer {":
Code:
unsigned long getLastCheck(){
return lastRecovery;
}
void setLastCheck(unsigned long value){
lastRecovery = value;
}
those functions will take when it was recovered and the other one sets a new time when it recovery again
now, inside the same class, but in "private:" add this:
Code:
unsigned long lastRecovery;
this is to store the time when it last recovered.
now, at WorldThread.cpp, in "checkStats" function, add this as the first line:
Code:
player->setLastCheck(GetTickCount());
this will update the last check each time it recoverys.
then, inside PlayerThread function, find "checkStats(thisplayer);" and put:
Code:
if (GetTickCount() - thisplayer->getLastCheck() > 2000)
before it, this code will garante to just run the functions each 2000 miliseconds(2 seconds).
_______________________________________________________________________________________________
Giving Skill Points when level Up:
go into Levels.cpp, into the giveExp function, add this
Code:
int player_level = player->getLevel();
int skp = player->getSp();
if (player_level <= 20)
skp += 2;
else if (player_level <= 40)
skp += 3;
else if (player_level <= 60)
skp += 4;
else if (player_level <= 80)
skp += 5;
else if (player_level <= 100)
skp += 6;
else if (player_level <= 120)
skp += 7;
player->setSp(skp);
after "player->setFp(player->getMaxFp(),true);"
it takes the player level(see it is after the setLevel, so it will get the new level of the player), then get the current SkillPoints, then checks for the player level until it find the level and add the proper sp for it level, then set it to the player.
note: you will have skillpoints but wont be able to distribute since the packet to it wasnt made yet.
_______________________________________________________________________________________________
Ban command:
at the begining of Players.cpp, add this:
Code:
#include "../Common/Database/MySQLM.h"
then, inside the same file, find chatProcessor function, find the last "else if" and it last "}", after it, insert this:
Code:
else if(_stricmp(command, "ban") == 0){ //check if it is the ban command
char* who = strtok_s(NULL, " ",&next_token); //take the next part just after the space after the ban word, wich is the player name
Player* who2 = getPlayerByName(who); //take the player by player name
int acc_id;
if (who2 != NULL) //if who2 is different of NULL, the player is online
{
who2->setAccessLevel(0); //sets it accesslevel ingame to 0
acc_id = who2->getOwner(); //takes the account id of that char
MySQL::setInt("accounts", "accesslvl", acc_id, 0); //update the accounts table changing its accesslevel to 0
}
else
{
char * sAcc_id = new char[]; //variable to store the account id from the characters table
MySQL::getString("characters", "name", who, "owner", sAcc_id); //takes the account id
acc_id = strval(sAcc_id); //take account id as integer
MySQL::setInt("accounts", "accesslvl", acc_id, 0); //update the accounts table changing its accesslevel to 0
delete[] sAcc_id; //delete sAcc_id from the memory(if you dont do, nobody will do for you in this case)
}
return true; //dont let !ban <player name> appears at the screen
}
_______________________________________________________________________________________________
Saving on logout:
inside MySQLM.cpp, find the setInt function, after it, add this:
Code:
void MySQL::setInt64(char* table, char* wht, int id, __int64 value){
setLastAccess(GetTickCount());
char query[255];
sprintf_s(query, 255, "update %s set %s='%u' where ID='%d';", table, wht, value, id);
mysql_real_query(&maple_db, query, strlen(query));
}
void MySQL::setFloat(char* table, char* wht, int id, float value){
setLastAccess(GetTickCount());
char query[255];
sprintf_s(query, 255, "update %s set %s='%f' where ID='%d';", table, wht, value, id);
mysql_real_query(&maple_db, query, strlen(query));
}
this is some code to put at the database floats and int64 values.
now, go to MySQLM.h and after the setInt declaration, put this:
Code:
static void setInt64(char* table, char* wht, int id, __int64 value);
static void setFloat(char* table, char* wht, int id, float value);
I dont know why and glaphan didnt answer but, the save function is declared as static, change it:
go to Player.h, find
Code:
static void save();
change to now, at WorldThread.cpp, find change to
Code:
thisplayer->save();
finally, go to Player.cpp and find the save function, put this inside:
Code:
setLastSave(GetTickCount());
MySQL::setInt("characters", "penya", getServerId(), inv->getPenya());
MySQL::setInt("characters", "haircolor", getServerId(), getHairColor());
MySQL::setInt("characters", "hair", getServerId(), getHair());
MySQL::setInt("characters", "face", getServerId(), getFace());
MySQL::setInt("characters", "gender", getServerId(), getGender());
MySQL::setInt("characters", "class", getServerId(), getJob());
MySQL::setInt64("characters", "exp", getServerId(), getExp());
MySQL::setInt("characters", "mp", getServerId(), getMP());
MySQL::setInt("characters", "fp", getServerId(), getFP());
MySQL::setInt("characters", "hp", getServerId(), getHp());
MySQL::setInt("characters", "level", getServerId(), getLevel());
MySQL::setInt("characters", "sta", getServerId(), getSta());
MySQL::setInt("characters", "intt", getServerId(), getIntt());
MySQL::setInt("characters", "dex", getServerId(), getDex());
MySQL::setInt("characters", "str", getServerId(), getStr());
MySQL::setFloat("characters", "posx", getServerId(), getPos(true).x);
MySQL::setFloat("characters", "posy", getServerId(), getPos(true).y);
MySQL::setFloat("characters", "posz", getServerId(), getPos(true).z);
MySQL::setInt("characters", "ap", getServerId(), getAp());
MySQL::setInt("characters", "sp", getServerId(), getSp());
this will get the values and update into the database.
Note: this is not saving inventory yet, I got some problems on making it and Im trying to figure it out.
Also, you can take the first tip on this guide(The fixing mp, fp and hp thing) and put it to save from time to time, but I think you can figure it out ;]
_______________________________________________________________________________________________
First step into fixing memory leaks problem
There is a problem that when you use, for example: "int x = new int;", you must do when you finish using it "delete x;", that happens because using the "new" keyword, it will create a space into the memory and unless you "delete" it, it wont get out of there(maybe when closing the program it does, I dont know). There is, for example at MySQLM.cpp, at the function that gets the items, it uses Equip* equip = new Equip(); inside a while statement. Lets say each Equip variable uses 13 bytes of memory...its not that much, but wait up. Since its inside a while statement that goes into all inventory slots, there can be a max of 74(I think its 74) items, making it take 962 bytes for each players that logins with a inventory full of equips. So, its almost 1kb for each player. But, its still not THAT much. Now, take a look at how many "new"'s dont have a "delete", it may get your memory full of crap and get it out of space.
Now that you now the theory, try to fix it :) search for each "new" and see if it have a delete.
One tip to make your look for "new"'s easier:
Google for "notepad++", install and run it, open all files at once inside it, ctrl+f(search box will appear), then right "new"(without quotes) and click search all opened files. Or you can use ctrl+f inside visual C++.
P.S.: If you dont know what you are doing, dont put any delete at your source.
_______________________________________________________________________________________________
Error "This id has been blocked" instead of "Your time is up":
When someone account is banned and he tryes to login, he gets a "Your time is up" message instead of "This id has been blocked", its a packet error(sending the wrong error ID).
To fix it, go to your login_server, go to login.cpp at loginUser function, find
Code:
case 2: LoginPacket::loginError(player, 0x80); break;
change the 0x80 to 0x77.
_______________________________________________________________________________________________
Not crashing client when GameServer isnt online:
This happens because even if there is no game server, it tryes to connect to it, making client crash if there isnt any game server. Lets add a check and a message for the user:
into your loginServer, go to LoginPacket.cpp, find the showWorld function, at the end, there is:
Code:
packet.packetSendLogin(player);
change it to
Code:
if (worlds.size() != 0)
packet.packetSendLogin(player);
else
LoginPacket::loginError(player, 0x88);
see about the login errors IDs at next section and change 0x88 to the error you want to be displayed.
_______________________________________________________________________________________________
Login Error IDs:
I tested all numbers between 100 and 255, didnt tested any before 100 so I dont know if there is any other error message.
Quote:
100 (0x64) - That ID is already in use
103 (0x67) - This account is already connected
107 (0x6B) - Old version of client
108 (0x6C) - Server capacity reach
109 (0x6D) - Service currently unavaiable, Please check flyff website for details
119 (0x77) - This ID has been blocked.
120 (0x78) - Wrong Password
121 (0x79) - Wrong ID.
122 (0x7A) - Account verification required. Please visit the flyff website.
123 (0x7B) - Sorry, children bellow 12 years of age are not permitted to play flyff
124 (0x7C) - The permission of a parent or guardian is required for players under 14 years old.
125 (0x7D) - Unable to connect to the game, account may have been terminated by user.
126 (0x7E) - No information about charging
127 (0x7F) - DB error
128 (0x80) - Your time is up
129 (0x81) - Other DB error
130 (0x82) - Other DB error
131 (0x83) - You cannot connect after 22:00
132 (0x84) - You cannot connect from outside the service for flyff
133 (0x85) - Your character is being checked at the moment. Please login after a while
134 (0x86) - Wrong password, cannot log into account for 15 seconds.
135 (0x87) - Wrong password 3 times. Cannot log into account for 15 minutes.
136 (0x88) - Server verification error
137 (0x89) - Session is over. Please try again
138 (0x8A) - Resource was falsified.
_______________________________________________________________________________________________
Changing exes place:
Open your sources folder, make a new folder called exe, copy your config file inside. Now open gameServer and loginServer. At the left side of the screen you will see "solution explorer", if you dont see look for it at the view menu(or press ctrl+alt+L), right click GameServer and then left click properties. Into configurations properties, click in "general" and find Output directory, change it value to "$(SolutionDir)\exe"(without quotes). Make this for both loginServer and gameServer. Now go to Build > build solution.
_______________________________________________________________________________________________
First step into not allowing login if account is logged:
For this to entire work, you would need to modify some things like changing online at the database to 1 on login and to 0 on logout, but, lets make the first step into this so people can take the packet of when you click YES to the message(This account is already connected) and try to make a disconnect script.
Here it goes:
At your login server, go to login.cpp, find this:
Code:
case 7: player->setUserName(username); player->setIsLogged(true); Worlds::showWorld(player); break;
and change to this:
Code:
case 7: LoginPacket::loginError(player, 0x67); break;
as you can see at my Login Errors ID at this tutorial, 0x67 is the already logged in message. Now, change into the database login to 1 and try to login xP
The next steps:
- Make the online at database change to 1 on login(I did make it but lost it due to some problems on my code, its kind of easy)
- Make the online at database change to 0 on logout(Dont look hard but I didnt look into it)
- Make the YES button disconnect the player(this is hard since you would need a disconnect script)
_______________________________________________________________________________________________
3 tryies to login:
OK, for this, first you need to add 2 collumns into your account table, and that is good because you can adaptate the C++ to php and use it on the login of your user CP as well.
The 2 collumns must be like this:
Code:
lastLoginTry, int(11), not null, default 0
numberOfTryies, int(11), not null, default 0
now, go to your loginServer, then at login.cpp, find the "switch(s)", change everything inside it to this:
Code:
case 0: player->setUserName(username); player->setIsLogged(true); Worlds::showWorld(player); break;
case 2: LoginPacket::loginError(player, 0x77); break; //ban
case 4: LoginPacket::loginError(player, 0x78); break; //wrong pass 1st
case 5: LoginPacket::loginError(player, 0x79); break; //invalid user
case 7: LoginPacket::loginError(player, 0x67); break; //already logged in
case 8: LoginPacket::loginError(player, 0x86); break; //wrong pass 2nd
case 9: LoginPacket::loginError(player, 0x87); break; //wrong pass 3rd
now, at checkLogin function, change everything inside it to this:
Code:
char rpassword[500];
if(!MySQL::isString("accounts","username", username)){
return 5; //invalid user
}
int tryies = MySQL::getInt("accounts", player->getUserid(), "numberOfTryies");
int lastTry = MySQL::getInt("accounts", player->getUserid(), "lastLoginTry");
int now = GetTickCount();
player->setUserid(MySQL::getUserID(username));
player->setAccessLevel(MySQL::getInt("accounts",player->getUserid(),"accesslvl"));
MySQL::getString("accounts","username",username,"password",rpassword);
if(strcmp(rpassword, password) == 0) {
if(MySQL::getInt("accounts",player->getUserid(),"online") == 1)
return 7; //already logged
if(player->getAccessLevel() < 100)
return 2; //player is banned
if ((tryies == 3) && (now - lastTry < 60000))
return 9;
else if ((tryies < 3) && (now - lastTry < 15000))
return 8;
else
{
MySQL::setInt("accounts", "lastLoginTry", player->getUserid(), GetTickCount());
MySQL::setInt("accounts", "numberOfTryies", player->getUserid(), 0);
return 0; //all ok
}
}
else
{
if ((tryies == 3) && (now - lastTry < 60000)) //15 minutes
{
return 9;
}
else
{
if ((tryies == 3) && (now - lastTry < 15000))
{
MySQL::setInt("accounts", "lastLoginTry", player->getUserid(), GetTickCount());
MySQL::setInt("accounts", "numberOfTryies", player->getUserid(), 0);
tryies = 0;
}
else
{
MySQL::setInt("accounts", "lastLoginTry", player->getUserid(), GetTickCount());
return 8;
}
}
if ((tryies == 0) || (tryies == 1))
{
MySQL::setInt("accounts", "lastLoginTry", player->getUserid(), GetTickCount());
MySQL::setInt("accounts", "numberOfTryies", player->getUserid(), tryies + 1);
return 4;
}
else if ((tryies < 3) && (now - lastTry < 15000))
{
MySQL::setInt("accounts", "lastLoginTry", player->getUserid(), GetTickCount());
return 8;
}
else
{
MySQL::setInt("accounts", "lastLoginTry", player->getUserid(), GetTickCount());
MySQL::setInt("accounts", "numberOfTryies", player->getUserid(), tryies + 1);
return 4;
}
return 9;
}
there it takes the values from database and if the pass is right, it tests if you can login(not wrong pass in the past) and if password is wrong it adds one to login tryies and return to the other function.
_______________________________________________________________________________________________
How to see the server and cluster:
Download this file: http://www.4shared.com/file/71744143...f7e/FlyFF.html
now, extract it into your flyff folder and run loader.bat, it will work greatly even with v12 client.
If my file dont exists anymore or you cant download it, download this one: http://rapidshare.com/files/15195151...f_v11_neuz.zip (Thanks to glaphanking for this one)
now, extrat it the same way, delete FlyffLaucher and create a run.bat(or any name.bat) and put this inside:
Code:
@echo off
echo Flyff Loader
Neuz.exe fameguy
run it by the .bat
Credits for the neuz.exe, I dont know, someone from FlyForFame ;)
_______________________________________________________________________________________________
Loading things(mobs for example):
Take the folder "databaseLoad" and put it at same folder you generate your exes(if you followed my other tip exactly like it is, it would be inside the "exe" folder. Now, go to your initializing.cpp file of gameServer. There is 4 lines like this:
Code:
char filename[50]="C:\\KiMS\\databaseLoad\\WdMadrigal.txt";
change all of them to this:
Code:
char filename[50]="databaseLoad\\WdMadrigal.txt";
then compile and run your login server then gameServer.
EDIT: it looks there is one file missing, donwload this and put inside your databaseLoad folder: http://www.4shared.com/file/71751641...abaseLoad.html
thanks to spikensbror for telling me to add this
_______________________________________________________________________________________________
Showing a [NOTICE]: <message> to players that login:
go to PlayersPacket.cpp, find a empty function called showMessage, put this inside:
Code:
Packet pak = Packet();
pak.setPlayer(player);
pak.addHeaderType2(0xff00ea);
pak.addString(msg,true);
pak.packetSendType2();
then, open Player.cpp, find this:
Code:
Server::showScrollingHeader(this);
(use ctrl+f to find it), uncomment it(take the // out)
then, into Server.cpp, find:
Code:
sprintf_s(msg,500,"KiFlyFF ~ Lulz");
and change "KiFlyFF ~ Lulz" to whatever you want.
Credits to Imortal :)
_______________________________________________________________________________________________
Optimazing time checks:
When you are going to check if its time to something like recovery hp/fp/mp(like I did on the first tip here), we was making this:
Code:
if (GetTickCount() - thisplayer->getLastCheck() > 2000)
that isnt good, it will subtract two numbers, then compare(not thinking about it taking the values from the functions), it might work fine with like 50 players and a decent computer.
You should instead, save when is the next check going to be and then compare it with the miliseconds to execute(2000 in this case).
So, you should define the variable and use the functions like they are now, but, with another name for better comprehension when you check your code again. It could be:
Code:
unsigned long nextRecovery;
unsigned long getNextCheck(){
return nextRecovery;
}
void setNextCheck(unsigned long value){
nextRecovery = value;
}
instead of
Code:
unsigned long lastRecovery;
unsigned long getLastCheck(){
return lastRecovery;
}
void setLastCheck(unsigned long value){
lastRecovery = value;
}
Then, when you are going to update the last check like this:
Code:
player->setLastCheck(GetTickCount());
do this instead:
Code:
player->setNextCheck(GetTickCount() + 2000);
So it will make less counts so better performance
Credits to Caali :)
_______________________________________________________________________________________________
Item command(UPDATE)
The item command that was here wasnt something big, it didnt work properly and there was a function that makes the same thing, so here is an update.
GlaphanKing made it work here: http://forum.ragezone.com/f457/share...-v1-0-a-539151
But there is a problem, if you dont put the parameters(like "!item 21" should put 1 wooden sword since there is no quantity) it will crash, here is how to have a default value:
Code:
int itemid = -1;
char * cItemId = "";
if (cItemId = strtok_s(NULL, " ",&next_token)) //take the item id
itemid = atoi(cItemId); //if the parameter was set, makes it int
else
return true; //else, return true so it doesnt show !item
int itemqty = 1; //default value comes here
int itemPlus = 0; //default value comes here
int itemElement = 0; //default value comes here
int itemElemPlus = 0; //default value comes here
int itemSockets = 0; //default value comes here
char * cItemQty = "";
char * cItemPlus = "";
char * cItemElement = "";
char * cItemElemPlus = "";
char * cItemSockets = "";
if (cItemQty = strtok_s(NULL, " ",&next_token))
itemqty = atoi(cItemQty); //if the parameter was set, it takes it to the correct variable
if (cItemPlus = strtok_s(NULL, " ",&next_token))
itemPlus = atoi(cItemPlus); //if the parameter was set, it takes it to the correct variable
if (cItemElement = strtok_s(NULL, " ",&next_token))
itemElement = atoi(cItemElement); //if the parameter was set, it takes it to the correct variable
if (cItemElemPlus = strtok_s(NULL, " ",&next_token))
itemElemPlus = atoi(cItemElemPlus); //if the parameter was set, it takes it to the correct variable
if (cItemSockets = strtok_s(NULL, " ",&next_token))
itemSockets = atoi(cItemSockets); //if the parameter was set, it takes it to the correct variable
after this, use the int variables as you want.
This can be used at every GM command, just change it to your needs.
_______________________________________________________________________________________________
Saving Incoming and Outgoing packets into log files
If you are testing some packets you sniffed, it would be of great use to have a copy of it in a txt so you can separe it like this:
Quote:
5e = flyff packets header
54 00 00 00 = packet lenght
00 ff ff ff
00 00 00 00
01 00 = number of commands in the packet
and understand better the packet. It is kind of impossible to put a "printf" on the packet and using notepad you copy it number by number, so here is a small tip to have it on a file in your .exe folder.
Incoming packets:
this is the same for both login and game servers, at player.cpp, find the function "bool Player::processRecv(recvPacket* pak)", then, inside it find the first "switch", before the switch add this:
Code:
FILE * pFile; //defines the file
pFile = fopen("packet_log.log", "a"); //open/create if not exists the file packet_log.log in "append mode", meaning it will add things at end of file, not emptying it
if (pFile!=NULL) //if file exists
fprintf (pFile, "Client -> Server: "); //put at the file a text so you differ incoming and outgoing packets
for(int i=0;i<len;i++){ //for packet lenght
if (pFile!=NULL) //if file exists
fprintf (pFile, "%02x ",buf[i]); //put the buf at the file
}
if (pFile!=NULL) //if file exists
{
fprintf (pFile, "\n"); //go to next line
fclose (pFile); //close the file
}
now, outgoing packets:
. both game and login Servers:
open PacketHandler.cpp inside this function "void PacketHandler::sendPacket(unsigned char *buff, int size)", find the try, before the "send(socket, (const char*)bufs, size+5, 0);" function, add this:
Code:
FILE * pFile;
pFile = fopen("packet_log.log", "a");
if (pFile!=NULL)
fprintf (pFile, "Server -> Client: ");
for(int i=0;i<size;i++){
if (pFile!=NULL)
fprintf (pFile, "%02x ",buff[i]);
}
if (pFile!=NULL)
{
fprintf (pFile, "\n");
fclose (pFile);
}
_______________________________________________________________________________________________
UPDATES
UPDATE #1: 13/11/2008(dd/mm/YYYY)
Added "fixing memory leaks problem"
UPDATE #2: 15/11/2008(dd/mm/YYYY)
Added "Correcting client error message", not crashing when no GameServer is running and Login Error IDs
UPDATE #3: 15/11/2008(dd/mm/YYYY)
How to get yours exe
UPDATE #4: 16/11/2008(dd/mm/YYYY)
Added 2 more things on loginServer, one thing about neuz and one thing at gameServer loading
UPDATE #5: 18/11/2008(dd/mm/YYYY)
Added things that people contributed(Show welcome message and optimazing your server)
UPDATE #6: 31/12/2008(dd/mm/YYYY)
Fixed one thing at ban command, added item command(not complete) and saving packets into a log file
UPDATE #6: 13/02/2009(dd/mm/YYYY)
Updated items command
_______________________________________________________________________________________________
Thats a good start for everyone, lets get it to 100%!
I tryied to made it clear, I wish you guys got it.
Credits: The source credits is at its page, go to it at the begining of this post, this guide and its content is credit to me(what is not mine is well credit just after the tip) :)
Re: Some things to Dragon Source
I will reserve this place to post more things, I will keep on posting my progress on this topic, so this post is reserved for the future.
Re: Some things to Dragon Source
Thanks BBim, i will try all that you have put, but if i can't compile it canno't test it, need to wait glaphan post on serve source edit
Re: Some things to Dragon Source
Quote:
Originally Posted by
ayboangelus
Thanks BBim, i will try all that you have put, but if i can't compile it canno't test it, need to wait glaphan post on serve source edit
I didnt post the source with the changes because I dont want people to just download and compile, I want everyone to learn, following this guide you will learn at least one little thing(for example, how to add GMs commands, execute sql querys, etc).
;]
Re: Some things to Dragon Source
Great.
Into this way we can create stable files.
Re: Some things to Dragon Source
Let it be known that BBim has been recorded as the first public contributor (excluding team) on RageZone. Good job sir. You are doing your community proud.
Re: Some things to Dragon Source
from caali wars to a comminity where people can work on working files.... Ragezone isnt so bad now.
Re: Some things to Dragon Source
glaphan in your source, skills and shop are disable, not ?
You are working on it ?
Re: Some things to Dragon Source
Nice guide but i have one problem.
I can`t compile it -.- I have some errors.
When i want compile Game Server i get it:
Code:
1>------ Build started: Project: Connection, Configuration: Debug Win32 ------
1>Creating library...
1>Build log was saved at "file://d:\Glaphan King\DragonFlyFF_Source\Connection\Debug\BuildLog.htm"
1>Connection - 0 error(s), 0 warning(s)
2>------ Build started: Project: GameServer, Configuration: Debug Win32 ------
2>Compiling...
2>FlyFFServer.cpp
2>Config.cpp
2>Inventory.cpp
2>Levels.cpp
2>Player.cpp
2>PlayerInventory.cpp
2>Players.cpp
2>Server.cpp
2>d:\glaphan king\dragonflyff_source\gameserver\config.h(202) : error C2770: invalid explicit template argument(s) for 'T ConfigFile::string_as_T(const std::string &)'
2> d:\glaphan king\dragonflyff_source\gameserver\config.h(102) : see declaration of 'ConfigFile::string_as_T'
2> d:\glaphan king\dragonflyff_source\gameserver\server.cpp(130) : see reference to function template instantiation 'bool ConfigFile::readInto<char[50]>(T (&),const std::string &) const' being compiled
2> with
2> [
2> T=char [50]
2> ]
2>ServerPacket.cpp
2>World.cpp
2>MySQLM.cpp
2>d:\glaphan king\dragonflyff_source\common\database\mysqlm.cpp(138) : warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
2> c:\program files\microsoft visual studio 9.0\vc\include\string.h(74) : see declaration of 'strcpy'
2>d:\glaphan king\dragonflyff_source\common\database\mysqlm.cpp(154) : warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
2> c:\program files\microsoft visual studio 9.0\vc\include\string.h(74) : see declaration of 'strcpy'
2>tinyxmlparser.cpp
2>InventoryPacket.cpp
2>MobPacket.cpp
2>MobsPacket.cpp
2>MoverPacket.cpp
2>NPCsPacket.cpp
2>PacketCreator.cpp
2>PlayerPacket.cpp
2>PlayersPacket.cpp
2>Generating Code...
2>Compiling...
2>ShopPacket.cpp
2>Initializing.cpp
2>tinystr.cpp
2>tinyxml.cpp
2>tinyxmlerror.cpp
2>Timer.cpp
2>TimerTest.cpp
2>NPC.cpp
2>NPCs.cpp
2>WorldThread.cpp
2>log.cpp
2>Mob.cpp
2>Mobs.cpp
2>Swarm.cpp
2>d:\glaphan king\dragonflyff_source\gameserver\mersennetwister.h(132) : warning C4146: unary minus operator applied to unsigned type, result still unsigned
2>d:\glaphan king\dragonflyff_source\gameserver\mersennetwister.h(265) : warning C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
2> c:\program files\microsoft visual studio 9.0\vc\include\stdio.h(237) : see declaration of 'fopen'
2>Swarms.cpp
2>Mover.cpp
2>Movers.cpp
2>MoverTemplates.cpp
2>ItemBank.cpp
2>ItemBanks.cpp
2>Generating Code...
2>Compiling...
2>Shops.cpp
2>Generating Code...
2>Build log was saved at "file://d:\Glaphan King\DragonFlyFF_Source\GameServer\Debug\BuildLog.htm"
2>GameServer - 1 error(s), 4 warning(s)
========== Build: 1 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
And when i want compile Login Server i get it:
Code:
1>------ Build started: Project: Connection, Configuration: Debug Win32 ------
1>Compiling...
1>PacketHandler.cpp
1>Selector.cpp
1>Acceptor.cpp
1>Generating Code...
1>Creating library...
1>Build log was saved at "file://d:\Glaphan King\DragonFlyFF_Source\Connection\Debug\BuildLog.htm"
1>Connection - 0 error(s), 0 warning(s)
2>------ Build started: Project: LoginServer, Configuration: Debug Win32 ------
2>Compiling...
2>FlyFFServer.cpp
2>Characters.cpp
2>Items.cpp
2>log.cpp
2>Login.cpp
2>Player.cpp
2>Server.cpp
2>Worlds.cpp
2>MySQLM.cpp
2>d:\glaphan king\dragonflyff_source\common\database\mysqlm.cpp(138) : warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
2> c:\program files\microsoft visual studio 9.0\vc\include\string.h(74) : see declaration of 'strcpy'
2>d:\glaphan king\dragonflyff_source\common\database\mysqlm.cpp(154) : warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
2> c:\program files\microsoft visual studio 9.0\vc\include\string.h(74) : see declaration of 'strcpy'
2>LoginPacket.cpp
2>PacketCreator.cpp
2>Initializing.cpp
2>tinystr.cpp
2>tinyxml.cpp
2>tinyxmlerror.cpp
2>tinyxmlparser.cpp
2>Generating Code...
2>Compiling manifest to resources...
2>Microsoft (R) Windows (R) Resource Compiler Version 6.0.5724.0
2>Copyright (C) Microsoft Corporation. All rights reserved.
2>Linking...
2>Embedding manifest...
2>Microsoft (R) Windows (R) Resource Compiler Version 6.0.5724.0
2>Copyright (C) Microsoft Corporation. All rights reserved.
2>Build log was saved at "file://d:\Glaphan King\DragonFlyFF_Source\LoginServer\Debug\BuildLog.htm"
2>LoginServer - 0 error(s), 2 warning(s)
========== Build: 2 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
Can you help me?
Re: Some things to Dragon Source
skills are not implemented yet. as for shops, they are composed of complexed vector of vectors. although I might have it load like caali did it, but more on the fly. It would entail loading from a simple text file for each shop.
Just some ideas I have been throwing around the drawing board.
Re: Some things to Dragon Source
ok, thanks for your answer.
Snow_man search a little we have answer to your question in other thread
Re: Some things to Dragon Source
@SM Those are simple errors that Galphan purposely placed in so that he would have real developers and not leechers working upon his program. Like myself I know little about C++, but that makes me a novice developer of C++ and not a complete sp00nfed leech
Re: Some things to Dragon Source
Thanks BBim you great and GlaphanKing its will be good if you will be insert this therad link into your theard of source release for fixs... =)
Re: Some things to Dragon Source
SOMEONE CAN HELP ME??
And i have 1 more question: How to do .exe file.
I can`t compile it -.- I have some errors.
When i want compile Game Server i get it:
Code:
1>------ Build started: Project: Connection, Configuration: Debug Win32 ------
1>Creating library...
1>Build log was saved at "file://d:\Glaphan King\DragonFlyFF_Source\Connection\Debug\BuildLog.htm"
1>Connection - 0 error(s), 0 warning(s)
2>------ Build started: Project: GameServer, Configuration: Debug Win32 ------
2>Compiling...
2>FlyFFServer.cpp
2>Config.cpp
2>Inventory.cpp
2>Levels.cpp
2>Player.cpp
2>PlayerInventory.cpp
2>Players.cpp
2>Server.cpp
2>d:\glaphan king\dragonflyff_source\gameserver\config.h(202) : error C2770: invalid explicit template argument(s) for 'T ConfigFile::string_as_T(const std::string &)'
2> d:\glaphan king\dragonflyff_source\gameserver\config.h(102) : see declaration of 'ConfigFile::string_as_T'
2> d:\glaphan king\dragonflyff_source\gameserver\server.cpp(130) : see reference to function template instantiation 'bool ConfigFile::readInto<char[50]>(T (&),const std::string &) const' being compiled
2> with
2> [
2> T=char [50]
2> ]
2>ServerPacket.cpp
2>World.cpp
2>MySQLM.cpp
2>d:\glaphan king\dragonflyff_source\common\database\mysqlm.cpp(138) : warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
2> c:\program files\microsoft visual studio 9.0\vc\include\string.h(74) : see declaration of 'strcpy'
2>d:\glaphan king\dragonflyff_source\common\database\mysqlm.cpp(154) : warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
2> c:\program files\microsoft visual studio 9.0\vc\include\string.h(74) : see declaration of 'strcpy'
2>tinyxmlparser.cpp
2>InventoryPacket.cpp
2>MobPacket.cpp
2>MobsPacket.cpp
2>MoverPacket.cpp
2>NPCsPacket.cpp
2>PacketCreator.cpp
2>PlayerPacket.cpp
2>PlayersPacket.cpp
2>Generating Code...
2>Compiling...
2>ShopPacket.cpp
2>Initializing.cpp
2>tinystr.cpp
2>tinyxml.cpp
2>tinyxmlerror.cpp
2>Timer.cpp
2>TimerTest.cpp
2>NPC.cpp
2>NPCs.cpp
2>WorldThread.cpp
2>log.cpp
2>Mob.cpp
2>Mobs.cpp
2>Swarm.cpp
2>d:\glaphan king\dragonflyff_source\gameserver\mersennetwister.h(132) : warning C4146: unary minus operator applied to unsigned type, result still unsigned
2>d:\glaphan king\dragonflyff_source\gameserver\mersennetwister.h(265) : warning C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
2> c:\program files\microsoft visual studio 9.0\vc\include\stdio.h(237) : see declaration of 'fopen'
2>Swarms.cpp
2>Mover.cpp
2>Movers.cpp
2>MoverTemplates.cpp
2>ItemBank.cpp
2>ItemBanks.cpp
2>Generating Code...
2>Compiling...
2>Shops.cpp
2>Generating Code...
2>Build log was saved at "file://d:\Glaphan King\DragonFlyFF_Source\GameServer\Debug\BuildLog.htm"
2>GameServer - 1 error(s), 4 warning(s)
========== Build: 1 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
And when i want compile Login Server i get it:
Code:
1>------ Build started: Project: Connection, Configuration: Debug Win32 ------
1>Compiling...
1>PacketHandler.cpp
1>Selector.cpp
1>Acceptor.cpp
1>Generating Code...
1>Creating library...
1>Build log was saved at "file://d:\Glaphan King\DragonFlyFF_Source\Connection\Debug\BuildLog.htm"
1>Connection - 0 error(s), 0 warning(s)
2>------ Build started: Project: LoginServer, Configuration: Debug Win32 ------
2>Compiling...
2>FlyFFServer.cpp
2>Characters.cpp
2>Items.cpp
2>log.cpp
2>Login.cpp
2>Player.cpp
2>Server.cpp
2>Worlds.cpp
2>MySQLM.cpp
2>d:\glaphan king\dragonflyff_source\common\database\mysqlm.cpp(138) : warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
2> c:\program files\microsoft visual studio 9.0\vc\include\string.h(74) : see declaration of 'strcpy'
2>d:\glaphan king\dragonflyff_source\common\database\mysqlm.cpp(154) : warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
2> c:\program files\microsoft visual studio 9.0\vc\include\string.h(74) : see declaration of 'strcpy'
2>LoginPacket.cpp
2>PacketCreator.cpp
2>Initializing.cpp
2>tinystr.cpp
2>tinyxml.cpp
2>tinyxmlerror.cpp
2>tinyxmlparser.cpp
2>Generating Code...
2>Compiling manifest to resources...
2>Microsoft (R) Windows (R) Resource Compiler Version 6.0.5724.0
2>Copyright (C) Microsoft Corporation. All rights reserved.
2>Linking...
2>Embedding manifest...
2>Microsoft (R) Windows (R) Resource Compiler Version 6.0.5724.0
2>Copyright (C) Microsoft Corporation. All rights reserved.
2>Build log was saved at "file://d:\Glaphan King\DragonFlyFF_Source\LoginServer\Debug\BuildLog.htm"
2>LoginServer - 0 error(s), 2 warning(s)
========== Build: 2 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
Can you help me?
Someone can do guide How correctly to do compiling??
Re: Some things to Dragon Source
@You compile it to make the .exe. If you can't compile it it means you need to fix the errors that Glaphan has placed in there.