示例#1
0
 public override void Decode(MinecraftStream stream)
 {
     ProtocolVersion = stream.ReadVarInt();
     ServerAddress   = stream.ReadString();
     ServerPort      = stream.ReadUShort();
     NextState       = (ConnectionState)stream.ReadVarInt();
 }
示例#2
0
        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);
        }