Client de connexion a Minecraft

djnaoki Messages postés 23 Date d'inscription samedi 17 novembre 2012 Statut Membre Dernière intervention 18 juin 2015 - Modifié par Whismeril le 30/10/2014 à 07:17
djnaoki Messages postés 23 Date d'inscription samedi 17 novembre 2012 Statut Membre Dernière intervention 18 juin 2015 - 29 oct. 2014 à 23:06
Bonjour,
je cherche a faire un petit client de connexion a minecraft j'ai déjà un petit code source que j'ai trouvé sur le net qui interroge le serveur mais je ne comprend pas bien le data qu'il envoi au serveur

quelqu'un pourrais il m'expliquer ??

ps :

le wiki : http://wiki.vg/Protocol

et le code source :
Imports System.Net.Sockets
Imports System.Text
Imports System.IO

Module main
    Private socketclient As New System.Net.Sockets.TcpClient()
    Dim port As Integer = 25565

    Sub Main()
        Dim serverList() As String = _
        {"192.168.1.22"}

        For i = 0 To serverList.Length - 1 Step 1
            Console.WriteLine("Connecting to " & serverList(i) & ":" & port & "..")
            socketclient.BeginConnect(serverList(i), "25565", New AsyncCallback(AddressOf connect), socketclient)
            Threading.Thread.Sleep(1000)
        Next

        Console.ReadLine()


    End Sub

    Public Sub connect(ByVal ar As IAsyncResult)
        If socketclient.Connected = True Then
            Console.WriteLine("Connected!")
            Dim stream As NetworkStream = socketclient.GetStream
            Dim sendBytes As [Byte]() = {&HFE}
            Console.WriteLine("Sending Data...")
            stream.Write(sendBytes, 0, sendBytes.Length)
           
            Console.WriteLine("Recieving Response..." & vbNewLine)
            Dim bytes(421) As Byte
            stream.Read(bytes, 0, CInt(421))

            'Trim Bytes
            Dim trimbytes(bytes.Length - 3) As Byte
            Array.Copy(bytes, 3, trimbytes, 0, bytes.Length - 3)

            'Process output
            Dim sb As New System.Text.StringBuilder
            For i As Integer = 1 To 241 Step 2
                If trimbytes(i) <> 0 Then
                    sb.Append(ChrW(BitConverter.ToInt16(trimbytes, i)))
                End If
            Next i
            Dim message() As String = sb.ToString.Split("§")

            'Display OutPut
            Console.WriteLine("----------Response Begin----------")
            Console.WriteLine(message(0))
            Console.WriteLine(message(1))
            Console.WriteLine(message(2))
            Console.WriteLine("----------Response End----------" & vbNewLine & vbNewLine)

            socketclient.Close()
        End If
    End Sub
End Module




merci !

--

2 réponses

djnaoki Messages postés 23 Date d'inscription samedi 17 novembre 2012 Statut Membre Dernière intervention 18 juin 2015
22 oct. 2014 à 00:13
j'ai trouver autre chose : http://minecraft-fr.gamepedia.com/Protocole_de_serveur_Classique mais je ne comprend toujours pas comment ca marche
0
djnaoki Messages postés 23 Date d'inscription samedi 17 novembre 2012 Statut Membre Dernière intervention 18 juin 2015
29 oct. 2014 à 23:06
personne ?? svp
0
Rejoignez-nous