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.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); }