public override void Decode(MinecraftStream stream) { ProtocolVersion = stream.ReadVarInt(); ServerAddress = stream.ReadString(); ServerPort = stream.ReadUShort(); NextState = (ConnectionState)stream.ReadVarInt(); }
public override Packet Read(byte[] data) { var re = new HandShake(); MinecraftStream ms = new MinecraftStream(data); re.ID = ms.ReadVarInt(); re.ProtocolVersion = ms.ReadVarInt(); var l = ms.ReadVarInt(); re.ServerAddress = ms.ReadString(l); re.ServerPort = ms.ReadUShort(); re.NextState = ms.ReadVarInt(); return(re); }