Author | Message | Time |
---|---|---|
LockesRabb | [quote]Message ID: 0x0B Message Name: SID_GETCHANNELLIST Direction: Server -> Client (Received) Format: (STRINGLIST) Channel names, terminated by a null string. Remarks: Contains a list of available channels.[/quote] BNETDocs says stringlist, and I'm at a loss as to exactly what a stringlist is. Is a stringlist pretty much a single string and can be just put inside a string variable, or is there a different way stringlist is supposed to be handled? Also, it says 'Terminated by a null string'-- is that in reference to EACH channel string being terminated by a null string, or the entire stringlist ENDING with a null string? I'm lost... Thanks for any help, and for reading this! | September 12, 2005, 9:07 PM |
KkBlazekK | According to BNETDocs, STRING Null-terminated array of characters. STRING[] An array of strings (see above). This type is generally only used when another field in the packet specifies how many entries there are. STRINGLIST A series of strings (see above) with an additional null-terminator at the end. | September 12, 2005, 9:24 PM |
Myndfyr | To make this even more clear, let's go with the 3 strings "123", "456", "789". If this were a string[], it would be represented in-memory (and in-packet) as: [code] 31 32 33 00 34 35 36 00 37 38 39 00 [/code] Often, a memory or packet location will tell the reader how many strings there are. If it were a string list, it would be: [code] 31 32 33 00 34 35 36 00 37 38 39 00 00 [/code] Note the extra null character. This tells a reader that it can stop reading. And yes, I chose numerical digits because they're easy-to-remember codes. :P | September 12, 2005, 11:04 PM |
LockesRabb | So, for STRINGLIST, I just read the string, and use CHR(0) as the delimiter when I use the Split function on it, then use a for next array to display each item in the array? | September 12, 2005, 11:10 PM |
Myndfyr | For a stringlist I wouldn't use the Split() function. I'd go with reading it in a stream-like fashion. | September 13, 2005, 12:13 AM |
LockesRabb | [quote author=MyndFyre link=topic=12788.msg127916#msg127916 date=1126570401] For a stringlist I wouldn't use the Split() function. I'd go with reading it in a stream-like fashion. [/quote] Could you give an example, because I'm not really sure what you mean by 'steam-like fashion'? | September 13, 2005, 12:14 AM |