• Welcome to Valhalla Legends Archive.
 

Packet 0x1C and 0x3C Information

Started by Smurfling, April 24, 2003, 07:41 AM

Previous topic - Next topic

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.


       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


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>

Tazo

Try using a packetbuffer class, its a whole lot easier ^^

Smurfling

#2
QuoteTry using a packetbuffer class, its a whole lot easier ^^

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

Camel

Quote from: Andreas Strobl on April 24, 2003, 07:51 AM
QuoteTry using a packetbuffer class, its a whole lot easier ^^

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
CSB would be a lot more lightweight if it just had functions like InsertDWORD(Long), InsertWORD(Integer), InsertNTString(String), InsertNonNTString(String), SendPacket(Byte)

Smurfling

Quote from: Camel on April 24, 2003, 11:30 AM
Quote from: Andreas Strobl on April 24, 2003, 07:51 AM
QuoteTry using a packetbuffer class, its a whole lot easier ^^

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
CSB would be a lot more lightweight if it just had functions like InsertDWORD(Long), InsertWORD(Integer), InsertNTString(String), InsertNonNTString(String), SendPacket(Byte)

Yea that's true, but well i can't complain about csb... i am really glad cuphead made it  ;D

Mesiah / haiseM

might i add, that i was the one who presented the idea of packet "building" to cuphead :P
]HighBrow Innovations
Coming soon...

AIM Online Status: 

Banana fanna fo fanna

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?

Yoni

St0rm: Yes.

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

Smurfling

#8
Quote from: Yoni on April 24, 2003, 07:58 PM
St0rm: Yes.

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



   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)


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

Tazo

im just guessing, but shouldn't you leave the channel first?

pianka

Quote from: laurion on April 25, 2003, 08:46 AM
im just guessing, but shouldn't you leave the channel first?
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...

UserLoser


Mesiah / haiseM

there sure is, you gotsta be sendin them udp packets before u try kickin it wit da 0x3C homes.
]HighBrow Innovations
Coming soon...

AIM Online Status: 

Camel

#13
Quote from: St0rm.iD on April 24, 2003, 07:52 PM
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?

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:
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

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 ;)
               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)


[edit2] sendpacket() calls makepacket():
Public Function MakePacket(ByVal ID As Long, ByVal Data As String)
   MakePacket = Chr(&HFF) & Chr(ID) & MKI(Len(Data) + 4) & Data
End Function

dxoigmn

#14
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:


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


Edit: In my CPacketBuffer class there are other subroutines to create packets from the buffer: MCPPacket(), FILEPacket(), BOTNETPacket(), and D2GSPacket().