Dont give up!, here is a code I wrote a long ass time ago for VB6, you need the attached DLL aswell (its a dll made from aluigi's code)
Functions that interact with the q3huff.dll:
Code:
Private Declare Function Huff_CompressPacket Lib "q3huff.dll" (msg As Byte, ByVal offset As Long, ByVal cursize As Long) As Long
Private Declare Function Huff_DecompressPacket Lib "q3huff.dll" (msg As Byte, ByVal offset As Long, ByVal cursize As Long, ByVal maxsize As Long) As Long
Public Sub CompressPacket(ByRef Data() As Byte)
Dim c As Long
Dim intLen As Long
Dim maxLen As Long
Dim i_buffer() As Byte 'input buffer
Dim o_buffer() As Byte 'output buffer
i_buffer = Data
maxLen = UBound(i_buffer) * 4
ReDim Preserve i_buffer(maxLen) As Byte
intLen = Huff_CompressPacket(i_buffer(0), 12, UBound(Data) + 1)
ReDim o_buffer(intLen - 1) As Byte
For c = 0 To (intLen - 1)
o_buffer(c) = i_buffer(c)
Next c
Data = o_buffer
Erase i_buffer, o_buffer
End Sub
Public Sub DecompressPacket(ByRef Data() As Byte)
Dim c As Long
Dim maxLen As Long
Dim intLen As Long
Dim i_buffer() As Byte 'input buffer
Dim o_buffer() As Byte 'output buffer
i_buffer = Data
maxLen = UBound(i_buffer) * 4
ReDim Preserve i_buffer(maxLen) As Byte
intLen = Huff_DecompressPacket(i_buffer(0), 12, UBound(Data) + 1, maxLen)
ReDim o_buffer(intLen - 1) As Byte
For c = 0 To (intLen - 1)
o_buffer(c) = i_buffer(c)
Next c
Data = o_buffer
Erase i_buffer, o_buffer
End Sub
That was the hard part, now make sure you also include the winsock (called it: ws) component:
Code:
Public Sub GetChallenge(ip As String, port As String)
Dim packet As String
Dim Data() As Byte
ws.Close
ws.Connect ip, port
packet = "????????getchallenge"
Data = StrConv(packet, vbFromUnicode)
ws.SendData Data
End Sub
Public Sub PlayerJoin(ip As String, port As String)
Dim packet As String
Dim Data() As Byte
ws.Close
ws.Connect ip, port
packet = "????????connect " & Chr(34) & "\challenge\" & challenge & "\qport\43586\protocol\26\name\\rate\25000\snaps\20\model\cultist/red\forcepowers\7-1-030330\color1\1\color2\11\handicap\200\sex\male\cg_predictItems\1\saber1\single_8\saber2\none\char_color_red\255\char_color_green\0\char_color_blue\0\teamtask\0" & Chr(34)
Data = StrConv(packet, vbFromUnicode)
CompressPacket Data
ws.SendData Data
End Sub
Have fun!