Initiate Mage
- Joined
- Nov 6, 2016
- Messages
- 3
- Reaction score
- 0
First of all, that's a very informative response, thank you.
I see, did you actually xref'd the values to check that ? (Just curious)
:Facepalm:, I thought Message.Encode deos something else haha, thank you for enlightening me.
I did not know about BMS files, I just downloaded them and they actually include the server files (&pdb) and their server structure (Channel/World/Login - Center/Game/Login), But I did not find the database files, any case you have them ?
Edit: did not see PacketBakery's response.
I reckon they have, thank you for responding nevertheless
Correct. Following Nexon's styles, User-related handling belongs in CUser, so this class would be inside of his User class itself. An incoming packet would go from ClientSocket.ProcessPacket, filter down to ClientSocket.ProcessUserPacket, and if the pUser (User reference) isn't null, it should call to pUser.OnPacket, which will hit both of the provided functions from a switch. CharacterData is the portion of User encoded within SetField.
As for your question towards the client reading in CharacterData, not all but most of all that data is indeed read in entirely by the client within CharacterData:ecode (the rest of the variables are handled from the data you do send/read). You can control how much you want to Encode or Decode through the "DBChar" flag which is the first 8-byte flag in the Encode packet. In higher versions there are some classes that are encoded always, regardless of flag though..sadly.
I see, did you actually xref'd the values to check that ? (Just curious)
As for Message.Encode, that shouldn't be an inner-class within User, it should just be a Message class. The way Nexon handles "Message" (or CWvsContext::OnMessage) is through 10 different functions leading to a major function with massive amounts of parameters. To simplify it, we just made a class. In this case the MessageResult enum points to SystemMessage, which is going to display the common "Red" notice equivalent to ServerNotice 5 in OdinMS. It is actually its own function (SendSystemMessage to be exact, like @Fraysa was pointing out), but he just sends the packet itself here. However.. assuming the Encode is a standard static OutPacket returned function like it's supposed to be, then it should be passed into SendPacket, as that won't do anything at all currently -- Encode just means to write data within that class.
:Facepalm:, I thought Message.Encode deos something else haha, thank you for enlightening me.
From a server-end standpoint, you may refer to BMS v53's files. This will help explain the similarities between Nexon's client-end and server-end if you wish to know more. The point of CharacterData is to simply split up a character's Items, Skill Data, and their Records (Mini Game information, Rings/Marriage information, etc) from the main User class and have it all stored and encoded elsewhere. CharacterData also holds an additional class reference for GW_CharacterStat which holds the character's stat information, and all of this is the data that Nexon saves/loads from their databases (plus, this is the information they send between servers to migrate your character). This is why it makes sense to why they store the matrix here as it was done. ;P
I did not know about BMS files, I just downloaded them and they actually include the server files (&pdb) and their server structure (Channel/World/Login - Center/Game/Login), But I did not find the database files, any case you have them ?
Edit: did not see PacketBakery's response.
It seems the people above me explained it pretty well, GetCharacterData is just retrieving the reference of my CharacterData class via an initialized variable in User. All of my User related decode packets (handlers) are inside my user class.
Message is not an inner class but it's own class. It is a switch case encode for the packet using opcode "Message".
I reckon they have, thank you for responding nevertheless