Bonsoir
Alors la je viens de debuter un bot socket sauf que je bloque apres l'envoie du packetid:4 , c'est a dire le serveur m'envoie rien
j'espere que quelqu'un pourra m'aider voici ma class AuthenticationManager :
Public login As String
Public pass As String
Public _msg As HelloConnectMessage
Public _log As LogBot
Public _salt As String
Public Const _publicKey As String = "MIIBUzANBgkqhkiG9w0BAQEFAAOCAUAAMIIBOwKCATIAqpzRrvO3We7EMi9cWYqdfb3rbdinTay+" +
"hxQ6t3dOiJLY4NITxyeIuy97yZYOojOlXS2SuJ4cCHjCeLCQO1FwOz+nynQWcBWecz2QdbHD2Kz7" +
"mNLd2qtZyEDO76rd7LaDOxRvgs9DsH9sfnCuKLKbd725xTLc7wRfJzOH9v9rTTYVXssXe7JUpTx8" +
"nV8yKnTiq3WpzBeZT4C3ZCR18GBBCh3NmSTbze9i2KipgZnOwBvhskVlweuqZ1KNIKsQgipBFuyw" +
"w68RGNYaAKofMVVio4amrGpCT5MM852jpHsgJJfOUHu6md1CnvdwDPbo/PKQUI0RLb0ezE5gsPma" +
"s39QBw+DiaibUkk1aCkBxTOFqpIbjfLM2/4qA6GPcWUJxP3vmGoeCTMBLNEiPfLqVm86QzUCAwEA" +
"AQ=="
Sub New(client As Form1, hcm As HelloConnectMessage, param1 As String, param2 As String)
_msg = hcm
Me.setSalt(_msg.Salt)
_log = New LogBot(client)
login = param1
pass = param2
End Sub
Public Sub setSalt(param1 As String)
Me._salt = param1
If Me._salt.Length < 32 Then
_log.WriteError("Authentification salt size is lower than 32")
While Me._salt.Length < 32
Me._salt = Me._salt + " "
End While
End If
End Sub
Public Function getIdentificationMessage() As IdentificationMessage
Dim imsg As IdentificationMessage
Dim token As String = ""
Dim account As String()
Dim buildType As UInteger = 1
Dim version As New Version(2, 21, 3, 85958, 1, 0, 1, 1)' les 2 dernier c'est technology et install
account = Me.login.Split("|")
imsg = New IdentificationMessage(version, "fr", cipherRsa(account(0), Me.pass), 0, False, False, False, 0)
Return imsg
End Function
Public Function cipherRsa(login As String, password As String) As List(Of Integer)
Dim baOut As Reader
Dim baIn As New Writer()
Dim bytes() As Byte
baIn.WriteString(Me._salt)
baIn.WriteByte(Me.login.Length)
baIn.WriteString(Me.login)
baIn.WriteString(Me.pass)
bytes = RSAClass.Encrypt(baIn.GetByte(), _publicKey).AsBytes
baOut = New Reader(bytes)
Dim ret As List(Of Integer) = New List(Of Integer)
For i As Integer = 0 To bytes.Length - 1
ret.Add(baOut.ReadByte())
Next
Return ret
End Function
Merci d'avance.