Valhalla Legends Forums Archive | Battle.net Bot Development References | Packet 0x1C and 0x3C Information

AuthorMessageTime
Smurfling
Well, &H1C to create a game isn't really the problem. After sending &H1C i am receiving the server response &H1C with &H00000000, so all's fine.

I think i must be doing something wrong with &H3C for map auth... well i don't really know what's within the packet, i am just inserting the data from a packet logged from the original bw client.

[code]
Dim po(15) As Object
po(0) = "DWORD"
po(1) = &H59490100
po(2) = "DWORD"
po(3) = &H99398E7D
po(4) = "DWORD"
po(5) = &H45DC24F0
po(6) = "DWORD"
po(7) = &H11E51CA
po(8) = "DWORD"
po(9) = &H66EA9E2
po(10) = "DWORD"
po(11) = &H427C452D
po(12) = "NTSTRING"
po(13) = "(4)Lost Temple.scm"
po(14) = "PACKET"
po(15) = &H3C
[/code]

After sending &H3C i am receiving the server response &H3C with &H00000000, map auth failed.

What i am trying to do is create and then start a game. Can somebody help me with that? Does anybody know what the values are for?

<Edited to add some more info>
April 24, 2003, 12:41 PM
laurion
Try using a packetbuffer class, its a whole lot easier ^^
April 24, 2003, 12:46 PM
Smurfling
[quote]Try using a packetbuffer class, its a whole lot easier ^^ [/quote]

I am using csb, just passing the object to csb.buildpacket("BNET",po) so

1) I can't use packetbuffer class
2) isn't it like a packetbuffer? :P
April 24, 2003, 12:51 PM
Camel
[quote author=Andreas Strobl link=board=17;threadid=1144;start=0#msg8397 date=1051188664]
[quote]Try using a packetbuffer class, its a whole lot easier ^^ [/quote]

I am using csb, just passing the object to csb.buildpacket("BNET",po) so

1) I can't use packetbuffer class
2) isn't it like a packetbuffer? :P
[/quote]
CSB would be a lot more lightweight if it just had functions like InsertDWORD(Long), InsertWORD(Integer), InsertNTString(String), InsertNonNTString(String), SendPacket(Byte)
April 24, 2003, 4:30 PM
Smurfling
[quote author=Camel link=board=17;threadid=1144;start=0#msg8403 date=1051201845]
[quote author=Andreas Strobl link=board=17;threadid=1144;start=0#msg8397 date=1051188664]
[quote]Try using a packetbuffer class, its a whole lot easier ^^ [/quote]

I am using csb, just passing the object to csb.buildpacket("BNET",po) so

1) I can't use packetbuffer class
2) isn't it like a packetbuffer? :P
[/quote]
CSB would be a lot more lightweight if it just had functions like InsertDWORD(Long), InsertWORD(Integer), InsertNTString(String), InsertNonNTString(String), SendPacket(Byte)
[/quote]

Yea that's true, but well i can't complain about csb... i am really glad cuphead made it ;D
April 24, 2003, 5:08 PM
MesiaH
might i add, that i was the one who presented the idea of packet "building" to cuphead :P
April 24, 2003, 5:51 PM
St0rm.iD
Why doesn't someone invent a way to automatically turn a Type into a serialized packet? Or is that too hard for VB to handle?
April 25, 2003, 12:52 AM
Yoni
St0rm: Yes.

Andreas: You seem to be using strings where you should be using enumerations. Look up "Enum" in your VB reference.
April 25, 2003, 12:58 AM
Smurfling
[quote author=Yoni link=board=17;threadid=1144;start=0#msg8452 date=1051232288]
St0rm: Yes.

Andreas: You seem to be using strings where you should be using enumerations. Look up "Enum" in your VB reference.
[/quote]

[code]

Enum MapAuthParts
P1 = &H59490100
P2 = &H99398E7D
P3 = &H7D45DC24
P4 = &HF0011E51
P5 = &HCA066EA9
P6 = &HE2427C45
End Enum

Dim po(15) As Object
po(0) = "DWORD"
po(1) = MapAuthParts.P1
po(2) = "DWORD"
po(3) = MapAuthParts.P2
po(4) = "DWORD"
po(5) = MapAuthParts.P3
po(6) = "DWORD"
po(7) = MapAuthParts.P4
po(8) = "DWORD"
po(9) = MapAuthParts.P5
po(10) = "DWORD"
po(11) = MapAuthParts.P6
po(12) = "NTSTRING"
po(13) = "-(4)Lost Temple.scm"
po(14) = "PACKET"
po(15) = &H3C
csb.BuildPacket("BNET", po)
[/code]

I think you told me to try this? Well it still isn't working for me... Think i tried too much - changed a bit, changed it again, and now i got a disc and don't know what i changed to get the it ;D

[09:50:51] InGame: Creating Game Hansi a
[09:50:51] InGame: Game Creation Successfull
[09:50:55] InGame: Starting Game
[09:50:55] InGame: FF 3C 08 00 00 00 00 00
[09:50:55] InGame: Map Authorization Failed
[09:50:55] InGame: Leaving Game
[09:51:33] BdNBot's record:
[09:51:33] Normal games: 0-0-1
[09:51:33] Ladder games: 0-0-0


btw + 1 for Yoni for posting the first real reply to my topic ;)

Edit: Hmm just tried to do the map auth with a different map and different values... still didn't get it to send me FF 3C 08 00 01 00 00 00. I must be doing something different then the values wrong. Is this the right packet order to get a game started?

Create it: &H1C
Left Channel: &H10
Start it: &H3C
April 25, 2003, 7:46 AM
laurion
im just guessing, but shouldn't you leave the channel first?
April 25, 2003, 1:46 PM
PiaNKA
[quote author=laurion link=board=17;threadid=1144;start=0#msg8467 date=1051278413]
im just guessing, but shouldn't you leave the channel first?
[/quote]
As far as I know, you do leave the channel first, I don't do much game packet handeling, so my knowledge is limited, but my rejoin function uses a game rejoin instead of a void rejoin (it's a ton faster) and it leaves the channel before it joins the game...
April 25, 2003, 2:47 PM
UserLoser
Isn't there UDP involved...?
April 25, 2003, 9:27 PM
MesiaH
there sure is, you gotsta be sendin them udp packets before u try kickin it wit da 0x3C homes.
April 26, 2003, 1:27 AM
Camel
[quote author=St0rm.iD link=board=17;threadid=1144;start=0#msg8449 date=1051231921]
Why doesn't someone invent a way to automatically turn a Type into a serialized packet? Or is that too hard for VB to handle?
[/quote]

there's no point in diong that in vb, because you can't use pointers, so you would have to copymemory from the type to a string in order to send it. it's much more simple to write functions to construct packets or use a packet buffer. using types is not out of the reach of vb, it's just undesirable.

i suppose one could do something like:
[code]Type FullPacket
PacketHeader As Byte
PacketID As Byte
PacketLength As Integer
Data As Integer
End Type

Public Sub SendPacket(PacketID As Byte, Data As String)
Dim MyPacket As FullPacket
MyPacket.PacketHeader = CByte(&HFF)
MyPacket.PacketID = PacketID
MyPacket.PacketLength = Len(Data)
MyPacket.Data = Data
SCK.SendData MyPacket
End Sub[/code]
btw, that's totally untested code

one could make types for each different packet, convert them to strings, and call that function, or write seperate types and functions for each packet


[edit] for the record, i just deal with everything as strings, and organize my code so it's readable ;)
[code] hashout = _
MKL(KeyCount) & _
MKL(IIf(frmSetup.Spawn, 1, 0)) & _
hashout

SendPacket &H51, _
MKL(seed) & _
MKL(version) & _
MKL(CheckSum) & _
hashout & _
ExeInfo & Chr(0) & _
Left(frmSetup.uLogin, 15) & Chr(0)[/code]

[edit2] sendpacket() calls makepacket():
[code]Public Function MakePacket(ByVal ID As Long, ByVal Data As String)
MakePacket = Chr(&HFF) & Chr(ID) & MKI(Len(Data) + 4) & Data
End Function[/code]
April 26, 2003, 4:30 AM
kamakazie
I'd much rather use a PacketBuffer. Makes code much simpler and easier to read and you can reuse the class for different things such at botnet, d2gs, mcp, and the bncs file protocol. As an example:

[code]
Public Sub writeUserData(Fields() As String, Values() As String)

Dim oPBuf As New CPacketBuffer

oPBuf.Insert CLng(1)
oPBuf.Insert UBound(Fields) + 1
oPBuf.Insert CByte(0)
oPBuf.Insert Fields()
oPBuf.Insert Values()
BNCSClient.SendData oPBuf.BNCSPacket(SID_WRITEUSERDATA)

Set oPBuf = Nothing

End Sub
[/code]

Edit: In my CPacketBuffer class there are other subroutines to create packets from the buffer: MCPPacket(), FILEPacket(), BOTNETPacket(), and D2GSPacket().
April 26, 2003, 5:33 AM
Smurfling
LoL took me too long to handle but finally got it accepting &H1C and &H3C (for both, standard and ladder).

So after changing the game status from created to open to started the game should run and i don't get any errors back. I didn't thought about the time you need to stay in game to have no draw yet so i remained ingame for 2 mins. After that i tried sending the report but somehow bnet always bans me >:(

Does BNet check the report header and text? I don't know what most values are for, just know the result,users,slots, report header & text. Anyone can help me out there?

[code]
Private Sub GameReport()
AddChat(Col.Gainsboro, "InGame: ", Col.White, "Sending Game Report")

Dim po(15) As Object
po(0) = "DWORD" 'Whats that for?
po(1) = &H0
po(2) = "DWORD" 'Player Slots
po(3) = &H8
po(4) = "DWORD" 'Game Result - Here a Win
po(5) = &H1
po(6) = "DWORD" 'Whats that for?
po(7) = &H0
po(8) = "DWORD" 'Whats that for?
po(9) = &H0
po(10) = "DWORD" 'Whats that for?
po(11) = &H0
po(10) = "DWORD" 'Whats that for?
po(11) = &H0
po(10) = "DWORD" 'Whats that for?
po(11) = &H0
po(10) = "DWORD" 'Whats that for?
po(11) = &H0
po(10) = "DWORD" 'Whats that for?
po(11) = &H0
po(12) = "STRING" 'Users in game
po(13) = Username
po(10) = "DWORD" 'Whats that for?
po(11) = &H0
po(10) = "DWORD" 'Whats that for?
po(11) = &H0
po(12) = "STRING" 'Report Header
po(13) = "On map Lost Temple:"
po(12) = "BYTE" 'Split?
po(13) = &HA
po(12) = "BYTE" 'NT?
po(13) = &H0
po(12) = "STRING" 'Report header
po(13) = Username & " was a BdNBot and played for " & MF(GameDuration / 60000) & " minutes."
po(12) = "BYTE" 'Split?
po(13) = &HA
po(12) = "BYTE" 'Split?
po(13) = &HA
po(12) = "STRING" Report text
po(13) = "BdNBot Likes To Play Battle.Net Games ;)"
po(14) = "PACKET"
po(15) = &H2C
csb.BuildPacket("BNET", po)[/code]
May 13, 2003, 10:54 AM
iago
It's really easy to figure out, just get into a few games, log the packets, and compare.

There are some things that you really ought to figure out yourself, and I think this is one of them :-P
May 13, 2003, 5:27 PM
Smurfling
[code]
po(4) = "DWORD" 'Game Result Player1
po(5) = &H1
po(6) = "DWORD" 'Game Result Player2
po(7) = &H0
po(8) = "DWORD" 'Game Result Player3
po(9) = &H0
po(10) = "DWORD" 'Game Result Player4
po(11) = &H0
po(10) = "DWORD" 'Game Result Player5
po(11) = &H0
po(10) = "DWORD" 'Game Result Player6
po(11) = &H0
po(10) = "DWORD" 'Game Result Player7
po(11) = &H0
po(10) = "DWORD" 'Game Result Player8
po(11) = &H0
[/code]

Ah think i got the first, 8 DWORD's for the Results of max 8 Players. If there weren't all player slots full the DWORD = &H0[code][/code]
May 14, 2003, 9:21 AM

Search