In order to make use of the Battle.net Diablo II realms, you must be successfully logged onto your account. See Logon Sequences for the Diablo II logon sequence.
The following is the suggested sequence (begin after receiving [0x3A] SID_LOGONRESPONSE2):
- C > S [0x40] SID_QUERYREALMS2 (optional)
- Requests list of realms for this Battle.net server.
- S > C [0x40] SID_QUERYREALMS2 (if requested)
- Contains list of realms.
- C > S [0x3E] SID_LOGONREALMEX
- Realm logon challenge to Battle.net.
- S > C [0x3E] SID_LOGONREALMEX
- Realm logon response. Contains information to connect to MCP server.
Connect to MCP server whose IP address and port are found in the
SID_LOGONREALMEX response. Send all MCP packets to this server.
Send protocol byte
0x01 to MCP server, the same first byte you sent to connect to Battle.net.
- C > S [0x01] MCP_STARTUP
- Send data from SID_LOGONREALMEX response to MCP server.
- S > C [0x01] MCP_STARTUP
- Upon success, you should now request a list of characters. It is not required, but for perfect emulation you should request it.
- C > S [0x19] MCP_CHARLIST2 (optional)
- Requests a list of characters from the server.
- S > C [0x19] MCP_CHARLIST2 (if requested)
- Contains a list of characters including their name, expiration date, type, class, level, etc.
After that sequence, the rest is up to you. You may create characters, delete characters, logon characters, upgrade characters, or just reconnect to the realm again for fun.