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
Maybe your values should be DWORDs?
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 http://forum.valhallalegends.com/index.php?topic=14994.0 since this post got moved
Maybe your values should be DWORDs?
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
This is what I have on W3GS_FORMAT.TXT:
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
and from what I can immediately see, you haven't placed the correct values for the packet size.
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
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.