StormByte Posted July 25, 2015 Report Share Posted July 25, 2015 (edited) Hi there, this question is specially directed to trinity devs, as I am very curious (note: only for curiosity sake, it is not my intention to put any kind of pressure on opcode implementing!).I've read the opcode implementation, but I have to say there is a thing I did not get correctly.I only saw in code, the definition of the opcode macro name, along with the class which is responsible to handle it, and it is being registered as UNHANDLED, NEVER, etc.. But what I did not find, is the opcode value itself.Am I wrong guessing that opcodes are sent in binary with some value and format, like <opcode_value><opcode_param1><opcode_param2> and the like? I always thought that the value for loot=1, cast=2, etc (only examples).How do they work? This is the part I have missing long time to learn how it work, but from my point of view, and my guessing, it is very similar to what a CPU receive.Any hint on this? EDIT: I recently saw https://github.com/TrinityCore/TrinityCore/blob/6.x/src/server/game/Server/Protocol/Opcodes.h which was exactly what I was looking for. So just a question missing, when an opcode is missing implementation? Is it because the opcode value changed, because there is no code to "construct" the packet, both? Thanks for the clarify, I just want to understand the work done here better Edited July 25, 2015 by StormByte 1 Link to comment Share on other sites More sharing options...
Unknow64 Posted July 25, 2015 Report Share Posted July 25, 2015 I'm also interested Link to comment Share on other sites More sharing options...
Warpten Posted July 25, 2015 Report Share Posted July 25, 2015 Link to comment Share on other sites More sharing options...
Nay Posted July 25, 2015 Report Share Posted July 25, 2015 Packet opcodes and structs are reverse engineered from the client. You can find a bit about that from the WPP projectPackets have a header and a body. In the header it's defined the direction (client->server, server->client), the timestamp it was sent, the opcode id and some other fields. The body is simply a bunch of bytes that only make sense once the opcode is known.Here's an example of reading a packet: https://github.com/TrinityCore/WowPacketParser/blob/master/WowPacketParser/Parsing/Parsers/GuildHandler.cs#L705-L712 1 Link to comment Share on other sites More sharing options...
Unknow64 Posted July 26, 2015 Report Share Posted July 26, 2015 Packet opcodes and structs are reverse engineered from the client. You can find a bit about that from the WPP projectPackets have a header and a body. In the header it's defined the direction (client->server, server->client), the timestamp it was sent, the opcode id and some other fields. The body is simply a bunch of bytes that only make sense once the opcode is known.Here's an example of reading a packet: https://github.com/TrinityCore/WowPacketParser/blob/master/WowPacketParser/Parsing/Parsers/GuildHandler.cs#L705-L712Thanks Nay Link to comment Share on other sites More sharing options...
Recommended Posts