using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Net; using System.Net.Http; using System.Net.NetworkInformation; using System.Net.Sockets; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Cryptography; using System.Security.Permissions; using System.Text; using System.Threading; using System.Threading.Tasks; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using BepInEx.Logging; using Cysharp.Threading.Tasks; using Cysharp.Threading.Tasks.CompilerServices; using GameNetcodeStuff; using HarmonyLib; using LethalCompanyInputUtils.Api; using LethalMin; using Microsoft.CodeAnalysis; using NAudio.Wave; using RadioBrowser; using RadioBrowser.Models; using ScanVan; using ScanVan.Behaviour; using ScanVan.ClipLoading; using ScanVan.Compatibility; using ScanVan.Managers; using ScanVan.Networking; using ScanVan.Patches; using ScanVan.Utils; using ScandalsTweaks.Patches; using ScandalsTweaks.Utils; using TMPro; using Unity.Netcode; using UnityEngine; using UnityEngine.AI; using UnityEngine.Audio; using UnityEngine.Events; using UnityEngine.InputSystem; using UnityEngine.Networking; using UnityEngine.Rendering; using UnityEngine.Rendering.HighDefinition; using UnityEngine.UI; using VoxxWeatherPlugin.Patches; using VoxxWeatherPlugin.Utils; using VoxxWeatherPlugin.Weathers; using Woecust.ImmersiveVisor; using scandal.scanvan.NetcodePatcher; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: IgnoresAccessChecksTo("Assembly-CSharp-firstpass")] [assembly: IgnoresAccessChecksTo("Assembly-CSharp")] [assembly: IgnoresAccessChecksTo("ImmersiveVisor")] [assembly: IgnoresAccessChecksTo("NoteBoxz.LethalMin")] [assembly: IgnoresAccessChecksTo("scandal.scandalstweaks")] [assembly: IgnoresAccessChecksTo("Unity.Netcode.Runtime")] [assembly: IgnoresAccessChecksTo("voxx.LethalElementsPlugin")] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("scandal.scanvan")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.5.2.0")] [assembly: AssemblyInformationalVersion("1.5.2+57fd1df4b1d28b3ffb44f465ec736e8eb6d9803a")] [assembly: AssemblyProduct("ScanVan")] [assembly: AssemblyTitle("scandal.scanvan")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.5.2.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] [module: NetcodePatchedAssembly] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte P_0) { Flag = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } public class CruiserXLCollisionTrigger : MonoBehaviour { public CruiserXLController mainScript = null; public BoxCollider insideTruckNavMeshBounds = null; public EnemyAI[] enemiesLastHit = null; private float timeSinceHittingPlayer; private float timeSinceHittingEnemy; private int enemyIndex; public void Start() { enemiesLastHit = (EnemyAI[])(object)new EnemyAI[3]; } public void OnTriggerEnter(Collider other) { //IL_040b: Unknown result type (might be due to invalid IL or missing references) //IL_0411: Invalid comparison between Unknown and I4 //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_018b: Unknown result type (might be due to invalid IL or missing references) //IL_019b: Unknown result type (might be due to invalid IL or missing references) //IL_01a0: Unknown result type (might be due to invalid IL or missing references) //IL_01d4: Unknown result type (might be due to invalid IL or missing references) //IL_01de: Unknown result type (might be due to invalid IL or missing references) //IL_01e3: Unknown result type (might be due to invalid IL or missing references) //IL_0219: Unknown result type (might be due to invalid IL or missing references) //IL_0221: Unknown result type (might be due to invalid IL or missing references) //IL_0227: Unknown result type (might be due to invalid IL or missing references) //IL_0334: Unknown result type (might be due to invalid IL or missing references) //IL_033f: Unknown result type (might be due to invalid IL or missing references) //IL_034a: Unknown result type (might be due to invalid IL or missing references) //IL_04be: Unknown result type (might be due to invalid IL or missing references) //IL_04cf: Unknown result type (might be due to invalid IL or missing references) //IL_04da: Unknown result type (might be due to invalid IL or missing references) //IL_04df: Unknown result type (might be due to invalid IL or missing references) //IL_0291: Unknown result type (might be due to invalid IL or missing references) //IL_02ec: Unknown result type (might be due to invalid IL or missing references) //IL_02f1: Unknown result type (might be due to invalid IL or missing references) //IL_0527: Unknown result type (might be due to invalid IL or missing references) //IL_052c: Unknown result type (might be due to invalid IL or missing references) //IL_053d: Unknown result type (might be due to invalid IL or missing references) //IL_055b: Unknown result type (might be due to invalid IL or missing references) //IL_0560: Unknown result type (might be due to invalid IL or missing references) //IL_0571: Unknown result type (might be due to invalid IL or missing references) //IL_0616: Unknown result type (might be due to invalid IL or missing references) //IL_061b: Unknown result type (might be due to invalid IL or missing references) //IL_062c: Unknown result type (might be due to invalid IL or missing references) //IL_0631: Unknown result type (might be due to invalid IL or missing references) //IL_0633: Unknown result type (might be due to invalid IL or missing references) //IL_0635: Unknown result type (might be due to invalid IL or missing references) //IL_0637: Unknown result type (might be due to invalid IL or missing references) //IL_064a: Expected I4, but got Unknown //IL_065b: Unknown result type (might be due to invalid IL or missing references) //IL_0660: Unknown result type (might be due to invalid IL or missing references) //IL_0668: Unknown result type (might be due to invalid IL or missing references) //IL_0691: Unknown result type (might be due to invalid IL or missing references) //IL_0696: Unknown result type (might be due to invalid IL or missing references) //IL_069e: Unknown result type (might be due to invalid IL or missing references) //IL_06c7: Unknown result type (might be due to invalid IL or missing references) //IL_06cc: Unknown result type (might be due to invalid IL or missing references) //IL_06d4: Unknown result type (might be due to invalid IL or missing references) if (!((VehicleController)mainScript).hasBeenSpawned || (((VehicleController)mainScript).magnetedToShip && ((VehicleController)mainScript).magnetTime > 0.8f)) { return; } if (((Component)other).CompareTag("Player")) { PlayerControllerB val = default(PlayerControllerB); ((Component)other).TryGetComponent(ref val); if ((Object)(object)val == (Object)null) { return; } Transform physicsTransform = ((VehicleController)mainScript).physicsRegion.physicsTransform; if ((Object)(object)val.physicsParent == (Object)(object)physicsTransform || (Object)(object)val.overridePhysicsParent == (Object)(object)physicsTransform || Time.realtimeSinceStartup - timeSinceHittingPlayer < 0.25f) { return; } float num = ((Vector3)(ref ((VehicleController)mainScript).averageVelocity)).magnitude; if (num < 2f) { return; } Vector3 val2 = ((Component)val).transform.position - ((VehicleController)mainScript).mainRigidbody.position; float num2 = Vector3.Angle(Vector3.Normalize(((VehicleController)mainScript).averageVelocity * 1000f), Vector3.Normalize(val2 * 1000f)); if (num2 > 70f) { return; } if (num2 < 30f && mainScript.wheelRPM > 400f) { num += 6f; } if ((((Component)val.gameplayCamera).transform.position - ((VehicleController)mainScript).mainRigidbody.position).y < -0.1f) { num *= 2f; } timeSinceHittingPlayer = Time.realtimeSinceStartup; Vector3 val3 = Vector3.ClampMagnitude(((VehicleController)mainScript).averageVelocity, 40f); if ((Object)(object)val == (Object)(object)GameNetworkManager.Instance.localPlayerController) { if (num > 20f) { GameNetworkManager.Instance.localPlayerController.KillPlayer(val3, true, (CauseOfDeath)8, 9, default(Vector3), false); } else { int num3 = 0; if (num > 15f) { num3 = 80; } else if (num > 12f) { num3 = 60; } else if (num > 8f) { num3 = 40; } if (num3 > 0) { GameNetworkManager.Instance.localPlayerController.DamagePlayer(num3, true, true, (CauseOfDeath)8, 0, false, val3); } } if (!GameNetworkManager.Instance.localPlayerController.isPlayerDead && ((Vector3)(ref GameNetworkManager.Instance.localPlayerController.externalForceAutoFade)).sqrMagnitude < ((Vector3)(ref ((VehicleController)mainScript).averageVelocity)).sqrMagnitude) { GameNetworkManager.Instance.localPlayerController.externalForceAutoFade = ((VehicleController)mainScript).averageVelocity; } } else if (((NetworkBehaviour)mainScript).IsOwner && ((Vector3)(ref ((VehicleController)mainScript).averageVelocity)).magnitude > 1.8f) { mainScript.CarReactToObstacle(((VehicleController)mainScript).averageVelocity, ((Component)val).transform.position, ((VehicleController)mainScript).averageVelocity, (CarObstacleType)0); } } else { if (!((Component)other).gameObject.CompareTag("Enemy") || Time.realtimeSinceStartup - timeSinceHittingEnemy < 0.25f) { return; } EnemyAICollisionDetect val4 = default(EnemyAICollisionDetect); ((Component)other).TryGetComponent(ref val4); if ((Object)(object)val4 == (Object)null || (Object)(object)val4.mainScript == (Object)null || val4.mainScript.isEnemyDead || (!val4.mainScript.enemyType.canDie && (int)val4.mainScript.enemyType.SizeLimit == 0)) { return; } EnemyAI obj = val4.mainScript; MouthDogAI val5 = (MouthDogAI)(object)((obj is MouthDogAI) ? obj : null); if ((!((Object)(object)val5 != (Object)null) || !Object.op_Implicit((Object)(object)val5) || val5.suspicionLevel <= 8) && !((VehicleController)mainScript).ignitionStarted) { return; } Object navMeshOwner = val4.mainScript.agent.navMeshOwner; Behaviour val6 = (Behaviour)(object)((navMeshOwner is Behaviour) ? navMeshOwner : null); if (((Object)(object)val6 != (Object)null && ((Component)val6).transform.IsChildOf(((Component)mainScript).transform)) || Vector3.Angle(((VehicleController)mainScript).averageVelocity, ((Component)val4.mainScript).transform.position - ((Component)this).transform.position) > 130f || ((mainScript.liftGateOpen || mainScript.sideDoorOpen) && (((Collider)insideTruckNavMeshBounds).ClosestPoint(((Component)val4.mainScript).transform.position) == ((Component)val4.mainScript).transform.position || ((Collider)insideTruckNavMeshBounds).ClosestPoint(val4.mainScript.agent.destination) == val4.mainScript.agent.destination))) { return; } bool dealDamage = false; for (int i = 0; i < enemiesLastHit.Length; i++) { if ((Object)(object)enemiesLastHit[i] == (Object)(object)val4.mainScript && (Time.realtimeSinceStartup - timeSinceHittingEnemy < 0.6f || ((Vector3)(ref ((VehicleController)mainScript).averageVelocity)).magnitude < 4f)) { dealDamage = true; } } timeSinceHittingEnemy = Time.realtimeSinceStartup; Vector3 position = ((Component)val4).transform.position; bool flag = false; EnemySize enemySize = val4.mainScript.enemyType.EnemySize; EnemySize val7 = enemySize; switch ((int)val7) { case 0: flag = mainScript.CarReactToObstacle(((VehicleController)mainScript).averageVelocity, position, ((VehicleController)mainScript).averageVelocity, (CarObstacleType)1, 1f, val4.mainScript, dealDamage); break; case 1: flag = mainScript.CarReactToObstacle(((VehicleController)mainScript).averageVelocity, position, ((VehicleController)mainScript).averageVelocity, (CarObstacleType)1, 3f, val4.mainScript, dealDamage); break; case 2: flag = mainScript.CarReactToObstacle(((VehicleController)mainScript).averageVelocity, position, ((VehicleController)mainScript).averageVelocity, (CarObstacleType)1, 2f, val4.mainScript, dealDamage); break; } if (flag) { enemyIndex = (enemyIndex + 1) % 3; enemiesLastHit[enemyIndex] = val4.mainScript; return; } for (int j = 0; j < enemiesLastHit.Length; j++) { if ((Object)(object)enemiesLastHit[j] == (Object)(object)val4.mainScript) { enemiesLastHit[j] = null; } } } } } public class CruiserXLController : VehicleController { [Header("Modules")] public EVAModule voiceModule = null; [Header("Variation")] public Material truckMat = null; public Material rareTruckDialsOn = null; public Material rareTruckClusterOn = null; public Material rareTruckRadioOn = null; public Material rareHeaterOn = null; public Material rareWindowOn = null; public Texture2D defaultTruckTex = null; public Texture2D rareTruckTex = null; public Light radioLightCol = null; public Light heaterLightCol = null; public Light clusterLightCol = null; public Light leftWindowLightCol = null; public Light rightWindowLightCol = null; public float specialChance; public bool isSpecial; public Light jcJensonLight = null; public SpriteRenderer jcJensonSymbol = null; public GameObject jcJensonSymbolObj = null; [Header("Vehicle Physics")] public List wheels = null; public AnimationCurve steeringWheelCurve = null; public NavMeshObstacle navObstacle = null; public CapsuleCollider cabinPoint = null; public CruiserXLCollisionTrigger collisionTrigger = null; public Rigidbody playerPhysicsBody = null; public AnimationCurve engineCurve = null; public AnimationCurve enginePowerCurve = null; public Coroutine automaticTransmissionCoroutine = null; private WheelHit[] wheelHits = (WheelHit[])(object)new WheelHit[4]; public Vector3 lastVelocity; public Vector3 previousVehiclePosition; public bool allWheelsAirborne; private float timeSinceUntethered; public float brakeInput; public float clutchInput; public float gasInput; public float timeAtLastGearboxDamage; public int baseTransmissionHP = 20; public int syncedTransmissionHP; public int transmissionHP; public bool usingSwitchIgnition; public float clutchSpeed; public float minClutchReturnSpeed; public float clutchReturnSpeed; public float stallTimer; public bool engineStalled = false; public float clutchFriction; public float clutchSlip; public float clutchEngagement; public bool clutchPedalPressed; public bool lastClutchPedalPressed; public float enginePower; public float engineReversePower; public float throttleReleaseSpeed; public float maxThrottleSpeed; public float throttleSpeed; public float inclineCompensation; public float throttleInput; public bool handbrakeEngaged; public bool inReverse; public bool inNeutral; public float[] gearRatios = null; public float diffRatio; public int currentGear; public float upShiftThreshold = 2500f; public float downShiftThreshold = 1100f; public float lastShiftTime = 0f; public float shiftCooldown = 0.6f; public float shiftTime = 0.15f; public float extraWeight = 0f; public float forwardWheelSpeed; public float reverseWheelSpeed; public float minInclineCompensation = 1.78f; public float maxInclineCompensation = 4.1f; public float maxInclineCompensationAngle = 32f; public float frontWheelRPM; public float backWheelRPM; public float wheelRPM; private float timeSinceLastCollision; private float steeringDecay = 1f; private float forwardsSlip; public float baseForwardStiffness = 1f; public float baseSidewaysStiffness = 0.75f; public float wheelTorque; public float wheelBrakeTorque; public bool hasDeliveredVehicle; public float maxBrakingPower; public float baseSteeringWheelTurnSpeed; [Header("Multiplayer")] public Collider itemSafetyBounds = null; public Collider vehicleBounds = null; public Collider storageCompartment = null; public PlayerControllerB playerWhoShifted = null; public VehiclePlayerSeat frontLeftSeat = null; public VehiclePlayerSeat frontMiddleSeat = null; public VehiclePlayerSeat frontRightSeat = null; public PlayerControllerB currentMiddlePassenger = null; public InteractTrigger middlePassengerSeatTrigger = null; public InteractTrigger driversSideWindow = null; public InteractTrigger passengersSideWindow = null; public AnimatedObjectTrigger driversSideWindowTrigger = null; public AnimatedObjectTrigger passengersSideWindowTrigger = null; public Vector3 playerPositionOffset; public Vector3 seatNodePositionOffset; public Vector2 syncedMoveInputVector; public bool localPlayerInMiddlePassengerSeat; public float syncedWheelRotation; public float syncedFrontWheelRPM; public float syncedBackWheelRPM; public float syncedWheelRPM; public float syncedEngineRPM; public float syncedMotorTorque; public float syncedBrakeTorque; public int syncedCarHP; public bool syncedDrivePedalPressed; public bool syncedBrakePedalPressed; public bool syncedClutchPedalPressed; public float tyreStress; public bool wheelSlipping; public float syncCarEffectsInterval; public float syncWheelTorqueInterval; public float syncCarDrivetrainInterval; [Header("Effects")] public GameObject heaterDirectionLever = null; public GameObject heaterTempLever = null; public GameObject fanSpeedLever = null; public MeshRenderer heaterBaseMesh = null; public MeshRenderer windshieldMesh = null; public GameObject[] disableOnDestroy = null; public GameObject[] enableOnDestroy = null; public GameObject windshieldObject = null; public InteractTrigger pushTruckTrigger = null; public MeshRenderer leftBrakeMesh = null; public MeshRenderer rightBrakeMesh = null; public MeshRenderer backLeftBrakeMesh = null; public MeshRenderer backRightBrakeMesh = null; public Collider[] weatherEffectBlockers = null; public Collider ignitionCollider = null; public Animator handbrakeAnimator = null; public ScanNodeProperties scanNode = null; public GameObject blinkerLightsContainer = null; public GameObject sideDoorContainer = null; public GameObject leftElectricMirror = null; public GameObject rightElectricMirror = null; public Coroutine dashboardSymbolPreStartup = null; public Light hazardWarningLight = null; public Light leftSignalLight = null; public Light rightSignalLight = null; public SpriteRenderer hazardWarningSymbol = null; public SpriteRenderer leftSignalSymbol = null; public SpriteRenderer rightSignalSymbol = null; public Light vehicleDisplayLight = null; public SpriteRenderer vehicleDisplay = null; public Light parkingBrakeLight = null; public Light checkEngineLight = null; public Light alertLight = null; public Light seatBeltLight = null; public Light oilLevelLight = null; public Light batteryLight = null; public Light coolantLevelLight = null; public Light dippedBeamLight = null; public Light highBeamLight = null; public Light immobiliserLight = null; public SpriteRenderer parkingBrakeSymbol = null; public SpriteRenderer checkEngineLightSymbol = null; public SpriteRenderer alertLightSymbol = null; public SpriteRenderer seatbeltLightSymbol = null; public SpriteRenderer oilLevelLightSymbol = null; public SpriteRenderer batteryLightSymbol = null; public SpriteRenderer coolantLevelLightSymbol = null; public SpriteRenderer dippedBeamLightSymbol = null; public SpriteRenderer highBeamLightSymbol = null; public SpriteRenderer immobiliserSymbol = null; public Animator ignitionAnimator = null; public GameObject carKeyContainer = null; public GameObject carKeyInHand = null; public Transform ignitionKeyPosition = null; public GameObject headlightSwitch = null; public MeshRenderer lowBeamMesh = null; public MeshRenderer highBeamMesh = null; public GameObject highBeamContainer = null; public GameObject clusterLightsContainer = null; public MeshRenderer leftDoorMesh = null; public MeshRenderer rightDoorMesh = null; public MeshRenderer radioMesh = null; public MeshRenderer radioPowerDial = null; public MeshRenderer radioVolumeDial = null; public GameObject radioLight = null; public GameObject heaterLight = null; public GameObject leftWindowLight = null; public GameObject rightWindowLight = null; public TextMeshPro radioTime = null; public TextMeshPro radioFrequency = null; public GameObject sideLightsContainer = null; public MeshRenderer sideTopLightsMesh = null; public AnimationCurve oilPressureNeedleCurve = null; public AnimationCurve turboPressureNeedleCurve = null; public MeshRenderer interiorMesh = null; public MeshRenderer speedometerMesh = null; public MeshRenderer tachometerMesh = null; public MeshRenderer oilPressureMesh = null; public MeshRenderer lowBeamMeshLod = null; public MeshRenderer highBeamMeshLod = null; public MeshRenderer backLightsMeshLod = null; public MeshRenderer sideTopLightsMeshLod = null; public MeshRenderer leftBlinkerMeshLod = null; public MeshRenderer rightBlinkerMeshLod = null; public MeshRenderer leftBlinkerMesh = null; public MeshRenderer rightBlinkerMesh = null; public Transform speedometerTransform = null; public Transform tachometerTransform = null; public Transform oilPressureTransform = null; private Coroutine blinkersCoroutine = null; public InteractTrigger windscreenWipersTrigger = null; public InteractTrigger startIgnitionTrigger = null; public InteractTrigger stopIgnitionTrigger = null; public GameObject reverseLightsContainer = null; public MeshRenderer reverseLightsMesh = null; public Animator manualShiftAnimator = null; public bool treatingPlayerInfection; public string[] upShiftString = null; public string[] downShiftString = null; public float mirrorAngleFloat; public float lightSwitchFloat; public float heatSpeedFloat; public float heatDirectionFloat; public float heatPositionFloat; public bool smoothRotation; public bool heaterOn; public float heaterTemp; public float heaterSpeed; public float steeringWheelAnimValue; public float steeringSpeed; public bool windshieldShattered; public bool inIgnitionAnimation; public bool isHeaterCold; public bool isHeaterWarm; private Vector3 ignitionKeyScale = new Vector3(0.06f, 0.06f, 0.06f); private Vector3 LHD_Pos_Local = new Vector3(0.0489f, 0.1371f, -0.1566f); private Vector3 LHD_Pos_Server = new Vector3(0.0366f, 0.1023f, -0.1088f); private Vector3 LHD_Rot_Local = new Vector3(-3.446f, 3.193f, 172.642f); private Vector3 LHD_Rot_Server = new Vector3(-191.643f, 174.051f, -7.768005f); public float ignitionRotSpeed = 45f; public int currentSweepStage; public bool hasSweepedDashboard; public bool hazardsBlinking; public bool hazardsOn; public bool reverseLightsOn; private float speedometerFloat; private float tachometerFloat; public bool disableAnimations; public bool lowBeamsOn; public bool highBeamsOn; public bool overrideCabinLightSwitch; public bool cabinLightSwitchEnabled = true; private float oilPressureFloat; private float turboPressureFloat; public bool overdriveSwitchEnabled; public bool correctedPosition; public bool twistingKey; public bool electricsOn; public bool isCabLightOn; public bool liftGateOpen; public bool sideDoorOpen; [Header("Audio")] public AudioSource[] allVehicleAudios = null; public AudioClip[] streamerRadioClips = null; public AudioSource roofAudio = null; public AudioSource cabinLightSwitchAudio = null; public AudioClip cabinLightSwitchToggle = null; public AudioSource handbrakeAudio = null; public AudioClip handbrakeOn = null; public AudioClip handbrakeOff = null; public AudioClip[] clutchInClips = null; public AudioClip[] clutchOutClips = null; public AudioSource engineAudio4 = null; public AudioSource engineAudio3 = null; public AudioClip stallEngine = null; public AudioClip blinkOn = null; public AudioClip blinkOff = null; public AudioClip[] gearCrunchSounds = null; public AudioClip[] shiftSounds = null; public AudioSource roofRainAudio = null; public AudioSource carKeySounds = null; public AudioSource wiperAudio = null; public AudioSource backUpBeeperAudio = null; private Coroutine truckAlarmCoroutine = null; public AudioSource alarmAudio = null; public AudioSource heaterAudio = null; public bool engineKnockingAudioActive; public float engineKnockSpeed; private float timeSinceTogglingRadio; public bool alarmDebounce; private float timeAtLastAlarmPing; private float timeAtLastEVAPing; [Header("Radio")] public RadioBehaviour liveRadioController = null; private float lastSongTime; public float minFrequency = 75.55f; public float maxFrequency = 255.5f; public bool isFmRadio = false; private float timeLastSyncedRadio; private float radioPingTimestamp; [Header("Materials")] public Material blinkerOnMat = null; public Material clusterDialsOffMat = null; public Material clusterDialsOnMat = null; public Material heaterOffMat = null; public Material heaterOnMat = null; public Material greyLightOffMat = null; public Material redLightOffMat = null; public Material clusterOffMaterial = null; public Material clusterOnMaterial = null; public Material radioOffMaterial = null; public Material radioOnMaterial = null; public Material windowOffMaterial = null; public Material windowOnMaterial = null; public Material windshieldMat = null; public override void OnNetworkSpawn() { ((NetworkBehaviour)this).OnNetworkSpawn(); if (!StartOfRound.Instance.inShipPhase && ((NetworkBehaviour)this).IsServer) { specialChance = 0.09f; Random random = new Random(StartOfRound.Instance.randomMapSeed); isSpecial = random.NextDouble() < (double)specialChance; SetSpecialVariantRpc(isSpecial); } } [Rpc(/*Could not decode attribute arguments.*/)] public void SetSpecialVariantRpc(bool special) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(4283610501u, val2, val, (SendTo)6, (RpcDelivery)0); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref special, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val3, 4283610501u, val2, val, (SendTo)6, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; isSpecial = special; SetVariant(isSpecial); } } } public void SetVariant(bool isJenson) { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Unknown result type (might be due to invalid IL or missing references) //IL_0197: Unknown result type (might be due to invalid IL or missing references) //IL_019c: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: Unknown result type (might be due to invalid IL or missing references) //IL_01c8: Unknown result type (might be due to invalid IL or missing references) if (isJenson) { truckMat.mainTexture = (Texture)(object)rareTruckTex; radioLightCol.color = Color32.op_Implicit(new Color32((byte)250, (byte)254, (byte)170, byte.MaxValue)); leftWindowLightCol.color = Color32.op_Implicit(new Color32((byte)250, (byte)254, (byte)170, byte.MaxValue)); rightWindowLightCol.color = Color32.op_Implicit(new Color32((byte)250, (byte)254, (byte)170, byte.MaxValue)); heaterLightCol.color = Color32.op_Implicit(new Color32((byte)250, (byte)254, (byte)170, byte.MaxValue)); clusterLightCol.color = Color32.op_Implicit(new Color32((byte)250, (byte)254, (byte)222, byte.MaxValue)); voiceModule.clusterLight.color = Color32.op_Implicit(new Color32((byte)250, (byte)254, (byte)222, byte.MaxValue)); clusterDialsOnMat = rareTruckDialsOn; clusterOnMaterial = rareTruckClusterOn; radioOnMaterial = rareTruckRadioOn; heaterOnMat = rareHeaterOn; windowOnMaterial = rareWindowOn; ((Graphic)radioTime).color = Color32.op_Implicit(new Color32(byte.MaxValue, (byte)204, (byte)51, byte.MaxValue)); ((Graphic)radioFrequency).color = Color32.op_Implicit(new Color32(byte.MaxValue, (byte)204, (byte)51, byte.MaxValue)); ((Graphic)voiceModule.clusterScreen).color = Color32.op_Implicit(new Color32(byte.MaxValue, (byte)204, (byte)51, byte.MaxValue)); voiceModule.clusterTexts[0] = "sys status: [ok]"; voiceModule.clusterTexts[15] = "high temp!"; voiceModule.clusterTexts[13] = "error: wd606"; } else { truckMat.mainTexture = (Texture)(object)defaultTruckTex; } } public void OnEnable() { References.truckController = this; } public void Awake() { //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) base.ragdollPhysicsBody.interpolation = (RigidbodyInterpolation)1; base.windwiperPhysicsBody1.interpolation = (RigidbodyInterpolation)1; base.windwiperPhysicsBody2.interpolation = (RigidbodyInterpolation)1; ((VehicleController)this).Awake(); base.physicsRegion.priority = 1; base.syncedPosition = ((Component)this).transform.position; base.syncedRotation = ((Component)this).transform.rotation; Transform transform = ((Component)base.driverSeatTrigger.playerPositionNode).transform; transform.localPosition += seatNodePositionOffset; Transform transform2 = ((Component)middlePassengerSeatTrigger.playerPositionNode).transform; transform2.localPosition += seatNodePositionOffset; Transform transform3 = ((Component)base.passengerSeatTrigger.playerPositionNode).transform; transform3.localPosition += seatNodePositionOffset; usingSwitchIgnition = false; ignitionCollider.enabled = false; base.backDoorOpen = true; SetTruckStats(); } private void SetTruckStats() { //IL_029d: Unknown result type (might be due to invalid IL or missing references) //IL_02b7: Unknown result type (might be due to invalid IL or missing references) //IL_02e1: Unknown result type (might be due to invalid IL or missing references) //IL_02e2: Unknown result type (might be due to invalid IL or missing references) //IL_0371: Unknown result type (might be due to invalid IL or missing references) //IL_037e: Unknown result type (might be due to invalid IL or missing references) //IL_038b: Unknown result type (might be due to invalid IL or missing references) //IL_0398: Unknown result type (might be due to invalid IL or missing references) base.idleSpeed = 80f; base.pushForceMultiplier = 162f; base.carTooltips = new string[4] { "Gas pedal: [W]", "Brake pedal: [S]", "Clutch pedal: [L-Shift]", "Remove key: [LMB + E]" }; base.turboBoostForce = 10000f; base.turboBoostUpwardForce = 23000f; steeringSpeed = 6f; baseSteeringWheelTurnSpeed = 4.2f; base.steeringWheelTurnSpeed = baseSteeringWheelTurnSpeed; handbrakeEngaged = true; inNeutral = true; throttleSpeed = 1f; maxThrottleSpeed = 2f; throttleReleaseSpeed = 3f; minInclineCompensation = 1.78f; maxInclineCompensation = 4.1f; maxInclineCompensationAngle = 32f; baseTransmissionHP = 20; transmissionHP = baseTransmissionHP; syncedTransmissionHP = baseTransmissionHP; clutchSpeed = 4f; clutchReturnSpeed = 1.5f; minClutchReturnSpeed = 0.5f; base.jumpForce = 4150f; base.brakeSpeed = 10000f; maxBrakingPower = 12000f; base.speed = 60f; base.stability = 0.4f; backUpBeeperAudio.volume = 0.95f; heaterTemp = 1f; isHeaterWarm = true; base.torqueForce = 1.75f; base.carMaxSpeed = 60f; base.pushVerticalOffsetAmount = 1.25f; base.baseCarHP = 46; if (!StartOfRound.Instance.inShipPhase) { base.carHP = base.baseCarHP; syncedCarHP = base.baseCarHP; } base.MinEngineRPM = 800f; base.MaxEngineRPM = 5000f; base.engineIntensityPercentage = base.MaxEngineRPM; base.carAcceleration = 350f; base.EngineTorque = 100f; engineReversePower = 6100f; SetWheelFriction(); base.mainRigidbody.maxLinearVelocity = base.carMaxSpeed; base.mainRigidbody.maxAngularVelocity = 4f; base.chanceToStartIgnition = Random.Range(12, 45); base.FrontLeftWheel.mass = 150f; base.FrontRightWheel.mass = 150f; base.BackLeftWheel.mass = 150f; base.BackRightWheel.mass = 150f; base.mainRigidbody.automaticCenterOfMass = false; base.mainRigidbody.centerOfMass = new Vector3(0f, -0.26f, 0.25f); base.mainRigidbody.automaticInertiaTensor = false; JointSpring val = default(JointSpring); val.spring = 18000f; val.damper = 3800f; val.targetPosition = 0.7f; JointSpring suspensionSpring = val; base.FrontLeftWheel.sprungMass = 228.2732f; base.FrontRightWheel.sprungMass = 228.2732f; base.BackLeftWheel.sprungMass = 271.7272f; base.BackRightWheel.sprungMass = 271.7272f; base.FrontRightWheel.forceAppPointDistance = 0.47f; base.FrontLeftWheel.forceAppPointDistance = 0.47f; base.BackRightWheel.forceAppPointDistance = 0.4f; base.BackLeftWheel.forceAppPointDistance = 0.4f; base.FrontRightWheel.suspensionSpring = suspensionSpring; base.FrontLeftWheel.suspensionSpring = suspensionSpring; base.BackRightWheel.suspensionSpring = suspensionSpring; base.BackLeftWheel.suspensionSpring = suspensionSpring; base.FrontRightWheel.wheelDampingRate = 3.1f; base.FrontLeftWheel.wheelDampingRate = 3.1f; base.BackRightWheel.wheelDampingRate = 3.1f; base.BackLeftWheel.wheelDampingRate = 3.1f; base.FrontRightWheel.suspensionDistance = 0.4f; base.FrontLeftWheel.suspensionDistance = 0.4f; base.BackRightWheel.suspensionDistance = 0.4f; base.BackLeftWheel.suspensionDistance = 0.4f; } private void SetWheelFriction() { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) WheelFrictionCurve val = default(WheelFrictionCurve); ((WheelFrictionCurve)(ref val)).extremumSlip = 1f; ((WheelFrictionCurve)(ref val)).extremumValue = 0.6f; ((WheelFrictionCurve)(ref val)).asymptoteSlip = 0.8f; ((WheelFrictionCurve)(ref val)).asymptoteValue = 0.5f; ((WheelFrictionCurve)(ref val)).stiffness = baseForwardStiffness; WheelFrictionCurve forwardFriction = val; base.FrontRightWheel.forwardFriction = forwardFriction; base.FrontLeftWheel.forwardFriction = forwardFriction; base.BackRightWheel.forwardFriction = forwardFriction; base.BackLeftWheel.forwardFriction = forwardFriction; val = default(WheelFrictionCurve); ((WheelFrictionCurve)(ref val)).extremumSlip = 0.7f; ((WheelFrictionCurve)(ref val)).extremumValue = 1f; ((WheelFrictionCurve)(ref val)).asymptoteSlip = 0.8f; ((WheelFrictionCurve)(ref val)).asymptoteValue = 1f; ((WheelFrictionCurve)(ref val)).stiffness = baseSidewaysStiffness; WheelFrictionCurve sidewaysFriction = val; base.FrontRightWheel.sidewaysFriction = sidewaysFriction; base.FrontLeftWheel.sidewaysFriction = sidewaysFriction; base.BackRightWheel.sidewaysFriction = sidewaysFriction; base.BackLeftWheel.sidewaysFriction = sidewaysFriction; } public void Start() { //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) ((MonoBehaviour)this).StartCoroutine(SetCarRainCollisions()); base.FrontLeftWheel.brakeTorque = maxBrakingPower; base.FrontRightWheel.brakeTorque = maxBrakingPower; base.BackLeftWheel.brakeTorque = maxBrakingPower; base.BackRightWheel.brakeTorque = maxBrakingPower; base.currentRadioClip = 0; base.decals = (DecalProjector[])(object)new DecalProjector[24]; if (StartOfRound.Instance.inShipPhase) { base.loadedVehicleFromSave = true; base.mainRigidbody.isKinematic = true; ((Component)this).transform.position = StartOfRound.Instance.magnetPoint.position + StartOfRound.Instance.magnetPoint.forward * 7f; base.magnetedToShip = true; base.inDropshipAnimation = false; hasDeliveredVehicle = true; base.hasBeenSpawned = true; StartMagneting(); } } public IEnumerator SetCarRainCollisions() { yield return (object)new WaitForSeconds(4f); ParticleSystem[] particleTriggers = (ParticleSystem[])(object)new ParticleSystem[9] { GlobalReferences.rainParticles, GlobalReferences.rainHitParticles, GlobalReferences.stormyRainParticles, GlobalReferences.stormyRainHitParticles, GlobalReferences.wesleyHurricaneRainParticles, GlobalReferences.wesleyHurricaneRainHitParticles, GlobalReferences.wesleyHurricaneSandParticles, GlobalReferences.wesleyForsakenRainParticles, GlobalReferences.wesleyForsakenRainHitParticles }; for (int i = 0; i < particleTriggers.Length; i++) { if ((Object)(object)particleTriggers[i] == (Object)null) { Plugin.Logger.LogDebug((object)"weather particle or trigger is null!"); continue; } TriggerModule trigger = particleTriggers[i].trigger; for (int j = 0; j < weatherEffectBlockers.Length; j++) { int index = ((TriggerModule)(ref trigger)).colliderCount + j; ((TriggerModule)(ref trigger)).SetCollider(index, (Component)(object)weatherEffectBlockers[j]); } trigger = default(TriggerModule); } } public void SendClientSyncData() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) if (base.magnetedToShip) { Vector3 eulerAngles = ((Quaternion)(ref base.magnetTargetRotation)).eulerAngles; MagnetCarRpc(base.magnetTargetPosition, eulerAngles, base.magnetStartPosition, base.magnetStartRotation, RoundManager.Instance.tempTransform.eulerAngles, base.averageVelocityAtMagnetStart); } if (base.turboBoosts > 0) { AddTurboBoostRpc(base.turboBoosts); } SyncClientDataRpc(base.carHP, base.steeringWheelAnimFloat, base.ignitionStarted, isSpecial); } [Rpc(/*Could not decode attribute arguments.*/)] public void SyncClientDataRpc(int carHealth, float wheelRot, bool ignOn, bool isJenson) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(718438838u, val2, val, (SendTo)3, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val3, carHealth); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref wheelRot, default(ForPrimitives)); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref ignOn, default(ForPrimitives)); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref isJenson, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val3, 718438838u, val2, val, (SendTo)3, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (!((NetworkBehaviour)this).IsHost) { isSpecial = isJenson; SetVariant(isSpecial); base.carHP = carHealth; syncedCarHP = carHealth; syncedWheelRotation = wheelRot; base.steeringWheelAnimFloat = wheelRot; disableAnimations = !ignOn; inIgnitionAnimation = !ignOn; electricsOn = ignOn; electricsOn = ignOn; base.keyIsInIgnition = ignOn; SetKeyIgnitionValues(trying: false, keyInHand: false, ignOn); SetIgnition(ignOn, ignOn); SetFrontCabinLightOn(ignOn); TrySetCarIgnitionTriggers(); if (ignOn) { dashboardSymbolPreStartup = ((MonoBehaviour)this).StartCoroutine(PreIgnitionSymbolCheck()); } SetSymbolActive(vehicleDisplay, vehicleDisplayLight, ignOn); driversSideWindow.interactable = ignOn; passengersSideWindow.interactable = ignOn; ignitionCollider.enabled = ignOn; ignitionAnimator.SetInteger("SAIgnition_Anim", ignOn ? 1 : 0); } } public void SetBackDoorOpen(bool open) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) RoundManager.Instance.PlayAudibleNoise(base.backDoorContainer.transform.position, 21f, 0.9f, 0, false, 2692); liftGateOpen = open; } public void SetSideDoorOpen(bool open) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) RoundManager.Instance.PlayAudibleNoise(sideDoorContainer.transform.position, 21f, 0.9f, 0, false, 2692); sideDoorOpen = open; } public void SetCabinLightSwitchLocalClient() { if (!overrideCabinLightSwitch && !cabinLightSwitchEnabled) { overrideCabinLightSwitch = true; cabinLightSwitchEnabled = true; roofAudio.PlayOneShot(cabinLightSwitchToggle); base.frontCabinLightContainer.SetActive(true); ((Renderer)base.frontCabinLightMesh).material = base.headlightsOnMat; SetCabinLightSwitchRpc(switchState: true, cabLightOn: true, setOverride: true); } else if (overrideCabinLightSwitch) { overrideCabinLightSwitch = false; cabinLightSwitchEnabled = true; roofAudio.PlayOneShot(cabinLightSwitchToggle); bool flag = isCabLightOn && base.keyIsInIgnition && electricsOn && cabinLightSwitchEnabled; base.frontCabinLightContainer.SetActive(flag); ((Renderer)base.frontCabinLightMesh).material = (Material)(flag ? ((object)base.headlightsOnMat) : ((object)greyLightOffMat)); SetCabinLightSwitchRpc(switchState: true, flag, setOverride: false); } else { cabinLightSwitchEnabled = false; roofAudio.PlayOneShot(cabinLightSwitchToggle); base.frontCabinLightContainer.SetActive(false); ((Renderer)base.frontCabinLightMesh).material = greyLightOffMat; SetCabinLightSwitchRpc(switchState: false, cabLightOn: false, setOverride: false); } } [Rpc(/*Could not decode attribute arguments.*/)] private void SetCabinLightSwitchRpc(bool switchState, bool cabLightOn, bool setOverride) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(2915638757u, val2, val, (SendTo)5, (RpcDelivery)0); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref switchState, default(ForPrimitives)); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref cabLightOn, default(ForPrimitives)); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref setOverride, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val3, 2915638757u, val2, val, (SendTo)5, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; overrideCabinLightSwitch = setOverride; cabinLightSwitchEnabled = switchState; roofAudio.PlayOneShot(cabinLightSwitchToggle); base.frontCabinLightContainer.SetActive(cabLightOn); ((Renderer)base.frontCabinLightMesh).material = (Material)(cabLightOn ? ((object)base.headlightsOnMat) : ((object)greyLightOffMat)); } } } public void SetFrontCabinLightOn(bool setOn) { isCabLightOn = setOn; if (overrideCabinLightSwitch) { if (!base.frontCabinLightContainer.activeSelf) { base.frontCabinLightContainer.SetActive(true); ((Renderer)base.frontCabinLightMesh).material = base.headlightsOnMat; } } else if (cabinLightSwitchEnabled) { base.frontCabinLightContainer.SetActive(setOn); ((Renderer)base.frontCabinLightMesh).material = (Material)(setOn ? ((object)base.headlightsOnMat) : ((object)greyLightOffMat)); } else { base.frontCabinLightContainer.SetActive(false); ((Renderer)base.frontCabinLightMesh).material = greyLightOffMat; } } [Rpc(/*Could not decode attribute arguments.*/)] public void SetFrontCabinLightRpc(bool setOn) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(2820477147u, val2, val, (SendTo)5, (RpcDelivery)0); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref setOn, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val3, 2820477147u, val2, val, (SendTo)5, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; SetFrontCabinLightOn(setOn); } } } public void ToggleHandbrake() { if (!((Object)(object)base.currentDriver != (Object)null) || base.localPlayerInControl) { handbrakeEngaged = !handbrakeEngaged; handbrakeAnimator.SetBool("engaged", handbrakeEngaged); if (handbrakeEngaged) { handbrakeAudio.PlayOneShot(handbrakeOn); } else { handbrakeAudio.PlayOneShot(handbrakeOff); } SetHandbrakeRpc(handbrakeEngaged); } } [Rpc(/*Could not decode attribute arguments.*/)] public void SetHandbrakeRpc(bool setHandbrake) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(1779906441u, val2, val, (SendTo)5, (RpcDelivery)0); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref setHandbrake, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val3, 1779906441u, val2, val, (SendTo)5, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (handbrakeEngaged != setHandbrake) { handbrakeEngaged = setHandbrake; handbrakeAnimator.SetBool("engaged", handbrakeEngaged); if (handbrakeEngaged) { handbrakeAudio.PlayOneShot(handbrakeOn); } else { handbrakeAudio.PlayOneShot(handbrakeOff); } } } public void TrySetCarIgnitionTriggers() { if (base.localPlayerInControl || !((Object)(object)base.currentDriver != (Object)null)) { if (base.ignitionStarted) { startIgnitionTrigger.hoverTip = "Untwist key : [LMB]"; startIgnitionTrigger.holdTip = "[ Untwisting key ]"; startIgnitionTrigger.timeToHold = 0.75f; startIgnitionTrigger.timeToHoldSpeedMultiplier = 1f; } else if (base.keyIsInIgnition) { bool flag = usingSwitchIgnition || (Object)(object)base.currentDriver == (Object)null; startIgnitionTrigger.hoverTip = (flag ? "Remove key : [LMB]" : "Try ignition : [LMB] (Hold)"); startIgnitionTrigger.holdTip = (flag ? "[ Removing Key ]" : "[ Trying ignition ]"); startIgnitionTrigger.timeToHold = (flag ? 0.75f : 1f); startIgnitionTrigger.timeToHoldSpeedMultiplier = (flag ? 1f : 0f); } else { startIgnitionTrigger.hoverTip = "Try ignition : [LMB] (Hold)"; startIgnitionTrigger.holdTip = "[ Trying ignition ]"; startIgnitionTrigger.timeToHold = 1f; startIgnitionTrigger.timeToHoldSpeedMultiplier = 0f; } } } public void StartTryCarIgnition() { if (!usingSwitchIgnition && base.localPlayerInControl && !base.ignitionStarted) { if (base.keyIgnitionCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(base.keyIgnitionCoroutine); base.keyIgnitionCoroutine = null; } disableAnimations = true; inIgnitionAnimation = true; TryIgnitionRpc(base.keyIsInIgnition, isCabLightOn, engineStalled); TrySetCarIgnitionTriggers(); base.keyIgnitionCoroutine = ((MonoBehaviour)this).StartCoroutine(TryIgnition(isLocalDriver: true)); } } private IEnumerator TryIgnition(bool isLocalDriver) { if ((Object)(object)base.currentDriver == (Object)null) { base.keyIgnitionCoroutine = null; yield break; } if (base.keyIsInIgnition) { if (engineStalled) { PlayerControllerB currentDriver = base.currentDriver; if (currentDriver != null) { currentDriver.playerBodyAnimator.SetInteger("SA_CarAnim", 9); } } else { PlayerControllerB currentDriver2 = base.currentDriver; if (currentDriver2 != null && currentDriver2.playerBodyAnimator.GetInteger("SA_CarAnim") == 3) { PlayerControllerB currentDriver3 = base.currentDriver; if (currentDriver3 != null) { currentDriver3.playerBodyAnimator.SetInteger("SA_CarAnim", 2); } } else { PlayerControllerB currentDriver4 = base.currentDriver; if (currentDriver4 != null) { currentDriver4.playerBodyAnimator.SetInteger("SA_CarAnim", 12); } } } int animIndex = base.currentDriver.playerBodyAnimator.GetInteger("SA_CarAnim"); if (animIndex == 9) { animIndex = 12; } ignitionAnimator.SetInteger("SAIgnition_Anim", animIndex); TrySetCarIgnitionTriggers(); engineStalled = false; SetKeyIgnitionValues(trying: true, keyInHand: true, keyInSlot: true); yield return (object)new WaitForSeconds(0.02f); carKeySounds.PlayOneShot(base.twistKey); SetKeyIgnitionValues(trying: true, keyInHand: true, keyInSlot: true); yield return (object)new WaitForSeconds(0.1467f); } else { PlayerControllerB currentDriver5 = base.currentDriver; if (currentDriver5 != null) { currentDriver5.playerBodyAnimator.SetInteger("SA_CarAnim", 2); } ignitionAnimator.SetInteger("SAIgnition_Anim", 2); TrySetCarIgnitionTriggers(); SetKeyIgnitionValues(trying: false, keyInHand: true, keyInSlot: false); yield return (object)new WaitForSeconds(0.6f); carKeySounds.PlayOneShot(base.insertKey); SetKeyIgnitionValues(trying: false, keyInHand: true, keyInSlot: true); TrySetCarIgnitionTriggers(); yield return (object)new WaitForSeconds(0.2f); carKeySounds.PlayOneShot(base.twistKey); SetKeyIgnitionValues(trying: true, keyInHand: true, keyInSlot: true); yield return (object)new WaitForSeconds(0.185f); } if (!isLocalDriver) { yield break; } bool clutchInterlock = clutchPedalPressed && clutchEngagement <= 0.31f; TryStartIgnitionRpc(clutchInterlock); SetKeyIgnitionValues(trying: true, keyInHand: true, keyInSlot: true); electricsOn = true; SetFrontCabinLightOn(electricsOn); TrySetCarIgnitionTriggers(); driversSideWindow.interactable = electricsOn; passengersSideWindow.interactable = electricsOn; if (dashboardSymbolPreStartup == null && !hasSweepedDashboard) { dashboardSymbolPreStartup = ((MonoBehaviour)this).StartCoroutine(PreIgnitionSymbolCheck()); } SetSymbolActive(vehicleDisplay, vehicleDisplayLight, active: true); if (!clutchInterlock) { yield break; } base.engineAudio1.Stop(); base.engineAudio1.clip = base.revEngineStart; base.engineAudio1.volume = 0.7f; base.engineAudio1.PlayOneShot(base.engineRev); base.engineAudio1.pitch = 1f; base.carEngine1AudioActive = true; yield return (object)new WaitForSeconds(Random.Range(0.8f, 2f)); if ((float)Random.Range(0, 100) < base.chanceToStartIgnition && clutchInterlock) { disableAnimations = false; inIgnitionAnimation = false; electricsOn = true; PlayerControllerB currentDriver6 = base.currentDriver; if (currentDriver6 != null) { currentDriver6.playerBodyAnimator.SetInteger("SA_CarAnim", 1); } SetKeyIgnitionValues(trying: false, keyInHand: false, keyInSlot: true); SetIgnition(started: true, cabLightOn: true); SetFrontCabinLightOn(base.keyIsInIgnition); CancelIgnitionAnimation(ignitionOn: true, setIgnitionAnim: true); startIgnitionTrigger.StopInteraction(); TrySetCarIgnitionTriggers(); startIgnitionTrigger.StopInteraction(); startIgnitionTrigger.currentCooldownValue = 1f; StartIgnitionRpc(setTriggers: false); } else { base.chanceToStartIgnition += 22f; base.chanceToStartIgnition = Mathf.Clamp(base.chanceToStartIgnition, 0f, 99f); } } [Rpc(/*Could not decode attribute arguments.*/)] public void TryIgnitionRpc(bool setKeyInSlot, bool preIgnition, bool hasStalled) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(3540053645u, val2, val, (SendTo)5, (RpcDelivery)0); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref setKeyInSlot, default(ForPrimitives)); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref preIgnition, default(ForPrimitives)); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref hasStalled, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val3, 3540053645u, val2, val, (SendTo)5, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (!base.ignitionStarted) { if (base.keyIgnitionCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(base.keyIgnitionCoroutine); base.keyIgnitionCoroutine = null; } disableAnimations = true; inIgnitionAnimation = true; SetKeyIgnitionValues(trying: false, keyInHand: false, setKeyInSlot); if (!isCabLightOn && preIgnition) { SetFrontCabinLightOn(preIgnition); } engineStalled = hasStalled; base.keyIgnitionCoroutine = ((MonoBehaviour)this).StartCoroutine(TryIgnition(isLocalDriver: false)); } } [Rpc(/*Could not decode attribute arguments.*/)] public void TryStartIgnitionRpc(bool shiftInterlock) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(2290489169u, val2, val, (SendTo)5, (RpcDelivery)0); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref shiftInterlock, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val3, 2290489169u, val2, val, (SendTo)5, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; SetKeyIgnitionValues(trying: true, keyInHand: true, keyInSlot: true); electricsOn = true; SetFrontCabinLightOn(electricsOn); driversSideWindow.interactable = electricsOn; passengersSideWindow.interactable = electricsOn; if (dashboardSymbolPreStartup == null && !hasSweepedDashboard) { dashboardSymbolPreStartup = ((MonoBehaviour)this).StartCoroutine(PreIgnitionSymbolCheck()); } SetSymbolActive(vehicleDisplay, vehicleDisplayLight, active: true); if (shiftInterlock) { base.engineAudio1.Stop(); base.engineAudio1.clip = base.revEngineStart; base.engineAudio1.volume = 0.7f; base.engineAudio1.PlayOneShot(base.engineRev); base.engineAudio1.pitch = 1f; base.carEngine1AudioActive = true; } } } public void CancelTryCarIgnition() { if (!usingSwitchIgnition && base.localPlayerInControl && !base.ignitionStarted && base.keyIgnitionCoroutine != null) { CancelIgnitionAnimation(ignitionOn: false, setIgnitionAnim: false); disableAnimations = true; inIgnitionAnimation = false; TrySetCarIgnitionTriggers(); if (GameNetworkManager.Instance.localPlayerController.playerBodyAnimator.GetInteger("SA_CarAnim") == 2 && base.keyIsInIgnition) { GameNetworkManager.Instance.localPlayerController.playerBodyAnimator.SetInteger("SA_CarAnim", 3); } else if (GameNetworkManager.Instance.localPlayerController.playerBodyAnimator.GetInteger("SA_CarAnim") == 12 || GameNetworkManager.Instance.localPlayerController.playerBodyAnimator.GetInteger("SA_CarAnim") == 9) { GameNetworkManager.Instance.localPlayerController.playerBodyAnimator.SetInteger("SA_CarAnim", 3); } else { GameNetworkManager.Instance.localPlayerController.playerBodyAnimator.SetInteger("SA_CarAnim", 0); } int integer = base.currentDriver.playerBodyAnimator.GetInteger("SA_CarAnim"); ignitionAnimator.SetInteger("SAIgnition_Anim", integer); CancelTryIgnitionRpc(base.keyIsInIgnition, isCabLightOn, electricsOn, integer); } } [Rpc(/*Could not decode attribute arguments.*/)] public void CancelTryIgnitionRpc(bool setKeyInSlot, bool cabinLightOn, bool preIgnition, int currentAnimIndex) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(1131385462u, val2, val, (SendTo)5, (RpcDelivery)0); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref setKeyInSlot, default(ForPrimitives)); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref cabinLightOn, default(ForPrimitives)); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref preIgnition, default(ForPrimitives)); BytePacker.WriteValueBitPacked(val3, currentAnimIndex); ((NetworkBehaviour)this).__endSendRpc(ref val3, 1131385462u, val2, val, (SendTo)5, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; CancelIgnitionAnimation(ignitionOn: false, setIgnitionAnim: false); disableAnimations = true; inIgnitionAnimation = false; PlayerControllerB currentDriver = base.currentDriver; if (currentDriver != null) { currentDriver.playerBodyAnimator.SetInteger("SA_CarAnim", currentAnimIndex); } ignitionAnimator.SetInteger("SAIgnition_Anim", currentAnimIndex); if (setKeyInSlot && !base.keyIsInIgnition) { carKeySounds.PlayOneShot(base.insertKey); } SetKeyIgnitionValues(trying: false, keyInHand: false, setKeyInSlot); base.removeKeyIgnitionTrigger.SetActive(base.keyIsInIgnition); if (!base.keyIsInIgnition) { return; } if (cabinLightOn && !isCabLightOn) { SetFrontCabinLightOn(cabinLightOn); } if (preIgnition && !electricsOn) { electricsOn = true; driversSideWindow.interactable = electricsOn; passengersSideWindow.interactable = electricsOn; if (dashboardSymbolPreStartup == null && !hasSweepedDashboard) { dashboardSymbolPreStartup = ((MonoBehaviour)this).StartCoroutine(PreIgnitionSymbolCheck()); } } } [Rpc(/*Could not decode attribute arguments.*/)] public void StartIgnitionRpc(bool setTriggers) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(4118721524u, val2, val, (SendTo)5, (RpcDelivery)0); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref setTriggers, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val3, 4118721524u, val2, val, (SendTo)5, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; disableAnimations = false; inIgnitionAnimation = false; electricsOn = true; PlayerControllerB currentDriver = base.currentDriver; if (currentDriver != null) { currentDriver.playerBodyAnimator.SetInteger("SA_CarAnim", 1); } SetKeyIgnitionValues(trying: false, keyInHand: false, keyInSlot: true); SetIgnition(started: true, cabLightOn: true); SetFrontCabinLightOn(base.keyIsInIgnition); CancelIgnitionAnimation(ignitionOn: true, setIgnitionAnim: true); if (setTriggers) { TrySetCarIgnitionTriggers(); } } } public void SetIgnition(bool started, bool cabLightOn) { SetFrontCabinLightOn(cabLightOn); base.carEngine1AudioActive = started; if (started) { disableAnimations = false; inIgnitionAnimation = false; electricsOn = true; if (started != base.ignitionStarted) { base.ignitionStarted = true; base.carExhaustParticle.Play(); base.engineAudio1.Stop(); base.engineAudio1.PlayOneShot(base.engineStartSuccessful); base.engineAudio1.clip = base.engineRun; } } else { base.ignitionStarted = false; base.carExhaustParticle.Stop(true, (ParticleSystemStopBehavior)1); } } public void UntwistKeyInIgnition() { if ((!base.keyIsInIgnition || base.ignitionStarted || usingSwitchIgnition) && (!((Object)(object)base.currentDriver != (Object)null) || base.localPlayerInControl) && base.ignitionStarted && !inIgnitionAnimation) { if (base.keyIgnitionCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(base.keyIgnitionCoroutine); base.keyIgnitionCoroutine = null; } base.keyIgnitionCoroutine = ((MonoBehaviour)this).StartCoroutine(UntwistKey()); TrySetCarIgnitionTriggers(); UntwistKeyInIgnitionRpc(); } } private IEnumerator UntwistKey() { disableAnimations = true; inIgnitionAnimation = false; PlayerControllerB currentDriver = base.currentDriver; if (currentDriver != null) { currentDriver.playerBodyAnimator.SetInteger("SA_CarAnim", 7); } ignitionAnimator.SetInteger("SAIgnition_Anim", 7); yield return (object)new WaitForSeconds(0.08f); if (dashboardSymbolPreStartup != null) { ((MonoBehaviour)this).StopCoroutine(dashboardSymbolPreStartup); dashboardSymbolPreStartup = null; StopPreIgnitionChecks(); } carKeySounds.PlayOneShot(base.twistKey); SetKeyIgnitionValues(trying: false, keyInHand: false, keyInSlot: true); SetIgnition(started: false, cabLightOn: true); engineAudio3.volume = 0.775f; engineAudio3.PlayOneShot(stallEngine); TrySetCarIgnitionTriggers(); yield return (object)new WaitForSeconds(0.08f); base.keyIgnitionCoroutine = null; } [Rpc(/*Could not decode attribute arguments.*/)] public void UntwistKeyInIgnitionRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(1677604189u, val2, val, (SendTo)5, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendRpc(ref val3, 1677604189u, val2, val, (SendTo)5, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (base.keyIgnitionCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(base.keyIgnitionCoroutine); base.keyIgnitionCoroutine = null; } base.keyIgnitionCoroutine = ((MonoBehaviour)this).StartCoroutine(UntwistKey()); } } public void RemoveKeyFromIgnition() { if ((!base.keyIsInIgnition || usingSwitchIgnition || !base.localPlayerInControl) && (!((Object)(object)base.currentDriver != (Object)null) || base.localPlayerInControl) && !base.ignitionStarted && base.keyIsInIgnition && !inIgnitionAnimation) { if (base.keyIgnitionCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(base.keyIgnitionCoroutine); base.keyIgnitionCoroutine = null; } base.keyIgnitionCoroutine = ((MonoBehaviour)this).StartCoroutine(RemoveKey()); TrySetCarIgnitionTriggers(); usingSwitchIgnition = false; base.chanceToStartIgnition = 20f; RemoveKeyFromIgnitionRpc(); } } private IEnumerator RemoveKey() { disableAnimations = true; inIgnitionAnimation = false; PlayerControllerB currentDriver = base.currentDriver; if (currentDriver != null && currentDriver.playerBodyAnimator.GetInteger("SA_CarAnim") == 0) { PlayerControllerB currentDriver2 = base.currentDriver; if (currentDriver2 != null) { currentDriver2.playerBodyAnimator.SetTrigger("SA_RemoveInIgnition"); } } else { PlayerControllerB currentDriver3 = base.currentDriver; if (currentDriver3 != null) { currentDriver3.playerBodyAnimator.SetInteger("SA_CarAnim", 8); } } ignitionAnimator.SetInteger("SAIgnition_Anim", 0); engineStalled = false; yield return (object)new WaitForSeconds(base.ignitionStarted ? 0.18f : 0.26f); if (dashboardSymbolPreStartup != null) { ((MonoBehaviour)this).StopCoroutine(dashboardSymbolPreStartup); dashboardSymbolPreStartup = null; StopPreIgnitionChecks(); } base.removeKeyIgnitionTrigger.SetActive(false); carKeySounds.PlayOneShot(base.removeKey); SetKeyIgnitionValues(trying: false, keyInHand: true, keyInSlot: false); SetIgnition(started: false, cabLightOn: false); electricsOn = false; SetSymbolActive(vehicleDisplay, vehicleDisplayLight, active: false); driversSideWindow.interactable = false; passengersSideWindow.interactable = false; TrySetCarIgnitionTriggers(); yield return (object)new WaitForSeconds(0.73f); SetKeyIgnitionValues(trying: false, keyInHand: false, keyInSlot: false); base.keyIgnitionCoroutine = null; } [Rpc(/*Could not decode attribute arguments.*/)] public void RemoveKeyFromIgnitionRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(2078953510u, val2, val, (SendTo)5, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendRpc(ref val3, 2078953510u, val2, val, (SendTo)5, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (base.keyIgnitionCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(base.keyIgnitionCoroutine); base.keyIgnitionCoroutine = null; } base.keyIgnitionCoroutine = ((MonoBehaviour)this).StartCoroutine(RemoveKey()); } } public IEnumerator PreIgnitionSymbolCheck() { SetSymbolActive(dippedBeamLightSymbol, dippedBeamLight, active: true); SetSymbolActive(highBeamLightSymbol, highBeamLight, active: true); SetSymbolActive(parkingBrakeSymbol, parkingBrakeLight, active: true); SetSymbolActive(seatbeltLightSymbol, seatBeltLight, active: true); SetSymbolActive(oilLevelLightSymbol, oilLevelLight, active: true); SetSymbolActive(batteryLightSymbol, batteryLight, active: true); SetSymbolActive(coolantLevelLightSymbol, coolantLevelLight, active: true); SetSymbolActive(alertLightSymbol, alertLight, active: true); SetSymbolActive(checkEngineLightSymbol, checkEngineLight, active: true); currentSweepStage = 1; yield return (object)new WaitForSeconds(1f); SetSymbolActive(dippedBeamLightSymbol, dippedBeamLight, lowBeamsOn); SetSymbolActive(highBeamLightSymbol, highBeamLight, highBeamsOn); currentSweepStage = 2; yield return (object)new WaitForSeconds(1f); SetSymbolActive(seatbeltLightSymbol, seatBeltLight, active: false); SetSymbolActive(parkingBrakeSymbol, parkingBrakeLight, handbrakeEngaged); currentSweepStage = 3; yield return (object)new WaitForSeconds(1f); SetSymbolActive(oilLevelLightSymbol, oilLevelLight, base.carHP <= 25); SetSymbolActive(batteryLightSymbol, batteryLight, !base.ignitionStarted || base.carHP <= 22); SetSymbolActive(coolantLevelLightSymbol, coolantLevelLight, base.carHP <= 30); SetSymbolActive(alertLightSymbol, alertLight, base.carHP <= 16); SetSymbolActive(checkEngineLightSymbol, checkEngineLight, base.carHP <= 38); currentSweepStage = 4; hasSweepedDashboard = true; } private void StopPreIgnitionChecks() { hasSweepedDashboard = false; currentSweepStage = 0; SetSymbolActive(dippedBeamLightSymbol, dippedBeamLight, active: false); SetSymbolActive(highBeamLightSymbol, highBeamLight, active: false); SetSymbolActive(parkingBrakeSymbol, parkingBrakeLight, active: false); SetSymbolActive(seatbeltLightSymbol, seatBeltLight, active: false); SetSymbolActive(oilLevelLightSymbol, oilLevelLight, active: false); SetSymbolActive(batteryLightSymbol, batteryLight, active: false); SetSymbolActive(coolantLevelLightSymbol, coolantLevelLight, active: false); SetSymbolActive(alertLightSymbol, alertLight, active: false); SetSymbolActive(checkEngineLightSymbol, checkEngineLight, active: false); } public void CancelIgnitionAnimation(bool ignitionOn, bool setIgnitionAnim) { if (base.keyIgnitionCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(base.keyIgnitionCoroutine); base.keyIgnitionCoroutine = null; } base.keyIsInDriverHand = false; twistingKey = false; base.carEngine1AudioActive = ignitionOn; if (setIgnitionAnim) { ignitionAnimator.SetInteger("SAIgnition_Anim", ignitionOn ? 1 : 0); } } public void SetKeyIgnitionValues(bool trying, bool keyInHand, bool keyInSlot) { twistingKey = trying; base.keyIsInDriverHand = keyInHand; base.keyIsInIgnition = keyInSlot; } public void SetTriggerHoverTip(InteractTrigger trigger, string tip) { trigger.hoverTip = tip; } public void SetDriverInCar() { if (base.hasBeenSpawned && !base.carDestroyed && !Object.op_Implicit((Object)(object)GameNetworkManager.Instance.localPlayerController.inAnimationWithEnemy) && !GameNetworkManager.Instance.localPlayerController.inVehicleAnimation && !StartOfRound.Instance.inShipPhase) { if ((Object)(object)base.currentDriver != (Object)null) { GameNetworkManager.Instance.localPlayerController.CancelSpecialTriggerAnimations(); HUDManager.Instance.DisplayTip("Seat occupied", "You cannot enter an occupied seat! aborting!", false, false, "LC_Tip1"); } else { SetDriverInCarServerRpc((int)GameNetworkManager.Instance.localPlayerController.playerClientId); } } } [Rpc(/*Could not decode attribute arguments.*/)] public void SetDriverInCarServerRpc(int playerId) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(3762133933u, val2, val, (SendTo)2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val3, playerId); ((NetworkBehaviour)this).__endSendRpc(ref val3, 3762133933u, val2, val, (SendTo)2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; PlayerControllerB val4 = StartOfRound.Instance.allPlayerScripts[playerId]; if ((Object)(object)val4 == (Object)null || val4.isPlayerDead || !val4.isPlayerControlled || (Object)(object)base.currentDriver != (Object)null) { CancelSetPlayerInVehicleClientRpc(playerId); return; } base.currentDriver = StartOfRound.Instance.allPlayerScripts[playerId]; ((NetworkBehaviour)this).NetworkObject.ChangeOwnership(StartOfRound.Instance.allPlayerScripts[playerId].actualClientId); SetDriverInCarOwnerRpc(); } } [Rpc(/*Could not decode attribute arguments.*/)] public void SetDriverInCarOwnerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(437116846u, val2, val, (SendTo)0, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendRpc(ref val3, 437116846u, val2, val, (SendTo)0, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; PlayerUtils.disableAnimationSync = true; SetVehicleCollisionForPlayer(setEnabled: false, GameNetworkManager.Instance.localPlayerController); InteractTriggerPatches.specialInteractCoroutine = ((MonoBehaviour)this).StartCoroutine(InteractTriggerPatches.SpecialTruckInteractAnimation(base.driverSeatTrigger, GameNetworkManager.Instance.localPlayerController, this, frontLeftSeat)); ActivateControl(); SetTriggerHoverTip(base.driverSideDoorTrigger, "Exit : [LMB]"); ignitionCollider.enabled = true; startIgnitionTrigger.isBeingHeldByPlayer = false; engineStalled = false; TrySetCarIgnitionTriggers(); GameNetworkManager.Instance.localPlayerController.playerBodyAnimator.SetFloat("animationSpeed", 0.5f); if (base.keyIsInIgnition) { GameNetworkManager.Instance.localPlayerController.playerBodyAnimator.SetInteger("SA_CarAnim", 0); } if (base.ignitionStarted) { GameNetworkManager.Instance.localPlayerController.playerBodyAnimator.SetInteger("SA_CarAnim", 1); } if (base.driverSideDoor.boolValue) { base.driverSideDoor.TriggerAnimation(GameNetworkManager.Instance.localPlayerController); } SetDriverInCarClientsRpc((int)GameNetworkManager.Instance.localPlayerController.playerClientId, base.keyIsInIgnition, base.ignitionStarted); } } [Rpc(/*Could not decode attribute arguments.*/)] public void SetDriverInCarClientsRpc(int playerId, bool setKeyInSlot, bool setStarted) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(2358374295u, val2, val, (SendTo)1, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val3, playerId); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref setKeyInSlot, default(ForPrimitives)); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref setStarted, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val3, 2358374295u, val2, val, (SendTo)1, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; base.currentDriver = StartOfRound.Instance.allPlayerScripts[playerId]; SetVehicleCollisionForPlayer(setEnabled: false, base.currentDriver); ignitionCollider.enabled = false; startIgnitionTrigger.isBeingHeldByPlayer = false; engineStalled = false; frontLeftSeat.ReplacePlayerAnimator(StartOfRound.Instance.allPlayerScripts[playerId], isLocalPlayer: false, base.driverSeatTrigger); base.keyIsInIgnition = setKeyInSlot; base.ignitionStarted = setStarted; if (setKeyInSlot) { base.currentDriver.playerBodyAnimator.SetInteger("SA_CarAnim", 0); } if (setStarted) { base.currentDriver.playerBodyAnimator.SetInteger("SA_CarAnim", 1); } } } public void ExitDriverSideSeat() { //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) if (base.localPlayerInControl) { GameNetworkManager.Instance.localPlayerController.playerBodyAnimator.SetInteger("SA_CarAnim", 0); int num = CanExitCar(passengerSide: false); if (num == 0 && !base.driverSideDoor.boolValue) { base.driverSideDoor.TriggerAnimation(GameNetworkManager.Instance.localPlayerController); } if (num != -1) { GameNetworkManager.Instance.localPlayerController.TeleportPlayer(base.driverSideExitPoints[num].position, false, 0f, false, true); } else { GameNetworkManager.Instance.localPlayerController.TeleportPlayer(base.driverSideExitPoints[1].position, false, 0f, false, true); } } } public void OnDriverExit() { //IL_013c: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_0196: Unknown result type (might be due to invalid IL or missing references) //IL_019c: Unknown result type (might be due to invalid IL or missing references) if (((NetworkBehaviour)this).IsSpawned && !((Object)(object)((NetworkBehaviour)this).NetworkManager == (Object)null) && ((NetworkBehaviour)this).NetworkManager.IsListening) { PlayerUtils.disableAnimationSync = false; base.localPlayerInControl = false; DisableVehicleCollisionForAllPlayers(); SetTriggerHoverTip(base.driverSideDoorTrigger, "Use door : [LMB]"); disableAnimations = !base.ignitionStarted; inIgnitionAnimation = false; usingSwitchIgnition = false; ignitionCollider.enabled = true; startIgnitionTrigger.isBeingHeldByPlayer = false; GameNetworkManager.Instance.localPlayerController.playerBodyAnimator.SetInteger("SA_CarAnim", 0); PlayerUtils.ResetHUDToolTips(GameNetworkManager.Instance.localPlayerController); if ((Object)(object)base.currentDriver != (Object)(object)GameNetworkManager.Instance.localPlayerController) { HUDManager.Instance.DisplayTip("Err?", "This state should not occur! aborting!", false, false, "LC_Tip1"); return; } DisableControl(); CancelIgnitionAnimation(base.ignitionStarted, setIgnitionAnim: true); base.chanceToStartIgnition = 20f; SetIgnition(base.ignitionStarted, isCabLightOn); TrySetCarIgnitionTriggers(); engineStalled = false; base.syncedPosition = ((Component)this).transform.position; base.syncedRotation = ((Component)this).transform.rotation; OnDriverExitServerRpc((int)GameNetworkManager.Instance.localPlayerController.playerClientId, ((Component)this).transform.position, ((Component)this).transform.rotation); OnDriverExitRpc((int)GameNetworkManager.Instance.localPlayerController.playerClientId, base.syncedPosition, base.syncedRotation, base.ignitionStarted, base.keyIsInIgnition, isCabLightOn, electricsOn); } } [Rpc(/*Could not decode attribute arguments.*/)] public void OnDriverExitServerRpc(int playerId, Vector3 carLocation, Quaternion carRotation) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(2452258268u, val2, val, (SendTo)2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val3, playerId); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref carLocation); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref carRotation); ((NetworkBehaviour)this).__endSendRpc(ref val3, 2452258268u, val2, val, (SendTo)2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; PlayerControllerB val4 = StartOfRound.Instance.allPlayerScripts[playerId]; if (!((Object)(object)val4 == (Object)null) && val4.isPlayerControlled) { base.syncedPosition = carLocation; base.syncedRotation = carRotation; base.drivePedalPressed = false; base.brakePedalPressed = false; base.currentDriver = null; ((NetworkBehaviour)this).NetworkObject.ChangeOwnership(StartOfRound.Instance.allPlayerScripts[0].actualClientId); } } } [Rpc(/*Could not decode attribute arguments.*/)] public void OnDriverExitRpc(int playerId, Vector3 carLocation, Quaternion carRotation, bool setIgnitionState, bool setKeyInSlot, bool cabinLightOn, bool preIgnition) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_0180: Unknown result type (might be due to invalid IL or missing references) //IL_0181: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(1067900697u, val2, val, (SendTo)5, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val3, playerId); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref carLocation); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref carRotation); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref setIgnitionState, default(ForPrimitives)); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref setKeyInSlot, default(ForPrimitives)); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref cabinLightOn, default(ForPrimitives)); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref preIgnition, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val3, 1067900697u, val2, val, (SendTo)5, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; PlayerControllerB val4 = StartOfRound.Instance.allPlayerScripts[playerId]; if (!((Object)(object)val4 == (Object)null) && val4.isPlayerControlled) { base.syncedPosition = carLocation; base.syncedRotation = carRotation; base.drivePedalPressed = false; base.brakePedalPressed = false; base.currentDriver = null; electricsOn = preIgnition; base.keyIsInIgnition = setKeyInSlot; base.ignitionStarted = setIgnitionState; if (base.ignitionStarted && !base.carExhaustParticle.isEmitting) { base.carExhaustParticle.Play(); } else if (!base.ignitionStarted && base.carExhaustParticle.isEmitting) { base.carExhaustParticle.Stop(true, (ParticleSystemStopBehavior)1); } disableAnimations = !base.ignitionStarted; inIgnitionAnimation = false; usingSwitchIgnition = false; ignitionCollider.enabled = true; startIgnitionTrigger.isBeingHeldByPlayer = false; frontLeftSeat.ReturnPlayerAnimator(StartOfRound.Instance.allPlayerScripts[playerId], isLocalPlayer: false, base.driverSeatTrigger); CancelIgnitionAnimation(base.ignitionStarted, setIgnitionAnim: true); SetIgnition(base.ignitionStarted, cabinLightOn); TrySetCarIgnitionTriggers(); engineStalled = false; if (base.localPlayerInPassengerSeat || localPlayerInMiddlePassengerSeat) { SetVehicleCollisionForPlayer(setEnabled: false, GameNetworkManager.Instance.localPlayerController); } } } public void SetMiddlePassengerInCar() { if (base.hasBeenSpawned && !base.carDestroyed && !Object.op_Implicit((Object)(object)GameNetworkManager.Instance.localPlayerController.inAnimationWithEnemy) && !GameNetworkManager.Instance.localPlayerController.inVehicleAnimation && !StartOfRound.Instance.inShipPhase) { if ((Object)(object)currentMiddlePassenger != (Object)null) { GameNetworkManager.Instance.localPlayerController.CancelSpecialTriggerAnimations(); HUDManager.Instance.DisplayTip("Seat occupied", "You cannot enter an occupied seat! aborting!", false, false, "LC_Tip1"); } else { SetMiddlePassengerInCarServerRpc((int)GameNetworkManager.Instance.localPlayerController.playerClientId); } } } [Rpc(/*Could not decode attribute arguments.*/)] public void SetMiddlePassengerInCarServerRpc(int playerId) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(4234258805u, val2, val, (SendTo)2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val3, playerId); ((NetworkBehaviour)this).__endSendRpc(ref val3, 4234258805u, val2, val, (SendTo)2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; PlayerControllerB val4 = StartOfRound.Instance.allPlayerScripts[playerId]; if ((Object)(object)val4 == (Object)null || val4.isPlayerDead || !val4.isPlayerControlled || (Object)(object)currentMiddlePassenger != (Object)null) { CancelSetPlayerInVehicleClientRpc(playerId); return; } SetVehicleCollisionForPlayer(setEnabled: false, val4); if ((int)GameNetworkManager.Instance.localPlayerController.playerClientId == playerId) { SetPassengerIntoMiddleSeat(); } else { frontMiddleSeat.ReplacePlayerAnimator(StartOfRound.Instance.allPlayerScripts[playerId], isLocalPlayer: false, middlePassengerSeatTrigger); } currentMiddlePassenger = val4; SetMiddlePassengerInCarRpc(playerId); } [Rpc(/*Could not decode attribute arguments.*/)] public void SetMiddlePassengerInCarRpc(int playerId) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(1070323261u, val2, val, (SendTo)3, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val3, playerId); ((NetworkBehaviour)this).__endSendRpc(ref val3, 1070323261u, val2, val, (SendTo)3, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; PlayerControllerB player = StartOfRound.Instance.allPlayerScripts[playerId]; SetVehicleCollisionForPlayer(setEnabled: false, player); if ((int)GameNetworkManager.Instance.localPlayerController.playerClientId == playerId) { SetPassengerIntoMiddleSeat(); } else { frontMiddleSeat.ReplacePlayerAnimator(StartOfRound.Instance.allPlayerScripts[playerId], isLocalPlayer: false, middlePassengerSeatTrigger); } currentMiddlePassenger = player; currentMiddlePassenger.playerBodyAnimator.SetFloat("animationSpeed", 0.5f); } } public void SetPassengerIntoMiddleSeat() { PlayerUtils.disableAnimationSync = true; InteractTriggerPatches.specialInteractCoroutine = ((MonoBehaviour)this).StartCoroutine(InteractTriggerPatches.SpecialTruckInteractAnimation(middlePassengerSeatTrigger, GameNetworkManager.Instance.localPlayerController, this, frontMiddleSeat)); localPlayerInMiddlePassengerSeat = true; SetTriggerHoverTip(base.driverSideDoorTrigger, "Exit : [LMB]"); SetTriggerHoverTip(base.passengerSideDoorTrigger, "Exit : [LMB]"); GameNetworkManager.Instance.localPlayerController.playerBodyAnimator.SetFloat("animationSpeed", 0.5f); if (base.driverSideDoor.boolValue) { base.driverSideDoor.TriggerAnimation(GameNetworkManager.Instance.localPlayerController); } if (base.passengerSideDoor.boolValue) { base.passengerSideDoor.TriggerAnimation(GameNetworkManager.Instance.localPlayerController); } } public void ExitMiddlePassengerSideSeat(bool isPassengerSide) { //IL_014e: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) if (!localPlayerInMiddlePassengerSeat) { return; } GameNetworkManager.Instance.localPlayerController.playerBodyAnimator.SetInteger("SA_CarAnim", 0); int num = CanExitCar(isPassengerSide); if (isPassengerSide) { if (num == 0 && !base.passengerSideDoor.boolValue) { base.passengerSideDoor.TriggerAnimation(GameNetworkManager.Instance.localPlayerController); } if (num != -1) { GameNetworkManager.Instance.localPlayerController.TeleportPlayer(base.passengerSideExitPoints[num].position, false, 0f, false, true); } else { GameNetworkManager.Instance.localPlayerController.TeleportPlayer(base.passengerSideExitPoints[1].position, false, 0f, false, true); } } else { if (num == 0 && !base.driverSideDoor.boolValue) { base.driverSideDoor.TriggerAnimation(GameNetworkManager.Instance.localPlayerController); } if (num != -1) { GameNetworkManager.Instance.localPlayerController.TeleportPlayer(base.driverSideExitPoints[num].position, false, 0f, false, true); } else { GameNetworkManager.Instance.localPlayerController.TeleportPlayer(base.driverSideExitPoints[1].position, false, 0f, false, true); } } } public void OnMiddlePassengerExit() { //IL_00ff: Unknown result type (might be due to invalid IL or missing references) if (((NetworkBehaviour)this).IsSpawned && !((Object)(object)((NetworkBehaviour)this).NetworkManager == (Object)null) && ((NetworkBehaviour)this).NetworkManager.IsListening) { PlayerUtils.disableAnimationSync = false; SetVehicleCollisionForPlayer(setEnabled: true, GameNetworkManager.Instance.localPlayerController); localPlayerInMiddlePassengerSeat = false; SetTriggerHoverTip(base.driverSideDoorTrigger, "Use door : [LMB]"); SetTriggerHoverTip(base.passengerSideDoorTrigger, "Use door : [LMB]"); GameNetworkManager.Instance.localPlayerController.playerBodyAnimator.SetInteger("SA_CarAnim", 0); PlayerUtils.ResetHUDToolTips(GameNetworkManager.Instance.localPlayerController); if ((Object)(object)currentMiddlePassenger != (Object)(object)GameNetworkManager.Instance.localPlayerController) { HUDManager.Instance.DisplayTip("Err?", "This state should not occur! aborting!", false, false, "LC_Tip1"); return; } currentMiddlePassenger = null; OnMiddlePassengerExitRpc((int)GameNetworkManager.Instance.localPlayerController.playerClientId, ((Component)GameNetworkManager.Instance.localPlayerController).transform.position); } } [Rpc(/*Could not decode attribute arguments.*/)] public void OnMiddlePassengerExitRpc(int playerId, Vector3 exitPoint) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(2405236776u, val2, val, (SendTo)5, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val3, playerId); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref exitPoint); ((NetworkBehaviour)this).__endSendRpc(ref val3, 2405236776u, val2, val, (SendTo)5, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; PlayerControllerB val4 = StartOfRound.Instance.allPlayerScripts[playerId]; if (!((Object)(object)val4 == (Object)null) && val4.isPlayerControlled && !((Object)(object)val4 == (Object)(object)GameNetworkManager.Instance.localPlayerController)) { frontMiddleSeat.ReturnPlayerAnimator(StartOfRound.Instance.allPlayerScripts[playerId], isLocalPlayer: false, middlePassengerSeatTrigger); val4.TeleportPlayer(exitPoint, false, 0f, false, true); currentMiddlePassenger = null; if (!((NetworkBehaviour)this).IsOwner) { SetVehicleCollisionForPlayer(setEnabled: true, GameNetworkManager.Instance.localPlayerController); } } } public void SetPassengerInCar() { if (base.hasBeenSpawned && !base.carDestroyed && !Object.op_Implicit((Object)(object)GameNetworkManager.Instance.localPlayerController.inAnimationWithEnemy) && !GameNetworkManager.Instance.localPlayerController.inVehicleAnimation && !StartOfRound.Instance.inShipPhase) { if ((Object)(object)base.currentPassenger != (Object)null) { GameNetworkManager.Instance.localPlayerController.CancelSpecialTriggerAnimations(); HUDManager.Instance.DisplayTip("Seat occupied", "You cannot enter an occupied seat! aborting!", false, false, "LC_Tip1"); } else { SetPassengerInCarServerRpc((int)GameNetworkManager.Instance.localPlayerController.playerClientId); } } } [Rpc(/*Could not decode attribute arguments.*/)] public void SetPassengerInCarServerRpc(int playerId) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(3385475783u, val2, val, (SendTo)2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val3, playerId); ((NetworkBehaviour)this).__endSendRpc(ref val3, 3385475783u, val2, val, (SendTo)2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; PlayerControllerB val4 = StartOfRound.Instance.allPlayerScripts[playerId]; if ((Object)(object)val4 == (Object)null || val4.isPlayerDead || !val4.isPlayerControlled || (Object)(object)base.currentPassenger != (Object)null) { CancelSetPlayerInVehicleClientRpc(playerId); return; } SetVehicleCollisionForPlayer(setEnabled: false, val4); if ((int)GameNetworkManager.Instance.localPlayerController.playerClientId == playerId) { SetPassengerIntoPassengerSeat(); } else { frontRightSeat.ReplacePlayerAnimator(StartOfRound.Instance.allPlayerScripts[playerId], isLocalPlayer: false, base.passengerSeatTrigger); } base.currentPassenger = val4; SetPassengerInCarRpc(playerId); } [Rpc(/*Could not decode attribute arguments.*/)] public void SetPassengerInCarRpc(int playerId) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(1614408832u, val2, val, (SendTo)3, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val3, playerId); ((NetworkBehaviour)this).__endSendRpc(ref val3, 1614408832u, val2, val, (SendTo)3, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; PlayerControllerB val4 = StartOfRound.Instance.allPlayerScripts[playerId]; SetVehicleCollisionForPlayer(setEnabled: false, val4); if ((int)GameNetworkManager.Instance.localPlayerController.playerClientId == playerId) { SetPassengerIntoPassengerSeat(); } else { frontRightSeat.ReplacePlayerAnimator(StartOfRound.Instance.allPlayerScripts[playerId], isLocalPlayer: false, base.passengerSeatTrigger); } base.currentPassenger = val4; base.currentPassenger.playerBodyAnimator.SetFloat("animationSpeed", 0.5f); } } public void SetPassengerIntoPassengerSeat() { PlayerUtils.disableAnimationSync = true; InteractTriggerPatches.specialInteractCoroutine = ((MonoBehaviour)this).StartCoroutine(InteractTriggerPatches.SpecialTruckInteractAnimation(base.passengerSeatTrigger, GameNetworkManager.Instance.localPlayerController, this, frontRightSeat)); base.localPlayerInPassengerSeat = true; SetTriggerHoverTip(base.passengerSideDoorTrigger, "Exit : [LMB]"); GameNetworkManager.Instance.localPlayerController.playerBodyAnimator.SetFloat("animationSpeed", 0.5f); if (base.passengerSideDoor.boolValue) { base.passengerSideDoor.TriggerAnimation(GameNetworkManager.Instance.localPlayerController); } } public void ExitPassengerSideSeat() { //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) if (base.localPlayerInPassengerSeat && !localPlayerInMiddlePassengerSeat) { GameNetworkManager.Instance.localPlayerController.playerBodyAnimator.SetInteger("SA_CarAnim", 0); int num = CanExitCar(passengerSide: true); if (num == 0 && !base.passengerSideDoor.boolValue) { base.passengerSideDoor.TriggerAnimation(GameNetworkManager.Instance.localPlayerController); } if (num != -1) { GameNetworkManager.Instance.localPlayerController.TeleportPlayer(base.passengerSideExitPoints[num].position, false, 0f, false, true); } else { GameNetworkManager.Instance.localPlayerController.TeleportPlayer(base.passengerSideExitPoints[1].position, false, 0f, false, true); } } } public void OnPassengerExit() { //IL_00ed: Unknown result type (might be due to invalid IL or missing references) if (((NetworkBehaviour)this).IsSpawned && !((Object)(object)((NetworkBehaviour)this).NetworkManager == (Object)null) && ((NetworkBehaviour)this).NetworkManager.IsListening) { PlayerUtils.disableAnimationSync = false; SetVehicleCollisionForPlayer(setEnabled: true, GameNetworkManager.Instance.localPlayerController); base.localPlayerInPassengerSeat = false; SetTriggerHoverTip(base.passengerSideDoorTrigger, "Use door : [LMB]"); GameNetworkManager.Instance.localPlayerController.playerBodyAnimator.SetInteger("SA_CarAnim", 0); PlayerUtils.ResetHUDToolTips(GameNetworkManager.Instance.localPlayerController); if ((Object)(object)base.currentPassenger != (Object)(object)GameNetworkManager.Instance.localPlayerController) { HUDManager.Instance.DisplayTip("Err?", "This state should not occur! aborting!", false, false, "LC_Tip1"); return; } base.currentPassenger = null; OnPassengerExitRpc((int)GameNetworkManager.Instance.localPlayerController.playerClientId, ((Component)GameNetworkManager.Instance.localPlayerController).transform.position); } } [Rpc(/*Could not decode attribute arguments.*/)] public void OnPassengerExitRpc(int playerId, Vector3 exitPoint) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(732754567u, val2, val, (SendTo)5, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val3, playerId); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref exitPoint); ((NetworkBehaviour)this).__endSendRpc(ref val3, 732754567u, val2, val, (SendTo)5, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; PlayerControllerB val4 = StartOfRound.Instance.allPlayerScripts[playerId]; if (!((Object)(object)val4 == (Object)null) && val4.isPlayerControlled && !((Object)(object)val4 == (Object)(object)GameNetworkManager.Instance.localPlayerController)) { frontRightSeat.ReturnPlayerAnimator(StartOfRound.Instance.allPlayerScripts[playerId], isLocalPlayer: false, base.passengerSeatTrigger); val4.TeleportPlayer(exitPoint, false, 0f, false, true); base.currentPassenger = null; if (!((NetworkBehaviour)this).IsOwner) { SetVehicleCollisionForPlayer(setEnabled: true, GameNetworkManager.Instance.localPlayerController); } } } [Rpc(/*Could not decode attribute arguments.*/)] public void CancelSetPlayerInVehicleClientRpc(int playerId) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(3176739277u, val2, val, (SendTo)6, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val3, playerId); ((NetworkBehaviour)this).__endSendRpc(ref val3, 3176739277u, val2, val, (SendTo)6, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if ((int)GameNetworkManager.Instance.localPlayerController.playerClientId == playerId) { HUDManager.Instance.DisplayTip("Kicked from vehicle", "You have been forcefully kicked to prevent a softlock!", false, false, "LC_Tip1"); } } } [Rpc(/*Could not decode attribute arguments.*/)] public void OnDriverLeaveGameServerRpc(int playerId) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(203598337u, val2, val, (SendTo)2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val3, playerId); ((NetworkBehaviour)this).__endSendRpc(ref val3, 203598337u, val2, val, (SendTo)2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; PlayerControllerB val4 = StartOfRound.Instance.allPlayerScripts[playerId]; if (!((Object)(object)val4 == (Object)null)) { ((NetworkBehaviour)this).NetworkObject.ChangeOwnership(StartOfRound.Instance.allPlayerScripts[0].actualClientId); OnDriverLeave(val4, base.ignitionStarted, base.keyIsInIgnition, isCabLightOn, electricsOn); OnDriverLeaveGameRpc(playerId, base.syncedPosition, base.syncedRotation, base.ignitionStarted, base.keyIsInIgnition, isCabLightOn, electricsOn); } } } public void OnDriverLeave(PlayerControllerB playerController, bool setIgnitionState, bool setKeyInSlot, bool cabinLightOn, bool preIgnition) { //IL_00c3: Unknown result type (might be due to invalid IL or missing references) base.drivePedalPressed = false; base.brakePedalPressed = false; base.currentDriver = null; electricsOn = preIgnition; base.keyIsInIgnition = setKeyInSlot; base.ignitionStarted = setIgnitionState; if (base.ignitionStarted && !base.carExhaustParticle.isEmitting) { base.carExhaustParticle.Play(); } else if (!base.ignitionStarted && base.carExhaustParticle.isEmitting) { base.carExhaustParticle.Stop(true, (ParticleSystemStopBehavior)1); } disableAnimations = !base.ignitionStarted; inIgnitionAnimation = false; ignitionCollider.enabled = setKeyInSlot; startIgnitionTrigger.isBeingHeldByPlayer = false; frontLeftSeat.ReturnPlayerAnimator(playerController, isLocalPlayer: false, base.driverSeatTrigger); playerController.TeleportPlayer(Vector3.zero, false, 0f, false, true); CancelIgnitionAnimation(base.ignitionStarted, setIgnitionAnim: true); SetIgnition(base.ignitionStarted, electricsOn); engineStalled = false; if (base.localPlayerInPassengerSeat || localPlayerInMiddlePassengerSeat) { SetVehicleCollisionForPlayer(setEnabled: false, GameNetworkManager.Instance.localPlayerController); } } [Rpc(/*Could not decode attribute arguments.*/)] public void OnDriverLeaveGameRpc(int playerId, Vector3 carLocation, Quaternion carRotation, bool setIgnitionState, bool setKeyInSlot, bool cabinLightOn, bool preIgnition) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_0168: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Unknown result type (might be due to invalid IL or missing references) //IL_016f: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(1187821516u, val2, val, (SendTo)3, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val3, playerId); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref carLocation); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref carRotation); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref setIgnitionState, default(ForPrimitives)); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref setKeyInSlot, default(ForPrimitives)); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref cabinLightOn, default(ForPrimitives)); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref preIgnition, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val3, 1187821516u, val2, val, (SendTo)3, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; PlayerControllerB val4 = StartOfRound.Instance.allPlayerScripts[playerId]; if (!((Object)(object)val4 == (Object)null)) { base.syncedPosition = carLocation; base.syncedRotation = carRotation; OnDriverLeave(val4, setIgnitionState, setKeyInSlot, cabinLightOn, preIgnition); } } } [Rpc(/*Could not decode attribute arguments.*/)] public void OnMiddlePassengerLeaveGameRpc(int playerId) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(2421407223u, val2, val, (SendTo)6, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val3, playerId); ((NetworkBehaviour)this).__endSendRpc(ref val3, 2421407223u, val2, val, (SendTo)6, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; PlayerControllerB val4 = StartOfRound.Instance.allPlayerScripts[playerId]; if (!((Object)(object)val4 == (Object)null)) { frontMiddleSeat.ReturnPlayerAnimator(val4, isLocalPlayer: false, middlePassengerSeatTrigger); val4.TeleportPlayer(Vector3.zero, false, 0f, false, true); currentMiddlePassenger = null; if (!((NetworkBehaviour)this).IsOwner) { SetVehicleCollisionForPlayer(setEnabled: true, GameNetworkManager.Instance.localPlayerController); } } } [Rpc(/*Could not decode attribute arguments.*/)] public void OnPassengerLeaveGameRpc(int playerId) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(3986388574u, val2, val, (SendTo)6, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val3, playerId); ((NetworkBehaviour)this).__endSendRpc(ref val3, 3986388574u, val2, val, (SendTo)6, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; PlayerControllerB val4 = StartOfRound.Instance.allPlayerScripts[playerId]; if (!((Object)(object)val4 == (Object)null)) { frontRightSeat.ReturnPlayerAnimator(val4, isLocalPlayer: false, base.passengerSeatTrigger); val4.TeleportPlayer(Vector3.zero, false, 0f, false, true); base.currentPassenger = null; if (!((NetworkBehaviour)this).IsOwner) { SetVehicleCollisionForPlayer(setEnabled: true, GameNetworkManager.Instance.localPlayerController); } } } private int CanExitCar(bool passengerSide) { //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) if (!passengerSide) { for (int i = 0; i < base.driverSideExitPoints.Length; i++) { if (!CheckExitPointInvalid(((Component)GameNetworkManager.Instance.localPlayerController.gameplayCamera).transform.position, base.driverSideExitPoints[i].position, base.exitCarLayerMask, (QueryTriggerInteraction)1)) { return i; } } return -1; } for (int j = 0; j < base.passengerSideExitPoints.Length; j++) { if (!CheckExitPointInvalid(((Component)GameNetworkManager.Instance.localPlayerController.gameplayCamera).transform.position, base.passengerSideExitPoints[j].position, base.exitCarLayerMask, (QueryTriggerInteraction)1)) { return j; } } return -1; } public bool CheckExitPointInvalid(Vector3 playerPos, Vector3 exitPoint, int layerMask, QueryTriggerInteraction interaction) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) if (Physics.Linecast(playerPos, exitPoint, layerMask, interaction)) { return true; } if (Physics.CheckCapsule(exitPoint, exitPoint + Vector3.up, 0.5f, layerMask, interaction)) { return true; } LayerMask val = LayerMask.op_Implicit(layerMask | LayerMask.GetMask(new string[1] { "Vehicle" })); if (!Physics.Linecast(exitPoint, exitPoint + Vector3.down * 4f, LayerMask.op_Implicit(val), interaction)) { return true; } return false; } public void EnableVehicleCollisionForAllPlayers() { //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < StartOfRound.Instance.allPlayerScripts.Length; i++) { if ((Object)(object)StartOfRound.Instance.allPlayerScripts[i] != (Object)(object)base.currentPassenger && (Object)(object)StartOfRound.Instance.allPlayerScripts[i] != (Object)(object)currentMiddlePassenger) { if ((Object)(object)StartOfRound.Instance.allPlayerScripts[i] != (Object)(object)GameNetworkManager.Instance.localPlayerController) { ((Collider)StartOfRound.Instance.allPlayerScripts[i].thisController).excludeLayers = LayerMask.op_Implicit(1073745920); StartOfRound.Instance.allPlayerScripts[i].playerRigidbody.excludeLayers = LayerMask.op_Implicit(1073745920); break; } ((Collider)StartOfRound.Instance.allPlayerScripts[i].thisController).excludeLayers = LayerMask.op_Implicit(0); StartOfRound.Instance.allPlayerScripts[i].playerRigidbody.excludeLayers = LayerMask.op_Implicit(0); } } } public void DisableVehicleCollisionForAllPlayers() { //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < StartOfRound.Instance.allPlayerScripts.Length; i++) { if (!base.localPlayerInControl && !localPlayerInMiddlePassengerSeat && !base.localPlayerInPassengerSeat && (Object)(object)StartOfRound.Instance.allPlayerScripts[i] == (Object)(object)GameNetworkManager.Instance.localPlayerController) { ((Collider)StartOfRound.Instance.allPlayerScripts[i].thisController).excludeLayers = LayerMask.op_Implicit(0); StartOfRound.Instance.allPlayerScripts[i].playerRigidbody.excludeLayers = LayerMask.op_Implicit(0); } else { ((Collider)StartOfRound.Instance.allPlayerScripts[i].thisController).excludeLayers = LayerMask.op_Implicit(1073745920); StartOfRound.Instance.allPlayerScripts[i].playerRigidbody.excludeLayers = LayerMask.op_Implicit(1073745920); } } } public void SetVehicleCollisionForPlayer(bool setEnabled, PlayerControllerB player) { //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) if (!setEnabled) { ((Collider)player.thisController).excludeLayers = LayerMask.op_Implicit(1073745920); player.playerRigidbody.excludeLayers = LayerMask.op_Implicit(1073745920); } else { ((Collider)player.thisController).excludeLayers = LayerMask.op_Implicit(0); player.playerRigidbody.excludeLayers = LayerMask.op_Implicit(0); } } private void GetVehicleInput() { //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)GameNetworkManager.Instance.localPlayerController == (Object)null || GameNetworkManager.Instance.localPlayerController.isTypingChat || GameNetworkManager.Instance.localPlayerController.quickMenuManager.isMenuOpen) { return; } base.moveInputVector = IngamePlayerSettings.Instance.playerInput.actions.FindAction("Move", false).ReadValue(); base.moveInputVector.x = Mathf.Round(base.moveInputVector.x); base.moveInputVector.y = Mathf.Round(base.moveInputVector.y); if (syncedMoveInputVector != base.moveInputVector || syncedDrivePedalPressed != base.drivePedalPressed || syncedBrakePedalPressed != base.brakePedalPressed || syncedClutchPedalPressed != clutchPedalPressed) { syncedMoveInputVector = base.moveInputVector; syncedDrivePedalPressed = base.drivePedalPressed; syncedBrakePedalPressed = base.brakePedalPressed; syncedClutchPedalPressed = clutchPedalPressed; SyncPlayerInputsRpc(base.moveInputVector, base.drivePedalPressed, base.brakePedalPressed, clutchPedalPressed); } base.brakePedalPressed = Plugin.VehicleControlsInstance.BrakePedalKey.IsPressed(); brakeInput = Mathf.MoveTowards(brakeInput, base.brakePedalPressed ? 1f : 0f, 10f * Time.deltaTime); clutchPedalPressed = Plugin.VehicleControlsInstance.ClutchPedalKey.IsPressed(); clutchInput = Mathf.MoveTowards(clutchInput, clutchPedalPressed ? 1f : 0f, 10f * Time.deltaTime); smoothRotation = UserConfig.SmoothWheel.Value; if (!base.ignitionStarted) { base.steeringAnimValue = 0f; steeringWheelAnimValue = 0f; base.drivePedalPressed = false; throttleInput = 0f; brakeInput = 0f; return; } if (Plugin.VehicleControlsInstance.SteerLeftKey.IsPressed()) { base.steeringAnimValue = -1f; } else if (Plugin.VehicleControlsInstance.SteerRightKey.IsPressed()) { base.steeringAnimValue = 1f; } else { base.steeringAnimValue = 0f; } if (UserConfig.SmoothWheel.Value) { if (base.steeringAnimValue == 0f) { steeringWheelAnimValue = NormaliseFloat(Mathf.Lerp(steeringWheelAnimValue, 0f, steeringSpeed * Time.deltaTime)); } else { steeringWheelAnimValue = NormaliseFloat(Mathf.Lerp(steeringWheelAnimValue, base.steeringAnimValue, steeringSpeed * Time.deltaTime)); } } else { steeringWheelAnimValue = base.steeringAnimValue; } base.drivePedalPressed = Plugin.VehicleControlsInstance.GasPedalKey.IsPressed() || (inReverse && Plugin.VehicleControlsInstance.ReversePedalKey.IsPressed()); gasInput = Mathf.MoveTowards(gasInput, base.drivePedalPressed ? 1f : 0f, 10f * Time.deltaTime); if (base.moveInputVector.x == 0f && UserConfig.RecenterWheel.Value) { base.steeringWheelAnimFloat = NormaliseFloat(Mathf.MoveTowards(base.steeringWheelAnimFloat, 0f, base.steeringWheelTurnSpeed * Time.deltaTime / 6f)); } } private void ActivateControl() { Plugin.VehicleControlsInstance.JumpKey.performed += DoTurboBoost; Plugin.VehicleControlsInstance.GearShiftForwardKey.performed += ShiftGearForwardInput; Plugin.VehicleControlsInstance.GearShiftBackwardKey.performed += ShiftGearBackInput; Plugin.VehicleControlsInstance.ToggleMagnetKey.performed += ActivateMagnet; Plugin.VehicleControlsInstance.ToggleHeadlightsKey.performed += ActivateHeadlights; Plugin.VehicleControlsInstance.ToggleWipersKey.performed += ActivateWipers; Plugin.VehicleControlsInstance.ActivateHornKey.performed += ActivateHorn; Plugin.VehicleControlsInstance.ActivateHornKey.canceled += ActivateHorn; Plugin.VehicleControlsInstance.SwitchIgnitionKey.performed += SetUsingSwitchIgnition; Plugin.VehicleControlsInstance.SwitchIgnitionKey.canceled += SetUsingSwitchIgnition; base.currentDriver = GameNetworkManager.Instance.localPlayerController; base.localPlayerInControl = true; base.steeringAnimValue = 0f; steeringWheelAnimValue = 0f; base.drivePedalPressed = false; base.brakePedalPressed = false; clutchPedalPressed = false; throttleInput = 0f; brakeInput = 0f; clutchEngagement = 1f; clutchSlip = 0f; } private void DisableControl() { Plugin.VehicleControlsInstance.JumpKey.performed -= DoTurboBoost; Plugin.VehicleControlsInstance.GearShiftForwardKey.performed -= ShiftGearForwardInput; Plugin.VehicleControlsInstance.GearShiftBackwardKey.performed -= ShiftGearBackInput; Plugin.VehicleControlsInstance.ToggleMagnetKey.performed -= ActivateMagnet; Plugin.VehicleControlsInstance.ToggleHeadlightsKey.performed -= ActivateHeadlights; Plugin.VehicleControlsInstance.ToggleWipersKey.performed -= ActivateWipers; Plugin.VehicleControlsInstance.ActivateHornKey.performed -= ActivateHorn; Plugin.VehicleControlsInstance.ActivateHornKey.canceled -= ActivateHorn; Plugin.VehicleControlsInstance.SwitchIgnitionKey.performed -= SetUsingSwitchIgnition; Plugin.VehicleControlsInstance.SwitchIgnitionKey.canceled -= SetUsingSwitchIgnition; base.currentDriver = null; base.localPlayerInControl = false; base.steeringAnimValue = 0f; steeringWheelAnimValue = 0f; base.drivePedalPressed = false; base.brakePedalPressed = false; clutchPedalPressed = false; throttleInput = 0f; brakeInput = 0f; clutchEngagement = 1f; clutchSlip = 0f; } public void ActivateMagnet(CallbackContext context) { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) if (((CallbackContext)(ref context)).performed) { float num = Vector3.Distance(((Component)this).transform.position, StartOfRound.Instance.magnetPoint.position); if (num >= 20f) { Plugin.Logger.LogDebug((object)$"Vehicle is too far away from the magnet to toggle it. Distance: {num}"); return; } GlobalReferences.magnetTrigger.TriggerAnimation(GameNetworkManager.Instance.localPlayerController); string text = (GlobalReferences.magnetTrigger.boolValue ? "Activated" : "Deactivated"); HUDManager.Instance.DisplayGlobalNotification("Ship Magnet " + text); } } public void SetUsingSwitchIgnition(CallbackContext context) { if (base.localPlayerInControl && base.keyIgnitionCoroutine == null && ((((CallbackContext)(ref context)).performed && !usingSwitchIgnition) || (((CallbackContext)(ref context)).canceled && usingSwitchIgnition))) { usingSwitchIgnition = !usingSwitchIgnition; TrySetCarIgnitionTriggers(); HUDManager.Instance.holdFillAmount = 0f; startIgnitionTrigger.isBeingHeldByPlayer = false; } } public void SetGearAnimation(string setGear) { manualShiftAnimator.CrossFade(setGear, 0.01f); if (base.ignitionStarted) { PlayerControllerB currentDriver = base.currentDriver; if (currentDriver != null) { currentDriver.playerBodyAnimator.CrossFade(setGear, 0.01f); } } base.gearStickAudio.PlayOneShot(shiftSounds[Random.Range(0, shiftSounds.Length)]); } public void ShiftGearForwardInput(CallbackContext context) { if (((CallbackContext)(ref context)).performed && base.localPlayerInControl && !(Time.realtimeSinceStartup - timeSinceTogglingRadio < 0.5f) && !(Time.realtimeSinceStartup - base.timeAtLastGearShift < 0.15f) && base.keyIgnitionCoroutine == null) { AttemptToShiftGearForward(); } } public void AttemptToShiftGearForward() { if (currentGear >= gearRatios.Length - 1) { return; } int num = -1; if (!clutchPedalPressed && base.ignitionStarted) { num = Random.Range(0, gearCrunchSounds.Length); engineAudio3.volume = 1f; engineAudio3.PlayOneShot(gearCrunchSounds[num]); if ((float)Random.Range(0, 40) < 20f) { DealPermanentGearboxDamage(1); } } base.timeAtLastGearShift = Time.realtimeSinceStartup; playerWhoShifted = GameNetworkManager.Instance.localPlayerController; int num2 = 0; if (currentGear == 0 && !inNeutral) { num2 = 0; SetGearAnimation(upShiftString[num2]); inReverse = false; inNeutral = true; currentGear = 1; } else if (inNeutral) { num2 = 1; SetGearAnimation(upShiftString[num2]); inNeutral = false; inReverse = false; currentGear = 1; } else if (currentGear < gearRatios.Length - 1) { if (currentGear == 0) { currentGear = 1; } else { currentGear++; } num2 = currentGear; SetGearAnimation(upShiftString[num2]); inReverse = false; inNeutral = false; } ShiftToGearRpc((int)GameNetworkManager.Instance.localPlayerController.playerClientId, currentGear, num2, upShifting: true, inNeutral, inReverse, num); } public void ShiftGearBackInput(CallbackContext context) { if (((CallbackContext)(ref context)).performed && base.localPlayerInControl && !(Time.realtimeSinceStartup - timeSinceTogglingRadio < 0.5f) && !(Time.realtimeSinceStartup - base.timeAtLastGearShift < 0.15f) && base.keyIgnitionCoroutine == null) { AttemptToShiftGearBackwards(); } } public void AttemptToShiftGearBackwards() { if (currentGear == 0 && inReverse) { return; } int num = -1; if (!clutchPedalPressed && base.ignitionStarted) { num = Random.Range(0, gearCrunchSounds.Length); engineAudio3.volume = 1f; engineAudio3.PlayOneShot(gearCrunchSounds[num]); if ((float)Random.Range(0, 40) < 20f) { DealPermanentGearboxDamage(1); } } base.timeAtLastGearShift = Time.realtimeSinceStartup; playerWhoShifted = GameNetworkManager.Instance.localPlayerController; int num2 = 0; if (currentGear == 1 && inNeutral) { num2 = 0; SetGearAnimation(downShiftString[num2]); inReverse = true; inNeutral = false; currentGear = 0; } else if (currentGear > 1) { currentGear--; num2 = currentGear + 1; SetGearAnimation(downShiftString[num2]); inNeutral = false; inReverse = false; } else if (currentGear == 1) { num2 = 1; SetGearAnimation(downShiftString[num2]); inNeutral = true; inReverse = false; } ShiftToGearRpc((int)GameNetworkManager.Instance.localPlayerController.playerClientId, currentGear, num2, upShifting: false, inNeutral, inReverse, num); } [Rpc(/*Could not decode attribute arguments.*/)] public void ShiftToGearRpc(int playerId, int setGear, int gearAnimation, bool upShifting, bool isNeutral, bool isReverse, int crunchId) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(1802936242u, val2, val, (SendTo)5, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val3, playerId); BytePacker.WriteValueBitPacked(val3, setGear); BytePacker.WriteValueBitPacked(val3, gearAnimation); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref upShifting, default(ForPrimitives)); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref isNeutral, default(ForPrimitives)); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref isReverse, default(ForPrimitives)); BytePacker.WriteValueBitPacked(val3, crunchId); ((NetworkBehaviour)this).__endSendRpc(ref val3, 1802936242u, val2, val, (SendTo)5, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; base.timeAtLastGearShift = Time.realtimeSinceStartup; playerWhoShifted = StartOfRound.Instance.allPlayerScripts[playerId]; currentGear = setGear; inNeutral = isNeutral; inReverse = isReverse; if (crunchId != -1) { engineAudio3.volume = 1f; engineAudio3.PlayOneShot(gearCrunchSounds[crunchId]); } if (upShifting) { SetGearAnimation(upShiftString[gearAnimation]); } else { SetGearAnimation(downShiftString[gearAnimation]); } } } public void DealPermanentGearboxDamage(int damageAmount) { if (!StartOfRound.Instance.inShipPhase && !base.magnetedToShip && !base.carDestroyed && ((NetworkBehaviour)this).IsOwner && transmissionHP > 0) { timeAtLastGearboxDamage = Time.realtimeSinceStartup; transmissionHP -= damageAmount; transmissionHP = Mathf.Clamp(transmissionHP, 0, baseTransmissionHP); syncedTransmissionHP = transmissionHP; DealGearboxDamageRpc(transmissionHP); } } [Rpc(/*Could not decode attribute arguments.*/)] public void DealGearboxDamageRpc(int gearHealth) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(4167936217u, val2, val, (SendTo)1, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val3, gearHealth); ((NetworkBehaviour)this).__endSendRpc(ref val3, 4167936217u, val2, val, (SendTo)1, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; timeAtLastGearboxDamage = Time.realtimeSinceStartup; transmissionHP = gearHealth; syncedTransmissionHP = transmissionHP; } } } public void StartMagneting() { //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) //IL_0178: Unknown result type (might be due to invalid IL or missing references) //IL_017d: Unknown result type (might be due to invalid IL or missing references) //IL_017e: Unknown result type (might be due to invalid IL or missing references) //IL_0183: Unknown result type (might be due to invalid IL or missing references) //IL_0190: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_0197: Unknown result type (might be due to invalid IL or missing references) //IL_01a3: Unknown result type (might be due to invalid IL or missing references) //IL_01a8: Unknown result type (might be due to invalid IL or missing references) //IL_01b4: Unknown result type (might be due to invalid IL or missing references) //IL_01b9: Unknown result type (might be due to invalid IL or missing references) //IL_01bf: Unknown result type (might be due to invalid IL or missing references) //IL_01c4: Unknown result type (might be due to invalid IL or missing references) //IL_01cc: Unknown result type (might be due to invalid IL or missing references) //IL_0208: Unknown result type (might be due to invalid IL or missing references) //IL_020d: Unknown result type (might be due to invalid IL or missing references) //IL_020f: Unknown result type (might be due to invalid IL or missing references) //IL_0215: Unknown result type (might be due to invalid IL or missing references) //IL_021a: Unknown result type (might be due to invalid IL or missing references) //IL_021c: Unknown result type (might be due to invalid IL or missing references) base.mainRigidbody.isKinematic = true; base.magnetTime = 0f; base.magnetRotationTime = 0f; StartOfRound.Instance.isObjectAttachedToMagnet = true; StartOfRound.Instance.attachedVehicle = (VehicleController)(object)this; base.magnetedToShip = true; base.averageVelocityAtMagnetStart = base.averageVelocity; RoundManager.Instance.tempTransform.eulerAngles = new Vector3(0f, ((Component)this).transform.eulerAngles.y, 0f); Vector3 eulerAngles = RoundManager.Instance.tempTransform.eulerAngles; Vector3 eulerAngles2 = ((Component)this).transform.eulerAngles; eulerAngles2.y = Mathf.Round((eulerAngles2.y + 90f) / 180f) * 180f - 90f; eulerAngles2.z = Mathf.Round(eulerAngles2.z / 90f) * 90f; float num = Mathf.Repeat(eulerAngles2.x + Random.Range(-5f, 5f) + 180f, 360f) - 180f; eulerAngles2.x = Mathf.Clamp(num, -20f, 20f); base.magnetTargetRotation = Quaternion.Euler(eulerAngles2); Vector3 val = default(Vector3); ((Vector3)(ref val))..ctor(0f, -0.5f, (0f - base.boundsCollider.size.x) * 0.5f * ((Component)base.boundsCollider).transform.lossyScale.x); Vector3 val2 = StartOfRound.Instance.magnetPoint.position + val; base.magnetTargetPosition = StartOfRound.Instance.elevatorTransform.InverseTransformPoint(val2); base.magnetStartPosition = ((Component)this).transform.position; base.magnetStartRotation = ((Component)this).transform.rotation; Quaternion magnetTargetRotation = base.magnetTargetRotation; ((Component)this).transform.rotation = magnetTargetRotation; CollectItemsInTruck(justDepartedIntoOrbit: false); if (!StartOfRound.Instance.inShipPhase && !((Object)(object)GameNetworkManager.Instance.localPlayerController == (Object)null)) { MagnetCarRpc(base.magnetTargetPosition, eulerAngles2, base.magnetStartPosition, base.magnetStartRotation, eulerAngles, base.averageVelocityAtMagnetStart); } } [Rpc(/*Could not decode attribute arguments.*/)] public void MagnetCarRpc(Vector3 targetPosition, Vector3 targetRotation, Vector3 startPosition, Quaternion startRotation, Vector3 tempRotation, Vector3 avgVel) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Unknown result type (might be due to invalid IL or missing references) //IL_0163: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Unknown result type (might be due to invalid IL or missing references) //IL_016b: Unknown result type (might be due to invalid IL or missing references) //IL_0171: Unknown result type (might be due to invalid IL or missing references) //IL_0172: Unknown result type (might be due to invalid IL or missing references) //IL_0178: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_017e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(231877460u, val2, val, (SendTo)1, (RpcDelivery)0); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref targetPosition); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref targetRotation); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref startPosition); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref startRotation); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref tempRotation); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref avgVel); ((NetworkBehaviour)this).__endSendRpc(ref val3, 231877460u, val2, val, (SendTo)1, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; base.mainRigidbody.isKinematic = true; base.magnetedToShip = true; base.magnetTime = 0f; base.magnetRotationTime = 0f; base.averageVelocityAtMagnetStart = avgVel; RoundManager.Instance.tempTransform.eulerAngles = tempRotation; StartOfRound.Instance.isObjectAttachedToMagnet = true; StartOfRound.Instance.attachedVehicle = (VehicleController)(object)this; base.magnetStartPosition = startPosition; base.magnetStartRotation = startRotation; base.magnetTargetPosition = targetPosition; base.magnetTargetRotation = Quaternion.Euler(targetRotation); CollectItemsInTruck(justDepartedIntoOrbit: false); } } } public void CollectItemsInTruck(bool justDepartedIntoOrbit) { //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) foreach (GrabbableObject item in References.itemsInTruck) { if (!((Object)(object)item != (Object)null) || item.isHeld || item.isHeldByEnemy || !((Object)(object)((Component)item).transform.parent == (Object)(object)((Component)this).transform)) { continue; } if (!justDepartedIntoOrbit) { if ((Object)(object)References.lastDriver != (Object)null) { References.lastDriver.SetItemInElevator(base.magnetedToShip, base.magnetedToShip, item); } else if ((Object)(object)GameNetworkManager.Instance.localPlayerController != (Object)null) { GameNetworkManager.Instance.localPlayerController.SetItemInElevator(base.magnetedToShip, base.magnetedToShip, item); } continue; } bool flag = true; Vector3 position = ((Component)item).transform.position; if (storageCompartment.ClosestPoint(position) == position) { flag = !liftGateOpen && !sideDoorOpen; } else { bool flag2 = itemSafetyBounds.ClosestPoint(position) == position; flag = flag2; } if (item.isInElevator != flag && item.isInShipRoom != flag) { if ((Object)(object)References.lastDriver != (Object)null) { References.lastDriver.SetItemInElevator(flag, flag, item); } else if ((Object)(object)GameNetworkManager.Instance.localPlayerController != (Object)null) { GameNetworkManager.Instance.localPlayerController.SetItemInElevator(flag, flag, item); } } } } public void SetOverdriveSwitchLocalClient() { overdriveSwitchEnabled = !overdriveSwitchEnabled; cabinLightSwitchAudio.PlayOneShot(cabinLightSwitchToggle); SetOverdriveSwitchRpc(overdriveSwitchEnabled); } [Rpc(/*Could not decode attribute arguments.*/)] private void SetOverdriveSwitchRpc(bool switchState) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(344299242u, val2, val, (SendTo)5, (RpcDelivery)0); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref switchState, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val3, 344299242u, val2, val, (SendTo)5, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; overdriveSwitchEnabled = switchState; cabinLightSwitchAudio.PlayOneShot(cabinLightSwitchToggle); } } } public void AddEngineOil() { if (transmissionHP < baseTransmissionHP) { int num = Mathf.Min(transmissionHP + 2, baseTransmissionHP); AddTransmissionOilOnLocalClient(num); AddTransmissionOilRpc(num); } else { int num2 = Mathf.Min(base.carHP + 2, base.baseCarHP); AddEngineOilOnLocalClient(num2); AddEngineOilRpc(num2); } } public void AddTransmissionOilOnLocalClient(int setGearHealth) { base.hoodAudio.PlayOneShot(base.pourOil); transmissionHP = setGearHealth; } [Rpc(/*Could not decode attribute arguments.*/)] public void AddTransmissionOilRpc(int setGearHP) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(1393669511u, val2, val, (SendTo)5, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val3, setGearHP); ((NetworkBehaviour)this).__endSendRpc(ref val3, 1393669511u, val2, val, (SendTo)5, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; AddTransmissionOilOnLocalClient(setGearHP); } } } public void AddEngineOilOnLocalClient(int setCarHP) { base.hoodAudio.PlayOneShot(base.pourOil); base.carHP = setCarHP; } [Rpc(/*Could not decode attribute arguments.*/)] public void AddEngineOilRpc(int setHP) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(2664742903u, val2, val, (SendTo)5, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val3, setHP); ((NetworkBehaviour)this).__endSendRpc(ref val3, 2664742903u, val2, val, (SendTo)5, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; AddEngineOilOnLocalClient(setHP); } } } public void AddTurboBoost() { if (!overdriveSwitchEnabled && transmissionHP < baseTransmissionHP) { int num = Mathf.Min(transmissionHP + 2, baseTransmissionHP); AddTransmissionOilOnLocalClient(num); AddTransmissionOilRpc(num); } else { int setTurboBoosts = Mathf.Min(base.turboBoosts + 1, 4); AddTurboBoostOnLocalClient(setTurboBoosts); AddTurboBoostRpc(setTurboBoosts); } } public void AddTurboBoostOnLocalClient(int setTurboBoosts) { base.hoodAudio.PlayOneShot(base.pourTurbo); base.turboBoosts = setTurboBoosts; } [Rpc(/*Could not decode attribute arguments.*/)] public void AddTurboBoostRpc(int setTurboBoosts) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(2998005556u, val2, val, (SendTo)5, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val3, setTurboBoosts); ((NetworkBehaviour)this).__endSendRpc(ref val3, 2998005556u, val2, val, (SendTo)5, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; AddTurboBoostOnLocalClient(setTurboBoosts); } } } public void SetHeaterOnLocalClient(bool on) { if (heaterOn != on) { heaterOn = on; SetHeaterRpc(heaterOn); } } [Rpc(/*Could not decode attribute arguments.*/)] private void SetHeaterRpc(bool heatOn) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(1137787820u, val2, val, (SendTo)5, (RpcDelivery)0); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref heatOn, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val3, 1137787820u, val2, val, (SendTo)5, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; heaterOn = heatOn; } } } public void SetHeaterFanSpeedOnLocalClient(float fanSpeed) { if (heaterSpeed != fanSpeed) { heaterSpeed = fanSpeed; SetHeaterFanSpeedRpc(heaterSpeed); } } [Rpc(/*Could not decode attribute arguments.*/)] private void SetHeaterFanSpeedRpc(float fanSpeed) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(3963678435u, val2, val, (SendTo)5, (RpcDelivery)0); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref fanSpeed, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val3, 3963678435u, val2, val, (SendTo)5, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; heaterSpeed = fanSpeed; } } } public void SetHeaterDirectionOnLocalClient(float heatTemp) { if (heaterTemp != heatTemp) { heaterTemp = heatTemp; isHeaterCold = heatTemp == 0f; isHeaterWarm = heatTemp == 1f; SetHeaterDirectionRpc(heaterTemp); } } [Rpc(/*Could not decode attribute arguments.*/)] private void SetHeaterDirectionRpc(float temp) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(3569046119u, val2, val, (SendTo)5, (RpcDelivery)0); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref temp, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val3, 3569046119u, val2, val, (SendTo)5, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; heaterTemp = temp; isHeaterCold = heaterTemp == 0f; isHeaterWarm = heaterTemp == 1f; } } } private void DoTurboBoost(CallbackContext context) { //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) if (((CallbackContext)(ref context)).performed) { PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController; if (!((Object)(object)localPlayerController == (Object)null) && !localPlayerController.isPlayerDead && localPlayerController.isPlayerControlled && !localPlayerController.isTypingChat && !localPlayerController.quickMenuManager.isMenuOpen && base.localPlayerInControl && base.ignitionStarted && !base.jumpingInCar && !base.keyIsInDriverHand) { Vector2 dir = IngamePlayerSettings.Instance.playerInput.actions.FindAction("Move", false).ReadValue(); UseTurboBoostLocalClient(dir); UseTurboBoostRpc(); } } } public void UseTurboBoostLocalClient(Vector2 dir = default(Vector2)) { //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_0166: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) bool flag = base.turboBoosts > 0 && overdriveSwitchEnabled; PlayerControllerB currentDriver = base.currentDriver; if (currentDriver != null) { currentDriver.playerBodyAnimator.SetTrigger("SA_JumpInCar"); } PlayerControllerB currentDriver2 = base.currentDriver; if (currentDriver2 != null) { currentDriver2.movementAudio.PlayOneShot(base.jumpInCarSFX); } if (((NetworkBehaviour)this).IsOwner) { if (base.turboBoosts == 0 || !overdriveSwitchEnabled) { base.jumpingInCar = true; ((MonoBehaviour)this).StartCoroutine(jerkCarUpward(Vector2.op_Implicit(dir))); return; } if (flag) { Vector3 val = ((Component)this).transform.TransformDirection(new Vector3(dir.x, 0f, dir.y)); base.mainRigidbody.AddForce(val * base.turboBoostForce + Vector3.up * base.turboBoostUpwardForce * 0.6f, (ForceMode)1); } } if (flag) { base.turboBoosts = Mathf.Max(0, base.turboBoosts - 1); base.turboBoostAudio.PlayOneShot(base.turboBoostSFX); base.engineAudio1.PlayOneShot(base.turboBoostSFX2); base.turboBoostParticle.Play(true); if (Vector3.Distance(((Component)StartOfRound.Instance.audioListener).transform.position, ((Component)base.turboBoostAudio).transform.position) < 10f) { HUDManager.Instance.ShakeCamera((ScreenShakeType)1); } } } private IEnumerator jerkCarUpward(Vector3 dir) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) if (!((NetworkBehaviour)this).IsOwner) { base.jumpingInCar = false; yield break; } yield return (object)new WaitForSeconds(0.16f); Vector3 jerkForce = ((Component)this).transform.TransformDirection(new Vector3(dir.x, 0f, dir.y)); base.mainRigidbody.AddForce(jerkForce * base.turboBoostForce * 0.22f + Vector3.up * base.turboBoostUpwardForce * 0.1f, (ForceMode)1); base.mainRigidbody.AddForceAtPosition(Vector3.up * base.jumpForce, ((Component)base.hoodFireAudio).transform.position - Vector3.up * 2f, (ForceMode)1); yield return (object)new WaitForSeconds(0.15f); base.jumpingInCar = false; } [Rpc(/*Could not decode attribute arguments.*/)] public void UseTurboBoostRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(2821576097u, val2, val, (SendTo)1, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendRpc(ref val3, 2821576097u, val2, val, (SendTo)1, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; UseTurboBoostLocalClient(); } } } public void ActivateHeadlights(CallbackContext context) { if (((CallbackContext)(ref context)).performed && base.localPlayerInControl) { ToggleHeadlightsLocalClient(); } } public void ActivateWipers(CallbackContext context) { if (((CallbackContext)(ref context)).performed && base.localPlayerInControl) { ((UnityEvent)(object)windscreenWipersTrigger.onInteract).Invoke(StartOfRound.Instance.localPlayerController); } } public void ActivateHorn(CallbackContext context) { if (base.localPlayerInControl && truckAlarmCoroutine == null && ((((CallbackContext)(ref context)).performed && !base.honkingHorn) || (((CallbackContext)(ref context)).canceled && base.honkingHorn))) { SetHonkingLocalClient(!base.honkingHorn); } } public void SetHonkingLocalClient(bool honk) { base.honkingHorn = honk; SetHonkRpc(honk); } [Rpc(/*Could not decode attribute arguments.*/)] public void SetHonkRpc(bool honk) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(500051534u, val2, val, (SendTo)5, (RpcDelivery)0); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref honk, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val3, 500051534u, val2, val, (SendTo)5, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; base.honkingHorn = honk; } } } public void OnDisable() { //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) DisableControl(); RemoveCarRainCollision(); truckMat.mainTexture = (Texture)(object)defaultTruckTex; if (base.localPlayerInControl || base.localPlayerInPassengerSeat || localPlayerInMiddlePassengerSeat) { GameNetworkManager.Instance.localPlayerController.CancelSpecialTriggerAnimations(); } GrabbableObject[] componentsInChildren = ((Component)base.physicsRegion.physicsTransform).GetComponentsInChildren(); for (int i = 0; i < componentsInChildren.Length; i++) { if ((Object)(object)RoundManager.Instance.mapPropsContainer != (Object)null) { ((Component)componentsInChildren[i]).transform.SetParent(RoundManager.Instance.mapPropsContainer.transform, true); } else { ((Component)componentsInChildren[i]).transform.SetParent((Transform)null, true); } if (!componentsInChildren[i].isHeld) { componentsInChildren[i].FallToGround(false, false, default(Vector3)); } } base.physicsRegion.disablePhysicsRegion = true; if (StartOfRound.Instance.CurrentPlayerPhysicsRegions.Contains(base.physicsRegion)) { StartOfRound.Instance.CurrentPlayerPhysicsRegions.Remove(base.physicsRegion); } PlayerUtils.seatedInTruck = false; PlayerUtils.isPlayerOnTruck = false; PlayerUtils.isPlayerInCab = false; PlayerUtils.isPlayerInStorage = false; References.truckController = null; } [Rpc(/*Could not decode attribute arguments.*/)] public void SyncPlayerZoneRpc(int playerId, bool onTruck, bool inCab, bool inStorage) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(2905751979u, val2, val, (SendTo)5, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val3, playerId); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref onTruck, default(ForPrimitives)); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref inCab, default(ForPrimitives)); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref inStorage, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val3, 2905751979u, val2, val, (SendTo)5, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; PlayerControllerB val4 = StartOfRound.Instance.allPlayerScripts[playerId]; if (!((Object)(object)val4 == (Object)null) && !val4.isPlayerDead && val4.isPlayerControlled) { PlayerControllerBPatches.PlayerControllerBData data = PlayerControllerBPatches.GetData(val4); data.isPlayerOnTruck = onTruck; data.isPlayerInCab = inCab; data.isPlayerInStorage = inStorage; } } } public void Update() { //IL_01d5: Unknown result type (might be due to invalid IL or missing references) //IL_01db: Unknown result type (might be due to invalid IL or missing references) //IL_058f: Unknown result type (might be due to invalid IL or missing references) //IL_0594: Unknown result type (might be due to invalid IL or missing references) if (base.destroyNextFrame) { if (((NetworkBehaviour)this).IsOwner) { Plugin.Logger.LogInfo((object)$"is networkobject spawned?: {((NetworkBehaviour)this).NetworkObject.IsSpawned}"); Plugin.Logger.LogInfo((object)("destroying " + ((Object)((Component)this).gameObject).name + " on local client")); Object.Destroy((Object)(object)((Component)base.windwiperPhysicsBody1).gameObject); Object.Destroy((Object)(object)((Component)base.windwiperPhysicsBody2).gameObject); Object.Destroy((Object)(object)((Component)base.ragdollPhysicsBody).gameObject); Object.Destroy((Object)(object)((Component)playerPhysicsBody).gameObject); Object.Destroy((Object)(object)((Component)this).gameObject); } return; } if ((Object)(object)((NetworkBehaviour)this).NetworkObject != (Object)null && !((NetworkBehaviour)this).NetworkObject.IsSpawned) { RemoveCarRainCollision(); base.physicsRegion.disablePhysicsRegion = true; if (StartOfRound.Instance.CurrentPlayerPhysicsRegions.Contains(base.physicsRegion)) { StartOfRound.Instance.CurrentPlayerPhysicsRegions.Remove(base.physicsRegion); } if (base.localPlayerInControl || base.localPlayerInPassengerSeat || localPlayerInMiddlePassengerSeat) { GameNetworkManager.Instance.localPlayerController.CancelSpecialTriggerAnimations(); } GrabbableObject[] componentsInChildren = ((Component)base.physicsRegion.physicsTransform).GetComponentsInChildren(); for (int i = 0; i < componentsInChildren.Length; i++) { if ((Object)(object)RoundManager.Instance.mapPropsContainer != (Object)null) { ((Component)componentsInChildren[i]).transform.SetParent(RoundManager.Instance.mapPropsContainer.transform, true); } else { ((Component)componentsInChildren[i]).transform.SetParent((Transform)null, true); } if (!componentsInChildren[i].isHeld) { componentsInChildren[i].FallToGround(false, false, default(Vector3)); } } Plugin.Logger.LogInfo((object)("destroying " + ((Object)((Component)this).gameObject).name + " on local client, next frame")); base.destroyNextFrame = true; return; } ReactToDamage(); if (base.magnetedToShip) { if (!StartOfRound.Instance.magnetOn) { base.magnetedToShip = false; StartOfRound.Instance.isObjectAttachedToMagnet = false; CollectItemsInTruck(justDepartedIntoOrbit: false); return; } base.magnetTime = Mathf.Min(base.magnetTime + Time.deltaTime, 1f); base.magnetRotationTime = Mathf.Min(base.magnetTime + Time.deltaTime * 0.75f, 1f); if (!base.finishedMagneting && base.magnetTime > 0.7f) { base.finishedMagneting = true; base.turbulenceAmount = 2f; base.turbulenceAudio.volume = 0.6f; base.turbulenceAudio.PlayOneShot(base.maxCollisions[Random.Range(0, base.maxCollisions.Length)]); } } else { base.finishedMagneting = false; if ((Object)(object)StartOfRound.Instance.attachedVehicle == (Object)(object)this) { StartOfRound.Instance.attachedVehicle = null; } if (((NetworkBehaviour)this).IsOwner) { if (base.enabledCollisionForAllPlayers) { base.enabledCollisionForAllPlayers = false; DisableVehicleCollisionForAllPlayers(); } } else if (!base.enabledCollisionForAllPlayers) { base.enabledCollisionForAllPlayers = true; EnableVehicleCollisionForAllPlayers(); } } if (base.carDestroyed) { base.driverSeatTrigger.interactable = false; middlePassengerSeatTrigger.interactable = false; base.passengerSeatTrigger.interactable = false; return; } base.driverSeatTrigger.interactable = base.hasBeenSpawned; middlePassengerSeatTrigger.interactable = base.hasBeenSpawned; base.passengerSeatTrigger.interactable = base.hasBeenSpawned; if (PlayerUtils.seatedInTruck) { SyncPlayerLookInput(); } if (!disableAnimations && (Object)(object)base.currentDriver != (Object)null && (Object)(object)base.currentDriver.playerBodyAnimator != (Object)null) { base.currentDriver.playerBodyAnimator.SetFloat("animationSpeed", base.steeringWheelAnimFloat + 0.5f); if (base.ignitionStarted && base.keyIgnitionCoroutine == null) { int num = 1; base.currentDriver.playerBodyAnimator.SetInteger("SA_CarAnim", num); } } SetCarEffects(steeringWheelAnimValue); if (!base.ignitionStarted) { base.EngineRPM = Mathf.Lerp(base.EngineRPM, 0f, 3f * Time.deltaTime); } if (((NetworkBehaviour)this).IsOwner) { if (base.localPlayerInControl && (Object)(object)base.currentDriver != (Object)null) { GetVehicleInput(); } float num2 = 0f; SetInternalStress(num2); base.stressPerSecond = num2; return; } if (base.ignitionStarted) { base.EngineRPM = Mathf.Lerp(base.EngineRPM, syncedEngineRPM, 6f * Time.deltaTime); } frontWheelRPM = syncedFrontWheelRPM; backWheelRPM = syncedBackWheelRPM; wheelRPM = Mathf.Lerp(wheelRPM, syncedWheelRPM, 6f * Time.deltaTime); base.moveInputVector = syncedMoveInputVector; base.steeringAnimValue = base.moveInputVector.x; steeringWheelAnimValue = 0f; base.drivePedalPressed = syncedDrivePedalPressed; base.brakePedalPressed = syncedBrakePedalPressed; clutchPedalPressed = syncedClutchPedalPressed; } public void SyncPlayerLookInput() { PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController; if ((Object)(object)localPlayerController == (Object)null || localPlayerController.isPlayerDead || !localPlayerController.isPlayerControlled) { return; } PlayerControllerBPatches.PlayerControllerBData data = PlayerControllerBPatches.GetData(localPlayerController); if (data.vehicleCameraHorizontal != localPlayerController.ladderCameraHorizontal) { data.vehicleCameraHorizontal = localPlayerController.ladderCameraHorizontal; } if (data.syncLookInputInterval >= 0.14f) { if (data.lastVehicleCameraHorizontal != localPlayerController.ladderCameraHorizontal) { data.syncLookInputInterval = 0f; data.lastVehicleCameraHorizontal = localPlayerController.ladderCameraHorizontal; SyncPlayerLookInputRpc((int)localPlayerController.playerClientId, localPlayerController.ladderCameraHorizontal); } } else { data.syncLookInputInterval += Time.deltaTime; } } [Rpc(/*Could not decode attribute arguments.*/)] public void SyncPlayerLookInputRpc(int playerId, float lookInput) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(4242820360u, val2, val, (SendTo)5, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val3, playerId); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref lookInput, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val3, 4242820360u, val2, val, (SendTo)5, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; PlayerControllerB val4 = StartOfRound.Instance.allPlayerScripts[playerId]; if (!((Object)(object)val4 == (Object)null) && !val4.isPlayerDead && val4.isPlayerControlled) { val4.ladderCameraHorizontal = lookInput; PlayerControllerBPatches.PlayerControllerBData data = PlayerControllerBPatches.GetData(val4); data.vehicleCameraHorizontal = lookInput; } } } public void UpdatePlayerVehicleAnimations() { PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController; if (!((Object)(object)localPlayerController == (Object)null) && !localPlayerController.isPlayerDead && localPlayerController.isPlayerControlled) { int integer = localPlayerController.playerBodyAnimator.GetInteger("SA_CarAnim"); PlayerControllerBPatches.PlayerControllerBData data = PlayerControllerBPatches.GetData(localPlayerController); if (data.currentCarAnimation != integer) { data.currentCarAnimation = integer; SyncPlayerVehicleAnimationsRpc((int)localPlayerController.playerClientId, integer, isTrigger: false, null, null, null); } } } [Rpc(/*Could not decode attribute arguments.*/)] public void SyncPlayerVehicleAnimationsRpc(int playerId, int animIndex, bool isTrigger, string upperStringName, string leftStringName, string rightStringName) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0189: Unknown result type (might be due to invalid IL or missing references) //IL_0193: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_01a2: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Unknown result type (might be due to invalid IL or missing references) //IL_0174: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(3102248458u, val2, val, (SendTo)5, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val3, playerId); BytePacker.WriteValueBitPacked(val3, animIndex); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref isTrigger, default(ForPrimitives)); bool flag = upperStringName != null; ((FastBufferWriter)(ref val3)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val3)).WriteValueSafe(upperStringName, false); } bool flag2 = leftStringName != null; ((FastBufferWriter)(ref val3)).WriteValueSafe(ref flag2, default(ForPrimitives)); if (flag2) { ((FastBufferWriter)(ref val3)).WriteValueSafe(leftStringName, false); } bool flag3 = rightStringName != null; ((FastBufferWriter)(ref val3)).WriteValueSafe(ref flag3, default(ForPrimitives)); if (flag3) { ((FastBufferWriter)(ref val3)).WriteValueSafe(rightStringName, false); } ((NetworkBehaviour)this).__endSendRpc(ref val3, 3102248458u, val2, val, (SendTo)5, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; PlayerControllerB val4 = StartOfRound.Instance.allPlayerScripts[playerId]; if ((Object)(object)val4 == (Object)null) { Plugin.Logger.LogWarning((object)("no player found for " + ((Object)((Component)this).gameObject).name + ", aborting")); } else if (!val4.isPlayerDead && val4.isPlayerControlled) { if (isTrigger) { val4.playerBodyAnimator.CrossFade(upperStringName, 0.05f); val4.playerBodyAnimator.CrossFade(leftStringName, 0.05f); val4.playerBodyAnimator.CrossFade(rightStringName, 0.05f); } else { val4.playerBodyAnimator.SetInteger("SA_CarAnim", animIndex); } } } [Rpc(/*Could not decode attribute arguments.*/)] public void SyncRadioTimeRpc(float songTime) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(4199638913u, val2, val, (SendTo)3, (RpcDelivery)0); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref songTime, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val3, 4199638913u, val2, val, (SendTo)3, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; base.currentSongTime = songTime; SetRadioTime(); } } } public void SetRadioTime() { if (!((Object)(object)base.radioAudio.clip == (Object)null) && base.radioOn) { base.radioAudio.time = Mathf.Clamp(base.currentSongTime % base.radioAudio.clip.length, 0.01f, base.radioAudio.clip.length - 0.1f); } } public void ChangeRadioType() { if (SCVNetworker.Instance.StreamerRadio.Value) { HUDManager.Instance.DisplayTip("Live radio disabled", "The host has disabled this feature!", false, false, "LC_Tip1"); } else { if (!base.radioOn) { return; } isFmRadio = !isFmRadio; if (!isFmRadio) { liveRadioController.TurnRadioOnOff(state: false); base.radioInterference.Stop(); if (base.radioAudio.loop) { base.radioAudio.loop = false; } SetCurrentRadioClip(); base.currentSongTime = lastSongTime; SetRadioTime(); if ((Object)(object)base.radioAudio.clip != (Object)null) { base.radioAudio.Play(); } base.radioOn = true; } else { liveRadioController.TogglePowerLocalClient(checkOn: false); if (!base.radioAudio.loop) { base.radioAudio.loop = true; } lastSongTime = base.currentSongTime; base.radioOn = true; } ChangeRadioTypeRpc(isFmRadio, base.currentRadioClip, lastSongTime, base.currentSongTime); } } [Rpc(/*Could not decode attribute arguments.*/)] public void ChangeRadioTypeRpc(bool isFmStation, int radioStation, float lastTime, float currentTime) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(1953632049u, val2, val, (SendTo)5, (RpcDelivery)0); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref isFmStation, default(ForPrimitives)); BytePacker.WriteValueBitPacked(val3, radioStation); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref lastTime, default(ForPrimitives)); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref currentTime, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val3, 1953632049u, val2, val, (SendTo)5, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; isFmRadio = isFmStation; base.currentRadioClip = radioStation; if (!isFmRadio) { liveRadioController.TurnRadioOnOff(state: false); base.radioInterference.Stop(); if (base.radioAudio.loop) { base.radioAudio.loop = false; } SetCurrentRadioClip(); base.currentSongTime = currentTime; SetRadioTime(); if ((Object)(object)base.radioAudio.clip != (Object)null) { base.radioAudio.Play(); } base.radioOn = true; } else { if (!base.radioAudio.loop) { base.radioAudio.loop = true; } lastSongTime = lastTime; base.radioOn = true; } } public void ChangeRadioStation(bool seekForward) { if (isFmRadio) { TrySetFMRadioRpc(lastSongTime); if (!base.radioAudio.loop) { base.radioAudio.loop = true; } liveRadioController.ToggleStationLocalClient(); } else { if (!base.radioOn) { return; } if (!SCVNetworker.Instance.StreamerRadio.Value) { if (base.radioClips.Length != 0) { if (seekForward) { base.currentRadioClip = (base.currentRadioClip + 1) % base.radioClips.Length; } else { base.currentRadioClip = (base.currentRadioClip - 1 + base.radioClips.Length) % base.radioClips.Length; } } else { base.currentRadioClip = 0; } } else if (seekForward) { base.currentRadioClip = (base.currentRadioClip + 1) % streamerRadioClips.Length; } else { base.currentRadioClip = (base.currentRadioClip - 1 + streamerRadioClips.Length) % streamerRadioClips.Length; } SetCurrentRadioClip(); base.currentSongTime = 0f; lastSongTime = 0f; SetRadioTime(); if ((Object)(object)base.radioAudio.clip != (Object)null) { base.radioAudio.Play(); } SetRadioStationRpc(base.currentRadioClip); } } [Rpc(/*Could not decode attribute arguments.*/)] public void SetRadioStationRpc(int radioStation) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(2140426134u, val2, val, (SendTo)5, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val3, radioStation); ((NetworkBehaviour)this).__endSendRpc(ref val3, 2140426134u, val2, val, (SendTo)5, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (!base.radioOn) { base.radioOn = true; } base.currentRadioClip = radioStation; SetCurrentRadioClip(); base.currentSongTime = 0f; lastSongTime = 0f; SetRadioTime(); if ((Object)(object)base.radioAudio.clip != (Object)null) { base.radioAudio.Play(); } } } public void SwitchRadio() { if (base.localPlayerInControl && base.keyIgnitionCoroutine == null && base.ignitionStarted) { timeSinceTogglingRadio = Time.realtimeSinceStartup; PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController; localPlayerController.playerBodyAnimator.CrossFade("U_Radio_TurnOn_LHD", 0.05f); localPlayerController.playerBodyAnimator.CrossFade("L_Radio_TurnOn_LHD", 0.05f); localPlayerController.playerBodyAnimator.CrossFade("R_Radio_TurnOn_LHD", 0.05f); SyncPlayerVehicleAnimationsRpc((int)localPlayerController.playerClientId, 0, isTrigger: true, "U_Radio_TurnOn_LHD", "L_Radio_TurnOn_LHD", "R_Radio_TurnOn_LHD"); } if (isFmRadio) { TrySetFMRadioRpc(lastSongTime); if (!base.radioAudio.loop) { base.radioAudio.loop = true; } liveRadioController.TogglePowerLocalClient(checkOn: true); return; } if (base.radioAudio.loop) { base.radioAudio.loop = false; } base.radioOn = !base.radioOn; if (base.radioOn) { SetCurrentRadioClip(); base.currentSongTime = lastSongTime; SetRadioTime(); if ((Object)(object)base.radioAudio.clip != (Object)null) { base.radioAudio.Play(); } } else { lastSongTime = base.currentSongTime; if ((Object)(object)base.radioAudio.clip != (Object)null) { base.radioAudio.Stop(); } } SetRadioRpc(base.radioOn, base.currentRadioClip, base.currentSongTime, lastSongTime); } [Rpc(/*Could not decode attribute arguments.*/)] public void TrySetFMRadioRpc(float lastTime) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(1383733861u, val2, val, (SendTo)5, (RpcDelivery)0); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref lastTime, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val3, 1383733861u, val2, val, (SendTo)5, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; isFmRadio = true; if (!base.radioAudio.loop) { base.radioAudio.loop = true; } lastSongTime = lastTime; } } [Rpc(/*Could not decode attribute arguments.*/)] public void SetRadioRpc(bool on, int currentClip, float songTime, float lastRadioTime) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(3819348054u, val2, val, (SendTo)5, (RpcDelivery)0); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref on, default(ForPrimitives)); BytePacker.WriteValueBitPacked(val3, currentClip); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref songTime, default(ForPrimitives)); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref lastRadioTime, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val3, 3819348054u, val2, val, (SendTo)5, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (base.radioOn == on) { return; } if (base.radioAudio.loop) { base.radioAudio.loop = false; } base.radioOn = on; base.currentRadioClip = currentClip; if (on) { SetCurrentRadioClip(); base.currentSongTime = songTime; SetRadioTime(); if ((Object)(object)base.radioAudio.clip != (Object)null) { base.radioAudio.Play(); } } else { lastSongTime = lastRadioTime; if ((Object)(object)base.radioAudio.clip != (Object)null) { base.radioAudio.Stop(); } } } private void SetCurrentRadioClip() { if (!SCVNetworker.Instance.StreamerRadio.Value) { if (base.radioClips == null) { base.radioAudio.clip = null; base.currentRadioClip = 0; return; } base.currentRadioClip %= base.radioClips.Length; if (base.currentRadioClip < 0) { base.currentRadioClip += base.radioClips.Length; } base.radioAudio.clip = base.radioClips[base.currentRadioClip]; } else { base.currentRadioClip %= streamerRadioClips.Length; if (base.currentRadioClip < 0) { base.currentRadioClip += streamerRadioClips.Length; } base.radioAudio.clip = streamerRadioClips[base.currentRadioClip]; } } public void SetRadioValues() { //IL_0066: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)base.radioAudio.clip == (Object)null) { return; } if (((NetworkBehaviour)this).IsServer && base.radioAudio.isPlaying && Time.realtimeSinceStartup > radioPingTimestamp) { radioPingTimestamp = Time.realtimeSinceStartup + 1f; RoundManager.Instance.PlayAudibleNoise(((Component)base.radioAudio).transform.position, 16f, Mathf.Min((base.radioAudio.volume + base.radioInterference.volume) * 0.5f, 0.9f), 0, false, 2692); } if (base.radioOn && !isFmRadio && ((NetworkBehaviour)this).IsServer) { base.currentSongTime += Time.deltaTime; if (Time.realtimeSinceStartup - timeLastSyncedRadio > 1f) { timeLastSyncedRadio = Time.realtimeSinceStartup; SyncRadioTimeRpc(base.currentSongTime); } if (!base.radioAudio.isPlaying) { ChangeRadioStation(seekForward: true); } } } private void MatchWheelMeshToCollider(MeshRenderer wheelMesh, MeshRenderer brakeMesh, WheelCollider wheelCollider) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) Vector3 position = default(Vector3); Quaternion rotation = default(Quaternion); wheelCollider.GetWorldPose(ref position, ref rotation); ((Component)wheelMesh).transform.position = position; ((Component)wheelMesh).transform.rotation = rotation; ((Component)brakeMesh).transform.position = ((Component)wheelMesh).transform.position; } public void TryBeginAlarm() { if (truckAlarmCoroutine == null) { BeginAlarmRpc(); } } [Rpc(/*Could not decode attribute arguments.*/)] public void BeginAlarmRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(1849009000u, val2, val, (SendTo)7, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendRpc(ref val3, 1849009000u, val2, val, (SendTo)7, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; truckAlarmCoroutine = ((MonoBehaviour)this).StartCoroutine(BeginAlarmSound()); } } } private IEnumerator BeginAlarmSound() { alarmAudio.loop = true; alarmDebounce = true; base.hornAudio.Stop(); base.honkingHorn = false; alarmAudio.Play(); if (blinkersCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(blinkersCoroutine); blinkersCoroutine = null; } SetSymbolActive(immobiliserSymbol, immobiliserLight, active: true); blinkersCoroutine = ((MonoBehaviour)this).StartCoroutine(FlashBlinkerLights()); yield return (object)new WaitForSeconds(17.296f); alarmAudio.loop = false; SetSymbolActive(immobiliserSymbol, immobiliserLight, active: false); if (!hazardsOn) { if (blinkersCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(blinkersCoroutine); blinkersCoroutine = null; } hazardsBlinking = false; ((Renderer)leftBlinkerMesh).material = base.headlightsOffMat; ((Renderer)leftBlinkerMeshLod).material = base.headlightsOffMat; ((Renderer)rightBlinkerMesh).material = base.headlightsOffMat; ((Renderer)rightBlinkerMeshLod).material = base.headlightsOffMat; SetSymbolActive(leftSignalSymbol, leftSignalLight, active: false); SetSymbolActive(hazardWarningSymbol, hazardWarningLight, active: false); SetSymbolActive(rightSignalSymbol, rightSignalLight, active: false); blinkerLightsContainer.SetActive(false); } truckAlarmCoroutine = null; alarmDebounce = false; } public void SetCarEffects(float setSteering) { //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_02f5: Unknown result type (might be due to invalid IL or missing references) //IL_031b: Unknown result type (might be due to invalid IL or missing references) setSteering = (((NetworkBehaviour)this).IsOwner ? setSteering : 0f); base.steeringWheelAnimFloat = Mathf.Clamp(base.steeringWheelAnimFloat + setSteering * (base.steeringWheelTurnSpeed * Time.deltaTime / 6f), -1f, 1f); base.steeringWheelAnimator.SetFloat("steeringWheelTurnSpeed", Mathf.Clamp((base.steeringWheelAnimFloat + 1f) / 2f, 0f, 1f)); speedometerTransform.localRotation = Quaternion.Euler(0f, -225f * speedometerFloat, 0f); tachometerTransform.localRotation = Quaternion.Euler(0f, -135f * tachometerFloat, 0f); oilPressureTransform.localRotation = Quaternion.Euler(0f, -135f * oilPressureFloat, 0f); if (base.ignitionStarted) { float num = (float)base.carHP / (float)base.baseCarHP; float num2 = turboPressureNeedleCurve.Evaluate(num); float num3 = oilPressureNeedleCurve.Evaluate((float)((double)(base.carHP / 2) + (double)base.turboBoosts * 3.5 * (double)(turboPressureFloat * (float)(overdriveSwitchEnabled ? 1 : 0))) / (float)(base.baseCarHP + 4)); float num4 = Mathf.Abs(backWheelRPM) / 850f; float num5 = base.EngineRPM / base.MaxEngineRPM; speedometerFloat = Mathf.Lerp(speedometerFloat, num4, 6f * Time.deltaTime); tachometerFloat = Mathf.Lerp(tachometerFloat, num5, 6f * Time.deltaTime); turboPressureFloat = Mathf.Lerp(turboPressureFloat, num2, 6f * Time.deltaTime); oilPressureFloat = Mathf.Lerp(oilPressureFloat, num3, 4f * Time.deltaTime); } else { bool flag = base.engineAudio1.volume > 0.1f && twistingKey; speedometerFloat = Mathf.Lerp(speedometerFloat, 0f, 6f * Time.deltaTime); tachometerFloat = Mathf.Lerp(tachometerFloat, flag ? 0.065f : 0f, 4.5f * Time.deltaTime); turboPressureFloat = Mathf.Lerp(turboPressureFloat, 0f, 6f * Time.deltaTime); oilPressureFloat = Mathf.Lerp(oilPressureFloat, 0f, 6f * Time.deltaTime); } mirrorAngleFloat = Mathf.MoveTowards(mirrorAngleFloat, (!electricsOn) ? 77.5f : 0f, 50f * Time.deltaTime); leftElectricMirror.transform.localRotation = Quaternion.Euler(0f, 0f - mirrorAngleFloat, 0f); rightElectricMirror.transform.localRotation = Quaternion.Euler(0f, mirrorAngleFloat, 0f); SetCarRadio(); SetCarInteriorAnimations(); SetCarHeater(); SetCarLightingEffects(); SetCarAudioEffects(); CalculateTyreSlip(); SetCarKeyEffects(); if (((NetworkBehaviour)this).IsOwner) { SyncCarEffectsToOtherClients(); if (!base.syncedExtremeStress && base.underExtremeStress && base.extremeStressAudio.volume > 0.35f) { base.syncedExtremeStress = true; SyncExtremeStressRpc(base.underExtremeStress); } else if (base.syncedExtremeStress && !base.underExtremeStress && base.extremeStressAudio.volume < 0.5f) { base.syncedExtremeStress = false; SyncExtremeStressRpc(base.underExtremeStress); } } else if (smoothRotation) { base.steeringWheelAnimFloat = Mathf.Lerp(base.steeringWheelAnimFloat, syncedWheelRotation, 6f * Time.deltaTime); } else { base.steeringWheelAnimFloat = Mathf.MoveTowards(base.steeringWheelAnimFloat, syncedWheelRotation, base.steeringWheelTurnSpeed * Time.deltaTime / 6f); } } public void SetCarInteriorAnimations() { //IL_005d: Unknown result type (might be due to invalid IL or missing references) float num = ((!lowBeamsOn) ? 0f : ((!highBeamsOn) ? 82.5f : 165f)); lightSwitchFloat = Mathf.MoveTowards(lightSwitchFloat, num, 800f * Time.deltaTime); headlightSwitch.transform.localRotation = Quaternion.Euler(0f, lightSwitchFloat, 0f); } public void SetCarHeater() { //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Unknown result type (might be due to invalid IL or missing references) float num = heaterSpeed; float num2 = num; if (num2 != 1f) { if (num2 != 2f) { if (num2 != 3f) { if (num2 == 4f) { heatSpeedFloat = Mathf.Lerp(heatSpeedFloat, 12.75f, 50f * Time.deltaTime); } } else { heatSpeedFloat = Mathf.Lerp(heatSpeedFloat, 4.2f, 50f * Time.deltaTime); } } else { heatSpeedFloat = Mathf.Lerp(heatSpeedFloat, -4.2f, 50f * Time.deltaTime); } } else { heatSpeedFloat = Mathf.Lerp(heatSpeedFloat, -12.75f, 50f * Time.deltaTime); } fanSpeedLever.transform.localRotation = Quaternion.Euler(heatSpeedFloat, 0f, 0f); heatDirectionFloat = Mathf.Lerp(heatDirectionFloat, heaterOn ? (-0.5f) : 20f, 50f * Time.deltaTime); heaterDirectionLever.transform.localRotation = Quaternion.Euler(0f, heatDirectionFloat, 0f); heatPositionFloat = Mathf.Lerp(heatPositionFloat, isHeaterCold ? 20f : (-20f), 50f * Time.deltaTime); heaterTempLever.transform.localRotation = Quaternion.Euler(0f, heatPositionFloat, 0f); } public void SetObjectRotation(GameObject obj, Quaternion target, float deltaSpeed, bool useRotate) { //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) if (useRotate) { obj.transform.localRotation = Quaternion.RotateTowards(obj.transform.localRotation, target, deltaSpeed * Time.deltaTime); } else { obj.transform.localRotation = Quaternion.Lerp(obj.transform.localRotation, target, deltaSpeed * Time.deltaTime); } } public void SetCarRadio() { if (!electricsOn && !base.radioOn) { ((TMP_Text)radioTime).text = null; ((TMP_Text)radioFrequency).text = null; } else if (base.radioOn) { ((TMP_Text)radioTime).text = SetRadioClock(((TMP_Text)HUDManager.Instance.clockNumber).text); if (Time.realtimeSinceStartup - liveRadioController._timeSinceChangingVol < 2f) { ((TMP_Text)radioFrequency).text = SetRadioVolume(liveRadioController._volume); } else if (isFmRadio) { ((TMP_Text)radioFrequency).text = ((liveRadioController._stream == null || string.IsNullOrEmpty(liveRadioController._stream.buffer_info)) ? "PI SEEK" : liveRadioController._currentFrequency); } else { ((TMP_Text)radioFrequency).text = SetRadioCDTrack(base.currentRadioClip); } } else { ((TMP_Text)radioTime).text = null; ((TMP_Text)radioFrequency).text = "RADIO OFF"; } } private string SetRadioVolume(float vol) { if (vol <= 0f) { return "RADIO MUTE"; } if (vol == 1f) { return "VOL MAX"; } int num = Mathf.RoundToInt(vol * 10f); return $"VOL {num:00}"; } private string SetRadioCDTrack(int currentTrack) { if (!SCVNetworker.Instance.StreamerRadio.Value && base.radioClips.Length == 0) { return "NO CD"; } int num = currentTrack + 1; return $"CD PLAY {num:00}"; } private string SetRadioClock(string clockText) { return clockText.Trim().Replace("\n", "").Replace("AM", "") .Replace("PM", "") .Trim(); } public void SetCarLightingEffects() { bool flag = wheelBrakeTorque > 100f && base.ignitionStarted && !handbrakeEngaged; bool flag2 = inReverse && base.ignitionStarted; if (base.backLightsOn != flag) { base.backLightsOn = flag; ((Renderer)base.backLightsMesh).material = (Material)(flag ? ((object)base.backLightOnMat) : ((object)greyLightOffMat)); ((Renderer)backLightsMeshLod).material = (Material)(flag ? ((object)base.backLightOnMat) : ((object)greyLightOffMat)); base.backLightsContainer.SetActive(flag); } if (reverseLightsOn != flag2) { reverseLightsOn = flag2; ((Renderer)reverseLightsMesh).enabled = flag2; reverseLightsContainer.SetActive(flag2); } } private void SetVehicleAudioProperties(AudioSource audio, bool audioActive, float lowest, float highest, float lerpSpeed, bool useVolumeInsteadOfPitch = false, float onVolume = 1f) { if (audioActive && (((Object)(object)audio == (Object)(object)base.extremeStressAudio && base.magnetedToShip) || (((Object)(object)audio == (Object)(object)base.rollingAudio || (Object)(object)audio == (Object)(object)base.skiddingAudio) && (base.magnetedToShip || (!base.FrontLeftWheel.isGrounded && !base.FrontRightWheel.isGrounded && !base.BackLeftWheel.isGrounded && !base.BackRightWheel.isGrounded))))) { audioActive = false; } if (audioActive) { if (!audio.isPlaying) { audio.Play(); } if (useVolumeInsteadOfPitch) { audio.volume = Mathf.Max(Mathf.Lerp(audio.volume, highest, lerpSpeed * Time.deltaTime), lowest); return; } audio.volume = Mathf.Lerp(audio.volume, onVolume, 20f * Time.deltaTime); audio.pitch = Mathf.Lerp(audio.pitch, highest, lerpSpeed * Time.deltaTime); } else { if (useVolumeInsteadOfPitch) { audio.volume = Mathf.Lerp(audio.volume, 0f, lerpSpeed * Time.deltaTime); } else { audio.volume = Mathf.Lerp(audio.volume, 0f, 4f * Time.deltaTime); audio.pitch = Mathf.Lerp(audio.pitch, lowest, 4f * Time.deltaTime); } if (audio.isPlaying && audio.volume <= 0.001f) { audio.Stop(); } } } public void SetCarAudioEffects() { //IL_022e: Unknown result type (might be due to invalid IL or missing references) //IL_0283: Unknown result type (might be due to invalid IL or missing references) //IL_0437: Unknown result type (might be due to invalid IL or missing references) //IL_02d9: Unknown result type (might be due to invalid IL or missing references) //IL_031f: Unknown result type (might be due to invalid IL or missing references) //IL_0545: Unknown result type (might be due to invalid IL or missing references) //IL_05dd: Unknown result type (might be due to invalid IL or missing references) float num = engineCurve.Evaluate(base.EngineRPM / base.engineIntensityPercentage); float num2 = 1f; if (base.ignitionStarted) { num2 = 1.35f; } float highest = (base.ignitionStarted ? (Mathf.Clamp(num, 0.65f, 1.15f) * 1.35f) : 1f); float highest2 = Mathf.Clamp(num, 0.7f, 1.5f); float num3 = Mathf.Abs(wheelRPM); float highest3 = Mathf.Clamp(num3 / 63f, 0f, 1f); float highest4 = heaterSpeed / 4f; base.carEngine2AudioActive = base.ignitionStarted; base.carRollingAudioActive = !allWheelsAirborne && num3 > 10f; SetVehicleAudioProperties(base.engineAudio1, base.carEngine1AudioActive, 0.65f * num2, highest, 2f, useVolumeInsteadOfPitch: false, 0.7f); SetVehicleAudioProperties(base.engineAudio2, base.carEngine2AudioActive, 0.7f, highest2, 3f, useVolumeInsteadOfPitch: false, 0.5f); SetVehicleAudioProperties(base.rollingAudio, base.carRollingAudioActive, 0f, highest3, 5f, useVolumeInsteadOfPitch: true); SetVehicleAudioProperties(base.extremeStressAudio, base.underExtremeStress, 0.2f, 1f, 3f, useVolumeInsteadOfPitch: true); SetVehicleAudioProperties(heaterAudio, heaterOn && base.ignitionStarted, 0f, highest4, 3f, useVolumeInsteadOfPitch: true); SetVehicleAudioProperties(backUpBeeperAudio, base.ignitionStarted && inReverse, 0f, 1f, 4f, useVolumeInsteadOfPitch: true); SetRadioValues(); if (base.engineAudio1.volume > 0.3f && base.engineAudio1.isPlaying && Time.realtimeSinceStartup - base.timeAtLastEngineAudioPing > 2f) { base.timeAtLastEngineAudioPing = Time.realtimeSinceStartup; if (!base.ignitionStarted) { RoundManager.Instance.PlayAudibleNoise(((Component)base.engineAudio1).transform.position, 15f, 0.6f, 0, false, 2692); } else if (base.EngineRPM < 980f) { if (!base.magnetedToShip) { RoundManager.Instance.PlayAudibleNoise(((Component)base.engineAudio1).transform.position, 11f, 0.5f, 0, false, 2692); } } else if (base.EngineRPM >= 980f && base.EngineRPM < 3700f) { RoundManager.Instance.PlayAudibleNoise(((Component)base.engineAudio1).transform.position, 25f, 0.6f, 0, false, 2692); } else if (base.EngineRPM >= 3700f) { RoundManager.Instance.PlayAudibleNoise(((Component)base.engineAudio1).transform.position, 32f, 0.75f, 0, false, 2692); } } base.steeringWheelAudio.volume = 1f; if (lastClutchPedalPressed != clutchPedalPressed) { lastClutchPedalPressed = clutchPedalPressed; if (lastClutchPedalPressed) { int num4 = Random.Range(0, clutchInClips.Length); PlayerControllerB currentDriver = base.currentDriver; if (currentDriver != null) { currentDriver.movementAudio.PlayOneShot(clutchInClips[num4]); } } else { int num5 = Random.Range(0, clutchOutClips.Length); PlayerControllerB currentDriver2 = base.currentDriver; if (currentDriver2 != null) { currentDriver2.movementAudio.PlayOneShot(clutchOutClips[num5]); } } } if (voiceModule.voiceAudio.isPlaying && Time.realtimeSinceStartup - timeAtLastEVAPing > 2f) { timeAtLastEVAPing = Time.realtimeSinceStartup; RoundManager.Instance.PlayAudibleNoise(((Component)voiceModule.voiceAudio).transform.position, 30f, 0.91f, 0, false, 106217); } base.turbulenceAudio.volume = Mathf.Lerp(base.turbulenceAudio.volume, Mathf.Min(1f, base.turbulenceAmount), 10f * Time.deltaTime); base.turbulenceAmount = Mathf.Max(base.turbulenceAmount - Time.deltaTime, 0f); if (base.turbulenceAudio.volume > 0.02f) { if (!base.turbulenceAudio.isPlaying) { base.turbulenceAudio.Play(); } } else if (base.turbulenceAudio.isPlaying) { base.turbulenceAudio.Stop(); } if (truckAlarmCoroutine != null) { if (Time.realtimeSinceStartup - timeAtLastAlarmPing > 2f) { timeAtLastAlarmPing = Time.realtimeSinceStartup; RoundManager.Instance.PlayAudibleNoise(((Component)base.hornAudio).transform.position, 30f, 0.91f, 0, false, 106217); } } else if (base.honkingHorn) { base.hornAudio.pitch = 1f; if (!base.hornAudio.isPlaying) { base.hornAudio.Play(); } if (Time.realtimeSinceStartup - base.timeAtLastHornPing > 2f) { base.timeAtLastHornPing = Time.realtimeSinceStartup; RoundManager.Instance.PlayAudibleNoise(((Component)base.hornAudio).transform.position, 28f, 0.85f, 0, false, 106217); } } else { base.hornAudio.pitch = Mathf.Max(base.hornAudio.pitch - Time.deltaTime * 6f, 0.01f); if (base.hornAudio.pitch < 0.02f && base.hornAudio.isPlaying) { base.hornAudio.Stop(); } } } public void CalculateTyreSlip() { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) if (((NetworkBehaviour)this).IsOwner) { float num = Vector3.Dot(Vector3.Normalize(base.mainRigidbody.velocity * 1000f), ((Component)this).transform.forward); float num2 = Mathf.Abs(backWheelRPM); bool flag = base.BackLeftWheel.isGrounded && base.BackRightWheel.isGrounded; bool flag2 = false; if (flag) { if (wheelTorque > 600f && Mathf.Abs(forwardsSlip) > 0.245f && num2 > 350f) { num = Mathf.Max(num, 0.8f); flag2 = true; if (((Vector3)(ref base.averageVelocity)).magnitude > 8f && !base.tireSparks.isPlaying) { base.tireSparks.Play(true); } } else { flag2 = false; if (base.tireSparks.isEmitting) { base.tireSparks.Stop(true, (ParticleSystemStopBehavior)1); } } } else { flag2 = false; if (base.tireSparks.isEmitting) { base.tireSparks.Stop(true, (ParticleSystemStopBehavior)1); } } SetVehicleAudioProperties(base.skiddingAudio, flag2, 0f, num, 3f, useVolumeInsteadOfPitch: true); if (Mathf.Abs(tyreStress - num) > 0.02f || wheelSlipping != flag2) { tyreStress = num; wheelSlipping = flag2; SetTyreStressRpc(num, flag2); } } else { if (wheelSlipping && ((Vector3)(ref base.averageVelocity)).magnitude > 8f && !base.tireSparks.isPlaying) { base.tireSparks.Play(true); } else if (!wheelSlipping && base.tireSparks.isEmitting) { base.tireSparks.Stop(true, (ParticleSystemStopBehavior)1); } SetVehicleAudioProperties(base.skiddingAudio, wheelSlipping, 0f, tyreStress, 3f, useVolumeInsteadOfPitch: true); } } public void SetCarKeyEffects() { //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_0343: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_0153: Unknown result type (might be due to invalid IL or missing references) //IL_039c: Unknown result type (might be due to invalid IL or missing references) //IL_03b2: Unknown result type (might be due to invalid IL or missing references) //IL_03c8: Unknown result type (might be due to invalid IL or missing references) //IL_03e4: Unknown result type (might be due to invalid IL or missing references) //IL_0400: Unknown result type (might be due to invalid IL or missing references) //IL_01c7: Unknown result type (might be due to invalid IL or missing references) //IL_01bf: Unknown result type (might be due to invalid IL or missing references) //IL_01cc: Unknown result type (might be due to invalid IL or missing references) //IL_01df: Unknown result type (might be due to invalid IL or missing references) //IL_01d7: Unknown result type (might be due to invalid IL or missing references) //IL_01e4: Unknown result type (might be due to invalid IL or missing references) //IL_022c: Unknown result type (might be due to invalid IL or missing references) //IL_0242: Unknown result type (might be due to invalid IL or missing references) //IL_0258: Unknown result type (might be due to invalid IL or missing references) //IL_02b0: Unknown result type (might be due to invalid IL or missing references) //IL_02c3: Unknown result type (might be due to invalid IL or missing references) //IL_02c5: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)base.currentDriver == (Object)null || base.keyIsInIgnition) { if (((Renderer)base.keyObject).enabled != base.keyIsInIgnition) { ((Renderer)base.keyObject).enabled = base.keyIsInIgnition; } if ((Object)(object)((Component)base.keyObject).transform.parent != (Object)(object)carKeyContainer.transform) { ((Component)base.keyObject).transform.SetParent(carKeyContainer.transform); } ((Component)base.keyObject).transform.localScale = ignitionKeyScale; if ((Object)(object)carKeyInHand.transform.parent != (Object)(object)carKeyContainer.transform) { carKeyInHand.transform.SetParent(carKeyContainer.transform, false); } carKeyInHand.transform.localScale = Vector3.one; carKeyInHand.transform.localPosition = Vector3.zero; carKeyInHand.transform.localRotation = Quaternion.identity; ((Component)base.keyObject).transform.position = ignitionKeyPosition.position; ((Component)base.keyObject).transform.rotation = ignitionKeyPosition.rotation; } else if (base.keyIsInDriverHand) { if (!((Renderer)base.keyObject).enabled) { ((Renderer)base.keyObject).enabled = true; } Transform val = (base.localPlayerInControl ? base.currentDriver.localItemHolder : base.currentDriver.serverItemHolder); Vector3 localPosition = (base.localPlayerInControl ? LHD_Pos_Local : LHD_Pos_Server); Vector3 val2 = (base.localPlayerInControl ? LHD_Rot_Local : LHD_Rot_Server); if ((Object)(object)carKeyInHand.transform.parent != (Object)(object)val.parent) { carKeyInHand.transform.SetParent(val.parent, false); } carKeyInHand.transform.localScale = Vector3.one; carKeyInHand.transform.localPosition = Vector3.zero; carKeyInHand.transform.localRotation = Quaternion.identity; if ((Object)(object)((Component)base.keyObject).transform.parent != (Object)(object)carKeyInHand.transform) { ((Component)base.keyObject).transform.SetParent(carKeyInHand.transform); } ((Component)base.keyObject).transform.localPosition = localPosition; ((Component)base.keyObject).transform.localRotation = Quaternion.Euler(val2); } else { if (((Renderer)base.keyObject).enabled) { ((Renderer)base.keyObject).enabled = false; } if ((Object)(object)((Component)base.keyObject).transform.parent != (Object)(object)carKeyContainer.transform) { ((Component)base.keyObject).transform.SetParent(carKeyContainer.transform); } ((Component)base.keyObject).transform.localScale = ignitionKeyScale; if ((Object)(object)carKeyInHand.transform.parent != (Object)(object)carKeyContainer.transform) { carKeyInHand.transform.SetParent(carKeyContainer.transform, false); } carKeyInHand.transform.localScale = Vector3.one; carKeyInHand.transform.localPosition = Vector3.zero; carKeyInHand.transform.localRotation = Quaternion.identity; ((Component)base.keyObject).transform.position = ignitionKeyPosition.position; ((Component)base.keyObject).transform.rotation = ignitionKeyPosition.rotation; } } public void FixedUpdate() { //IL_0233: Unknown result type (might be due to invalid IL or missing references) //IL_0238: Unknown result type (might be due to invalid IL or missing references) //IL_0244: Unknown result type (might be due to invalid IL or missing references) //IL_0249: Unknown result type (might be due to invalid IL or missing references) //IL_0255: Unknown result type (might be due to invalid IL or missing references) //IL_0264: Unknown result type (might be due to invalid IL or missing references) //IL_026a: Unknown result type (might be due to invalid IL or missing references) //IL_026f: Unknown result type (might be due to invalid IL or missing references) //IL_0285: Unknown result type (might be due to invalid IL or missing references) //IL_0297: Unknown result type (might be due to invalid IL or missing references) //IL_029d: Unknown result type (might be due to invalid IL or missing references) //IL_02b3: Unknown result type (might be due to invalid IL or missing references) //IL_02c0: Unknown result type (might be due to invalid IL or missing references) //IL_02c6: Unknown result type (might be due to invalid IL or missing references) //IL_02d0: Unknown result type (might be due to invalid IL or missing references) //IL_02e0: Unknown result type (might be due to invalid IL or missing references) //IL_02e5: Unknown result type (might be due to invalid IL or missing references) //IL_02fb: Unknown result type (might be due to invalid IL or missing references) //IL_0301: Unknown result type (might be due to invalid IL or missing references) //IL_030b: Unknown result type (might be due to invalid IL or missing references) //IL_0315: Unknown result type (might be due to invalid IL or missing references) //IL_031a: Unknown result type (might be due to invalid IL or missing references) //IL_031f: Unknown result type (might be due to invalid IL or missing references) //IL_0357: Unknown result type (might be due to invalid IL or missing references) //IL_035d: Unknown result type (might be due to invalid IL or missing references) //IL_0367: Unknown result type (might be due to invalid IL or missing references) //IL_036c: Unknown result type (might be due to invalid IL or missing references) //IL_0371: Unknown result type (might be due to invalid IL or missing references) //IL_037f: Unknown result type (might be due to invalid IL or missing references) //IL_0384: Unknown result type (might be due to invalid IL or missing references) //IL_03a2: Unknown result type (might be due to invalid IL or missing references) //IL_03a7: Unknown result type (might be due to invalid IL or missing references) //IL_03b5: Unknown result type (might be due to invalid IL or missing references) //IL_03ba: Unknown result type (might be due to invalid IL or missing references) //IL_03c2: Unknown result type (might be due to invalid IL or missing references) //IL_03d6: Unknown result type (might be due to invalid IL or missing references) //IL_03dc: Unknown result type (might be due to invalid IL or missing references) //IL_03e7: Unknown result type (might be due to invalid IL or missing references) //IL_051b: Unknown result type (might be due to invalid IL or missing references) //IL_0526: Unknown result type (might be due to invalid IL or missing references) //IL_052b: Unknown result type (might be due to invalid IL or missing references) //IL_0530: Unknown result type (might be due to invalid IL or missing references) //IL_04d4: Unknown result type (might be due to invalid IL or missing references) //IL_04df: Unknown result type (might be due to invalid IL or missing references) //IL_04e5: Unknown result type (might be due to invalid IL or missing references) //IL_04ea: Unknown result type (might be due to invalid IL or missing references) //IL_04f8: Unknown result type (might be due to invalid IL or missing references) //IL_04fd: Unknown result type (might be due to invalid IL or missing references) //IL_0502: Unknown result type (might be due to invalid IL or missing references) //IL_054c: Unknown result type (might be due to invalid IL or missing references) //IL_0558: Unknown result type (might be due to invalid IL or missing references) //IL_055d: Unknown result type (might be due to invalid IL or missing references) //IL_0570: Unknown result type (might be due to invalid IL or missing references) //IL_057b: Unknown result type (might be due to invalid IL or missing references) //IL_0592: Unknown result type (might be due to invalid IL or missing references) //IL_059d: Unknown result type (might be due to invalid IL or missing references) //IL_05b4: Unknown result type (might be due to invalid IL or missing references) //IL_05bf: Unknown result type (might be due to invalid IL or missing references) //IL_0805: Unknown result type (might be due to invalid IL or missing references) //IL_081f: Unknown result type (might be due to invalid IL or missing references) //IL_0840: Unknown result type (might be due to invalid IL or missing references) //IL_085a: Unknown result type (might be due to invalid IL or missing references) //IL_087b: Unknown result type (might be due to invalid IL or missing references) //IL_088f: Unknown result type (might be due to invalid IL or missing references) //IL_08b0: Unknown result type (might be due to invalid IL or missing references) //IL_08c4: Unknown result type (might be due to invalid IL or missing references) //IL_05de: Unknown result type (might be due to invalid IL or missing references) //IL_05e3: Unknown result type (might be due to invalid IL or missing references) //IL_05ef: Unknown result type (might be due to invalid IL or missing references) //IL_05f4: Unknown result type (might be due to invalid IL or missing references) //IL_01cc: Unknown result type (might be due to invalid IL or missing references) //IL_01d1: Unknown result type (might be due to invalid IL or missing references) //IL_01db: Unknown result type (might be due to invalid IL or missing references) //IL_01e0: Unknown result type (might be due to invalid IL or missing references) //IL_01f2: Unknown result type (might be due to invalid IL or missing references) //IL_01f7: Unknown result type (might be due to invalid IL or missing references) //IL_0203: Unknown result type (might be due to invalid IL or missing references) //IL_0208: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_0488: Unknown result type (might be due to invalid IL or missing references) //IL_0497: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_0164: Unknown result type (might be due to invalid IL or missing references) //IL_0176: Unknown result type (might be due to invalid IL or missing references) //IL_017b: Unknown result type (might be due to invalid IL or missing references) //IL_0187: Unknown result type (might be due to invalid IL or missing references) //IL_018c: Unknown result type (might be due to invalid IL or missing references) //IL_09e5: Unknown result type (might be due to invalid IL or missing references) //IL_09ea: Unknown result type (might be due to invalid IL or missing references) //IL_09f6: Unknown result type (might be due to invalid IL or missing references) //IL_09fb: Unknown result type (might be due to invalid IL or missing references) //IL_0458: Unknown result type (might be due to invalid IL or missing references) //IL_0467: Unknown result type (might be due to invalid IL or missing references) //IL_0b36: Unknown result type (might be due to invalid IL or missing references) //IL_0b3b: Unknown result type (might be due to invalid IL or missing references) //IL_0b16: Unknown result type (might be due to invalid IL or missing references) //IL_0b1b: Unknown result type (might be due to invalid IL or missing references) //IL_0b27: Unknown result type (might be due to invalid IL or missing references) //IL_0b2c: Unknown result type (might be due to invalid IL or missing references) //IL_0bed: Unknown result type (might be due to invalid IL or missing references) //IL_0bf2: Unknown result type (might be due to invalid IL or missing references) //IL_0bf3: Unknown result type (might be due to invalid IL or missing references) //IL_0bf8: Unknown result type (might be due to invalid IL or missing references) //IL_0bfc: Unknown result type (might be due to invalid IL or missing references) //IL_0c01: Unknown result type (might be due to invalid IL or missing references) //IL_0c03: Unknown result type (might be due to invalid IL or missing references) //IL_0c04: Unknown result type (might be due to invalid IL or missing references) //IL_0c09: Unknown result type (might be due to invalid IL or missing references) //IL_0c0e: Unknown result type (might be due to invalid IL or missing references) //IL_0c17: Unknown result type (might be due to invalid IL or missing references) //IL_0c1c: Unknown result type (might be due to invalid IL or missing references) //IL_0c1e: Unknown result type (might be due to invalid IL or missing references) //IL_0c20: Unknown result type (might be due to invalid IL or missing references) //IL_0c25: Unknown result type (might be due to invalid IL or missing references) //IL_0c2a: Unknown result type (might be due to invalid IL or missing references) //IL_0bb9: Unknown result type (might be due to invalid IL or missing references) //IL_0b6a: Unknown result type (might be due to invalid IL or missing references) //IL_0b6c: Unknown result type (might be due to invalid IL or missing references) //IL_0b71: Unknown result type (might be due to invalid IL or missing references) //IL_0b74: Unknown result type (might be due to invalid IL or missing references) //IL_0b79: Unknown result type (might be due to invalid IL or missing references) //IL_0b7e: Unknown result type (might be due to invalid IL or missing references) //IL_0c38: Unknown result type (might be due to invalid IL or missing references) //IL_0c39: Unknown result type (might be due to invalid IL or missing references) //IL_0c3e: Unknown result type (might be due to invalid IL or missing references) //IL_0c9f: Unknown result type (might be due to invalid IL or missing references) //IL_0ca4: Unknown result type (might be due to invalid IL or missing references) //IL_0cb0: Unknown result type (might be due to invalid IL or missing references) //IL_0cb5: Unknown result type (might be due to invalid IL or missing references) //IL_0c5f: Unknown result type (might be due to invalid IL or missing references) if (!StartOfRound.Instance.inShipPhase && !base.loadedVehicleFromSave && !hasDeliveredVehicle) { if ((Object)(object)base.itemShip == (Object)null && (Object)(object)References.itemShip != (Object)null) { base.itemShip = References.itemShip; } if ((Object)(object)base.itemShip != (Object)null && !base.hasBeenSpawned) { if (base.itemShip.untetheredVehicle) { timeSinceUntethered = Time.realtimeSinceStartup; base.inDropshipAnimation = false; base.mainRigidbody.MovePosition(base.itemShip.deliverVehiclePoint.position); base.mainRigidbody.MoveRotation(base.itemShip.deliverVehiclePoint.rotation); base.syncedPosition = base.mainRigidbody.position; base.syncedRotation = base.mainRigidbody.rotation; base.hasBeenSpawned = true; hasDeliveredVehicle = true; } else if (base.itemShip.deliveringVehicle) { base.inDropshipAnimation = true; base.mainRigidbody.isKinematic = true; base.mainRigidbody.MovePosition(base.itemShip.deliverVehiclePoint.position); base.mainRigidbody.MoveRotation(base.itemShip.deliverVehiclePoint.rotation); base.syncedPosition = base.mainRigidbody.position; base.syncedRotation = base.mainRigidbody.rotation; } } else if ((Object)(object)base.itemShip == (Object)null) { base.inDropshipAnimation = false; base.mainRigidbody.isKinematic = true; base.mainRigidbody.MovePosition(StartOfRound.Instance.notSpawnedPosition.position + Vector3.forward * 30f); base.syncedPosition = base.mainRigidbody.position; base.syncedRotation = base.mainRigidbody.rotation; } } if (base.magnetedToShip) { base.mainRigidbody.isKinematic = true; base.syncedPosition = base.mainRigidbody.position; base.syncedRotation = base.mainRigidbody.rotation; base.mainRigidbody.MovePosition(Vector3.Lerp(base.magnetStartPosition, StartOfRound.Instance.elevatorTransform.position + base.magnetTargetPosition, base.magnetPositionCurve.Evaluate(base.magnetTime))); base.mainRigidbody.MoveRotation(Quaternion.Lerp(base.magnetStartRotation, base.magnetTargetRotation, base.magnetRotationCurve.Evaluate(base.magnetRotationTime))); base.averageVelocityAtMagnetStart = Vector3.Lerp(base.averageVelocityAtMagnetStart, Vector3.ClampMagnitude(base.averageVelocityAtMagnetStart, 4f), 4f * Time.fixedDeltaTime); if (!base.finishedMagneting) { base.magnetStartPosition += Vector3.ClampMagnitude(base.averageVelocityAtMagnetStart, 5f) * Time.fixedDeltaTime; } } else { if (!((NetworkBehaviour)this).IsOwner && !base.inDropshipAnimation) { base.mainRigidbody.isKinematic = true; Vector3 val = base.syncedPosition + base.averageVelocity * Time.fixedDeltaTime; Mathf.Clamp(base.syncSpeedMultiplier * Vector3.Distance(base.mainRigidbody.position, val), 1.3f, 300f); Vector3 val2 = Vector3.Lerp(base.mainRigidbody.position, val, Time.fixedDeltaTime * base.syncSpeedMultiplier); base.mainRigidbody.MovePosition(val2); base.mainRigidbody.MoveRotation(Quaternion.Lerp(base.mainRigidbody.rotation, base.syncedRotation, base.syncRotationSpeed)); } else if (((NetworkBehaviour)this).IsOwner && !base.inDropshipAnimation) { SyncCarPhysicsToOtherClients(); } if (((NetworkBehaviour)this).IsOwner && !base.carDestroyed && !StartOfRound.Instance.isObjectAttachedToMagnet && (Object)(object)StartOfRound.Instance.attachedVehicle == (Object)null && StartOfRound.Instance.magnetOn && Vector3.Distance(((Component)this).transform.position, StartOfRound.Instance.magnetPoint.position) < 12f) { if (!Physics.Linecast(((Component)this).transform.position, StartOfRound.Instance.magnetPoint.position, 256, (QueryTriggerInteraction)1)) { StartMagneting(); } return; } } if (base.averageCount > base.movingAverageLength) { base.averageVelocity += (base.mainRigidbody.velocity - base.averageVelocity) / (float)(base.movingAverageLength + 1); } else { base.averageCount++; base.averageVelocity += base.mainRigidbody.velocity; if (base.averageCount == base.movingAverageLength) { base.averageVelocity /= (float)base.averageCount; } } base.ragdollPhysicsBody.Move(((Component)this).transform.position, ((Component)this).transform.rotation); base.windwiperPhysicsBody1.Move(base.windwiper1.position, base.windwiper1.rotation); base.windwiperPhysicsBody2.Move(base.windwiper2.position, base.windwiper2.rotation); if (base.carDestroyed) { previousVehiclePosition = base.mainRigidbody.position; lastVelocity = base.mainRigidbody.velocity; return; } float num = steeringWheelCurve.Evaluate(Mathf.Abs(base.steeringWheelAnimFloat)) * 50f; base.FrontLeftWheel.steerAngle = num * Mathf.Sign(base.steeringWheelAnimFloat) * steeringDecay; base.FrontRightWheel.steerAngle = num * Mathf.Sign(base.steeringWheelAnimFloat) * steeringDecay; base.FrontLeftWheel.motorTorque = wheelTorque; base.FrontRightWheel.motorTorque = wheelTorque; base.BackLeftWheel.motorTorque = wheelTorque; base.BackRightWheel.motorTorque = wheelTorque; base.FrontLeftWheel.brakeTorque = wheelBrakeTorque; base.FrontRightWheel.brakeTorque = wheelBrakeTorque; base.BackLeftWheel.brakeTorque = wheelBrakeTorque; base.BackRightWheel.brakeTorque = wheelBrakeTorque; base.FrontLeftWheel.rotationSpeed = Mathf.Clamp(base.FrontLeftWheel.rotationSpeed, reverseWheelSpeed, forwardWheelSpeed); base.FrontRightWheel.rotationSpeed = Mathf.Clamp(base.FrontRightWheel.rotationSpeed, reverseWheelSpeed, forwardWheelSpeed); base.BackLeftWheel.rotationSpeed = Mathf.Clamp(base.BackLeftWheel.rotationSpeed, reverseWheelSpeed, forwardWheelSpeed); base.BackRightWheel.rotationSpeed = Mathf.Clamp(base.BackRightWheel.rotationSpeed, reverseWheelSpeed, forwardWheelSpeed); MatchWheelMeshToCollider(base.leftWheelMesh, leftBrakeMesh, base.FrontLeftWheel); MatchWheelMeshToCollider(base.rightWheelMesh, rightBrakeMesh, base.FrontRightWheel); MatchWheelMeshToCollider(base.backLeftWheelMesh, backLeftBrakeMesh, base.BackLeftWheel); MatchWheelMeshToCollider(base.backRightWheelMesh, backRightBrakeMesh, base.BackRightWheel); ((Component)leftBrakeMesh).transform.localEulerAngles = new Vector3(((Component)leftBrakeMesh).transform.localEulerAngles.x, base.FrontLeftWheel.steerAngle, 0f); ((Component)rightBrakeMesh).transform.localEulerAngles = new Vector3(((Component)rightBrakeMesh).transform.localEulerAngles.x, base.FrontRightWheel.steerAngle, 0f); ((Component)backLeftBrakeMesh).transform.localEulerAngles = new Vector3(((Component)backLeftBrakeMesh).transform.localEulerAngles.x, 0f, 0f); ((Component)backRightBrakeMesh).transform.localEulerAngles = new Vector3(((Component)backRightBrakeMesh).transform.localEulerAngles.x, 0f, 0f); allWheelsAirborne = !base.FrontLeftWheel.isGrounded && !base.FrontRightWheel.isGrounded && !base.BackLeftWheel.isGrounded && !base.BackRightWheel.isGrounded; if (!((NetworkBehaviour)this).IsOwner) { steeringDecay = 1f; wheelTorque = syncedMotorTorque; wheelBrakeTorque = syncedBrakeTorque; enginePower = 0f; inclineCompensation = 1f; throttleInput = 0f; brakeInput = 0f; clutchEngagement = 1f; clutchSlip = 0f; SetWheelStiffness(base.FrontLeftWheel, isSnow: false); SetWheelStiffness(base.FrontRightWheel, isSnow: false); SetWheelStiffness(base.BackLeftWheel, isSnow: false); SetWheelStiffness(base.BackRightWheel, isSnow: false); forwardWheelSpeed = 8000f; reverseWheelSpeed = -8000f; forwardsSlip = 0f; previousVehiclePosition = base.mainRigidbody.position; lastVelocity = base.mainRigidbody.velocity; return; } UpdateCarDrivetrain(); UpdateCarEngine(); SyncCarDrivetrainToOtherClients(); SyncCarWheelTorqueToOtherClients(); bool flag = base.FrontLeftWheel.isGrounded && base.FrontRightWheel.isGrounded; if (((Vector3)(ref base.averageVelocity)).magnitude < 28f || !flag) { steeringDecay = Mathf.MoveTowards(steeringDecay, 1f, 4f * Time.fixedDeltaTime); } else if (((Vector3)(ref base.averageVelocity)).magnitude > 28f && flag) { steeringDecay = Mathf.Lerp(1f, 0.65f, (((Vector3)(ref base.averageVelocity)).magnitude - 28f) / 50f); steeringDecay = Mathf.Max(steeringDecay, 0.65f); } if (base.mainRigidbody.IsSleeping() || base.magnetedToShip || allWheelsAirborne) { forwardsSlip = 0f; previousVehiclePosition = base.mainRigidbody.position; lastVelocity = base.mainRigidbody.velocity; return; } Vector3 val3 = Vector3.zero; int num2 = 0; WheelHit val4 = default(WheelHit); for (int i = 0; i < wheels.Count; i++) { if (wheels[i].GetGroundHit(ref val4)) { wheelHits[i] = val4; val3 += ((WheelHit)(ref val4)).normal; num2++; SetWheelStiffness(wheels[i], ((Component)((WheelHit)(ref val4)).collider).CompareTag("Snow")); } else { wheelHits[i] = default(WheelHit); } } ((Vector3)(ref val3)).Normalize(); Vector3 val5 = Vector3.ProjectOnPlane(((Component)this).transform.forward, val3); Vector3 normalized = ((Vector3)(ref val5)).normalized; Vector3 val6 = -val3; val5 = Physics.gravity; Vector3 val7 = val6 * ((Vector3)(ref val5)).magnitude; Vector3 val8 = val7 - Physics.gravity; if (handbrakeEngaged && num2 == 4 && Vector3.Angle(-val3, Physics.gravity) < 30f) { base.mainRigidbody.AddForce(val8, (ForceMode)5); } forwardsSlip = (((WheelHit)(ref wheelHits[2])).forwardSlip + ((WheelHit)(ref wheelHits[3])).forwardSlip) * 0.5f; previousVehiclePosition = base.mainRigidbody.position; lastVelocity = base.mainRigidbody.velocity; } public float NormaliseFloat(float num) { if (float.IsNaN(num) || float.IsInfinity(num) || float.IsNegativeInfinity(num) || float.IsPositiveInfinity(num)) { return 0f; } return num; } private void SetWheelStiffness(WheelCollider wheel, bool isSnow) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) WheelFrictionCurve forwardFriction = wheel.forwardFriction; WheelFrictionCurve sidewaysFriction = wheel.sidewaysFriction; ((WheelFrictionCurve)(ref forwardFriction)).stiffness = (isSnow ? 0.5f : baseForwardStiffness); ((WheelFrictionCurve)(ref sidewaysFriction)).stiffness = (isSnow ? 0.45f : baseSidewaysStiffness); wheel.forwardFriction = forwardFriction; wheel.sidewaysFriction = sidewaysFriction; } private void UpdateCarDrivetrain() { //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) bool localPlayerUsingController = StartOfRound.Instance.localPlayerUsingController; bool ignitionStarted = base.ignitionStarted; bool flag = base.drivePedalPressed && ignitionStarted; bool flag2 = !base.drivePedalPressed && ignitionStarted; float num = Mathf.Abs(gearRatios[currentGear]); float num2 = clutchEngagement * clutchFriction; float num3 = Mathf.Abs(wheelRPM) * num * diffRatio * num2; float num4 = Vector3.Angle(((Component)this).transform.forward, Vector3.ProjectOnPlane(((Component)this).transform.forward, Vector3.up)); float num5 = Vector3.Dot(((Component)this).transform.forward, Vector3.up); float num6 = Mathf.Clamp01(Mathf.Abs(base.EngineRPM - num3) / 800f); float num7 = Mathf.InverseLerp(500f, 0f, Mathf.Abs(wheelRPM)); float num8 = Mathf.Clamp01(num5) * num7 * num6; float num9 = Mathf.Lerp(1.25f, 0.5f, throttleInput); if (clutchPedalPressed) { clutchEngagement = NormaliseFloat(Mathf.MoveTowards(clutchEngagement, 0f, clutchSpeed * Time.fixedDeltaTime)); } else { clutchEngagement = NormaliseFloat(Mathf.MoveTowards(clutchEngagement, 1f, Mathf.Lerp(clutchReturnSpeed, minClutchReturnSpeed, num8) * num9 * Time.fixedDeltaTime)); } if (base.drivePedalPressed) { throttleInput = NormaliseFloat(Mathf.MoveTowards(throttleInput, 1f, Mathf.Lerp(throttleSpeed, maxThrottleSpeed, num8) * Time.fixedDeltaTime)); } else { throttleInput = NormaliseFloat(Mathf.MoveTowards(throttleInput, 0f, throttleReleaseSpeed * Time.fixedDeltaTime)); } float num10 = 0f; if (num5 > 0f) { num10 = Mathf.Clamp01(num4 / maxInclineCompensationAngle); } inclineCompensation = Mathf.Lerp(minInclineCompensation, maxInclineCompensation, num10 * num7); frontWheelRPM = NormaliseFloat((base.FrontLeftWheel.rpm + base.FrontRightWheel.rpm) / 2f); backWheelRPM = NormaliseFloat((base.BackLeftWheel.rpm + base.BackRightWheel.rpm) / 2f); wheelRPM = NormaliseFloat((frontWheelRPM + backWheelRPM) / 2f); if (handbrakeEngaged) { wheelBrakeTorque = Mathf.MoveTowards(wheelBrakeTorque, maxBrakingPower, base.brakeSpeed * Time.fixedDeltaTime); } else if (base.brakePedalPressed) { wheelBrakeTorque = Mathf.MoveTowards(wheelBrakeTorque, maxBrakingPower * brakeInput, base.brakeSpeed * Time.fixedDeltaTime); } else if (!base.brakePedalPressed && brakeInput == 0f) { wheelBrakeTorque = 0f; } if (!base.ignitionStarted || inNeutral || clutchEngagement == 0f) { wheelTorque = 0f; if (!inNeutral && !base.ignitionStarted) { wheelBrakeTorque = maxBrakingPower; } forwardWheelSpeed = 8000f; reverseWheelSpeed = -8000f; return; } if (inReverse) { if (flag) { wheelTorque = (0f - engineReversePower) * num2; } else if (flag2) { wheelTorque = base.idleSpeed * -1f * num2; } forwardWheelSpeed = base.MaxEngineRPM / (gearRatios[Mathf.Clamp(0, gearRatios.Length - 1, 1)] * diffRatio) * 6f; reverseWheelSpeed = base.MaxEngineRPM / (gearRatios[0] * diffRatio) * 6f; return; } if (flag) { wheelTorque = enginePower * inclineCompensation * num2; } else if (flag2) { wheelTorque = base.idleSpeed * num2; } if (currentGear < 1) { currentGear = 1; } forwardWheelSpeed = base.MaxEngineRPM / (gearRatios[Mathf.Clamp(currentGear, 1, gearRatios.Length - 1)] * diffRatio) * 6f; reverseWheelSpeed = base.MaxEngineRPM / (gearRatios[0] * diffRatio) * 6f; } public void SyncCarWheelTorqueToOtherClients() { if (syncWheelTorqueInterval >= 0.14f) { float num = Mathf.Round(wheelTorque); float num2 = Mathf.Round(wheelBrakeTorque); if (syncedMotorTorque != num || syncedBrakeTorque != num2) { syncWheelTorqueInterval = 0f; syncedMotorTorque = wheelTorque; syncedBrakeTorque = wheelBrakeTorque; SyncWheelTorqueRpc(wheelTorque, wheelBrakeTorque); } } else { syncWheelTorqueInterval += Time.fixedDeltaTime; } } [Rpc(/*Could not decode attribute arguments.*/)] public void SyncWheelTorqueRpc(float motorTorque, float brakeTorque) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(3563070839u, val2, val, (SendTo)1, (RpcDelivery)0); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref motorTorque, default(ForPrimitives)); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref brakeTorque, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val3, 3563070839u, val2, val, (SendTo)1, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; syncedMotorTorque = motorTorque; syncedBrakeTorque = brakeTorque; } } } public void SyncCarDrivetrainToOtherClients() { float num = 0.15f * ((Vector3)(ref base.averageVelocity)).magnitude; num = Mathf.Clamp(num, 0.15f, 0.21f); if (syncCarDrivetrainInterval >= num) { float num2 = NormaliseFloat(Mathf.Round(base.EngineRPM)); float num3 = NormaliseFloat(Mathf.Round(wheelRPM)); float num4 = NormaliseFloat(Mathf.Round(frontWheelRPM)); float num5 = NormaliseFloat(Mathf.Round(backWheelRPM)); if (syncedWheelRPM != num3 || syncedEngineRPM != num2) { syncCarDrivetrainInterval = 0f; syncedFrontWheelRPM = num4; syncedBackWheelRPM = num5; syncedWheelRPM = num3; syncedEngineRPM = num2; SyncCarDrivetrainRpc(frontWheelRPM, backWheelRPM, wheelRPM, syncedEngineRPM); } } else { syncCarDrivetrainInterval += Time.fixedDeltaTime; } } [Rpc(/*Could not decode attribute arguments.*/)] public void SyncCarDrivetrainRpc(float frontWheelSpeed, float backWheelSpeed, float wheelSpeed, float engineSpeed) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(2253232283u, val2, val, (SendTo)1, (RpcDelivery)0); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref frontWheelSpeed, default(ForPrimitives)); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref backWheelSpeed, default(ForPrimitives)); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref wheelSpeed, default(ForPrimitives)); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref engineSpeed, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val3, 2253232283u, val2, val, (SendTo)1, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; syncedFrontWheelRPM = frontWheelSpeed; syncedBackWheelRPM = backWheelSpeed; syncedWheelRPM = wheelSpeed; syncedEngineRPM = engineSpeed; } } } private void UpdateCarEngine() { if (base.carDestroyed) { return; } if (!base.ignitionStarted) { enginePower = 0f; stallTimer = 0f; return; } float num = Mathf.Abs(gearRatios[currentGear]); float num2 = Mathf.Abs(backWheelRPM) * num * diffRatio; enginePower = enginePowerCurve.Evaluate(base.EngineRPM / base.MaxEngineRPM) * base.EngineTorque * (num * diffRatio); if (inNeutral || clutchEngagement == 0f) { stallTimer = 0f; base.EngineRPM = Mathf.Lerp(base.EngineRPM, base.drivePedalPressed ? base.MaxEngineRPM : base.MinEngineRPM, base.drivePedalPressed ? (2f * Time.fixedDeltaTime) : (1.8f * Time.fixedDeltaTime)); return; } float num3 = Mathf.Pow(clutchEngagement, 2f); float num4 = Mathf.Lerp(base.MinEngineRPM, base.MaxEngineRPM, throttleInput); float num5 = Mathf.Lerp(num4, num2, num3); float num6 = Mathf.Lerp(2f, 3.5f, num3); base.EngineRPM = Mathf.Lerp(base.EngineRPM, num5, num6 * Time.fixedDeltaTime); base.EngineRPM = Mathf.Clamp(base.EngineRPM, 0f, base.MaxEngineRPM); clutchSlip = Mathf.Abs(base.EngineRPM - num2); bool flag = base.EngineRPM <= base.MinEngineRPM - 150f; bool flag2 = !clutchPedalPressed && clutchEngagement >= 0.25f && base.drivePedalPressed && base.EngineRPM <= base.MinEngineRPM + 300f && !flag; if (flag || flag2) { stallTimer += Time.fixedDeltaTime; if (stallTimer > (flag ? 0.01f : 0.25f) && !engineStalled) { StallEngineRpc(); engineStalled = true; stallTimer = 0f; StallEngine(); } } else { stallTimer = 0f; } } public void StallEngine() { if (base.keyIgnitionCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(base.keyIgnitionCoroutine); base.keyIgnitionCoroutine = null; } disableAnimations = true; engineAudio3.volume = 0.775f; engineAudio3.PlayOneShot(stallEngine); ignitionAnimator.SetInteger("SAIgnition_Anim", 7); base.chanceToStartIgnition = 101f; SetFrontCabinLightOn(setOn: true); base.carEngine1AudioActive = false; base.ignitionStarted = false; usingSwitchIgnition = false; base.carExhaustParticle.Stop(true, (ParticleSystemStopBehavior)1); PlayerControllerB currentDriver = base.currentDriver; if (currentDriver != null) { currentDriver.playerBodyAnimator.SetInteger("SA_CarAnim", 1); } TrySetCarIgnitionTriggers(); } [Rpc(/*Could not decode attribute arguments.*/)] public void StallEngineRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(2229834372u, val2, val, (SendTo)1, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendRpc(ref val3, 2229834372u, val2, val, (SendTo)1, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; engineStalled = true; stallTimer = 0f; StallEngine(); } } } public void SyncCarEffectsToOtherClients() { if (syncCarEffectsInterval > 0.045f) { if (syncedWheelRotation != base.steeringWheelAnimFloat) { syncCarEffectsInterval = 0f; syncedWheelRotation = base.steeringWheelAnimFloat; SyncCarEffectsRpc(base.steeringWheelAnimFloat, smoothRotation); } } else { syncCarEffectsInterval += Time.deltaTime; } } [Rpc(/*Could not decode attribute arguments.*/)] public void SyncCarEffectsRpc(float wheelRotation, bool smoothRot) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(1154936118u, val2, val, (SendTo)1, (RpcDelivery)0); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref wheelRotation, default(ForPrimitives)); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref smoothRot, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val3, 1154936118u, val2, val, (SendTo)1, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; syncedWheelRotation = wheelRotation; smoothRotation = smoothRot; } } } [Rpc(/*Could not decode attribute arguments.*/)] public void SyncPlayerInputsRpc(Vector2 playerInput, bool gasPressed, bool brakePressed, bool clutchPressed) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(1252950827u, val2, val, (SendTo)1, (RpcDelivery)0); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref playerInput); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref gasPressed, default(ForPrimitives)); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref brakePressed, default(ForPrimitives)); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref clutchPressed, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val3, 1252950827u, val2, val, (SendTo)1, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; syncedMoveInputVector = playerInput; syncedDrivePedalPressed = gasPressed; syncedBrakePedalPressed = brakePressed; syncedClutchPedalPressed = clutchPressed; } } } private void SyncCarPhysicsToOtherClients() { //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) base.mainRigidbody.isKinematic = false; float num = 0.12f * (((Vector3)(ref base.averageVelocity)).magnitude / 200f); num = Mathf.Clamp(num, 0.01f, 0.2f); if (base.syncCarPositionInterval >= num) { if (Vector3.Distance(base.syncedPosition, ((Component)this).transform.position) > 0.014f) { base.syncCarPositionInterval = 0f; base.syncedPosition = ((Component)this).transform.position; base.syncedRotation = ((Component)this).transform.rotation; SyncCarPositionRpc(((Component)this).transform.position, ((Component)this).transform.eulerAngles); } else if (Vector3.Angle(((Component)this).transform.forward, base.syncedRotation * Vector3.forward) > 2f) { base.syncCarPositionInterval = 0f; base.syncedPosition = ((Component)this).transform.position; base.syncedRotation = ((Component)this).transform.rotation; SyncCarPositionRpc(((Component)this).transform.position, ((Component)this).transform.eulerAngles); } } else { base.syncCarPositionInterval += Time.fixedDeltaTime; } } [Rpc(/*Could not decode attribute arguments.*/)] public void SyncCarPositionRpc(Vector3 carPosition, Vector3 carRotation) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(3777613204u, val2, val, (SendTo)1, (RpcDelivery)0); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref carPosition); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref carRotation); ((NetworkBehaviour)this).__endSendRpc(ref val3, 3777613204u, val2, val, (SendTo)1, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; base.syncedPosition = carPosition; base.syncedRotation = Quaternion.Euler(carRotation); } } } [Rpc(/*Could not decode attribute arguments.*/)] public void SetTyreStressRpc(float stress, bool wheelSkidding) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(3195815204u, val2, val, (SendTo)1, (RpcDelivery)0); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref stress, default(ForPrimitives)); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref wheelSkidding, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val3, 3195815204u, val2, val, (SendTo)1, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; tyreStress = stress; wheelSlipping = wheelSkidding; } } } public void UpdateScanNodeText() { if (base.carDestroyed) { scanNode.headerText = "Destroyed Truck"; scanNode.subText = "Your once trusty mule.."; } else if (GameNetworkManager.Instance.connectedPlayers == 1) { scanNode.subText = "Your only trusty mule.."; } else { scanNode.subText = "Your trusty mule!"; } } public void LateUpdate() { UpdateScanNodeText(); if (!base.carDestroyed) { SetDashboardSymbols(); if (base.localPlayerInControl && !base.setControlTips) { base.setControlTips = true; HUDManager.Instance.ChangeControlTipMultiple(base.carTooltips, false, (Item)null); } else if (!base.localPlayerInControl && base.setControlTips) { base.setControlTips = false; } bool flag = base.magnetedToShip && (StartOfRound.Instance.inShipPhase || !StartOfRound.Instance.shipDoorsEnabled); if (flag && (windshieldShattered || base.windshieldBroken)) { RegenerateWindshield(); } base.hornAudio.mute = flag; base.engineAudio1.mute = flag; base.engineAudio2.mute = flag; carKeySounds.mute = flag; cabinLightSwitchAudio.mute = flag; heaterAudio.mute = flag; voiceModule.voiceAudio.mute = flag; wiperAudio.mute = flag; base.rollingAudio.mute = flag; base.skiddingAudio.mute = flag; base.turbulenceAudio.mute = flag; base.hoodFireAudio.mute = flag; base.extremeStressAudio.mute = flag; base.pushAudio.mute = flag; bool flag2 = voiceModule.audioIsPlaying || voiceModule.voiceAudio.isPlaying || (Object)(object)voiceModule.voiceAudio.clip != (Object)null || (voiceModule.isPlayingIgnitionChime && !voiceModule.hasAlertedOnEngineStart); base.radioAudio.mute = flag || flag2; base.radioInterference.mute = flag || flag2; if ((Object)(object)base.currentDriver != (Object)null && (Object)(object)References.lastDriver != (Object)(object)base.currentDriver && !base.magnetedToShip) { References.lastDriver = base.currentDriver; } if (base.honkingHorn && base.hornAudio.isPlaying && base.hornAudio.pitch < 1f) { base.hornAudio.Stop(); } voiceModule.DoEVACycle(); } } public void AddExtraWeightToCar() { if (References.itemsInTruck == null || (float)References.itemsInTruck.Count <= 10f) { extraWeight = 0f; } else { extraWeight = 0f; } } public void SetDashboardSymbols() { if (!base.keyIsInIgnition) { SetSymbolActive(dippedBeamLightSymbol, dippedBeamLight, active: false); SetSymbolActive(highBeamLightSymbol, highBeamLight, active: false); SetSymbolActive(parkingBrakeSymbol, parkingBrakeLight, active: false); SetSymbolActive(oilLevelLightSymbol, oilLevelLight, active: false); SetSymbolActive(batteryLightSymbol, batteryLight, active: false); SetSymbolActive(coolantLevelLightSymbol, coolantLevelLight, active: false); SetSymbolActive(alertLightSymbol, alertLight, active: false); SetSymbolActive(checkEngineLightSymbol, checkEngineLight, active: false); } else if (hasSweepedDashboard) { SetSymbolActive(dippedBeamLightSymbol, dippedBeamLight, currentSweepStage > 1 && lowBeamsOn); SetSymbolActive(highBeamLightSymbol, highBeamLight, currentSweepStage > 1 && highBeamsOn); SetSymbolActive(parkingBrakeSymbol, parkingBrakeLight, currentSweepStage > 2 && handbrakeEngaged); SetSymbolActive(oilLevelLightSymbol, oilLevelLight, currentSweepStage > 3 && base.carHP <= 25); SetSymbolActive(batteryLightSymbol, batteryLight, currentSweepStage > 3 && (!base.ignitionStarted || base.carHP <= 22)); SetSymbolActive(coolantLevelLightSymbol, coolantLevelLight, currentSweepStage > 3 && base.carHP <= 30); SetSymbolActive(alertLightSymbol, alertLight, currentSweepStage > 3 && base.carHP <= 16); SetSymbolActive(checkEngineLightSymbol, checkEngineLight, currentSweepStage > 3 && base.carHP <= 38); } } public void SetSymbolActive(SpriteRenderer symbol, Light symbolLight, bool active) { if (!((Object)(object)symbol == (Object)null) && ((Renderer)symbol).enabled != active) { ((Renderer)symbol).enabled = active; if ((Object)(object)symbolLight != (Object)null) { ((Behaviour)symbolLight).enabled = active; } } } public bool CarReactToObstacle(Vector3 vel, Vector3 position, Vector3 impulse, CarObstacleType type, float obstacleSize = 1f, EnemyAI enemyScript = null, bool dealDamage = true) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Expected I4, but got Unknown //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_01b1: Unknown result type (might be due to invalid IL or missing references) //IL_01c1: Unknown result type (might be due to invalid IL or missing references) //IL_01c6: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_01d3: Unknown result type (might be due to invalid IL or missing references) //IL_01de: Unknown result type (might be due to invalid IL or missing references) //IL_01e3: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0374: Unknown result type (might be due to invalid IL or missing references) //IL_0375: Unknown result type (might be due to invalid IL or missing references) //IL_037f: Unknown result type (might be due to invalid IL or missing references) //IL_0384: Unknown result type (might be due to invalid IL or missing references) //IL_0395: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_026a: Unknown result type (might be due to invalid IL or missing references) //IL_027b: Unknown result type (might be due to invalid IL or missing references) //IL_027c: Unknown result type (might be due to invalid IL or missing references) //IL_0286: Unknown result type (might be due to invalid IL or missing references) //IL_028b: Unknown result type (might be due to invalid IL or missing references) //IL_0295: Unknown result type (might be due to invalid IL or missing references) //IL_021c: Unknown result type (might be due to invalid IL or missing references) //IL_021d: Unknown result type (might be due to invalid IL or missing references) //IL_0227: Unknown result type (might be due to invalid IL or missing references) //IL_022c: Unknown result type (might be due to invalid IL or missing references) //IL_0236: Unknown result type (might be due to invalid IL or missing references) //IL_041e: Unknown result type (might be due to invalid IL or missing references) //IL_03b7: Unknown result type (might be due to invalid IL or missing references) //IL_0433: Unknown result type (might be due to invalid IL or missing references) //IL_0316: Unknown result type (might be due to invalid IL or missing references) //IL_035e: Unknown result type (might be due to invalid IL or missing references) switch ((int)type) { case 2: if (base.carHP < 10) { base.mainRigidbody.AddForceAtPosition(Vector3.up * base.torqueForce + vel, position, (ForceMode)1); } else { base.mainRigidbody.AddForceAtPosition((Vector3.up * base.torqueForce + vel) * 0.5f, position, (ForceMode)1); } CarBumpLocalClient(base.averageVelocity * 0.7f); if (dealDamage) { DealPermanentDamage(1, position); } return true; case 0: PlayCollisionAudio(position, 5, Mathf.Clamp(((Vector3)(ref vel)).magnitude / 7f, 0.65f, 1f)); if (((Vector3)(ref vel)).magnitude < 4.25f) { base.mainRigidbody.velocity = Vector3.Normalize(-impulse * 100000000f) * 9f; DealPermanentDamage(1); return true; } base.mainRigidbody.AddForceAtPosition(Vector3.up * base.torqueForce, position, (ForceMode)2); return false; case 1: { float num; if (obstacleSize <= 1f) { num = 1f; _ = base.carReactToPlayerHitMultiplier; } else if (obstacleSize <= 2f) { num = 9f; _ = base.carReactToPlayerHitMultiplier; } else { num = 15f; _ = base.carReactToPlayerHitMultiplier; } vel = Vector3.Scale(vel, new Vector3(1f, 0f, 1f)); base.mainRigidbody.AddForceAtPosition(Vector3.up * base.torqueForce, position, (ForceMode)2); bool result = false; if (((Vector3)(ref vel)).magnitude < num) { if (obstacleSize <= 1f) { base.mainRigidbody.AddForce(Vector3.Normalize(-impulse * 1E+09f) * 4f, (ForceMode)1); if (((Vector3)(ref vel)).magnitude > 1f) { enemyScript.KillEnemyOnOwnerClient(false); } } else { CarBumpLocalClient(base.averageVelocity); base.mainRigidbody.velocity = Vector3.Normalize(-impulse * 100000000f) * 9f; PlayerControllerB val = (PlayerControllerB)(((Object)(object)base.currentDriver != (Object)null) ? base.currentDriver : (((Object)(object)currentMiddlePassenger != (Object)null) ? ((object)currentMiddlePassenger) : ((object)((!((Object)(object)base.currentPassenger != (Object)null)) ? null : base.currentPassenger)))); if (((Vector3)(ref vel)).magnitude > 2f && dealDamage) { enemyScript.HitEnemyOnLocalClient(2, Vector3.zero, val, true, 331); } result = true; if ((isSpecial && obstacleSize > 1f) || (!isSpecial && obstacleSize > 2f)) { DealPermanentDamage(1, position); } } } else { base.mainRigidbody.AddForce(Vector3.Normalize(-impulse * 1E+09f) * (base.carReactToPlayerHitMultiplier - 220f), (ForceMode)1); if (dealDamage) { DealPermanentDamage(isSpecial ? 1 : 2, position); } PlayerControllerB val2 = (PlayerControllerB)(((Object)(object)base.currentDriver != (Object)null) ? base.currentDriver : (((Object)(object)currentMiddlePassenger != (Object)null) ? ((object)currentMiddlePassenger) : ((object)((!((Object)(object)base.currentPassenger != (Object)null)) ? null : base.currentPassenger)))); enemyScript.HitEnemyOnLocalClient(20, Vector3.zero, val2, false, 331); } PlayCollisionAudio(position, 5, 1f); return result; } default: return false; } } public void OnCollisionEnter(Collision collision) { //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_033e: Unknown result type (might be due to invalid IL or missing references) //IL_02b9: Unknown result type (might be due to invalid IL or missing references) //IL_03d6: Unknown result type (might be due to invalid IL or missing references) //IL_04c0: Unknown result type (might be due to invalid IL or missing references) //IL_04c5: Unknown result type (might be due to invalid IL or missing references) //IL_04cf: Unknown result type (might be due to invalid IL or missing references) //IL_0426: Unknown result type (might be due to invalid IL or missing references) //IL_042b: Unknown result type (might be due to invalid IL or missing references) //IL_0435: Unknown result type (might be due to invalid IL or missing references) //IL_048e: Unknown result type (might be due to invalid IL or missing references) //IL_0493: Unknown result type (might be due to invalid IL or missing references) //IL_049d: Unknown result type (might be due to invalid IL or missing references) //IL_04ad: Unknown result type (might be due to invalid IL or missing references) //IL_04b3: Unknown result type (might be due to invalid IL or missing references) if (!((NetworkBehaviour)this).IsOwner || base.magnetedToShip || !base.hasBeenSpawned || ((Component)collision.collider).gameObject.layer != 8 || Time.realtimeSinceStartup - timeSinceLastCollision < 0.05f || Time.realtimeSinceStartup - timeSinceUntethered < 4f) { return; } timeSinceLastCollision = Time.realtimeSinceStartup; float magnitude = ((Vector3)(ref lastVelocity)).magnitude; Vector3 damagePosition = base.mainRigidbody.velocity; float num = Mathf.Abs(magnitude - ((Vector3)(ref damagePosition)).magnitude); float num2 = 0f; int contacts = collision.GetContacts(base.contacts); Vector3 val = Vector3.zero; for (int i = 0; i < contacts; i++) { damagePosition = ((ContactPoint)(ref base.contacts[i])).impulse; if (((Vector3)(ref damagePosition)).magnitude > num2) { damagePosition = ((ContactPoint)(ref base.contacts[i])).impulse; num2 = ((Vector3)(ref damagePosition)).magnitude; } val += ((ContactPoint)(ref base.contacts[i])).point; } val /= (float)contacts; num2 /= Time.fixedDeltaTime; if (num2 < base.minimalBumpForce || ((Vector3)(ref base.averageVelocity)).magnitude < 4f) { if (num2 > 3f && ((Vector3)(ref base.averageVelocity)).magnitude > 2.5f) { SetInternalStress(0.2f); base.lastStressType = "Scraping"; } return; } float setVolume = 0.5f; int num3 = -1; if (num >= 9f && ((Vector3)(ref lastVelocity)).magnitude > 31f) { if (base.carHP < 3) { DestroyCar(); DestroyCarRpc(); return; } num3 = 2; setVolume = Mathf.Clamp((num2 - base.maximumBumpForce) / 20000f, 0.8f, 1f); setVolume = Mathf.Clamp(setVolume + Random.Range(-0.15f, 0.25f), 0.7f, 1f); if (!windshieldShattered) { ShatterWindshield(); ShatterWindshieldRpc(); } else if (windshieldShattered && !base.windshieldBroken) { BreakWindshield(); BreakWindshieldRpc(); } DamageVehicle(Random.Range(40, 60), collision.relativeVelocity, base.carHP - 2); } if (num2 > base.maximumBumpForce && ((Vector3)(ref lastVelocity)).magnitude >= 11f) { num3 = 2; setVolume = Mathf.Clamp((num2 - base.maximumBumpForce) / 20000f, 0.8f, 1f); setVolume = Mathf.Clamp(setVolume + Random.Range(-0.15f, 0.25f), 0.7f, 1f); DamageVehicle(num, collision.relativeVelocity); } else if (num2 > base.mediumBumpForce && ((Vector3)(ref lastVelocity)).magnitude >= 3f) { num3 = 1; setVolume = Mathf.Clamp((num2 - base.mediumBumpForce) / (base.maximumBumpForce - base.mediumBumpForce), 0.67f, 1f); setVolume = Mathf.Clamp(setVolume + Random.Range(-0.15f, 0.25f), 0.5f, 1f); } if (num3 == -1) { return; } PlayCollisionAudio(val, num3, setVolume); if (num2 > base.maximumBumpForce + 10000f && ((Vector3)(ref lastVelocity)).magnitude > 18f && num >= 8.5f) { DamagePlayerInVehicle(Vector3.ClampMagnitude(-collision.relativeVelocity, 60f), num); if (!windshieldShattered) { ShatterWindshield(); ShatterWindshieldRpc(); } else if (windshieldShattered && !base.windshieldBroken) { BreakWindshield(); BreakWindshieldRpc(); } CarCollisionRpc(Vector3.ClampMagnitude(-collision.relativeVelocity, 60f), num); damagePosition = default(Vector3); DealPermanentDamage(2, damagePosition); } else { CarBumpLocalClient(Vector3.ClampMagnitude(-collision.relativeVelocity, 40f)); } } public void DamageVehicle(float diff, Vector3 collision, int damageAmount = 2) { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) if (diff >= 7f && diff < 12f) { DamagePlayerInVehicle(Vector3.ClampMagnitude(-collision, 60f), diff); CarCollisionRpc(Vector3.ClampMagnitude(-collision, 60f), diff); if (damageAmount != 0) { DealPermanentDamage(damageAmount); } } else if (diff > 4f && diff < 7f) { DamagePlayerInVehicle(Vector3.ClampMagnitude(-collision, 60f), diff / 2f); CarCollisionRpc(Vector3.ClampMagnitude(-collision, 60f), diff / 2f); if (damageAmount != 0) { DealPermanentDamage(damageAmount); } } } public void CarBumpLocalClient(Vector3 vel) { //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) if (!base.localPlayerInControl && !localPlayerInMiddlePassengerSeat && !base.localPlayerInPassengerSeat && VehicleUtils.IsPlayerInVehicleBounds()) { if (PlayerUtils.isPlayerInCab) { vel = Vector3.ClampMagnitude(vel, 5f); } else if (PlayerUtils.isPlayerInStorage) { vel = Vector3.ClampMagnitude(vel, 30f); } PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController; localPlayerController.externalForceAutoFade += vel; CarBumpRpc(vel); } } [Rpc(/*Could not decode attribute arguments.*/)] public void CarBumpRpc(Vector3 vel) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(3911754106u, val2, val, (SendTo)1, (RpcDelivery)0); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref vel); ((NetworkBehaviour)this).__endSendRpc(ref val3, 3911754106u, val2, val, (SendTo)1, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (!base.localPlayerInControl && !localPlayerInMiddlePassengerSeat && !base.localPlayerInPassengerSeat && VehicleUtils.IsPlayerInVehicleBounds()) { if (PlayerUtils.isPlayerInCab) { vel = Vector3.ClampMagnitude(vel, 5f); } else if (PlayerUtils.isPlayerInStorage) { vel = Vector3.ClampMagnitude(vel, 30f); } PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController; localPlayerController.externalForceAutoFade += vel; } } [Rpc(/*Could not decode attribute arguments.*/)] public void CarCollisionRpc(Vector3 vel, float magn) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(1897686969u, val2, val, (SendTo)1, (RpcDelivery)0); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref vel); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref magn, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val3, 1897686969u, val2, val, (SendTo)1, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; DamagePlayerInVehicle(vel, magn); } } } private void DamagePlayerInVehicle(Vector3 vel, float magnitude) { //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0190: Unknown result type (might be due to invalid IL or missing references) //IL_015b: Unknown result type (might be due to invalid IL or missing references) //IL_0166: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Unknown result type (might be due to invalid IL or missing references) if (!base.localPlayerInPassengerSeat && !localPlayerInMiddlePassengerSeat && !base.localPlayerInControl) { if (VehicleUtils.IsPlayerInVehicleBounds()) { if (GameNetworkManager.Instance.localPlayerController.health < 15) { GameNetworkManager.Instance.localPlayerController.KillPlayer(vel, true, (CauseOfDeath)16, 0, ((Component)this).transform.up * 0.77f, false); return; } HUDManager.Instance.ShakeCamera((ScreenShakeType)0); GameNetworkManager.Instance.localPlayerController.DamagePlayer(5, true, true, (CauseOfDeath)16, 0, false, vel); PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController; localPlayerController.externalForceAutoFade += vel; } } else if (magnitude > 28f) { GameNetworkManager.Instance.localPlayerController.DamagePlayer((int)((Vector3)(ref vel)).magnitude, true, true, (CauseOfDeath)16, 0, false, vel); } else if (magnitude <= 24f) { HUDManager.Instance.ShakeCamera((ScreenShakeType)1); GameNetworkManager.Instance.localPlayerController.DamagePlayer(5, true, true, (CauseOfDeath)16, 0, false, vel); } else { HUDManager.Instance.ShakeCamera((ScreenShakeType)3); if (GameNetworkManager.Instance.localPlayerController.health < 10) { GameNetworkManager.Instance.localPlayerController.KillPlayer(vel, true, (CauseOfDeath)16, 0, ((Component)this).transform.up * 0.77f, false); } else { GameNetworkManager.Instance.localPlayerController.DamagePlayer(10, true, true, (CauseOfDeath)16, 0, false, vel); } } } [Rpc(/*Could not decode attribute arguments.*/)] public void ShatterWindshieldRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(1190235238u, val2, val, (SendTo)5, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendRpc(ref val3, 1190235238u, val2, val, (SendTo)5, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; ShatterWindshield(); } } } public void ShatterWindshield() { if (!windshieldShattered) { base.windshieldBroken = false; windshieldShattered = true; Material[] sharedMaterials = ((Renderer)windshieldMesh).sharedMaterials; sharedMaterials[0] = base.windshieldBrokenMat; ((Renderer)windshieldMesh).sharedMaterials = sharedMaterials; } } [Rpc(/*Could not decode attribute arguments.*/)] public void BreakWindshieldRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(934350138u, val2, val, (SendTo)5, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendRpc(ref val3, 934350138u, val2, val, (SendTo)5, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; BreakWindshield(); } } } public void BreakWindshield() { //IL_004a: Unknown result type (might be due to invalid IL or missing references) if (!base.windshieldBroken) { base.windshieldBroken = true; windshieldShattered = true; windshieldObject.SetActive(false); base.glassParticle.Play(); ((Component)base.miscAudio).transform.localPosition = windshieldObject.transform.localPosition; base.miscAudio.PlayOneShot(base.windshieldBreak); } } private void RegenerateWindshield() { base.windshieldBroken = false; windshieldShattered = false; windshieldObject.SetActive(true); Material[] sharedMaterials = ((Renderer)windshieldMesh).sharedMaterials; sharedMaterials[0] = windshieldMat; ((Renderer)windshieldMesh).sharedMaterials = sharedMaterials; } public void PlayCollisionAudio(Vector3 setPosition, int audioType, float setVolume) { //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) if (Time.realtimeSinceStartup - base.audio1Time > Time.realtimeSinceStartup - base.audio2Time) { bool flag = Time.realtimeSinceStartup - base.audio1Time >= base.collisionAudio1.clip.length * 0.8f; if (base.audio1Type <= audioType || flag) { base.audio1Time = Time.realtimeSinceStartup; base.audio1Type = audioType; ((Component)base.collisionAudio1).transform.position = setPosition; PlayRandomClipAndPropertiesFromAudio(base.collisionAudio1, setVolume, flag, audioType); CarCollisionSFXRpc(((Component)base.collisionAudio1).transform.localPosition, 0, audioType, setVolume); } } else { bool flag2 = Time.realtimeSinceStartup - base.audio2Time >= base.collisionAudio2.clip.length * 0.8f; if (base.audio1Type <= audioType || flag2) { base.audio2Time = Time.realtimeSinceStartup; base.audio2Type = audioType; ((Component)base.collisionAudio2).transform.position = setPosition; PlayRandomClipAndPropertiesFromAudio(base.collisionAudio2, setVolume, flag2, audioType); CarCollisionSFXRpc(((Component)base.collisionAudio2).transform.localPosition, 1, audioType, setVolume); } } } [Rpc(/*Could not decode attribute arguments.*/)] public void CarCollisionSFXRpc(Vector3 audioPosition, int audio, int audioType, float vol) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(2311967180u, val2, val, (SendTo)1, (RpcDelivery)0); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref audioPosition); BytePacker.WriteValueBitPacked(val3, audio); BytePacker.WriteValueBitPacked(val3, audioType); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref vol, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val3, 2311967180u, val2, val, (SendTo)1, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; AudioSource val4 = ((audio != 0) ? base.collisionAudio2 : base.collisionAudio1); bool audioFinished = val4.clip.length - val4.time < 0.2f; ((Component)val4).transform.localPosition = audioPosition; PlayRandomClipAndPropertiesFromAudio(val4, vol, audioFinished, audioType); } } } private void PlayRandomClipAndPropertiesFromAudio(AudioSource audio, float setVolume, bool audioFinished, int audioType) { //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_01ab: Unknown result type (might be due to invalid IL or missing references) if (!audioFinished) { audio.Stop(); } AudioClip[] array; switch (audioType) { case 0: array = base.minCollisions; base.turbulenceAmount = Mathf.Min(base.turbulenceAmount + 0.4f, 2f); break; case 1: array = base.medCollisions; base.turbulenceAmount = Mathf.Min(base.turbulenceAmount + 0.75f, 2f); break; case 2: array = base.maxCollisions; base.turbulenceAmount = Mathf.Min(base.turbulenceAmount + 1.4f, 2f); break; default: array = base.obstacleCollisions; base.turbulenceAmount = Mathf.Min(base.turbulenceAmount + 0.75f, 2f); break; } AudioClip val = array[Random.Range(0, array.Length)]; if ((Object)(object)val == (Object)(object)audio.clip && Random.Range(0, 10) <= 5) { val = array[Random.Range(0, array.Length)]; } if (audioFinished) { audio.pitch = Random.Range(0.8f, 1.2f); } audio.clip = val; audio.PlayOneShot(val, setVolume); if (base.ignitionStarted) { if (audioType >= 2) { RoundManager.Instance.PlayAudibleNoise(((Component)base.engineAudio1).transform.position, 18f + setVolume / 1f * 7f, 0.6f, 0, false, 2692); } else if (audioType >= 1) { RoundManager.Instance.PlayAudibleNoise(((Component)base.engineAudio1).transform.position, 12f + setVolume / 1f * 7f, 0.6f, 0, false, 2692); } } if (audioType == -1) { array = base.minCollisions; val = array[Random.Range(0, array.Length)]; audio.PlayOneShot(val); } } private void SetInternalStress(float carStressIncrease = 0f) { //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) if (!StartOfRound.Instance.inShipPhase && !base.magnetedToShip && !base.carDestroyed && ((NetworkBehaviour)this).IsOwner) { if (carStressIncrease <= 0f) { base.carStressChange = Mathf.Clamp(base.carStressChange - Time.deltaTime, -0.25f, 0.5f); } else { base.carStressChange = Mathf.Clamp(base.carStressChange + Time.deltaTime * carStressIncrease, 0f, 10f); } base.underExtremeStress = carStressIncrease >= 1f; base.carStress = Mathf.Clamp(base.carStress + base.carStressChange, 0f, 100f); if (base.carStress > 7f) { base.carStress = 0f; DealPermanentDamage(2); base.lastDamageType = "Stress"; } } } public void DealPermanentDamage(int damageAmount, Vector3 damagePosition = default(Vector3)) { if (!StartOfRound.Instance.inShipPhase && !base.magnetedToShip && !base.carDestroyed && ((NetworkBehaviour)this).IsOwner) { base.timeAtLastDamage = Time.realtimeSinceStartup; base.carHP -= damageAmount; syncedCarHP = base.carHP; if (base.carHP <= 0) { DestroyCar(); DestroyCarRpc(); } else { DealDamageRpc(base.carHP); } } } [Rpc(/*Could not decode attribute arguments.*/)] public void DealDamageRpc(int carHealth) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(2956878147u, val2, val, (SendTo)1, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val3, carHealth); ((NetworkBehaviour)this).__endSendRpc(ref val3, 2956878147u, val2, val, (SendTo)1, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; base.timeAtLastDamage = Time.realtimeSinceStartup; base.carHP = carHealth; syncedCarHP = base.carHP; } } } [Rpc(/*Could not decode attribute arguments.*/)] public void DestroyCarRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(1629085561u, val2, val, (SendTo)5, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendRpc(ref val3, 1629085561u, val2, val, (SendTo)5, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (!base.carDestroyed) { DestroyCar(); } } } public void DestroyCar() { //IL_0298: Unknown result type (might be due to invalid IL or missing references) //IL_04b9: Unknown result type (might be due to invalid IL or missing references) //IL_04c3: Unknown result type (might be due to invalid IL or missing references) //IL_04cd: Unknown result type (might be due to invalid IL or missing references) //IL_04dd: Unknown result type (might be due to invalid IL or missing references) //IL_04e2: Unknown result type (might be due to invalid IL or missing references) //IL_04e7: Unknown result type (might be due to invalid IL or missing references) //IL_0576: Unknown result type (might be due to invalid IL or missing references) //IL_0580: Unknown result type (might be due to invalid IL or missing references) //IL_058a: Unknown result type (might be due to invalid IL or missing references) //IL_058f: Unknown result type (might be due to invalid IL or missing references) //IL_0594: Unknown result type (might be due to invalid IL or missing references) //IL_059c: Unknown result type (might be due to invalid IL or missing references) //IL_05a6: Unknown result type (might be due to invalid IL or missing references) //IL_062c: Unknown result type (might be due to invalid IL or missing references) //IL_0637: Unknown result type (might be due to invalid IL or missing references) //IL_063c: Unknown result type (might be due to invalid IL or missing references) //IL_0641: Unknown result type (might be due to invalid IL or missing references) //IL_064b: Unknown result type (might be due to invalid IL or missing references) //IL_0650: Unknown result type (might be due to invalid IL or missing references) if (!base.carDestroyed) { base.carDestroyed = true; base.magnetedToShip = false; if (blinkersCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(blinkersCoroutine); blinkersCoroutine = null; } RemoveCarRainCollision(); CollectItemsInTruck(justDepartedIntoOrbit: false); base.underExtremeStress = false; base.hoodPoppedUp = true; ((Renderer)base.keyObject).enabled = false; base.engineAudio1.Stop(); base.engineAudio2.Stop(); engineAudio3.Stop(); engineAudio4.Stop(); base.turbulenceAudio.Stop(); base.rollingAudio.Stop(); if (base.radioOn) { liveRadioController.TurnRadioOnOff(state: false); } base.radioAudio.Stop(); base.radioInterference.Stop(); heaterOn = false; base.radioOn = false; base.extremeStressAudio.Stop(); carKeySounds.Stop(); cabinLightSwitchAudio.Stop(); base.honkingHorn = false; base.hornAudio.Stop(); base.tireSparks.Stop(); base.skiddingAudio.Stop(); base.turboBoostAudio.Stop(); base.turboBoostParticle.Stop(); if (voiceModule.audioTimedCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(voiceModule.audioTimedCoroutine); voiceModule.audioTimedCoroutine = null; } voiceModule.voiceAudio.Stop(); voiceModule.voiceAudio.mute = true; base.EngineRPM = 0f; wheelRPM = 0f; currentGear = 1; if (blinkersCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(blinkersCoroutine); blinkersCoroutine = null; } hazardsBlinking = false; ((Renderer)leftBlinkerMesh).material = base.headlightsOffMat; ((Renderer)leftBlinkerMeshLod).material = base.headlightsOffMat; ((Renderer)rightBlinkerMesh).material = base.headlightsOffMat; ((Renderer)rightBlinkerMeshLod).material = base.headlightsOffMat; SetSymbolActive(leftSignalSymbol, leftSignalLight, active: false); SetSymbolActive(hazardWarningSymbol, hazardWarningLight, active: false); SetSymbolActive(rightSignalSymbol, rightSignalLight, active: false); blinkerLightsContainer.SetActive(false); RoundManager.Instance.PlayAudibleNoise(((Component)base.engineAudio1).transform.position, 20f, 0.8f, 0, false, 2692); base.FrontLeftWheel.motorTorque = 0f; base.FrontRightWheel.motorTorque = 0f; base.BackLeftWheel.motorTorque = 0f; base.BackRightWheel.motorTorque = 0f; base.FrontRightWheel.brakeTorque = 0f; base.FrontLeftWheel.brakeTorque = 0f; base.BackLeftWheel.brakeTorque = 0f; base.BackRightWheel.brakeTorque = 0f; ((Collider)base.FrontLeftWheel).enabled = false; ((Collider)base.FrontRightWheel).enabled = false; ((Collider)base.BackLeftWheel).enabled = false; ((Collider)base.BackRightWheel).enabled = false; ((Renderer)base.leftWheelMesh).enabled = false; ((Renderer)base.rightWheelMesh).enabled = false; ((Renderer)base.backLeftWheelMesh).enabled = false; ((Renderer)base.backRightWheelMesh).enabled = false; ((Renderer)leftBrakeMesh).enabled = false; ((Renderer)rightBrakeMesh).enabled = false; ((Renderer)backLeftBrakeMesh).enabled = false; ((Renderer)backRightBrakeMesh).enabled = false; ((Renderer)((Component)base.carHoodAnimator).gameObject.GetComponentInChildren()).enabled = false; base.backDoorContainer.SetActive(false); base.headlightsContainer.SetActive(false); sideLightsContainer.SetActive(false); base.backLightsContainer.SetActive(false); BreakWindshield(); base.destroyedTruckMesh.SetActive(true); ((Component)base.mainBodyMesh).gameObject.SetActive(false); for (int i = 0; i < disableOnDestroy.Length; i++) { disableOnDestroy[i].SetActive(false); } for (int j = 0; j < enableOnDestroy.Length; j++) { enableOnDestroy[j].SetActive(true); } base.mainRigidbody.ResetCenterOfMass(); base.mainRigidbody.AddForceAtPosition(Vector3.up * 1560f * 5f, ((Component)base.hoodFireAudio).transform.position - Vector3.up, (ForceMode)1); SetIgnition(started: false, cabLightOn: false); SetFrontCabinLightOn(setOn: false); base.carExhaustParticle.Stop(true, (ParticleSystemStopBehavior)1); base.keyIsInDriverHand = false; base.keyIsInIgnition = false; base.keyIgnitionCoroutine = null; liftGateOpen = true; base.backDoorOpen = true; sideDoorOpen = true; if (base.localPlayerInControl || localPlayerInMiddlePassengerSeat || base.localPlayerInPassengerSeat) { GameNetworkManager.Instance.localPlayerController.CancelSpecialTriggerAnimations(); GameNetworkManager.Instance.localPlayerController.KillPlayer(Vector3.up * 27f + 20f * Random.insideUnitSphere, true, (CauseOfDeath)3, 6, Vector3.up * 1.5f, false); } InteractTrigger[] componentsInChildren = ((Component)this).gameObject.GetComponentsInChildren(); for (int k = 0; k < componentsInChildren.Length; k++) { componentsInChildren[k].interactable = false; componentsInChildren[k].CancelAnimationExternally(); } base.driverSeatTrigger.interactable = false; middlePassengerSeatTrigger.interactable = false; base.passengerSeatTrigger.interactable = false; base.currentDriver = null; currentMiddlePassenger = null; base.currentPassenger = null; Landmine.SpawnExplosion(((Component)this).transform.position + ((Component)this).transform.forward + Vector3.up * 1.5f, true, 6f, 10f, 30, 1000f, base.truckDestroyedExplosion, true); pushTruckTrigger.interactable = true; } } public void RemoveCarRainCollision() { //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Expected O, but got Unknown ParticleSystem[] array = (ParticleSystem[])(object)new ParticleSystem[9] { GlobalReferences.rainParticles, GlobalReferences.rainHitParticles, GlobalReferences.stormyRainParticles, GlobalReferences.stormyRainHitParticles, GlobalReferences.wesleyHurricaneRainParticles, GlobalReferences.wesleyHurricaneRainHitParticles, GlobalReferences.wesleyHurricaneSandParticles, GlobalReferences.wesleyForsakenRainParticles, GlobalReferences.wesleyForsakenRainHitParticles }; ParticleSystem[] array2 = array; foreach (ParticleSystem val in array2) { if ((Object)(object)val == (Object)null) { Plugin.Logger.LogDebug((object)"weather particle or trigger is null!"); continue; } TriggerModule trigger = val.trigger; for (int num = ((TriggerModule)(ref trigger)).colliderCount - 1; num >= 0; num--) { Collider value = (Collider)((TriggerModule)(ref trigger)).GetCollider(num); if (weatherEffectBlockers.Contains(value)) { ((TriggerModule)(ref trigger)).RemoveCollider(num); } } } } private void ReactToDamage() { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) base.healthMeter.localScale = new Vector3(1f, 1f, Mathf.Lerp(base.healthMeter.localScale.z, Mathf.Clamp(((float)base.carHP + (float)transmissionHP) / ((float)base.baseCarHP + (float)baseTransmissionHP), 0.01f, 1f), 6f * Time.deltaTime)); base.turboMeter.localScale = new Vector3(1f, 1f, Mathf.Lerp(base.turboMeter.localScale.z, Mathf.Clamp((float)base.turboBoosts / 4f, 0.01f, 1f), 6f * Time.deltaTime)); if (transmissionHP <= 12) { clutchFriction = (float)transmissionHP / 13.5f; clutchFriction = Mathf.Clamp(clutchFriction, 0.6f, 1f); } else { clutchFriction = 1f; } if (!((NetworkBehaviour)this).IsOwner) { return; } if (base.carHP < 7 && Time.realtimeSinceStartup - base.timeAtLastDamage > 16f) { base.timeAtLastDamage = Time.realtimeSinceStartup; base.carHP++; syncedCarHP = base.carHP; SyncCarHealthRpc(base.carHP); } if (base.carDestroyed) { if (base.carHP < 3) { if (!base.isHoodOnFire) { base.isHoodOnFire = true; base.hoodFireAudio.Play(); base.hoodFireParticle.Play(); SetHoodOnFireRpc(base.isHoodOnFire); } } else if (base.isHoodOnFire && base.carHP >= 3) { base.isHoodOnFire = false; base.hoodFireAudio.Stop(); base.hoodFireParticle.Stop(true, (ParticleSystemStopBehavior)1); SetHoodOnFireRpc(base.isHoodOnFire); } } else if (base.carHP < 3) { if (!base.isHoodOnFire) { if (!base.hoodPoppedUp) { base.hoodPoppedUp = true; SetHoodOpenLocalClient(base.hoodPoppedUp); } base.isHoodOnFire = true; base.hoodFireAudio.Play(); base.hoodFireParticle.Play(); SetHoodOnFireRpc(base.isHoodOnFire); } } else if (base.isHoodOnFire && base.carHP >= 3) { base.isHoodOnFire = false; base.hoodFireAudio.Stop(); base.hoodFireParticle.Stop(true, (ParticleSystemStopBehavior)1); SetHoodOnFireRpc(base.isHoodOnFire); } } [Rpc(/*Could not decode attribute arguments.*/)] private void SyncCarHealthRpc(int carHealth) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(827845429u, val2, val, (SendTo)1, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val3, carHealth); ((NetworkBehaviour)this).__endSendRpc(ref val3, 827845429u, val2, val, (SendTo)1, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; base.timeAtLastDamage = Time.realtimeSinceStartup; syncedCarHP = carHealth; base.carHP = syncedCarHP; } } } [Rpc(/*Could not decode attribute arguments.*/)] public void SetHoodOnFireRpc(bool onFire) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(3637472327u, val2, val, (SendTo)1, (RpcDelivery)0); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref onFire, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val3, 3637472327u, val2, val, (SendTo)1, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; base.isHoodOnFire = onFire; if (base.isHoodOnFire) { base.hoodFireAudio.Play(); base.hoodFireParticle.Play(); } else { base.hoodFireAudio.Stop(); base.hoodFireParticle.Stop(true, (ParticleSystemStopBehavior)1); } } } [Rpc(/*Could not decode attribute arguments.*/)] public void SyncExtremeStressRpc(bool underStress) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(23543307u, val2, val, (SendTo)1, (RpcDelivery)0); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref underStress, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val3, 23543307u, val2, val, (SendTo)1, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (base.carDestroyed) { base.underExtremeStress = false; } else { base.underExtremeStress = underStress; } } } public void PushTruckWithArms() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_015b: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Unknown result type (might be due to invalid IL or missing references) if (!base.magnetedToShip && Physics.Raycast(((Component)GameNetworkManager.Instance.localPlayerController.gameplayCamera).transform.position, ((Component)GameNetworkManager.Instance.localPlayerController.gameplayCamera).transform.forward, ref base.hit, 10f, 1073742656, (QueryTriggerInteraction)1) && !((Object)(object)GameNetworkManager.Instance.localPlayerController.overridePhysicsParent != (Object)null) && !((Object)(object)GameNetworkManager.Instance.localPlayerController.physicsParent == (Object)(object)base.physicsRegion.physicsTransform)) { Vector3 point = ((RaycastHit)(ref base.hit)).point; Vector3 forward = ((Component)GameNetworkManager.Instance.localPlayerController.gameplayCamera).transform.forward; int clip = Random.Range(0, base.minCollisions.Length); if (((NetworkBehaviour)this).IsOwner) { base.mainRigidbody.AddForceAtPosition(Vector3.Normalize(forward * 1000f) * Random.Range(40f, 50f) * base.pushForceMultiplier, point - ((Component)base.mainRigidbody).transform.up * base.pushVerticalOffsetAmount, (ForceMode)1); PushTruckFromOwnerRpc(point, clip); } else { PushTruckRpc(point, forward, clip); } } } [Rpc(/*Could not decode attribute arguments.*/)] public void PushTruckRpc(Vector3 pushPosition, Vector3 dir, int clip) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_013f: Unknown result type (might be due to invalid IL or missing references) //IL_0145: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_0185: Unknown result type (might be due to invalid IL or missing references) //IL_018a: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(3306296137u, val2, val, (SendTo)6, (RpcDelivery)0); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref pushPosition); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref dir); BytePacker.WriteValueBitPacked(val3, clip); ((NetworkBehaviour)this).__endSendRpc(ref val3, 3306296137u, val2, val, (SendTo)6, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; base.pushAudio.clip = base.minCollisions[clip]; ((Component)base.pushAudio).transform.position = pushPosition; base.pushAudio.Play(); base.turbulenceAmount = Mathf.Min(base.turbulenceAmount + 0.5f, 2f); if (((NetworkBehaviour)this).IsOwner) { base.mainRigidbody.AddForceAtPosition(Vector3.Normalize(dir * 1000f) * Random.Range(40f, 50f) * base.pushForceMultiplier, pushPosition - ((Component)base.mainRigidbody).transform.up * base.pushVerticalOffsetAmount, (ForceMode)1); } } } [Rpc(/*Could not decode attribute arguments.*/)] public void PushTruckFromOwnerRpc(Vector3 pos, int clip) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(3587297227u, val2, val, (SendTo)6, (RpcDelivery)0); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref pos); BytePacker.WriteValueBitPacked(val3, clip); ((NetworkBehaviour)this).__endSendRpc(ref val3, 3587297227u, val2, val, (SendTo)6, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; base.pushAudio.clip = base.minCollisions[clip]; ((Component)base.pushAudio).transform.position = pos; base.pushAudio.Play(); base.turbulenceAmount = Mathf.Min(base.turbulenceAmount + 0.5f, 2f); } } } public void ToggleHoodOpenLocalClient() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) RoundManager.Instance.PlayAudibleNoise(((Component)base.carHoodAnimator).gameObject.transform.position, 18f, 0.7f, 0, false, 2692); base.carHoodOpen = !base.carHoodOpen; if (!base.carHoodOpen) { base.hoodPoppedUp = false; } base.carHoodAnimator.SetBool("hoodOpen", base.carHoodOpen); SetHoodOpenRpc(base.carHoodOpen); } public void SetHoodOpenLocalClient(bool setOpen) { //IL_0025: Unknown result type (might be due to invalid IL or missing references) if (base.carHoodOpen != setOpen) { RoundManager.Instance.PlayAudibleNoise(((Component)base.carHoodAnimator).gameObject.transform.position, 18f, 0.7f, 0, false, 2692); base.carHoodOpen = setOpen; base.carHoodAnimator.SetBool("hoodOpen", setOpen); SetHoodOpenRpc(open: true); } } [Rpc(/*Could not decode attribute arguments.*/)] public void SetHoodOpenRpc(bool open) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(1570871273u, val2, val, (SendTo)5, (RpcDelivery)0); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref open, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val3, 1570871273u, val2, val, (SendTo)5, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (base.carHoodOpen != open) { RoundManager.Instance.PlayAudibleNoise(((Component)base.carHoodAnimator).gameObject.transform.position, 18f, 0.7f, 0, false, 2692); base.carHoodOpen = open; if (!base.carHoodOpen) { base.hoodPoppedUp = false; } base.carHoodAnimator.SetBool("hoodOpen", open); } } private IEnumerator FlashBlinkerLights() { while (true) { yield return (object)new WaitForSeconds(0.4f); hazardsBlinking = true; base.steeringWheelAudio.PlayOneShot(blinkOn); ((Renderer)leftBlinkerMesh).material = blinkerOnMat; ((Renderer)leftBlinkerMeshLod).material = blinkerOnMat; ((Renderer)rightBlinkerMesh).material = blinkerOnMat; ((Renderer)rightBlinkerMeshLod).material = blinkerOnMat; SetSymbolActive(leftSignalSymbol, leftSignalLight, active: true); SetSymbolActive(hazardWarningSymbol, hazardWarningLight, active: true); SetSymbolActive(rightSignalSymbol, rightSignalLight, active: true); blinkerLightsContainer.SetActive(true); yield return (object)new WaitForSeconds(0.4f); hazardsBlinking = false; base.steeringWheelAudio.PlayOneShot(blinkOff); ((Renderer)leftBlinkerMesh).material = base.headlightsOffMat; ((Renderer)leftBlinkerMeshLod).material = base.headlightsOffMat; ((Renderer)rightBlinkerMesh).material = base.headlightsOffMat; ((Renderer)rightBlinkerMeshLod).material = base.headlightsOffMat; SetSymbolActive(leftSignalSymbol, leftSignalLight, active: false); SetSymbolActive(hazardWarningSymbol, hazardWarningLight, active: false); SetSymbolActive(rightSignalSymbol, rightSignalLight, active: false); blinkerLightsContainer.SetActive(false); } } public void SetHazardLightsOnLocalClient() { hazardsOn = !hazardsOn; if (truckAlarmCoroutine == null) { if (blinkersCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(blinkersCoroutine); blinkersCoroutine = null; } if (hazardsOn) { blinkersCoroutine = ((MonoBehaviour)this).StartCoroutine(FlashBlinkerLights()); } else { hazardsBlinking = false; ((Renderer)leftBlinkerMesh).material = base.headlightsOffMat; ((Renderer)leftBlinkerMeshLod).material = base.headlightsOffMat; ((Renderer)rightBlinkerMesh).material = base.headlightsOffMat; ((Renderer)rightBlinkerMeshLod).material = base.headlightsOffMat; SetSymbolActive(leftSignalSymbol, leftSignalLight, active: false); SetSymbolActive(hazardWarningSymbol, hazardWarningLight, active: false); SetSymbolActive(rightSignalSymbol, rightSignalLight, active: false); blinkerLightsContainer.SetActive(false); } } SetHazardLightsRpc(hazardsOn); } [Rpc(/*Could not decode attribute arguments.*/)] public void SetHazardLightsRpc(bool warningsOn) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(26954103u, val2, val, (SendTo)5, (RpcDelivery)0); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref warningsOn, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val3, 26954103u, val2, val, (SendTo)5, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; hazardsOn = warningsOn; if (truckAlarmCoroutine == null) { if (blinkersCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(blinkersCoroutine); blinkersCoroutine = null; } if (hazardsOn) { blinkersCoroutine = ((MonoBehaviour)this).StartCoroutine(FlashBlinkerLights()); return; } hazardsBlinking = false; ((Renderer)leftBlinkerMesh).material = base.headlightsOffMat; ((Renderer)leftBlinkerMeshLod).material = base.headlightsOffMat; ((Renderer)rightBlinkerMesh).material = base.headlightsOffMat; ((Renderer)rightBlinkerMeshLod).material = base.headlightsOffMat; SetSymbolActive(leftSignalSymbol, leftSignalLight, active: false); SetSymbolActive(hazardWarningSymbol, hazardWarningLight, active: false); SetSymbolActive(rightSignalSymbol, rightSignalLight, active: false); blinkerLightsContainer.SetActive(false); } } public void ToggleHeadlightsLocalClient() { if (!lowBeamsOn && !highBeamsOn) { lowBeamsOn = true; highBeamsOn = false; } else if (lowBeamsOn && !highBeamsOn) { highBeamsOn = true; lowBeamsOn = true; } else if (lowBeamsOn && highBeamsOn) { highBeamsOn = false; lowBeamsOn = false; } cabinLightSwitchAudio.PlayOneShot(base.headlightsToggleSFX); base.headlightsContainer.SetActive(lowBeamsOn); highBeamContainer.SetActive(highBeamsOn); radioLight.SetActive(lowBeamsOn); heaterLight.SetActive(lowBeamsOn); leftWindowLight.SetActive(lowBeamsOn); rightWindowLight.SetActive(lowBeamsOn); sideLightsContainer.SetActive(lowBeamsOn); clusterLightsContainer.SetActive(lowBeamsOn); SetHeadlightMaterial(lowBeamsOn, highBeamsOn); ToggleHeadlightsRpc(lowBeamsOn, highBeamsOn); } [Rpc(/*Could not decode attribute arguments.*/)] public void ToggleHeadlightsRpc(bool setLowBeamsOn, bool setHighBeamsOn) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(2382088157u, val2, val, (SendTo)5, (RpcDelivery)0); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref setLowBeamsOn, default(ForPrimitives)); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref setHighBeamsOn, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val3, 2382088157u, val2, val, (SendTo)5, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; lowBeamsOn = setLowBeamsOn; highBeamsOn = setHighBeamsOn; cabinLightSwitchAudio.PlayOneShot(base.headlightsToggleSFX); base.headlightsContainer.SetActive(lowBeamsOn); highBeamContainer.SetActive(highBeamsOn); radioLight.SetActive(lowBeamsOn); heaterLight.SetActive(lowBeamsOn); leftWindowLight.SetActive(lowBeamsOn); rightWindowLight.SetActive(lowBeamsOn); sideLightsContainer.SetActive(lowBeamsOn); clusterLightsContainer.SetActive(lowBeamsOn); SetHeadlightMaterial(lowBeamsOn, highBeamsOn); } } } private void SetHeadlightMaterial(bool lowOn, bool highOn) { Material[] sharedMaterials = ((Renderer)interiorMesh).sharedMaterials; sharedMaterials[2] = (lowOn ? clusterOnMaterial : clusterOffMaterial); sharedMaterials[3] = (lowOn ? clusterDialsOnMat : clusterDialsOffMat); ((Renderer)interiorMesh).sharedMaterials = sharedMaterials; ((Renderer)speedometerMesh).material = (lowOn ? clusterOnMaterial : clusterOffMaterial); ((Renderer)tachometerMesh).material = (lowOn ? clusterOnMaterial : clusterOffMaterial); ((Renderer)oilPressureMesh).material = (lowOn ? clusterOnMaterial : clusterOffMaterial); ((Renderer)heaterBaseMesh).material = (lowOn ? heaterOnMat : heaterOffMat); Material[] sharedMaterials2 = ((Renderer)leftDoorMesh).sharedMaterials; Material[] sharedMaterials3 = ((Renderer)rightDoorMesh).sharedMaterials; sharedMaterials2[2] = (lowOn ? windowOnMaterial : windowOffMaterial); sharedMaterials3[2] = (lowOn ? windowOnMaterial : windowOffMaterial); ((Renderer)leftDoorMesh).sharedMaterials = sharedMaterials2; ((Renderer)rightDoorMesh).sharedMaterials = sharedMaterials3; ((Renderer)radioMesh).material = (lowOn ? radioOnMaterial : radioOffMaterial); ((Renderer)radioPowerDial).material = (lowOn ? radioOnMaterial : radioOffMaterial); ((Renderer)radioVolumeDial).material = (lowOn ? radioOnMaterial : radioOffMaterial); ((Renderer)lowBeamMesh).material = (lowOn ? base.headlightsOnMat : base.headlightsOffMat); ((Renderer)lowBeamMeshLod).material = (lowOn ? base.headlightsOnMat : base.headlightsOffMat); ((Renderer)highBeamMesh).material = (highOn ? base.headlightsOnMat : base.headlightsOffMat); ((Renderer)highBeamMeshLod).material = (highOn ? base.headlightsOnMat : base.headlightsOffMat); ((Renderer)sideTopLightsMesh).material = (Material)(lowOn ? ((object)base.backLightOnMat) : ((object)redLightOffMat)); ((Renderer)sideTopLightsMeshLod).material = (Material)(lowOn ? ((object)base.backLightOnMat) : ((object)redLightOffMat)); } protected override void __initializeVariables() { ((VehicleController)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Expected O, but got Unknown //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Expected O, but got Unknown //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Expected O, but got Unknown //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Expected O, but got Unknown //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Expected O, but got Unknown //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Expected O, but got Unknown //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Expected O, but got Unknown //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Expected O, but got Unknown //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Expected O, but got Unknown //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Expected O, but got Unknown //IL_0195: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Expected O, but got Unknown //IL_01b1: Unknown result type (might be due to invalid IL or missing references) //IL_01c0: Expected O, but got Unknown //IL_01cd: Unknown result type (might be due to invalid IL or missing references) //IL_01dc: Expected O, but got Unknown //IL_01e9: Unknown result type (might be due to invalid IL or missing references) //IL_01f8: Expected O, but got Unknown //IL_0205: Unknown result type (might be due to invalid IL or missing references) //IL_0214: Expected O, but got Unknown //IL_0221: Unknown result type (might be due to invalid IL or missing references) //IL_0230: Expected O, but got Unknown //IL_023d: Unknown result type (might be due to invalid IL or missing references) //IL_024c: Expected O, but got Unknown //IL_0259: Unknown result type (might be due to invalid IL or missing references) //IL_0268: Expected O, but got Unknown //IL_0275: Unknown result type (might be due to invalid IL or missing references) //IL_0284: Expected O, but got Unknown //IL_0291: Unknown result type (might be due to invalid IL or missing references) //IL_02a0: Expected O, but got Unknown //IL_02ad: Unknown result type (might be due to invalid IL or missing references) //IL_02bc: Expected O, but got Unknown //IL_02c9: Unknown result type (might be due to invalid IL or missing references) //IL_02d8: Expected O, but got Unknown //IL_02e5: Unknown result type (might be due to invalid IL or missing references) //IL_02f4: Expected O, but got Unknown //IL_0301: Unknown result type (might be due to invalid IL or missing references) //IL_0310: Expected O, but got Unknown //IL_031d: Unknown result type (might be due to invalid IL or missing references) //IL_032c: Expected O, but got Unknown //IL_0339: Unknown result type (might be due to invalid IL or missing references) //IL_0348: Expected O, but got Unknown //IL_0355: Unknown result type (might be due to invalid IL or missing references) //IL_0364: Expected O, but got Unknown //IL_0371: Unknown result type (might be due to invalid IL or missing references) //IL_0380: Expected O, but got Unknown //IL_038d: Unknown result type (might be due to invalid IL or missing references) //IL_039c: Expected O, but got Unknown //IL_03a9: Unknown result type (might be due to invalid IL or missing references) //IL_03b8: Expected O, but got Unknown //IL_03c5: Unknown result type (might be due to invalid IL or missing references) //IL_03d4: Expected O, but got Unknown //IL_03e1: Unknown result type (might be due to invalid IL or missing references) //IL_03f0: Expected O, but got Unknown //IL_03fd: Unknown result type (might be due to invalid IL or missing references) //IL_040c: Expected O, but got Unknown //IL_0419: Unknown result type (might be due to invalid IL or missing references) //IL_0428: Expected O, but got Unknown //IL_0435: Unknown result type (might be due to invalid IL or missing references) //IL_0444: Expected O, but got Unknown //IL_0451: Unknown result type (might be due to invalid IL or missing references) //IL_0460: Expected O, but got Unknown //IL_046d: Unknown result type (might be due to invalid IL or missing references) //IL_047c: Expected O, but got Unknown //IL_0489: Unknown result type (might be due to invalid IL or missing references) //IL_0498: Expected O, but got Unknown //IL_04a5: Unknown result type (might be due to invalid IL or missing references) //IL_04b4: Expected O, but got Unknown //IL_04c1: Unknown result type (might be due to invalid IL or missing references) //IL_04d0: Expected O, but got Unknown //IL_04dd: Unknown result type (might be due to invalid IL or missing references) //IL_04ec: Expected O, but got Unknown //IL_04f9: Unknown result type (might be due to invalid IL or missing references) //IL_0508: Expected O, but got Unknown //IL_0515: Unknown result type (might be due to invalid IL or missing references) //IL_0524: Expected O, but got Unknown //IL_0531: Unknown result type (might be due to invalid IL or missing references) //IL_0540: Expected O, but got Unknown //IL_054d: Unknown result type (might be due to invalid IL or missing references) //IL_055c: Expected O, but got Unknown //IL_0569: Unknown result type (might be due to invalid IL or missing references) //IL_0578: Expected O, but got Unknown //IL_0585: Unknown result type (might be due to invalid IL or missing references) //IL_0594: Expected O, but got Unknown //IL_05a1: Unknown result type (might be due to invalid IL or missing references) //IL_05b0: Expected O, but got Unknown //IL_05bd: Unknown result type (might be due to invalid IL or missing references) //IL_05cc: Expected O, but got Unknown //IL_05d9: Unknown result type (might be due to invalid IL or missing references) //IL_05e8: Expected O, but got Unknown //IL_05f5: Unknown result type (might be due to invalid IL or missing references) //IL_0604: Expected O, but got Unknown //IL_0611: Unknown result type (might be due to invalid IL or missing references) //IL_0620: Expected O, but got Unknown //IL_062d: Unknown result type (might be due to invalid IL or missing references) //IL_063c: Expected O, but got Unknown //IL_0649: Unknown result type (might be due to invalid IL or missing references) //IL_0658: Expected O, but got Unknown //IL_0665: Unknown result type (might be due to invalid IL or missing references) //IL_0674: Expected O, but got Unknown //IL_0681: Unknown result type (might be due to invalid IL or missing references) //IL_0690: Expected O, but got Unknown //IL_069d: Unknown result type (might be due to invalid IL or missing references) //IL_06ac: Expected O, but got Unknown //IL_06b9: Unknown result type (might be due to invalid IL or missing references) //IL_06c8: Expected O, but got Unknown //IL_06d5: Unknown result type (might be due to invalid IL or missing references) //IL_06e4: Expected O, but got Unknown //IL_06f1: Unknown result type (might be due to invalid IL or missing references) //IL_0700: Expected O, but got Unknown //IL_070d: Unknown result type (might be due to invalid IL or missing references) //IL_071c: Expected O, but got Unknown //IL_0729: Unknown result type (might be due to invalid IL or missing references) //IL_0738: Expected O, but got Unknown //IL_0745: Unknown result type (might be due to invalid IL or missing references) //IL_0754: Expected O, but got Unknown //IL_0761: Unknown result type (might be due to invalid IL or missing references) //IL_0770: Expected O, but got Unknown //IL_077d: Unknown result type (might be due to invalid IL or missing references) //IL_078c: Expected O, but got Unknown //IL_0799: Unknown result type (might be due to invalid IL or missing references) //IL_07a8: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(4283610501u, new RpcReceiveHandler(__rpc_handler_4283610501), "SetSpecialVariantRpc"); ((NetworkBehaviour)this).__registerRpc(718438838u, new RpcReceiveHandler(__rpc_handler_718438838), "SyncClientDataRpc"); ((NetworkBehaviour)this).__registerRpc(2915638757u, new RpcReceiveHandler(__rpc_handler_2915638757), "SetCabinLightSwitchRpc"); ((NetworkBehaviour)this).__registerRpc(2820477147u, new RpcReceiveHandler(__rpc_handler_2820477147), "SetFrontCabinLightRpc"); ((NetworkBehaviour)this).__registerRpc(1779906441u, new RpcReceiveHandler(__rpc_handler_1779906441), "SetHandbrakeRpc"); ((NetworkBehaviour)this).__registerRpc(3540053645u, new RpcReceiveHandler(__rpc_handler_3540053645), "TryIgnitionRpc"); ((NetworkBehaviour)this).__registerRpc(2290489169u, new RpcReceiveHandler(__rpc_handler_2290489169), "TryStartIgnitionRpc"); ((NetworkBehaviour)this).__registerRpc(1131385462u, new RpcReceiveHandler(__rpc_handler_1131385462), "CancelTryIgnitionRpc"); ((NetworkBehaviour)this).__registerRpc(4118721524u, new RpcReceiveHandler(__rpc_handler_4118721524), "StartIgnitionRpc"); ((NetworkBehaviour)this).__registerRpc(1677604189u, new RpcReceiveHandler(__rpc_handler_1677604189), "UntwistKeyInIgnitionRpc"); ((NetworkBehaviour)this).__registerRpc(2078953510u, new RpcReceiveHandler(__rpc_handler_2078953510), "RemoveKeyFromIgnitionRpc"); ((NetworkBehaviour)this).__registerRpc(3762133933u, new RpcReceiveHandler(__rpc_handler_3762133933), "SetDriverInCarServerRpc"); ((NetworkBehaviour)this).__registerRpc(437116846u, new RpcReceiveHandler(__rpc_handler_437116846), "SetDriverInCarOwnerRpc"); ((NetworkBehaviour)this).__registerRpc(2358374295u, new RpcReceiveHandler(__rpc_handler_2358374295), "SetDriverInCarClientsRpc"); ((NetworkBehaviour)this).__registerRpc(2452258268u, new RpcReceiveHandler(__rpc_handler_2452258268), "OnDriverExitServerRpc"); ((NetworkBehaviour)this).__registerRpc(1067900697u, new RpcReceiveHandler(__rpc_handler_1067900697), "OnDriverExitRpc"); ((NetworkBehaviour)this).__registerRpc(4234258805u, new RpcReceiveHandler(__rpc_handler_4234258805), "SetMiddlePassengerInCarServerRpc"); ((NetworkBehaviour)this).__registerRpc(1070323261u, new RpcReceiveHandler(__rpc_handler_1070323261), "SetMiddlePassengerInCarRpc"); ((NetworkBehaviour)this).__registerRpc(2405236776u, new RpcReceiveHandler(__rpc_handler_2405236776), "OnMiddlePassengerExitRpc"); ((NetworkBehaviour)this).__registerRpc(3385475783u, new RpcReceiveHandler(__rpc_handler_3385475783), "SetPassengerInCarServerRpc"); ((NetworkBehaviour)this).__registerRpc(1614408832u, new RpcReceiveHandler(__rpc_handler_1614408832), "SetPassengerInCarRpc"); ((NetworkBehaviour)this).__registerRpc(732754567u, new RpcReceiveHandler(__rpc_handler_732754567), "OnPassengerExitRpc"); ((NetworkBehaviour)this).__registerRpc(3176739277u, new RpcReceiveHandler(__rpc_handler_3176739277), "CancelSetPlayerInVehicleClientRpc"); ((NetworkBehaviour)this).__registerRpc(203598337u, new RpcReceiveHandler(__rpc_handler_203598337), "OnDriverLeaveGameServerRpc"); ((NetworkBehaviour)this).__registerRpc(1187821516u, new RpcReceiveHandler(__rpc_handler_1187821516), "OnDriverLeaveGameRpc"); ((NetworkBehaviour)this).__registerRpc(2421407223u, new RpcReceiveHandler(__rpc_handler_2421407223), "OnMiddlePassengerLeaveGameRpc"); ((NetworkBehaviour)this).__registerRpc(3986388574u, new RpcReceiveHandler(__rpc_handler_3986388574), "OnPassengerLeaveGameRpc"); ((NetworkBehaviour)this).__registerRpc(1802936242u, new RpcReceiveHandler(__rpc_handler_1802936242), "ShiftToGearRpc"); ((NetworkBehaviour)this).__registerRpc(4167936217u, new RpcReceiveHandler(__rpc_handler_4167936217), "DealGearboxDamageRpc"); ((NetworkBehaviour)this).__registerRpc(231877460u, new RpcReceiveHandler(__rpc_handler_231877460), "MagnetCarRpc"); ((NetworkBehaviour)this).__registerRpc(344299242u, new RpcReceiveHandler(__rpc_handler_344299242), "SetOverdriveSwitchRpc"); ((NetworkBehaviour)this).__registerRpc(1393669511u, new RpcReceiveHandler(__rpc_handler_1393669511), "AddTransmissionOilRpc"); ((NetworkBehaviour)this).__registerRpc(2664742903u, new RpcReceiveHandler(__rpc_handler_2664742903), "AddEngineOilRpc"); ((NetworkBehaviour)this).__registerRpc(2998005556u, new RpcReceiveHandler(__rpc_handler_2998005556), "AddTurboBoostRpc"); ((NetworkBehaviour)this).__registerRpc(1137787820u, new RpcReceiveHandler(__rpc_handler_1137787820), "SetHeaterRpc"); ((NetworkBehaviour)this).__registerRpc(3963678435u, new RpcReceiveHandler(__rpc_handler_3963678435), "SetHeaterFanSpeedRpc"); ((NetworkBehaviour)this).__registerRpc(3569046119u, new RpcReceiveHandler(__rpc_handler_3569046119), "SetHeaterDirectionRpc"); ((NetworkBehaviour)this).__registerRpc(2821576097u, new RpcReceiveHandler(__rpc_handler_2821576097), "UseTurboBoostRpc"); ((NetworkBehaviour)this).__registerRpc(500051534u, new RpcReceiveHandler(__rpc_handler_500051534), "SetHonkRpc"); ((NetworkBehaviour)this).__registerRpc(2905751979u, new RpcReceiveHandler(__rpc_handler_2905751979), "SyncPlayerZoneRpc"); ((NetworkBehaviour)this).__registerRpc(4242820360u, new RpcReceiveHandler(__rpc_handler_4242820360), "SyncPlayerLookInputRpc"); ((NetworkBehaviour)this).__registerRpc(3102248458u, new RpcReceiveHandler(__rpc_handler_3102248458), "SyncPlayerVehicleAnimationsRpc"); ((NetworkBehaviour)this).__registerRpc(4199638913u, new RpcReceiveHandler(__rpc_handler_4199638913), "SyncRadioTimeRpc"); ((NetworkBehaviour)this).__registerRpc(1953632049u, new RpcReceiveHandler(__rpc_handler_1953632049), "ChangeRadioTypeRpc"); ((NetworkBehaviour)this).__registerRpc(2140426134u, new RpcReceiveHandler(__rpc_handler_2140426134), "SetRadioStationRpc"); ((NetworkBehaviour)this).__registerRpc(1383733861u, new RpcReceiveHandler(__rpc_handler_1383733861), "TrySetFMRadioRpc"); ((NetworkBehaviour)this).__registerRpc(3819348054u, new RpcReceiveHandler(__rpc_handler_3819348054), "SetRadioRpc"); ((NetworkBehaviour)this).__registerRpc(1849009000u, new RpcReceiveHandler(__rpc_handler_1849009000), "BeginAlarmRpc"); ((NetworkBehaviour)this).__registerRpc(3563070839u, new RpcReceiveHandler(__rpc_handler_3563070839), "SyncWheelTorqueRpc"); ((NetworkBehaviour)this).__registerRpc(2253232283u, new RpcReceiveHandler(__rpc_handler_2253232283), "SyncCarDrivetrainRpc"); ((NetworkBehaviour)this).__registerRpc(2229834372u, new RpcReceiveHandler(__rpc_handler_2229834372), "StallEngineRpc"); ((NetworkBehaviour)this).__registerRpc(1154936118u, new RpcReceiveHandler(__rpc_handler_1154936118), "SyncCarEffectsRpc"); ((NetworkBehaviour)this).__registerRpc(1252950827u, new RpcReceiveHandler(__rpc_handler_1252950827), "SyncPlayerInputsRpc"); ((NetworkBehaviour)this).__registerRpc(3777613204u, new RpcReceiveHandler(__rpc_handler_3777613204), "SyncCarPositionRpc"); ((NetworkBehaviour)this).__registerRpc(3195815204u, new RpcReceiveHandler(__rpc_handler_3195815204), "SetTyreStressRpc"); ((NetworkBehaviour)this).__registerRpc(3911754106u, new RpcReceiveHandler(__rpc_handler_3911754106), "CarBumpRpc"); ((NetworkBehaviour)this).__registerRpc(1897686969u, new RpcReceiveHandler(__rpc_handler_1897686969), "CarCollisionRpc"); ((NetworkBehaviour)this).__registerRpc(1190235238u, new RpcReceiveHandler(__rpc_handler_1190235238), "ShatterWindshieldRpc"); ((NetworkBehaviour)this).__registerRpc(934350138u, new RpcReceiveHandler(__rpc_handler_934350138), "BreakWindshieldRpc"); ((NetworkBehaviour)this).__registerRpc(2311967180u, new RpcReceiveHandler(__rpc_handler_2311967180), "CarCollisionSFXRpc"); ((NetworkBehaviour)this).__registerRpc(2956878147u, new RpcReceiveHandler(__rpc_handler_2956878147), "DealDamageRpc"); ((NetworkBehaviour)this).__registerRpc(1629085561u, new RpcReceiveHandler(__rpc_handler_1629085561), "DestroyCarRpc"); ((NetworkBehaviour)this).__registerRpc(827845429u, new RpcReceiveHandler(__rpc_handler_827845429), "SyncCarHealthRpc"); ((NetworkBehaviour)this).__registerRpc(3637472327u, new RpcReceiveHandler(__rpc_handler_3637472327), "SetHoodOnFireRpc"); ((NetworkBehaviour)this).__registerRpc(23543307u, new RpcReceiveHandler(__rpc_handler_23543307), "SyncExtremeStressRpc"); ((NetworkBehaviour)this).__registerRpc(3306296137u, new RpcReceiveHandler(__rpc_handler_3306296137), "PushTruckRpc"); ((NetworkBehaviour)this).__registerRpc(3587297227u, new RpcReceiveHandler(__rpc_handler_3587297227), "PushTruckFromOwnerRpc"); ((NetworkBehaviour)this).__registerRpc(1570871273u, new RpcReceiveHandler(__rpc_handler_1570871273), "SetHoodOpenRpc"); ((NetworkBehaviour)this).__registerRpc(26954103u, new RpcReceiveHandler(__rpc_handler_26954103), "SetHazardLightsRpc"); ((NetworkBehaviour)this).__registerRpc(2382088157u, new RpcReceiveHandler(__rpc_handler_2382088157), "ToggleHeadlightsRpc"); ((VehicleController)this).__initializeRpcs(); } private static void __rpc_handler_4283610501(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool specialVariantRpc = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref specialVariantRpc, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((CruiserXLController)(object)target).SetSpecialVariantRpc(specialVariantRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_718438838(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int carHealth = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref carHealth); float wheelRot = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref wheelRot, default(ForPrimitives)); bool ignOn = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref ignOn, default(ForPrimitives)); bool isJenson = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref isJenson, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((CruiserXLController)(object)target).SyncClientDataRpc(carHealth, wheelRot, ignOn, isJenson); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2915638757(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool switchState = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref switchState, default(ForPrimitives)); bool cabLightOn = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref cabLightOn, default(ForPrimitives)); bool setOverride = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref setOverride, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((CruiserXLController)(object)target).SetCabinLightSwitchRpc(switchState, cabLightOn, setOverride); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2820477147(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool frontCabinLightRpc = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref frontCabinLightRpc, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((CruiserXLController)(object)target).SetFrontCabinLightRpc(frontCabinLightRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1779906441(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool handbrakeRpc = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref handbrakeRpc, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((CruiserXLController)(object)target).SetHandbrakeRpc(handbrakeRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3540053645(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool setKeyInSlot = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref setKeyInSlot, default(ForPrimitives)); bool preIgnition = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref preIgnition, default(ForPrimitives)); bool hasStalled = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref hasStalled, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((CruiserXLController)(object)target).TryIgnitionRpc(setKeyInSlot, preIgnition, hasStalled); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2290489169(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool shiftInterlock = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref shiftInterlock, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((CruiserXLController)(object)target).TryStartIgnitionRpc(shiftInterlock); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1131385462(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool setKeyInSlot = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref setKeyInSlot, default(ForPrimitives)); bool cabinLightOn = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref cabinLightOn, default(ForPrimitives)); bool preIgnition = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref preIgnition, default(ForPrimitives)); int currentAnimIndex = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref currentAnimIndex); target.__rpc_exec_stage = (__RpcExecStage)1; ((CruiserXLController)(object)target).CancelTryIgnitionRpc(setKeyInSlot, cabinLightOn, preIgnition, currentAnimIndex); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_4118721524(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool setTriggers = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref setTriggers, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((CruiserXLController)(object)target).StartIgnitionRpc(setTriggers); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1677604189(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((CruiserXLController)(object)target).UntwistKeyInIgnitionRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2078953510(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((CruiserXLController)(object)target).RemoveKeyFromIgnitionRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3762133933(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int driverInCarServerRpc = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref driverInCarServerRpc); target.__rpc_exec_stage = (__RpcExecStage)1; ((CruiserXLController)(object)target).SetDriverInCarServerRpc(driverInCarServerRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_437116846(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((CruiserXLController)(object)target).SetDriverInCarOwnerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2358374295(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerId = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerId); bool setKeyInSlot = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref setKeyInSlot, default(ForPrimitives)); bool setStarted = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref setStarted, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((CruiserXLController)(object)target).SetDriverInCarClientsRpc(playerId, setKeyInSlot, setStarted); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2452258268(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerId = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerId); Vector3 carLocation = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref carLocation); Quaternion carRotation = default(Quaternion); ((FastBufferReader)(ref reader)).ReadValueSafe(ref carRotation); target.__rpc_exec_stage = (__RpcExecStage)1; ((CruiserXLController)(object)target).OnDriverExitServerRpc(playerId, carLocation, carRotation); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1067900697(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerId = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerId); Vector3 carLocation = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref carLocation); Quaternion carRotation = default(Quaternion); ((FastBufferReader)(ref reader)).ReadValueSafe(ref carRotation); bool setIgnitionState = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref setIgnitionState, default(ForPrimitives)); bool setKeyInSlot = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref setKeyInSlot, default(ForPrimitives)); bool cabinLightOn = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref cabinLightOn, default(ForPrimitives)); bool preIgnition = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref preIgnition, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((CruiserXLController)(object)target).OnDriverExitRpc(playerId, carLocation, carRotation, setIgnitionState, setKeyInSlot, cabinLightOn, preIgnition); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_4234258805(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int middlePassengerInCarServerRpc = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref middlePassengerInCarServerRpc); target.__rpc_exec_stage = (__RpcExecStage)1; ((CruiserXLController)(object)target).SetMiddlePassengerInCarServerRpc(middlePassengerInCarServerRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1070323261(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int middlePassengerInCarRpc = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref middlePassengerInCarRpc); target.__rpc_exec_stage = (__RpcExecStage)1; ((CruiserXLController)(object)target).SetMiddlePassengerInCarRpc(middlePassengerInCarRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2405236776(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerId = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerId); Vector3 exitPoint = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref exitPoint); target.__rpc_exec_stage = (__RpcExecStage)1; ((CruiserXLController)(object)target).OnMiddlePassengerExitRpc(playerId, exitPoint); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3385475783(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int passengerInCarServerRpc = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref passengerInCarServerRpc); target.__rpc_exec_stage = (__RpcExecStage)1; ((CruiserXLController)(object)target).SetPassengerInCarServerRpc(passengerInCarServerRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1614408832(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int passengerInCarRpc = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref passengerInCarRpc); target.__rpc_exec_stage = (__RpcExecStage)1; ((CruiserXLController)(object)target).SetPassengerInCarRpc(passengerInCarRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_732754567(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerId = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerId); Vector3 exitPoint = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref exitPoint); target.__rpc_exec_stage = (__RpcExecStage)1; ((CruiserXLController)(object)target).OnPassengerExitRpc(playerId, exitPoint); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3176739277(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerId = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerId); target.__rpc_exec_stage = (__RpcExecStage)1; ((CruiserXLController)(object)target).CancelSetPlayerInVehicleClientRpc(playerId); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_203598337(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerId = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerId); target.__rpc_exec_stage = (__RpcExecStage)1; ((CruiserXLController)(object)target).OnDriverLeaveGameServerRpc(playerId); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1187821516(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerId = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerId); Vector3 carLocation = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref carLocation); Quaternion carRotation = default(Quaternion); ((FastBufferReader)(ref reader)).ReadValueSafe(ref carRotation); bool setIgnitionState = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref setIgnitionState, default(ForPrimitives)); bool setKeyInSlot = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref setKeyInSlot, default(ForPrimitives)); bool cabinLightOn = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref cabinLightOn, default(ForPrimitives)); bool preIgnition = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref preIgnition, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((CruiserXLController)(object)target).OnDriverLeaveGameRpc(playerId, carLocation, carRotation, setIgnitionState, setKeyInSlot, cabinLightOn, preIgnition); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2421407223(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerId = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerId); target.__rpc_exec_stage = (__RpcExecStage)1; ((CruiserXLController)(object)target).OnMiddlePassengerLeaveGameRpc(playerId); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3986388574(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerId = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerId); target.__rpc_exec_stage = (__RpcExecStage)1; ((CruiserXLController)(object)target).OnPassengerLeaveGameRpc(playerId); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1802936242(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerId = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerId); int setGear = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref setGear); int gearAnimation = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref gearAnimation); bool upShifting = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref upShifting, default(ForPrimitives)); bool isNeutral = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref isNeutral, default(ForPrimitives)); bool isReverse = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref isReverse, default(ForPrimitives)); int crunchId = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref crunchId); target.__rpc_exec_stage = (__RpcExecStage)1; ((CruiserXLController)(object)target).ShiftToGearRpc(playerId, setGear, gearAnimation, upShifting, isNeutral, isReverse, crunchId); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_4167936217(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int gearHealth = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref gearHealth); target.__rpc_exec_stage = (__RpcExecStage)1; ((CruiserXLController)(object)target).DealGearboxDamageRpc(gearHealth); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_231877460(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { Vector3 targetPosition = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref targetPosition); Vector3 targetRotation = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref targetRotation); Vector3 startPosition = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref startPosition); Quaternion startRotation = default(Quaternion); ((FastBufferReader)(ref reader)).ReadValueSafe(ref startRotation); Vector3 tempRotation = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref tempRotation); Vector3 avgVel = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref avgVel); target.__rpc_exec_stage = (__RpcExecStage)1; ((CruiserXLController)(object)target).MagnetCarRpc(targetPosition, targetRotation, startPosition, startRotation, tempRotation, avgVel); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_344299242(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool overdriveSwitchRpc = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref overdriveSwitchRpc, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((CruiserXLController)(object)target).SetOverdriveSwitchRpc(overdriveSwitchRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1393669511(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int setGearHP = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref setGearHP); target.__rpc_exec_stage = (__RpcExecStage)1; ((CruiserXLController)(object)target).AddTransmissionOilRpc(setGearHP); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2664742903(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int setHP = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref setHP); target.__rpc_exec_stage = (__RpcExecStage)1; ((CruiserXLController)(object)target).AddEngineOilRpc(setHP); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2998005556(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int setTurboBoosts = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref setTurboBoosts); target.__rpc_exec_stage = (__RpcExecStage)1; ((CruiserXLController)(object)target).AddTurboBoostRpc(setTurboBoosts); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1137787820(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool heaterRpc = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref heaterRpc, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((CruiserXLController)(object)target).SetHeaterRpc(heaterRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3963678435(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { float heaterFanSpeedRpc = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref heaterFanSpeedRpc, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((CruiserXLController)(object)target).SetHeaterFanSpeedRpc(heaterFanSpeedRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3569046119(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { float heaterDirectionRpc = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref heaterDirectionRpc, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((CruiserXLController)(object)target).SetHeaterDirectionRpc(heaterDirectionRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2821576097(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((CruiserXLController)(object)target).UseTurboBoostRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_500051534(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool honkRpc = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref honkRpc, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((CruiserXLController)(object)target).SetHonkRpc(honkRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2905751979(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerId = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerId); bool onTruck = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref onTruck, default(ForPrimitives)); bool inCab = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref inCab, default(ForPrimitives)); bool inStorage = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref inStorage, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((CruiserXLController)(object)target).SyncPlayerZoneRpc(playerId, onTruck, inCab, inStorage); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_4242820360(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerId = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerId); float lookInput = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref lookInput, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((CruiserXLController)(object)target).SyncPlayerLookInputRpc(playerId, lookInput); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3102248458(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerId = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerId); int animIndex = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref animIndex); bool isTrigger = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref isTrigger, default(ForPrimitives)); bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag, default(ForPrimitives)); string upperStringName = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref upperStringName, false); } bool flag2 = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag2, default(ForPrimitives)); string leftStringName = null; if (flag2) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref leftStringName, false); } bool flag3 = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag3, default(ForPrimitives)); string rightStringName = null; if (flag3) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref rightStringName, false); } target.__rpc_exec_stage = (__RpcExecStage)1; ((CruiserXLController)(object)target).SyncPlayerVehicleAnimationsRpc(playerId, animIndex, isTrigger, upperStringName, leftStringName, rightStringName); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_4199638913(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { float songTime = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref songTime, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((CruiserXLController)(object)target).SyncRadioTimeRpc(songTime); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1953632049(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool isFmStation = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref isFmStation, default(ForPrimitives)); int radioStation = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref radioStation); float lastTime = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref lastTime, default(ForPrimitives)); float currentTime = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref currentTime, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((CruiserXLController)(object)target).ChangeRadioTypeRpc(isFmStation, radioStation, lastTime, currentTime); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2140426134(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int radioStationRpc = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref radioStationRpc); target.__rpc_exec_stage = (__RpcExecStage)1; ((CruiserXLController)(object)target).SetRadioStationRpc(radioStationRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1383733861(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { float lastTime = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref lastTime, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((CruiserXLController)(object)target).TrySetFMRadioRpc(lastTime); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3819348054(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool on = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref on, default(ForPrimitives)); int currentClip = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref currentClip); float songTime = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref songTime, default(ForPrimitives)); float lastRadioTime = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref lastRadioTime, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((CruiserXLController)(object)target).SetRadioRpc(on, currentClip, songTime, lastRadioTime); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1849009000(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((CruiserXLController)(object)target).BeginAlarmRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3563070839(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { float motorTorque = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref motorTorque, default(ForPrimitives)); float brakeTorque = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref brakeTorque, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((CruiserXLController)(object)target).SyncWheelTorqueRpc(motorTorque, brakeTorque); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2253232283(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { float frontWheelSpeed = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref frontWheelSpeed, default(ForPrimitives)); float backWheelSpeed = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref backWheelSpeed, default(ForPrimitives)); float wheelSpeed = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref wheelSpeed, default(ForPrimitives)); float engineSpeed = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref engineSpeed, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((CruiserXLController)(object)target).SyncCarDrivetrainRpc(frontWheelSpeed, backWheelSpeed, wheelSpeed, engineSpeed); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2229834372(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((CruiserXLController)(object)target).StallEngineRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1154936118(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { float wheelRotation = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref wheelRotation, default(ForPrimitives)); bool smoothRot = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref smoothRot, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((CruiserXLController)(object)target).SyncCarEffectsRpc(wheelRotation, smoothRot); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1252950827(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { Vector2 playerInput = default(Vector2); ((FastBufferReader)(ref reader)).ReadValueSafe(ref playerInput); bool gasPressed = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref gasPressed, default(ForPrimitives)); bool brakePressed = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref brakePressed, default(ForPrimitives)); bool clutchPressed = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref clutchPressed, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((CruiserXLController)(object)target).SyncPlayerInputsRpc(playerInput, gasPressed, brakePressed, clutchPressed); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3777613204(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { Vector3 carPosition = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref carPosition); Vector3 carRotation = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref carRotation); target.__rpc_exec_stage = (__RpcExecStage)1; ((CruiserXLController)(object)target).SyncCarPositionRpc(carPosition, carRotation); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3195815204(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { float stress = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref stress, default(ForPrimitives)); bool wheelSkidding = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref wheelSkidding, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((CruiserXLController)(object)target).SetTyreStressRpc(stress, wheelSkidding); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3911754106(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { Vector3 vel = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref vel); target.__rpc_exec_stage = (__RpcExecStage)1; ((CruiserXLController)(object)target).CarBumpRpc(vel); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1897686969(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { Vector3 vel = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref vel); float magn = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref magn, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((CruiserXLController)(object)target).CarCollisionRpc(vel, magn); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1190235238(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((CruiserXLController)(object)target).ShatterWindshieldRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_934350138(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((CruiserXLController)(object)target).BreakWindshieldRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2311967180(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { Vector3 audioPosition = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref audioPosition); int audio = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref audio); int audioType = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref audioType); float vol = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref vol, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((CruiserXLController)(object)target).CarCollisionSFXRpc(audioPosition, audio, audioType, vol); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2956878147(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int carHealth = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref carHealth); target.__rpc_exec_stage = (__RpcExecStage)1; ((CruiserXLController)(object)target).DealDamageRpc(carHealth); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1629085561(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((CruiserXLController)(object)target).DestroyCarRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_827845429(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int carHealth = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref carHealth); target.__rpc_exec_stage = (__RpcExecStage)1; ((CruiserXLController)(object)target).SyncCarHealthRpc(carHealth); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3637472327(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool hoodOnFireRpc = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref hoodOnFireRpc, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((CruiserXLController)(object)target).SetHoodOnFireRpc(hoodOnFireRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_23543307(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool underStress = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref underStress, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((CruiserXLController)(object)target).SyncExtremeStressRpc(underStress); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3306296137(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { Vector3 pushPosition = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref pushPosition); Vector3 dir = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref dir); int clip = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref clip); target.__rpc_exec_stage = (__RpcExecStage)1; ((CruiserXLController)(object)target).PushTruckRpc(pushPosition, dir, clip); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3587297227(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { Vector3 pos = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref pos); int clip = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref clip); target.__rpc_exec_stage = (__RpcExecStage)1; ((CruiserXLController)(object)target).PushTruckFromOwnerRpc(pos, clip); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1570871273(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool hoodOpenRpc = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref hoodOpenRpc, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((CruiserXLController)(object)target).SetHoodOpenRpc(hoodOpenRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_26954103(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool hazardLightsRpc = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref hazardLightsRpc, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((CruiserXLController)(object)target).SetHazardLightsRpc(hazardLightsRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2382088157(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool setLowBeamsOn = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref setLowBeamsOn, default(ForPrimitives)); bool setHighBeamsOn = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref setHighBeamsOn, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((CruiserXLController)(object)target).ToggleHeadlightsRpc(setLowBeamsOn, setHighBeamsOn); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "CruiserXLController"; } } public enum ElectronicVoiceAlert { AllSystemsOk, FastenBelts, ThankYou, ParkBrakeOn, KeyInIgnition, HeadlampsOn, DriverDoorAjar, PassengerDoorAjar, BackRightDoorAjar, RearHatchAjar, EngineCoolantLevel, TransFluidLevel, FuelLevel, ChargeSysMalfunction, EngineOilPressure, EngineTempAboveNormal, EngineOverheating, EngineOilLevel, DiskBrakePads, WasherFluidLow } public enum TruckGearShift { Park = 4, Reverse = 3, Neutral = 2, Drive = 1 } public enum VoiceAlertPriority { None, Low, DoorAlert, Medium, IsIgnition, IsService, Override, IsImportant } namespace ScanVan { [BepInPlugin("scandal.scanvan", "ScanVan", "1.5.2")] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] public class Plugin : BaseUnityPlugin { internal static VehicleControls VehicleControlsInstance; public static Plugin Instance { get; private set; } internal static ManualLogSource Logger { get; private set; } internal static Harmony? Harmony { get; set; } public void Awake() { Logger = ((BaseUnityPlugin)this).Logger; Instance = this; AssetBundle val = AssetBundle.LoadFromFile(Path.Combine(Path.GetDirectoryName(((BaseUnityPlugin)this).Info.Location), "scanvananimationbundle")); if ((Object)(object)val == (Object)null) { Logger.LogError((object)"[AssetBundle] Failed to load asset bundle: scanvananimationbundle"); return; } References.truckPlayerAnimator = val.LoadAsset("truckPlayerMetarig.controller"); if ((Object)(object)References.truckPlayerAnimator != (Object)null) { Logger.LogInfo((object)"[AssetBundle] Successfully loaded runtime controller: truckPlayerMetarig"); VehicleControlsInstance = new VehicleControls(); UserConfig.InitConfig(); NetworkVariableInitalizer.Init(); Patch(); RadioManager.PreloadStations(); Logger.LogInfo((object)"scandal.scanvan v1.5.2 has loaded!"); } else { Logger.LogError((object)"[AssetBundle] Failed to load runtime controller: truckPlayerMetarig"); } } internal static void Patch() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Expected O, but got Unknown if (Harmony == null) { Harmony = new Harmony("scandal.scanvan"); } Logger.LogDebug((object)"Patching..."); Harmony.PatchAll(); if (IsModPresent("voxx.LethalElementsPlugin")) { LethalElementsCompatibility.PatchAllCompatibilityMethods(Harmony); } if (IsModPresent("NoteBoxz.LethalMin")) { LethalMinCompatibility.PatchAllCompatibilityMethods(Harmony); } if (IsModPresent("ImmersiveVisor")) { ImmersiveVisorCompatibility.PatchAllCompatibilityMethods(Harmony); } Logger.LogDebug((object)"Finished patching!"); } internal static void Unpatch() { Logger.LogDebug((object)"Unpatching..."); Harmony? harmony = Harmony; if (harmony != null) { harmony.UnpatchSelf(); } Logger.LogDebug((object)"Finished unpatching!"); } internal static bool IsModPresent(string name) { return Chainloader.PluginInfos.ContainsKey(name); } } public static class MyPluginInfo { public const string PLUGIN_GUID = "scandal.scanvan"; public const string PLUGIN_NAME = "ScanVan"; public const string PLUGIN_VERSION = "1.5.2"; } } namespace ScanVan.Utils { public static class CameraUtils { private static readonly Plane[] frustumPlanes = (Plane[])(object)new Plane[6]; public static bool IsVisibleToPlayersLocalCamera(this Renderer renderer, Camera playersCamera) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) Bounds bounds = renderer.bounds; GeometryUtility.CalculateFrustumPlanes(playersCamera, frustumPlanes); if (GeometryUtility.TestPlanesAABB(frustumPlanes, bounds)) { return true; } return false; } } public static class PlayerUtils { private struct AnimationInfo { public string stateName; public float normalizedTime; } public static bool seatedInTruck = false; public static bool disableAnimationSync; public static bool isPlayerOnTruck; public static bool isPlayerInCab; public static bool isPlayerInStorage; public static readonly int stopAnimationID = Animator.StringToHash("SA_stopAnimation"); private static float[] storedParameters = new float[0]; private static bool[] storedBools = new bool[0]; private static int[] storedInts = new int[0]; private static AnimationInfo[] storedAnimations = new AnimationInfo[0]; public static void ResetHUDToolTips(PlayerControllerB player) { if (!((Object)(object)player == (Object)null) && !player.isPlayerDead && player.isPlayerControlled) { if ((Object)(object)player.currentlyHeldObjectServer != (Object)null) { player.currentlyHeldObjectServer.SetControlTipsForItem(); } else { HUDManager.Instance.ClearControlTips(); } } } public static void StoreParameters(Animator playerAnimator) { //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Expected I4, but got Unknown //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) AnimatorControllerParameter[] parameters = playerAnimator.parameters; storedParameters = new float[parameters.Length]; storedBools = new bool[parameters.Length]; storedInts = new int[parameters.Length]; storedAnimations = new AnimationInfo[playerAnimator.layerCount]; for (int i = 0; i < parameters.Length; i++) { AnimatorControllerParameter val = parameters[i]; AnimatorControllerParameterType type = val.type; AnimatorControllerParameterType val2 = type; switch (val2 - 1) { case 0: storedParameters[i] = playerAnimator.GetFloat(val.name); break; case 3: storedBools[i] = playerAnimator.GetBool(val.name); break; case 2: storedInts[i] = playerAnimator.GetInteger(val.name); break; } } for (int j = 0; j < playerAnimator.layerCount; j++) { AnimatorStateInfo currentAnimatorStateInfo = playerAnimator.GetCurrentAnimatorStateInfo(j); AnimationInfo animationInfo = default(AnimationInfo); animationInfo.stateName = ((AnimatorStateInfo)(ref currentAnimatorStateInfo)).fullPathHash.ToString(); animationInfo.normalizedTime = ((AnimatorStateInfo)(ref currentAnimatorStateInfo)).normalizedTime; AnimationInfo animationInfo2 = animationInfo; storedAnimations[j] = animationInfo2; } } public static void RestoreParameters(Animator playerAnimator) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Expected I4, but got Unknown AnimatorControllerParameter[] parameters = playerAnimator.parameters; for (int i = 0; i < parameters.Length; i++) { AnimatorControllerParameter val = parameters[i]; AnimatorControllerParameterType type = val.type; AnimatorControllerParameterType val2 = type; switch (val2 - 1) { case 0: playerAnimator.SetFloat(val.name, storedParameters[i]); break; case 3: playerAnimator.SetBool(val.name, storedBools[i]); break; case 2: playerAnimator.SetInteger(val.name, storedInts[i]); break; } } for (int j = 0; j < playerAnimator.layerCount; j++) { AnimationInfo animationInfo = storedAnimations[j]; playerAnimator.Play(int.Parse(animationInfo.stateName), j, animationInfo.normalizedTime); } } public static void ResetPlayerData(PlayerControllerB player) { PlayerControllerBPatches.PlayerControllerBData data = PlayerControllerBPatches.GetData(player); data.currentCarAnimation = -1; player.ladderCameraHorizontal = 0f; data.vehicleCameraHorizontal = 0f; data.lastVehicleCameraHorizontal = 0f; } } public static class References { internal static ItemDropship itemShip = null; internal static CruiserXLController truckController = null; internal static CadaverGrowthAI cadaverGrowthAI = null; internal static HashSet itemsInTruck = new HashSet(); internal static PlayerControllerB lastDriver = null; internal static AudioMixerGroup diageticSFXGroup = null; internal static RuntimeAnimatorController truckPlayerAnimator = null; } public static class SaveManager { private static string SavePrefix = "ScanvanData."; public static void Save(string key, T data) { ES3.Save(SavePrefix + key, data, GameNetworkManager.Instance.currentSaveFileName); } public static bool TryLoad(string key, out T data) { if (!ES3.KeyExists(SavePrefix + key, GameNetworkManager.Instance.currentSaveFileName)) { data = default(T); return false; } data = ES3.Load(SavePrefix + key, GameNetworkManager.Instance.currentSaveFileName); return true; } public static void Delete(string key) { ES3.DeleteKey(SavePrefix + key, GameNetworkManager.Instance.currentSaveFileName); } } internal class UserConfig { internal static ConfigEntry StreamerRadio; internal static ConfigEntry OldBirdSight; internal static ConfigEntry SeatBoostEnabled; internal static ConfigEntry SeatBoostScale; internal static ConfigEntry PreventKnockback; internal static ConfigEntry VoiceAlertVolume; internal static ConfigEntry RecenterWheel; internal static ConfigEntry SmoothWheel; internal static void InitConfig() { //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Expected O, but got Unknown //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Expected O, but got Unknown ConfigFile config = ((BaseUnityPlugin)Plugin.Instance).Config; config.SaveOnConfigSet = false; StreamerRadio = config.Bind("Host", "DMCA Radio", true, "[Host] If true, will enable streamer-friendly music on the radio, and disable the live-radio system"); OldBirdSight = config.Bind("Host", "Enemy sight", true, "[Host] If true, will allow enemies such as Old Birds to see players in the front seats"); SeatBoostEnabled = config.Bind("General", "Enable Seat Boost", true, "Should the camera be boosted when sat in the truck?"); AcceptableValueRange val = new AcceptableValueRange(1f, 2f); SeatBoostScale = config.Bind("General", "Seat Boost Scale", 1f, new ConfigDescription("How much to boost the seat up? (Default: 1.0)", (AcceptableValueBase)(object)val, Array.Empty())); PreventKnockback = config.Bind("General", "Prevent Seated Knockback", true, "Prevent explosions kicking you out of the front seats?"); AcceptableValueRange val2 = new AcceptableValueRange(0.25f, 1f); VoiceAlertVolume = config.Bind("General", "Voice Alert Volume", 1f, new ConfigDescription("How much to reduce the voice alert volume by? (Full volume: 1.0)", (AcceptableValueBase)(object)val2, Array.Empty())); RecenterWheel = config.Bind("Quality Of Life", "Automatically Center Wheel", false, "Should the wheel be automatically re-centered?"); SmoothWheel = config.Bind("Quality Of Life", "Smooth Wheel", true, "Should the wheels inputs be smoothened?"); ClearOrphanedEntries(config); config.Save(); config.SaveOnConfigSet = true; } private static void ClearOrphanedEntries(ConfigFile config) { PropertyInfo propertyInfo = AccessTools.Property(typeof(ConfigFile), "OrphanedEntries"); Dictionary dictionary = (Dictionary)propertyInfo.GetValue(config); dictionary.Clear(); } } internal class VehicleControls : LcInputActions { [InputAction(/*Could not decode attribute arguments.*/)] public InputAction GasPedalKey { get; set; } = null; [InputAction(/*Could not decode attribute arguments.*/)] public InputAction ReversePedalKey { get; set; } = null; [InputAction(/*Could not decode attribute arguments.*/)] public InputAction SteerLeftKey { get; set; } = null; [InputAction(/*Could not decode attribute arguments.*/)] public InputAction BrakePedalKey { get; set; } = null; [InputAction(/*Could not decode attribute arguments.*/)] public InputAction SteerRightKey { get; set; } = null; [InputAction(/*Could not decode attribute arguments.*/)] public InputAction ClutchPedalKey { get; set; } = null; [InputAction(/*Could not decode attribute arguments.*/)] public InputAction SwitchIgnitionKey { get; set; } = null; [InputAction(/*Could not decode attribute arguments.*/)] public InputAction JumpKey { get; set; } = null; [InputAction(/*Could not decode attribute arguments.*/)] public InputAction GearShiftForwardKey { get; set; } = null; [InputAction(/*Could not decode attribute arguments.*/)] public InputAction GearShiftBackwardKey { get; set; } = null; [InputAction(/*Could not decode attribute arguments.*/)] public InputAction ToggleHeadlightsKey { get; set; } = null; [InputAction(/*Could not decode attribute arguments.*/)] public InputAction ActivateHornKey { get; set; } = null; [InputAction(/*Could not decode attribute arguments.*/)] public InputAction ToggleWipersKey { get; set; } = null; [InputAction(/*Could not decode attribute arguments.*/)] public InputAction ToggleMagnetKey { get; set; } = null; } public static class VehicleUtils { public static float lastCheckTime = 0f; public static float cooldown = 0.25f; public static bool MeetsSpecialConditionsToCheck() { if (Time.realtimeSinceStartup - lastCheckTime < cooldown) { return false; } lastCheckTime = Time.realtimeSinceStartup; return true; } public static bool IsEnemyInVehicle(EnemyAI enemyScript, CruiserXLController controller) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) if (((Collider)controller.collisionTrigger.insideTruckNavMeshBounds).ClosestPoint(((Component)enemyScript).transform.position) == ((Component)enemyScript).transform.position || ((Collider)controller.collisionTrigger.insideTruckNavMeshBounds).ClosestPoint(enemyScript.agent.destination) == enemyScript.agent.destination) { return true; } return false; } public static bool IsPlayerInVehicleBounds() { return PlayerUtils.isPlayerOnTruck; } public static bool IsPlayerSeatedInVehicle(CruiserXLController controller) { return PlayerUtils.seatedInTruck; } public static bool IsSeatedPlayerProtected(PlayerControllerB player, CruiserXLController controller) { bool boolValue = ((VehicleController)controller).driverSideDoor.boolValue; bool boolValue2 = ((VehicleController)controller).passengerSideDoor.boolValue; if (((Object)(object)player == (Object)(object)((VehicleController)controller).currentDriver && boolValue) || ((Object)(object)player == (Object)(object)controller.currentMiddlePassenger && (boolValue || boolValue2)) || ((Object)(object)player == (Object)(object)((VehicleController)controller).currentPassenger && boolValue2)) { return false; } return true; } public static bool IsPlayerProtectedByVehicle(PlayerControllerB player, CruiserXLController controller) { if (((VehicleController)controller).carDestroyed) { return false; } bool boolValue = ((VehicleController)controller).driverSideDoor.boolValue; bool boolValue2 = ((VehicleController)controller).passengerSideDoor.boolValue; bool liftGateOpen = controller.liftGateOpen; bool sideDoorOpen = controller.sideDoorOpen; if (PlayerUtils.isPlayerInCab && (boolValue || boolValue2)) { return false; } if (PlayerUtils.isPlayerInStorage && (liftGateOpen || sideDoorOpen)) { return false; } if (PlayerUtils.isPlayerOnTruck && !PlayerUtils.isPlayerInCab && !PlayerUtils.isPlayerInStorage) { return false; } return true; } public static bool IsPlayerNearTruck(PlayerControllerB player, CruiserXLController vehicle) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) Vector3 position = ((VehicleController)vehicle).mainRigidbody.position; Vector3 position2 = ((Component)player).transform.position; if (Vector3.Distance(position2, position) > 10f) { return false; } return true; } } } namespace ScanVan.Patches { [HarmonyPatch(typeof(BaboonBirdAI))] internal class BaboonBirdAIPatches { [HarmonyPatch("OnCollideWithPlayer")] [HarmonyPrefix] private static bool OnCollideWithPlayer_Prefix(BaboonBirdAI __instance, ref Collider other) { PlayerControllerB val = ((EnemyAI)__instance).MeetsStandardPlayerCollisionConditions(other, ((EnemyAI)__instance).inSpecialAnimation || __instance.doingKillAnimation, false); if ((Object)(object)val == (Object)null) { return true; } if ((Object)(object)References.truckController == (Object)null) { return true; } CruiserXLController truckController = References.truckController; float magnitude = ((Vector3)(ref ((VehicleController)truckController).averageVelocity)).magnitude; if (VehicleUtils.IsPlayerSeatedInVehicle(truckController)) { if (magnitude >= 2f) { return false; } if (VehicleUtils.IsSeatedPlayerProtected(val, truckController)) { return false; } return true; } bool flag = VehicleUtils.IsEnemyInVehicle((EnemyAI)(object)__instance, truckController); if (VehicleUtils.IsPlayerInVehicleBounds()) { if (PlayerUtils.isPlayerInStorage && !flag) { return false; } if (!PlayerUtils.isPlayerInStorage && !PlayerUtils.isPlayerInCab) { return magnitude < 2f; } if (PlayerUtils.isPlayerInCab) { if (magnitude < 2f && (((VehicleController)truckController).driverSideDoor.boolValue || ((VehicleController)truckController).passengerSideDoor.boolValue)) { return true; } return false; } return true; } if (flag) { return false; } return true; } } [HarmonyPatch(typeof(BushWolfEnemy))] public static class BushWolfEnemyPatches { [HarmonyPatch("Update")] [HarmonyPostfix] private static void Update_Postfix(BushWolfEnemy __instance) { if (!__instance.foundSpawningPoint || StartOfRound.Instance.livingPlayers == 0 || !((EnemyAI)__instance).isEnemyDead || ((EnemyAI)__instance).stunNormalizedTimer > 0f || __instance.matingCallTimer >= 0f || ((EnemyAI)__instance).currentBehaviourStateIndex != 2 || __instance.timeSinceKillingPlayer < 2f || __instance.timeSinceTakingDamage < 0.35f || __instance.failedTongueShoot || (Object)(object)((EnemyAI)__instance).targetPlayer == (Object)null || ((EnemyAI)__instance).targetPlayer.isPlayerDead || !((EnemyAI)__instance).targetPlayer.isPlayerControlled || Object.op_Implicit((Object)(object)((EnemyAI)__instance).targetPlayer.inAnimationWithEnemy) || ((EnemyAI)__instance).stunNormalizedTimer > 0f || (Object)(object)References.truckController == (Object)null) { return; } CruiserXLController truckController = References.truckController; if (((Object)(object)((VehicleController)truckController).currentDriver == (Object)(object)((EnemyAI)__instance).targetPlayer || (Object)(object)truckController.currentMiddlePassenger == (Object)(object)((EnemyAI)__instance).targetPlayer || (Object)(object)((VehicleController)truckController).currentPassenger == (Object)(object)((EnemyAI)__instance).targetPlayer) && VehicleUtils.IsSeatedPlayerProtected(((EnemyAI)__instance).targetPlayer, truckController)) { ((EnemyAI)__instance).agent.speed = 0f; __instance.CancelReelingPlayerIn(); if (((NetworkBehaviour)__instance).IsOwner && __instance.tongueLengthNormalized < -0.25f) { ((EnemyAI)__instance).SwitchToBehaviourState(0); return; } } PlayerControllerBPatches.PlayerControllerBData data = PlayerControllerBPatches.GetData(((EnemyAI)__instance).targetPlayer); if ((data.isPlayerInCab && !((VehicleController)truckController).driverSideDoor.boolValue && !((VehicleController)truckController).passengerSideDoor.boolValue) || (data.isPlayerInStorage && !truckController.liftGateOpen && !truckController.sideDoorOpen)) { ((EnemyAI)__instance).agent.speed = 0f; __instance.CancelReelingPlayerIn(); if (((NetworkBehaviour)__instance).IsOwner && __instance.tongueLengthNormalized < -0.25f) { ((EnemyAI)__instance).SwitchToBehaviourState(0); } } } } [HarmonyPatch(typeof(CadaverGrowthAI))] internal class CadaverGrowthAIPatches { [HarmonyPatch("Start")] [HarmonyPostfix] private static void Start_Postfix(CadaverGrowthAI __instance) { if ((Object)(object)References.cadaverGrowthAI == (Object)null) { References.cadaverGrowthAI = __instance; } } [HarmonyPatch("OnDisable")] [HarmonyPostfix] private static void OnDisable_Postfix(CadaverGrowthAI __instance) { if ((Object)(object)References.cadaverGrowthAI == (Object)(object)__instance) { References.cadaverGrowthAI = null; } } } [HarmonyPatch(typeof(ElevatorAnimationEvents))] public static class ElevatorAnimationEventsPatches { [HarmonyPatch("ElevatorFullyRunning")] [HarmonyPrefix] private static void ElevatorFullyRunning_PlayerSafety_Prefix() { if ((Object)(object)References.truckController == (Object)null) { return; } CruiserXLController truckController = References.truckController; if (((VehicleController)truckController).magnetedToShip) { truckController.CollectItemsInTruck(justDepartedIntoOrbit: true); PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController; if (PlayerUtils.seatedInTruck || PlayerUtils.isPlayerOnTruck) { localPlayerController.isInElevator = true; } } } } [HarmonyPatch(typeof(EnemyAI))] public static class EnemyAIPatches { [HarmonyPatch("PlayerIsTargetable")] [HarmonyPostfix] private static void PlayerIsTargetable_Postfix(EnemyAI __instance, PlayerControllerB playerScript, bool cannotBeInShip, bool overrideInsideFactoryCheck, bool checkForMineshaftStartTile, ref bool __result) { if (__instance is BushWolfEnemy && !((Object)(object)References.truckController == (Object)null)) { CruiserXLController truckController = References.truckController; PlayerControllerBPatches.PlayerControllerBData data = PlayerControllerBPatches.GetData(playerScript); if (((Object)(object)((VehicleController)truckController).currentDriver == (Object)(object)playerScript || (Object)(object)truckController.currentMiddlePassenger == (Object)(object)playerScript || (Object)(object)((VehicleController)truckController).currentPassenger == (Object)(object)playerScript) && VehicleUtils.IsSeatedPlayerProtected(playerScript, truckController)) { __result = false; } if ((data.isPlayerInCab && !((VehicleController)truckController).driverSideDoor.boolValue && !((VehicleController)truckController).passengerSideDoor.boolValue) || (data.isPlayerInStorage && !truckController.liftGateOpen && !truckController.sideDoorOpen)) { __result = false; } } } } [HarmonyPatch(typeof(ForestGiantAI))] internal static class ForestGiantAIPatches { [HarmonyPatch("AnimationEventA")] [HarmonyPrefix] private static bool AnimationEventA_Prefix(ForestGiantAI __instance) { PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController; if ((Object)(object)localPlayerController == (Object)null) { return false; } if ((Object)(object)References.truckController == (Object)null) { return true; } if (PlayerUtils.isPlayerInCab || PlayerUtils.isPlayerInStorage || PlayerUtils.seatedInTruck) { return false; } return true; } [HarmonyPatch("OnCollideWithPlayer")] [HarmonyPrefix] private static bool OnCollideWithPlayer_Prefix(ForestGiantAI __instance, ref Collider other) { if ((Object)(object)((EnemyAI)__instance).inSpecialAnimationWithPlayer != (Object)null || __instance.inEatingPlayerAnimation || ((EnemyAI)__instance).stunNormalizedTimer >= 0f || ((EnemyAI)__instance).currentBehaviourStateIndex == 2) { return true; } PlayerControllerB val = ((EnemyAI)__instance).MeetsStandardPlayerCollisionConditions(other, __instance.inEatingPlayerAnimation, false); if ((Object)(object)val == (Object)null) { return true; } if ((Object)(object)References.truckController == (Object)null) { return true; } CruiserXLController truckController = References.truckController; if (VehicleUtils.IsPlayerSeatedInVehicle(truckController)) { if (((VehicleController)truckController).windshieldBroken && ((Vector3)(ref ((VehicleController)truckController).averageVelocity)).magnitude <= 10f) { return true; } if (VehicleUtils.IsSeatedPlayerProtected(val, truckController)) { return false; } return true; } if (VehicleUtils.IsPlayerInVehicleBounds()) { if (PlayerUtils.isPlayerInCab && ((VehicleController)truckController).windshieldBroken && ((Vector3)(ref ((VehicleController)truckController).averageVelocity)).magnitude <= 10f) { return true; } if (VehicleUtils.IsPlayerProtectedByVehicle(val, truckController)) { return false; } return true; } return true; } } [HarmonyPatch(typeof(GameNetworkManager))] internal class GameNetworkManagerPatches { [HarmonyPatch("Start")] [HarmonyPostfix] public static void Start_Postfix() { SCVNetworker.Init(); } [HarmonyPatch("SaveItemsInShip")] [HarmonyPostfix] private static void SaveItemsInShip_Postfix(GameNetworkManager __instance) { //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) try { CruiserXLController cruiserXLController = default(CruiserXLController); if (Object.op_Implicit((Object)(object)StartOfRound.Instance.attachedVehicle) && ((Component)StartOfRound.Instance.attachedVehicle).TryGetComponent(ref cruiserXLController)) { SaveManager.Save("AttachedVehicleRotation", ((Quaternion)(ref ((VehicleController)cruiserXLController).magnetTargetRotation)).eulerAngles); SaveManager.Save("AttachedVehiclePosition", ((VehicleController)cruiserXLController).magnetTargetPosition); SaveManager.Save("AttachedVehicleTurbo", ((VehicleController)cruiserXLController).turboBoosts); SaveManager.Save("AttachedVehicleVariant", cruiserXLController.isSpecial); SaveManager.Save("AttachedVehicleIgnition", ((VehicleController)cruiserXLController).ignitionStarted); SaveManager.Save("AttachedVehicleSteeringRotation", ((VehicleController)cruiserXLController).steeringWheelAnimFloat); SaveManager.Save("AttachedVehicleHealth", ((VehicleController)cruiserXLController).carHP); Plugin.Logger.LogMessage((object)"Successfully saved Scanvan data."); } else { SaveManager.Delete("AttachedVehicleRotation"); SaveManager.Delete("AttachedVehiclePosition"); SaveManager.Delete("AttachedVehicleTurbo"); SaveManager.Delete("AttachedVehicleVariant"); SaveManager.Delete("AttachedVehicleIgnition"); SaveManager.Delete("AttachedVehicleSteeringRotation"); SaveManager.Delete("AttachedVehicleHealth"); Plugin.Logger.LogMessage((object)"Successfully deleted Scanvan data."); } } catch (Exception ex) { Plugin.Logger.LogError((object)("Exception caught saving Scanvan data:\n" + ex)); } } } [HarmonyPatch(typeof(GiantKiwiAI))] internal static class GiantKiwiAIPatches { [HarmonyPatch("NavigateTowardsTargetPlayer")] [HarmonyPrefix] private static bool NavigateTowardsTargetPlayer_Prefix(GiantKiwiAI __instance) { //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_016b: Unknown result type (might be due to invalid IL or missing references) //IL_0177: Unknown result type (might be due to invalid IL or missing references) //IL_017c: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)References.truckController == (Object)null) { return true; } CruiserXLController truckController = References.truckController; if (((EnemyAI)__instance).setDestinationToPlayerInterval <= 0f) { if (Vector3.Distance(((Component)((EnemyAI)__instance).targetPlayer).transform.position, ((Component)truckController).transform.position) < 10f) { ((EnemyAI)__instance).setDestinationToPlayerInterval = 0.25f; bool flag = (Object)(object)((VehicleController)truckController).currentDriver == (Object)(object)((EnemyAI)__instance).targetPlayer || (Object)(object)truckController.currentMiddlePassenger == (Object)(object)((EnemyAI)__instance).targetPlayer || (Object)(object)((VehicleController)truckController).currentPassenger == (Object)(object)((EnemyAI)__instance).targetPlayer; bool flag2 = truckController.vehicleBounds.ClosestPoint(((Component)((EnemyAI)__instance).targetPlayer).transform.position) == ((Component)((EnemyAI)__instance).targetPlayer).transform.position; bool flag3 = ((VehicleController)truckController).ontopOfTruckCollider.ClosestPoint(((Component)((EnemyAI)__instance).targetPlayer).transform.position) == ((Component)((EnemyAI)__instance).targetPlayer).transform.position; bool isPlayerInStorage = PlayerUtils.isPlayerInStorage; bool flag4 = PlayerUtils.isPlayerInCab && !PlayerUtils.seatedInTruck; int num = -1; if (flag || flag2 || isPlayerInStorage || flag4 || flag3) { __instance.targetPlayerIsInTruck = true; num = -33; } ((EnemyAI)__instance).destination = RoundManager.Instance.GetNavMeshPosition(((Component)((EnemyAI)__instance).targetPlayer).transform.position, RoundManager.Instance.navHit, 5.5f, num); return false; } return true; } return true; } [HarmonyPatch("IsEggInsideClosedTruck")] [HarmonyPrefix] private static bool IsEggInsideClosedTruck_Prefix(GiantKiwiAI __instance, KiwiBabyItem egg, bool closedTruck, ref bool __result) { if ((Object)(object)References.truckController == (Object)null) { return true; } CruiserXLController truckController = References.truckController; if ((Object)(object)((GrabbableObject)egg).parentObject == (Object)(object)((Component)((VehicleController)truckController).physicsRegion.parentNetworkObject).transform) { __result = !closedTruck || !truckController.liftGateOpen; return false; } return true; } [HarmonyPatch("AnimationEventB")] [HarmonyPrefix] private static void AnimationEventB_Prefix(GiantKiwiAI __instance) { if ((Object)(object)References.truckController == (Object)null) { return; } PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController; if ((Object)(object)localPlayerController == (Object)null || !localPlayerController.isPlayerControlled || localPlayerController.isPlayerDead) { return; } CruiserXLController truckController = References.truckController; float magnitude = ((Vector3)(ref ((VehicleController)truckController).averageVelocity)).magnitude; if (VehicleUtils.IsPlayerSeatedInVehicle(truckController)) { if (magnitude < 10f && VehicleUtils.IsSeatedPlayerProtected(localPlayerController, truckController)) { __instance.timeSinceHittingPlayer = 0.4f; return; } if (magnitude >= 10f) { __instance.timeSinceHittingPlayer = 0.4f; } } bool flag = VehicleUtils.IsEnemyInVehicle((EnemyAI)(object)__instance, truckController); if (VehicleUtils.IsPlayerInVehicleBounds()) { if (PlayerUtils.isPlayerInStorage && !flag) { __instance.timeSinceHittingPlayer = 0.4f; } if (PlayerUtils.isPlayerInCab && (magnitude >= 10f || (!((VehicleController)truckController).driverSideDoor.boolValue && !((VehicleController)truckController).passengerSideDoor.boolValue && !truckController.driversSideWindowTrigger.boolValue && !truckController.passengersSideWindowTrigger.boolValue))) { __instance.timeSinceHittingPlayer = 0.4f; } } else if (flag) { __instance.timeSinceHittingPlayer = 0.4f; } } } [HarmonyPatch(typeof(GrabbableObject))] public static class GrabbableObjectPatches { [HarmonyPatch("Update")] [HarmonyPostfix] private static void Update_Prefix(GrabbableObject __instance) { if (!((Object)(object)__instance == (Object)null) && !((Object)(object)References.truckController == (Object)null)) { CruiserXLController truckController = References.truckController; if (!((Object)(object)((Component)__instance).transform.parent == (Object)(object)((Component)truckController).transform) || __instance.isHeld || __instance.isHeldByEnemy) { References.itemsInTruck.Remove(__instance); } else { References.itemsInTruck.Add(__instance); } } } } [HarmonyPatch(typeof(HUDManager))] public class HUDManagerPatches { [HarmonyPatch("HelmetCondensationDrops")] [HarmonyPostfix] private static void HelmetCondensationDrops_Postfix(HUDManager __instance) { if (!((Object)(object)References.truckController == (Object)null) && (PlayerUtils.isPlayerInCab || PlayerUtils.isPlayerInStorage)) { __instance.increaseHelmetCondensation = false; } } } [HarmonyPatch(typeof(InteractTrigger))] public class InteractTriggerPatches { private static VehiclePlayerSeat currentPlayerSeat = null; public static Coroutine specialInteractCoroutine = null; public static float interactTime = 0.6f; public static float timeSinceSpecialInteraction; [HarmonyPatch("Interact")] [HarmonyPrefix] private static bool Interact_Prefix(InteractTrigger __instance, ref Transform playerTransform, bool __runOriginal) { if (!__runOriginal) { return false; } PlayerControllerB component = ((Component)playerTransform).GetComponent(); if ((Object)(object)component == (Object)null || component.isPlayerDead || !component.isPlayerControlled || (Object)(object)component != (Object)(object)GameNetworkManager.Instance.localPlayerController) { return true; } component.playerBodyAnimator.ResetTrigger(PlayerUtils.stopAnimationID); if ((Object)(object)component != (Object)(object)GameNetworkManager.Instance.localPlayerController) { return true; } if (component.inSpecialInteractAnimation && !component.isClimbingLadder && !__instance.allowUseWhileInAnimation) { return true; } if (!__instance.setVehicleAnimation || (Object)(object)__instance.overridePlayerParent == (Object)null) { return true; } CruiserXLController cruiserXLController = default(CruiserXLController); if (!((Component)__instance.overridePlayerParent).TryGetComponent(ref cruiserXLController)) { return true; } if (specialInteractCoroutine != null) { ((MonoBehaviour)cruiserXLController).StopCoroutine(specialInteractCoroutine); } timeSinceSpecialInteraction = Time.realtimeSinceStartup; if (__instance.interactCooldown) { if (__instance.currentCooldownValue >= 0f) { return false; } __instance.currentCooldownValue = __instance.cooldownTime; } component.ResetFallGravity(); ((UnityEvent)(object)__instance.onInteractEarly).Invoke((PlayerControllerB)null); return false; } public static IEnumerator SpecialTruckInteractAnimation(InteractTrigger trigger, PlayerControllerB playerController, CruiserXLController controller, VehiclePlayerSeat playerSeat) { playerSeat.ReplacePlayerAnimator(playerController, isLocalPlayer: true, trigger); currentPlayerSeat = playerSeat; trigger.UpdateUsedByPlayerServerRpc((int)playerController.playerClientId); trigger.isPlayingSpecialAnimation = true; trigger.lockedPlayer = playerController.thisPlayerBody; trigger.playerScriptInSpecialAnimation = playerController; if (trigger.clampLooking) { trigger.playerScriptInSpecialAnimation.minVerticalClamp = trigger.minVerticalClamp; trigger.playerScriptInSpecialAnimation.maxVerticalClamp = trigger.maxVerticalClamp; trigger.playerScriptInSpecialAnimation.horizontalClamp = trigger.horizontalClamp; trigger.playerScriptInSpecialAnimation.clampLooking = true; } trigger.playerScriptInSpecialAnimation.overridePhysicsParent = trigger.overridePlayerParent; trigger.playerScriptInSpecialAnimation.inVehicleAnimation = trigger.setVehicleAnimation; if (trigger.hidePlayerItem && (Object)(object)trigger.playerScriptInSpecialAnimation.currentlyHeldObjectServer != (Object)null) { trigger.playerScriptInSpecialAnimation.currentlyHeldObjectServer.EnableItemMeshes(false); } playerController.UpdateSpecialAnimationValue(true, (short)trigger.playerPositionNode.eulerAngles.y, 0f, false); playerController.inSpecialInteractAnimation = true; playerController.currentTriggerInAnimationWith = trigger; playerController.playerBodyAnimator.ResetTrigger(PlayerUtils.stopAnimationID); playerController.playerBodyAnimator.ResetTrigger(trigger.animationString); playerController.playerBodyAnimator.SetTrigger(trigger.animationString); HUDManager.Instance.ClearControlTips(); if (!trigger.stopAnimationManually) { yield return (object)new WaitForSeconds(trigger.animationWaitTime); trigger.StopSpecialAnimation(); } yield return (object)new WaitForSeconds(interactTime); specialInteractCoroutine = null; } [HarmonyPatch("Update")] [HarmonyPrefix] private static void Update_Prefix(InteractTrigger __instance) { CruiserXLController cruiserXLController = default(CruiserXLController); if ((Object)(object)__instance == (Object)null || (Object)(object)((NetworkBehaviour)__instance).NetworkManager == (Object)null || !((NetworkBehaviour)__instance).NetworkManager.IsListening || (Object)(object)__instance.lockedPlayer == (Object)null || !__instance.isPlayingSpecialAnimation || __instance.playerScriptInSpecialAnimation.isPlayerControlled || !__instance.playerScriptInSpecialAnimation.disconnectedMidGame || !__instance.setVehicleAnimation || (Object)(object)__instance.overridePlayerParent == (Object)null || !((Component)__instance.overridePlayerParent).TryGetComponent(ref cruiserXLController)) { return; } PlayerControllerB playerScriptInSpecialAnimation = __instance.playerScriptInSpecialAnimation; if (!((Object)(object)playerScriptInSpecialAnimation == (Object)null)) { __instance.StopUsingClientRpc((int)__instance.playerScriptInSpecialAnimation.playerClientId); if ((Object)(object)__instance == (Object)(object)((VehicleController)cruiserXLController).driverSeatTrigger) { cruiserXLController.OnDriverLeaveGameServerRpc((int)playerScriptInSpecialAnimation.playerClientId); } else if ((Object)(object)__instance == (Object)(object)cruiserXLController.middlePassengerSeatTrigger) { cruiserXLController.OnMiddlePassengerLeaveGameRpc((int)playerScriptInSpecialAnimation.playerClientId); } else if ((Object)(object)__instance == (Object)(object)((VehicleController)cruiserXLController).passengerSeatTrigger) { cruiserXLController.OnMiddlePassengerLeaveGameRpc((int)playerScriptInSpecialAnimation.playerClientId); } } } [HarmonyPatch("Update")] [HarmonyPostfix] private static void Update_Postfix(InteractTrigger __instance) { TalkieRadio talkieRadio = __instance as TalkieRadio; if (talkieRadio != null) { } } [HarmonyPatch("StopSpecialAnimation")] [HarmonyPrefix] private static bool StopSpecialAnimation_Prefix(InteractTrigger __instance, bool __runOriginal) { if (!__runOriginal) { return false; } if ((Object)(object)__instance == (Object)null) { return true; } if ((Object)(object)__instance.lockedPlayer == (Object)null) { return true; } if (__instance.isGettingDestroyed) { return true; } PlayerControllerB component = ((Component)__instance.lockedPlayer).GetComponent(); if ((Object)(object)component == (Object)null || !component.isPlayerControlled) { return true; } if ((Object)(object)component != (Object)(object)GameNetworkManager.Instance.localPlayerController) { return true; } if (!__instance.setVehicleAnimation || (Object)(object)__instance.overridePlayerParent == (Object)null) { return true; } CruiserXLController cruiserXLController = default(CruiserXLController); if (!((Component)__instance.overridePlayerParent).TryGetComponent(ref cruiserXLController)) { return true; } if (specialInteractCoroutine != null) { ((MonoBehaviour)__instance).StopCoroutine(specialInteractCoroutine); specialInteractCoroutine = null; } if ((Object)(object)currentPlayerSeat == (Object)null) { return true; } currentPlayerSeat.ReturnPlayerAnimator(component, isLocalPlayer: true, __instance); return true; } } [HarmonyPatch(typeof(ItemDropship))] public class ItemDropshipPatches { [HarmonyPatch("Start")] [HarmonyPrefix] private static void Start_Prefix(ItemDropship __instance) { if (!((Object)(object)__instance == (Object)null)) { References.itemShip = __instance; } } } [HarmonyPatch(typeof(Landmine))] public class LandminePatches { [HarmonyPatch("SpawnExplosion")] [HarmonyPostfix] private static void SpawnExplosion_Postfix(Landmine __instance, ref Vector3 explosionPosition, bool spawnExplosionEffect, ref float killRange, ref float damageRange, int nonLethalDamage, float physicsForce, GameObject overridePrefab, bool goThroughCar) { //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) if (NetworkManager.Singleton.IsHost && !((Object)(object)References.truckController == (Object)null)) { CruiserXLController truckController = References.truckController; if (((NetworkBehaviour)truckController).IsSpawned && ((VehicleController)truckController).hasBeenSpawned && !truckController.alarmDebounce && !((VehicleController)truckController).ignitionStarted && !((VehicleController)truckController).carDestroyed && !((VehicleController)truckController).magnetedToShip && !(Vector3.Distance(((Component)truckController).transform.position, explosionPosition) > 7.5f) && !((float)Random.Range(9, 85) > 12f)) { truckController.alarmDebounce = true; truckController.TryBeginAlarm(); } } } [HarmonyPatch("SpawnExplosion")] [HarmonyPrefix] private static void SpawnExplosion_Prefix(Landmine __instance, Vector3 explosionPosition, bool spawnExplosionEffect, ref float killRange, ref float damageRange, int nonLethalDamage, float physicsForce, GameObject overridePrefab, bool goThroughCar) { //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)References.truckController == (Object)null) && VehicleUtils.IsPlayerNearTruck(GameNetworkManager.Instance.localPlayerController, References.truckController) && !goThroughCar && ((PlayerUtils.isPlayerInStorage && References.truckController.storageCompartment.ClosestPoint(explosionPosition) != explosionPosition) || PlayerUtils.isPlayerInCab || PlayerUtils.seatedInTruck)) { killRange = -1f; damageRange = -1f; } } } [HarmonyPatch(typeof(Landmine_Patches))] public class ExternalLandminePatches { [HarmonyPatch("ShouldCheckCustomKnockback")] [HarmonyPrefix] private static bool ShouldCheckCustomKnockback_Prefix(ref bool __result) { if (PlayerUtils.seatedInTruck) { __result = true; return false; } return true; } [HarmonyPatch("CanPlayerBeKnockedBack")] [HarmonyPrefix] private static bool CanPlayerBeKnockedBack_Prefix(ref bool __result) { if (PlayerUtils.seatedInTruck && UserConfig.PreventKnockback.Value) { __result = false; return false; } return true; } [HarmonyPatch("CurrentForceMultiplier")] [HarmonyPrefix] private static bool CurrentForceMultiplier_Prefix(ref float __result) { if ((Object)(object)References.truckController != (Object)null) { __result = 1f; return false; } return true; } } [HarmonyPatch(typeof(MaskedPlayerEnemy))] internal class MaskedPlayerEnemyPatches { [HarmonyPatch("OnCollideWithPlayer")] [HarmonyPrefix] private static bool OnCollideWithPlayer_Prefix(MaskedPlayerEnemy __instance, ref Collider other) { PlayerControllerB val = ((EnemyAI)__instance).MeetsStandardPlayerCollisionConditions(other, __instance.inKillAnimation || __instance.startingKillAnimationLocalClient || !__instance.enemyEnabled, false); if ((Object)(object)val == (Object)null) { return true; } if ((Object)(object)References.truckController == (Object)null) { return true; } CruiserXLController truckController = References.truckController; float magnitude = ((Vector3)(ref ((VehicleController)truckController).averageVelocity)).magnitude; if (VehicleUtils.IsPlayerSeatedInVehicle(truckController)) { if (magnitude >= 2f) { return false; } if (VehicleUtils.IsSeatedPlayerProtected(val, truckController)) { return false; } return true; } bool flag = VehicleUtils.IsEnemyInVehicle((EnemyAI)(object)__instance, truckController); if (VehicleUtils.IsPlayerInVehicleBounds()) { if (PlayerUtils.isPlayerInStorage && !flag) { return false; } if (!PlayerUtils.isPlayerInStorage && !PlayerUtils.isPlayerInCab) { return magnitude < 2f; } if (PlayerUtils.isPlayerInCab) { if (magnitude < 2f && (((VehicleController)truckController).driverSideDoor.boolValue || ((VehicleController)truckController).passengerSideDoor.boolValue)) { return true; } return false; } return true; } if (flag) { return false; } return true; } } [HarmonyPatch(typeof(MouthDogAI))] public static class MouthDogAIPatches { [HarmonyPatch("OnCollideWithPlayer")] [HarmonyPrefix] private static bool OnCollideWithPlayer_Prefix(MouthDogAI __instance, ref Collider other) { PlayerControllerB val = ((EnemyAI)__instance).MeetsStandardPlayerCollisionConditions(other, __instance.inKillAnimation, false); if ((Object)(object)val == (Object)null) { return true; } if ((Object)(object)References.truckController == (Object)null) { return true; } CruiserXLController truckController = References.truckController; if (VehicleUtils.IsPlayerSeatedInVehicle(truckController)) { if (VehicleUtils.IsSeatedPlayerProtected(val, truckController)) { return false; } if (((EnemyAI)__instance).currentBehaviourStateIndex == 3) { val.inAnimationWithEnemy = (EnemyAI)(object)__instance; __instance.KillPlayerServerRpc((int)val.playerClientId); } return false; } if (VehicleUtils.IsPlayerInVehicleBounds()) { if (VehicleUtils.IsPlayerProtectedByVehicle(val, truckController)) { return false; } return true; } return true; } } [HarmonyPatch(typeof(PlayerControllerB))] internal static class PlayerControllerBPatches { public class PlayerControllerBData { public float syncLookInputInterval; public float vehicleCameraHorizontal; public float lastVehicleCameraHorizontal; public int currentCarAnimation = -1; public bool applyVoiceEffects = false; public bool isPlayerOnTruck; public bool isPlayerInCab; public bool isPlayerInStorage; } public static float checkInterval; public static Dictionary playerData = new Dictionary(); private static void RemoveStalePlayerData() { List list = new List(); foreach (PlayerControllerB key in playerData.Keys) { if (!Object.op_Implicit((Object)(object)key)) { list.Add(key); } } foreach (PlayerControllerB item in list) { playerData.Remove(item); } } public static PlayerControllerBData GetData(PlayerControllerB player) { if (!playerData.TryGetValue(player, out PlayerControllerBData value)) { value = new PlayerControllerBData(); playerData[player] = value; } return value; } [HarmonyPatch("Awake")] [HarmonyPostfix] private static void Awake_Postfix(PlayerControllerB __instance) { RemoveStalePlayerData(); if (!playerData.ContainsKey(__instance)) { playerData.Add(__instance, new PlayerControllerBData()); } } [HarmonyPatch("UpdatePlayerAnimationsToOtherClients")] [HarmonyPrefix] private static bool UpdatePlayerAnimationsToOtherClients_Prefix(PlayerControllerB __instance, Vector2 moveInputVector, bool __runOriginal) { if (!__runOriginal) { return false; } if ((Object)(object)__instance != (Object)(object)GameNetworkManager.Instance.localPlayerController) { return true; } if (PlayerUtils.disableAnimationSync) { return false; } return true; } [HarmonyPatch("TeleportPlayer")] [HarmonyPostfix] private static void TeleportPlayer_Postfix(PlayerControllerB __instance, Vector3 pos, bool withRotation = false, float rot = 0f, bool allowInteractTrigger = false, bool enableController = true) { if (!((Object)(object)__instance != (Object)(object)GameNetworkManager.Instance.localPlayerController) && !((Object)(object)References.truckController == (Object)null)) { PlayerUtils.isPlayerInCab = false; PlayerUtils.isPlayerOnTruck = false; PlayerUtils.isPlayerInStorage = false; } } [HarmonyPatch("SpawnPlayerAnimation")] [HarmonyPostfix] private static void SpawnPlayerAnimation_Postfix(ref PlayerControllerB __instance) { if (!((Object)(object)__instance != (Object)(object)GameNetworkManager.Instance.localPlayerController)) { PlayerControllerB val = __instance; ((Component)__instance).GetComponentInChildren().enabled = false; ((Renderer)val.thisPlayerModel).shadowCastingMode = (ShadowCastingMode)1; ((Component)val.localVisor).GetComponentInChildren().shadowCastingMode = (ShadowCastingMode)0; ((Renderer)val.thisPlayerModelLOD1).shadowCastingMode = (ShadowCastingMode)3; ((Renderer)val.thisPlayerModelLOD2).enabled = false; ((Component)val.thisPlayerModel).gameObject.layer = 23; ((Component)val.thisPlayerModelArms).gameObject.layer = 5; } } [HarmonyPatch("LateUpdate")] [HarmonyPostfix] public static void SyncZoneStateLateUpdate_Postfix(PlayerControllerB __instance) { if ((Object)(object)__instance == (Object)null || __instance.isPlayerDead || !__instance.isPlayerControlled || (Object)(object)__instance != (Object)(object)GameNetworkManager.Instance.localPlayerController || (Object)(object)References.truckController == (Object)null) { return; } CruiserXLController truckController = References.truckController; if (checkInterval < 0.3f) { checkInterval += Time.deltaTime; return; } checkInterval = 0f; PlayerControllerBData data = GetData(__instance); if (data.isPlayerOnTruck != PlayerUtils.isPlayerOnTruck || data.isPlayerInCab != PlayerUtils.isPlayerInCab || data.isPlayerInStorage != PlayerUtils.isPlayerInStorage) { data.isPlayerOnTruck = PlayerUtils.isPlayerOnTruck; data.isPlayerInCab = PlayerUtils.isPlayerInCab; data.isPlayerInStorage = PlayerUtils.isPlayerInStorage; truckController.SyncPlayerZoneRpc((int)__instance.playerClientId, PlayerUtils.isPlayerOnTruck, PlayerUtils.isPlayerInCab, PlayerUtils.isPlayerInStorage); } } [HarmonyPatch("Update")] [HarmonyPrefix] public static void Update_Prefix(PlayerControllerB __instance) { //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)__instance == (Object)null) && !__instance.isPlayerDead && __instance.isPlayerControlled && !((Object)(object)__instance != (Object)(object)GameNetworkManager.Instance.localPlayerController) && !((Object)(object)References.truckController == (Object)null)) { CruiserXLController truckController = References.truckController; if ((Object)(object)__instance == (Object)(object)((VehicleController)truckController).currentDriver || (Object)(object)__instance == (Object)(object)((VehicleController)truckController).currentPassenger || (Object)(object)__instance == (Object)(object)truckController.currentMiddlePassenger) { PlayerUtils.seatedInTruck = true; } else if (PlayerUtils.seatedInTruck) { PlayerUtils.seatedInTruck = false; ((Component)__instance.gameplayCamera).transform.localPosition = Vector3.zero; __instance.horizontalClamp = 70f; } if (PlayerUtils.seatedInTruck && UserConfig.PreventKnockback.Value) { __instance.externalForceAutoFade = Vector3.zero; __instance.externalForces = Vector3.zero; } } } [HarmonyPatch("Update")] [HarmonyPostfix] public static void Update_Postfix(PlayerControllerB __instance) { //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)__instance == (Object)null || __instance.isPlayerDead || !__instance.isPlayerControlled || (Object)(object)__instance != (Object)(object)GameNetworkManager.Instance.localPlayerController || (Object)(object)References.truckController == (Object)null) { return; } CruiserXLController truckController = References.truckController; Vector3 localPosition = Vector3.zero; if (!PlayerUtils.seatedInTruck) { return; } PlayerUtils.isPlayerInCab = true; PlayerUtils.isPlayerOnTruck = true; PlayerUtils.isPlayerInStorage = false; if (UserConfig.SeatBoostEnabled.Value) { localPosition = new Vector3(0f, 0.118f, -0.05f) * UserConfig.SeatBoostScale.Value; } Vector3 val = ((Component)__instance.gameplayCamera).transform.localRotation * Vector3.forward; val.y = 0f; float num = Vector3.Angle(val, Vector3.back); if (num < 70f && (Object)(object)__instance != (Object)(object)truckController.currentMiddlePassenger) { localPosition.x = Mathf.Sign(val.x) * ((70f - num) / 70f); } ((Component)__instance.gameplayCamera).transform.localPosition = localPosition; if ((Object)(object)__instance == (Object)(object)((VehicleController)truckController).currentDriver) { __instance.horizontalClamp = (truckController.driversSideWindowTrigger.boolValue ? 163f : 105f); if (__instance.ladderCameraHorizontal > 0f) { __instance.horizontalClamp = 163f; } } else if ((Object)(object)__instance == (Object)(object)((VehicleController)truckController).currentPassenger) { __instance.horizontalClamp = (truckController.passengersSideWindowTrigger.boolValue ? 163f : 105f); if (__instance.ladderCameraHorizontal < 0f) { __instance.horizontalClamp = 163f; } } } [HarmonyPatch("LateUpdate")] [HarmonyPostfix] private static void LateUpdate_Postfix(PlayerControllerB __instance) { //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)__instance == (Object)null) && !__instance.isPlayerDead && __instance.isPlayerControlled && !((Object)(object)References.truckController == (Object)null)) { CruiserXLController truckController = References.truckController; if (__instance.inVehicleAnimation && Object.op_Implicit((Object)(object)__instance.currentTriggerInAnimationWith) && Object.op_Implicit((Object)(object)__instance.currentTriggerInAnimationWith.overridePlayerParent) && (Object)(object)__instance.currentTriggerInAnimationWith.overridePlayerParent == (Object)(object)((Component)truckController).transform) { ((Component)__instance.playerModelArmsMetarig.parent).transform.localRotation = Quaternion.Euler(90f, 0f, 0f); __instance.playerModelArmsMetarig.localRotation = Quaternion.Euler(-90f, 0f, 0f); __instance.localArmsTransform.localPosition = new Vector3(0f, -0.008f, -0.43f); __instance.localArmsTransform.localRotation = Quaternion.Euler(84.78056f, 0f, 0f); ((Component)__instance.playerBodyAnimator).transform.localPosition = truckController.playerPositionOffset; ((Component)__instance.playerBodyAnimator).transform.localRotation = Quaternion.Euler(-90f, 0f, 0f); } } } } [HarmonyPatch(typeof(PumaAI))] internal static class PumaAIPatches { [HarmonyPatch("OnCollideWithPlayer")] [HarmonyPrefix] private static bool OnCollideWithPlayer_Prefix(PumaAI __instance, ref Collider other) { PlayerControllerB val = ((EnemyAI)__instance).MeetsStandardPlayerCollisionConditions(other, false, false); if ((Object)(object)val == (Object)null) { return true; } if ((Object)(object)References.truckController == (Object)null) { return true; } CruiserXLController truckController = References.truckController; float magnitude = ((Vector3)(ref ((VehicleController)truckController).averageVelocity)).magnitude; if (VehicleUtils.IsPlayerSeatedInVehicle(truckController)) { if (magnitude >= 2f) { return false; } if (VehicleUtils.IsSeatedPlayerProtected(val, truckController)) { return false; } return true; } bool flag = VehicleUtils.IsEnemyInVehicle((EnemyAI)(object)__instance, truckController); if (VehicleUtils.IsPlayerInVehicleBounds()) { if (PlayerUtils.isPlayerInStorage && !flag) { return false; } if (!PlayerUtils.isPlayerInStorage && !PlayerUtils.isPlayerInCab) { return magnitude < 2f; } if (PlayerUtils.isPlayerInCab) { if (magnitude < 2f && (((VehicleController)truckController).driverSideDoor.boolValue || ((VehicleController)truckController).passengerSideDoor.boolValue)) { return true; } return false; } return true; } if (flag) { return false; } return true; } } [HarmonyPatch(typeof(RadMechAI))] internal static class RadMechAIPatches { [HarmonyPatch("OnCollideWithPlayer")] [HarmonyPrefix] private static bool OnCollideWithPlayer_Prefix(RadMechAI __instance, ref Collider other) { PlayerControllerB val = ((EnemyAI)__instance).MeetsStandardPlayerCollisionConditions(other, false, false); if ((Object)(object)val == (Object)null) { return true; } if ((Object)(object)References.truckController == (Object)null) { return true; } CruiserXLController truckController = References.truckController; if (VehicleUtils.IsPlayerSeatedInVehicle(truckController)) { if (((VehicleController)truckController).windshieldBroken && ((Vector3)(ref ((VehicleController)truckController).averageVelocity)).magnitude <= 10f) { return true; } if (VehicleUtils.IsSeatedPlayerProtected(val, truckController)) { return false; } return true; } if (VehicleUtils.IsPlayerInVehicleBounds()) { if (PlayerUtils.isPlayerInCab && ((VehicleController)truckController).windshieldBroken && ((Vector3)(ref ((VehicleController)truckController).averageVelocity)).magnitude <= 10f) { return true; } if (VehicleUtils.IsPlayerProtectedByVehicle(val, truckController)) { return false; } return true; } return true; } } [HarmonyPatch(typeof(RedLocustBees))] internal static class RedLocustBeesPatches { [HarmonyPatch("OnCollideWithPlayer")] [HarmonyPrefix] private static void OnCollideWithPlayer_Prefix(RedLocustBees __instance, ref Collider other) { if ((Object)(object)References.truckController == (Object)null) { return; } PlayerControllerB val = ((EnemyAI)__instance).MeetsStandardPlayerCollisionConditions(other, false, false); if ((Object)(object)val == (Object)null) { return; } CruiserXLController truckController = References.truckController; float magnitude = ((Vector3)(ref ((VehicleController)truckController).averageVelocity)).magnitude; if (VehicleUtils.IsPlayerSeatedInVehicle(truckController)) { if (magnitude < 10f && VehicleUtils.IsSeatedPlayerProtected(val, truckController)) { __instance.timeSinceHittingPlayer = 0f; return; } if (magnitude >= 10f) { __instance.timeSinceHittingPlayer = 0f; } } bool flag = VehicleUtils.IsEnemyInVehicle((EnemyAI)(object)__instance, truckController); if (VehicleUtils.IsPlayerInVehicleBounds()) { if (PlayerUtils.isPlayerInStorage && !flag) { __instance.timeSinceHittingPlayer = 0f; } if (PlayerUtils.isPlayerInCab && (magnitude >= 10f || (!((VehicleController)truckController).driverSideDoor.boolValue && !((VehicleController)truckController).passengerSideDoor.boolValue && !truckController.driversSideWindowTrigger.boolValue && !truckController.passengersSideWindowTrigger.boolValue))) { __instance.timeSinceHittingPlayer = 0f; } } else if (flag) { __instance.timeSinceHittingPlayer = 0f; } } } [HarmonyPatch(typeof(SoundManager))] public static class SoundManagerPatches { [HarmonyPatch("Start")] [HarmonyPrefix] private static void Start_Prefix(SoundManager __instance) { if ((Object)(object)References.diageticSFXGroup == (Object)null) { AudioMixerGroup diageticSFXGroup = __instance.diageticMixer.FindMatchingGroups("Master/SFX")[0]; References.diageticSFXGroup = diageticSFXGroup; } } } [HarmonyPatch(typeof(StartOfRound))] public static class StartOfRoundPatches { [HarmonyPatch("Awake")] [HarmonyPostfix] private static void Awake_Postfix(StartOfRound __instance) { //IL_0019: Unknown result type (might be due to invalid IL or missing references) SCVNetworker.Create(); if (RadioManager._stations.Count == 0) { UniTaskExtensions.Forget(RadioManager.GetRadioStations()); } } [HarmonyPatch("SyncAlreadyHeldObjectsServerRpc")] [HarmonyPostfix] private static void SyncAlreadyHeldObjectsServerRpc_Postfix(StartOfRound __instance, int joiningClientId) { if (!Object.op_Implicit((Object)(object)__instance.attachedVehicle) || !(__instance.attachedVehicle is CruiserXLController cruiserXLController)) { return; } try { if ((Object)(object)cruiserXLController == (Object)null) { Plugin.Logger.LogError((object)"attempted to send client data, but the truck is null? please report this to Scandal."); } else { cruiserXLController.SendClientSyncData(); } } catch (Exception ex) { Plugin.Logger.LogError((object)("exception caught sending saved Scanvan data:\n" + ex)); } } [HarmonyPatch("LoadAttachedVehicle")] [HarmonyPostfix] private static void LoadAttachedVehicle_Postfix(StartOfRound __instance) { //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)__instance.attachedVehicle) || !(__instance.attachedVehicle is CruiserXLController cruiserXLController)) { return; } try { if ((Object)(object)cruiserXLController == (Object)null) { Plugin.Logger.LogError((object)"attempted to load saved data, but the truck is null? please report this to Scandal."); return; } SaveManager.TryLoad("AttachedVehicleVariant", out var data); SaveManager.TryLoad("AttachedVehicleRotation", out var data2); SaveManager.TryLoad("AttachedVehiclePosition", out var data3); SaveManager.TryLoad("AttachedVehicleTurbo", out var data4); SaveManager.TryLoad("AttachedVehicleIgnition", out var data5); SaveManager.TryLoad("AttachedVehicleSteeringRotation", out var data6); SaveManager.TryLoad("AttachedVehicleHealth", out var data7); cruiserXLController.isSpecial = data; cruiserXLController.SetVariant(cruiserXLController.isSpecial); ((Component)cruiserXLController).transform.rotation = Quaternion.Euler(data2); ((Component)cruiserXLController).transform.position = StartOfRound.Instance.elevatorTransform.TransformPoint(data3); ((VehicleController)cruiserXLController).turboBoosts = data4; cruiserXLController.voiceModule.ignitionChimeStarted = data5; cruiserXLController.voiceModule.ignitionChimeFinished = data5; cruiserXLController.disableAnimations = !data5; cruiserXLController.inIgnitionAnimation = !data5; cruiserXLController.electricsOn = data5; cruiserXLController.electricsOn = data5; ((VehicleController)cruiserXLController).keyIsInIgnition = data5; cruiserXLController.SetKeyIgnitionValues(trying: false, keyInHand: false, data5); cruiserXLController.SetIgnition(data5, data5); cruiserXLController.SetFrontCabinLightOn(data5); cruiserXLController.TrySetCarIgnitionTriggers(); if (data5) { cruiserXLController.dashboardSymbolPreStartup = ((MonoBehaviour)cruiserXLController).StartCoroutine(cruiserXLController.PreIgnitionSymbolCheck()); } cruiserXLController.SetSymbolActive(cruiserXLController.vehicleDisplay, cruiserXLController.vehicleDisplayLight, data5); cruiserXLController.driversSideWindow.interactable = data5; cruiserXLController.passengersSideWindow.interactable = data5; cruiserXLController.ignitionCollider.enabled = data5; cruiserXLController.ignitionAnimator.SetInteger("SAIgnition_Anim", data5 ? 1 : 0); cruiserXLController.syncedWheelRotation = data6; ((VehicleController)cruiserXLController).steeringWheelAnimFloat = data6; ((VehicleController)cruiserXLController).carHP = data7; } catch (Exception ex) { Plugin.Logger.LogError((object)("exception caught loading saved Scanvan data:\n" + ex)); } } } [HarmonyPatch(typeof(TerrainObstacleTrigger))] public static class TerrainObstacleTriggerPatches { [HarmonyPatch("OnTriggerEnter")] [HarmonyPrefix] private static bool OnTriggerEnter_Prefix(TerrainObstacleTrigger __instance, Collider other, bool __runOriginal) { //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) if (!__runOriginal) { return false; } if ((Object)(object)References.truckController == (Object)null) { return true; } CruiserXLController cruiserXLController = default(CruiserXLController); ((Component)other).TryGetComponent(ref cruiserXLController); if ((Object)(object)cruiserXLController == (Object)null) { return true; } if (((NetworkBehaviour)cruiserXLController).IsOwner && ((Vector3)(ref ((VehicleController)cruiserXLController).averageVelocity)).magnitude >= 5f && Vector3.Angle(((VehicleController)cruiserXLController).averageVelocity, ((Component)__instance).transform.position - ((VehicleController)cruiserXLController).mainRigidbody.position) < 80f) { RoundManager.Instance.DestroyTreeOnLocalClient(((Component)__instance).transform.position); bool dealDamage = (Object)(object)((Component)__instance).transform.parent != (Object)null && ((Component)((Component)__instance).transform.parent).CompareTag("Wood"); cruiserXLController.CarReactToObstacle(((VehicleController)cruiserXLController).mainRigidbody.position - ((Component)__instance).transform.position, ((Component)__instance).transform.position, Vector3.zero, (CarObstacleType)2, 1f, null, dealDamage); } return false; } } [HarmonyPatch(typeof(Utilities))] public static class UtilitiesPatches { [HarmonyPatch("ShouldAllowSightForVehicle")] [HarmonyPrefix] private static bool ShouldAllowSightForVehicle_Prefix(ref PlayerControllerB player, ref EnemyAI enemy, ref bool __result) { if ((Object)(object)References.truckController == (Object)null) { return true; } CruiserXLController truckController = References.truckController; PlayerControllerBPatches.PlayerControllerBData data = PlayerControllerBPatches.GetData(player); if (!((Object)(object)((VehicleController)truckController).currentDriver == (Object)(object)player) && !((Object)(object)truckController.currentMiddlePassenger == (Object)(object)player) && !((Object)(object)((VehicleController)truckController).currentPassenger == (Object)(object)player) && !data.isPlayerInCab) { return true; } if (enemy is BaboonBirdAI) { __result = true; return false; } __result = SCVNetworker.Instance.OldBirdSight.Value; return false; } } [HarmonyPatch(typeof(VehicleController))] public static class VehicleControllerPatches { [HarmonyPatch("AddEngineOil")] [HarmonyPrefix] private static bool AddEngineOil_Prefix(VehicleController __instance, bool __runOriginal) { if (!__runOriginal) { return false; } if (!(__instance is CruiserXLController cruiserXLController)) { return true; } cruiserXLController.AddEngineOil(); return false; } [HarmonyPatch("AddTurboBoost")] [HarmonyPrefix] private static bool AddTurboBoost_Prefix(VehicleController __instance, bool __runOriginal) { if (!__runOriginal) { return false; } if (!(__instance is CruiserXLController cruiserXLController)) { return true; } cruiserXLController.AddTurboBoost(); return false; } [HarmonyPatch("StartMagneting")] [HarmonyPrefix] private static bool StartMagneting_Prefix(VehicleController __instance, bool __runOriginal) { if (!__runOriginal) { return false; } if (!(__instance is CruiserXLController)) { return true; } return false; } [HarmonyPatch("CollectItemsInTruck")] [HarmonyPrefix] private static bool CollectItemsInTruck_Prefix(VehicleController __instance, bool __runOriginal) { if (!__runOriginal) { return false; } if (!(__instance is CruiserXLController)) { return true; } return false; } [HarmonyPatch("DestroyCar")] [HarmonyPrefix] private static bool DestroyCar_Prefix(VehicleController __instance, bool __runOriginal) { if (!__runOriginal) { return false; } if (!(__instance is CruiserXLController cruiserXLController)) { return true; } cruiserXLController.DestroyCar(); return false; } [HarmonyPatch("ExitDriverSideSeat")] [HarmonyPrefix] private static bool ExitDriverSideSeat_Prefix(VehicleController __instance, bool __runOriginal) { if (!__runOriginal) { return false; } if (!(__instance is CruiserXLController cruiserXLController)) { return true; } cruiserXLController.ExitDriverSideSeat(); return false; } [HarmonyPatch("ExitPassengerSideSeat")] [HarmonyPrefix] private static bool ExitPassengerSideSeat_Prefix(VehicleController __instance, bool __runOriginal) { if (!__runOriginal) { return false; } if (!(__instance is CruiserXLController cruiserXLController)) { return true; } cruiserXLController.ExitPassengerSideSeat(); return false; } [HarmonyPatch("CarReactToObstacle")] [HarmonyPrefix] private static bool CarReactToObstacle_Prefix(VehicleController __instance, bool __runOriginal, ref Vector3 vel, ref Vector3 position, ref Vector3 impulse, ref CarObstacleType type, ref float obstacleSize, ref EnemyAI enemyScript, ref bool dealDamage) { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) if (!__runOriginal) { return false; } if (!(__instance is CruiserXLController cruiserXLController)) { return true; } cruiserXLController.CarReactToObstacle(vel, position, impulse, type, obstacleSize, enemyScript, dealDamage); return false; } [HarmonyPatch("DealPermanentDamage")] [HarmonyPrefix] private static bool DealPermanentDamage_Prefix(VehicleController __instance, bool __runOriginal, ref int damageAmount, ref Vector3 damagePosition) { //IL_0027: Unknown result type (might be due to invalid IL or missing references) if (!__runOriginal) { return false; } if (!(__instance is CruiserXLController cruiserXLController)) { return true; } cruiserXLController.DealPermanentDamage(damageAmount, damagePosition); return false; } [HarmonyPatch("DamagePlayerInVehicle")] [HarmonyPrefix] private static bool DamagePlayerInVehicle_Prefix(VehicleController __instance, bool __runOriginal, ref Vector3 vel, ref float magnitude) { //IL_0025: Unknown result type (might be due to invalid IL or missing references) if (!__runOriginal) { return false; } if (!(__instance is CruiserXLController cruiserXLController)) { return true; } ((VehicleController)cruiserXLController).DamagePlayerInVehicle(vel, magnitude); return false; } [HarmonyPatch("SetInternalStress")] [HarmonyPrefix] private static bool SetInternalStress_Prefix(VehicleController __instance, bool __runOriginal, ref float carStressIncrease) { if (!__runOriginal) { return false; } if (!(__instance is CruiserXLController cruiserXLController)) { return true; } ((VehicleController)cruiserXLController).SetInternalStress(carStressIncrease); return false; } [HarmonyPatch("ToggleHeadlightsLocalClient")] [HarmonyPrefix] private static bool ToggleHeadlightsLocalClient_Prefix(VehicleController __instance, bool __runOriginal) { if (!__runOriginal) { return false; } if (!(__instance is CruiserXLController cruiserXLController)) { return true; } cruiserXLController.ToggleHeadlightsLocalClient(); return false; } [HarmonyPatch("SetHeadlightMaterial")] [HarmonyPrefix] private static bool SetHeadlightMaterial_Prefix(VehicleController __instance, bool __runOriginal, ref bool on) { if (!__runOriginal) { return false; } if (!(__instance is CruiserXLController)) { return true; } return false; } [HarmonyPatch("SpringDriverSeatLocalClient")] [HarmonyPrefix] private static bool SpringDriverSeatLocalClient_Prefix(VehicleController __instance, bool __runOriginal) { if (!__runOriginal) { return false; } if (!(__instance is CruiserXLController)) { return true; } return false; } [HarmonyPatch("SetRadioOnLocalClient")] [HarmonyPrefix] private static bool SetRadioOnLocalClient_Prefix(VehicleController __instance, bool __runOriginal, ref bool on, ref bool setClip) { if (!__runOriginal) { return false; } if (!(__instance is CruiserXLController cruiserXLController)) { return true; } ((VehicleController)cruiserXLController).SetRadioOnLocalClient(on, setClip); return false; } [HarmonyPatch("SwitchRadio")] [HarmonyPrefix] private static bool SwitchRadio_Prefix(VehicleController __instance, bool __runOriginal) { if (!__runOriginal) { return false; } if (!(__instance is CruiserXLController cruiserXLController)) { return true; } cruiserXLController.SwitchRadio(); return false; } [HarmonyPatch("ChangeRadioStation")] [HarmonyPrefix] private static bool ChangeRadioStation_Prefix(VehicleController __instance, bool __runOriginal) { if (!__runOriginal) { return false; } if (!(__instance is CruiserXLController cruiserXLController)) { return true; } ((VehicleController)cruiserXLController).ChangeRadioStation(); return false; } [HarmonyPatch("StartTryCarIgnition")] [HarmonyPrefix] private static bool StartTryCarIgnition_Prefix(VehicleController __instance, bool __runOriginal) { if (!__runOriginal) { return false; } if (!(__instance is CruiserXLController cruiserXLController)) { return true; } cruiserXLController.StartTryCarIgnition(); return false; } [HarmonyPatch("CancelTryCarIgnition")] [HarmonyPrefix] private static bool CancelTryCarIgnition_Prefix(VehicleController __instance, bool __runOriginal) { if (!__runOriginal) { return false; } if (!(__instance is CruiserXLController cruiserXLController)) { return true; } cruiserXLController.CancelTryCarIgnition(); return false; } [HarmonyPatch("RemoveKeyFromIgnition")] [HarmonyPrefix] private static bool RemoveKeyFromIgnition_Prefix(VehicleController __instance, bool __runOriginal) { if (!__runOriginal) { return false; } if (!(__instance is CruiserXLController cruiserXLController)) { return true; } cruiserXLController.RemoveKeyFromIgnition(); return false; } } } namespace ScanVan.Networking { internal static class NetworkVariableInitalizer { internal static void Init() { NetworkVariableSerializationTypes.InitializeSerializer_UnmanagedByMemcpy(); NetworkVariableSerializationTypes.InitializeEqualityChecker_UnmanagedIEquatable(); NetworkVariableSerializationTypes.InitializeSerializer_UnmanagedByMemcpy(); NetworkVariableSerializationTypes.InitializeEqualityChecker_UnmanagedIEquatable(); NetworkVariableSerializationTypes.InitializeSerializer_UnmanagedByMemcpy(); NetworkVariableSerializationTypes.InitializeEqualityChecker_UnmanagedIEquatable(); NetworkVariableSerializationTypes.InitializeSerializer_UnmanagedByMemcpy(); NetworkVariableSerializationTypes.InitializeEqualityChecker_UnmanagedIEquatable(); NetworkVariableSerializationTypes.InitializeSerializer_UnmanagedByMemcpy(); NetworkVariableSerializationTypes.InitializeEqualityChecker_UnmanagedIEquatable(); NetworkVariableSerializationTypes.InitializeSerializer_UnmanagedByMemcpy(); NetworkVariableSerializationTypes.InitializeEqualityChecker_UnmanagedIEquatable(); NetworkVariableSerializationTypes.InitializeSerializer_UnmanagedByMemcpy(); NetworkVariableSerializationTypes.InitializeEqualityChecker_UnmanagedIEquatable(); } } internal class SCVNetworker : NetworkBehaviour { internal static GameObject networkPrefab; internal static SCVNetworker? Instance { get; private set; } internal NetworkVariable StreamerRadio { get; private set; } = new NetworkVariable(true, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); internal NetworkVariable OldBirdSight { get; private set; } = new NetworkVariable(true, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); internal static void Init() { //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Expected O, but got Unknown if ((Object)(object)networkPrefab != (Object)null) { Plugin.Logger.LogDebug((object)"Skipped network handler registration, because it has already been initialized"); return; } try { networkPrefab = new GameObject("SCVNetworker") { hideFlags = (HideFlags)61 }; NetworkObject val = networkPrefab.AddComponent(); byte[] value = MD5.Create().ComputeHash(Encoding.UTF8.GetBytes(typeof(SCVNetworker).Assembly.GetName().Name + ((Object)networkPrefab).name)); val.GlobalObjectIdHash = BitConverter.ToUInt32(value, 0); networkPrefab.AddComponent(); NetworkManager.Singleton.PrefabHandler.AddNetworkPrefab(networkPrefab); Plugin.Logger.LogDebug((object)"Successfully registered network handler. This is good news!"); } catch (Exception arg) { Plugin.Logger.LogError((object)$"Encountered some fatal error while registering network handler. The mod will not function like this!\n{arg}"); } } internal static void Create() { try { if (NetworkManager.Singleton.IsServer && (Object)(object)networkPrefab != (Object)null) { Object.Instantiate(networkPrefab).GetComponent().Spawn(true); } } catch { Plugin.Logger.LogError((object)"Encountered some fatal error while spawning network handler. It is likely that registration failed earlier on start-up, please consult your logs."); } } private void Awake() { Instance = this; } public override void OnNetworkSpawn() { ((NetworkBehaviour)this).OnNetworkSpawn(); if ((Object)(object)Instance != (Object)(object)this) { NetworkObject val = default(NetworkObject); if ((Object)(object)Instance != (Object)null && ((Component)Instance).TryGetComponent(ref val) && !val.IsSpawned && (Object)(object)Instance != (Object)(object)networkPrefab) { Object.Destroy((Object)(object)Instance); } Plugin.Logger.LogWarning((object)"There are 2 SCVNetworkers instantiated, and the wrong one was assigned as Instance. This shouldn't happen, but is recoverable"); Instance = this; } Plugin.Logger.LogDebug((object)"Successfully spawned network handler."); } private void Start() { if (!((Object)(object)this != (Object)(object)Instance) && ((NetworkBehaviour)this).IsSpawned && ((NetworkBehaviour)this).IsServer) { UpdateConfig(); } } private void UpdateConfig() { if (((NetworkBehaviour)this).IsServer) { StreamerRadio.Value = UserConfig.StreamerRadio.Value; OldBirdSight.Value = UserConfig.OldBirdSight.Value; } } protected override void __initializeVariables() { if (StreamerRadio == null) { throw new Exception("SCVNetworker.k__BackingField cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)StreamerRadio).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)StreamerRadio, "StreamerRadio"); base.NetworkVariableFields.Add((NetworkVariableBase)(object)StreamerRadio); if (OldBirdSight == null) { throw new Exception("SCVNetworker.k__BackingField cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)OldBirdSight).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)OldBirdSight, "OldBirdSight"); base.NetworkVariableFields.Add((NetworkVariableBase)(object)OldBirdSight); ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { ((NetworkBehaviour)this).__initializeRpcs(); } protected internal override string __getTypeName() { return "SCVNetworker"; } } } namespace ScanVan.Managers { public static class RadioManager { [CompilerGenerated] private sealed class d__2 : IAsyncStateMachine { public int <>1__state; public AsyncUniTaskMethodBuilder <>t__builder; private string 5__1; private RadioBrowserClient 5__2; private List 5__3; private string <>s__4; private List <>s__5; private Exception 5__6; private TaskAwaiter <>u__1; private TaskAwaiter> <>u__2; private void MoveNext() { //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Expected O, but got Unknown int num = <>1__state; try { if ((uint)num > 1u) { } try { TaskAwaiter> awaiter; TaskAwaiter awaiter2; if (num != 0) { if (num == 1) { awaiter = <>u__2; <>u__2 = default(TaskAwaiter>); num = (<>1__state = -1); goto IL_0124; } Plugin.Logger.LogDebug((object)"Searching Radio API for stations!"); awaiter2 = GetRadioBrowserApiUrl().GetAwaiter(); if (!awaiter2.IsCompleted) { num = (<>1__state = 0); <>u__1 = awaiter2; d__2 d__ = this; ((AsyncUniTaskMethodBuilder)(ref <>t__builder)).AwaitUnsafeOnCompleted, d__2>(ref awaiter2, ref d__); return; } } else { awaiter2 = <>u__1; <>u__1 = default(TaskAwaiter); num = (<>1__state = -1); } <>s__4 = awaiter2.GetResult(); 5__1 = <>s__4; <>s__4 = null; 5__2 = new RadioBrowserClient(5__1, (string)null); awaiter = 5__2.Stations.GetByVotesAsync(7500u).GetAwaiter(); if (!awaiter.IsCompleted) { num = (<>1__state = 1); <>u__2 = awaiter; d__2 d__ = this; ((AsyncUniTaskMethodBuilder)(ref <>t__builder)).AwaitUnsafeOnCompleted>, d__2>(ref awaiter, ref d__); return; } goto IL_0124; IL_0124: <>s__5 = awaiter.GetResult(); 5__3 = <>s__5; <>s__5 = null; _stations = 5__3.Where((StationInfo x) => x != null && x.Codec != null && x.Codec.Equals("mp3", StringComparison.OrdinalIgnoreCase) && x.UrlResolved != null && (x.UrlResolved.Scheme == Uri.UriSchemeHttp || x.UrlResolved.Scheme == Uri.UriSchemeHttps)).ToList(); Plugin.Logger.LogDebug((object)"Finished searching radio API for stations."); Plugin.Logger.LogDebug((object)$"Found {_stations.Count}"); 5__1 = null; 5__2 = null; 5__3 = null; } catch (Exception ex) { 5__6 = ex; Plugin.Logger.LogError((object)("Error finding radio stations: " + 5__6.Message)); } } catch (Exception ex) { <>1__state = -2; ((AsyncUniTaskMethodBuilder)(ref <>t__builder)).SetException(ex); return; } <>1__state = -2; ((AsyncUniTaskMethodBuilder)(ref <>t__builder)).SetResult(); } void IAsyncStateMachine.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext this.MoveNext(); } [DebuggerHidden] private void SetStateMachine(IAsyncStateMachine stateMachine) { } void IAsyncStateMachine.SetStateMachine(IAsyncStateMachine stateMachine) { //ILSpy generated this explicit interface implementation from .override directive in SetStateMachine this.SetStateMachine(stateMachine); } } public static List _stations = new List(); public static void PreloadStations() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) UniTaskExtensions.Forget(GetRadioStations()); } [AsyncStateMachine(typeof(d__2))] [DebuggerStepThrough] public static UniTask GetRadioStations() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) d__2 d__ = new d__2(); d__.<>t__builder = AsyncUniTaskMethodBuilder.Create(); d__.<>1__state = -1; ((AsyncUniTaskMethodBuilder)(ref d__.<>t__builder)).Start<d__2>(ref d__); return ((AsyncUniTaskMethodBuilder)(ref d__.<>t__builder)).Task; } public static StationInfo? GetRandomRadioStation() { if (_stations.Count == 0) { return null; } StationInfo val = _stations[Random.Range(0, _stations.Count)]; Plugin.Logger.LogDebug((object)val.Name); Plugin.Logger.LogDebug((object)val.StationUuid); return val; } public static StationInfo? GetRadioStationByGuid(Guid guid) { return ((IEnumerable)_stations).FirstOrDefault((Func)delegate(StationInfo x) { _ = x.StationUuid; return x.StationUuid == guid; }); } private static async Task GetRadioBrowserApiUrl() { IPAddress[] ips = Dns.GetHostAddresses("all.api.radio-browser.info"); long lastRoundTripTime = long.MaxValue; string searchUrl = "de1.api.radio-browser.info"; HttpClient client = new HttpClient(); IPAddress[] array = ips; foreach (IPAddress ipAddress in array) { try { PingReply reply = new Ping().Send(ipAddress); if (reply == null || reply.RoundtripTime >= lastRoundTripTime) { continue; } string hostName = (await Dns.GetHostEntryAsync(ipAddress)).HostName; if (!string.IsNullOrEmpty(hostName)) { HttpResponseMessage result = await client.GetAsync("https://" + hostName + "/"); Plugin.Logger.LogDebug((object)$"{hostName}, Is success? {result.IsSuccessStatusCode}, IP? {ipAddress}"); if (result.IsSuccessStatusCode) { lastRoundTripTime = reply.RoundtripTime; searchUrl = hostName; } } } catch (SocketException) { Plugin.Logger.LogWarning((object)"Cannot ping socket!"); } } return searchUrl; } } } namespace ScanVan.Compatibility { public class ImmersiveVisorCompatibility { [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public static void PatchAllCompatibilityMethods(Harmony harmony) { ApplyVisorPatch(harmony); } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] [HarmonyPrefix] public static void ApplyVisorPatch(Harmony harmony) { //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Expected O, but got Unknown MethodInfo methodInfo = AccessTools.Method(typeof(VisorRainState), "LineCastForCeiling", (Type[])null, (Type[])null); MethodInfo methodInfo2 = AccessTools.Method(typeof(ImmersiveVisorCompatibility), "LineCastForCeiling_Prefix", (Type[])null, (Type[])null); harmony.Patch((MethodBase)methodInfo, new HarmonyMethod(methodInfo2), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); } public static bool LineCastForCeiling_Prefix(VisorRainState __instance, ref bool __result) { if ((Object)(object)References.truckController == (Object)null) { return true; } CruiserXLController truckController = References.truckController; if (PlayerUtils.seatedInTruck || PlayerUtils.isPlayerInCab || PlayerUtils.isPlayerInStorage) { __result = true; return false; } return true; } } public class LethalElementsCompatibility { [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public static void PatchAllCompatibilityMethods(Harmony harmony) { ApplyElementsPatch(harmony); } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] [HarmonyPrefix] public static void ApplyElementsPatch(Harmony harmony) { //IL_01b1: Unknown result type (might be due to invalid IL or missing references) //IL_01bf: Expected O, but got Unknown //IL_01c4: Unknown result type (might be due to invalid IL or missing references) //IL_01d2: Expected O, but got Unknown //IL_01d7: Unknown result type (might be due to invalid IL or missing references) //IL_01e5: Expected O, but got Unknown //IL_01ea: Unknown result type (might be due to invalid IL or missing references) //IL_01f8: Expected O, but got Unknown //IL_01ff: Unknown result type (might be due to invalid IL or missing references) //IL_020c: Expected O, but got Unknown //IL_0212: Unknown result type (might be due to invalid IL or missing references) //IL_0220: Expected O, but got Unknown //IL_0226: Unknown result type (might be due to invalid IL or missing references) //IL_0234: Expected O, but got Unknown //IL_023a: Unknown result type (might be due to invalid IL or missing references) //IL_0248: Expected O, but got Unknown //IL_024e: Unknown result type (might be due to invalid IL or missing references) //IL_025c: Expected O, but got Unknown MethodInfo methodInfo = AccessTools.Method(typeof(PlayerEffectsManager), "SetPlayerTemperature", (Type[])null, (Type[])null); MethodInfo methodInfo2 = AccessTools.Method(typeof(HeatwavePatches), "CheckConditionsForHeatingStop", (Type[])null, (Type[])null); MethodInfo methodInfo3 = AccessTools.Method(typeof(HeatwavePatches), "CheckConditionsForHeatingPause", (Type[])null, (Type[])null); MethodInfo methodInfo4 = AccessTools.Method(typeof(BlizzardWeather), "Update", (Type[])null, (Type[])null); MethodInfo methodInfo5 = AccessTools.Method(typeof(SnowfallVFXManager), "Update", (Type[])null, (Type[])null); MethodInfo methodInfo6 = AccessTools.Method(typeof(BlizzardWeather), "SetColdZoneState", (Type[])null, (Type[])null); MethodInfo methodInfo7 = AccessTools.Method(typeof(SnowfallWeather), "SetColdZoneState", (Type[])null, (Type[])null); MethodInfo methodInfo8 = AccessTools.Method(typeof(CruiserXLController), "Start", (Type[])null, (Type[])null); MethodInfo methodInfo9 = AccessTools.Method(typeof(CruiserXLController), "FixedUpdate", (Type[])null, (Type[])null); MethodInfo methodInfo10 = AccessTools.Method(typeof(LethalElementsCompatibility), "SetPlayerTemperature_Heatwave", (Type[])null, (Type[])null); MethodInfo methodInfo11 = AccessTools.Method(typeof(LethalElementsCompatibility), "CheckConditionsForHeatingStop_Prefix", (Type[])null, (Type[])null); MethodInfo methodInfo12 = AccessTools.Method(typeof(LethalElementsCompatibility), "CheckConditionsForHeatingPause_Prefix", (Type[])null, (Type[])null); MethodInfo methodInfo13 = AccessTools.Method(typeof(LethalElementsCompatibility), "Update_Prefix", (Type[])null, (Type[])null); MethodInfo methodInfo14 = AccessTools.Method(typeof(LethalElementsCompatibility), "VFXUpdate_Postfix", (Type[])null, (Type[])null); MethodInfo methodInfo15 = AccessTools.Method(typeof(LethalElementsCompatibility), "SetColdZoneState_Prefix", (Type[])null, (Type[])null); MethodInfo methodInfo16 = AccessTools.Method(typeof(LethalElementsCompatibility), "SetBaseColdZoneState_Prefix", (Type[])null, (Type[])null); MethodInfo methodInfo17 = AccessTools.Method(typeof(LethalElementsCompatibility), "VehicleSnowTracksPatch_Prefix", (Type[])null, (Type[])null); MethodInfo methodInfo18 = AccessTools.Method(typeof(LethalElementsCompatibility), "VehicleSnowTracksFixedUpdatePatch_Prefix", (Type[])null, (Type[])null); harmony.Patch((MethodBase)methodInfo2, new HarmonyMethod(methodInfo11), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); harmony.Patch((MethodBase)methodInfo3, new HarmonyMethod(methodInfo12), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); harmony.Patch((MethodBase)methodInfo, new HarmonyMethod(methodInfo10), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); harmony.Patch((MethodBase)methodInfo4, new HarmonyMethod(methodInfo13), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); harmony.Patch((MethodBase)methodInfo5, (HarmonyMethod)null, new HarmonyMethod(methodInfo14), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); harmony.Patch((MethodBase)methodInfo6, new HarmonyMethod(methodInfo15), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); harmony.Patch((MethodBase)methodInfo7, new HarmonyMethod(methodInfo16), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); harmony.Patch((MethodBase)methodInfo8, new HarmonyMethod(methodInfo17), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); harmony.Patch((MethodBase)methodInfo9, new HarmonyMethod(methodInfo18), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); } public static void SetPlayerTemperature_Heatwave(PlayerEffectsManager __instance, float temperatureDelta) { if ((Object)(object)HeatwaveWeather.Instance == (Object)null || !((BaseWeather)HeatwaveWeather.Instance).IsActive || (Object)(object)References.truckController == (Object)null || (!PlayerUtils.isPlayerOnTruck && !PlayerUtils.isPlayerInCab && !PlayerUtils.isPlayerInStorage)) { return; } CruiserXLController truckController = References.truckController; bool flag = !((VehicleController)truckController).driverSideDoor.boolValue && !((VehicleController)truckController).passengerSideDoor.boolValue && !truckController.driversSideWindowTrigger.boolValue && !truckController.passengersSideWindowTrigger.boolValue && !((VehicleController)truckController).windshieldBroken; bool flag2 = !truckController.liftGateOpen && !truckController.sideDoorOpen; bool flag3 = ((VehicleController)truckController).ignitionStarted && truckController.heaterOn && !truckController.isHeaterWarm && truckController.isHeaterCold; bool flag4 = ((VehicleController)truckController).ignitionStarted && truckController.heaterOn && truckController.isHeaterWarm && !truckController.isHeaterCold; bool flag5 = PlayerUtils.isPlayerOnTruck && !PlayerUtils.isPlayerInCab && !PlayerUtils.isPlayerInStorage; PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController; bool flag6 = (Object)(object)localPlayerController.currentAudioTrigger != (Object)null && localPlayerController.currentAudioTrigger.insideLighting; if ((PlayerUtils.isPlayerInCab && flag) || (PlayerUtils.isPlayerInStorage && flag2)) { if (!flag6) { if (flag3) { PlayerEffectsManager.heatTransferRate = 0.25f * truckController.heaterSpeed; } else if (flag4) { PlayerEffectsManager.heatTransferRate = 1.15f * truckController.heaterSpeed; } else { PlayerEffectsManager.heatTransferRate = 0.75f; } } else { PlayerEffectsManager.heatTransferRate = 1f; } } else { PlayerEffectsManager.heatTransferRate = 1f; } if (flag5) { PlayerEffectsManager.heatTransferRate = 1f; } } public static void VehicleSnowTracksPatch_Prefix(CruiserXLController __instance) { //IL_0020: Unknown result type (might be due to invalid IL or missing references) SnowTrackersManager.AddFootprintTracker((MonoBehaviour)(object)__instance, 6f, 0.75f, 1f, new Vector3(0f, 0f, -1f)); } public static void VehicleSnowTracksFixedUpdatePatch_Prefix(CruiserXLController __instance) { if (SnowPatches.IsSnowActive()) { bool flag = ((VehicleController)__instance).FrontLeftWheel.isGrounded || ((VehicleController)__instance).FrontRightWheel.isGrounded || ((VehicleController)__instance).BackLeftWheel.isGrounded || ((VehicleController)__instance).BackRightWheel.isGrounded; SnowTrackersManager.UpdateFootprintTracker((MonoBehaviour)(object)__instance, flag); } } public static void VFXUpdate_Postfix() { if (!((Object)(object)References.truckController == (Object)null) && (PlayerUtils.isPlayerOnTruck || PlayerUtils.isPlayerInCab || PlayerUtils.isPlayerInStorage) && (PlayerUtils.isPlayerInCab || PlayerUtils.isPlayerInStorage)) { PlayerEffectsManager.isUnderSnow = false; SnowfallVFXManager.snowMovementHindranceMultiplier = 1f; } } public static bool SetColdZoneState_Prefix(BlizzardWeather __instance) { if ((Object)(object)References.truckController == (Object)null) { return true; } if (PlayerUtils.isPlayerOnTruck || PlayerUtils.isPlayerInCab || PlayerUtils.isPlayerInStorage) { return false; } return true; } public static bool SetBaseColdZoneState_Prefix(SnowfallWeather __instance) { if ((Object)(object)BlizzardWeather.Instance == (Object)null) { return true; } if ((Object)(object)References.truckController == (Object)null) { return true; } if (!PlayerUtils.isPlayerOnTruck && !PlayerUtils.isPlayerInCab && !PlayerUtils.isPlayerInStorage) { return true; } CruiserXLController truckController = References.truckController; bool flag = !((VehicleController)truckController).driverSideDoor.boolValue && !((VehicleController)truckController).passengerSideDoor.boolValue && !truckController.driversSideWindowTrigger.boolValue && !truckController.passengersSideWindowTrigger.boolValue && !((VehicleController)truckController).windshieldBroken; bool flag2 = !truckController.liftGateOpen && !truckController.sideDoorOpen; bool flag3 = PlayerUtils.isPlayerOnTruck && !PlayerUtils.isPlayerInCab && !PlayerUtils.isPlayerInStorage; PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController; bool flag4 = (Object)(object)localPlayerController.currentAudioTrigger != (Object)null && localPlayerController.currentAudioTrigger.insideLighting; if (PlayerUtils.isPlayerInCab) { if (flag) { if (((VehicleController)truckController).ignitionStarted && truckController.heaterOn) { PlayerEffectsManager.isInColdZone = truckController.isHeaterCold; } else { PlayerEffectsManager.isInColdZone = !flag4; } } else { PlayerEffectsManager.isInColdZone = IsWindAllowedVehicle(localPlayerController, truckController) && BlizzardWeather.Instance.isLocalPlayerInWind; } return false; } if (PlayerUtils.isPlayerInStorage) { if (flag2) { if (((VehicleController)truckController).ignitionStarted && truckController.heaterOn) { PlayerEffectsManager.isInColdZone = truckController.isHeaterCold; } else { PlayerEffectsManager.isInColdZone = !flag4; } } else { PlayerEffectsManager.isInColdZone = IsWindAllowedVehicle(localPlayerController, truckController) && BlizzardWeather.Instance.isLocalPlayerInWind; } return false; } if (flag3) { PlayerEffectsManager.isInColdZone = IsWindAllowedVehicle(localPlayerController, truckController) && BlizzardWeather.Instance.isLocalPlayerInWind; return false; } return true; } public static bool Update_Prefix(BlizzardWeather __instance) { if ((Object)(object)References.truckController == (Object)null) { return true; } if (!PlayerUtils.isPlayerOnTruck && !PlayerUtils.isPlayerInCab && !PlayerUtils.isPlayerInStorage) { return true; } CruiserXLController truckController = References.truckController; bool flag = !((VehicleController)truckController).driverSideDoor.boolValue && !((VehicleController)truckController).passengerSideDoor.boolValue && !truckController.driversSideWindowTrigger.boolValue && !truckController.passengersSideWindowTrigger.boolValue && !((VehicleController)truckController).windshieldBroken; bool flag2 = !truckController.liftGateOpen && !truckController.sideDoorOpen; bool flag3 = PlayerUtils.isPlayerInCab || PlayerUtils.isPlayerInStorage; bool flag4 = PlayerUtils.isPlayerOnTruck && !PlayerUtils.isPlayerInCab && !PlayerUtils.isPlayerInStorage; PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController; bool flag5 = (Object)(object)localPlayerController.currentAudioTrigger != (Object)null && localPlayerController.currentAudioTrigger.insideLighting; SnowfallWeather instance = SnowfallWeather.Instance; if (instance != null) { instance.Update(); } if (flag3) { if ((PlayerUtils.isPlayerInCab && flag) || (PlayerUtils.isPlayerInStorage && flag2)) { __instance.isPlayerInBlizzard = false; } else { __instance.isPlayerInBlizzard = __instance.isLocalPlayerInWind; } if (((VehicleController)truckController).ignitionStarted && truckController.heaterOn) { PlayerEffectsManager.heatTransferRate = 0.25f * truckController.heaterSpeed; } else { PlayerEffectsManager.heatTransferRate = 0.75f; } } if (flag4) { PlayerEffectsManager.heatTransferRate = 1f; __instance.isPlayerInBlizzard = __instance.isLocalPlayerInWind; } return false; } public static bool IsWindAllowedVehicle(PlayerControllerB localPlayer, CruiserXLController controller) { if ((Object)(object)localPlayer.currentAudioTrigger != (Object)null && localPlayer.currentAudioTrigger.insideLighting) { return false; } bool flag = !((VehicleController)controller).driverSideDoor.boolValue && !((VehicleController)controller).passengerSideDoor.boolValue && !controller.driversSideWindowTrigger.boolValue && !controller.passengersSideWindowTrigger.boolValue && !((VehicleController)controller).windshieldBroken; bool flag2 = !controller.liftGateOpen && !controller.sideDoorOpen; bool flag3 = PlayerUtils.isPlayerOnTruck && !PlayerUtils.isPlayerInCab && !PlayerUtils.isPlayerInStorage; if ((PlayerUtils.isPlayerInCab && !flag) || (PlayerUtils.isPlayerInStorage && !flag2)) { return true; } if (flag3) { return true; } return false; } public static bool CheckConditionsForHeatingStop_Prefix(PlayerControllerB playerController, ref bool __result) { if ((Object)(object)References.truckController == (Object)null) { return true; } if (!PlayerUtils.isPlayerOnTruck && !PlayerUtils.isPlayerInCab && !PlayerUtils.isPlayerInStorage) { return true; } CruiserXLController truckController = References.truckController; bool flag = !((VehicleController)truckController).driverSideDoor.boolValue && !((VehicleController)truckController).passengerSideDoor.boolValue && !truckController.driversSideWindowTrigger.boolValue && !truckController.passengersSideWindowTrigger.boolValue && !((VehicleController)truckController).windshieldBroken; bool flag2 = !truckController.liftGateOpen && !truckController.sideDoorOpen; bool flag3 = ((VehicleController)truckController).ignitionStarted && truckController.heaterOn && !truckController.isHeaterWarm && truckController.isHeaterCold; bool flag4 = ((VehicleController)truckController).ignitionStarted && truckController.heaterOn && truckController.isHeaterWarm && !truckController.isHeaterCold; bool flag5 = PlayerUtils.isPlayerOnTruck && !PlayerUtils.isPlayerInCab && !PlayerUtils.isPlayerInStorage; bool flag6 = (Object)(object)playerController.currentAudioTrigger != (Object)null && playerController.currentAudioTrigger.insideLighting; if ((PlayerUtils.isPlayerInCab && flag) || (PlayerUtils.isPlayerInStorage && flag2)) { if (flag3) { __result = true; } else if (flag4) { __result = false; } else { __result = false; } } else { __result = (flag6 ? true : false); } if (flag5) { __result = (flag6 ? true : false); } return false; } public static bool CheckConditionsForHeatingPause_Prefix(PlayerControllerB playerController, ref bool __result) { if ((Object)(object)References.truckController == (Object)null) { return true; } if (!PlayerUtils.isPlayerOnTruck && !PlayerUtils.isPlayerInCab && !PlayerUtils.isPlayerInStorage) { return true; } __result = false; return false; } } public class LethalMinCompatibility { [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public static void PatchAllCompatibilityMethods(Harmony harmony) { ApplyPikminPatch(harmony); } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] [HarmonyPrefix] public static void ApplyPikminPatch(Harmony harmony) { //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Expected O, but got Unknown //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Expected O, but got Unknown MethodInfo methodInfo = AccessTools.Method(typeof(CruiserXLCollisionTrigger), "OnTriggerEnter", (Type[])null, (Type[])null); MethodInfo methodInfo2 = AccessTools.Method(typeof(LethalMinCompatibility), "OnTriggerEnter_Prefix", (Type[])null, (Type[])null); MethodInfo methodInfo3 = AccessTools.Method(typeof(PikminVehicleController), "InitializeReferences", (Type[])null, (Type[])null); MethodInfo methodInfo4 = AccessTools.Method(typeof(LethalMinCompatibility), "InitializeReferences_Prefix", (Type[])null, (Type[])null); harmony.Patch((MethodBase)methodInfo, new HarmonyMethod(methodInfo2), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); harmony.Patch((MethodBase)methodInfo3, new HarmonyMethod(methodInfo4), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); } public static bool InitializeReferences_Prefix(PikminVehicleController __instance) { //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) CruiserXLController cruiserXLController = default(CruiserXLController); if (((Component)__instance).TryGetComponent(ref cruiserXLController)) { __instance.controller = (VehicleController)(object)cruiserXLController; __instance.PointsRegion = cruiserXLController.collisionTrigger.insideTruckNavMeshBounds; __instance.PikminCheckRegion = cruiserXLController.storageCompartment; __instance.PikminWarpPoint = new GameObject("Pikmin Warp Point").transform; __instance.PikminWarpPoint.SetParent(((Component)__instance).transform); __instance.PikminWarpPoint.localPosition = new Vector3(0f, -2f, -6.55f); __instance.PikminWarpPoint.localScale = new Vector3(1f, 1f, 1f); __instance.OriginalWTLocalPosition = __instance.PikminWarpPoint.localPosition; return false; } return true; } public static bool OnTriggerEnter_Prefix(CruiserXLCollisionTrigger __instance, ref Collider other) { try { PikminCollisionDetect val = default(PikminCollisionDetect); if (((Component)other).gameObject.CompareTag("Enemy") && ((Component)other).gameObject.TryGetComponent(ref val)) { return false; } } catch (Exception arg) { Plugin.Logger.LogError((object)$"Error in CruiserXLCollisionTrigger.OnTriggerEnterPrefix: {arg}"); return true; } return true; } } } namespace ScanVan.ClipLoading { public class DisposableAudioClip : IDisposable { private AudioSource _source; private AudioClip _clip; private CancellationToken _token; private bool _disposed = false; public AudioClip AudioClip => _clip; public bool Disposed => _disposed; public DisposableAudioClip(AudioSource source, AudioClip clip) { _source = source; _clip = clip; SetToken(default(CancellationToken)); } internal void SetToken(CancellationToken token) { _token = token; _token.Register(delegate { Dispose(); }); } public void Dispose() { _disposed = true; if ((Object)(object)_source != (Object)null) { StopAndCleanSource(); } if ((Object)(object)_clip != (Object)null) { Object.Destroy((Object)(object)_clip); } _source = null; _clip = null; } private void StopAndCleanSource() { if ((Object)(object)_source.clip == (Object)(object)_clip) { _source.Stop(); _source.clip = null; } } } public class DisposableAudioWebRequest : IDisposable { private DisposableAudioClip _disposableAudioClip; private UnityWebRequest _request; private bool _disposed = false; private string _error; private int _code; private bool _isDone = false; public DisposableAudioClip AudioClip => _disposableAudioClip; public string Error => _error; public int Code => _code; public bool IsDone => _isDone; public bool IsDisposed => _disposed; public DisposableAudioWebRequest(UnityWebRequest request) { _request = request; } public string GetReadableError() { return $"Code : {_code} {_error}"; } public bool HasErrors() { return !string.IsNullOrEmpty(_error); } internal void SetDisposableClip(DisposableAudioClip clip) { _disposableAudioClip = clip; } internal void SetStatus() { _code = (int)_request.responseCode; _error = _request.error; _isDone = _request.isDone; } public void Dispose() { if (!_disposed) { _disposed = true; if (_request != null) { SetStatus(); _request.Dispose(); } _request = null; } } } public class MP3Stream { private enum StreamingPlaybackState { Stopped, Playing, Buffering, Paused } private delegate void ShowErrorDelegate(string message); public bool Distorted = false; public bool decomp = false; public string buffer_info = null; public string song_info = null; public BufferedWaveProvider bufferedWaveProvider = null; private AudioSource _audioSource = null; private volatile StreamingPlaybackState playbackState; private volatile bool fullyDownloaded; private HttpWebRequest webRequest = null; private bool IsBufferNearlyFull => bufferedWaveProvider != null && bufferedWaveProvider.BufferLength - bufferedWaveProvider.BufferedBytes < bufferedWaveProvider.WaveFormat.AverageBytesPerSecond / 4; private void ShowError(string message) { Debug.LogWarning((object)message); } public void PlayStream(string streamUrl, AudioSource audioSource) { _audioSource = audioSource; if (playbackState == StreamingPlaybackState.Stopped) { playbackState = StreamingPlaybackState.Buffering; bufferedWaveProvider = null; ThreadPool.QueueUserWorkItem(StreamMp3, streamUrl); } else if (playbackState == StreamingPlaybackState.Paused) { playbackState = StreamingPlaybackState.Buffering; } } private void StreamMp3(object state) { //IL_0164: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Unknown result type (might be due to invalid IL or missing references) //IL_0183: Expected O, but got Unknown fullyDownloaded = false; string requestUriString = (string)state; webRequest = (HttpWebRequest)WebRequest.Create(requestUriString); int num = 0; webRequest.Headers.Clear(); webRequest.Headers.Add("GET", "/ HTTP/1.0"); webRequest.Headers.Add("Icy-MetaData", "1"); webRequest.UserAgent = "LethalCompany/ScandalRadio"; HttpWebResponse httpWebResponse; try { httpWebResponse = (HttpWebResponse)webRequest.GetResponse(); } catch (WebException ex) { if (ex.Status != WebExceptionStatus.RequestCanceled) { Console.WriteLine(ex.Message); } return; } byte[] array = new byte[65536]; try { num = Convert.ToInt32(httpWebResponse.GetResponseHeader("icy-metaint")); } catch { } IMp3FrameDecompressor val = null; try { using Stream sourceStream = httpWebResponse.GetResponseStream(); ReadFullyStream readFullyStream = new ReadFullyStream(sourceStream); do { if (IsBufferNearlyFull) { Thread.Sleep(1000); continue; } Mp3Frame val2; try { val2 = Mp3Frame.LoadFromStream((Stream)readFullyStream); } catch (EndOfStreamException) { fullyDownloaded = true; break; } catch (WebException) { break; } if (val2 == null) { break; } if (val == null) { val = CreateFrameDecompressor(val2); bufferedWaveProvider = new BufferedWaveProvider(val.OutputFormat) { BufferDuration = TimeSpan.FromSeconds(30.0) }; decomp = true; } int num2 = val.DecompressFrame(val2, array, 0); bufferedWaveProvider.AddSamples(array, 0, num2); } while (playbackState != 0); Console.WriteLine("Exiting Thread"); ((IDisposable)val).Dispose(); readFullyStream.Close(); readFullyStream.Dispose(); } finally { ((IDisposable)val)?.Dispose(); } } public void ReadData(float[] data) { if (bufferedWaveProvider == null) { return; } WaveExtensionMethods.ToSampleProvider((IWaveProvider)(object)bufferedWaveProvider).Read(data, 0, data.Length); if (Distorted) { for (int i = 0; i < data.Length; i++) { float num = Mathf.Cos(0.4f * Time.time) / 3f - 0.165f; data[i] = Mathf.Clamp(data[i] + num + Random.Range(-0.07f, 0.07f), 0f, 1f); } } } private static IMp3FrameDecompressor CreateFrameDecompressor(Mp3Frame frame) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Invalid comparison between Unknown and I4 //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Expected O, but got Unknown //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Expected O, but got Unknown WaveFormat val = (WaveFormat)new Mp3WaveFormat(frame.SampleRate, ((int)frame.ChannelMode == 3) ? 1 : 2, frame.FrameLength, frame.BitRate); return (IMp3FrameDecompressor)new AcmMp3FrameDecompressor(val); } public void StopPlayback() { if (playbackState != 0) { if (!fullyDownloaded) { } decomp = false; playbackState = StreamingPlaybackState.Stopped; if ((Object)(object)_audioSource != (Object)null) { _audioSource.Stop(); } ShowBufferState(0.0, 0.0); } } private void ShowBufferState(double buffered, double total) { buffer_info = $"{buffered:0.0}s/{total:0.0}s"; } public void UpdateLoop() { if (playbackState != 0 && bufferedWaveProvider != null) { double totalSeconds = bufferedWaveProvider.BufferedDuration.TotalSeconds; ShowBufferState(totalSeconds, bufferedWaveProvider.BufferDuration.TotalSeconds); if (totalSeconds < 0.5 && playbackState == StreamingPlaybackState.Playing && !fullyDownloaded) { Pause(); } else if (totalSeconds > 3.0 && playbackState == StreamingPlaybackState.Buffering) { Play(); } else if (fullyDownloaded && totalSeconds < 0.5) { Plugin.Logger.LogMessage((object)"Reached end of stream"); StopPlayback(); } } } public void Play() { _audioSource.Play(); playbackState = StreamingPlaybackState.Playing; } public void Pause() { playbackState = StreamingPlaybackState.Buffering; _audioSource.Pause(); } } public class ReadFullyStream : Stream { private readonly Stream sourceStream; private long pos; private readonly byte[] readAheadBuffer; private int readAheadLength; private int readAheadOffset; public override bool CanRead => true; public override bool CanSeek => false; public override bool CanWrite => false; public override long Length => pos; public override long Position { get { return pos; } set { throw new InvalidOperationException(); } } public ReadFullyStream(Stream sourceStream) { this.sourceStream = sourceStream; readAheadBuffer = new byte[4096]; } public override void Flush() { throw new InvalidOperationException(); } public override int Read(byte[] buffer, int offset, int count) { int num = 0; while (num < count) { int num2 = readAheadLength - readAheadOffset; int val = count - num; if (num2 > 0) { int num3 = Math.Min(num2, val); Array.Copy(readAheadBuffer, readAheadOffset, buffer, offset + num, num3); num += num3; readAheadOffset += num3; continue; } readAheadOffset = 0; readAheadLength = sourceStream.Read(readAheadBuffer, 0, readAheadBuffer.Length); if (readAheadLength != 0) { continue; } break; } pos += num; return num; } public override long Seek(long offset, SeekOrigin origin) { throw new InvalidOperationException(); } public override void SetLength(long value) { throw new InvalidOperationException(); } public override void Write(byte[] buffer, int offset, int count) { throw new InvalidOperationException(); } } public class UnityAudioStream : MonoBehaviour { [CompilerGenerated] private sealed class d__4 : IAsyncStateMachine { public int <>1__state; public AsyncUniTaskMethodBuilder <>t__builder; public string uri; public UnityAudioStream <>4__this; private Awaiter <>u__1; private void MoveNext() { //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) int num = <>1__state; try { Awaiter awaiter; if (num != 0) { SwitchToThreadPoolAwaitable val = UniTask.SwitchToThreadPool(); awaiter = ((SwitchToThreadPoolAwaitable)(ref val)).GetAwaiter(); if (!((Awaiter)(ref awaiter)).IsCompleted) { num = (<>1__state = 0); <>u__1 = awaiter; d__4 d__ = this; ((AsyncUniTaskMethodBuilder)(ref <>t__builder)).AwaitUnsafeOnCompletedd__4>(ref awaiter, ref d__); return; } } else { awaiter = <>u__1; <>u__1 = default(Awaiter); num = (<>1__state = -1); } ((Awaiter)(ref awaiter)).GetResult(); <>4__this._stream?.PlayStream(uri, <>4__this._audioSource); } catch (Exception exception) { <>1__state = -2; ((AsyncUniTaskMethodBuilder)(ref <>t__builder)).SetException(exception); return; } <>1__state = -2; ((AsyncUniTaskMethodBuilder)(ref <>t__builder)).SetResult(); } void IAsyncStateMachine.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext this.MoveNext(); } [DebuggerHidden] private void SetStateMachine(IAsyncStateMachine stateMachine) { } void IAsyncStateMachine.SetStateMachine(IAsyncStateMachine stateMachine) { //ILSpy generated this explicit interface implementation from .override directive in SetStateMachine this.SetStateMachine(stateMachine); } } private AudioSource _audioSource = null; private MP3Stream? _stream; public void Awake() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown GameObject val = new GameObject("AudioSource"); Object.DontDestroyOnLoad((Object)(object)val); ((Object)val).hideFlags = (HideFlags)61; _audioSource = val.AddComponent(); } public void PlayAudioFromStream(string uri) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) if (_stream == null) { _stream = new MP3Stream(); } UniTaskExtensions.Forget(StartMP3Stream(uri)); } [AsyncStateMachine(typeof(d__4))] [DebuggerStepThrough] private UniTask StartMP3Stream(string uri) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) d__4 d__ = new d__4(); d__.<>t__builder = AsyncUniTaskMethodBuilder.Create(); d__.<>4__this = this; d__.uri = uri; d__.<>1__state = -1; ((AsyncUniTaskMethodBuilder)(ref d__.<>t__builder)).Start<d__4>(ref d__); return ((AsyncUniTaskMethodBuilder)(ref d__.<>t__builder)).Task; } public void FixedUpdate() { _stream?.UpdateLoop(); } public void Update() { //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Expected O, but got Unknown if (_stream != null && _stream.decomp) { _audioSource.clip = AudioClip.Create("mp3_Stream", int.MaxValue, _stream.bufferedWaveProvider.WaveFormat.Channels, _stream.bufferedWaveProvider.WaveFormat.SampleRate, true, new PCMReaderCallback(_stream.ReadData)); _stream.decomp = false; } } public void Stop() { _stream?.StopPlayback(); _stream = null; if ((Object)(object)_audioSource != (Object)null) { _audioSource.Stop(); _audioSource.time = 0f; _audioSource.clip = null; } } } } namespace ScanVan.Behaviour { public class VoiceAlertDefinition { public ElectronicVoiceAlert alertType; public VoiceAlertPriority priority; public Func triggerCondition = null; public Func resetCondition = null; public Func setThankYou = null; public bool canThankYou; public bool hasPlayed; } public class EVAModule : NetworkBehaviour { [Header("EVA System")] public CruiserXLController controller = null; public AudioClip[] voiceAudioClips = null; public AudioSource voiceAudio = null; public AudioClip sixBeepAlert = null; public AudioClip singleAlert = null; public AudioClip highToneAlert = null; public AudioClip highToneAlertAlt = null; public AudioClip doorAlertAlt = null; public Coroutine playAudioCoroutine = null; public Coroutine audioTimedCoroutine = null; public Light clusterLight = null; public TextMeshPro clusterScreen = null; public VoiceAlertPriority currentPriority; public VoiceAlertDefinition[] alerts = null; public Queue<(int clipId, bool thank, bool important, bool ignition, int importantType)> alertClipQueue = new Queue<(int, bool, bool, bool, int)>(); public bool audioIsPlaying; public int randomServiceAlert = -1; public float baseVolume = 0.8f; public string[] clusterTexts = null; public bool isPlayingIgnitionChime; public bool isPlayingOnEngineStart; public int currentClipId; public int randomOverheatClipToPlay; public bool isImportantAlert; public bool isKeysForgotten; public float alertSystemInterval; public bool setThankYouClip; public bool stopThankYouClip; public bool hasAlertedOnEngineStart; public bool ignitionChimeStarted; public bool ignitionChimeFinished; public void Start() { alerts = new VoiceAlertDefinition[19] { new VoiceAlertDefinition { alertType = ElectronicVoiceAlert.WasherFluidLow, triggerCondition = () => controller.electricsOn && ignitionChimeFinished, resetCondition = () => !controller.electricsOn || !ignitionChimeFinished, priority = VoiceAlertPriority.IsService }, new VoiceAlertDefinition { alertType = ElectronicVoiceAlert.AllSystemsOk, triggerCondition = () => controller.electricsOn && ignitionChimeFinished && !hasAlertedOnEngineStart && !audioIsPlaying && ((VehicleController)controller).carHP > 22 && Mathf.Abs(controller.wheelRPM) > 50f, resetCondition = () => !controller.electricsOn, priority = VoiceAlertPriority.IsIgnition }, new VoiceAlertDefinition { alertType = ElectronicVoiceAlert.FastenBelts, triggerCondition = () => ((VehicleController)controller).testingVehicleInEditor, resetCondition = () => !((VehicleController)controller).testingVehicleInEditor, priority = VoiceAlertPriority.Low }, new VoiceAlertDefinition { alertType = ElectronicVoiceAlert.ThankYou, triggerCondition = () => setThankYouClip, resetCondition = () => stopThankYouClip, priority = VoiceAlertPriority.Override }, new VoiceAlertDefinition { alertType = ElectronicVoiceAlert.ParkBrakeOn, triggerCondition = () => audioTimedCoroutine == null && controller.handbrakeEngaged && ((VehicleController)controller).drivePedalPressed && ((VehicleController)controller).ignitionStarted, resetCondition = () => !controller.handbrakeEngaged || !((VehicleController)controller).ignitionStarted, canThankYou = true, setThankYou = () => !controller.handbrakeEngaged, priority = VoiceAlertPriority.Low }, new VoiceAlertDefinition { alertType = ElectronicVoiceAlert.KeyInIgnition, triggerCondition = () => ((VehicleController)controller).keyIsInIgnition && !((VehicleController)controller).ignitionStarted && ((VehicleController)controller).driverSideDoor.boolValue, resetCondition = () => !((VehicleController)controller).driverSideDoor.boolValue || !((VehicleController)controller).keyIsInIgnition || ((VehicleController)controller).ignitionStarted, priority = VoiceAlertPriority.IsImportant }, new VoiceAlertDefinition { alertType = ElectronicVoiceAlert.HeadlampsOn, triggerCondition = () => ((VehicleController)controller).headlightsContainer.activeSelf && !((VehicleController)controller).ignitionStarted && ((VehicleController)controller).driverSideDoor.boolValue, resetCondition = () => !((VehicleController)controller).driverSideDoor.boolValue || !((VehicleController)controller).headlightsContainer.activeSelf || ((VehicleController)controller).ignitionStarted, priority = VoiceAlertPriority.IsImportant }, new VoiceAlertDefinition { alertType = ElectronicVoiceAlert.DriverDoorAjar, triggerCondition = () => audioTimedCoroutine == null && ((VehicleController)controller).ignitionStarted && ((VehicleController)controller).driverSideDoor.boolValue && controller.wheelRPM > 80f, resetCondition = () => !((VehicleController)controller).driverSideDoor.boolValue || !((VehicleController)controller).ignitionStarted, canThankYou = true, setThankYou = () => !((VehicleController)controller).driverSideDoor.boolValue && ((VehicleController)controller).ignitionStarted, priority = VoiceAlertPriority.DoorAlert }, new VoiceAlertDefinition { alertType = ElectronicVoiceAlert.PassengerDoorAjar, triggerCondition = () => audioTimedCoroutine == null && ((VehicleController)controller).ignitionStarted && ((VehicleController)controller).passengerSideDoor.boolValue && controller.wheelRPM > 80f, resetCondition = () => !((VehicleController)controller).passengerSideDoor.boolValue || !((VehicleController)controller).ignitionStarted, canThankYou = true, setThankYou = () => !((VehicleController)controller).passengerSideDoor.boolValue && ((VehicleController)controller).ignitionStarted, priority = VoiceAlertPriority.DoorAlert }, new VoiceAlertDefinition { alertType = ElectronicVoiceAlert.RearHatchAjar, triggerCondition = () => audioTimedCoroutine == null && ((VehicleController)controller).ignitionStarted && controller.liftGateOpen && controller.wheelRPM > 80f, resetCondition = () => !controller.liftGateOpen || !((VehicleController)controller).ignitionStarted, canThankYou = true, setThankYou = () => !controller.liftGateOpen && ((VehicleController)controller).ignitionStarted, priority = VoiceAlertPriority.DoorAlert }, new VoiceAlertDefinition { alertType = ElectronicVoiceAlert.BackRightDoorAjar, triggerCondition = () => audioTimedCoroutine == null && ((VehicleController)controller).ignitionStarted && controller.sideDoorOpen && controller.wheelRPM > 80f, resetCondition = () => !controller.sideDoorOpen || !((VehicleController)controller).ignitionStarted, canThankYou = true, setThankYou = () => !controller.sideDoorOpen && ((VehicleController)controller).ignitionStarted, priority = VoiceAlertPriority.DoorAlert }, new VoiceAlertDefinition { alertType = ElectronicVoiceAlert.TransFluidLevel, triggerCondition = () => controller.transmissionHP <= 12 && ((VehicleController)controller).ignitionStarted, resetCondition = () => controller.transmissionHP > 12 || !controller.electricsOn || isImportantAlert, priority = VoiceAlertPriority.Medium }, new VoiceAlertDefinition { alertType = ElectronicVoiceAlert.FuelLevel, triggerCondition = () => ((VehicleController)controller).carHP <= 38 && controller.electricsOn, resetCondition = () => ((VehicleController)controller).carHP > 38 || !controller.electricsOn || isImportantAlert, priority = VoiceAlertPriority.Low }, new VoiceAlertDefinition { alertType = ElectronicVoiceAlert.EngineCoolantLevel, triggerCondition = () => ((VehicleController)controller).carHP <= 30 && controller.electricsOn, resetCondition = () => ((VehicleController)controller).carHP > 30 || !controller.electricsOn || isImportantAlert, priority = VoiceAlertPriority.Low }, new VoiceAlertDefinition { alertType = ElectronicVoiceAlert.EngineOilLevel, triggerCondition = () => ((VehicleController)controller).carHP <= 25 && controller.electricsOn, resetCondition = () => ((VehicleController)controller).carHP > 25 || !controller.electricsOn || isImportantAlert, priority = VoiceAlertPriority.Low }, new VoiceAlertDefinition { alertType = ElectronicVoiceAlert.ChargeSysMalfunction, triggerCondition = () => ((VehicleController)controller).carHP <= 22 && controller.electricsOn, resetCondition = () => ((VehicleController)controller).carHP > 22 || !controller.electricsOn || isImportantAlert, priority = VoiceAlertPriority.Medium }, new VoiceAlertDefinition { alertType = ElectronicVoiceAlert.EngineOilPressure, triggerCondition = () => ((VehicleController)controller).carHP <= 16 && controller.electricsOn, resetCondition = () => ((VehicleController)controller).carHP > 16 || !controller.electricsOn || isImportantAlert, priority = VoiceAlertPriority.Low }, new VoiceAlertDefinition { alertType = ElectronicVoiceAlert.EngineTempAboveNormal, triggerCondition = () => ((VehicleController)controller).carHP <= 12 && randomOverheatClipToPlay == 15 && controller.electricsOn, resetCondition = () => ((VehicleController)controller).carHP > 12 || !controller.electricsOn || randomOverheatClipToPlay == 0 || isImportantAlert, priority = VoiceAlertPriority.Medium }, new VoiceAlertDefinition { alertType = ElectronicVoiceAlert.EngineOverheating, triggerCondition = () => ((VehicleController)controller).carHP <= 12 && randomOverheatClipToPlay == 16 && controller.electricsOn, resetCondition = () => ((VehicleController)controller).carHP > 12 || !controller.electricsOn || randomOverheatClipToPlay == 0 || isImportantAlert, priority = VoiceAlertPriority.Medium } }; } public void DoEVACycle() { if (!((Object)(object)controller == (Object)null) && ((NetworkBehaviour)controller).IsSpawned && !((VehicleController)controller).carDestroyed && NetworkManager.Singleton.IsHost) { if (alertSystemInterval <= 0.25f) { alertSystemInterval += Time.deltaTime; return; } alertSystemInterval = 0f; SetIgnitionClips(); SetRandomOverheatClip(); SetVoiceAlertClips(); TryPlayQueuedClips(); } } public void SetRandomOverheatClip() { if (!((VehicleController)controller).ignitionStarted) { randomOverheatClipToPlay = 0; } else if (((VehicleController)controller).isHoodOnFire && ((VehicleController)controller).carHP <= 15) { if (randomOverheatClipToPlay == 0) { int num = Random.Range(15, 17); randomOverheatClipToPlay = num; } } else { randomOverheatClipToPlay = 0; } } public void SetVoiceAlertClips() { if (!ignitionChimeFinished || isImportantAlert || isKeysForgotten) { return; } VoiceAlertDefinition[] array = alerts; foreach (VoiceAlertDefinition voiceAlertDefinition in array) { if (voiceAlertDefinition.triggerCondition() && !voiceAlertDefinition.hasPlayed) { if (audioTimedCoroutine != null && voiceAudio.isPlaying) { if (CanInterrupt(currentPriority, voiceAlertDefinition.priority)) { CancelVoiceAudioCoroutine(); voiceAudio.Stop(); alertClipQueue.Clear(); SetClipInQueue(voiceAlertDefinition.alertType); } else { SetClipInQueue(voiceAlertDefinition.alertType); } } else { SetClipInQueue(voiceAlertDefinition.alertType); } voiceAlertDefinition.hasPlayed = true; } else if (voiceAlertDefinition.hasPlayed && voiceAlertDefinition.canThankYou && voiceAlertDefinition.setThankYou()) { if (audioTimedCoroutine == null || !voiceAudio.isPlaying || CanInterrupt(currentPriority, VoiceAlertPriority.Override)) { SetThankYouClip(); voiceAlertDefinition.hasPlayed = false; } } else if (voiceAlertDefinition.resetCondition() && voiceAlertDefinition.hasPlayed) { voiceAlertDefinition.hasPlayed = false; } } } private bool CanInterrupt(VoiceAlertPriority current, VoiceAlertPriority alertPriority) { if (alertPriority == VoiceAlertPriority.IsImportant) { return true; } if (current == VoiceAlertPriority.IsIgnition) { return false; } return alertPriority switch { VoiceAlertPriority.Override => current != VoiceAlertPriority.IsIgnition, VoiceAlertPriority.IsIgnition => current != VoiceAlertPriority.IsService, _ => alertPriority > current, }; } public void SetIgnitionClips() { if (isImportantAlert && isKeysForgotten && !((VehicleController)controller).headlightsContainer.activeSelf && !((VehicleController)controller).keyIsInIgnition) { isImportantAlert = false; isKeysForgotten = false; ResetAudioClip(ElectronicVoiceAlert.HeadlampsOn); ResetAudioClip(ElectronicVoiceAlert.KeyInIgnition); SetThankYouClip(); return; } if (currentClipId != 2) { if ((!isImportantAlert || !isKeysForgotten) && ((VehicleController)controller).driverSideDoor.boolValue && ((VehicleController)controller).headlightsContainer.activeSelf && !((VehicleController)controller).ignitionStarted && ((VehicleController)controller).keyIsInIgnition) { isImportantAlert = true; isKeysForgotten = true; SetImportantAlert(-1, -1); return; } if (!isImportantAlert && !((VehicleController)controller).ignitionStarted && ((VehicleController)controller).driverSideDoor.boolValue && ((VehicleController)controller).headlightsContainer.activeSelf) { isImportantAlert = true; SetImportantAlert(5, 1); return; } if (!isKeysForgotten && ((VehicleController)controller).keyIsInIgnition && !((VehicleController)controller).ignitionStarted && ((VehicleController)controller).driverSideDoor.boolValue) { isKeysForgotten = true; SetImportantAlert(4, 2); return; } } if (isImportantAlert && (!((VehicleController)controller).headlightsContainer.activeSelf || ((VehicleController)controller).ignitionStarted) && currentClipId != 2) { isImportantAlert = false; isKeysForgotten = false; ResetAudioClip(ElectronicVoiceAlert.HeadlampsOn); ResetAudioClip(ElectronicVoiceAlert.KeyInIgnition); SetThankYouClip(); return; } if (isKeysForgotten && !((VehicleController)controller).keyIsInIgnition && currentClipId != 2) { isKeysForgotten = false; isImportantAlert = false; ResetAudioClip(ElectronicVoiceAlert.HeadlampsOn); ResetAudioClip(ElectronicVoiceAlert.KeyInIgnition); SetThankYouClip(); return; } if ((isKeysForgotten || isImportantAlert) && !((VehicleController)controller).driverSideDoor.boolValue) { isKeysForgotten = false; isImportantAlert = false; if (isPlayingIgnitionChime) { ignitionChimeStarted = false; hasAlertedOnEngineStart = false; } if (isPlayingOnEngineStart) { hasAlertedOnEngineStart = false; ResetAudioClip(ElectronicVoiceAlert.AllSystemsOk); } StopAudioClipIfPlaying(); return; } if (controller.electricsOn) { if (!ignitionChimeStarted && currentClipId != 2 && !isImportantAlert && !isKeysForgotten) { isPlayingOnEngineStart = true; ignitionChimeStarted = true; hasAlertedOnEngineStart = false; int num = Random.Range(-5, 4); randomServiceAlert = num; ResetAudioClip(ElectronicVoiceAlert.HeadlampsOn); ResetAudioClip(ElectronicVoiceAlert.KeyInIgnition); ResetAudioClip(ElectronicVoiceAlert.AllSystemsOk); SetIgnitionChime(); } return; } VoiceAlertDefinition[] array = alerts; foreach (VoiceAlertDefinition voiceAlertDefinition in array) { if (voiceAlertDefinition.priority != VoiceAlertPriority.IsImportant) { voiceAlertDefinition.hasPlayed = false; } } ResetAudioClip(ElectronicVoiceAlert.ThankYou); ignitionChimeFinished = false; ignitionChimeStarted = false; hasAlertedOnEngineStart = false; randomOverheatClipToPlay = 0; randomServiceAlert = -1; } private void TryPlayQueuedClips() { if (alertClipQueue.Count != 0 && audioTimedCoroutine == null && playAudioCoroutine == null && !isImportantAlert && !isKeysForgotten && ignitionChimeFinished) { playAudioCoroutine = ((MonoBehaviour)this).StartCoroutine(TryPlayAudioClipsInQueue()); } } private void StopAudioClipIfPlaying() { CancelVoiceAudioCoroutine(); voiceAudio.Stop(); voiceAudio.clip = null; currentClipId = -1; ((TMP_Text)clusterScreen).text = null; ((Behaviour)clusterLight).enabled = false; StopAudioClipRpc(); } [Rpc(/*Could not decode attribute arguments.*/)] public void StopAudioClipRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(3748556394u, val2, val, (SendTo)5, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendRpc(ref val3, 3748556394u, val2, val, (SendTo)5, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1) { base.__rpc_exec_stage = (__RpcExecStage)0; isKeysForgotten = false; isImportantAlert = false; CancelVoiceAudioCoroutine(); voiceAudio.Stop(); voiceAudio.clip = null; currentClipId = -1; ((TMP_Text)clusterScreen).text = null; ((Behaviour)clusterLight).enabled = false; } } } private void ResetAudioClip(ElectronicVoiceAlert alert) { RemoveClipFromQueue((int)alert); } private void RemoveClipFromQueue(int clipId) { if (IsClipInQueue(clipId)) { alertClipQueue = new Queue<(int, bool, bool, bool, int)>(alertClipQueue.Where(((int clipId, bool thank, bool important, bool ignition, int importantType) i) => i.clipId != clipId)); } } private void SetClipInQueue(ElectronicVoiceAlert alert, bool isThankYouClip = false, bool isImportantWarning = false, bool isIgnitionChime = false, int importantType = -1) { if (!IsClipInQueue((int)alert)) { alertClipQueue.Enqueue(((int)alert, isThankYouClip, isImportantWarning, isIgnitionChime, importantType)); } } public bool IsClipInQueue(int alertInt) { if (alertClipQueue.Any(((int clipId, bool thank, bool important, bool ignition, int importantType) i) => i.clipId == alertInt)) { return true; } return false; } public void SetThankYouClip() { if ((Object)(object)voiceAudio.clip != (Object)null && voiceAudio.isPlaying && (Object)(object)voiceAudio.clip != (Object)(object)voiceAudioClips[2] && voiceAudio.time < voiceAudio.clip.length / 2f && currentClipId != -1 && (Object)(object)voiceAudio.clip != (Object)(object)voiceAudioClips[3]) { VoiceAlertDefinition voiceAlertDefinition = alerts.FirstOrDefault((VoiceAlertDefinition i) => i.alertType == (ElectronicVoiceAlert)currentClipId); if (voiceAlertDefinition != null && voiceAlertDefinition.triggerCondition()) { SetClipInQueue((ElectronicVoiceAlert)currentClipId); } } CancelVoiceAudioCoroutine(); voiceAudio.Stop(); alertClipQueue.Clear(); PlayAudioClip(2, playThankAudio: true, isImportantWarning: false, isIgnitionChime: false, 0); SetThankYouClipRpc(isImportantAlert, isKeysForgotten); } [Rpc(/*Could not decode attribute arguments.*/)] public void SetThankYouClipRpc(bool isLamps, bool isKeys) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(3872872763u, val2, val, (SendTo)5, (RpcDelivery)0); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref isLamps, default(ForPrimitives)); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref isKeys, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val3, 3872872763u, val2, val, (SendTo)5, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1) { base.__rpc_exec_stage = (__RpcExecStage)0; isKeysForgotten = isKeys; isImportantAlert = isLamps; CancelVoiceAudioCoroutine(); voiceAudio.Stop(); alertClipQueue.Clear(); PlayAudioClip(2, playThankAudio: true, isImportantWarning: false, isIgnitionChime: false, 0); } } } public void SetImportantAlert(int clipToPlay, int clipType) { CancelVoiceAudioCoroutine(); voiceAudio.Stop(); alertClipQueue.Clear(); PlayAudioClip(clipToPlay, playThankAudio: false, isImportantWarning: true, isIgnitionChime: false, clipType); SetImportantAlertRpc(clipToPlay, clipType, isKeysForgotten, isImportantAlert); } [Rpc(/*Could not decode attribute arguments.*/)] public void SetImportantAlertRpc(int clipToPlay, int clipType, bool isKeys, bool isLamps) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(2753757642u, val2, val, (SendTo)5, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val3, clipToPlay); BytePacker.WriteValueBitPacked(val3, clipType); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref isKeys, default(ForPrimitives)); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref isLamps, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val3, 2753757642u, val2, val, (SendTo)5, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1) { base.__rpc_exec_stage = (__RpcExecStage)0; isKeysForgotten = isKeys; isImportantAlert = isLamps; CancelVoiceAudioCoroutine(); voiceAudio.Stop(); alertClipQueue.Clear(); PlayAudioClip(clipToPlay, playThankAudio: false, isImportantWarning: true, isIgnitionChime: false, clipType); } } } public void SetIgnitionChime() { CancelVoiceAudioCoroutine(); voiceAudio.Stop(); alertClipQueue.Clear(); PlayAudioClip(-1, playThankAudio: false, isImportantWarning: false, isIgnitionChime: true, -1); SetIgnitionChimeRpc(); } [Rpc(/*Could not decode attribute arguments.*/)] public void SetIgnitionChimeRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(1132289964u, val2, val, (SendTo)5, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendRpc(ref val3, 1132289964u, val2, val, (SendTo)5, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1) { base.__rpc_exec_stage = (__RpcExecStage)0; CancelVoiceAudioCoroutine(); voiceAudio.Stop(); alertClipQueue.Clear(); PlayAudioClip(-1, playThankAudio: false, isImportantWarning: false, isIgnitionChime: true, -1); } } } [Rpc(/*Could not decode attribute arguments.*/)] public void PlayAudioClipRpc(int clipToPlay = 0, bool isThankYouClip = false, bool isImportantWarning = false, bool isIgnitionChime = false, int importantType = -1, bool overridePlayback = true) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(1220500623u, val2, val, (SendTo)5, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val3, clipToPlay); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref isThankYouClip, default(ForPrimitives)); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref isImportantWarning, default(ForPrimitives)); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref isIgnitionChime, default(ForPrimitives)); BytePacker.WriteValueBitPacked(val3, importantType); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref overridePlayback, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val3, 1220500623u, val2, val, (SendTo)5, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 1) { return; } base.__rpc_exec_stage = (__RpcExecStage)0; if (overridePlayback) { CancelVoiceAudioCoroutine(); voiceAudio.Stop(); alertClipQueue.Clear(); PlayAudioClip(clipToPlay, isThankYouClip, isImportantWarning, isIgnitionChime, importantType); return; } if (alertClipQueue.Count >= voiceAudioClips.Length) { alertClipQueue.Clear(); } alertClipQueue.Enqueue((clipToPlay, isThankYouClip, isImportantWarning, isIgnitionChime, importantType)); playAudioCoroutine = ((MonoBehaviour)this).StartCoroutine(TryPlayAudioClipsInQueue()); } public void CancelVoiceAudioCoroutine() { if (audioTimedCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(audioTimedCoroutine); audioTimedCoroutine = null; } } private IEnumerator TryPlayAudioClipsInQueue() { audioIsPlaying = true; while (alertClipQueue.Count > 0) { var (clipId, isThankYouClip, isImportantWarning, isIgnitionChime, clipType) = alertClipQueue.Dequeue(); if (NetworkManager.Singleton.IsServer) { PlayAudioClipRpc(clipId, isThankYouClip, isImportantWarning, isIgnitionChime, clipType, overridePlayback: false); } if (isThankYouClip || isImportantWarning || isIgnitionChime) { CancelVoiceAudioCoroutine(); alertClipQueue.Clear(); } PlayAudioClip(clipId, isThankYouClip, isImportantWarning, isIgnitionChime, clipType); yield return (object)new WaitUntil((Func)(() => audioTimedCoroutine == null)); } audioIsPlaying = false; playAudioCoroutine = null; } private VoiceAlertPriority GetPriority(int clipId, bool isThankYou, bool isImportant, bool isIgnition) { if (isImportant) { return VoiceAlertPriority.IsImportant; } if (isIgnition) { return VoiceAlertPriority.IsIgnition; } if (isThankYou) { return VoiceAlertPriority.Override; } return alerts.FirstOrDefault((VoiceAlertDefinition i) => i.alertType == (ElectronicVoiceAlert)clipId)?.priority ?? VoiceAlertPriority.Low; } public void PlayAudioClip(int clipId, bool playThankAudio, bool isImportantWarning, bool isIgnitionChime, int clipType) { if (NetworkManager.Singleton.IsServer) { currentPriority = GetPriority(clipId, playThankAudio, isImportantWarning, isIgnitionChime); } currentClipId = clipId; voiceAudio.loop = false; voiceAudio.volume = baseVolume * UserConfig.VoiceAlertVolume.Value; if (isIgnitionChime) { audioTimedCoroutine = ((MonoBehaviour)this).StartCoroutine(PlayIgnitionChime()); } else if (isImportantWarning) { audioTimedCoroutine = ((MonoBehaviour)this).StartCoroutine(PlayImportantAlert(clipId, clipType)); } else if (playThankAudio) { audioTimedCoroutine = ((MonoBehaviour)this).StartCoroutine(PlayThankYouAudio(clipId)); } else { audioTimedCoroutine = ((MonoBehaviour)this).StartCoroutine(PlayVoiceAlert(clipId)); } } private IEnumerator PlayIgnitionChime() { currentClipId = -1; isPlayingIgnitionChime = true; yield return (object)new WaitForSeconds(0.25f); ((TMP_Text)clusterScreen).fontSize = 2.1f; ((TMP_Text)clusterScreen).text = (controller.isSpecial ? "sys status: [booting]" : "service due"); ((Behaviour)clusterLight).enabled = true; voiceAudio.Stop(); voiceAudio.clip = sixBeepAlert; voiceAudio.Play(); yield return (object)new WaitForSeconds(voiceAudio.clip.length + 0.45f); audioTimedCoroutine = null; ((TMP_Text)clusterScreen).text = null; ((Behaviour)clusterLight).enabled = false; currentClipId = -1; isPlayingIgnitionChime = false; voiceAudio.clip = null; if (NetworkManager.Singleton.IsServer) { currentPriority = VoiceAlertPriority.None; } ignitionChimeFinished = true; } private IEnumerator PlayImportantAlert(int clipId, int clipType) { if (NetworkManager.Singleton.IsServer) { if (clipId != -1) { RemoveClipFromQueue(clipId); } else if (clipId == -1 && clipType == -1) { RemoveClipFromQueue(5); RemoveClipFromQueue(4); } } yield return (object)new WaitForSeconds(0.3f); voiceAudio.loop = false; if (clipId == -1 && clipType == -1) { while (isImportantAlert || isKeysForgotten) { yield return SetScreenTextAfterDelay(4, 0.08f); voiceAudio.Stop(); voiceAudio.PlayOneShot(singleAlert); yield return (object)new WaitForSeconds(singleAlert.length); voiceAudio.clip = voiceAudioClips[4]; voiceAudio.Play(); yield return (object)new WaitForSeconds(voiceAudio.clip.length + 0.25f); voiceAudio.Stop(); voiceAudio.clip = highToneAlertAlt; voiceAudio.Play(); yield return (object)new WaitForSeconds(voiceAudio.clip.length + 0.25f); yield return SetScreenTextAfterDelay(5, 0.08f); voiceAudio.Stop(); voiceAudio.PlayOneShot(singleAlert); yield return (object)new WaitForSeconds(singleAlert.length); voiceAudio.clip = voiceAudioClips[5]; voiceAudio.Play(); yield return (object)new WaitForSeconds(voiceAudio.clip.length + 0.25f); voiceAudio.Stop(); voiceAudio.clip = highToneAlert; voiceAudio.Play(); yield return (object)new WaitForSeconds(voiceAudio.clip.length + 0.25f); } } else { while (isImportantAlert || isKeysForgotten) { yield return SetScreenTextAfterDelay(clipId, 0.08f); voiceAudio.Stop(); voiceAudio.PlayOneShot(singleAlert); yield return (object)new WaitForSeconds(singleAlert.length); voiceAudio.clip = voiceAudioClips[clipId]; voiceAudio.Play(); yield return (object)new WaitForSeconds(voiceAudio.clip.length + 0.25f); voiceAudio.Stop(); voiceAudio.clip = ((clipType == 1) ? highToneAlert : highToneAlertAlt); voiceAudio.Play(); yield return (object)new WaitForSeconds(voiceAudio.clip.length + 0.25f); } } } private IEnumerator PlayThankYouAudio(int clipId) { voiceAudio.Stop(); ((TMP_Text)clusterScreen).text = null; ((Behaviour)clusterLight).enabled = false; voiceAudio.clip = voiceAudioClips[2]; yield return (object)new WaitForSeconds(0.15f); ((TMP_Text)clusterScreen).text = clusterTexts[clipId]; ((Behaviour)clusterLight).enabled = true; voiceAudio.Play(); yield return (object)new WaitForSeconds(voiceAudio.clip.length + 0.45f); audioTimedCoroutine = null; ((TMP_Text)clusterScreen).text = null; ((Behaviour)clusterLight).enabled = false; currentClipId = -1; currentPriority = VoiceAlertPriority.None; voiceAudio.clip = null; } private IEnumerator PlayVoiceAlert(int clipId) { if (NetworkManager.Singleton.IsHost) { RemoveClipFromQueue(clipId); } if (clipId == 0) { isPlayingOnEngineStart = true; hasAlertedOnEngineStart = true; } yield return SetScreenTextAfterDelay(clipId, 0.08f); voiceAudio.Stop(); voiceAudio.PlayOneShot(singleAlert); yield return (object)new WaitForSeconds(singleAlert.length); voiceAudio.clip = voiceAudioClips[clipId]; voiceAudio.Play(); yield return (object)new WaitForSeconds(voiceAudio.clip.length + 0.45f); audioTimedCoroutine = null; ((TMP_Text)clusterScreen).text = null; ((Behaviour)clusterLight).enabled = false; currentClipId = -1; if (clipId == 0) { isPlayingOnEngineStart = false; } if (NetworkManager.Singleton.IsServer) { currentPriority = VoiceAlertPriority.None; } voiceAudio.clip = null; } private IEnumerator SetScreenTextAfterDelay(int clipId, float delay) { ((TMP_Text)clusterScreen).text = null; ((Behaviour)clusterLight).enabled = false; yield return (object)new WaitForSeconds(delay); ((TMP_Text)clusterScreen).text = clusterTexts[clipId]; ((Behaviour)clusterLight).enabled = true; } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(3748556394u, new RpcReceiveHandler(__rpc_handler_3748556394), "StopAudioClipRpc"); ((NetworkBehaviour)this).__registerRpc(3872872763u, new RpcReceiveHandler(__rpc_handler_3872872763), "SetThankYouClipRpc"); ((NetworkBehaviour)this).__registerRpc(2753757642u, new RpcReceiveHandler(__rpc_handler_2753757642), "SetImportantAlertRpc"); ((NetworkBehaviour)this).__registerRpc(1132289964u, new RpcReceiveHandler(__rpc_handler_1132289964), "SetIgnitionChimeRpc"); ((NetworkBehaviour)this).__registerRpc(1220500623u, new RpcReceiveHandler(__rpc_handler_1220500623), "PlayAudioClipRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_3748556394(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((EVAModule)(object)target).StopAudioClipRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3872872763(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool isLamps = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref isLamps, default(ForPrimitives)); bool isKeys = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref isKeys, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((EVAModule)(object)target).SetThankYouClipRpc(isLamps, isKeys); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2753757642(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int clipToPlay = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref clipToPlay); int clipType = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref clipType); bool isKeys = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref isKeys, default(ForPrimitives)); bool isLamps = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref isLamps, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((EVAModule)(object)target).SetImportantAlertRpc(clipToPlay, clipType, isKeys, isLamps); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1132289964(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((EVAModule)(object)target).SetIgnitionChimeRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1220500623(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int clipToPlay = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref clipToPlay); bool isThankYouClip = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref isThankYouClip, default(ForPrimitives)); bool isImportantWarning = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref isImportantWarning, default(ForPrimitives)); bool isIgnitionChime = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref isIgnitionChime, default(ForPrimitives)); int importantType = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref importantType); bool overridePlayback = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref overridePlayback, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((EVAModule)(object)target).PlayAudioClipRpc(clipToPlay, isThankYouClip, isImportantWarning, isIgnitionChime, importantType, overridePlayback); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "EVAModule"; } } public class RadioBehaviour : NetworkBehaviour { [CompilerGenerated] private sealed class d__33 : IAsyncStateMachine { public int <>1__state; public AsyncUniTaskMethodBuilder <>t__builder; public string uri; public RadioBehaviour <>4__this; private Awaiter <>u__1; private void MoveNext() { //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) int num = <>1__state; try { Awaiter awaiter; if (num != 0) { SwitchToThreadPoolAwaitable val = UniTask.SwitchToThreadPool(); awaiter = ((SwitchToThreadPoolAwaitable)(ref val)).GetAwaiter(); if (!((Awaiter)(ref awaiter)).IsCompleted) { num = (<>1__state = 0); <>u__1 = awaiter; d__33 d__ = this; ((AsyncUniTaskMethodBuilder)(ref <>t__builder)).AwaitUnsafeOnCompletedd__33>(ref awaiter, ref d__); return; } } else { awaiter = <>u__1; <>u__1 = default(Awaiter); num = (<>1__state = -1); } ((Awaiter)(ref awaiter)).GetResult(); <>4__this._stream?.PlayStream(uri, <>4__this._audioSource); } catch (Exception exception) { <>1__state = -2; ((AsyncUniTaskMethodBuilder)(ref <>t__builder)).SetException(exception); return; } <>1__state = -2; ((AsyncUniTaskMethodBuilder)(ref <>t__builder)).SetResult(); } void IAsyncStateMachine.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext this.MoveNext(); } [DebuggerHidden] private void SetStateMachine(IAsyncStateMachine stateMachine) { } void IAsyncStateMachine.SetStateMachine(IAsyncStateMachine stateMachine) { //ILSpy generated this explicit interface implementation from .override directive in SetStateMachine this.SetStateMachine(stateMachine); } } public CruiserXLController _controller = null; public AudioSource _audioSource = null; public AudioSource _staticAudioSource = null; public AudioClip _static = null; public MP3Stream? _stream; public Guid? _lastStationId; public bool _hasClientRequestedChange; public bool _stationChangeRequested; public float _radioCheckInterval; public float _timeSinceChangingVol; public bool _playingStatic = false; public string _currentFrequency = null; public float _volume; public void Awake() { _staticAudioSource.clip = _static; _currentFrequency = "FM"; SetVolumeOnLocalClient(0.4f); } public void TogglePowerLocalClient(bool checkOn) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) if (RadioManager._stations.Count == 0) { HUDManager.Instance.DisplayTip("No stations found", "Attempting to fetch stations!", false, false, "LC_Tip1"); UniTaskExtensions.Forget(RadioManager.GetRadioStations()); return; } if (((VehicleController)_controller).radioOn && checkOn) { TurnOffRadioRpc(); return; } TurnOnRadioServerRpc(); if (_currentFrequency == "FM") { string randomFrequency = GetRandomFrequency(); ChangeAndSyncFrequencyRpc(randomFrequency); } } public void SetVolumeOnLocalClient(float setVolume) { _timeSinceChangingVol = Time.realtimeSinceStartup; setVolume = Mathf.Clamp01(setVolume); setVolume = Mathf.Round(setVolume / 0.1f) * 0.1f; _volume = setVolume; _audioSource.volume = setVolume; _staticAudioSource.volume = ((setVolume != 0f) ? Mathf.Clamp01(setVolume + 0.1f) : 0f); } public void RaiseVolume() { float radioVolumeOnClientsRpc = _volume + 0.1f; SetRadioVolumeOnClientsRpc(radioVolumeOnClientsRpc); } public void LowerVolume() { float radioVolumeOnClientsRpc = _volume - 0.1f; SetRadioVolumeOnClientsRpc(radioVolumeOnClientsRpc); } [Rpc(/*Could not decode attribute arguments.*/)] public void SetRadioVolumeOnClientsRpc(float setVolume) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(157521969u, val2, val, (SendTo)6, (RpcDelivery)0); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref setVolume, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val3, 157521969u, val2, val, (SendTo)6, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1) { base.__rpc_exec_stage = (__RpcExecStage)0; SetVolumeOnLocalClient(setVolume); } } } private Guid GetRandomRadioGuid() { StationInfo randomRadioStation = RadioManager.GetRandomRadioStation(); if (randomRadioStation == null) { return Guid.Empty; } return randomRadioStation.StationUuid; } public void ToggleStationLocalClient() { if (((VehicleController)_controller).radioOn) { ChangeStationServerRpc(); string randomFrequency = GetRandomFrequency(); ChangeAndSyncFrequencyRpc(randomFrequency); } } [Rpc(/*Could not decode attribute arguments.*/)] public void ChangeAndSyncFrequencyRpc(string frequency) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(3462253689u, val2, val, (SendTo)6, (RpcDelivery)0); bool flag = frequency != null; ((FastBufferWriter)(ref val3)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val3)).WriteValueSafe(frequency, false); } ((NetworkBehaviour)this).__endSendRpc(ref val3, 3462253689u, val2, val, (SendTo)6, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1) { base.__rpc_exec_stage = (__RpcExecStage)0; _currentFrequency = frequency; } } [Rpc(/*Could not decode attribute arguments.*/)] public void TurnOnRadioServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(1935879631u, val2, val, (SendTo)2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendRpc(ref val3, 1935879631u, val2, val, (SendTo)2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1) { base.__rpc_exec_stage = (__RpcExecStage)0; if (!((VehicleController)_controller).radioAudio.loop) { ((VehicleController)_controller).radioAudio.loop = true; } if (!_lastStationId.HasValue) { _lastStationId = GetRandomRadioGuid(); TurnOnAndSyncRadioRpc(_lastStationId.Value.ToString()); } TurnOnRadioRpc(); } } [Rpc(/*Could not decode attribute arguments.*/)] public void TurnOnAndSyncRadioRpc(string guidString) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(2808924688u, val2, val, (SendTo)6, (RpcDelivery)0); bool flag = guidString != null; ((FastBufferWriter)(ref val3)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val3)).WriteValueSafe(guidString, false); } ((NetworkBehaviour)this).__endSendRpc(ref val3, 2808924688u, val2, val, (SendTo)6, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1) { base.__rpc_exec_stage = (__RpcExecStage)0; _stationChangeRequested = false; _hasClientRequestedChange = false; _radioCheckInterval = 0f; if (Guid.TryParse(guidString, out var result)) { _lastStationId = result; } TurnRadioOnOff(state: true); } } [Rpc(/*Could not decode attribute arguments.*/)] public void TurnOnRadioRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(4129468706u, val2, val, (SendTo)6, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendRpc(ref val3, 4129468706u, val2, val, (SendTo)6, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1) { base.__rpc_exec_stage = (__RpcExecStage)0; TurnRadioOnOff(state: true); } } } [Rpc(/*Could not decode attribute arguments.*/)] public void TurnOffRadioRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(3593769423u, val2, val, (SendTo)6, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendRpc(ref val3, 3593769423u, val2, val, (SendTo)6, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1) { base.__rpc_exec_stage = (__RpcExecStage)0; TurnRadioOnOff(state: false); } } } [Rpc(/*Could not decode attribute arguments.*/)] public void ChangeStationServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(319200940u, val2, val, (SendTo)2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendRpc(ref val3, 319200940u, val2, val, (SendTo)2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1) { base.__rpc_exec_stage = (__RpcExecStage)0; if (((VehicleController)_controller).radioOn && !_stationChangeRequested) { _stationChangeRequested = true; _lastStationId = GetRandomRadioGuid(); TurnOnAndSyncRadioRpc(_lastStationId.Value.ToString()); } } } [Rpc(/*Could not decode attribute arguments.*/)] public void SyncRadioServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(171207481u, val2, val, (SendTo)2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendRpc(ref val3, 171207481u, val2, val, (SendTo)2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1) { base.__rpc_exec_stage = (__RpcExecStage)0; SyncRadioRpc(_lastStationId.ToString(), ((VehicleController)_controller).radioOn); } } } [Rpc(/*Could not decode attribute arguments.*/)] public void SyncRadioRpc(string guidString, bool radioOn) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(1648361472u, val2, val, (SendTo)6, (RpcDelivery)0); bool flag = guidString != null; ((FastBufferWriter)(ref val3)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val3)).WriteValueSafe(guidString, false); } ((FastBufferWriter)(ref val3)).WriteValueSafe(ref radioOn, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val3, 1648361472u, val2, val, (SendTo)6, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 1) { return; } base.__rpc_exec_stage = (__RpcExecStage)0; if (Guid.TryParse(guidString, out var result)) { Guid guid = result; Guid? lastStationId = _lastStationId; if (lastStationId.HasValue && guid == lastStationId.GetValueOrDefault() && radioOn == ((VehicleController)_controller).radioOn) { return; } } _lastStationId = result; TurnRadioOnOff(radioOn); } public void TurnRadioOnOff(bool state) { if (!((VehicleController)_controller).radioAudio.loop) { ((VehicleController)_controller).radioAudio.loop = true; } StopStaticIfPlaying(); if (state && _lastStationId.HasValue) { if (_stream != null) { Stop(); } PlayStatic(); StationInfo radioStationByGuid = RadioManager.GetRadioStationByGuid(_lastStationId.Value); if (radioStationByGuid != null) { PlayAudioFromStream(radioStationByGuid.UrlResolved.ToString()); } } else if (!state && _stream != null) { Stop(); _hasClientRequestedChange = false; _stationChangeRequested = false; _radioCheckInterval = 0f; } ((VehicleController)_controller).radioOn = state; } public string GetRandomFrequency() { string text = Random.Range(_controller.minFrequency, _controller.maxFrequency).ToString("0.##"); _currentFrequency = "FM " + text; return _currentFrequency; } private void PlayStatic() { _playingStatic = true; _staticAudioSource.Play(); } public void PlayAudioFromStream(string uri) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) if (_stream == null) { _stream = new MP3Stream(); } UniTaskExtensions.Forget(StartMP3Stream(uri)); } [AsyncStateMachine(typeof(d__33))] [DebuggerStepThrough] private UniTask StartMP3Stream(string uri) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) d__33 d__ = new d__33(); d__.<>t__builder = AsyncUniTaskMethodBuilder.Create(); d__.<>4__this = this; d__.uri = uri; d__.<>1__state = -1; ((AsyncUniTaskMethodBuilder)(ref d__.<>t__builder)).Start<d__33>(ref d__); return ((AsyncUniTaskMethodBuilder)(ref d__.<>t__builder)).Task; } public void FixedUpdate() { _stream?.UpdateLoop(); } public void Update() { //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Expected O, but got Unknown if (RadioManager._stations.Count == 0) { return; } if (_stream != null && string.IsNullOrEmpty(_stream.buffer_info) && !_stream.decomp) { _radioCheckInterval += Time.deltaTime; if (_radioCheckInterval > 6f && ((VehicleController)_controller).radioOn && !_hasClientRequestedChange) { _radioCheckInterval = 0f; _hasClientRequestedChange = true; ChangeStationServerRpc(); } } if (_stream != null && _stream.decomp) { StopStaticIfPlaying(); _radioCheckInterval = 0f; _hasClientRequestedChange = false; _stationChangeRequested = false; _audioSource.clip = AudioClip.Create("mp3_Stream", int.MaxValue, _stream.bufferedWaveProvider.WaveFormat.Channels, _stream.bufferedWaveProvider.WaveFormat.SampleRate, true, new PCMReaderCallback(_stream.ReadData)); _stream.decomp = false; } } private void StopStaticIfPlaying() { if (_playingStatic) { _staticAudioSource.Stop(); _playingStatic = false; } } public void Stop() { _stream?.StopPlayback(); _stream = null; if ((Object)(object)_audioSource != (Object)null) { _audioSource.Stop(); _audioSource.time = 0f; _audioSource.clip = null; } } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Expected O, but got Unknown //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Expected O, but got Unknown //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Expected O, but got Unknown //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Expected O, but got Unknown //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(157521969u, new RpcReceiveHandler(__rpc_handler_157521969), "SetRadioVolumeOnClientsRpc"); ((NetworkBehaviour)this).__registerRpc(3462253689u, new RpcReceiveHandler(__rpc_handler_3462253689), "ChangeAndSyncFrequencyRpc"); ((NetworkBehaviour)this).__registerRpc(1935879631u, new RpcReceiveHandler(__rpc_handler_1935879631), "TurnOnRadioServerRpc"); ((NetworkBehaviour)this).__registerRpc(2808924688u, new RpcReceiveHandler(__rpc_handler_2808924688), "TurnOnAndSyncRadioRpc"); ((NetworkBehaviour)this).__registerRpc(4129468706u, new RpcReceiveHandler(__rpc_handler_4129468706), "TurnOnRadioRpc"); ((NetworkBehaviour)this).__registerRpc(3593769423u, new RpcReceiveHandler(__rpc_handler_3593769423), "TurnOffRadioRpc"); ((NetworkBehaviour)this).__registerRpc(319200940u, new RpcReceiveHandler(__rpc_handler_319200940), "ChangeStationServerRpc"); ((NetworkBehaviour)this).__registerRpc(171207481u, new RpcReceiveHandler(__rpc_handler_171207481), "SyncRadioServerRpc"); ((NetworkBehaviour)this).__registerRpc(1648361472u, new RpcReceiveHandler(__rpc_handler_1648361472), "SyncRadioRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_157521969(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { float radioVolumeOnClientsRpc = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref radioVolumeOnClientsRpc, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((RadioBehaviour)(object)target).SetRadioVolumeOnClientsRpc(radioVolumeOnClientsRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3462253689(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag, default(ForPrimitives)); string frequency = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref frequency, false); } target.__rpc_exec_stage = (__RpcExecStage)1; ((RadioBehaviour)(object)target).ChangeAndSyncFrequencyRpc(frequency); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1935879631(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((RadioBehaviour)(object)target).TurnOnRadioServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2808924688(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag, default(ForPrimitives)); string guidString = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref guidString, false); } target.__rpc_exec_stage = (__RpcExecStage)1; ((RadioBehaviour)(object)target).TurnOnAndSyncRadioRpc(guidString); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_4129468706(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((RadioBehaviour)(object)target).TurnOnRadioRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3593769423(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((RadioBehaviour)(object)target).TurnOffRadioRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_319200940(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((RadioBehaviour)(object)target).ChangeStationServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_171207481(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((RadioBehaviour)(object)target).SyncRadioServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1648361472(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag, default(ForPrimitives)); string guidString = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref guidString, false); } bool radioOn = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref radioOn, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((RadioBehaviour)(object)target).SyncRadioRpc(guidString, radioOn); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "RadioBehaviour"; } } public class TalkieRadio : InteractTrigger { [Space(5f)] [Header("Talkie Radio")] [Tooltip("")] [SerializeField] private UnityEvent onStartTalking = new UnityEvent(); [Tooltip("")] [SerializeField] private UnityEvent onStopTalking = new UnityEvent(); private bool isActive; public void Reset() { base.hoverTip = "Transmit voice : [LMB]"; base.interactable = true; base.oneHandedItemAllowed = false; base.twoHandedItemAllowed = false; base.holdInteraction = true; base.timeToHold = 1f; base.timeToHoldSpeedMultiplier = 0f; base.holdTip = "Transmitting voice..."; base.cooldownTime = 0.5f; } public void Awake() { ((UnityEvent)(object)base.holdingInteractEvent).AddListener((UnityAction)EnableWalkieLocal); ((UnityEvent)(object)base.onStopInteract).AddListener((UnityAction)DisableWalkieLocal); } public void EnableWalkieLocal(float _) { //IL_002b: Unknown result type (might be due to invalid IL or missing references) if (!isActive) { isActive = true; if (((NetworkBehaviour)this).IsSpawned) { EnableWalkieRpc(NetworkBehaviourReference.op_Implicit((NetworkBehaviour)(object)GameNetworkManager.Instance.localPlayerController)); } } } [Rpc(/*Could not decode attribute arguments.*/)] public void EnableWalkieRpc(NetworkBehaviourReference playerReference) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(3081189776u, val2, val, (SendTo)7, (RpcDelivery)0); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref playerReference, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendRpc(ref val3, 3081189776u, val2, val, (SendTo)7, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; PlayerControllerB val4 = default(PlayerControllerB); if (((NetworkBehaviourReference)(ref playerReference)).TryGet(ref val4, (NetworkManager)null)) { val4.holdingWalkieTalkie = true; val4.speakingToWalkieTalkie = true; if ((Object)(object)StartOfRound.Instance != (Object)null) { StartOfRound.Instance.UpdatePlayerVoiceEffects(); } onStartTalking.Invoke(val4); } } public void DisableWalkieLocal(PlayerControllerB _) { //IL_001e: Unknown result type (might be due to invalid IL or missing references) isActive = false; if (((NetworkBehaviour)this).IsSpawned) { DisableWalkieRpc(NetworkBehaviourReference.op_Implicit((NetworkBehaviour)(object)GameNetworkManager.Instance.localPlayerController)); } } [Rpc(/*Could not decode attribute arguments.*/)] public void DisableWalkieRpc(NetworkBehaviourReference playerReference) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(894764714u, val2, val, (SendTo)7, (RpcDelivery)0); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref playerReference, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendRpc(ref val3, 894764714u, val2, val, (SendTo)7, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; PlayerControllerB val4 = default(PlayerControllerB); if (((NetworkBehaviourReference)(ref playerReference)).TryGet(ref val4, (NetworkManager)null)) { onStopTalking.Invoke(val4); val4.holdingWalkieTalkie = false; val4.speakingToWalkieTalkie = false; if ((Object)(object)StartOfRound.Instance != (Object)null) { StartOfRound.Instance.UpdatePlayerVoiceEffects(); } } } protected override void __initializeVariables() { ((InteractTrigger)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(3081189776u, new RpcReceiveHandler(__rpc_handler_3081189776), "EnableWalkieRpc"); ((NetworkBehaviour)this).__registerRpc(894764714u, new RpcReceiveHandler(__rpc_handler_894764714), "DisableWalkieRpc"); ((InteractTrigger)this).__initializeRpcs(); } private static void __rpc_handler_3081189776(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { NetworkBehaviourReference playerReference = default(NetworkBehaviourReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref playerReference, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)1; ((TalkieRadio)(object)target).EnableWalkieRpc(playerReference); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_894764714(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { NetworkBehaviourReference playerReference = default(NetworkBehaviourReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref playerReference, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)1; ((TalkieRadio)(object)target).DisableWalkieRpc(playerReference); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "TalkieRadio"; } } public class TruckAnimationEvents : MonoBehaviour { } public class TruckMirrorRenderer : MonoBehaviour { public CruiserXLController mainTruckScript = null; public MeshRenderer leftMirrorMesh = null; public MeshRenderer centerMirrorMesh = null; public MeshRenderer rightMirrorMesh = null; public MeshRenderer[] mirrorMeshes = null; public Camera[] mirrorCameras = null; public bool playerInTruck; public float elapsed; public float cameraFramerate; public int camerasToRenderPerFrame = 1; public int nextCameraToRender = 0; public float cameraRenderCountRemainder = 0f; public void Awake() { mirrorCameras[0].farClipPlane = 30f; mirrorCameras[2].farClipPlane = 30f; cameraFramerate = 40f; } public void LateUpdate() { if ((Object)(object)mainTruckScript == (Object)null || !((NetworkBehaviour)mainTruckScript).IsSpawned || ((VehicleController)mainTruckScript).carDestroyed || (Object)(object)mirrorCameras[0] == (Object)null || (Object)(object)mirrorCameras[1] == (Object)null || (Object)(object)mirrorCameras[2] == (Object)null || (Object)(object)leftMirrorMesh == (Object)null || (Object)(object)centerMirrorMesh == (Object)null || (Object)(object)rightMirrorMesh == (Object)null) { return; } PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController; if ((Object)(object)localPlayerController == (Object)null) { return; } Camera[] array = mirrorCameras; foreach (Camera val in array) { if (!((Object)(object)val == (Object)null)) { ((Behaviour)val).enabled = false; } } if (!PlayerUtils.seatedInTruck) { ((Renderer)leftMirrorMesh).enabled = false; ((Renderer)centerMirrorMesh).enabled = false; ((Renderer)rightMirrorMesh).enabled = false; return; } elapsed += Time.deltaTime; if (elapsed < 1f / cameraFramerate) { return; } elapsed = 0f; ((Renderer)leftMirrorMesh).enabled = true; ((Renderer)centerMirrorMesh).enabled = true; ((Renderer)rightMirrorMesh).enabled = true; int num = 0; for (int j = 0; j < 3; j++) { if (((Renderer)(object)mirrorMeshes[j]).IsVisibleToPlayersLocalCamera(localPlayerController.gameplayCamera)) { num++; } } float num2 = (float)camerasToRenderPerFrame * (float)num / 3f; cameraRenderCountRemainder += num2; int num3 = (nextCameraToRender + mirrorCameras.Length - 1) % mirrorCameras.Length; while (cameraRenderCountRemainder >= 0f) { if (((Renderer)(object)mirrorMeshes[nextCameraToRender]).IsVisibleToPlayersLocalCamera(localPlayerController.gameplayCamera)) { ((Behaviour)mirrorCameras[nextCameraToRender]).enabled = true; cameraRenderCountRemainder -= 1f; } nextCameraToRender = (nextCameraToRender + 1) % mirrorCameras.Length; if (nextCameraToRender == num3) { break; } } } } public class TruckPlayerZone : MonoBehaviour { public CruiserXLController controller = null; public bool hasLocalPlayer; public int priority; public float checkInterval; public void OnTriggerStay(Collider other) { if ((Object)(object)controller == (Object)null || (Object)(object)GameNetworkManager.Instance.localPlayerController == (Object)null || (Object)(object)((Component)GameNetworkManager.Instance.localPlayerController).gameObject == (Object)null || (Object)(object)((Component)other).gameObject != (Object)(object)((Component)GameNetworkManager.Instance.localPlayerController).gameObject || PlayerUtils.seatedInTruck) { return; } switch (priority) { case 1: if (!PlayerUtils.isPlayerInCab && !PlayerUtils.isPlayerInStorage) { PlayerUtils.isPlayerOnTruck = true; ResetTimer(hasPlayer: true); } break; case 2: if (!PlayerUtils.isPlayerInStorage) { PlayerUtils.isPlayerOnTruck = true; PlayerUtils.isPlayerInCab = true; ResetTimer(hasPlayer: true); } break; case 3: if (!PlayerUtils.isPlayerInCab) { PlayerUtils.isPlayerOnTruck = true; PlayerUtils.isPlayerInStorage = true; ResetTimer(hasPlayer: true); } break; } } private void ResetTimer(bool hasPlayer) { checkInterval = 0f; hasLocalPlayer = hasPlayer; } private void Update() { if (PlayerUtils.seatedInTruck) { checkInterval = 0f; if (priority == 1 || priority == 2) { hasLocalPlayer = true; } else { hasLocalPlayer = false; } } else if ((PlayerUtils.isPlayerInStorage || PlayerUtils.isPlayerInCab) && priority == 1) { ResetTimer(hasPlayer: true); } else { if (!hasLocalPlayer) { return; } if (checkInterval <= 0.2f) { checkInterval += Time.deltaTime; return; } ResetTimer(hasPlayer: false); if (priority == 1) { PlayerUtils.isPlayerOnTruck = false; } else if (priority == 3) { PlayerUtils.isPlayerInStorage = false; } else { PlayerUtils.isPlayerInCab = false; } } } } public class TruckSoundManager : MonoBehaviour { public CruiserXLController controller = null; public OccludeAudio[] insideOcclusion = null; public OccludeAudio[] outsideOcclusion = null; public float checkInterval = -0.1f; public bool IsItRaining() { //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Invalid comparison between Unknown and I4 //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Invalid comparison between Unknown and I4 //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Invalid comparison between Unknown and I4 if (((Object)(object)GlobalReferences.wesleyHurricaneRainObj != (Object)null && GlobalReferences.wesleyHurricaneRainObj.activeSelf) || ((Object)(object)GlobalReferences.wesleyForsakenRainObj != (Object)null && GlobalReferences.wesleyForsakenRainObj.activeSelf)) { return true; } return (int)TimeOfDay.Instance.currentLevelWeather == 1 || (int)TimeOfDay.Instance.currentLevelWeather == 4 || (int)TimeOfDay.Instance.currentLevelWeather == 2; } public void Start() { for (int i = 0; i < insideOcclusion.Length; i++) { insideOcclusion[i].lowPassOverride = 3500f; } for (int j = 0; j < outsideOcclusion.Length; j++) { outsideOcclusion[j].lowPassOverride = 3500f; } } public void LateUpdate() { if ((Object)(object)controller == (Object)null) { return; } if (checkInterval > 0.5f) { checkInterval = 0f; return; } checkInterval += Time.deltaTime; PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController; if ((Object)(object)localPlayerController == (Object)null) { return; } PlayerControllerB val = localPlayerController; if (localPlayerController.isPlayerDead && (Object)(object)localPlayerController.spectatedPlayerScript != (Object)null) { val = localPlayerController.spectatedPlayerScript; } PlayerControllerBPatches.PlayerControllerBData data = PlayerControllerBPatches.GetData(val); bool flag = data?.isPlayerInCab ?? false; bool flag2 = data?.isPlayerInStorage ?? false; bool flag3 = flag || flag2; bool flag4 = IsItRaining() && flag3; bool flag5 = ((VehicleController)controller).driverSideDoor.boolValue || controller.driversSideWindowTrigger.boolValue || ((VehicleController)controller).passengerSideDoor.boolValue || controller.passengersSideWindowTrigger.boolValue || ((VehicleController)controller).windshieldBroken; bool flag6 = controller.sideDoorOpen || controller.liftGateOpen; ((VehicleController)controller).SetVehicleAudioProperties(controller.roofRainAudio, flag4, 0f, 1f, 3f, true, 1f); controller.roofRainAudio.spatialBlend = Mathf.MoveTowards(controller.roofRainAudio.spatialBlend, flag4 ? 0f : 1f, 4f * Time.deltaTime); OccludeAudio val3 = default(OccludeAudio); for (int i = 0; i < StartOfRound.Instance.allPlayerScripts.Length; i++) { PlayerControllerB val2 = StartOfRound.Instance.allPlayerScripts[i]; if ((Object)(object)val2 == (Object)null || val2.isPlayerDead || !val2.isPlayerControlled || val2.isUnderwater || val2.sinkingValue > 0.73f || (Object)(object)val2 == (Object)(object)localPlayerController) { continue; } PlayerControllerBPatches.PlayerControllerBData data2 = PlayerControllerBPatches.GetData(val2); if (data2 == null || (Object)(object)val2.currentVoiceChatIngameSettings?.voiceAudio == (Object)null || !((Component)val2.currentVoiceChatIngameSettings.voiceAudio).TryGetComponent(ref val3)) { continue; } bool isPlayerInCab = data2.isPlayerInCab; bool isPlayerInStorage = data2.isPlayerInStorage; bool flag7 = isPlayerInCab || isPlayerInStorage; if ((flag7 || flag3) && val2.speakingToWalkieTalkie && val.holdingWalkieTalkie) { data2.applyVoiceEffects = false; val2.voiceMuffledByEnemy = false; val3.overridingLowPass = true; val3.lowPassOverride = 4000f; continue; } if (!flag7 && !flag3) { if (data2.applyVoiceEffects) { data2.applyVoiceEffects = false; val2.voiceMuffledByEnemy = false; val3.overridingLowPass = false; } continue; } data2.applyVoiceEffects = true; bool flag8 = false; if (flag3) { if (flag7) { flag8 = false; } else if (flag) { flag8 = !flag5; } else if (flag2) { flag8 = !flag6; } } else if (flag7) { if (isPlayerInCab) { flag8 = !flag5; } else if (isPlayerInStorage) { flag8 = !flag6; } } else { flag8 = false; } if (flag3 && flag7 && ((flag && isPlayerInCab) || (flag2 && isPlayerInStorage))) { flag8 = false; } val2.voiceMuffledByEnemy = flag8; val3.overridingLowPass = flag8; if (flag8) { val3.lowPassOverride = 600f; } } for (int j = 0; j < insideOcclusion.Length; j++) { if (flag3) { insideOcclusion[j].overridingLowPass = false; } else { insideOcclusion[j].overridingLowPass = !flag5; } } for (int k = 0; k < outsideOcclusion.Length; k++) { if (flag3) { outsideOcclusion[k].overridingLowPass = !flag5; } else { outsideOcclusion[k].overridingLowPass = false; } } } } public class VehiclePlayerPusher : MonoBehaviour { public CruiserXLController thisController = null; public void OnTriggerStay(Collider other) { //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Unknown result type (might be due to invalid IL or missing references) //IL_0153: Unknown result type (might be due to invalid IL or missing references) //IL_0158: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Unknown result type (might be due to invalid IL or missing references) if (((Vector3)(ref ((VehicleController)thisController).averageVelocity)).magnitude > 8f) { return; } PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController; if ((Object)(object)localPlayerController == (Object)null || (Object)(object)((Component)other).gameObject != (Object)(object)((Component)localPlayerController).gameObject || localPlayerController.isFallingFromJump || localPlayerController.isFallingNoJump) { return; } Transform physicsTransform = ((VehicleController)thisController).physicsRegion.physicsTransform; if (!((Object)(object)localPlayerController.physicsParent == (Object)(object)physicsTransform) && !((Object)(object)localPlayerController.overridePhysicsParent == (Object)(object)physicsTransform) && !PlayerUtils.seatedInTruck && !PlayerUtils.isPlayerOnTruck) { Vector3 val = (((VehicleController)thisController).mainRigidbody.position - thisController.previousVehiclePosition) / Time.fixedDeltaTime; Vector3 val2 = ((Component)localPlayerController).transform.position - ((VehicleController)thisController).mainRigidbody.position; Vector3 normalized = ((Vector3)(ref val2)).normalized; float num = Vector3.Dot(((Vector3)(ref val)).normalized, normalized); if (!(num < 0.8f)) { localPlayerController.externalForceAutoFade += Vector3.ClampMagnitude(((Vector3)(ref val)).normalized, 5f); } } } } public class VehiclePlayerSeat : MonoBehaviour { public RuntimeAnimatorController cachedPlayerAnimatorController = null; public Animator thisPlayerAnimator = null; public void ReplacePlayerAnimator(PlayerControllerB playerController, bool isLocalPlayer, InteractTrigger seatTrigger) { if ((Object)(object)playerController == (Object)null || playerController.isPlayerDead || !playerController.isPlayerControlled) { if ((Object)(object)playerController != (Object)null) { playerController.playerBodyAnimator.runtimeAnimatorController = (isLocalPlayer ? StartOfRound.Instance.localClientAnimatorController : StartOfRound.Instance.otherClientsAnimatorController); } cachedPlayerAnimatorController = null; thisPlayerAnimator = null; return; } if (isLocalPlayer) { UncrouchPlayer(playerController); } PlayerUtils.ResetPlayerData(playerController); cachedPlayerAnimatorController = null; cachedPlayerAnimatorController = Object.Instantiate(playerController.playerBodyAnimator.runtimeAnimatorController); ((Object)cachedPlayerAnimatorController).name = "metarig"; thisPlayerAnimator = playerController.playerBodyAnimator; if (isLocalPlayer) { PlayerUtils.StoreParameters(playerController.playerBodyAnimator); } playerController.playerBodyAnimator.runtimeAnimatorController = References.truckPlayerAnimator; if (!isLocalPlayer) { playerController.playerBodyAnimator.ResetTrigger(PlayerUtils.stopAnimationID); playerController.playerBodyAnimator.ResetTrigger(seatTrigger.animationString); playerController.playerBodyAnimator.SetTrigger(seatTrigger.animationString); } } public void ReturnPlayerAnimator(PlayerControllerB playerController, bool isLocalPlayer, InteractTrigger seatTrigger) { if ((Object)(object)playerController == (Object)null || playerController.isPlayerDead || !playerController.isPlayerControlled) { if ((Object)(object)playerController != (Object)null) { playerController.playerBodyAnimator.runtimeAnimatorController = (isLocalPlayer ? StartOfRound.Instance.localClientAnimatorController : StartOfRound.Instance.otherClientsAnimatorController); } cachedPlayerAnimatorController = null; thisPlayerAnimator = null; return; } if ((Object)(object)cachedPlayerAnimatorController != (Object)null) { playerController.playerBodyAnimator.runtimeAnimatorController = cachedPlayerAnimatorController; if (isLocalPlayer) { PlayerUtils.RestoreParameters(playerController.playerBodyAnimator); } } else if (isLocalPlayer) { playerController.playerBodyAnimator.runtimeAnimatorController = StartOfRound.Instance.localClientAnimatorController; } else { playerController.playerBodyAnimator.runtimeAnimatorController = StartOfRound.Instance.otherClientsAnimatorController; } if (isLocalPlayer) { playerController.playerBodyAnimator.ResetTrigger(PlayerUtils.stopAnimationID); UncrouchPlayer(playerController); } PlayerUtils.ResetPlayerData(playerController); cachedPlayerAnimatorController = null; thisPlayerAnimator = null; } public static void UncrouchPlayer(PlayerControllerB player) { player.isCrouching = false; player.playerBodyAnimator.SetBool("crouching", false); } } } namespace System.Runtime.CompilerServices { [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] internal sealed class IgnoresAccessChecksToAttribute : Attribute { public IgnoresAccessChecksToAttribute(string assemblyName) { } } } namespace __GEN { internal class NetworkVariableSerializationHelper { [RuntimeInitializeOnLoadMethod] internal static void InitializeSerialization() { NetworkVariableSerializationTypes.InitializeSerializer_UnmanagedByMemcpy(); NetworkVariableSerializationTypes.InitializeEqualityChecker_UnmanagedIEquatable(); } } } namespace scandal.scanvan.NetcodePatcher { [AttributeUsage(AttributeTargets.Module)] internal class NetcodePatchedAssemblyAttribute : Attribute { } }