protected override bool OnRead()
        {
            bool bufferReadValid = true;

            this.MissileIndex = GameNetworkMessage.ReadIntFromPacket(CompressionMission.MissileCompressionInfo, ref bufferReadValid);
            this.Agent        = GameNetworkMessage.ReadAgentReferenceFromPacket(ref bufferReadValid);
            this.WeaponIndex  = (EquipmentIndex)GameNetworkMessage.ReadIntFromPacket(CompressionMission.WieldSlotCompressionInfo, ref bufferReadValid);
            if (this.WeaponIndex == EquipmentIndex.None)
            {
                this.Weapon = ModuleNetworkData.ReadMissileWeaponReferenceFromPacket(Game.Current.ObjectManager, ref bufferReadValid);
            }
            this.Position     = GameNetworkMessage.ReadVec3FromPacket(CompressionBasic.PositionCompressionInfo, ref bufferReadValid);
            this.Direction    = GameNetworkMessage.ReadVec3FromPacket(CompressionBasic.UnitVectorCompressionInfo, ref bufferReadValid);
            this.Speed        = GameNetworkMessage.ReadFloatFromPacket(CompressionMission.MissileSpeedCompressionInfo, ref bufferReadValid);
            this.HasRigidBody = GameNetworkMessage.ReadBoolFromPacket(ref bufferReadValid);
            if (this.HasRigidBody)
            {
                this.Orientation           = GameNetworkMessage.ReadRotationMatrixFromPacket(ref bufferReadValid);
                this.MissionObjectToIgnore = GameNetworkMessage.ReadMissionObjectReferenceFromPacket(ref bufferReadValid);
            }
            else
            {
                Vec3 f = GameNetworkMessage.ReadVec3FromPacket(CompressionBasic.UnitVectorCompressionInfo, ref bufferReadValid);
                this.Orientation = new Mat3(Vec3.Side, f, Vec3.Up);
                this.Orientation.Orthonormalize();
            }
            this.IsPrimaryWeaponShot = GameNetworkMessage.ReadBoolFromPacket(ref bufferReadValid);
            return(bufferReadValid);
        }
Exemplo n.º 2
0
        protected override bool OnRead()
        {
            bool bufferReadValid = true;

            this.Character             = (BasicCharacterObject)GameNetworkMessage.ReadObjectReferenceFromPacket(MBObjectManager.Instance, CompressionBasic.GUIDCompressionInfo, ref bufferReadValid);
            this.Monster               = (Monster)GameNetworkMessage.ReadObjectReferenceFromPacket(MBObjectManager.Instance, CompressionBasic.GUIDCompressionInfo, ref bufferReadValid);
            this.AgentIndex            = GameNetworkMessage.ReadAgentIndexFromPacket(CompressionMission.AgentCompressionInfo, ref bufferReadValid);
            this.MountAgentIndex       = GameNetworkMessage.ReadAgentIndexFromPacket(CompressionMission.AgentCompressionInfo, ref bufferReadValid);
            this.Peer                  = GameNetworkMessage.ReadNetworkPeerReferenceFromPacket(ref bufferReadValid);
            this.SpawnEquipment        = new Equipment();
            this.SpawnMissionEquipment = new MissionEquipment();
            for (EquipmentIndex index = EquipmentIndex.WeaponItemBeginSlot; index < EquipmentIndex.NumAllWeaponSlots; ++index)
            {
                this.SpawnMissionEquipment[index] = ModuleNetworkData.ReadWeaponReferenceFromPacket(MBObjectManager.Instance, ref bufferReadValid);
            }
            for (EquipmentIndex equipmentIndex = EquipmentIndex.NumAllWeaponSlots; equipmentIndex < EquipmentIndex.NumEquipmentSetSlots; ++equipmentIndex)
            {
                this.SpawnEquipment.AddEquipmentToSlotWithoutAgent(equipmentIndex, ModuleNetworkData.ReadItemReferenceFromPacket(MBObjectManager.Instance, ref bufferReadValid));
            }
            this.IsPlayerAgent       = GameNetworkMessage.ReadBoolFromPacket(ref bufferReadValid);
            this.BodyPropertiesSeed  = !this.IsPlayerAgent ? GameNetworkMessage.ReadIntFromPacket(CompressionGeneric.RandomSeedCompressionInfo, ref bufferReadValid) : 0;
            this.BodyPropertiesValue = GameNetworkMessage.ReadBodyPropertiesFromPacket(ref bufferReadValid);
            this.IsFemale            = GameNetworkMessage.ReadBoolFromPacket(ref bufferReadValid);
            this.Team           = GameNetworkMessage.ReadTeamReferenceFromPacket(ref bufferReadValid);
            this.Position       = GameNetworkMessage.ReadVec3FromPacket(CompressionBasic.PositionCompressionInfo, ref bufferReadValid);
            this.Direction      = GameNetworkMessage.ReadVec2FromPacket(CompressionBasic.UnitVectorCompressionInfo, ref bufferReadValid).Normalized();
            this.FormationIndex = GameNetworkMessage.ReadIntFromPacket(CompressionOrder.FormationClassCompressionInfo, ref bufferReadValid);
            this.ClothingColor1 = GameNetworkMessage.ReadUintFromPacket(CompressionGeneric.ColorCompressionInfo, ref bufferReadValid);
            this.ClothingColor2 = GameNetworkMessage.ReadUintFromPacket(CompressionGeneric.ColorCompressionInfo, ref bufferReadValid);
            return(bufferReadValid);
        }
Exemplo n.º 3
0
        protected override bool OnRead()
        {
            bool bufferReadValid = true;

            this.OrderType = (OrderType)GameNetworkMessage.ReadIntFromPacket(CompressionOrder.OrderTypeCompressionInfo, ref bufferReadValid);
            this.Position  = GameNetworkMessage.ReadVec3FromPacket(CompressionOrder.OrderPositionCompressionInfo, ref bufferReadValid);
            return(bufferReadValid);
        }
        protected override bool OnRead()
        {
            bool bufferReadValid = true;

            this.Agent     = GameNetworkMessage.ReadAgentReferenceFromPacket(ref bufferReadValid);
            this.Position  = GameNetworkMessage.ReadVec2FromPacket(CompressionBasic.PositionCompressionInfo, ref bufferReadValid);
            this.Direction = GameNetworkMessage.ReadVec3FromPacket(CompressionBasic.UnitVectorCompressionInfo, ref bufferReadValid);
            return(bufferReadValid);
        }
        protected override bool OnRead()
        {
            bool bufferReadValid = true;

            this.MissionObject = GameNetworkMessage.ReadMissionObjectReferenceFromPacket(ref bufferReadValid);
            this.LocalSpace    = GameNetworkMessage.ReadBoolFromPacket(ref bufferReadValid);
            this.Position      = GameNetworkMessage.ReadVec3FromPacket(this.LocalSpace ? CompressionBasic.LocalPositionCompressionInfo : CompressionBasic.PositionCompressionInfo, ref bufferReadValid);
            this.Impulse       = GameNetworkMessage.ReadVec3FromPacket(CompressionBasic.ImpulseCompressionInfo, ref bufferReadValid);
            return(bufferReadValid);
        }
        protected override bool OnRead()
        {
            bool bufferReadValid = true;

            this.AgentIndex       = GameNetworkMessage.ReadAgentIndexFromPacket(CompressionMission.AgentCompressionInfo, ref bufferReadValid);
            this.HorseItem        = ModuleNetworkData.ReadItemReferenceFromPacket(Game.Current.ObjectManager, ref bufferReadValid);
            this.HorseHarnessItem = ModuleNetworkData.ReadItemReferenceFromPacket(Game.Current.ObjectManager, ref bufferReadValid);
            this.Position         = GameNetworkMessage.ReadVec3FromPacket(CompressionBasic.PositionCompressionInfo, ref bufferReadValid);
            this.Direction        = GameNetworkMessage.ReadVec2FromPacket(CompressionBasic.UnitVectorCompressionInfo, ref bufferReadValid);
            return(bufferReadValid);
        }
        protected override bool OnRead()
        {
            bool bufferReadValid = true;

            this.MissionObject    = GameNetworkMessage.ReadMissionObjectReferenceFromPacket(ref bufferReadValid);
            this.DestructionLevel = GameNetworkMessage.ReadIntFromPacket(CompressionMission.UsableGameObjectDestructionStateCompressionInfo, ref bufferReadValid);
            this.ForcedIndex      = GameNetworkMessage.ReadBoolFromPacket(ref bufferReadValid) ? GameNetworkMessage.ReadIntFromPacket(CompressionBasic.MissionObjectIDCompressionInfo, ref bufferReadValid) : -1;
            this.BlowMagnitude    = GameNetworkMessage.ReadFloatFromPacket(CompressionMission.UsableGameObjectBlowMagnitude, ref bufferReadValid);
            this.BlowPosition     = GameNetworkMessage.ReadVec3FromPacket(CompressionBasic.PositionCompressionInfo, ref bufferReadValid);
            this.BlowDirection    = GameNetworkMessage.ReadVec3FromPacket(CompressionMission.UsableGameObjectBlowDirection, ref bufferReadValid);
            return(bufferReadValid);
        }
Exemplo n.º 8
0
        protected override bool OnRead()
        {
            bool bufferReadValid = true;

            this.Weapon        = ModuleNetworkData.ReadWeaponReferenceFromPacket(MBObjectManager.Instance, ref bufferReadValid);
            this.MissionObject = GameNetworkMessage.ReadMissionObjectReferenceFromPacket(ref bufferReadValid);
            Vec3 o   = GameNetworkMessage.ReadVec3FromPacket(CompressionBasic.LocalPositionCompressionInfo, ref bufferReadValid);
            Mat3 rot = GameNetworkMessage.ReadRotationMatrixFromPacket(ref bufferReadValid);

            if (bufferReadValid)
            {
                this.AttachLocalFrame = new MatrixFrame(rot, o);
            }
            return(bufferReadValid);
        }
Exemplo n.º 9
0
        protected override bool OnRead()
        {
            bool bufferReadValid = true;

            this.MissionObject = GameNetworkMessage.ReadMissionObjectReferenceFromPacket(ref bufferReadValid);
            Vec3 s             = GameNetworkMessage.ReadVec3FromPacket(CompressionBasic.UnitVectorCompressionInfo, ref bufferReadValid);
            Vec3 f             = GameNetworkMessage.ReadVec3FromPacket(CompressionBasic.UnitVectorCompressionInfo, ref bufferReadValid);
            Vec3 u             = GameNetworkMessage.ReadVec3FromPacket(CompressionBasic.UnitVectorCompressionInfo, ref bufferReadValid);
            Vec3 scalingVector = GameNetworkMessage.ReadVec3FromPacket(CompressionBasic.ScaleCompressionInfo, ref bufferReadValid);
            Vec3 o             = GameNetworkMessage.ReadVec3FromPacket(CompressionBasic.PositionCompressionInfo, ref bufferReadValid);

            if (bufferReadValid)
            {
                this.Frame = new MatrixFrame(new Mat3(s, f, u), o);
                this.Frame.Scale(scalingVector);
            }
            return(bufferReadValid);
        }
Exemplo n.º 10
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);
        }
        protected override bool OnRead()
        {
            bool bufferReadValid = true;

            this.Agent            = GameNetworkMessage.ReadAgentReferenceFromPacket(ref bufferReadValid, true);
            this.EquipmentIndex   = (EquipmentIndex)GameNetworkMessage.ReadIntFromPacket(CompressionMission.ItemSlotCompressionInfo, ref bufferReadValid);
            this.WeaponSpawnFlags = (Mission.WeaponSpawnFlags)GameNetworkMessage.ReadIntFromPacket(CompressionMission.SpawnedItemWeaponSpawnFlagCompressionInfo, ref bufferReadValid);
            if (this.WeaponSpawnFlags.HasAnyFlag <Mission.WeaponSpawnFlags>(Mission.WeaponSpawnFlags.WithPhysics))
            {
                this.Velocity        = GameNetworkMessage.ReadVec3FromPacket(CompressionMission.SpawnedItemVelocityCompressionInfo, ref bufferReadValid);
                this.AngularVelocity = GameNetworkMessage.ReadVec3FromPacket(CompressionMission.SpawnedItemAngularVelocityCompressionInfo, ref bufferReadValid);
            }
            else
            {
                this.Velocity        = Vec3.Zero;
                this.AngularVelocity = Vec3.Zero;
            }
            this.ForcedIndex = GameNetworkMessage.ReadIntFromPacket(CompressionBasic.MissionObjectIDCompressionInfo, ref bufferReadValid);
            return(bufferReadValid);
        }