Exemple #1
0
        protected override bool OnRead()
        {
            bool bufferReadValid = true;

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

            this.MissionObject = GameNetworkMessage.ReadMissionObjectReferenceFromPacket(ref bufferReadValid);
            this.Frame         = GameNetworkMessage.ReadMatrixFrameFromPacket(ref bufferReadValid);
            this.Duration      = GameNetworkMessage.ReadFloatFromPacket(CompressionMission.FlagCapturePointDurationCompressionInfo, 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);
        }
        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.ObjectId = GameNetworkMessage.ReadMissionObjectIdFromPacket(ref bufferReadValid);
            this.Prefab   = GameNetworkMessage.ReadStringFromPacket(ref bufferReadValid);
            this.Frame    = GameNetworkMessage.ReadMatrixFrameFromPacket(ref bufferReadValid);
            int capacity = GameNetworkMessage.ReadIntFromPacket(CompressionBasic.EntityChildCountCompressionInfo, ref bufferReadValid);

            if (bufferReadValid)
            {
                this.ChildObjectIds = new List <MissionObjectId>(capacity);
                for (int index = 0; index < capacity; ++index)
                {
                    if (bufferReadValid)
                    {
                        this.ChildObjectIds.Add(GameNetworkMessage.ReadMissionObjectIdFromPacket(ref bufferReadValid));
                    }
                }
            }
            return(bufferReadValid);
        }