Jump to content

I need some explanations for some codes in C++


Go to solution Solved by JachuPL,

Recommended Posts

  • Former Staff

Hello guys I'm a bit confused with some of the functions in the server source first thing 

 

I'm reading the source at the moment trying to understand how it's work (I'm not talking about how the server is working with the cores and db ....etc)I'm talking about some functions like this

	if (GetHorseLevel() <= 0)
		return;

now this means that if the horse level is less or equals "0" don't continue ....

 

now the problem is when I click (right-click) on this "GetHorseLevel" (I'm using VS2013) and click on "Go To definition" it sends me to  "CHorseRider class" in horse_rider.h

 

now the thing i can't understand is how the source gets the level of the horse  ???

 

there are a lot of other things like this (i can't under stand) but i think if I realized this function i'll understand the others

 

Sorry for bad english 

        Best Regards

               FlyGun :P

Link to comment
Share on other sites

 

The function from the CHorseRider class tells you how it gets the horse level o.O

no O.o ... can you show me the code that's tells you this ??? the horse level is taken from the sql table but how ??

 

 

find CHARACTER::SetPlayerProto and you will know. The definition of the struct passed in param is inside common/tables.h

Link to comment
Share on other sites

  • Former Staff

 

 

The function from the CHorseRider class tells you how it gets the horse level o.O

no O.o ... can you show me the code that's tells you this ??? the horse level is taken from the sql table but how ??

 

 

find CHARACTER::SetPlayerProto and you will know. The definition of the struct passed in param is inside common/tables.h

 

thanks ... i found the struct "struct    THorseInfo" ... i'll read some code now

Link to comment
Share on other sites

  • Former Staff

 

 

The function from the CHorseRider class tells you how it gets the horse level o.O

no O.o ... can you show me the code that's tells you this ??? the horse level is taken from the sql table but how ??

 

 

find CHARACTER::SetPlayerProto and you will know. The definition of the struct passed in param is inside common/tables.h

 

ok ... i see the tables and everything ... how this tables get there informationes   from the database (sql) ??

Link to comment
Share on other sites

  • Solution

On start, game sends packet to DB HEADER_GD_BOOT or sth like that. DB collects all the necessary data, pack it and returns to game. Game gets initialized with data get from DB and it launches. If the data is wrong, game shuts down.

 

 

For a player, your client sends HEADER_CG_LOGIN3 packet to game. Game forwards this packet to DB. DB gets the packet, selects all the data from table (look for QUERY_PLAYER_LOAD or sth like that) and returns it to game.

  • Love 1
Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.