Beispiel #1
0
        protected RollerUpdate(IReadOnlyPacket packet)
            : this()
        {
            LocationX = packet.ReadInt();
            LocationY = packet.ReadInt();
            TargetX   = packet.ReadInt();
            TargetY   = packet.ReadInt();

            int n = packet.ReadLegacyShort();

            for (int i = 0; i < n; i++)
            {
                ObjectUpdates.Add(RollerObjectUpdate.Parse(packet));
            }

            RollerId = packet.ReadLegacyLong();

            if (packet.Available > 0)
            {
                Type = (RollerUpdateType)packet.ReadInt();
                if (Type == RollerUpdateType.MovingEntity ||
                    Type == RollerUpdateType.StationaryEntity)
                {
                    if (packet.Protocol == ClientType.Unity)
                    {
                        packet.ReadInt();
                    }
                    // Entity index may have changed to long here
                    // but it's int everywhere else ???
                    EntityIndex     = packet.ReadInt();
                    EntityLocationZ = packet.ReadLegacyFloat();
                    EntityTargetZ   = packet.ReadLegacyFloat();
                }
            }
        }
Beispiel #2
0
 protected RollerObjectUpdate(IReadOnlyPacket packet)
 {
     Id        = packet.ReadLegacyLong();
     LocationZ = packet.ReadLegacyFloat();
     TargetZ   = packet.ReadLegacyFloat();
 }