public override void WriteTo(byte[] buf, ref int i) { Bit.WriteInt32(buf, ref i, verificationCode.Length); foreach (var b in verificationCode) { Bit.WriteUInt8(buf, ref i, b); } }
public ClientVerifyMessage(byte[] buf, ref int i) : base(KType) { int byteCount = Bit.ReadInt32(buf, ref i); verificationCode = new byte[byteCount]; for (int j = 0; j < byteCount; ++j) { verificationCode[j] = Bit.ReadUInt8(buf, ref i); } }
public override void WriteTo(byte[] buf, ref int i) { Bit.WriteUInt8(buf, ref i, (byte)(result ? 1 : 0)); }
public ServerVerifyResultMessage(byte[] buf, ref int i) : base(KType) { byte val = Bit.ReadUInt8(buf, ref i); result = val != 0; }
public string ReadString() { int byteCount = Bit.ReadUInt16(bytes, ref i); return(Bit.ReadString(bytes, ref i, byteCount)); }
public int ReadInt32() { return(Bit.ReadInt32(bytes, ref i)); }
public float ReadSingle() { return(Bit.ReadSingle(bytes, ref i)); }
public byte ReadByte() { return(Bit.ReadUInt8(bytes, ref i)); }
public short ReadInt16() { return(Bit.ReadInt16(bytes, ref i)); }
public void WriteString(string val) { Bit.WriteUInt16(bytes, ref i, (ushort)Bit.GetStringByteCount(val)); Bit.WriteString(bytes, ref i, val); }
public bool ReadBoolean() { byte val = Bit.ReadUInt8(bytes, ref i); return(val != 0); }
public void WriteSingle(float val) { Bit.WriteSingle(bytes, ref i, val); }
public void WriteInt32(int val) { Bit.WriteInt32(bytes, ref i, val); }
public void WriteInt16(short val) { Bit.WriteInt16(bytes, ref i, val); }
public void WriteByte(byte val) { Bit.WriteUInt8(bytes, ref i, val); }
public void WriteBoolean(bool val) { Bit.WriteUInt8(bytes, ref i, (byte)(val ? 1 : 0)); }