Personally I have not delved far into Diablo's Packets and Network Protocols, but I will share what little I do know here. There is also information I'll share pertaining to vanilla D3 because I'd imagine it's largly the same for ROS aswell (though I will strictly note this when I do). And if not, will atleast help push some understanding into how blizzard does things. I will update this if I ever delve farther into it, or if any of you have a greater knowledge of this topic and wish to contribute then please, be my guest.
Blizzard uses Protocol Buffers in its networking code. Protocol Buffers are a way of encoding structured data in an efficient yet extensible format.
Read more here...
Blizzard is using a deprecated RPC implementation that comes with protobuf 2.3. It works like this: there are services provided on both sides of the connection; packets are wrapped by the RPC headers, and there is a basic service attached when the connection starts (connection.proto, which id is 0). The client will ask the server to attach more services using the BindRequest imported_hash and will tell the server that it attached service providers using BindRequest exported_entry (hash and id) so that the server can make requests like LoadModuleRequest to the client.
Main header:
uint8 service
varint32 method
uint16 requestid
varint64 unknown
varint32 datasize
If the service byte is 0xFE (constant RPC call response), the unknown field is not present:
uint8 service
varint32 method
uint16 requestid
varint32 datasize
The rest of the packet should be at least equal to datasize. Note that messages can be chained in a single packet.
(Diablo 3, likely similar for ROS)
>>> ConnectRequest
<<< ConnectResponse
>>> BindRequest
<<< BindResponse
>>> BindRequest
<<< BindResponse
>>> LogonRequest
uint8 service;
varint32 method;
uint16 requestid; // incremental
varint64 unknown;
varint32 datasize;
- The client does a BindRequest with information (hashes) about a specific service, and then the server returns a BindResponse with an SID.
- These SIDs are later used by the client to communicate with the different services.
- 0x00 is the base service. It does not require binding.
Credit for a a good majority of this page goes out to a priject that sadly no longer exists. However can still be seen here:
WayBack: diablo3dev.com/