public static Version24 Parse(byte[] vb) { Version24 v = new Version24(); v.Major = vb[0]; v.Minor = vb[1]; v.Build = vb[2]; return(v); }
public static Version24 Parse(string version) { Version24 v = new Version24(); string[] s = version.Split('.'); v.Major = byte.Parse(s[0]); v.Minor = byte.Parse(s[1]); v.Build = byte.Parse(s[2]); return(v); }
public ReplayHeader(byte[] data) { int pos = 0; _length = (ushort)data.Length; ClientVersion = Version64.Parse(BitConverter.ToInt64(data, 0)); // 8 bytes ServerVersion = Version24.Parse(BinaryUtil.Extract(data, 8, 3)); // 3 bytes byte blen = data[11]; ObserverKey = new RawEntry8(BinaryUtil.Extract(data, 12, (int)blen)); // 1+blen bytes pos = 12 + blen; if (data.Length > pos) { ushort len = BitConverter.ToUInt16(data, pos); pos += 2; Signature = new RawEntry16(BinaryUtil.Extract(data, pos, (int)len)); pos += len; len = BitConverter.ToUInt16(data, pos); pos += 2; Certificate = new RawEntry16(BinaryUtil.Extract(data, pos, (int)len)); pos += len; } }