Esempio n. 1
0
        internal void PackSyncData(uint indexes, Network.ByteOutStream stream)
        {
            if (indexes == 0 || !IsActive)
            {
                return;
            }

            log.Debug("Sending data for {0}", Actor);

            stream.WriteByte(HeaderBytes.Synchronizable);
            stream.WriteActor(Actor);
            stream.WriteUShort((ushort)DataSize);
            stream.WriteUInt(indexes);

            for (int i = 0; i < Values.Length; ++i)
            {
                if ((indexes & ((uint)1 << i)) != 0)
                {
                    Values[i].Pack(stream);
                }
            }

            return;
        }