Beispiel #1
0
 public override void VisitLock(Lock @lock)
 {
     _stream.AppendLong(@lock.Id);
     _stream.AppendByte((byte)_lockType);
     _stream.AppendByte((byte)@lock.State);
     _stream.AppendByte((byte)(@lock.Primary ? 1 : 0));
     _stream.AppendLong((long)@lock.Timer.Duration.TotalMilliseconds);
     _stream.AppendLong((long)@lock.Timer.Elapsed.TotalMilliseconds);
     _stream.AppendLong(@lock.Owner.Eid);
     _stream.AppendStream(_target);
 }
Beispiel #2
0
        public static void WriteToStream(this IEnumerable <IOptionalProperty> properties, BinaryStream stream)
        {
            var p = properties ?? new IOptionalProperty[0];

            stream.AppendInt(p.Count());

            foreach (var property in p)
            {
                stream.AppendByte((byte)property.Type);
                stream.AppendObject(property.Value);
            }
        }