public void Deserialize(ref Snapshot snapshot, ref Snapshot baseline, ref DataStreamReader reader, ref NetworkCompressionModel compressionModel, uint changeMask)
 {
     #region __GHOST_READ__
     if ((changeMask__GHOST_MASK_BATCH__ & (1 << __GHOST_MASK_INDEX__)) != 0)
     {
         snapshot.__GHOST_FIELD_NAME__ = reader.ReadPackedFixedString4096Delta(baseline.__GHOST_FIELD_NAME__, compressionModel);
     }
     else
     {
         snapshot.__GHOST_FIELD_NAME__ = baseline.__GHOST_FIELD_NAME__;
     }
     #endregion
 }
Beispiel #2
0
        public void ReadWritePackedFixedString4096Delta()
        {
            var dataStream       = new DataStreamWriter(300 * 4, Allocator.Temp);
            var compressionModel = new NetworkCompressionModel(Allocator.Temp);

            var src      = new FixedString4096("This is a string");
            var baseline = new FixedString4096("This is another string");

            dataStream.WritePackedFixedString4096Delta(src, baseline, compressionModel);
            dataStream.Flush();

            //Assert.LessOrEqual(dataStream.Length, src.LengthInBytes+2);

            var reader = new DataStreamReader(dataStream.AsNativeArray());
            var dst    = reader.ReadPackedFixedString4096Delta(baseline, compressionModel);

            Assert.AreEqual(src, dst);
        }