Valhalla Legends Forums Archive | BnetDocs Research and Discussion | Request for Information: SID_STARTADVEX3 (statstring)

AuthorMessageTime
PunK
Unfortunately, I would do this myself but I lost my warcraft II CD so I don't have the installer. I was hoping somebody knew what the statstring would look like or maybe a refrence?

[code]
1 Unknown
2 Unknown
3 Game Speed
    0x00: Slowest
    0x01: Slower
    0x02: Slow
    0x03: Normal
    0x04: Fast
    0x05: Faster
    0x06: Fastest
4 Approval
    0x00: Not Approved
    0x01: Blizzard Approved
    0x02: Ladder Approved
    0x03: PGL Approved
    0x04: KBK Approved
    0x05: CompUSA Approved
5 Game Type
    0x02: Melee
    0x03: FFA
    0x04: 1v1
    0x09: Ladder
    0x0A: UMS
    0x0F: TvB
    0x10: Iron man ladder
6 Parameter; The value of this parameter depends on the game type.
7 Checksum; This is a checksum of the map file.
8 Starting Resources
9 Creator/Map name
    These two values are separated by a 0x0D byte
[/code]

edit;

I'm trying to create a ladder game but it has been nothing but an epic fail.

Thanks.
August 13, 2008, 6:39 AM
MysT_DooM
I have an idea of what it would be but not 100% sure, I don't think it would be like sc's but I could be wrong.  If you dont have the game client to packet log try getting EUB Micro, or EUB Multiloader, one of those has war2 winbotting capabilities which you can packetlog.

August 13, 2008, 8:00 PM
Barabajagal
First off: Documentation

[code]0000  FF 1C 5A 00 00 00 00 00 00 00 00 00 0F 00 04 00    ..Z.............
0010  1F 00 00 00 00 00 00 00 54 45 53 54 00 00 2C 2C    ........TEST..,,
0020  2C 38 2C 31 2C 66 2C 34 2C 32 34 63 61 62 31 35    ,8,1,f,4,24cab15
0030  38 2C 32 30 30 2C 52 65 61 6C 69 74 79 52 69 70    8,200,RealityRip
0040  70 6C 65 0D 41 6C 6C 20 59 6F 75 20 4E 65 65 64    ple.All You Need
0050  20 42 4E 45 2E 70 75 64 0D 00                       BNE.pud..[/code]

Game name: TEST
Game Pass: nothing
Game Map: All You Need BNE.pud
Game Type: Top vs Bottom (4v4)
Game Speed: Fastest
Resources: Default
Tileset: Default
One Peon: Yes
Fixed Order: No


Packet Log Explained:
State:   00 00 00 00
Time:    00 00 00 00
Type:    0F 00
Param:   04 00
Unknown: 1F 00 00 00
Ladder:  00 00 00 00
Name:    54 45 53 54 00 (TEST)
Pass:    00 (None)
Statstring: ,,,8,1,f,4,24cab158,200,RealityRipple.All You Need BNE.pud
  Unknown: Blank
  Unknown: Blank
  Speed: 8 (Fastest)
  Approval: 1 (Blizzard Approved)
  Type: 0x0F (Top vs Bottom)
  Param: 4
  Checksum: 24cab158
  Resources: 200
  Creator: RealityRipple
  Map: All You Need BNE.pud
August 14, 2008, 12:34 AM
PunK
Looks like the redux is wrong. According to bnetdocs, 0x06 is fastest but it seems 0x08 is fastest.
August 14, 2008, 12:41 AM
Barabajagal
I fixed it. It didn't have all the possible values for speed.
August 14, 2008, 1:48 AM
Strilanc
This is the code I use to generate warcraft 3 stat strings.

[code]    ''' <summary>Encodes game parameters, properties, etc.</summary>
    ''' <returns>The encoded string</returns>
    ''' <remarks>
    '''  0 BYTE #slots-1 (text-hex)
    '''  1 BYTE[8] host counter (text-hex)
    '''  encoded:
    '''      2 DWORD settings
    '''      3 BYTE[5] map size and other?
    '''      4 DWORD hex key
    '''      5 STRING map name
    '''      6 STRING user name
    '''      7 STRING unknown("")
    ''' </remarks>
    Public Function generateStatString(ByVal hostCount As Integer) As Byte()
        'free slots in text-hex
        Dim bbSlots(0 To 0) As Byte
        bbSlots(0) = CByte(Asc(Hex(slots.Count - 1).ToLower()))

        'host counter in text-hex
        Dim bbCount(0 To 7) As Byte
        For i As Integer = 0 To 7
            bbCount(i) = CByte(Asc(Hex(hostCount Mod 16).ToLower()))
            hostCount \= 16
        Next i

        'settings
        Dim b As Byte
        Dim bbSettings(0 To 3) As Byte
        b = 0
        If False Then b = b Or CByte(&H80) 'unknown
        If False Then b = b Or CByte(&H40) 'unknown
        If False Then b = b Or CByte(&H20) 'unknown (set for the melee map "divide and conquer")
        If False Then b = b Or CByte(&H10) 'unknown
        If False Then b = b Or CByte(&H8) 'unknown
        If False Then b = b Or CByte(&H4) 'unknown
        If speed = SPD.FAST Then b = b Or CByte(&H2)
        If speed = SPD.MEDIUM Then b = b Or CByte(&H1) '[other speed indicated by no fast or medium flags]
        bbSettings(0) = b
        b = 0
        If False Then b = b Or CByte(&H80) 'unknown
        If teamsTogether Then b = b Or CByte(&H40)
        If observers = OBS.FULL_OBSERVERS Or observers = OBS.OBSERVERS_ON_DEFEAT Then b = b Or CByte(&H20)
        If observers = OBS.FULL_OBSERVERS Then b = b Or CByte(&H10)
        If visibility = VIS.MAP_DEFAULT Then b = b Or CByte(&H8)
        If visibility = VIS.ALWAYS_VISIBLE Then b = b Or CByte(&H4)
        If visibility = VIS.EXPLORED Then b = b Or CByte(&H2)
        If visibility = VIS.HIDE_TERRAIN Then b = b Or CByte(&H1)
        bbSettings(1) = b
        b = 0
        If False Then b = b Or CByte(&H80) 'unknown
        If False Then b = b Or CByte(&H40) 'unknown
        If False Then b = b Or CByte(&H20) 'unknown
        If False Then b = b Or CByte(&H10) 'unknown
        If False Then b = b Or CByte(&H8) 'unknown
        If lockTeams Then b = b Or CByte(&H4)
        If lockTeams Then b = b Or CByte(&H2) 'why lock teams again?
        If False Then b = b Or CByte(&H1) 'unknown
        bbSettings(2) = b
        b = 0
        If False Then b = b Or CByte(&H80) 'unknown
        If observers = OBS.REFEREES Then b = b Or CByte(&H40)
        If False Then b = b Or CByte(&H20) 'unknown
        If False Then b = b Or CByte(&H10) 'unknown
        If False Then b = b Or CByte(&H8) 'unknown
        If randomHero Then b = b Or CByte(&H4)
        If randomRace Then b = b Or CByte(&H2)
        If allowFullSharedControl Then b = b Or CByte(&H1)
        bbSettings(3) = b

        'size
        Dim bbSize(0 To 4) As Byte
        bbSize(0) = 0 'unknown
        bbSize(1) = playableWidth
        bbSize(2) = 0 'unknown
        bbSize(3) = playableHeight
        bbSize(4) = 0 'unknown

        'encode
        Dim bb() As Byte = BnetCrypt.encodePreMaskedByteArray( _
                concat( _
                    bbSettings, _
                    bbSize, _
                    hexKey, _
                    packString(My.Settings.relMapPath + name, True), _
                    packString(My.Settings.username, True), _
                    packString("", True) _
                ))
        Return concat(bbSlots, bbCount, bb, array(Of Byte)(0))
    End Function[/code]

[code]    Public Shared Function encodePreMaskedByteArray(ByVal bbDecoded() As Byte) As Byte()
        Dim n As Integer = bbDecoded.Length
        Dim numBlocks As Integer = CInt(Math.Ceiling(n / 7))
        Dim bbCoded(0 To n + numBlocks - 1) As Byte

        'For each chunk
        For i As Integer = 0 To numBlocks - 1
            Dim d As Integer = i * 7 'position in decoded array
            Dim c As Integer = i * 8 + 1 'position in coded array
            Dim header As Byte = 1 'placed before the chunk in destination
            Dim p As Byte = &H2 'bit mask

            'Process chunk
            For j As Integer = 0 To 6
                If d + j >= n Then Exit For
                bbCoded(c + j) = bbDecoded(d + j) Or CByte(&H1) 'place in coded array with first bit forced to 1
                If (bbDecoded(d + j) And &H1) = 1 Then header = header Or p 'place first bit in header
                p <<= 1 'next bit
            Next j

            'place header in destination array
            bbCoded(c - 1) = header
        Next i

        Return bbCoded
    End Function[/code]
August 30, 2008, 3:34 PM
UserLoser
what's with all the 'If False Then' ?
August 30, 2008, 6:21 PM
Strilanc
When I originally wrote it I was finding out what a new bit meant relatively often, so I just preplaced all the bit lines and put 'False' on the ones I didn't know the function of yet.
August 30, 2008, 11:20 PM
Yegg
[quote author=Strilanc link=topic=17603.msg179583#msg179583 date=1220138450]
When I originally wrote it I was finding out what a new bit meant relatively often, so I just preplaced all the bit lines and put 'False' on the ones I didn't know the function of yet.
[/quote]

But the block of code after the if then will never occur since it is always False. Wouldn't it be more sensible to just comment out the line?
August 31, 2008, 3:53 AM
Strilanc
[quote author=Yegg link=topic=17603.msg179590#msg179590 date=1220154805]
[quote author=Strilanc link=topic=17603.msg179583#msg179583 date=1220138450]
When I originally wrote it I was finding out what a new bit meant relatively often, so I just preplaced all the bit lines and put 'False' on the ones I didn't know the function of yet.
[/quote]

But the block of code after the if then will never occur since it is always False. Wouldn't it be more sensible to just comment out the line?
[/quote]

What's the difference? Just comment them out yourself if you don't like them. The compiler probably removes them anyways.
September 2, 2008, 1:55 AM
Yegg
[quote author=Strilanc link=topic=17603.msg179626#msg179626 date=1220320552]
[quote author=Yegg link=topic=17603.msg179590#msg179590 date=1220154805]
[quote author=Strilanc link=topic=17603.msg179583#msg179583 date=1220138450]
When I originally wrote it I was finding out what a new bit meant relatively often, so I just preplaced all the bit lines and put 'False' on the ones I didn't know the function of yet.
[/quote]

But the block of code after the if then will never occur since it is always False. Wouldn't it be more sensible to just comment out the line?
[/quote]

What's the difference? Just comment them out yourself if you don't like them. The compiler probably removes them anyways.
[/quote]

Because it makes for bag/ugly coding in general. And in the end, it's stupid.
September 2, 2008, 5:06 PM
Barabajagal
What do warcraft 3 statstrings have to do with anything?
September 2, 2008, 6:35 PM

Search