• Welcome to Valhalla Legends Archive.
 

Can't send channel list [b.net emu, heh]

Started by Lycaon, September 01, 2004, 06:01 AM

Previous topic - Next topic

Lycaon

I'm screwing around programming, and am currently writing a server emu for kicks.  Got a small problem though.

To start off simple, I'm only working with the original Diablo at the moment.  Clients can log in just fine, however, when I try to send an edited channel list to the client, it just sits there and says 'waiting for response.'  Now, if I snag a serverlist packet when I log in for real, then send that to my client later, it works just fine, but as soon as I remove a channel out of the packet, it sticks.

The original packet looks like this:


FF 0B 0B 01 42 6C 69 7A 7A 61 72 64 20 54 65 63     ΓΏ Blizzard Tec
68 20 53 75 70 70 6F 72 74 00 4F 70 65 6E 20 54     h Support.Open T
65 63 68 20 53 75 70 70 6F 72 74 00 42 65 67 69     ech Support.Begi
6E 6E 65 72 73 20 4F 6E 6C 79 00 54 6F 77 6E 20     nners Only.Town
53 71 75 61 72 65 00 54 72 61 64 69 6E 67 20 50     Square.Trading P
6F 73 74 00 41 64 76 65 6E 74 75 72 65 72 73 20     ost.Adventurers
57 61 6E 74 65 64 00 42 6F 75 6E 74 79 20 48 75     Wanted.Bounty Hu
6E 74 65 72 73 00 47 75 69 6C 64 20 52 65 63 72     nters.Guild Recr
75 69 74 6D 65 6E 74 00 47 75 69 6C 64 20 4D 65     uitment.Guild Me
6D 62 65 72 73 00 57 61 72 72 69 6F 72 73 20 41     mbers.Warriors A
72 65 6E 61 00 52 6F 67 75 65 73 20 47 61 6C 6C     rena.Rogues Gall
65 72 79 00 53 6F 63 72 65 72 73 20 54 6F 77 65     ery.Socrers Towe
72 00 56 65 74 65 72 61 6E 73 20 4C 6F 75 6E 67     r.Veterans Loung
65 20 28 4C 32 30 2B 29 00 54 68 65 20 42 6C 61     e (L20+).The Bla
63 6B 20 4C 6F 75 6E 67 65 20 28 4C 33 30 2B 29     ck Lounge (L30+)
00 48 65 6C 6C 27 73 20 43 61 72 65 74 61 6B 65     .Hell's Caretake
72 73 20 28 4C 33 30 2B 29 00 00                   rs (L30+)..


All it is is FF 0B 0B 01, followed by a list of null-terminated strings, then one last Chr(0) to end the packet.  Now, FF is the beginning of the packet, the first 0B is the command / packet ID, not sure what the third and fourth are.  The third can't be the number of strings, there are 15 channels and 0B = 11, not 15.  The fourth byte, 1, has me stumped.

I can remove the first, and change the length of some, but it seems to randomly fail...

Can anyone shed some light on this?

Lycaon

Nevermind, I forgot the byte order was reversed.  the 0B 01 is really 010b, or 267, the length of the packet.  Doh!