• Welcome to Valhalla Legends Archive.
 

Warcraft 3 Game Statstring Decoding (0x09 SID_GETADVLISTEX)

Started by Lynxy, January 08, 2009, 06:02 PM

Previous topic - Next topic

Lynxy

I'm trying to get the game statring from the Warcraft 3 custom game list.  I've gotten all the other info (game type, host ip, etc), I just need to figure out how to decode the statstring.  I have used the code mentioned at Warcraft III Map Data Decode Function without success, so i recreated the decoding function using data from W3GS_FORMAT.TXT and still no go.

Code mentioned in first link:
Public Function DecodeMapData(ByVal Encoded As String, ByRef Decoded As String) As Long
' Ported to VB by l2k-Shadow
Dim enc() As Byte, dec() As Byte
Dim i As Long, j As Long, d As Byte, lngLen As Long
    enc = StrConv(Encoded, vbFromUnicode)
    For i = 0 To UBound(enc)
        If (i Mod 8) Then
            ReDim Preserve dec(lngLen)
            dec(lngLen) = (enc(i) And ((RShift(d, 1 + j) Or Not 1)))
            j = j + 1
            lngLen = lngLen + 1
        Else
            j = 0
            d = enc(i)
        End If
    Next i
    Decoded = StrConv(dec, vbUnicode)
    DecodeMapData = lngLen
End Function

Public Function RShift(ByVal pnValue As Long, ByVal pnShift As Long) As Long
    RShift = CLng(pnValue \ (2 ^ pnShift))
End Function


I create a game on the offical WAR3 client and examine the data from S>C SID_GETADVLISTEX (0x09)
Map filename: Kodo Tag v4.8.w3m
Host's name: The_Lynxy
Raw data:
0000: 62 32 30 30 30 30 30 30 30 01 03 49 07 01 01 47  b20000000..I...G
0010: 01 91 47 01 87 23 FB ED 4D CB 61 71 73 5D 45 6F  .‘G.‡#ûíMËaqs]Eo
0020: 77 99 6F 6D 6F 61 65 5D 4B CB 6F 65 6F 21 55 61  w™omoae]KËoeo!Ua
0030: 67 81 21 77 35 2F 39 2F 77 C7 33 6D 01 55 69 65  g.!w5/9/wÇ3m.Uie
0040: 5F 25 4D 79 6F 79 79 01 01                       _%Myoyy..


Using the supplied decoding code, I get this:
0000: 00 32 30 30 30 30 30 30 00 02 48 07 01 00 46 90  .2000000..H...F.
0010: 46 00 86 22 FA EC CA 61 71 72 5C 45 6E 99 6F 6C  F.†"úìÊaqr\En™ol
0020: 6F 61 65 5C CB 6E 65 6E 20 55 60 81 21 76 34 2F  oae\Ënen U`.!v4/
0030: 39 2E C7 33 6C 01 55 69 64 25 4D 79 6F 78 79 00  9.Ç3l.Uid%Myoxy.


Decoding has helped a little, but it's nowhere near ready.  I have searched all over this forum to try and find out how to do this, as well as on google, but was unable to find anything. 

Could anyone please point me in the right direction?  What I'm trying to accomplish is no good without the host's name.  Thank you


Lynxy

WOW! That worked, thank you so much! I can't believe I overlooked that.  *doh* ty Andy <3