Valhalla Legends Forums Archive | Battle.net Bot Development | Re: W3GS_FORMAT.TXT

AuthorMessageTime
leax
hi pros
i got a question on
Request Join Game (clients send this on every try to join game)
W3GS_REQJOIN 0x1E

how do one find out about the
(DWORD)  05000000 |Join game counter of client
and
(DWORD)  02000000 |Total game join/create counter

i tried random values since they are "counters" but keep getting disconencted from the host
just wondering if anyone know more about these

also is the protocol refernces moved to anywhere more permanent now ? maybe this post is outa date

thanks

November 22, 2006, 10:03 AM
Topaz
Maybe your values should be DWORDs?
November 23, 2006, 2:09 AM
leax
i m sure the packet format is correct, as i got it to connect once or twice, thats why i m suspecting the counters are wrong
maybe i have to resort to manually incrment the counters...

oh the post refernce is https://davnit.net/bnet/vL/index.php?topic=14994.0 since this post got moved
November 23, 2006, 3:57 AM
Topaz
Maybe your values should be DWORDs?
November 23, 2006, 5:45 AM
leax
sorry i dont understand, what value, which DWORD ?

edit* oh i get what u mean by DWORD now, thoses 2 lines are from the original post by Dota.For.Rest but i did use DWORD in the code
(DWORD)  05000000 |Join game counter of client
(DWORD)  02000000 |Total game join/create counter

the problem is i get disconected from the host after i send the packet, after receiving a W3GS_REJECTJOIN packet. i m not sure what went wrong and i though it could be the 2 counters messing things up as i have gotten back W3GS_SLOTINFOJOIN(success) on very rare occasions


    Public Function SEND_W3GS_REQJOIN(ByVal userName As String) As Byte()
        Dim packet As ArrayList
        Dim buffer As Byte()
        Try
            packet = New ArrayList
            AddByteArray(packet, New Byte() {247})              'W3GS header constant
            AddByteArray(packet, New Byte() {30})               'W3GS_REQJOIN
            AddByteArray(packet, New Byte() {0, 0})             'undefined packet length
            AddByteArray(packet, New Byte() {1, 0, 0, 0})       'total number of game played
            AddByteArray(packet, New Byte() {0, 0, 0, 0})
            AddByteArray(packet, New Byte() {0})
            AddByteArray(packet, New Byte() {224, 23})          'External game port
            AddByteArray(packet, New Byte() {1, 0, 0, 0})       'total number of game joined or created, include not played
            AddByteArray(packet, userName)                      'Client name null terminated
            AddByteArray(packet, New Byte() {1, 0})
            AddByteArray(packet, New Byte() {2, 0})                 'inet address type
            AddByteArray(packet, New Byte() {23, 224})              'port
            AddByteArray(packet, New Byte() {192, 168, 0, 3})       'ip
            AddByteArray(packet, New Byte() {0, 0, 0, 0})
            AddByteArray(packet, New Byte() {0, 0, 0, 0})

            buffer = CType(packet.ToArray(GetType(Byte)), Byte())
            AssignLength(buffer)
            Return buffer
        Catch ex As Exception
            Return New Byte() {}
        End Try
    End Function
November 23, 2006, 6:43 AM
Topaz
This is what I have on W3GS_FORMAT.TXT:

[code]Request Join Game (clients send this on every try to join game)
W3GS_REQJOIN 0x1E
IN 192.168.000.003:01040 LEN:42
·  ·  3 ·  · · · ·  · · 8 ·  ·  · ·  · · · ·  R u s s i a . O n l i n e ·  · ·  · · · · · · · ·  · · · ·  · · · ·
f7 1e 3300 05000000 fed83814 00 e117 02000000 5275737369612e4f6e6c696e6500 0100 020017e0c0a80003 00000000 00000000
(BYTE)  f7      |W3GS Signature
(BYTE)  1e      |Packet Signature
(WORD)  3300    |Packet Size
(DWORD)  05000000 |Join game counter of client
(DWORD)  fed83814 |GetTickCount WinAPI value only for LAN games (Zero for battle.net games)
(BYTE)  00      |Always zero? (i think its additional byte for tick count)
(WORD)  e117    |External game port (used by others Game clients to connect to this client)
(DWORD)  02000000 |Total game join/create counter
(char[]) 5275737369612e4f6e6c696e6500
                  |Client name (null terminated string)
(WORD)  0100    |Always 0x0001? IPv4 type tag
(sockaddr_in) 020017e0c0a80003
                  |Internal client IP and Port
(DWORD)  00000000 |Always zero? additional bytes for IPv6 compability
(DWORD)  00000000 |Always zero? additional bytes for IPv6 compability[/code]

and from what I can immediately see, you haven't placed the correct values for the packet size.
November 23, 2006, 7:12 PM
leax
thanks for the follow up topaz
the packet length is handled in the AssignLength(buffer)function, forgot to comment that line.

i had some progress with the counters, i start both counter below from 1
(DWORD)  1 | Join game counter of client
(DWORD)  1 | Total game join/create counter
and it join succesfully For the First Time

now if the host leaves then recreate a game (this is done form the actuall war3 game client), and when i try to join again with 1 and 1, it will reject, however i tried incrmement both so becomes 2 and 2 and it accpeted! so bascially now i can kinda of trial and error with the counter increment till i manage to join and usually the counter gets to around 5ish and needs to be reset to 1 again.

this is pure observation and terribly annoying, thats why i m hoping someone might know more about these damn counters on how i manage to connect without in the dark increments. anther interst point is how the hell does the host know whats client's "correct" counter value is and why they even bother with sucha clumy mechanism


November 23, 2006, 11:28 PM
Topaz
Have you tried taking packet logs and seeing how it's supposed to be done? I suggest you do that, since the game seems to have no trouble doing it without fail.
November 24, 2006, 5:31 PM

Search