Need help with Login Packets [VB.NET]
3 replies [Last post]
rom4e
WoM Member
Members
WoM Member: 551969
WoM Coins: 3

Hey, I have this code for login player to a server but it doesn't work with the new version 1.3.1.

I changed the protocol from 29 to 39 but it still dosen't work.
So, can anyone to help me to edit this code to works.
Thanks.
This is the code:
                Dim username As String = StrReverse("Test Player")
                Dim dataa(2 + (username.Length * 2)) As Byte
                dataa(0) = CByte(2)
                Dim sh(1) As Byte
                sh = BitConverter.GetBytes(CShort(username.Length))
                Array.Reverse(sh)
                sh.CopyTo(dataa, 1)
                Dim name() As Byte = Encoding.Unicode.GetBytes(username)
                Array.Reverse(name)
                name.CopyTo(dataa, 3)
                Stream.Write(dataa, 0, dataa.Length)
                ' REQUESTLOGIN
                Dim id As Byte = CByte(1)
                Dim protecol(3) As Byte
                protecol = BitConverter.GetBytes(CInt(39))
                Array.Reverse(protecol)
                Dim len(1) As Byte
                len = BitConverter.GetBytes(CShort(username.Length))
                Array.Reverse(len)
                Dim usrname(username.Length * 2 - 1) As Byte
                usrname = Encoding.Unicode.GetBytes(username)
                Array.Reverse(usrname)
                Dim lon(7) As Byte
                lon = BitConverter.GetBytes(CLng(0))
                Array.Reverse(lon)
                Dim intt(3) As Byte
                intt = BitConverter.GetBytes(CInt(0))
                Array.Reverse(intt)
                Dim empty As Byte = CByte(0)
                Dim data(22 + (username.Length * 2)) As Byte
                data(0) = id
                protecol.CopyTo(data, 1)
                len.CopyTo(data, 5)
                usrname.CopyTo(data, 7)
                Dim index As Integer = (7 + (username.Length * 2))
                lon.CopyTo(data, index)
                index = index + 8
                intt.CopyTo(data, index)
                index = index + 4
                data(index) = empty
                data(index + 1) = empty
                data(index + 2) = empty
                data(index + 3) = empty
                Stream.Write(data, 0, data.Length)

BloodRedMamba
WoM Member
Members
WoM Member: 531699
WoM Coins: 49
Head hurts

Ouch as I looked at your post...

rom4e
WoM Member
Members
WoM Member: 551969
WoM Coins: 3
No, it's not a JavaScript. :D

No, it's not a JavaScript. :D I wrote the language in the title, it's a Visual Basic .NET.

So this code is working on 1.2.5 but in 1.3.1 there are many changes with the packets. I tried to change it alone, but unsuccessfully.