コード例 #1
0
        public static object Read(NetIncomingMessage message)
        {
            var p = new ObjectUpdatePacket();

            p.Updates = new PackedShipUpdate[message.ReadVariableUInt32()];
            for (int i = 0; i < p.Updates.Length; i++)
            {
                p.Updates[i] = PackedShipUpdate.ReadFrom(message);
            }
            return(p);
        }
コード例 #2
0
        public static object Read(NetPacketReader message)
        {
            var p = new ObjectUpdatePacket();

            p.Tick = message.GetUInt();
            var pack        = new BitReader(message.GetRemainingBytes(), 0);
            var updateCount = pack.GetUInt(8);

            p.Updates = new PackedShipUpdate[updateCount];
            for (int i = 0; i < p.Updates.Length; i++)
            {
                p.Updates[i] = PackedShipUpdate.ReadFrom(ref pack);
            }
            return(p);
        }