Ejemplo n.º 1
0
        protected override bool OnRead()
        {
            bool bufferReadValid = true;

            this.ObjectId = GameNetworkMessage.ReadMissionObjectIdFromPacket(ref bufferReadValid);
            this.Parent   = GameNetworkMessage.ReadMissionObjectReferenceFromPacket(ref bufferReadValid);
            this.Frame    = GameNetworkMessage.ReadNonUniformTransformFromPacket(CompressionBasic.PositionCompressionInfo, CompressionBasic.LowResQuaternionCompressionInfo, ref bufferReadValid);
            return(bufferReadValid);
        }
Ejemplo n.º 2
0
        protected override bool OnRead()
        {
            bool bufferReadValid = true;

            this.MissileIndex          = GameNetworkMessage.ReadIntFromPacket(CompressionMission.MissileCompressionInfo, ref bufferReadValid);
            this.CollisionReaction     = (Mission.MissileCollisionReaction)GameNetworkMessage.ReadIntFromPacket(CompressionMission.MissileCollisionReactionCompressionInfo, ref bufferReadValid);
            this.AttackerAgent         = GameNetworkMessage.ReadAgentReferenceFromPacket(ref bufferReadValid, true);
            this.AttachedAgent         = (Agent)null;
            this.AttachedToShield      = false;
            this.AttachedBoneIndex     = (sbyte)-1;
            this.AttachedMissionObject = (MissionObject)null;
            if (this.CollisionReaction == Mission.MissileCollisionReaction.Stick || this.CollisionReaction == Mission.MissileCollisionReaction.BounceBack)
            {
                if (GameNetworkMessage.ReadBoolFromPacket(ref bufferReadValid))
                {
                    this.AttachedAgent    = GameNetworkMessage.ReadAgentReferenceFromPacket(ref bufferReadValid, true);
                    this.AttachedToShield = GameNetworkMessage.ReadBoolFromPacket(ref bufferReadValid);
                    if (!this.AttachedToShield)
                    {
                        this.AttachedBoneIndex = (sbyte)GameNetworkMessage.ReadIntFromPacket(CompressionMission.BoneIndexCompressionInfo, ref bufferReadValid);
                    }
                }
                else
                {
                    this.AttachedMissionObject = GameNetworkMessage.ReadMissionObjectReferenceFromPacket(ref bufferReadValid);
                }
            }
            this.AttachLocalFrame = this.CollisionReaction == Mission.MissileCollisionReaction.BecomeInvisible || this.CollisionReaction == Mission.MissileCollisionReaction.PassThrough ? MatrixFrame.Identity : (!GameNetworkMessage.ReadBoolFromPacket(ref bufferReadValid) ? GameNetworkMessage.ReadNonUniformTransformFromPacket(CompressionBasic.PositionCompressionInfo, CompressionBasic.LowResQuaternionCompressionInfo, ref bufferReadValid) : GameNetworkMessage.ReadNonUniformTransformFromPacket(CompressionBasic.BigRangeLowResLocalPositionCompressionInfo, CompressionBasic.LowResQuaternionCompressionInfo, ref bufferReadValid));
            if (this.CollisionReaction == Mission.MissileCollisionReaction.BounceBack)
            {
                this.BounceBackVelocity        = GameNetworkMessage.ReadVec3FromPacket(CompressionMission.SpawnedItemVelocityCompressionInfo, ref bufferReadValid);
                this.BounceBackAngularVelocity = GameNetworkMessage.ReadVec3FromPacket(CompressionMission.SpawnedItemAngularVelocityCompressionInfo, ref bufferReadValid);
            }
            else
            {
                this.BounceBackVelocity        = Vec3.Zero;
                this.BounceBackAngularVelocity = Vec3.Zero;
            }
            if (this.CollisionReaction == Mission.MissileCollisionReaction.Stick || this.CollisionReaction == Mission.MissileCollisionReaction.BounceBack)
            {
                this.ForcedSpawnIndex = GameNetworkMessage.ReadIntFromPacket(CompressionBasic.MissionObjectIDCompressionInfo, ref bufferReadValid);
            }
            return(bufferReadValid);
        }