//Handshake. private static async Task HandshakePacketHandler(byte[] data, MemoryStream stream, MinecraftClientConnection connection) { HandshakePacket packet = new HandshakePacket(); await packet.Read(stream); connection.state = packet.nextState; Logger.LogMessage("Handshake with state " + packet.nextState); Logger.LogMessage("IP is " + ((IPEndPoint)connection.client.Client.RemoteEndPoint).Address.ToString()); }
public static void ReadHandshake(Client client, PacketReader reader) { HandshakePacket hp = new HandshakePacket(); hp.Read(reader); if (!reader.Failed) { Client.HandlePacketHandshake(client, hp); } }