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);
        }
        protected override bool OnRead()
        {
            bool bufferReadValid = true;

            this.Peer         = GameNetworkMessage.ReadNetworkPeerReferenceFromPacket(ref bufferReadValid);
            this.VisualsIndex = GameNetworkMessage.ReadIntFromPacket(CompressionMission.AgentOffsetCompressionInfo, ref bufferReadValid);
            this.Character    = (BasicCharacterObject)GameNetworkMessage.ReadObjectReferenceFromPacket(MBObjectManager.Instance, CompressionBasic.GUIDCompressionInfo, ref bufferReadValid);
            this.Equipment    = new Equipment();
            bool flag = GameNetworkMessage.ReadBoolFromPacket(ref bufferReadValid);

            for (EquipmentIndex equipmentIndex = EquipmentIndex.WeaponItemBeginSlot; equipmentIndex < (flag ? EquipmentIndex.NumEquipmentSetSlots : EquipmentIndex.ArmorItemEndSlot); ++equipmentIndex)
            {
                EquipmentElement itemRosterElement = ModuleNetworkData.ReadItemReferenceFromPacket(MBObjectManager.Instance, ref bufferReadValid);
                if (bufferReadValid)
                {
                    this.Equipment.AddEquipmentToSlotWithoutAgent(equipmentIndex, itemRosterElement);
                }
                else
                {
                    break;
                }
            }
            this.BodyPropertiesSeed        = GameNetworkMessage.ReadIntFromPacket(CompressionGeneric.RandomSeedCompressionInfo, ref bufferReadValid);
            this.IsFemale                  = GameNetworkMessage.ReadBoolFromPacket(ref bufferReadValid);
            this.SelectedEquipmentSetIndex = GameNetworkMessage.ReadIntFromPacket(CompressionBasic.MissionObjectIDCompressionInfo, ref bufferReadValid);
            this.TroopCountInFormation     = GameNetworkMessage.ReadIntFromPacket(CompressionBasic.PlayerCompressionInfo, ref bufferReadValid);
            return(bufferReadValid);
        }
示例#3
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);
        }
示例#4
0
        protected override bool OnRead()
        {
            bool bufferReadValid = true;

            this._optionList = new List <MultiplayerOptions.MultiplayerOption>();
            for (MultiplayerOptions.OptionType optionType = MultiplayerOptions.OptionType.ServerName; optionType < MultiplayerOptions.OptionType.NumOfSlots; ++optionType)
            {
                MultiplayerOptionsProperty optionProperty = optionType.GetOptionProperty();
                if (optionProperty.Replication == MultiplayerOptionsProperty.ReplicationOccurrence.AtMapLoad)
                {
                    MultiplayerOptions.MultiplayerOption multiplayerOption = MultiplayerOptions.MultiplayerOption.CreateMultiplayerOption(optionType);
                    switch (optionProperty.OptionValueType)
                    {
                    case MultiplayerOptions.OptionValueType.Bool:
                        multiplayerOption.UpdateValue(GameNetworkMessage.ReadBoolFromPacket(ref bufferReadValid));
                        break;

                    case MultiplayerOptions.OptionValueType.Integer:
                    case MultiplayerOptions.OptionValueType.Enum:
                        multiplayerOption.UpdateValue(GameNetworkMessage.ReadIntFromPacket(new CompressionInfo.Integer(optionProperty.BoundsMin, optionProperty.BoundsMax, true), ref bufferReadValid));
                        break;

                    case MultiplayerOptions.OptionValueType.String:
                        multiplayerOption.UpdateValue(GameNetworkMessage.ReadStringFromPacket(ref bufferReadValid));
                        break;
                    }
                    this._optionList.Add(multiplayerOption);
                }
            }
            return(bufferReadValid);
        }
 protected override bool OnRead()
 {
   bool bufferReadValid = true;
   this.Agent = GameNetworkMessage.ReadAgentReferenceFromPacket(ref bufferReadValid);
   this.IsSuccessful = GameNetworkMessage.ReadBoolFromPacket(ref bufferReadValid);
   return bufferReadValid;
 }
示例#6
0
        protected override bool OnRead()
        {
            bool bufferReadValid = true;

            this.SendMeBloodEvents = GameNetworkMessage.ReadBoolFromPacket(ref bufferReadValid);
            this.SendMeSoundEvents = GameNetworkMessage.ReadBoolFromPacket(ref bufferReadValid);
            return(bufferReadValid);
        }
示例#7
0
        protected override bool OnRead()
        {
            bool bufferReadValid = true;

            this.Peer     = GameNetworkMessage.ReadNetworkPeerReferenceFromPacket(ref bufferReadValid);
            this.Accepted = GameNetworkMessage.ReadBoolFromPacket(ref bufferReadValid);
            return(bufferReadValid);
        }
        protected override bool OnRead()
        {
            bool bufferReadValid = true;

            this.UsableGameObject     = GameNetworkMessage.ReadMissionObjectReferenceFromPacket(ref bufferReadValid) as UsableMissionObject;
            this.IsDisabledForPlayers = GameNetworkMessage.ReadBoolFromPacket(ref bufferReadValid);
            return(bufferReadValid);
        }
示例#9
0
        protected override bool OnRead()
        {
            bool bufferReadValid = true;

            this.IsDefendPressed = GameNetworkMessage.ReadBoolFromPacket(ref bufferReadValid);
            this.ForcedSlotIndexToDropWeaponFrom = (EquipmentIndex)GameNetworkMessage.ReadIntFromPacket(CompressionMission.WieldSlotCompressionInfo, ref bufferReadValid);
            return(bufferReadValid);
        }
        protected override bool OnRead()
        {
            bool bufferReadValid = true;

            this.Message         = GameNetworkMessage.ReadStringFromPacket(ref bufferReadValid);
            this.IsMessageTextId = GameNetworkMessage.ReadBoolFromPacket(ref bufferReadValid);
            return(bufferReadValid);
        }
示例#11
0
        protected override bool OnRead()
        {
            bool bufferReadValid = true;

            this.MissionObject = GameNetworkMessage.ReadMissionObjectReferenceFromPacket(ref bufferReadValid);
            this.Visible       = GameNetworkMessage.ReadBoolFromPacket(ref bufferReadValid);
            return(bufferReadValid);
        }
        protected override bool OnRead()
        {
            bool bufferReadValid = true;

            this.Agent          = GameNetworkMessage.ReadAgentReferenceFromPacket(ref bufferReadValid);
            this.ComponentIndex = GameNetworkMessage.ReadIntFromPacket(CompressionMission.AgentPrefabComponentIndexCompressionInfo, ref bufferReadValid);
            this.Visibility     = GameNetworkMessage.ReadBoolFromPacket(ref bufferReadValid);
            return(bufferReadValid);
        }
示例#13
0
        protected override bool OnRead()
        {
            bool bufferReadValid = true;

            this.MissionObject   = GameNetworkMessage.ReadMissionObjectReferenceFromPacket(ref bufferReadValid);
            this.BodyFlags       = (BodyFlags)GameNetworkMessage.ReadIntFromPacket(CompressionBasic.FlagsCompressionInfo, ref bufferReadValid);
            this.ApplyToChildren = GameNetworkMessage.ReadBoolFromPacket(ref bufferReadValid);
            return(bufferReadValid);
        }
示例#14
0
        protected override bool OnRead()
        {
            bool bufferReadValid = true;

            this.Agent           = GameNetworkMessage.ReadAgentReferenceFromPacket(ref bufferReadValid);
            this.IsKilled        = GameNetworkMessage.ReadBoolFromPacket(ref bufferReadValid);
            this.ActionCodeIndex = new ActionIndexCache(GameNetworkMessage.ReadIntFromPacket(CompressionBasic.ActionCodeCompressionInfo, ref bufferReadValid));
            return(bufferReadValid);
        }
示例#15
0
        protected override bool OnRead()
        {
            bool bufferReadValid = true;

            this.Team1     = GameNetworkMessage.ReadMBTeamReferenceFromPacket(CompressionMission.TeamCompressionInfo, ref bufferReadValid);
            this.Team2     = GameNetworkMessage.ReadMBTeamReferenceFromPacket(CompressionMission.TeamCompressionInfo, ref bufferReadValid);
            this.IsEnemyOf = GameNetworkMessage.ReadBoolFromPacket(ref bufferReadValid);
            return(bufferReadValid);
        }
        protected override bool OnRead()
        {
            bool bufferReadValid = true;

            this.InMission = GameNetworkMessage.ReadBoolFromPacket(ref bufferReadValid);
            this.GameType  = GameNetworkMessage.ReadStringFromPacket(ref bufferReadValid);
            this.Map       = GameNetworkMessage.ReadStringFromPacket(ref bufferReadValid);
            return(bufferReadValid);
        }
示例#17
0
        protected override bool OnRead()
        {
            bool bufferReadValid = true;

            this.MissionObject  = GameNetworkMessage.ReadMissionObjectReferenceFromPacket(ref bufferReadValid);
            this.ChannelNo      = GameNetworkMessage.ReadBoolFromPacket(ref bufferReadValid) ? 1 : 0;
            this.AnimationIndex = GameNetworkMessage.ReadIntFromPacket(CompressionBasic.AnimationIndexCompressionInfo, ref bufferReadValid);
            this.AnimationSpeed = GameNetworkMessage.ReadBoolFromPacket(ref bufferReadValid) ? GameNetworkMessage.ReadFloatFromPacket(CompressionBasic.AnimationSpeedCompressionInfo, ref bufferReadValid) : 1f;
            return(bufferReadValid);
        }
示例#18
0
        protected override bool OnRead()
        {
            bool bufferReadValid = true;

            this.Agent             = GameNetworkMessage.ReadAgentReferenceFromPacket(ref bufferReadValid, true);
            this.SpawnedItemEntity = GameNetworkMessage.ReadMissionObjectReferenceFromPacket(ref bufferReadValid) as SpawnedItemEntity;
            this.SlotIndex         = (EquipmentIndex)GameNetworkMessage.ReadIntFromPacket(CompressionMission.ItemSlotCompressionInfo, ref bufferReadValid);
            this.RemoveWeapon      = GameNetworkMessage.ReadBoolFromPacket(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);
        }
        public virtual bool ReadFromNetwork()
        {
            bool bufferReadValid = true;

            this.GameEntity.SetVisibilityExcludeParents(GameNetworkMessage.ReadBoolFromPacket(ref bufferReadValid));
            if (GameNetworkMessage.ReadBoolFromPacket(ref bufferReadValid))
            {
                MatrixFrame frame = GameNetworkMessage.ReadMatrixFrameFromPacket(ref bufferReadValid);
                this.GameEntity.SetFrame(ref frame);
                if (GameNetworkMessage.ReadBoolFromPacket(ref bufferReadValid))
                {
                    this._firstFrame       = this.GameEntity.GetFrame();
                    this._lastSynchedFrame = GameNetworkMessage.ReadMatrixFrameFromPacket(ref bufferReadValid);
                    this.SetSynchState(SynchedMissionObject.SynchState.SynchronizeFrameOverTime);
                    this._duration = GameNetworkMessage.ReadFloatFromPacket(CompressionMission.FlagCapturePointDurationCompressionInfo, ref bufferReadValid);
                    this._timer    = 0.0f;
                    if (this._duration.ApproximatelyEqualsTo(0.0f))
                    {
                        this._duration = 0.1f;
                    }
                }
            }
            if ((NativeObject)this.GameEntity.Skeleton != (NativeObject)null && GameNetworkMessage.ReadBoolFromPacket(ref bufferReadValid))
            {
                int   animationIndex           = GameNetworkMessage.ReadIntFromPacket(CompressionBasic.AnimationIndexCompressionInfo, ref bufferReadValid);
                float animationSpeedMultiplier = GameNetworkMessage.ReadFloatFromPacket(CompressionBasic.AnimationSpeedCompressionInfo, ref bufferReadValid);
                float parameter = GameNetworkMessage.ReadFloatFromPacket(CompressionBasic.UnitVectorCompressionInfo, ref bufferReadValid);
                this.GameEntity.Skeleton.SetAnimationAtChannel(animationIndex, 0, animationSpeedMultiplier, 0.0f);
                this.GameEntity.Skeleton.SetAnimationParameterAtChannel(0, parameter);
                if (GameNetworkMessage.ReadBoolFromPacket(ref bufferReadValid))
                {
                    this.GameEntity.Skeleton.TickAnimationsAndForceUpdate(1f / 1000f, this.GameEntity.GetGlobalFrame(), true);
                    this.GameEntity.PauseSkeletonAnimation();
                }
                else
                {
                    this.GameEntity.ResumeSkeletonAnimation();
                }
            }
            if (GameNetworkMessage.ReadBoolFromPacket(ref bufferReadValid))
            {
                uint color1 = GameNetworkMessage.ReadUintFromPacket(CompressionGeneric.ColorCompressionInfo, ref bufferReadValid);
                uint color2 = GameNetworkMessage.ReadUintFromPacket(CompressionGeneric.ColorCompressionInfo, ref bufferReadValid);
                if (bufferReadValid)
                {
                    this.GameEntity.SetColor(color1, color2, "use_team_color");
                }
            }
            if (GameNetworkMessage.ReadBoolFromPacket(ref bufferReadValid))
            {
                this.SetDisabledAndMakeInvisible();
            }
            return(bufferReadValid);
        }
示例#21
0
        protected override bool OnRead()
        {
            bool bufferReadValid = true;

            this.AutoAssign = GameNetworkMessage.ReadBoolFromPacket(ref bufferReadValid);
            if (!this.AutoAssign)
            {
                this.Team = GameNetworkMessage.ReadTeamReferenceFromPacket(ref bufferReadValid);
            }
            return(bufferReadValid);
        }
示例#22
0
        protected override bool OnRead()
        {
            bool bufferReadValid = true;

            this.Agent                     = GameNetworkMessage.ReadAgentReferenceFromPacket(ref bufferReadValid);
            this.IsLeftHand                = GameNetworkMessage.ReadBoolFromPacket(ref bufferReadValid);
            this.IsWieldedInstantly        = GameNetworkMessage.ReadBoolFromPacket(ref bufferReadValid);
            this.IsWieldedOnSpawn          = GameNetworkMessage.ReadBoolFromPacket(ref bufferReadValid);
            this.WieldedItemIndex          = (EquipmentIndex)GameNetworkMessage.ReadIntFromPacket(CompressionMission.WieldSlotCompressionInfo, ref bufferReadValid);
            this.MainHandCurrentUsageIndex = GameNetworkMessage.ReadIntFromPacket(CompressionMission.WeaponUsageIndexCompressionInfo, 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);
        }
示例#24
0
        protected override bool OnRead()
        {
            bool bufferReadValid = true;

            this.Team             = GameNetworkMessage.ReadMBTeamReferenceFromPacket(CompressionMission.TeamCompressionInfo, ref bufferReadValid);
            this.Side             = (BattleSideEnum)GameNetworkMessage.ReadIntFromPacket(CompressionMission.TeamSideCompressionInfo, ref bufferReadValid);
            this.Color            = GameNetworkMessage.ReadUintFromPacket(CompressionGeneric.ColorCompressionInfo, ref bufferReadValid);
            this.Color2           = GameNetworkMessage.ReadUintFromPacket(CompressionGeneric.ColorCompressionInfo, ref bufferReadValid);
            this.BannerCode       = GameNetworkMessage.ReadStringFromPacket(ref bufferReadValid);
            this.IsPlayerGeneral  = GameNetworkMessage.ReadBoolFromPacket(ref bufferReadValid);
            this.IsPlayerSergeant = GameNetworkMessage.ReadBoolFromPacket(ref bufferReadValid);
            return(bufferReadValid);
        }
        protected override bool OnRead()
        {
            bool bufferReadValid = true;

            this.Weapon              = ModuleNetworkData.ReadWeaponReferenceFromPacket(MBObjectManager.Instance, ref bufferReadValid);
            this.Frame               = GameNetworkMessage.ReadMatrixFrameFromPacket(ref bufferReadValid);
            this.WeaponSpawnFlags    = (Mission.WeaponSpawnFlags)GameNetworkMessage.ReadIntFromPacket(CompressionMission.SpawnedItemWeaponSpawnFlagCompressionInfo, ref bufferReadValid);
            this.ForcedIndex         = GameNetworkMessage.ReadIntFromPacket(CompressionBasic.MissionObjectIDCompressionInfo, ref bufferReadValid);
            this.ParentMissionObject = GameNetworkMessage.ReadMissionObjectReferenceFromPacket(ref bufferReadValid);
            this.IsVisible           = GameNetworkMessage.ReadBoolFromPacket(ref bufferReadValid);
            this.HasLifeTime         = GameNetworkMessage.ReadBoolFromPacket(ref bufferReadValid);
            return(bufferReadValid);
        }
        protected override bool OnRead()
        {
            bool bufferReadValid = true;

            this.MissionObject = GameNetworkMessage.ReadMissionObjectReferenceFromPacket(ref bufferReadValid);
            bool flag = GameNetworkMessage.ReadBoolFromPacket(ref bufferReadValid);

            if (bufferReadValid)
            {
                this.ChannelNo = flag ? 1 : 0;
            }
            this.Parameter = GameNetworkMessage.ReadFloatFromPacket(CompressionBasic.UnitVectorCompressionInfo, ref bufferReadValid);
            return(bufferReadValid);
        }
示例#27
0
        protected override bool OnRead()
        {
            bool bufferReadValid = true;

            this.ParameterOne = this.ParameterTwo = -1;
            this.Message      = GameNetworkMessage.ReadIntFromPacket(CompressionMission.MultiplayerNotificationCompressionInfo, ref bufferReadValid);
            if (GameNetworkMessage.ReadBoolFromPacket(ref bufferReadValid))
            {
                this.ParameterOne = GameNetworkMessage.ReadIntFromPacket(CompressionMission.MultiplayerNotificationParameterCompressionInfo, ref bufferReadValid);
                if (GameNetworkMessage.ReadBoolFromPacket(ref bufferReadValid))
                {
                    this.ParameterTwo = GameNetworkMessage.ReadIntFromPacket(CompressionMission.MultiplayerNotificationParameterCompressionInfo, ref bufferReadValid);
                }
            }
            return(bufferReadValid);
        }
示例#28
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);
        }
示例#29
0
        public static MissionWeapon ReadWeaponReferenceFromPacket(
            MBObjectManager objectManager,
            ref bool bufferReadValid)
        {
            if (GameNetworkMessage.ReadBoolFromPacket(ref bufferReadValid))
            {
                return(MissionWeapon.Invalid);
            }
            MBObjectBase mbObjectBase1 = GameNetworkMessage.ReadObjectReferenceFromPacket(objectManager, CompressionBasic.GUIDCompressionInfo, ref bufferReadValid);
            int          num1          = GameNetworkMessage.ReadIntFromPacket(CompressionGeneric.ItemDataValueCompressionInfo, ref bufferReadValid);
            int          num2          = GameNetworkMessage.ReadIntFromPacket(CompressionMission.WeaponReloadPhaseCompressionInfo, ref bufferReadValid);
            short        num3          = (short)GameNetworkMessage.ReadIntFromPacket(CompressionMission.WeaponUsageIndexCompressionInfo, ref bufferReadValid);
            int          num4          = GameNetworkMessage.ReadBoolFromPacket(ref bufferReadValid) ? 1 : 0;
            Banner       banner        = (Banner)null;

            if (num4 != 0)
            {
                string bannerKey = GameNetworkMessage.ReadStringFromPacket(ref bufferReadValid);
                if (bufferReadValid)
                {
                    banner = new Banner(bannerKey);
                }
            }
            ItemObject    primaryItem1 = mbObjectBase1 as ItemObject;
            bool          flag         = GameNetworkMessage.ReadBoolFromPacket(ref bufferReadValid);
            MissionWeapon missionWeapon;

            if (bufferReadValid & flag)
            {
                MBObjectBase mbObjectBase2 = GameNetworkMessage.ReadObjectReferenceFromPacket(objectManager, CompressionBasic.GUIDCompressionInfo, ref bufferReadValid);
                int          num5          = GameNetworkMessage.ReadIntFromPacket(CompressionGeneric.ItemDataValueCompressionInfo, ref bufferReadValid);
                ItemObject   primaryItem2  = mbObjectBase2 as ItemObject;
                missionWeapon = new MissionWeapon(primaryItem1, (ItemModifier)null, banner, (short)num1, (short)num2, new MissionWeapon?(new MissionWeapon(primaryItem2, (ItemModifier)null, banner, (short)num5)));
            }
            else
            {
                missionWeapon = new MissionWeapon(primaryItem1, (ItemModifier)null, banner, (short)num1, (short)num2, new MissionWeapon?());
            }
            missionWeapon.CurrentUsageIndex = (int)num3;
            return(missionWeapon);
        }