• Welcome to Valhalla Legends Archive.
 

BNCS 0x09! help please.

Started by brew, April 01, 2007, 06:43 AM

Previous topic - Next topic

brew

So on Bnetdocs, I looked up the 0x09 for getting a game list, and apparently there are four "product specific conditions", and it tells you what only the first condition is (game type), and none of the others.  Does anyone have any idea what the other three are?
<3 Zorm
Quote[01:08:05 AM] <@Zorm> haha, me get pussy? don't kid yourself quik
Scio te esse, sed quid sumne? :P

Ersan

Try using search before asking dumb questions...

brew

Thanks, ersan. I didn't find out what they're for, but I found a topic of another person trying to parse the 0x09 and he showed his send0x09 sub... i'm still not sure where he got the values for the other 3 product specific parameters but it seems to be working for me.
<3 Zorm
Quote[01:08:05 AM] <@Zorm> haha, me get pussy? don't kid yourself quik
Scio te esse, sed quid sumne? :P

l2k-Shadow

Why don't you use a packet logger and see what the game sends?
Quote from: replaced on November 04, 2006, 11:54 AM
I dunno wat it means, someone tell me whats ix86 and pmac?
Can someone send me a working bot source (with bnls support) to my email?  Then help me copy and paste it to my bot? ;D
Já jsem byl určenej abych tady žil,
Dával si ovar, křen a k tomu pivo pil.
Tam by ses povídaj jak prase v žitě měl,
Já nechci před nikym sednout si na prdel.

Já nejsem z USA, já nejsem z USA, já vážně nejsem z USA... a snad se proto na mě nezloběj.

brew

Because I have no idea where my starcraft disk is
<3 Zorm
Quote[01:08:05 AM] <@Zorm> haha, me get pussy? don't kid yourself quik
Scio te esse, sed quid sumne? :P

Explicit

Quote from: brew on April 01, 2007, 04:10 PM
Because I have no idea where my starcraft disk is

That still isn't an excuse.
I'm awake in the infinite cold.

[13:41:45]<@Fapiko> Why is TehUser asking for wang pictures?
[13:42:03]<@TehUser> I wasn't asking for wang pictures, I was looking at them.
[13:47:40]<@TehUser> Mine's fairly short.

Barabajagal

Packet.ClearOutbound
    s = &H0
    G = &H0
    If Config.Game = STAR Or Config.Game = SEXP Or Config.Game = SSHR Or Config.Game = JSTR Then
        l = &H30
    Else
        l = &H0
    End If
    C = &HFF
    Packet.InsertDWORD G
    Packet.InsertDWORD l
    Packet.InsertDWORD s
    Packet.InsertDWORD C
    Packet.InsertNTString GameName
    Packet.InsertNTString GamePass
    Packet.InsertNTString ""

brew

#7
Quote from: [RealityRipple] on April 01, 2007, 04:27 PM
Packet.ClearOutbound
    s = &H0
    G = &H0
    If Config.Game = STAR Or Config.Game = SEXP Or Config.Game = SSHR Or Config.Game = JSTR Then
        l = &H30
    Else
        l = &H0
    End If
    C = &HFF
    Packet.InsertDWORD G
    Packet.InsertDWORD l
    Packet.InsertDWORD s
    Packet.InsertDWORD C
    Packet.InsertNTString GameName
    Packet.InsertNTString GamePass
    Packet.InsertNTString ""

There are a number of things I would like to comment about that:
1. For the game statstring, it should not be "". It should be vbNullString, always, for many different reasons.
2. The first "dword" is acually two words: The first being the game type which you want to get the list for, the values for this are the same as in the 0x1C statstring. (for example, 0x000A = Use Map Settings)
3. The last dword is acually the max number of games you want to be returned.
4. "If Config.Game = STAR Or Config.Game = SEXP Or Config.Game = SSHR Or Config.Game = JSTR Then"
Uh.... you should consider using short circuit evaluation or nested ifs.


Public Sub Send0x09()
    With pbuffer
        .InsertWORD &HA              'Product Specific 1
        .InsertWORD 0                'Product Specific 2
        .InsertDWORD &H1F            'Product Specific 3
        .InsertDWORD 0               'Product Specific 4
        .InsertDWORD 10              'Max games
        .InsertNTString vbNullString 'Game Name
        .InsertNTString vbNullString 'Game Password
        .InsertNTString vbNullString 'Game Statstring
        .sendPacket &H9
    End With
    AddChat vbYellow, "Sending 0x09..."
End Sub

is the code I'm using.

Thank you for helping, reality.
<3 Zorm
Quote[01:08:05 AM] <@Zorm> haha, me get pussy? don't kid yourself quik
Scio te esse, sed quid sumne? :P

Barabajagal

What I have works just fine for listing all games. The last DWord (C) is not max games for D1, it's what level to display at. When set to &HFF, it lists games for all levels, and lists all games for all other clients. As for not using vbNullString... I don't know why I didn't. Momentary lapse of reason I guess.

warz

"" equates to a 'null string', most likely. i'd assume it's just the null byte, as well as vbnullstring.

Barabajagal

No, "" is not a null string in Visual Basic. We've already had this discussion.

warz

Quote from: [RealityRipple] on April 01, 2007, 09:55 PM
No, "" is not a null string in Visual Basic. We've already had this discussion.

So, what does it equate to?

Barabajagal

#12
A null terminator (00) I guess? Read in this topic for more info.

Edit: There was another topic somewhere else where we went more in depth with it, but I can't find it...

warz

#13
Quote from: [RealityRipple] on April 01, 2007, 10:16 PM
A null terminator (00) I guess? Read in this topic for more info.

Edit: There was another topic somewhere else where we went more in depth with it, but I can't find it...

Assuming we're talking about string related functions, is a single null terminating byte not a null string? A function looking for the null terminator in a string would stop on the first byte either way. '00' (a null terminator) and '00 00 00 00' (a null terminated array of null bytes) are both evaluated as a single null terminator, or null string (meaning a string with no content, other than the terminator) which might look like "" in-code. So, you know that "" does not equate to a null string, but you say it equates to a null terminator? What's the difference?

Edit: After reading that post, I now know that visual basic stores strings as unicode.

Barabajagal

#14
"" takes up memory, vbNullString doesn't.

Edit: http://forums.devx.com/showthread.php?t=70074 might clear some things up.