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 FirstPersonView; 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.Patches.Enemies; using ScanVan.Patches.InternalUtils; using ScanVan.Scripts; using ScanVan.Utils; using ScandalLib.Patches; using ScandalLib.Scripts; using ScandalsTweaks.Compatibility; using ScandalsTweaks.Patches; using ScandalsTweaks.Patches.Enemies; using ScandalsTweaks.Utils; using TMPro; using Unity.Netcode; using UnityEngine; 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("FirstPersonView")] [assembly: IgnoresAccessChecksTo("ImmersiveVisor")] [assembly: IgnoresAccessChecksTo("NoteBoxz.LethalMin")] [assembly: IgnoresAccessChecksTo("scandal.scandallib")] [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.8.10.0")] [assembly: AssemblyInformationalVersion("1.8.10+2de0f016b85d87204cb338c436b6aa02cc42a6e6")] [assembly: AssemblyProduct("ScanVan")] [assembly: AssemblyTitle("scandal.scanvan")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.8.10.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] [module: NetcodePatchedAssembly] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [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] [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] [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_044c: Unknown result type (might be due to invalid IL or missing references) //IL_045c: Unknown result type (might be due to invalid IL or missing references) //IL_0461: Unknown result type (might be due to invalid IL or missing references) //IL_0466: Unknown result type (might be due to invalid IL or missing references) //IL_0470: Unknown result type (might be due to invalid IL or missing references) //IL_0475: 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_0117: 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_0121: 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_0133: 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_013d: 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_0149: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: 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_01ed: 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_01fc: Unknown result type (might be due to invalid IL or missing references) //IL_0232: Unknown result type (might be due to invalid IL or missing references) //IL_023a: Unknown result type (might be due to invalid IL or missing references) //IL_0240: Unknown result type (might be due to invalid IL or missing references) //IL_0546: Unknown result type (might be due to invalid IL or missing references) //IL_0557: Unknown result type (might be due to invalid IL or missing references) //IL_0562: Unknown result type (might be due to invalid IL or missing references) //IL_0567: Unknown result type (might be due to invalid IL or missing references) //IL_034d: Unknown result type (might be due to invalid IL or missing references) //IL_0358: Unknown result type (might be due to invalid IL or missing references) //IL_0363: Unknown result type (might be due to invalid IL or missing references) //IL_0595: Unknown result type (might be due to invalid IL or missing references) //IL_059a: Unknown result type (might be due to invalid IL or missing references) //IL_05ab: Unknown result type (might be due to invalid IL or missing references) //IL_02aa: Unknown result type (might be due to invalid IL or missing references) //IL_05c9: Unknown result type (might be due to invalid IL or missing references) //IL_05ce: Unknown result type (might be due to invalid IL or missing references) //IL_05df: Unknown result type (might be due to invalid IL or missing references) //IL_0305: Unknown result type (might be due to invalid IL or missing references) //IL_030a: Unknown result type (might be due to invalid IL or missing references) //IL_0681: Unknown result type (might be due to invalid IL or missing references) //IL_0686: Unknown result type (might be due to invalid IL or missing references) //IL_0697: Unknown result type (might be due to invalid IL or missing references) //IL_069c: 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_06a0: Unknown result type (might be due to invalid IL or missing references) //IL_06a2: Unknown result type (might be due to invalid IL or missing references) //IL_06b5: Expected I4, but got Unknown //IL_06c6: Unknown result type (might be due to invalid IL or missing references) //IL_06cb: Unknown result type (might be due to invalid IL or missing references) //IL_06d3: Unknown result type (might be due to invalid IL or missing references) //IL_06fc: Unknown result type (might be due to invalid IL or missing references) //IL_0701: Unknown result type (might be due to invalid IL or missing references) //IL_0709: Unknown result type (might be due to invalid IL or missing references) //IL_0732: Unknown result type (might be due to invalid IL or missing references) //IL_0737: Unknown result type (might be due to invalid IL or missing references) //IL_073f: 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); if (!((Component)other).TryGetComponent(ref val) || Time.realtimeSinceStartup - timeSinceHittingPlayer < 0.25f) { 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 { EnemyAICollisionDetect val4 = default(EnemyAICollisionDetect); if (!((Component)other).gameObject.CompareTag("Enemy") || Time.realtimeSinceStartup - timeSinceHittingEnemy < 0.25f || !((Component)other).TryGetComponent(ref val4) || (Object)(object)val4.mainScript == (Object)null || val4.mainScript.isEnemyDead) { return; } if (val4.mainScript is SandWormAI) { timeSinceHittingEnemy = Time.realtimeSinceStartup; ((VehicleController)mainScript).mainRigidbody.AddExplosionForce(((VehicleController)mainScript).mainRigidbody.mass * 100f, ((Component)mainScript).transform.position + ((Component)mainScript).transform.forward + Vector3.up * 1.5f, 12f, 3f, (ForceMode)1); } else { if (val4.mainScript is BushWolfEnemy) { return; } EnemyAI obj = val4.mainScript; FlowerSnakeEnemy val5 = (FlowerSnakeEnemy)(object)((obj is FlowerSnakeEnemy) ? obj : null); if ((val5 != null && Object.op_Implicit((Object)(object)val5.clingingToPlayer)) || val4.mainScript is BushWolfEnemy) { return; } EnemyAI obj2 = val4.mainScript; MouthDogAI val6 = (MouthDogAI)(object)((obj2 is MouthDogAI) ? obj2 : null); if (((!((Object)(object)val6 != (Object)null) || !Object.op_Implicit((Object)(object)val6) || val6.suspicionLevel <= 8) && !((VehicleController)mainScript).ignitionStarted) || Vector3.Angle(((VehicleController)mainScript).averageVelocity, ((Component)val4.mainScript).transform.position - ((Component)this).transform.position) > 130f || ((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("Gimmicks/Variety")] public EVAModule voiceModule = null; 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 specialVariantChance; public bool isSpecialVariant; [Header("Physics")] public List wheels = null; public AnimationCurve steeringWheelCurve = null; public CruiserXLCollisionTrigger collisionTrigger = null; public Rigidbody playerPhysicsBody = null; public AnimationCurve engineCurve = null; public AnimationCurve enginePowerCurve = null; public Vector3 lastVelocity; private WheelHit[] wheelHits = (WheelHit[])(object)new WheelHit[4]; public Vector3 previousVehiclePosition; public Quaternion previousVehicleRotation; private float timeSinceLastCollision; public bool hasDeliveredVehicle; public bool frontWheelsGrounded; public bool backWheelsGrounded; public bool allWheelsAirborne; public bool allWheelsGrounded; private float timeSinceUntethered; public bool usingSwitchIgnition; public bool engineStalled = false; public bool handbrakeEngaged; public bool inReverse; public bool inNeutral; public bool clutchPedalPressed; public bool lastClutchPedalPressed; public float brakeInput; public float clutchInput; public float gasInput; public float throttleInput; public float clutchSpeed; public float minClutchReturnSpeed; public float clutchReturnSpeed; public float stallTimer; public float clutchFriction; public float clutchSlip; public float clutchEngagement; public float throttleReleaseSpeed; public float maxThrottleSpeed; public float throttleSpeed; public float inclineCompensation; public float minInclineCompensation = 1.78f; public float maxInclineCompensation = 4.1f; public float maxInclineCompensationAngle = 32f; public float forwardWheelSpeed; public float reverseWheelSpeed; public float frontWheelRPM; public float backWheelRPM; public float wheelRPM; private float maxAutoCenterSpeed = 8f; private float steeringAngle; private float steeringDecay = 1f; private float forwardsSlip; public float baseForwardStiffness = 1f; public float baseSidewaysStiffness = 0.75f; public float currentMotorTorque; public float currentBrakeTorque; public float maxBrakingPower; public float enginePower; public float engineReversePower; public float timeAtLastGearboxDamage; public int baseTransmissionHP = 20; public int syncedTransmissionHP; public int transmissionHP; public float[] gearRatios = null; public float diffRatio; public int currentGear; [Header("Networking/Player")] private bool receivedSyncData; public VanPhysicsRegion vanZone = null; public VanPlayerZone vanCabinZone = null; public VanPlayerZone vanStorageZone = null; public Collider itemSafetyBounds = null; public Collider vehicleBounds = null; public CapsuleCollider cabinPoint = null; public Collider storageCompartment = null; public PlayerControllerB lastDriver = null; public PlayerControllerB playerWhoShifted = null; public VanSeatAnimator frontLeftSeat = null; public VanSeatAnimator frontMiddleSeat = null; public VanSeatAnimator 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 syncedSteeringWheelRotation; public float syncedFrontWheelRPM; public float syncedBackWheelRPM; public float syncedWheelRPM; public float syncedEngineRPM; public float syncedCurrentMotorTorque; public float syncedCurrentBrakeTorque; public int syncedCarHP; public bool syncedDrivePedalPressed; public bool syncedBrakePedalPressed; public bool syncedClutchPedalPressed; public float syncedTyreStress; public bool syncedTyreSlipping; public float syncEffectsInterval; public float syncTorqueInterval; public float syncDrivetrainInterval; [Header("VFX")] 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 Animator leftDoorAnimator = null; public Animator rightDoorAnimator = null; public Coroutine dashboardSweepCoroutine = 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; public VanWindow frontLeftWindow = null; public VanWindow frontRightWindow = null; public InteractTrigger domeLightTrigger = null; public Animator headlampSwitchAnimator = null; public Animator hvacAnimator = null; private Coroutine blinkersCoroutine = null; public InteractTrigger windscreenWipersTrigger = null; public InteractTrigger startIgnitionTrigger = null; public GameObject reverseLightsContainer = null; public MeshRenderer reverseLightsMesh = null; public Transform tempPushTransform = null; public bool treatingPlayerInfection; public string[] upShiftString = null; public string[] downShiftString = null; public bool smoothRotation; public bool heaterOn; public int heaterTemperature; public int heaterSpeed; public float steeringWheelAnimValue; public float steeringSpeed; public bool inIgnitionAnimation; public bool isHeaterCold; public bool isHeaterWarm; private readonly float handbrakePullSpeed = 70f; private float handbrakeAnimValue; private float timeAtLastHandbrakePull; private Vector3 ignitionKeyScale = Vector3.one; 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 int currentSweepStage; public bool hasSweepedDashboard; public bool hazardsBlinking; public bool hazardsOn; public bool reverseLightsOn; private float speedometerFloat; private float tachometerFloat; public float headlampSwitchAnimFloat; public float hvacFanSpeedAnimFloat; public float hvacFanDirectionAnimFloat; public float hvacFanTemperatureAnimFloat; 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 twistingKey; public bool ignitionOn; public bool isCabinLightOn; public bool liftGateOpen; public bool sideDoorOpen; private readonly string STEERING_WHEEL_SPEED = "steeringWheelTurnSpeed"; private readonly string ANIMATION_SPEED = "animationSpeed"; private readonly string REMOVE_IN_IGNITION = "SA_RemoveInIgnition"; private readonly string IGNITION_ANIM = "SAIgnition_Anim"; private readonly string CAR_ANIM = "SA_CarAnim"; private readonly string JUMP_WHILE_IN_CAR = "SA_JumpInCar"; private readonly string CAR_HANDBRAKE_ON_ENGAGEMENT = "SA_CarHandbrakeOn"; private readonly string CAR_HANDBRAKE_OFF_ENGAGEMENT = "SA_CarHandbrakeOff"; private readonly string HANDBRAKE_ENGAGEMENT = "engagement"; private readonly string UPPER_BODY_RADIO_ON = "U_Radio_TurnOn_LHD"; private readonly string LEFT_ARM_RADIO_ON = "L_Radio_TurnOn_LHD"; private readonly string RIGHT_ARM_RADIO_ON = "R_Radio_TurnOn_LHD"; private readonly string UPPER_BODY_HANDBRAKE_ON = "U_EngageHandbrake"; private readonly string LEFT_ARM_HANDBRAKE_ON = "L_EngageHandbrake"; private readonly string RIGHT_ARM_HANDBRAKE_ON = "R_EngageHandbrake"; private readonly string UPPER_BODY_HANDBRAKE_OFF = "U_DisengageHandbrake"; private readonly string LEFT_ARM_HANDBRAKE_OFF = "L_DisengageHandbrake"; private readonly string RIGHT_ARM_HANDBRAKE_OFF = "R_DisengageHandbrake"; private readonly string HVAC_TEMPERATURE = "temperature"; private readonly string HVAC_FAN_SPEED = "fanSpeed"; private readonly string HVAC_DIRECTION = "direction"; private readonly string DOOR_ELECTRIC_MIRROR_STATE = "mirrorOpen"; private readonly string HEADLAMP_SWITCH_DIRECTION = "switch"; private readonly string DOMELIGHT_IGNITION_HOVERTIP = "Switch cabin light : [LMB]"; private readonly string DOMELIGHT_OFF_HOVERTIP = "Switch cabin light : [LMB] (Off)"; private readonly string DOMELIGHT_ON_HOVERTIP = "Switch cabin light : [LMB] (On)"; private readonly string DOOR_ENTER_HOVERTIP = "Use door : [LMB]"; private readonly string DOOR_EXIT_HOVERTIP = "Exit : [LMB]"; private readonly string WINDOW_DISABLED_HOLDTIP = "[ No ignition power ]"; private readonly string UNTWIST_KEY_HOVERTIP = "Untwist key : [LMB]"; private readonly string UNTWIST_KEY_HOLDTIP = "[ Untwisting key ]"; private readonly string TRYIGNITION_KEY_HOVERTIP = "Try ignition : [LMB] (Hold)"; private readonly string TRYIGNITION_KEY_HOLDTIP = "[ Trying ignition ]"; private readonly string REMOVE_KEY_HOVERTIP = "Remove key : [LMB]"; private readonly string REMOVE_KEY_HOLDTIP = "[ Removing key ]"; private readonly string PLAYER_MOVEMENT = "Move"; [Header("Audio")] public RadioBehaviour liveRadioController = null; 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 vanAlarmCoroutine = null; public AudioSource alarmAudio = null; public AudioSource heaterAudio = null; public bool roofRainAudioActive; public bool engineKnockingAudioActive; public float engineKnockSpeed; private float timeSinceTogglingRadio; public bool alarmDebounce; private float timeAtLastAlarmPing; private float timeAtLastEVAPing; private float lastSongTime; public float minFrequency = 75.55f; public float maxFrequency = 255.5f; public bool isFmRadio = false; private float syncedSongTime; 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 (((NetworkBehaviour)this).IsServer && !StartOfRound.Instance.inShipPhase) { Random random = new Random(StartOfRound.Instance.randomMapSeed); isSpecialVariant = random.NextDouble() < (double)specialVariantChance; if (random.Next(100) < 37) { voiceModule.randomServiceAlert = random.Next(18, 21); } if (random.Next(100) < 10) { voiceModule.useAltAudio = true; voiceModule.voiceAudioClips[4] = voiceModule.keysAlertAlt; voiceModule.voiceAudioClips[6] = voiceModule.doorAlertAlt; voiceModule.voiceAudioClips[7] = voiceModule.doorAlertAlt; voiceModule.voiceAudioClips[8] = voiceModule.doorAlertAlt; voiceModule.voiceAudioClips[9] = voiceModule.doorAlertAlt; voiceModule.clusterTexts[4] = "dont forget your keys"; voiceModule.clusterTexts[6] = "a door is ajar"; voiceModule.clusterTexts[7] = "a door is ajar"; voiceModule.clusterTexts[8] = "a door is ajar"; voiceModule.clusterTexts[9] = "a door is ajar"; } SetSpecialVariantRpc(isSpecialVariant); InitializeVanRpc(voiceModule.randomServiceAlert, voiceModule.useAltAudio); } } [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 val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(4283610501u, val3, val, (SendTo)6, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref special, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val2, 4283610501u, val3, val, (SendTo)6, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; isSpecialVariant = special; SetVariant(isSpecialVariant); } } } [Rpc(/*Could not decode attribute arguments.*/)] public void InitializeVanRpc(int serviceAlert, bool useAlt) { //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_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_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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(2934651884u, val3, val, (SendTo)3, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, serviceAlert); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref useAlt, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val2, 2934651884u, val3, val, (SendTo)3, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; voiceModule.randomServiceAlert = serviceAlert; voiceModule.useAltAudio = useAlt; if (useAlt) { voiceModule.voiceAudioClips[4] = voiceModule.keysAlertAlt; voiceModule.voiceAudioClips[6] = voiceModule.doorAlertAlt; voiceModule.voiceAudioClips[7] = voiceModule.doorAlertAlt; voiceModule.voiceAudioClips[8] = voiceModule.doorAlertAlt; voiceModule.voiceAudioClips[9] = voiceModule.doorAlertAlt; voiceModule.clusterTexts[4] = "dont forget your keys"; voiceModule.clusterTexts[6] = "a door is ajar"; voiceModule.clusterTexts[7] = "a door is ajar"; voiceModule.clusterTexts[8] = "a door is ajar"; voiceModule.clusterTexts[9] = "a door is ajar"; } } } public void SetVariant(bool isJenson) { //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: 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_0070: 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_009a: 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_00c4: 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_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) //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_016c: 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_01cf: 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_01f6: Unknown result type (might be due to invalid IL or missing references) //IL_01fb: Unknown result type (might be due to invalid IL or missing references) //IL_0222: 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) truckMat.mainTexture = (Texture)(object)(isJenson ? rareTruckTex : defaultTruckTex); if (isJenson) { 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)); vehicleDisplay.color = Color32.op_Implicit(new Color32((byte)250, (byte)254, (byte)222, byte.MaxValue)); vehicleDisplayLight.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"; } } public void OnEnable() { VehicleUtils.vanController = this; } public void Awake() { //IL_0063: 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_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_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_009a: 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_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: 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_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: 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; playerPhysicsBody.interpolation = (RigidbodyInterpolation)0; playerPhysicsBody.freezeRotation = true; base.backDoorOpen = true; ((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; InitializeVan(); } private void InitializeVan() { //IL_0100: 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_0144: 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_01d4: Unknown result type (might be due to invalid IL or missing references) //IL_01e1: Unknown result type (might be due to invalid IL or missing references) //IL_01ee: Unknown result type (might be due to invalid IL or missing references) //IL_01fb: Unknown result type (might be due to invalid IL or missing references) base.carTooltips = new string[4] { "Gas pedal : [W]", "Brake pedal : [S]", "Clutch pedal : [Shift]", "Switch action : [LMB]" }; transmissionHP = baseTransmissionHP; syncedTransmissionHP = baseTransmissionHP; if (!StartOfRound.Instance.inShipPhase) { base.carHP = base.baseCarHP; syncedCarHP = base.baseCarHP; } SetWheelFriction(); base.mainRigidbody.maxLinearVelocity = base.carMaxSpeed; base.mainRigidbody.maxAngularVelocity = 4f; 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 suspensionSpring = new JointSpring { spring = 18000f, damper = 3800f, targetPosition = 0.7f }; 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(SetRainCollision()); 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 SetRainCollision() { yield return (object)new WaitForSeconds(4f); ParticleSystem[] particleTriggers = (ParticleSystem[])(object)new ParticleSystem[13] { References.rainParticles, References.rainHitParticles, References.stormyRainParticles, References.stormyRainHitParticles, References.wesleyHurricaneRainParticles, References.wesleyHurricaneRainHitParticles, References.wesleyHurricaneSandParticles, References.wesleyForsakenRainParticles, References.wesleyForsakenRainHitParticles, References.kenjiAcidRainParticles, References.kenjiAcidRainHitParticles, References.kenjiAcidStormyRainParticles, References.kenjiAcidStormyRainHitParticles }; for (int i = 0; i < particleTriggers.Length; i++) { if ((Object)(object)particleTriggers[i] == (Object)null) { Plugin.LogDebug("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, isSpecialVariant, voiceModule.randomServiceAlert, voiceModule.useAltAudio); } [Rpc(/*Could not decode attribute arguments.*/)] public void SyncClientDataRpc(int carHealth, float wheelRot, bool setStarted, bool isJenson, int serviceAlert, bool useAltVoices) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_011c: 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_00c6: 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_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: 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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(1322991716u, val3, val, (SendTo)3, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, carHealth); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref wheelRot, default(ForPrimitives)); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref setStarted, default(ForPrimitives)); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref isJenson, default(ForPrimitives)); BytePacker.WriteValueBitPacked(val2, serviceAlert); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref useAltVoices, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val2, 1322991716u, val3, val, (SendTo)3, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (!receivedSyncData) { receivedSyncData = true; isSpecialVariant = isJenson; SetVariant(isSpecialVariant); base.carHP = carHealth; syncedCarHP = carHealth; syncedSteeringWheelRotation = wheelRot; base.steeringWheelAnimFloat = wheelRot; disableAnimations = !setStarted; inIgnitionAnimation = !setStarted; ignitionOn = setStarted; ignitionOn = setStarted; base.keyIsInIgnition = setStarted; voiceModule.randomServiceAlert = serviceAlert; voiceModule.useAltAudio = useAltVoices; SetIgnitionValues(trying: false, keyInHand: false, setStarted); SetIgnition(setStarted, setStarted); SetFrontCabinLightOn(setStarted); SetIgnitionTrigger(); if (setStarted) { dashboardSweepCoroutine = ((MonoBehaviour)this).StartCoroutine(DashboardSweepCoroutine()); leftDoorAnimator.SetBool(DOOR_ELECTRIC_MIRROR_STATE, setStarted); rightDoorAnimator.SetBool(DOOR_ELECTRIC_MIRROR_STATE, setStarted); } SetSymbolActive(vehicleDisplay, vehicleDisplayLight, setStarted); SetWindowTriggers(setStarted); ignitionCollider.enabled = setStarted; ignitionAnimator.SetInteger(IGNITION_ANIM, setStarted ? 1 : 0); } } public void SetBackDoorOpen(bool open) { liftGateOpen = open; } public void SetSideDoorOpen(bool open) { sideDoorOpen = open; } public void SetCabinLightSwitchLocalClient() { SetCabinLightSwitchOwnerRpc(); } [Rpc(/*Could not decode attribute arguments.*/)] private void SetCabinLightSwitchOwnerRpc() { //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 val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(1187453226u, val3, val, (SendTo)0, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendRpc(ref val2, 1187453226u, val3, val, (SendTo)0, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (!overrideCabinLightSwitch && !cabinLightSwitchEnabled) { overrideCabinLightSwitch = true; cabinLightSwitchEnabled = true; roofAudio.PlayOneShot(cabinLightSwitchToggle); base.frontCabinLightContainer.SetActive(true); ((Renderer)base.frontCabinLightMesh).material = base.headlightsOnMat; string dOMELIGHT_ON_HOVERTIP = DOMELIGHT_ON_HOVERTIP; domeLightTrigger.hoverTip = dOMELIGHT_ON_HOVERTIP; SetCabinLightSwitchRpc(switchState: true, cabLightOn: true, setOverride: true, dOMELIGHT_ON_HOVERTIP); } else if (overrideCabinLightSwitch) { overrideCabinLightSwitch = false; cabinLightSwitchEnabled = true; roofAudio.PlayOneShot(cabinLightSwitchToggle); bool flag = isCabinLightOn && base.keyIsInIgnition && ignitionOn && cabinLightSwitchEnabled; base.frontCabinLightContainer.SetActive(flag); ((Renderer)base.frontCabinLightMesh).material = (Material)(flag ? ((object)base.headlightsOnMat) : ((object)greyLightOffMat)); string dOMELIGHT_ON_HOVERTIP = DOMELIGHT_IGNITION_HOVERTIP; domeLightTrigger.hoverTip = dOMELIGHT_ON_HOVERTIP; SetCabinLightSwitchRpc(switchState: true, flag, setOverride: false, dOMELIGHT_ON_HOVERTIP); } else { overrideCabinLightSwitch = false; cabinLightSwitchEnabled = false; roofAudio.PlayOneShot(cabinLightSwitchToggle); base.frontCabinLightContainer.SetActive(false); ((Renderer)base.frontCabinLightMesh).material = greyLightOffMat; string dOMELIGHT_ON_HOVERTIP = DOMELIGHT_OFF_HOVERTIP; domeLightTrigger.hoverTip = dOMELIGHT_ON_HOVERTIP; SetCabinLightSwitchRpc(switchState: false, cabLightOn: false, setOverride: false, dOMELIGHT_ON_HOVERTIP); } } } [Rpc(/*Could not decode attribute arguments.*/)] private void SetCabinLightSwitchRpc(bool switchState, bool cabLightOn, bool setOverride, string setMessage) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_0133: 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_00de: 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_0142: 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_0114: 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 val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(396020993u, val3, val, (SendTo)5, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref switchState, default(ForPrimitives)); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref cabLightOn, default(ForPrimitives)); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref setOverride, default(ForPrimitives)); bool flag = setMessage != null; ((FastBufferWriter)(ref val2)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val2)).WriteValueSafe(setMessage, false); } ((NetworkBehaviour)this).__endSendRpc(ref val2, 396020993u, val3, 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)); domeLightTrigger.hoverTip = setMessage; } } public void SetFrontCabinLightOn(bool setOn) { isCabinLightOn = 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 val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(2820477147u, val3, val, (SendTo)5, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref setOn, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val2, 2820477147u, val3, 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) || (base.localPlayerInControl && Time.realtimeSinceStartup - timeAtLastHandbrakePull < 0.78f)) { return; } timeAtLastHandbrakePull = Time.realtimeSinceStartup; handbrakeEngaged = !handbrakeEngaged; if (base.ignitionStarted) { if (handbrakeEngaged) { PlayCombinedOccupantAnimation(base.currentDriver, UPPER_BODY_HANDBRAKE_ON, LEFT_ARM_HANDBRAKE_ON, RIGHT_ARM_HANDBRAKE_ON, 0.075f); } else { PlayCombinedOccupantAnimation(base.currentDriver, UPPER_BODY_HANDBRAKE_OFF, LEFT_ARM_HANDBRAKE_OFF, RIGHT_ARM_HANDBRAKE_OFF, 0.075f); } } 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 val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(1779906441u, val3, val, (SendTo)5, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref setHandbrake, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val2, 1779906441u, val3, val, (SendTo)5, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (handbrakeEngaged == setHandbrake) { return; } timeAtLastHandbrakePull = Time.realtimeSinceStartup; handbrakeEngaged = setHandbrake; if (base.ignitionStarted) { if (handbrakeEngaged) { PlayCombinedOccupantAnimation(base.currentDriver, UPPER_BODY_HANDBRAKE_ON, LEFT_ARM_HANDBRAKE_ON, RIGHT_ARM_HANDBRAKE_ON, 0.075f); } else { PlayCombinedOccupantAnimation(base.currentDriver, UPPER_BODY_HANDBRAKE_OFF, LEFT_ARM_HANDBRAKE_OFF, RIGHT_ARM_HANDBRAKE_OFF, 0.075f); } } if (handbrakeEngaged) { handbrakeAudio.PlayOneShot(handbrakeOn); } else { handbrakeAudio.PlayOneShot(handbrakeOff); } } public void SetWindowTriggers(bool isIgnitionOn) { driversSideWindow.holdInteraction = !isIgnitionOn; passengersSideWindow.holdInteraction = !isIgnitionOn; if (!isIgnitionOn) { driversSideWindow.holdTip = WINDOW_DISABLED_HOLDTIP; passengersSideWindow.holdTip = WINDOW_DISABLED_HOLDTIP; } else { driversSideWindow.holdTip = null; passengersSideWindow.holdTip = null; } } public void SetIgnitionTrigger() { if (base.localPlayerInControl || !((Object)(object)base.currentDriver != (Object)null)) { if (base.ignitionStarted) { startIgnitionTrigger.hoverTip = UNTWIST_KEY_HOVERTIP; startIgnitionTrigger.holdTip = UNTWIST_KEY_HOLDTIP; startIgnitionTrigger.timeToHold = 0.5f; startIgnitionTrigger.timeToHoldSpeedMultiplier = 1f; } else if (base.keyIsInIgnition) { bool flag = usingSwitchIgnition || (Object)(object)base.currentDriver == (Object)null; startIgnitionTrigger.hoverTip = (flag ? REMOVE_KEY_HOVERTIP : TRYIGNITION_KEY_HOVERTIP); startIgnitionTrigger.holdTip = (flag ? REMOVE_KEY_HOLDTIP : TRYIGNITION_KEY_HOLDTIP); startIgnitionTrigger.timeToHold = (flag ? 0.5f : 1f); startIgnitionTrigger.timeToHoldSpeedMultiplier = (flag ? 1f : 0f); } else { startIgnitionTrigger.hoverTip = TRYIGNITION_KEY_HOVERTIP; startIgnitionTrigger.holdTip = TRYIGNITION_KEY_HOLDTIP; startIgnitionTrigger.timeToHold = 1f; startIgnitionTrigger.timeToHoldSpeedMultiplier = 0f; } } } public void StartTryCarIgnition() { if (!usingSwitchIgnition && base.localPlayerInControl && !base.ignitionStarted && !inIgnitionAnimation && (!inIgnitionAnimation || !startIgnitionTrigger.isBeingHeldByPlayer)) { CancelIgnitionCoroutine(); disableAnimations = true; inIgnitionAnimation = true; TryIgnitionRpc(base.keyIsInIgnition, isCabinLightOn, engineStalled); SetIgnitionTrigger(); 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) { base.currentDriver.playerBodyAnimator.SetInteger(CAR_ANIM, engineStalled ? 9 : 12); int animIndex = base.currentDriver.playerBodyAnimator.GetInteger(CAR_ANIM); if (animIndex == 9) { animIndex = 12; } ignitionAnimator.SetInteger(IGNITION_ANIM, animIndex); SetIgnitionTrigger(); engineStalled = false; SetIgnitionValues(trying: true, keyInHand: true, keyInSlot: true); yield return (object)new WaitForSeconds(0.02f); carKeySounds.PlayOneShot(base.twistKey); SetIgnitionValues(trying: true, keyInHand: true, keyInSlot: true); yield return (object)new WaitForSeconds(0.1467f); } else { base.currentDriver.playerBodyAnimator.SetInteger(CAR_ANIM, 2); ignitionAnimator.SetInteger(IGNITION_ANIM, 2); SetIgnitionTrigger(); SetIgnitionValues(trying: false, keyInHand: true, keyInSlot: false); yield return (object)new WaitForSeconds(0.6f); carKeySounds.PlayOneShot(base.insertKey); SetIgnitionValues(trying: false, keyInHand: true, keyInSlot: true); SetIgnitionTrigger(); yield return (object)new WaitForSeconds(0.2f); carKeySounds.PlayOneShot(base.twistKey); SetIgnitionValues(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); SetIgnitionValues(trying: true, keyInHand: true, keyInSlot: true); ignitionOn = true; SetFrontCabinLightOn(ignitionOn); SetIgnitionTrigger(); SetWindowTriggers(ignitionOn); if (dashboardSweepCoroutine == null && !hasSweepedDashboard) { dashboardSweepCoroutine = ((MonoBehaviour)this).StartCoroutine(DashboardSweepCoroutine()); } leftDoorAnimator.SetBool(DOOR_ELECTRIC_MIRROR_STATE, ignitionOn); rightDoorAnimator.SetBool(DOOR_ELECTRIC_MIRROR_STATE, ignitionOn); SetSymbolActive(vehicleDisplay, vehicleDisplayLight, active: true); if (!clutchInterlock) { yield break; } PlayIgnitionAudio(); yield return (object)new WaitForSeconds(Random.Range(0.8f, 2f)); if ((float)Random.Range(0, 100) < base.chanceToStartIgnition && clutchInterlock) { CancelIgnitionAnimation(ignitionOn: true, setIgnitionAnim: true); disableAnimations = false; inIgnitionAnimation = false; ignitionOn = true; PlayerControllerB currentDriver = base.currentDriver; if (currentDriver != null) { currentDriver.playerBodyAnimator.SetInteger(CAR_ANIM, 1); } SetIgnitionValues(trying: false, keyInHand: false, keyInSlot: true); SetIgnition(setStarted: true, setCabinLight: true); SetFrontCabinLightOn(base.keyIsInIgnition); startIgnitionTrigger.StopInteraction(); SetIgnitionTrigger(); 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 cabLightActive, 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 val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(3540053645u, val3, val, (SendTo)1, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref setKeyInSlot, default(ForPrimitives)); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref cabLightActive, default(ForPrimitives)); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref hasStalled, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val2, 3540053645u, val3, val, (SendTo)1, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; CancelIgnitionCoroutine(); disableAnimations = true; inIgnitionAnimation = true; SetIgnitionValues(trying: false, keyInHand: false, setKeyInSlot); if (!isCabinLightOn && cabLightActive) { SetFrontCabinLightOn(cabLightActive); } 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 val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(2290489169u, val3, val, (SendTo)1, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref shiftInterlock, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val2, 2290489169u, val3, val, (SendTo)1, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; SetIgnitionValues(trying: true, keyInHand: true, keyInSlot: true); ignitionOn = true; SetFrontCabinLightOn(ignitionOn); SetWindowTriggers(ignitionOn); if (dashboardSweepCoroutine == null && !hasSweepedDashboard) { dashboardSweepCoroutine = ((MonoBehaviour)this).StartCoroutine(DashboardSweepCoroutine()); } leftDoorAnimator.SetBool(DOOR_ELECTRIC_MIRROR_STATE, ignitionOn); rightDoorAnimator.SetBool(DOOR_ELECTRIC_MIRROR_STATE, ignitionOn); SetSymbolActive(vehicleDisplay, vehicleDisplayLight, active: true); if (shiftInterlock) { PlayIgnitionAudio(); } } } public void PlayIgnitionAudio() { 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 && inIgnitionAnimation && (inIgnitionAnimation || !startIgnitionTrigger.isBeingHeldByPlayer)) { PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController; int integer = localPlayerController.playerBodyAnimator.GetInteger(CAR_ANIM); if (integer == 0 && base.keyIsInIgnition) { localPlayerController.playerBodyAnimator.SetInteger(CAR_ANIM, 13); } else if ((integer == 2 || integer == 9 || integer == 12) && base.keyIsInIgnition) { localPlayerController.playerBodyAnimator.SetInteger(CAR_ANIM, 3); } else { localPlayerController.playerBodyAnimator.SetInteger(CAR_ANIM, 0); } int integer2 = localPlayerController.playerBodyAnimator.GetInteger(CAR_ANIM); CancelIgnitionAnimation(ignitionOn: false, setIgnitionAnim: false); disableAnimations = true; inIgnitionAnimation = false; SetIgnitionTrigger(); int num = integer2; if (integer == 13) { num = 3; } ignitionAnimator.SetInteger(IGNITION_ANIM, num); CancelTryIgnitionRpc(base.keyIsInIgnition, isCabinLightOn, ignitionOn, integer2, num); } } [Rpc(/*Could not decode attribute arguments.*/)] public void CancelTryIgnitionRpc(bool setKeyInSlot, bool cabinLightOn, bool isIgnitionOn, int playerAnimIndex, int ignitionAnimIndex) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_010f: 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_00d4: 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_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_011e: 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 val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(191059047u, val3, val, (SendTo)1, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref setKeyInSlot, default(ForPrimitives)); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref cabinLightOn, default(ForPrimitives)); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref isIgnitionOn, default(ForPrimitives)); BytePacker.WriteValueBitPacked(val2, playerAnimIndex); BytePacker.WriteValueBitPacked(val2, ignitionAnimIndex); ((NetworkBehaviour)this).__endSendRpc(ref val2, 191059047u, val3, val, (SendTo)1, (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(CAR_ANIM, playerAnimIndex); } ignitionAnimator.SetInteger(IGNITION_ANIM, ignitionAnimIndex); if (setKeyInSlot && !base.keyIsInIgnition) { carKeySounds.PlayOneShot(base.insertKey); } SetIgnitionValues(trying: false, keyInHand: false, setKeyInSlot); if (!setKeyInSlot) { return; } if (cabinLightOn && !isCabinLightOn) { SetFrontCabinLightOn(cabinLightOn); } if (isIgnitionOn && !ignitionOn) { ignitionOn = true; SetWindowTriggers(ignitionOn); if (dashboardSweepCoroutine == null && !hasSweepedDashboard) { dashboardSweepCoroutine = ((MonoBehaviour)this).StartCoroutine(DashboardSweepCoroutine()); } leftDoorAnimator.SetBool(DOOR_ELECTRIC_MIRROR_STATE, ignitionOn); rightDoorAnimator.SetBool(DOOR_ELECTRIC_MIRROR_STATE, ignitionOn); } } [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 val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(4118721524u, val3, val, (SendTo)1, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref setTriggers, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val2, 4118721524u, val3, val, (SendTo)1, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; CancelIgnitionAnimation(ignitionOn: true, setIgnitionAnim: true); disableAnimations = false; inIgnitionAnimation = false; ignitionOn = true; PlayerControllerB currentDriver = base.currentDriver; if (currentDriver != null) { currentDriver.playerBodyAnimator.SetInteger(CAR_ANIM, 1); } SetIgnitionValues(trying: false, keyInHand: false, keyInSlot: true); SetIgnition(setStarted: true, setCabinLight: true); SetFrontCabinLightOn(base.keyIsInIgnition); if (setTriggers) { SetIgnitionTrigger(); } } } public void SetIgnition(bool setStarted, bool setCabinLight) { SetFrontCabinLightOn(setCabinLight); base.carEngine1AudioActive = setStarted; if (setStarted) { disableAnimations = false; inIgnitionAnimation = false; ignitionOn = true; if (setStarted != 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) { CancelIgnitionCoroutine(); base.keyIgnitionCoroutine = ((MonoBehaviour)this).StartCoroutine(UntwistKey()); SetIgnitionTrigger(); UntwistKeyInIgnitionRpc(); } } private IEnumerator UntwistKey() { disableAnimations = true; inIgnitionAnimation = false; PlayerControllerB currentDriver = base.currentDriver; if (currentDriver != null) { currentDriver.playerBodyAnimator.SetInteger(CAR_ANIM, 7); } ignitionAnimator.SetInteger(IGNITION_ANIM, 7); yield return (object)new WaitForSeconds(0.08f); if (dashboardSweepCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(dashboardSweepCoroutine); dashboardSweepCoroutine = null; StopDashboardSweepCoroutine(); } carKeySounds.PlayOneShot(base.twistKey); SetIgnitionValues(trying: false, keyInHand: false, keyInSlot: true); SetIgnition(setStarted: false, setCabinLight: true); engineAudio3.volume = 0.775f; engineAudio3.PlayOneShot(stallEngine); SetIgnitionTrigger(); 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) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(1677604189u, val3, val, (SendTo)5, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendRpc(ref val2, 1677604189u, val3, val, (SendTo)5, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; CancelIgnitionCoroutine(); 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) { CancelIgnitionCoroutine(); base.keyIgnitionCoroutine = ((MonoBehaviour)this).StartCoroutine(RemoveKey()); SetIgnitionTrigger(); usingSwitchIgnition = false; base.chanceToStartIgnition = 20f; RemoveKeyFromIgnitionRpc(); } } private IEnumerator RemoveKey() { disableAnimations = true; inIgnitionAnimation = false; PlayerControllerB currentDriver = base.currentDriver; if (currentDriver != null && currentDriver.playerBodyAnimator.GetInteger(CAR_ANIM) == 0) { PlayerControllerB currentDriver2 = base.currentDriver; if (currentDriver2 != null) { currentDriver2.playerBodyAnimator.SetTrigger(REMOVE_IN_IGNITION); } } else { PlayerControllerB currentDriver3 = base.currentDriver; if (currentDriver3 != null) { currentDriver3.playerBodyAnimator.SetInteger(CAR_ANIM, 8); } } ignitionAnimator.SetInteger(IGNITION_ANIM, 0); engineStalled = false; yield return (object)new WaitForSeconds(base.ignitionStarted ? 0.18f : 0.26f); if (dashboardSweepCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(dashboardSweepCoroutine); dashboardSweepCoroutine = null; StopDashboardSweepCoroutine(); } carKeySounds.PlayOneShot(base.removeKey); SetIgnitionValues(trying: false, keyInHand: true, keyInSlot: false); SetIgnition(setStarted: false, setCabinLight: false); ignitionOn = false; SetWindowTriggers(ignitionOn); leftDoorAnimator.SetBool(DOOR_ELECTRIC_MIRROR_STATE, ignitionOn); rightDoorAnimator.SetBool(DOOR_ELECTRIC_MIRROR_STATE, ignitionOn); SetSymbolActive(vehicleDisplay, vehicleDisplayLight, active: false); SetIgnitionTrigger(); yield return (object)new WaitForSeconds(0.73f); SetIgnitionValues(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) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(2078953510u, val3, val, (SendTo)5, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendRpc(ref val2, 2078953510u, val3, val, (SendTo)5, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; CancelIgnitionCoroutine(); base.keyIgnitionCoroutine = ((MonoBehaviour)this).StartCoroutine(RemoveKey()); } } } public IEnumerator DashboardSweepCoroutine() { 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 StopDashboardSweepCoroutine() { 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) { CancelIgnitionCoroutine(); base.keyIsInDriverHand = false; twistingKey = false; base.carEngine1AudioActive = ignitionOn; if (setIgnitionAnim) { ignitionAnimator.SetInteger(IGNITION_ANIM, ignitionOn ? 1 : 0); } } private void CancelIgnitionCoroutine() { if (base.keyIgnitionCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(base.keyIgnitionCoroutine); base.keyIgnitionCoroutine = null; } } public void SetIgnitionValues(bool trying, bool keyInHand, bool keyInSlot) { twistingKey = trying; base.keyIsInDriverHand = keyInHand; base.keyIsInIgnition = keyInSlot; } public void SetDoorInteractTrigger(InteractTrigger trigger, string tip, bool setHoldInteract = false) { trigger.hoverTip = tip; trigger.holdInteraction = setHoldInteract; } [Rpc(/*Could not decode attribute arguments.*/)] public void CancelSetPlayerInVehicleRpc(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 val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(39759947u, val3, val, (SendTo)6, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, playerId); ((NetworkBehaviour)this).__endSendRpc(ref val2, 39759947u, val3, val, (SendTo)6, (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)GameNetworkManager.Instance.localPlayerController != (Object)(object)val4)) { InteractTriggerPatches.CancelVehicleSeatInteraction(); } } } public void SetDriverInVehicle() { //IL_0014: 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) SetDriverInVehicleServerRpc((int)GameNetworkManager.Instance.localPlayerController.playerClientId); } [Rpc(/*Could not decode attribute arguments.*/)] public void SetDriverInVehicleServerRpc(int playerId, RpcParams rpcParams = default(RpcParams)) { //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_0122: 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) 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 }; FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(1669503344u, rpcParams, val, (SendTo)2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, playerId); ((NetworkBehaviour)this).__endSendRpc(ref val2, 1669503344u, rpcParams, val, (SendTo)2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; PlayerControllerB val3 = StartOfRound.Instance.allPlayerScripts[playerId]; if ((Object)(object)val3 == (Object)null || val3.isPlayerDead || !val3.isPlayerControlled || (Object)(object)base.currentDriver != (Object)null) { CancelSetPlayerInVehicleRpc(playerId); return; } base.currentDriver = StartOfRound.Instance.allPlayerScripts[playerId]; ((NetworkBehaviour)this).NetworkObject.ChangeOwnership(rpcParams.Receive.SenderClientId); SetDriverInVehicleOwnerRpc(); } } [Rpc(/*Could not decode attribute arguments.*/)] public void SetDriverInVehicleOwnerRpc() { //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 val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(829536932u, val3, val, (SendTo)0, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendRpc(ref val2, 829536932u, val3, val, (SendTo)0, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; ((VehicleSeatAnimator)frontLeftSeat).SetLocalPlayerIntoSeat(); ActivateControl(); SetDoorInteractTrigger(base.driverSideDoorTrigger, DOOR_EXIT_HOVERTIP, setHoldInteract: true); ignitionCollider.enabled = true; startIgnitionTrigger.isBeingHeldByPlayer = false; engineStalled = false; SetIgnitionTrigger(); GameNetworkManager.Instance.localPlayerController.playerBodyAnimator.SetFloat(ANIMATION_SPEED, 0.5f); if (base.ignitionStarted) { GameNetworkManager.Instance.localPlayerController.playerBodyAnimator.SetInteger(CAR_ANIM, 1); } else { GameNetworkManager.Instance.localPlayerController.playerBodyAnimator.SetInteger(CAR_ANIM, 0); } int integer = GameNetworkManager.Instance.localPlayerController.playerBodyAnimator.GetInteger(CAR_ANIM); if (base.driverSideDoor.boolValue) { base.driverSideDoor.TriggerAnimation(GameNetworkManager.Instance.localPlayerController); } HUDManager.Instance.ChangeControlTipMultiple(base.carTooltips, false, (Item)null); SetDriverInVehicleNotOwnerRpc((int)GameNetworkManager.Instance.localPlayerController.playerClientId, ignitionOn, base.keyIsInIgnition, base.ignitionStarted, integer); } } [Rpc(/*Could not decode attribute arguments.*/)] public void SetDriverInVehicleNotOwnerRpc(int playerId, bool isIgnitionOn, bool setKeyInSlot, bool setStarted, int playerAnimIndex) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_010f: 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_00ec: 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_011e: 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 val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(2597680848u, val3, val, (SendTo)1, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, playerId); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref isIgnitionOn, default(ForPrimitives)); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref setKeyInSlot, default(ForPrimitives)); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref setStarted, default(ForPrimitives)); BytePacker.WriteValueBitPacked(val2, playerAnimIndex); ((NetworkBehaviour)this).__endSendRpc(ref val2, 2597680848u, val3, val, (SendTo)1, (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) { Plugin.LogError("SetDriverInVehicleNotOwnerRpc failed to find player object reference from player client id!"); return; } base.currentDriver = val4; disableAnimations = !setStarted; inIgnitionAnimation = false; ((VehicleSeatAnimator)frontLeftSeat).SetPlayerAnimations(val4, false); startIgnitionTrigger.isBeingHeldByPlayer = false; ignitionCollider.enabled = false; CancelIgnitionCoroutine(); val4.playerBodyAnimator.SetFloat(ANIMATION_SPEED, 0.5f); ignitionOn = isIgnitionOn; SetFrontCabinLightOn(isIgnitionOn); engineStalled = false; base.keyIsInIgnition = setKeyInSlot; base.ignitionStarted = setStarted; val4.playerBodyAnimator.SetInteger(CAR_ANIM, playerAnimIndex); } } public void ExitDriverSideSeat() { //IL_00ae: 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) if (base.localPlayerInControl) { GameNetworkManager.Instance.localPlayerController.playerBodyAnimator.SetInteger(CAR_ANIM, 0); int num = CanExitVehicle(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 OnDriverExitVehicle() { //IL_0106: 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_0117: 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_0133: 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) if (((NetworkBehaviour)this).IsSpawned && !((Object)(object)((NetworkBehaviour)this).NetworkManager == (Object)null) && ((NetworkBehaviour)this).NetworkManager.IsListening && !((Object)(object)base.currentDriver != (Object)(object)GameNetworkManager.Instance.localPlayerController)) { base.localPlayerInControl = false; SetDoorInteractTrigger(base.driverSideDoorTrigger, DOOR_ENTER_HOVERTIP); disableAnimations = !base.ignitionStarted; inIgnitionAnimation = false; usingSwitchIgnition = false; ignitionCollider.enabled = true; startIgnitionTrigger.isBeingHeldByPlayer = false; GameNetworkManager.Instance.localPlayerController.playerBodyAnimator.SetInteger(CAR_ANIM, 0); DisableControl(); CancelIgnitionAnimation(base.ignitionStarted, setIgnitionAnim: true); SetIgnition(base.ignitionStarted, isCabinLightOn); base.chanceToStartIgnition = 20f; SetIgnitionTrigger(); engineStalled = false; base.syncedPosition = ((Component)this).transform.position; base.syncedRotation = ((Component)this).transform.rotation; OnDriverExitVehicleServerRpc((int)GameNetworkManager.Instance.localPlayerController.playerClientId, base.syncedPosition, base.syncedRotation, base.ignitionStarted, base.keyIsInIgnition, isCabinLightOn, ignitionOn); } } [Rpc(/*Could not decode attribute arguments.*/)] public void OnDriverExitVehicleServerRpc(int playerId, Vector3 carLocation, Quaternion carRotation, bool setIgnitionState, bool setKeyInSlot, bool cabinLightOn, bool isIgnitionOn) { //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_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_009b: 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_00b6: 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_00d1: 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_00ec: 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) //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) //IL_0140: 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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(4013101331u, val3, val, (SendTo)2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, playerId); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref carLocation); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref carRotation); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref setIgnitionState, default(ForPrimitives)); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref setKeyInSlot, default(ForPrimitives)); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref cabinLightOn, default(ForPrimitives)); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref isIgnitionOn, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val2, 4013101331u, val3, val, (SendTo)2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; OnDriverExitVehicleRpc(playerId, carLocation, carRotation, setIgnitionState, setKeyInSlot, cabinLightOn, isIgnitionOn); ((NetworkBehaviour)this).NetworkObject.ChangeOwnership(0uL); } } } [Rpc(/*Could not decode attribute arguments.*/)] public void OnDriverExitVehicleRpc(int playerId, Vector3 carLocation, Quaternion carRotation, bool setIgnitionState, bool setKeyInSlot, bool cabinLightOn, bool isIgnitionOn) { //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_019b: 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_01a2: 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) 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 val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(4270035134u, val3, val, (SendTo)1, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, playerId); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref carLocation); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref carRotation); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref setIgnitionState, default(ForPrimitives)); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref setKeyInSlot, default(ForPrimitives)); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref cabinLightOn, default(ForPrimitives)); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref isIgnitionOn, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val2, 4270035134u, val3, val, (SendTo)1, (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.LogError("OnDriverExitVehicleRpc failed to find player object reference from player client id."); return; } if ((Object)(object)GameNetworkManager.Instance.localPlayerController == (Object)(object)val4) { Plugin.LogDebug("OnDriverExitVehicleRpc player argument was the previous occupant."); return; } base.syncedPosition = carLocation; base.syncedRotation = carRotation; base.drivePedalPressed = false; base.brakePedalPressed = false; base.currentDriver = null; ((VehicleSeatAnimator)frontLeftSeat).ReturnPlayerAnimations(val4, false); ignitionOn = isIgnitionOn; 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; CancelIgnitionAnimation(base.ignitionStarted, setIgnitionAnim: true); SetIgnition(base.ignitionStarted, cabinLightOn); SetIgnitionTrigger(); engineStalled = false; } public void SetMiddlePassengerInVehicle() { SetMiddlePassengerInVehicleServerRpc((int)GameNetworkManager.Instance.localPlayerController.playerClientId); } [Rpc(/*Could not decode attribute arguments.*/)] public void SetMiddlePassengerInVehicleServerRpc(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_0113: 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 val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(1015725535u, val3, val, (SendTo)2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, playerId); ((NetworkBehaviour)this).__endSendRpc(ref val2, 1015725535u, val3, 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)currentMiddlePassenger != (Object)null) { CancelSetPlayerInVehicleRpc(playerId); return; } currentMiddlePassenger = val4; SetMiddlePassengerInVehicleRpc(NetworkBehaviourReference.op_Implicit((NetworkBehaviour)(object)val4)); } } [Rpc(/*Could not decode attribute arguments.*/)] public void SetMiddlePassengerInVehicleRpc(NetworkBehaviourReference playerNetObjRef) { //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 val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(3837509662u, val3, val, (SendTo)6, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref playerNetObjRef, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendRpc(ref val2, 3837509662u, val3, val, (SendTo)6, (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 playerNetObjRef)).TryGet(ref val4, (NetworkManager)null)) { Plugin.LogError("SetMiddlePassengerInVehicleRpc failed to find player object reference from network behaviour!"); return; } val4.playerBodyAnimator.SetInteger(CAR_ANIM, 0); if ((Object)(object)val4 == (Object)(object)GameNetworkManager.Instance.localPlayerController) { ((VehicleSeatAnimator)frontMiddleSeat).SetLocalPlayerIntoSeat(); localPlayerInMiddlePassengerSeat = true; SetDoorInteractTrigger(base.driverSideDoorTrigger, DOOR_EXIT_HOVERTIP, setHoldInteract: true); SetDoorInteractTrigger(base.passengerSideDoorTrigger, DOOR_EXIT_HOVERTIP, setHoldInteract: true); if (base.driverSideDoor.boolValue) { base.driverSideDoor.TriggerAnimation(GameNetworkManager.Instance.localPlayerController); } if (base.passengerSideDoor.boolValue) { base.passengerSideDoor.TriggerAnimation(GameNetworkManager.Instance.localPlayerController); } } else { ((VehicleSeatAnimator)frontMiddleSeat).SetPlayerAnimations(val4, false); } currentMiddlePassenger = val4; val4.playerBodyAnimator.SetFloat(ANIMATION_SPEED, 0.5f); } public void ExitMiddlePassengerSeat(bool isPassengerSide) { //IL_014f: Unknown result type (might be due to invalid IL or missing references) //IL_0128: 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_0092: Unknown result type (might be due to invalid IL or missing references) if (!localPlayerInMiddlePassengerSeat) { return; } GameNetworkManager.Instance.localPlayerController.playerBodyAnimator.SetInteger(CAR_ANIM, 0); int num = CanExitVehicle(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 OnMiddlePassengerExitVehicle() { //IL_00ab: 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) if (((NetworkBehaviour)this).IsSpawned && !((Object)(object)((NetworkBehaviour)this).NetworkManager == (Object)null) && ((NetworkBehaviour)this).NetworkManager.IsListening && !((Object)(object)currentMiddlePassenger != (Object)(object)GameNetworkManager.Instance.localPlayerController)) { localPlayerInMiddlePassengerSeat = false; SetDoorInteractTrigger(base.driverSideDoorTrigger, DOOR_ENTER_HOVERTIP); SetDoorInteractTrigger(base.passengerSideDoorTrigger, DOOR_ENTER_HOVERTIP); GameNetworkManager.Instance.localPlayerController.playerBodyAnimator.SetInteger(CAR_ANIM, 0); currentMiddlePassenger = null; OnMiddlePassengerExitVehicleRpc(NetworkBehaviourReference.op_Implicit((NetworkBehaviour)(object)GameNetworkManager.Instance.localPlayerController), ((Component)GameNetworkManager.Instance.localPlayerController).transform.position); } } [Rpc(/*Could not decode attribute arguments.*/)] public void OnMiddlePassengerExitVehicleRpc(NetworkBehaviourReference playerNetObjRef, 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_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_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_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_0122: 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 val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(1197815956u, val3, val, (SendTo)5, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref playerNetObjRef, default(ForNetworkSerializable)); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref exitPoint); ((NetworkBehaviour)this).__endSendRpc(ref val2, 1197815956u, val3, val, (SendTo)5, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; PlayerControllerB val4 = default(PlayerControllerB); if (!((NetworkBehaviourReference)(ref playerNetObjRef)).TryGet(ref val4, (NetworkManager)null)) { Plugin.LogError("OnMiddlePassengerExitVehicleRpc failed to find player object reference from network behaviour!"); return; } ((VehicleSeatAnimator)frontMiddleSeat).ReturnPlayerAnimations(val4, false); val4.playerBodyAnimator.SetInteger(CAR_ANIM, 0); val4.TeleportPlayer(exitPoint, false, 0f, false, true); currentMiddlePassenger = null; } } public void SetPassengerInVehicle() { SetPassengerInVehicleServerRpc((int)GameNetworkManager.Instance.localPlayerController.playerClientId); } [Rpc(/*Could not decode attribute arguments.*/)] public void SetPassengerInVehicleServerRpc(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_0113: 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 val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(3853468369u, val3, val, (SendTo)2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, playerId); ((NetworkBehaviour)this).__endSendRpc(ref val2, 3853468369u, val3, 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.currentPassenger != (Object)null) { CancelSetPlayerInVehicleRpc(playerId); return; } base.currentPassenger = val4; SetPassengerInVehicleRpc(NetworkBehaviourReference.op_Implicit((NetworkBehaviour)(object)val4)); } } [Rpc(/*Could not decode attribute arguments.*/)] protected void SetPassengerInVehicleRpc(NetworkBehaviourReference playerNetObjRef) { //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 val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(2038294352u, val3, val, (SendTo)6, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref playerNetObjRef, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendRpc(ref val2, 2038294352u, val3, val, (SendTo)6, (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 playerNetObjRef)).TryGet(ref val4, (NetworkManager)null)) { Plugin.LogError("SetPassengerInVehicleRpc failed to find player object reference from network behaviour!"); return; } val4.playerBodyAnimator.SetInteger(CAR_ANIM, 0); if ((Object)(object)val4 == (Object)(object)GameNetworkManager.Instance.localPlayerController) { ((VehicleSeatAnimator)frontRightSeat).SetLocalPlayerIntoSeat(); base.localPlayerInPassengerSeat = true; SetDoorInteractTrigger(base.passengerSideDoorTrigger, DOOR_EXIT_HOVERTIP, setHoldInteract: true); if (base.passengerSideDoor.boolValue) { base.passengerSideDoor.TriggerAnimation(GameNetworkManager.Instance.localPlayerController); } } else { ((VehicleSeatAnimator)frontRightSeat).SetPlayerAnimations(val4, false); } base.currentPassenger = val4; val4.playerBodyAnimator.SetFloat(ANIMATION_SPEED, 0.5f); } public void ExitPassengerSideSeat() { //IL_00b6: 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) if (base.localPlayerInPassengerSeat && !localPlayerInMiddlePassengerSeat) { GameNetworkManager.Instance.localPlayerController.playerBodyAnimator.SetInteger(CAR_ANIM, 0); int num = CanExitVehicle(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 OnPassengerExitVehicle() { //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: 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 && !((Object)(object)base.currentPassenger != (Object)(object)GameNetworkManager.Instance.localPlayerController)) { base.localPlayerInPassengerSeat = false; SetDoorInteractTrigger(base.passengerSideDoorTrigger, DOOR_ENTER_HOVERTIP); GameNetworkManager.Instance.localPlayerController.playerBodyAnimator.SetInteger(CAR_ANIM, 0); base.currentPassenger = null; OnPassengerExitVehicleRpc(NetworkBehaviourReference.op_Implicit((NetworkBehaviour)(object)GameNetworkManager.Instance.localPlayerController), ((Component)GameNetworkManager.Instance.localPlayerController).transform.position); } } [Rpc(/*Could not decode attribute arguments.*/)] public void OnPassengerExitVehicleRpc(NetworkBehaviourReference playerNetObjRef, 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_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_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_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_0122: 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 val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(1439394877u, val3, val, (SendTo)5, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref playerNetObjRef, default(ForNetworkSerializable)); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref exitPoint); ((NetworkBehaviour)this).__endSendRpc(ref val2, 1439394877u, val3, val, (SendTo)5, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; PlayerControllerB val4 = default(PlayerControllerB); if (!((NetworkBehaviourReference)(ref playerNetObjRef)).TryGet(ref val4, (NetworkManager)null)) { Plugin.LogError("OnPassengerExitVehicleRpc failed to find player object reference from network behaviour!"); return; } ((VehicleSeatAnimator)frontRightSeat).ReturnPlayerAnimations(val4, false); val4.playerBodyAnimator.SetInteger(CAR_ANIM, 0); val4.TeleportPlayer(exitPoint, false, 0f, false, true); base.currentPassenger = null; } } [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_0112: 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) 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 val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(203598337u, val3, val, (SendTo)2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, playerId); ((NetworkBehaviour)this).__endSendRpc(ref val2, 203598337u, val3, 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(0uL); OnDriverLeave(val4, base.ignitionStarted, base.keyIsInIgnition, isCabinLightOn, ignitionOn); OnDriverLeaveGameRpc(playerId, base.syncedPosition, base.syncedRotation, base.ignitionStarted, base.keyIsInIgnition, isCabinLightOn, ignitionOn); } } } public void OnDriverLeave(PlayerControllerB playerController, bool setIgnitionState, bool setKeyInSlot, bool cabinLightOn, bool preIgnition) { //IL_00d0: Unknown result type (might be due to invalid IL or missing references) base.drivePedalPressed = false; base.brakePedalPressed = false; base.currentDriver = null; ignitionOn = 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; ((VehicleSeatAnimator)frontLeftSeat).ReturnPlayerAnimations(playerController, false); playerController.playerBodyAnimator.SetInteger(CAR_ANIM, 0); playerController.TeleportPlayer(Vector3.zero, false, 0f, false, true); CancelIgnitionAnimation(base.ignitionStarted, setIgnitionAnim: true); SetIgnition(base.ignitionStarted, ignitionOn); engineStalled = false; } [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 val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(1187821516u, val3, val, (SendTo)3, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, playerId); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref carLocation); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref carRotation); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref setIgnitionState, default(ForPrimitives)); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref setKeyInSlot, default(ForPrimitives)); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref cabinLightOn, default(ForPrimitives)); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref preIgnition, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val2, 1187821516u, val3, 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_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 = new RpcAttributeParams { RequireOwnership = false }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(2421407223u, val3, val, (SendTo)6, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, playerId); ((NetworkBehaviour)this).__endSendRpc(ref val2, 2421407223u, val3, val, (SendTo)6, (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)) { ((VehicleSeatAnimator)frontMiddleSeat).ReturnPlayerAnimations(val4, false); val4.playerBodyAnimator.SetInteger(CAR_ANIM, 0); val4.TeleportPlayer(Vector3.zero, false, 0f, false, true); currentMiddlePassenger = null; } } } [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_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 = new RpcAttributeParams { RequireOwnership = false }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(3986388574u, val3, val, (SendTo)6, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, playerId); ((NetworkBehaviour)this).__endSendRpc(ref val2, 3986388574u, val3, val, (SendTo)6, (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)) { ((VehicleSeatAnimator)frontRightSeat).ReturnPlayerAnimations(val4, false); val4.playerBodyAnimator.SetInteger(CAR_ANIM, 0); val4.TeleportPlayer(Vector3.zero, false, 0f, false, true); base.currentPassenger = null; } } } private int CanExitVehicle(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() { Plugin.LogDebug("Attempted to enable collision, but this is unnecessary."); } public void DisableVehicleCollisionForAllPlayers() { Plugin.LogDebug("Attempted to disable collision, but this is unnecessary."); } public void SetVehicleCollisionForPlayer(bool setEnabled, PlayerControllerB player) { Plugin.LogDebug("Attempted to set collision, but this is unnecessary."); } private void GetVehicleInput() { //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) PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController; if ((Object)(object)localPlayerController == (Object)null || localPlayerController.isTypingChat || localPlayerController.quickMenuManager.isMenuOpen) { return; } SyncPlayerInputs(); base.moveInputVector = IngamePlayerSettings.Instance.playerInput.actions.FindAction(PLAYER_MOVEMENT, false).ReadValue(); base.moveInputVector.x = (StartOfRound.Instance.localPlayerUsingController ? base.moveInputVector.x : Mathf.Round(base.moveInputVector.x)); base.moveInputVector.y = Mathf.Round(base.moveInputVector.y); 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; } base.steeringAnimValue = base.moveInputVector.x; 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); float magnitude = ((Vector3)(ref base.averageVelocity)).magnitude; if (!(magnitude < 0.5f)) { float num = Mathf.Clamp01(magnitude / maxAutoCenterSpeed); if (base.moveInputVector.x == 0f && UserConfig.RecenterWheel.Value) { base.steeringWheelAnimFloat = NormaliseFloat(Mathf.MoveTowards(base.steeringWheelAnimFloat, 0f, base.steeringWheelTurnSpeed * num * Time.deltaTime / 6f)); } } } private void SyncPlayerInputs() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: 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_0053: 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) 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); } } 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_0017: 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) if (((CallbackContext)(ref context)).performed) { float num = Vector3.Distance(((Component)this).transform.position, StartOfRound.Instance.magnetPoint.position); if (num >= 20f) { Plugin.LogDebug($"Van is too far away from the magnet to toggle it. Distance: {num}."); } else { References.magnetTrigger.TriggerAnimation(GameNetworkManager.Instance.localPlayerController); } } } public void SetUsingSwitchIgnition(CallbackContext context) { if (base.localPlayerInControl && base.keyIgnitionCoroutine == null && ((((CallbackContext)(ref context)).performed && !usingSwitchIgnition) || (((CallbackContext)(ref context)).canceled && usingSwitchIgnition))) { usingSwitchIgnition = !usingSwitchIgnition; SetIgnitionTrigger(); HUDManager.Instance.holdFillAmount = 0f; startIgnitionTrigger.isBeingHeldByPlayer = false; } } public void SetGearAnimation(string setGear) { base.gearStickAnimator.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 val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(1802936242u, val3, val, (SendTo)5, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, playerId); BytePacker.WriteValueBitPacked(val2, setGear); BytePacker.WriteValueBitPacked(val2, gearAnimation); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref upShifting, default(ForPrimitives)); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref isNeutral, default(ForPrimitives)); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref isReverse, default(ForPrimitives)); BytePacker.WriteValueBitPacked(val2, crunchId); ((NetworkBehaviour)this).__endSendRpc(ref val2, 1802936242u, val3, 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 val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(4167936217u, val3, val, (SendTo)1, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, gearHealth); ((NetworkBehaviour)this).__endSendRpc(ref val2, 4167936217u, val3, 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_0052: 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_0071: 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_0095: 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_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: 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_00d3: 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_0134: Unknown result type (might be due to invalid IL or missing references) //IL_0135: 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_0151: Unknown result type (might be due to invalid IL or missing references) //IL_016d: 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_018d: 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_019f: Unknown result type (might be due to invalid IL or missing references) //IL_01a1: Unknown result type (might be due to invalid IL or missing references) //IL_01a6: Unknown result type (might be due to invalid IL or missing references) //IL_01b2: Unknown result type (might be due to invalid IL or missing references) //IL_01b7: 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) //IL_01ce: 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_01db: Unknown result type (might be due to invalid IL or missing references) //IL_0216: Unknown result type (might be due to invalid IL or missing references) //IL_021b: 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_0223: Unknown result type (might be due to invalid IL or missing references) //IL_0228: Unknown result type (might be due to invalid IL or missing references) //IL_022a: Unknown result type (might be due to invalid IL or missing references) if (((NetworkBehaviour)this).IsOwner) { SetVehicleKinematic(setKinematic: 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; CollectItemsInVan(); 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_012d: Unknown result type (might be due to invalid IL or missing references) //IL_012f: 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_015d: 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_0164: 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_016c: Unknown result type (might be due to invalid IL or missing references) //IL_016d: Unknown result type (might be due to invalid IL or missing references) //IL_0173: 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) //IL_0179: 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 val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(231877460u, val3, val, (SendTo)1, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref targetPosition); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref targetRotation); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref startPosition); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref startRotation); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref tempRotation); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref avgVel); ((NetworkBehaviour)this).__endSendRpc(ref val2, 231877460u, val3, val, (SendTo)1, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; SetVehicleKinematic(setKinematic: 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); CollectItemsInVan(); } } } public void CollectItemsInVan() { 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 ((Object)(object)lastDriver != (Object)null) { lastDriver.SetItemInElevator(base.magnetedToShip, base.magnetedToShip, item); continue; } PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController; if (localPlayerController != null) { localPlayerController.SetItemInElevator(base.magnetedToShip, base.magnetedToShip, 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 val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(344299242u, val3, val, (SendTo)5, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref switchState, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val2, 344299242u, val3, 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 val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(1393669511u, val3, val, (SendTo)5, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, setGearHP); ((NetworkBehaviour)this).__endSendRpc(ref val2, 1393669511u, val3, 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 val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(2664742903u, val3, val, (SendTo)5, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, setHP); ((NetworkBehaviour)this).__endSendRpc(ref val2, 2664742903u, val3, 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 val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(2998005556u, val3, val, (SendTo)5, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, setTurboBoosts); ((NetworkBehaviour)this).__endSendRpc(ref val2, 2998005556u, val3, 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() { heaterOn = !heaterOn; 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 val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(1137787820u, val3, val, (SendTo)5, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref heatOn, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val2, 1137787820u, val3, 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(int setSpeed) { int num = Mathf.Clamp(heaterSpeed + setSpeed, 0, 4); if (heaterSpeed != num) { heaterSpeed = num; SetHeaterFanSpeedRpc(heaterSpeed); } } [Rpc(/*Could not decode attribute arguments.*/)] private void SetHeaterFanSpeedRpc(int fanSpeed) { //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 val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(3475323633u, val3, val, (SendTo)5, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, fanSpeed); ((NetworkBehaviour)this).__endSendRpc(ref val2, 3475323633u, val3, 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(int heatTemp) { if (heaterTemperature != heatTemp) { heaterTemperature = heatTemp; isHeaterCold = heatTemp == 0; isHeaterWarm = heatTemp == 1; SetHeaterDirectionRpc(heaterTemperature); } } [Rpc(/*Could not decode attribute arguments.*/)] private void SetHeaterDirectionRpc(int temp) { //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 val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(1374575140u, val3, val, (SendTo)5, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, temp); ((NetworkBehaviour)this).__endSendRpc(ref val2, 1374575140u, val3, val, (SendTo)5, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; heaterTemperature = temp; isHeaterCold = heaterTemperature == 0; isHeaterWarm = heaterTemperature == 1; } } } private void DoTurboBoost(CallbackContext context) { //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_00ba: 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(PLAYER_MOVEMENT, false).ReadValue(); UseTurboBoostLocalClient(dir); UseTurboBoostRpc(); } } } public void UseTurboBoostLocalClient(Vector2 dir = default(Vector2)) { //IL_0157: Unknown result type (might be due to invalid IL or missing references) //IL_0167: 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_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: 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_00bb: 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_00cb: 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_00db: 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_00ea: 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(JUMP_WHILE_IN_CAR); } 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 val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(2821576097u, val3, val, (SendTo)1, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendRpc(ref val2, 2821576097u, val3, 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 && vanAlarmCoroutine == 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 val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(500051534u, val3, val, (SendTo)5, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref honk, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val2, 500051534u, val3, 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_0191: 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) RemoveRainCollision(); DisableControl(); ((PlayerPhysicsRegion)vanZone).disablePhysicsRegion = true; if (StartOfRound.Instance.CurrentPlayerPhysicsRegions.Contains((PlayerPhysicsRegion)(object)vanZone)) { StartOfRound.Instance.CurrentPlayerPhysicsRegions.Remove((PlayerPhysicsRegion)(object)vanZone); } for (int i = 0; i < StartOfRound.Instance.allPlayerScripts.Length; i++) { PlayerControllerB val = StartOfRound.Instance.allPlayerScripts[i]; if ((Object)(object)((Component)val).transform.parent == (Object)(object)((PlayerPhysicsRegion)vanZone).physicsTransform) { Transform parent = (val.isInElevator ? val.playersManager.elevatorTransform : val.playersManager.playersContainer); ((Component)val).transform.SetParent(parent); Plugin.LogWarning($"Player {i} setting parent since vehicle was disabled."); } } if (base.localPlayerInControl || base.localPlayerInPassengerSeat || localPlayerInMiddlePassengerSeat) { GameNetworkManager.Instance.localPlayerController.CancelSpecialTriggerAnimations(); } GrabbableObject[] componentsInChildren = ((Component)base.physicsRegion.physicsTransform).GetComponentsInChildren(); for (int j = 0; j < componentsInChildren.Length; j++) { if ((Object)(object)RoundManager.Instance.mapPropsContainer != (Object)null) { ((Component)componentsInChildren[j]).transform.SetParent(RoundManager.Instance.mapPropsContainer.transform, true); } else { ((Component)componentsInChildren[j]).transform.SetParent((Transform)null, true); } if (!componentsInChildren[j].isHeld) { componentsInChildren[j].FallToGround(false, false, default(Vector3)); } } truckMat.mainTexture = (Texture)(object)defaultTruckTex; VehicleUtils.isSeatedInVan = false; VehicleUtils.vanController = null; } public void Update() { //IL_03a6: Unknown result type (might be due to invalid IL or missing references) //IL_03ab: Unknown result type (might be due to invalid IL or missing references) //IL_022e: Unknown result type (might be due to invalid IL or missing references) //IL_0234: Unknown result type (might be due to invalid IL or missing references) if (base.destroyNextFrame) { if (((NetworkBehaviour)this).IsOwner) { 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) { RemoveRainCollision(); ((PlayerPhysicsRegion)vanZone).disablePhysicsRegion = true; if (StartOfRound.Instance.CurrentPlayerPhysicsRegions.Contains((PlayerPhysicsRegion)(object)vanZone)) { StartOfRound.Instance.CurrentPlayerPhysicsRegions.Remove((PlayerPhysicsRegion)(object)vanZone); } for (int i = 0; i < StartOfRound.Instance.allPlayerScripts.Length; i++) { PlayerControllerB val = StartOfRound.Instance.allPlayerScripts[i]; if ((Object)(object)((Component)val).transform.parent == (Object)(object)((PlayerPhysicsRegion)vanZone).physicsTransform) { Transform parent = (val.isInElevator ? val.playersManager.elevatorTransform : val.playersManager.playersContainer); ((Component)val).transform.SetParent(parent); Plugin.LogWarning($"Player {i} setting parent since vehicle was removed."); } } if (base.localPlayerInControl || base.localPlayerInPassengerSeat || localPlayerInMiddlePassengerSeat) { GameNetworkManager.Instance.localPlayerController.CancelSpecialTriggerAnimations(); } GrabbableObject[] componentsInChildren = ((Component)base.physicsRegion.physicsTransform).GetComponentsInChildren(); for (int j = 0; j < componentsInChildren.Length; j++) { if ((Object)(object)RoundManager.Instance.mapPropsContainer != (Object)null) { ((Component)componentsInChildren[j]).transform.SetParent(RoundManager.Instance.mapPropsContainer.transform, true); } else { ((Component)componentsInChildren[j]).transform.SetParent((Transform)null, true); } if (!componentsInChildren[j].isHeld) { componentsInChildren[j].FallToGround(false, false, default(Vector3)); } } base.destroyNextFrame = true; return; } ReactToDamage(); if (base.magnetedToShip) { if (!StartOfRound.Instance.magnetOn) { base.magnetedToShip = false; StartOfRound.Instance.isObjectAttachedToMagnet = false; CollectItemsInVan(); 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; } } SetCarEffects(steeringWheelAnimValue); UpdateOccupantAnimations(); if (base.localPlayerInControl) { GetVehicleInput(); return; } base.moveInputVector = syncedMoveInputVector; base.steeringAnimValue = base.moveInputVector.x; steeringWheelAnimValue = 0f; base.drivePedalPressed = syncedDrivePedalPressed; base.brakePedalPressed = syncedBrakePedalPressed; clutchPedalPressed = syncedClutchPedalPressed; } private void UpdateOccupantAnimations() { if (!((Object)(object)base.currentDriver == (Object)null) && !((Object)(object)base.currentDriver.playerBodyAnimator == (Object)null) && !disableAnimations && base.keyIgnitionCoroutine == null && base.ignitionStarted) { float num = base.steeringWheelAnimFloat + 0.5f; base.currentDriver.playerBodyAnimator.SetFloat(ANIMATION_SPEED, 0f - num); base.currentDriver.playerBodyAnimator.SetInteger(CAR_ANIM, 1); base.currentDriver.playerBodyAnimator.SetFloat(CAR_HANDBRAKE_ON_ENGAGEMENT, handbrakeAnimValue); base.currentDriver.playerBodyAnimator.SetFloat(CAR_HANDBRAKE_OFF_ENGAGEMENT, 1f * handbrakeAnimValue); } } [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 val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(3102248458u, val3, val, (SendTo)5, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, playerId); BytePacker.WriteValueBitPacked(val2, animIndex); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref isTrigger, default(ForPrimitives)); bool flag = upperStringName != null; ((FastBufferWriter)(ref val2)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val2)).WriteValueSafe(upperStringName, false); } bool flag2 = leftStringName != null; ((FastBufferWriter)(ref val2)).WriteValueSafe(ref flag2, default(ForPrimitives)); if (flag2) { ((FastBufferWriter)(ref val2)).WriteValueSafe(leftStringName, false); } bool flag3 = rightStringName != null; ((FastBufferWriter)(ref val2)).WriteValueSafe(ref flag3, default(ForPrimitives)); if (flag3) { ((FastBufferWriter)(ref val2)).WriteValueSafe(rightStringName, false); } ((NetworkBehaviour)this).__endSendRpc(ref val2, 3102248458u, val3, 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.isPlayerDead && val4.isPlayerControlled) { if (isTrigger) { PlayCombinedOccupantAnimation(val4, upperStringName, leftStringName, rightStringName, 0.05f); } else { val4.playerBodyAnimator.SetInteger(CAR_ANIM, animIndex); } } } [Rpc(/*Could not decode attribute arguments.*/)] public void SyncRadioTimeRpc(float songTime, float syncedTime) { //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 val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(3263666580u, val3, val, (SendTo)3, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref songTime, default(ForPrimitives)); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref syncedTime, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val2, 3263666580u, val3, val, (SendTo)3, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; base.currentSongTime = songTime; syncedSongTime = syncedTime; timeLastSyncedRadio = Time.realtimeSinceStartup; SetRadioTime(); } } } public void SetRadioTime() { if (!isFmRadio && !((Object)(object)base.radioAudio.clip == (Object)null) && base.radioOn) { float num = (syncedSongTime + (Time.realtimeSinceStartup - timeLastSyncedRadio)) % base.radioAudio.clip.length; if (Mathf.Abs(num - base.radioAudio.time) > 1f) { base.radioAudio.time = num; } } } public void ChangeRadioType() { if (ScanVanNetworker.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(); SetCurrentRadioClip(); if (base.radioAudio.loop) { base.radioAudio.loop = false; } if ((Object)(object)base.radioAudio.clip != (Object)null) { base.radioAudio.Play(); } base.currentSongTime = lastSongTime; syncedSongTime = base.currentSongTime; timeLastSyncedRadio = Time.realtimeSinceStartup; base.radioAudio.time = base.currentSongTime; base.radioOn = true; } else { liveRadioController.TogglePowerLocalClient(checkOn: false); if (!base.radioAudio.loop) { base.radioAudio.loop = true; } lastSongTime = base.currentSongTime; syncedSongTime = lastSongTime; timeLastSyncedRadio = Time.realtimeSinceStartup; base.radioAudio.time = lastSongTime; 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 val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(1953632049u, val3, val, (SendTo)5, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref isFmStation, default(ForPrimitives)); BytePacker.WriteValueBitPacked(val2, radioStation); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref lastTime, default(ForPrimitives)); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref currentTime, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val2, 1953632049u, val3, 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(); SetCurrentRadioClip(); if (base.radioAudio.loop) { base.radioAudio.loop = false; } if ((Object)(object)base.radioAudio.clip != (Object)null) { base.radioAudio.Play(); } base.currentSongTime = currentTime; syncedSongTime = currentTime; timeLastSyncedRadio = Time.realtimeSinceStartup; base.radioAudio.time = currentTime; base.radioOn = true; } else { if (!base.radioAudio.loop) { base.radioAudio.loop = true; } lastSongTime = lastTime; syncedSongTime = lastTime; timeLastSyncedRadio = Time.realtimeSinceStartup; base.radioAudio.time = 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 (!ScanVanNetworker.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(); if (base.radioAudio.loop) { base.radioAudio.loop = false; } if ((Object)(object)base.radioAudio.clip != (Object)null) { base.radioAudio.Play(); } base.currentSongTime = 0f; lastSongTime = 0f; syncedSongTime = 0f; timeLastSyncedRadio = Time.realtimeSinceStartup; base.radioAudio.time = 0f; 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 val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(2140426134u, val3, val, (SendTo)5, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, radioStation); ((NetworkBehaviour)this).__endSendRpc(ref val2, 2140426134u, val3, 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(); if (base.radioAudio.loop) { base.radioAudio.loop = false; } if ((Object)(object)base.radioAudio.clip != (Object)null) { base.radioAudio.Play(); } base.currentSongTime = 0f; lastSongTime = 0f; syncedSongTime = 0f; timeLastSyncedRadio = Time.realtimeSinceStartup; base.radioAudio.time = 0f; } } private void PlayCombinedOccupantAnimation(PlayerControllerB player, string upperString, string leftString, string rightString, float time) { if (!((Object)(object)player == (Object)null)) { player.playerBodyAnimator.CrossFade(upperString, time); player.playerBodyAnimator.CrossFade(leftString, time); player.playerBodyAnimator.CrossFade(rightString, time); } } public void SwitchRadio() { if (base.localPlayerInControl && base.keyIgnitionCoroutine == null && base.ignitionStarted) { timeSinceTogglingRadio = Time.realtimeSinceStartup; PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController; PlayCombinedOccupantAnimation(localPlayerController, UPPER_BODY_RADIO_ON, LEFT_ARM_RADIO_ON, RIGHT_ARM_RADIO_ON, 0.05f); SyncPlayerVehicleAnimationsRpc((int)localPlayerController.playerClientId, 0, isTrigger: true, UPPER_BODY_RADIO_ON, LEFT_ARM_RADIO_ON, RIGHT_ARM_RADIO_ON); } 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(); if ((Object)(object)base.radioAudio.clip != (Object)null) { base.radioAudio.Play(); } base.currentSongTime = lastSongTime; syncedSongTime = lastSongTime; timeLastSyncedRadio = Time.realtimeSinceStartup; base.radioAudio.time = lastSongTime; } else { lastSongTime = base.currentSongTime; syncedSongTime = base.currentSongTime; timeLastSyncedRadio = Time.realtimeSinceStartup; 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 val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(1383733861u, val3, val, (SendTo)5, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref lastTime, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val2, 1383733861u, val3, 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 radioTime, 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 val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(3819348054u, val3, val, (SendTo)5, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref on, default(ForPrimitives)); BytePacker.WriteValueBitPacked(val2, currentClip); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref radioTime, default(ForPrimitives)); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref lastRadioTime, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val2, 3819348054u, val3, 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(); if ((Object)(object)base.radioAudio.clip != (Object)null) { base.radioAudio.Play(); } base.currentSongTime = radioTime; syncedSongTime = radioTime; timeLastSyncedRadio = Time.realtimeSinceStartup; base.radioAudio.time = radioTime; } else { lastSongTime = lastRadioTime; syncedSongTime = lastRadioTime; timeLastSyncedRadio = Time.realtimeSinceStartup; if ((Object)(object)base.radioAudio.clip != (Object)null) { base.radioAudio.Stop(); } } } private void SetCurrentRadioClip() { if (!ScanVanNetworker.Instance.StreamerRadio.Value) { if (base.radioClips == null || base.radioClips.Length == 0) { 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_0078: Unknown result type (might be due to invalid IL or missing references) if (!base.radioOn || (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 (isFmRadio || !((NetworkBehaviour)this).IsServer) { return; } if (!base.radioAudio.isPlaying) { ChangeRadioStation(seekForward: true); return; } base.currentSongTime = base.radioAudio.time; if (Time.realtimeSinceStartup - timeLastSyncedRadio > 1f) { timeLastSyncedRadio = Time.realtimeSinceStartup; syncedSongTime = base.radioAudio.time; SyncRadioTimeRpc(base.currentSongTime, syncedSongTime); } } 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 (vanAlarmCoroutine == null && base.keyIgnitionCoroutine == 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 val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(1849009000u, val3, val, (SendTo)6, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendRpc(ref val2, 1849009000u, val3, val, (SendTo)6, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; vanAlarmCoroutine = ((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); } vanAlarmCoroutine = null; alarmDebounce = false; } public void SetCarEffects(float setSteering) { //IL_00e8: 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_0136: 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(STEERING_WHEEL_SPEED, Mathf.Clamp((base.steeringWheelAnimFloat + 1f) / 2f, 0f, 1f)); handbrakeAnimValue = Mathf.MoveTowards(handbrakeAnimValue, handbrakeEngaged ? 0f : 1f, handbrakePullSpeed * Time.deltaTime * (Time.realtimeSinceStartup - timeAtLastHandbrakePull)); handbrakeAnimator.SetFloat(HANDBRAKE_ENGAGEMENT, handbrakeAnimValue); 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); } SetRadioEffects(); SetInteriorEffects(); SetHeaterEffects(); SetLightingEffects(); SetAudioEffects(); SetTyreSlipEffects(); SetKeyEffects(); if (((NetworkBehaviour)this).IsOwner) { SyncEffectsToOtherClients(); 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, syncedSteeringWheelRotation, 6f * Time.deltaTime); } else { base.steeringWheelAnimFloat = Mathf.MoveTowards(base.steeringWheelAnimFloat, syncedSteeringWheelRotation, base.steeringWheelTurnSpeed * Time.deltaTime / 6f); } } public void SetInteriorEffects() { float num = ((!lowBeamsOn) ? 0f : ((!highBeamsOn) ? 0.5f : 1f)); headlampSwitchAnimFloat = Mathf.MoveTowards(headlampSwitchAnimFloat, num, 8f * Time.deltaTime); headlampSwitchAnimator.SetFloat(HEADLAMP_SWITCH_DIRECTION, headlampSwitchAnimFloat); } public void SetHeaterEffects() { float num = (float)heaterSpeed - 1f; float num2 = num / 3f; hvacFanSpeedAnimFloat = Mathf.MoveTowards(hvacFanSpeedAnimFloat, num2, 8f * Time.deltaTime); float num3 = (heaterOn ? 1f : 0f); hvacFanDirectionAnimFloat = Mathf.MoveTowards(hvacFanDirectionAnimFloat, num3, 8f * Time.deltaTime); float num4 = heaterTemperature; hvacFanTemperatureAnimFloat = Mathf.MoveTowards(hvacFanTemperatureAnimFloat, 1f - num4, 8f * Time.deltaTime); hvacAnimator.SetFloat(HVAC_FAN_SPEED, hvacFanSpeedAnimFloat); hvacAnimator.SetFloat(HVAC_DIRECTION, hvacFanDirectionAnimFloat); hvacAnimator.SetFloat(HVAC_TEMPERATURE, hvacFanTemperatureAnimFloat); } 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 SetRadioEffects() { if (!ignitionOn && !base.radioOn) { ((TMP_Text)radioTime).text = null; ((TMP_Text)radioFrequency).text = null; } else if (base.radioOn) { ((TMP_Text)radioTime).text = GetClockTime(((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 (!ScanVanNetworker.Instance.StreamerRadio.Value && base.radioClips.Length == 0) { return "NO CD"; } int num = currentTrack + 1; return $"CD PLAY {num:00}"; } private string GetClockTime(string clockText) { if ((Object)(object)RoundManager.Instance.currentLevel != (Object)null && !RoundManager.Instance.currentLevel.planetHasTime) { return DateTime.Now.ToString("h:mm"); } return clockText.Trim().Replace("\n", "").Replace("AM", "") .Replace("PM", "") .Trim(); } public void SetLightingEffects() { bool flag = base.brakePedalPressed && 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 || allWheelsAirborne))) { 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 SetAudioEffects() { //IL_022f: Unknown result type (might be due to invalid IL or missing references) //IL_0284: Unknown result type (might be due to invalid IL or missing references) //IL_02da: Unknown result type (might be due to invalid IL or missing references) //IL_048a: Unknown result type (might be due to invalid IL or missing references) //IL_0320: Unknown result type (might be due to invalid IL or missing references) //IL_0598: Unknown result type (might be due to invalid IL or missing references) //IL_0630: 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 = (float)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); } } SetVehicleAudioProperties(roofRainAudio, roofRainAudioActive, 0f, 1f, 3f, useVolumeInsteadOfPitch: true); roofRainAudio.spatialBlend = Mathf.MoveTowards(roofRainAudio.spatialBlend, roofRainAudioActive ? 0f : 1f, 4f * Time.deltaTime); 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 > 1f) { 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 (vanAlarmCoroutine != 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 SetTyreSlipEffects() { //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 = false; if (backWheelsGrounded) { if (currentMotorTorque > 600f && Mathf.Abs(forwardsSlip) > 0.245f && num2 > 350f) { num = Mathf.Max(num, 0.8f); flag = true; if (((Vector3)(ref base.averageVelocity)).magnitude > 8f && !base.tireSparks.isPlaying) { base.tireSparks.Play(true); } } else { flag = false; if (base.tireSparks.isEmitting) { base.tireSparks.Stop(true, (ParticleSystemStopBehavior)1); } } } else { flag = false; if (base.tireSparks.isEmitting) { base.tireSparks.Stop(true, (ParticleSystemStopBehavior)1); } } SetVehicleAudioProperties(base.skiddingAudio, flag, 0f, num, 3f, useVolumeInsteadOfPitch: true); if (Mathf.Abs(syncedTyreStress - num) > 0.02f || syncedTyreSlipping != flag) { syncedTyreStress = num; syncedTyreSlipping = flag; SetTyreStressRpc(num, flag); } } else { if (syncedTyreSlipping && ((Vector3)(ref base.averageVelocity)).magnitude > 8f && !base.tireSparks.isPlaying) { base.tireSparks.Play(true); } else if (!syncedTyreSlipping && base.tireSparks.isEmitting) { base.tireSparks.Stop(true, (ParticleSystemStopBehavior)1); } SetVehicleAudioProperties(base.skiddingAudio, syncedTyreSlipping, 0f, syncedTyreStress, 3f, useVolumeInsteadOfPitch: true); } } public void SetKeyEffects(bool localUseBodyHands = false) { //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_0348: 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_03a1: 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_03cd: Unknown result type (might be due to invalid IL or missing references) //IL_03e9: Unknown result type (might be due to invalid IL or missing references) //IL_0405: Unknown result type (might be due to invalid IL or missing references) //IL_01d0: 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) //IL_01d5: 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_01dc: Unknown result type (might be due to invalid IL or missing references) //IL_01e9: Unknown result type (might be due to invalid IL or missing references) //IL_0231: Unknown result type (might be due to invalid IL or missing references) //IL_0247: Unknown result type (might be due to invalid IL or missing references) //IL_025d: Unknown result type (might be due to invalid IL or missing references) //IL_02b5: Unknown result type (might be due to invalid IL or missing references) //IL_02c8: Unknown result type (might be due to invalid IL or missing references) //IL_02ca: 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; } bool flag = base.localPlayerInControl && !localUseBodyHands; Transform val = (flag ? base.currentDriver.localItemHolder : base.currentDriver.serverItemHolder); Vector3 localPosition = (flag ? LHD_Pos_Local : LHD_Pos_Server); Vector3 val2 = (flag ? 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_00ca: 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_0105: 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_0140: Unknown result type (might be due to invalid IL or missing references) //IL_0154: 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_0189: Unknown result type (might be due to invalid IL or missing references) SetVehicleToDropship(); SetVehicleToFixedPosition(); TryAttachToShipMagnet(); MovePhysicsBodies(); CalculateVehicleVelocity(); SyncCarPhysicsToOtherClients(); if (base.carDestroyed) { SetPreviousVehiclePosition(); return; } ApplySteering(); ApplyWheelForces(); 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; allWheelsGrounded = base.FrontLeftWheel.isGrounded && base.FrontRightWheel.isGrounded && base.BackLeftWheel.isGrounded && base.BackRightWheel.isGrounded; backWheelsGrounded = base.BackLeftWheel.isGrounded && base.BackRightWheel.isGrounded; frontWheelsGrounded = base.FrontLeftWheel.isGrounded && base.FrontRightWheel.isGrounded; if (!((NetworkBehaviour)this).IsOwner) { SetCarPhysicsValuesOnClient(); CalculateWheelSlip(calculatePhysics: false); SetWheelStiffness(base.FrontLeftWheel, isSnow: false); SetWheelStiffness(base.FrontRightWheel, isSnow: false); SetWheelStiffness(base.BackLeftWheel, isSnow: false); SetWheelStiffness(base.BackRightWheel, isSnow: false); SetPreviousVehiclePosition(); return; } UpdateCarDrivetrain(); UpdateCarEngine(); SyncDrivetrain(); SyncWheelTorque(); if (base.mainRigidbody.IsSleeping() || base.magnetedToShip || allWheelsAirborne) { CalculateWheelSlip(calculatePhysics: false); SetPreviousVehiclePosition(); } else { ApplyAntiSlipForce(); CalculateWheelSlip(calculatePhysics: true); SetPreviousVehiclePosition(); } } private void SetCarPhysicsValuesOnClient() { currentMotorTorque = syncedCurrentMotorTorque; currentBrakeTorque = syncedCurrentBrakeTorque; float num = (base.ignitionStarted ? syncedEngineRPM : 0f); base.EngineRPM = Mathf.Lerp(base.EngineRPM, num, 3f * Time.fixedDeltaTime); steeringDecay = 1f; enginePower = 0f; inclineCompensation = 1f; throttleInput = 0f; brakeInput = 0f; clutchEngagement = 1f; clutchSlip = 0f; frontWheelRPM = syncedFrontWheelRPM; backWheelRPM = syncedBackWheelRPM; wheelRPM = syncedWheelRPM; forwardWheelSpeed = 8000f; reverseWheelSpeed = -8000f; } private void SetPreviousVehiclePosition() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: 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_001e: Unknown result type (might be due to invalid IL or missing references) //IL_002a: 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) previousVehiclePosition = base.mainRigidbody.position; previousVehicleRotation = base.mainRigidbody.rotation; lastVelocity = base.mainRigidbody.velocity; } private void SetVehicleToDropship() { //IL_0082: 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_0091: 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_00a8: 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_00b9: 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_00f0: 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_011e: 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) //IL_012f: 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_017c: Unknown result type (might be due to invalid IL or missing references) //IL_0198: Unknown result type (might be due to invalid IL or missing references) //IL_01aa: Unknown result type (might be due to invalid IL or missing references) //IL_01af: Unknown result type (might be due to invalid IL or missing references) //IL_01bb: Unknown result type (might be due to invalid IL or missing references) //IL_01c0: 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.inDropshipAnimation = false; SetVehicleKinematic(setKinematic: true); base.mainRigidbody.MovePosition(StartOfRound.Instance.notSpawnedPosition.position + Vector3.forward * 30f); base.syncedPosition = base.mainRigidbody.position; base.syncedRotation = base.mainRigidbody.rotation; } else if (base.itemShip.untetheredVehicle) { 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; SetVehicleKinematic(setKinematic: 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; } } } private void SetVehicleKinematic(bool setKinematic) { if (base.mainRigidbody.isKinematic != setKinematic) { base.mainRigidbody.isKinematic = setKinematic; Plugin.LogDebug($"Set 'mainRigidbody' kinematic to: {setKinematic}."); } } private void SetVehicleToFixedPosition() { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: 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) //IL_0034: 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_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) //IL_0070: 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_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: 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_00bb: 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_00d0: 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_00ea: 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_0108: 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_013d: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_014c: Unknown result type (might be due to invalid IL or missing references) //IL_0151: 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) //IL_016a: 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_0176: Unknown result type (might be due to invalid IL or missing references) //IL_0189: Unknown result type (might be due to invalid IL or missing references) //IL_018f: Unknown result type (might be due to invalid IL or missing references) //IL_019a: Unknown result type (might be due to invalid IL or missing references) //IL_01ac: 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) if (base.magnetedToShip) { SetVehicleKinematic(setKinematic: 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) { SetVehicleKinematic(setKinematic: true); Vector3 val = base.syncedPosition + base.averageVelocity * Time.fixedDeltaTime; 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)); base.truckVelocityLastFrame = base.mainRigidbody.velocity; } } private void TryAttachToShipMagnet() { //IL_0082: 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_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) if (!base.magnetedToShip && ((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) >= 10f) && !Physics.Linecast(((Component)this).transform.position, StartOfRound.Instance.magnetPoint.position, 256, (QueryTriggerInteraction)1)) { StartMagneting(); } } private void MovePhysicsBodies() { //IL_000d: 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_002f: Unknown result type (might be due to invalid IL or missing references) //IL_003a: 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_0072: 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) 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); ((Component)playerPhysicsBody).transform.localPosition = Vector3.zero; ((Component)playerPhysicsBody).transform.localRotation = Quaternion.identity; } private void CalculateVehicleVelocity() { //IL_005d: 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_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_0016: 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_002c: Unknown result type (might be due to invalid IL or missing references) //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_0044: 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_0098: 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) if (base.averageCount > base.movingAverageLength) { base.averageVelocity += (base.mainRigidbody.velocity - base.averageVelocity) / (float)(base.movingAverageLength + 1); return; } base.averageCount++; base.averageVelocity += base.mainRigidbody.velocity; if (base.averageCount == base.movingAverageLength) { base.averageVelocity /= (float)base.averageCount; } } private void ApplySteering() { float num = Mathf.Abs(base.steeringWheelAnimFloat); float num2 = Mathf.Sign(base.steeringWheelAnimFloat); steeringAngle = steeringWheelCurve.Evaluate(num) * 50f * num2; base.FrontLeftWheel.steerAngle = steeringAngle; base.FrontRightWheel.steerAngle = steeringAngle; } private void SetSteeringDecay() { if (((Vector3)(ref base.averageVelocity)).magnitude < 28f || !frontWheelsGrounded) { steeringDecay = Mathf.MoveTowards(steeringDecay, 1f, 4f * Time.fixedDeltaTime); } else if (((Vector3)(ref base.averageVelocity)).magnitude > 28f && frontWheelsGrounded) { steeringDecay = Mathf.Lerp(1f, 0.65f, (((Vector3)(ref base.averageVelocity)).magnitude - 28f) / 50f); steeringDecay = Mathf.Max(steeringDecay, 0.65f); } } private void ApplyWheelForces() { SetTorqueToWheelCollider(base.FrontLeftWheel, currentMotorTorque, currentBrakeTorque); SetTorqueToWheelCollider(base.FrontRightWheel, currentMotorTorque, currentBrakeTorque); SetTorqueToWheelCollider(base.BackLeftWheel, currentMotorTorque, currentBrakeTorque); SetTorqueToWheelCollider(base.BackRightWheel, currentMotorTorque, currentBrakeTorque); SetWheelRotationVelocity(); } private void SetTorqueToWheelCollider(WheelCollider wheelCollider, float motorForce, float brakeForce) { wheelCollider.motorTorque = motorForce; wheelCollider.brakeTorque = brakeForce; } private void SetWheelRotationVelocity() { 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); } private void CalculateWheelSlip(bool calculatePhysics) { //IL_0078: 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_003f: Unknown result type (might be due to invalid IL or missing references) if (!calculatePhysics) { forwardsSlip = 0f; return; } WheelHit val = default(WheelHit); for (int i = 0; i < wheels.Count; i++) { if (wheels[i].GetGroundHit(ref val)) { wheelHits[i] = val; SetWheelStiffness(wheels[i], ((Component)((WheelHit)(ref val)).collider).CompareTag("Snow")); } else { wheelHits[i] = default(WheelHit); } } forwardsSlip = (((WheelHit)(ref wheelHits[2])).forwardSlip + ((WheelHit)(ref wheelHits[3])).forwardSlip) * 0.5f; } private void UpdateCarDrivetrain() { //IL_0064: 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) //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_008b: 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) bool flag = base.drivePedalPressed && base.ignitionStarted; bool flag2 = !base.drivePedalPressed && base.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) { currentBrakeTorque = Mathf.MoveTowards(currentBrakeTorque, maxBrakingPower, base.brakeSpeed * Time.fixedDeltaTime); } else if (base.brakePedalPressed) { currentBrakeTorque = Mathf.MoveTowards(currentBrakeTorque, maxBrakingPower * brakeInput, base.brakeSpeed * Time.fixedDeltaTime); } else if (!base.brakePedalPressed && brakeInput == 0f) { currentBrakeTorque = 0f; } if (!base.ignitionStarted || inNeutral || clutchEngagement == 0f) { currentMotorTorque = 0f; if (!inNeutral && !base.ignitionStarted) { currentBrakeTorque = maxBrakingPower; } forwardWheelSpeed = 8000f; reverseWheelSpeed = -8000f; return; } if (inReverse) { if (flag) { currentMotorTorque = (0f - engineReversePower) * num2; } else if (flag2) { currentMotorTorque = 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) { currentMotorTorque = enginePower * inclineCompensation * num2; } else if (flag2) { currentMotorTorque = 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; } private void ApplyAntiSlipForce() { //IL_0001: 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_000d: 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_0020: 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_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: 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_0050: 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_0077: 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_007d: 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_008b: 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_008d: 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_00a0: 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) //IL_00a6: 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_00ac: 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_00d1: 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_00c3: 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_00c9: Unknown result type (might be due to invalid IL or missing references) Vector3 val = Vector3.zero; for (int i = 0; i < wheelHits.Length; i++) { val += ((WheelHit)(ref wheelHits[i])).normal; } val = ((Vector3)(ref val)).normalized; if (allWheelsGrounded && !(Vector3.Angle(-val, Physics.gravity) > 30f)) { Vector3 val2 = Vector3.ProjectOnPlane(((Component)this).transform.forward, val); Vector3 normalized = ((Vector3)(ref val2)).normalized; Vector3 val3 = -val; val2 = Physics.gravity; Vector3 val4 = val3 * ((Vector3)(ref val2)).magnitude; Vector3 val5 = val4 - Physics.gravity; if (!handbrakeEngaged) { val5 = Vector3.ProjectOnPlane(val5, normalized); } base.mainRigidbody.AddForce(val5, (ForceMode)5); } } 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.56f : baseForwardStiffness); ((WheelFrictionCurve)(ref sidewaysFriction)).stiffness = (isSnow ? 0.58f : baseSidewaysStiffness); wheel.forwardFriction = forwardFriction; wheel.sidewaysFriction = sidewaysFriction; } public void SyncWheelTorque() { if (syncTorqueInterval >= 0.14f) { float num = Mathf.Round(currentMotorTorque); float num2 = Mathf.Round(currentBrakeTorque); if (syncedCurrentMotorTorque != num || syncedCurrentBrakeTorque != num2) { syncTorqueInterval = 0f; syncedCurrentMotorTorque = currentMotorTorque; syncedCurrentBrakeTorque = currentBrakeTorque; SyncWheelTorqueRpc(currentMotorTorque, currentBrakeTorque); } } else { syncTorqueInterval += 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 val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(3563070839u, val3, val, (SendTo)1, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref motorTorque, default(ForPrimitives)); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref brakeTorque, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val2, 3563070839u, val3, val, (SendTo)1, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; syncedCurrentMotorTorque = motorTorque; syncedCurrentBrakeTorque = brakeTorque; } } } public void SyncDrivetrain() { float num = 0.15f * ((Vector3)(ref base.averageVelocity)).magnitude; num = Mathf.Clamp(num, 0.15f, 0.21f); if (syncDrivetrainInterval >= 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) { syncDrivetrainInterval = 0f; syncedFrontWheelRPM = num4; syncedBackWheelRPM = num5; syncedWheelRPM = num3; syncedEngineRPM = num2; SyncDrivetrainRpc(frontWheelRPM, backWheelRPM, wheelRPM, syncedEngineRPM); } } else { syncDrivetrainInterval += Time.fixedDeltaTime; } } [Rpc(/*Could not decode attribute arguments.*/)] public void SyncDrivetrainRpc(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 val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(3539121039u, val3, val, (SendTo)1, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref frontWheelSpeed, default(ForPrimitives)); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref backWheelSpeed, default(ForPrimitives)); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref wheelSpeed, default(ForPrimitives)); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref engineSpeed, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val2, 3539121039u, val3, 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); PlayerControllerB currentDriver = base.currentDriver; if (currentDriver != null) { currentDriver.playerBodyAnimator.SetInteger(CAR_ANIM, 1); } ignitionAnimator.SetInteger(IGNITION_ANIM, 7); base.chanceToStartIgnition = 101f; SetFrontCabinLightOn(setOn: true); base.carEngine1AudioActive = false; base.ignitionStarted = false; usingSwitchIgnition = false; base.carExhaustParticle.Stop(true, (ParticleSystemStopBehavior)1); SetIgnitionTrigger(); } [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 val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(2229834372u, val3, val, (SendTo)1, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendRpc(ref val2, 2229834372u, val3, 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 SyncEffectsToOtherClients() { if (syncEffectsInterval > 0.045f) { if (syncedSteeringWheelRotation != base.steeringWheelAnimFloat) { syncEffectsInterval = 0f; syncedSteeringWheelRotation = base.steeringWheelAnimFloat; SyncCarEffectsRpc(base.steeringWheelAnimFloat, smoothRotation); } } else { syncEffectsInterval += 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 val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(1154936118u, val3, val, (SendTo)1, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref wheelRotation, default(ForPrimitives)); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref smoothRot, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val2, 1154936118u, val3, val, (SendTo)1, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; syncedSteeringWheelRotation = 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 val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(1252950827u, val3, val, (SendTo)1, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref playerInput); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref gasPressed, default(ForPrimitives)); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref brakePressed, default(ForPrimitives)); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref clutchPressed, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val2, 1252950827u, val3, 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_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_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_00ea: 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_009c: 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_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_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: 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) //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_013b: 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) if (!((NetworkBehaviour)this).IsOwner || base.magnetedToShip || base.inDropshipAnimation) { return; } SetVehicleKinematic(setKinematic: 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 val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(3777613204u, val3, val, (SendTo)1, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref carPosition); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref carRotation); ((NetworkBehaviour)this).__endSendRpc(ref val2, 3777613204u, val3, 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 val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(3195815204u, val3, val, (SendTo)1, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref stress, default(ForPrimitives)); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref wheelSkidding, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val2, 3195815204u, val3, val, (SendTo)1, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; syncedTyreStress = stress; syncedTyreSlipping = wheelSkidding; } } } public void UpdateScanNodeText() { if (base.carDestroyed) { scanNode.headerText = "Destroyed Van"; 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(); bool mute = base.magnetedToShip && (StartOfRound.Instance.inShipPhase || !StartOfRound.Instance.shipDoorsEnabled); if (StartOfRound.Instance.inShipPhase && base.windshieldBroken) { RegenerateWindshield(); } base.hornAudio.mute = mute; base.engineAudio1.mute = mute; base.engineAudio2.mute = mute; carKeySounds.mute = mute; cabinLightSwitchAudio.mute = mute; heaterAudio.mute = mute; voiceModule.voiceAudio.mute = mute; wiperAudio.mute = mute; base.rollingAudio.mute = mute; base.skiddingAudio.mute = mute; base.turbulenceAudio.mute = mute; base.hoodFireAudio.mute = mute; base.extremeStressAudio.mute = mute; base.pushAudio.mute = mute; base.radioAudio.mute = mute; base.radioInterference.mute = mute; if ((Object)(object)base.currentDriver != (Object)null && (Object)(object)lastDriver != (Object)(object)base.currentDriver && !base.magnetedToShip) { lastDriver = base.currentDriver; } if (base.honkingHorn && base.hornAudio.isPlaying && base.hornAudio.pitch < 1f) { base.hornAudio.Stop(); } voiceModule.DoEVACycle(); } } 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 ((isSpecialVariant && obstacleSize > 1f) || (!isSpecialVariant && obstacleSize > 2f)) { DealPermanentDamage(1, position); } } } else { base.mainRigidbody.AddForce(Vector3.Normalize(-impulse * 1E+09f) * (base.carReactToPlayerHitMultiplier - 220f), (ForceMode)1); if (dealDamage) { DealPermanentDamage(isSpecialVariant ? 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_0213: Unknown result type (might be due to invalid IL or missing references) //IL_0218: Unknown result type (might be due to invalid IL or missing references) //IL_0222: Unknown result type (might be due to invalid IL or missing references) //IL_024f: Unknown result type (might be due to invalid IL or missing references) //IL_0254: Unknown result type (might be due to invalid IL or missing references) //IL_025e: Unknown result type (might be due to invalid IL or missing references) //IL_0276: 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_02ca: Unknown result type (might be due to invalid IL or missing references) //IL_0436: Unknown result type (might be due to invalid IL or missing references) //IL_0539: Unknown result type (might be due to invalid IL or missing references) //IL_053e: Unknown result type (might be due to invalid IL or missing references) //IL_0548: Unknown result type (might be due to invalid IL or missing references) //IL_04cb: Unknown result type (might be due to invalid IL or missing references) //IL_04d0: 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_0428: Unknown result type (might be due to invalid IL or missing references) //IL_0507: Unknown result type (might be due to invalid IL or missing references) //IL_050c: Unknown result type (might be due to invalid IL or missing references) //IL_0516: 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_052c: 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 < 6f) { if (num2 > 3f && ((Vector3)(ref base.averageVelocity)).magnitude > 2.5f) { SetInternalStress(0.15f); base.lastStressType = "Scraping"; } return; } float setVolume = 0.5f; int audioType = -1; if (num >= 11f && ((Vector3)(ref lastVelocity)).magnitude > 38f) { if (base.carHP < 3) { DestroyCarRpc(); DestroyCar(); return; } DamagePlayerInVehicle(Vector3.ClampMagnitude(-collision.relativeVelocity, 60f), num); if (!base.windshieldBroken) { BreakWindshield(); BreakWindshieldRpc(); } CarCollisionRpc(Vector3.ClampMagnitude(-collision.relativeVelocity, 60f), num); int damageAmount = Random.Range(10, 20); damagePosition = default(Vector3); DealPermanentDamage(damageAmount, damagePosition); audioType = 2; setVolume = Mathf.Clamp((num2 - base.maximumBumpForce) / 20000f, 0.8f, 1f); setVolume = Mathf.Clamp(setVolume + Random.Range(-0.15f, 0.25f), 0.7f, 1f); PlayCollisionAudio(val, audioType, setVolume); return; } if (num2 >= base.minimalBumpForce && num2 < base.mediumBumpForce && num > 4f) { audioType = 0; setVolume = Mathf.Clamp((num2 - base.minimalBumpForce) / (base.mediumBumpForce - base.minimalBumpForce), 0.25f, 1f); setVolume = Mathf.Clamp(setVolume + Random.Range(-0.15f, 0.25f), 0.25f, 1f); } else if (num2 >= base.mediumBumpForce && num2 < base.maximumBumpForce && num > 9f) { audioType = 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); } else if (num2 >= base.maximumBumpForce && num > 9.5f) { audioType = 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); } PlayCollisionAudio(val, audioType, setVolume); if (num2 > base.maximumBumpForce + 10000f && ((Vector3)(ref lastVelocity)).magnitude >= 28f) { audioType = 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 (num >= 14f) { DamagePlayerInVehicle(Vector3.ClampMagnitude(-collision.relativeVelocity, 60f), num); if (!base.windshieldBroken) { BreakWindshield(); BreakWindshieldRpc(); } CarCollisionRpc(Vector3.ClampMagnitude(-collision.relativeVelocity, 60f), num); damagePosition = default(Vector3); DealPermanentDamage(2, damagePosition); return; } } CarBumpLocalClient(Vector3.ClampMagnitude(-collision.relativeVelocity, 40f)); } public void DamageVehicle(float diff, Vector3 collision, int damageAmount = 1) { //IL_0002: 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_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0020: 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_002b: 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) DamagePlayerInVehicle(Vector3.ClampMagnitude(-collision, 60f), diff / 1.5f); CarCollisionRpc(Vector3.ClampMagnitude(-collision, 60f), diff / 1.5f); if (damageAmount != 0) { DealPermanentDamage(damageAmount); } } public void CarBumpLocalClient(Vector3 vel) { //IL_0039: 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_006a: 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) //IL_0070: 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_007b: 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_0058: 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) if (!base.localPlayerInControl && !localPlayerInMiddlePassengerSeat && !base.localPlayerInPassengerSeat && VehicleUtils.IsPlayerInVanBounds(this)) { if (VehicleUtils.IsPlayerInVanCabin(this)) { vel = Vector3.ClampMagnitude(vel, 5f); } else if (VehicleUtils.IsPlayerInVanStorage(this)) { 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_00fe: 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) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_012f: 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_0135: 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_0117: 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) //IL_0122: 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 val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(3911754106u, val3, val, (SendTo)1, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref vel); ((NetworkBehaviour)this).__endSendRpc(ref val2, 3911754106u, val3, 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.IsPlayerInVanBounds(this)) { if (VehicleUtils.IsPlayerInVanCabin(this)) { vel = Vector3.ClampMagnitude(vel, 5f); } else if (VehicleUtils.IsPlayerInVanStorage(this)) { 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 val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(1897686969u, val3, val, (SendTo)1, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref vel); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref magn, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val2, 1897686969u, val3, val, (SendTo)1, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; DamagePlayerInVehicle(vel, magn); } } } public void DamagePlayerInVehicle(Vector3 vel, float magnitude) { //IL_0132: 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_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0109: 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_00ae: 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_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_0059: 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_006e: 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_01e6: 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_01bc: 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) if (!base.localPlayerInPassengerSeat && !localPlayerInMiddlePassengerSeat && !base.localPlayerInControl) { if (VehicleUtils.IsPlayerInVanBounds(this)) { 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 > 27f) { 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((int)((Vector3)(ref vel)).magnitude, true, true, (CauseOfDeath)16, 0, false, vel); } } else if (magnitude <= 16f && magnitude >= 4f) { 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 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 val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(934350138u, val3, val, (SendTo)5, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendRpc(ref val2, 934350138u, val3, 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_0043: Unknown result type (might be due to invalid IL or missing references) if (!base.windshieldBroken) { base.windshieldBroken = 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; 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 val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(2311967180u, val3, val, (SendTo)1, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref audioPosition); BytePacker.WriteValueBitPacked(val2, audio); BytePacker.WriteValueBitPacked(val2, audioType); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref vol, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val2, 2311967180u, val3, 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); } } public void SetInternalStress(float carStressIncrease = 0f) { //IL_00cd: 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) if (((NetworkBehaviour)this).IsOwner && !base.magnetedToShip && !base.carDestroyed) { 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 (((NetworkBehaviour)this).IsOwner && !base.magnetedToShip && !base.carDestroyed) { base.timeAtLastDamage = Time.realtimeSinceStartup; base.carHP -= damageAmount; syncedCarHP = base.carHP; if (base.carHP <= 0) { DealDamageRpc(base.carHP); DestroyCarRpc(); DestroyCar(); } 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 val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(2956878147u, val3, val, (SendTo)1, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, carHealth); ((NetworkBehaviour)this).__endSendRpc(ref val2, 2956878147u, val3, 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) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(1629085561u, val3, val, (SendTo)5, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendRpc(ref val2, 1629085561u, val3, val, (SendTo)5, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; DestroyCar(); } } } public void DestroyCar() { //IL_005f: 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_0146: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_0156: 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_0165: Unknown result type (might be due to invalid IL or missing references) //IL_016a: Unknown result type (might be due to invalid IL or missing references) if (!base.carDestroyed) { base.carDestroyed = true; UnMagnetCar(); StopAudiosPlayback(); RemoveRainCollision(); CollectItemsInVan(); StopParticleVFX(); SetMaterials(); SetLightsOff(); BreakWindshield(); RoundManager.Instance.PlayAudibleNoise(((Component)base.engineAudio1).transform.position, 20f, 0.8f, 0, false, 2692); DisableWheelCollider(base.FrontLeftWheel, base.leftWheelMesh, leftBrakeMesh); DisableWheelCollider(base.FrontRightWheel, base.rightWheelMesh, rightBrakeMesh); DisableWheelCollider(base.BackLeftWheel, base.backLeftWheelMesh, backLeftBrakeMesh); DisableWheelCollider(base.BackRightWheel, base.backRightWheelMesh, backRightBrakeMesh); DisableObjectsOnDestroy(); EnableObjectsOnDestroy(); base.destroyedTruckMesh.SetActive(true); SetExplosionForce(1560f, ((Component)base.hoodFireAudio).transform.position); DisableIgnition(); DisableDrivetrain(); ResetControl(); KillOccupants(); SetInteractions(); ResetOccupants(); Landmine.SpawnExplosion(((Component)this).transform.position + ((Component)this).transform.forward + Vector3.up * 1.5f, true, 6f, 10f, 30, 1000f, base.truckDestroyedExplosion, true); } } private void UnMagnetCar() { if (base.magnetedToShip && !((Object)(object)StartOfRound.Instance.attachedVehicle != (Object)(object)this)) { base.magnetedToShip = false; StartOfRound.Instance.attachedVehicle = null; StartOfRound.Instance.isObjectAttachedToMagnet = false; CollectItemsInVan(); } } private void StopAudiosPlayback() { base.underExtremeStress = false; base.engineAudio1.Stop(); base.engineAudio2.Stop(); engineAudio3.Stop(); engineAudio4.Stop(); base.turbulenceAudio.Stop(); base.pushAudio.Stop(); base.miscAudio.Stop(); base.steeringWheelAudio.Stop(); base.gearStickAudio.Stop(); base.rollingAudio.Stop(); base.radioAudio.Stop(); base.radioInterference.Stop(); base.extremeStressAudio.Stop(); carKeySounds.Stop(); base.honkingHorn = false; base.hornAudio.Stop(); base.skiddingAudio.Stop(); base.turboBoostAudio.Stop(); if (base.radioOn) { liveRadioController.TurnRadioOnOff(state: false); } heaterOn = false; base.radioOn = false; base.extremeStressAudio.Stop(); cabinLightSwitchAudio.Stop(); if (voiceModule.audioTimedCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(voiceModule.audioTimedCoroutine); voiceModule.audioTimedCoroutine = null; } voiceModule.voiceAudio.Stop(); voiceModule.voiceAudio.mute = true; if (blinkersCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(blinkersCoroutine); blinkersCoroutine = null; } hazardsBlinking = false; roofRainAudio.Stop(); } private void StopParticleVFX() { base.tireSparks.Stop(); base.turboBoostParticle.Stop(); } private void SetMaterials() { ((Renderer)leftBlinkerMesh).material = base.headlightsOffMat; ((Renderer)leftBlinkerMeshLod).material = base.headlightsOffMat; ((Renderer)rightBlinkerMesh).material = base.headlightsOffMat; ((Renderer)rightBlinkerMeshLod).material = base.headlightsOffMat; } private void SetLightsOff() { SetSymbolActive(leftSignalSymbol, leftSignalLight, active: false); SetSymbolActive(hazardWarningSymbol, hazardWarningLight, active: false); SetSymbolActive(rightSignalSymbol, rightSignalLight, active: false); blinkerLightsContainer.SetActive(false); } private void DisableWheelCollider(WheelCollider wheelCollider, MeshRenderer wheelMesh, MeshRenderer brakeMesh) { if (!((Object)(object)wheelCollider == (Object)null) && !((Object)(object)brakeMesh == (Object)null) && ((Collider)wheelCollider).enabled) { wheelCollider.motorTorque = 0f; wheelCollider.brakeTorque = 0f; ((Collider)wheelCollider).enabled = false; ((Renderer)wheelMesh).enabled = false; ((Renderer)brakeMesh).enabled = false; } } private void DisableObjectsOnDestroy() { for (int i = 0; i < disableOnDestroy.Length; i++) { if (disableOnDestroy[i].activeSelf) { disableOnDestroy[i].SetActive(false); } } ((Component)base.mainBodyMesh).gameObject.SetActive(false); ((Component)base.carHoodAnimator).gameObject.SetActive(false); base.backDoorContainer.SetActive(false); base.headlightsContainer.SetActive(false); sideLightsContainer.SetActive(false); base.backLightsContainer.SetActive(false); } private void EnableObjectsOnDestroy() { for (int i = 0; i < enableOnDestroy.Length; i++) { if (!enableOnDestroy[i].activeSelf) { enableOnDestroy[i].SetActive(true); } } } private void SetExplosionForce(float forceMultiplier, Vector3 explosionPos) { //IL_0013: 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_001e: 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) base.mainRigidbody.ResetCenterOfMass(); base.mainRigidbody.AddForceAtPosition(Vector3.up * forceMultiplier, explosionPos - Vector3.up, (ForceMode)1); } private void DisableIgnition() { CancelIgnitionCoroutine(); SetFrontCabinLightOn(setOn: false); base.ignitionStarted = false; if (base.carExhaustParticle.isEmitting) { base.carExhaustParticle.Stop(true, (ParticleSystemStopBehavior)1); } base.keyIsInIgnition = false; base.keyIsInDriverHand = false; twistingKey = false; } private void DisableDrivetrain() { base.EngineRPM = 0f; frontWheelRPM = 0f; backWheelRPM = 0f; wheelRPM = 0f; currentGear = 1; } private void ResetControl() { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: 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_002b: Unknown result type (might be due to invalid IL or missing references) base.steeringAnimValue = 0f; base.drivePedalPressed = false; base.brakePedalPressed = false; base.moveInputVector = Vector2.zero; syncedMoveInputVector = Vector2.zero; } private void KillOccupants() { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //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_0037: 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_0049: Unknown result type (might be due to invalid IL or missing references) if (VehicleUtils.IsPlayerSeatedInVan()) { GameNetworkManager.Instance.localPlayerController.KillPlayer(Vector3.up * 27f + 20f * Random.insideUnitSphere, true, (CauseOfDeath)3, 6, Vector3.up * 1.5f, false); } } private void SetInteractions() { InteractTrigger[] componentsInChildren = ((Component)this).gameObject.GetComponentsInChildren(); for (int i = 0; i < componentsInChildren.Length; i++) { componentsInChildren[i].interactable = false; componentsInChildren[i].CancelAnimationExternally(); } pushTruckTrigger.interactable = true; } private void ResetOccupants() { base.currentDriver = null; currentMiddlePassenger = null; base.currentPassenger = null; } public void RemoveRainCollision() { //IL_009d: 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_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Expected O, but got Unknown ParticleSystem[] array = (ParticleSystem[])(object)new ParticleSystem[13] { References.rainParticles, References.rainHitParticles, References.stormyRainParticles, References.stormyRainHitParticles, References.wesleyHurricaneRainParticles, References.wesleyHurricaneRainHitParticles, References.wesleyHurricaneSandParticles, References.wesleyForsakenRainParticles, References.wesleyForsakenRainHitParticles, References.kenjiAcidRainParticles, References.kenjiAcidRainHitParticles, References.kenjiAcidStormyRainParticles, References.kenjiAcidStormyRainHitParticles }; ParticleSystem[] array2 = array; foreach (ParticleSystem val in array2) { if ((Object)(object)val == (Object)null) { Plugin.LogDebug("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 / 15f; clutchFriction = Mathf.Clamp(clutchFriction, 0.4f, 1f); } else { clutchFriction = 1f; } if (!((NetworkBehaviour)this).IsOwner) { return; } if (base.carHP < 9 && Time.realtimeSinceStartup - base.timeAtLastDamage > 8f) { base.timeAtLastDamage = Time.realtimeSinceStartup; base.carHP++; syncedCarHP = base.carHP; SyncCarHealthRpc(base.carHP); } if (base.carHP < 6) { if (!base.isHoodOnFire) { SetHoodFireAndSync(setOnFire: true); } } else if (base.isHoodOnFire) { SetHoodFireAndSync(setOnFire: false); } } [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 val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(827845429u, val3, val, (SendTo)1, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, carHealth); ((NetworkBehaviour)this).__endSendRpc(ref val2, 827845429u, val3, 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 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 val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(23543307u, val3, val, (SendTo)1, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref underStress, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val2, 23543307u, val3, 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; } } } private void SetHoodFireAndSync(bool setOnFire) { SetHoodOnFireLocalClient(setOnFire); SetHoodOnFireRpc(setOnFire); } [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) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(3637472327u, val3, val, (SendTo)1, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref onFire, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val2, 3637472327u, val3, val, (SendTo)1, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; SetHoodOnFireLocalClient(onFire); } } } private void SetHoodOnFireLocalClient(bool setOnFire) { base.isHoodOnFire = setOnFire; if (setOnFire) { base.hoodFireAudio.Play(); base.hoodFireParticle.Play(); if (!base.carHoodOpen && !base.carDestroyed) { SetHoodOpenLocalClient(setOpen: true); } } else { base.hoodFireAudio.Stop(); base.hoodFireParticle.Stop(true, (ParticleSystemStopBehavior)1); } } public void ToggleHoodOpenLocalClient() { base.carHoodOpen = !base.carHoodOpen; base.carHoodAnimator.SetBool("hoodOpen", base.carHoodOpen); SetHoodOpenRpc(base.carHoodOpen); } public void SetHoodOpenLocalClient(bool setOpen) { if (!base.carHoodOpen || base.carHoodOpen != setOpen) { base.carHoodOpen = setOpen; base.carHoodAnimator.SetBool("hoodOpen", setOpen); } } [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) 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 val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(1570871273u, val3, val, (SendTo)5, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref open, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val2, 1570871273u, val3, val, (SendTo)5, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; base.carHoodOpen = open; base.carHoodAnimator.SetBool("hoodOpen", base.carHoodOpen); } } } public void PushTruckWithArms() { //IL_0026: 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_00b8: 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_00d2: 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_00de: 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_00f0: 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_01a9: 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_0139: 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_0144: 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_0163: 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_017e: Unknown result type (might be due to invalid IL or missing references) //IL_0189: Unknown result type (might be due to invalid IL or missing references) //IL_018e: 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) 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; tempPushTransform.position = point; Vector3 localPosition = tempPushTransform.localPosition; int clip = Random.Range(0, base.minCollisions.Length); float turbulence = Mathf.Min(base.turbulenceAmount + 0.5f, 2f); if (((NetworkBehaviour)this).IsOwner) { PlayPushAudio(localPosition, clip, turbulence); base.mainRigidbody.AddForceAtPosition(Vector3.Normalize(forward * 1000f) * Random.Range(40f, 50f) * base.pushForceMultiplier, tempPushTransform.position - ((Component)base.mainRigidbody).transform.up * base.pushVerticalOffsetAmount, (ForceMode)1); PushTruckFromOwnerRpc(localPosition, clip, turbulence); } else { PushTruckRpc(localPosition, forward, clip, turbulence); } } } [Rpc(/*Could not decode attribute arguments.*/)] public void PushTruckRpc(Vector3 pushPosition, Vector3 dir, int clip, float turbulence) { //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_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_00fc: 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_0124: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_012f: 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_014e: Unknown result type (might be due to invalid IL or missing references) //IL_0159: 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_0174: 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) 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 val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(565346060u, val3, val, (SendTo)6, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref pushPosition); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref dir); BytePacker.WriteValueBitPacked(val2, clip); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref turbulence, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val2, 565346060u, val3, val, (SendTo)6, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; PlayPushAudio(pushPosition, clip, turbulence); if (((NetworkBehaviour)this).IsOwner) { tempPushTransform.localPosition = pushPosition; base.mainRigidbody.AddForceAtPosition(Vector3.Normalize(dir * 1000f) * Random.Range(40f, 50f) * base.pushForceMultiplier, tempPushTransform.position - ((Component)base.mainRigidbody).transform.up * base.pushVerticalOffsetAmount, (ForceMode)1); } } } [Rpc(/*Could not decode attribute arguments.*/)] public void PushTruckFromOwnerRpc(Vector3 pushPosition, int clip, float turbulence) { //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_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_0075: 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_0094: 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_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 = default(RpcAttributeParams); RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(3478470034u, val3, val, (SendTo)1, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref pushPosition); BytePacker.WriteValueBitPacked(val2, clip); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref turbulence, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val2, 3478470034u, val3, val, (SendTo)1, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; PlayPushAudio(pushPosition, clip, turbulence); } } } public void PlayPushAudio(Vector3 pos, int clip, float turbulence) { //IL_0020: Unknown result type (might be due to invalid IL or missing references) base.pushAudio.clip = base.minCollisions[clip]; ((Component)base.pushAudio).transform.localPosition = pos; base.pushAudio.Play(); base.turbulenceAmount = turbulence; } 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 (vanAlarmCoroutine == 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 val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(26954103u, val3, val, (SendTo)5, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref warningsOn, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val2, 26954103u, val3, val, (SendTo)5, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; hazardsOn = warningsOn; if (vanAlarmCoroutine == 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 val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(2382088157u, val3, val, (SendTo)5, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref setLowBeamsOn, default(ForPrimitives)); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref setHighBeamsOn, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val2, 2382088157u, val3, 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 ((NetworkBehaviour)this).__registerRpc(4283610501u, new RpcReceiveHandler(__rpc_handler_4283610501), "SetSpecialVariantRpc"); ((NetworkBehaviour)this).__registerRpc(2934651884u, new RpcReceiveHandler(__rpc_handler_2934651884), "InitializeVanRpc"); ((NetworkBehaviour)this).__registerRpc(1322991716u, new RpcReceiveHandler(__rpc_handler_1322991716), "SyncClientDataRpc"); ((NetworkBehaviour)this).__registerRpc(1187453226u, new RpcReceiveHandler(__rpc_handler_1187453226), "SetCabinLightSwitchOwnerRpc"); ((NetworkBehaviour)this).__registerRpc(396020993u, new RpcReceiveHandler(__rpc_handler_396020993), "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(191059047u, new RpcReceiveHandler(__rpc_handler_191059047), "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(39759947u, new RpcReceiveHandler(__rpc_handler_39759947), "CancelSetPlayerInVehicleRpc"); ((NetworkBehaviour)this).__registerRpc(1669503344u, new RpcReceiveHandler(__rpc_handler_1669503344), "SetDriverInVehicleServerRpc"); ((NetworkBehaviour)this).__registerRpc(829536932u, new RpcReceiveHandler(__rpc_handler_829536932), "SetDriverInVehicleOwnerRpc"); ((NetworkBehaviour)this).__registerRpc(2597680848u, new RpcReceiveHandler(__rpc_handler_2597680848), "SetDriverInVehicleNotOwnerRpc"); ((NetworkBehaviour)this).__registerRpc(4013101331u, new RpcReceiveHandler(__rpc_handler_4013101331), "OnDriverExitVehicleServerRpc"); ((NetworkBehaviour)this).__registerRpc(4270035134u, new RpcReceiveHandler(__rpc_handler_4270035134), "OnDriverExitVehicleRpc"); ((NetworkBehaviour)this).__registerRpc(1015725535u, new RpcReceiveHandler(__rpc_handler_1015725535), "SetMiddlePassengerInVehicleServerRpc"); ((NetworkBehaviour)this).__registerRpc(3837509662u, new RpcReceiveHandler(__rpc_handler_3837509662), "SetMiddlePassengerInVehicleRpc"); ((NetworkBehaviour)this).__registerRpc(1197815956u, new RpcReceiveHandler(__rpc_handler_1197815956), "OnMiddlePassengerExitVehicleRpc"); ((NetworkBehaviour)this).__registerRpc(3853468369u, new RpcReceiveHandler(__rpc_handler_3853468369), "SetPassengerInVehicleServerRpc"); ((NetworkBehaviour)this).__registerRpc(2038294352u, new RpcReceiveHandler(__rpc_handler_2038294352), "SetPassengerInVehicleRpc"); ((NetworkBehaviour)this).__registerRpc(1439394877u, new RpcReceiveHandler(__rpc_handler_1439394877), "OnPassengerExitVehicleRpc"); ((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(3475323633u, new RpcReceiveHandler(__rpc_handler_3475323633), "SetHeaterFanSpeedRpc"); ((NetworkBehaviour)this).__registerRpc(1374575140u, new RpcReceiveHandler(__rpc_handler_1374575140), "SetHeaterDirectionRpc"); ((NetworkBehaviour)this).__registerRpc(2821576097u, new RpcReceiveHandler(__rpc_handler_2821576097), "UseTurboBoostRpc"); ((NetworkBehaviour)this).__registerRpc(500051534u, new RpcReceiveHandler(__rpc_handler_500051534), "SetHonkRpc"); ((NetworkBehaviour)this).__registerRpc(3102248458u, new RpcReceiveHandler(__rpc_handler_3102248458), "SyncPlayerVehicleAnimationsRpc"); ((NetworkBehaviour)this).__registerRpc(3263666580u, new RpcReceiveHandler(__rpc_handler_3263666580), "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(3539121039u, new RpcReceiveHandler(__rpc_handler_3539121039), "SyncDrivetrainRpc"); ((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(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(23543307u, new RpcReceiveHandler(__rpc_handler_23543307), "SyncExtremeStressRpc"); ((NetworkBehaviour)this).__registerRpc(3637472327u, new RpcReceiveHandler(__rpc_handler_3637472327), "SetHoodOnFireRpc"); ((NetworkBehaviour)this).__registerRpc(1570871273u, new RpcReceiveHandler(__rpc_handler_1570871273), "SetHoodOpenRpc"); ((NetworkBehaviour)this).__registerRpc(565346060u, new RpcReceiveHandler(__rpc_handler_565346060), "PushTruckRpc"); ((NetworkBehaviour)this).__registerRpc(3478470034u, new RpcReceiveHandler(__rpc_handler_3478470034), "PushTruckFromOwnerRpc"); ((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_2934651884(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 serviceAlert = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref serviceAlert); bool useAlt = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref useAlt, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((CruiserXLController)(object)target).InitializeVanRpc(serviceAlert, useAlt); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1322991716(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 carHealth = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref carHealth); float wheelRot = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref wheelRot, default(ForPrimitives)); bool setStarted = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref setStarted, default(ForPrimitives)); bool isJenson = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref isJenson, default(ForPrimitives)); int serviceAlert = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref serviceAlert); bool useAltVoices = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref useAltVoices, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((CruiserXLController)(object)target).SyncClientDataRpc(carHealth, wheelRot, setStarted, isJenson, serviceAlert, useAltVoices); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1187453226(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).SetCabinLightSwitchOwnerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_396020993(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_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: 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)); bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag, default(ForPrimitives)); string setMessage = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref setMessage, false); } target.__rpc_exec_stage = (__RpcExecStage)1; ((CruiserXLController)(object)target).SetCabinLightSwitchRpc(switchState, cabLightOn, setOverride, setMessage); 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 cabLightActive = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref cabLightActive, 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, cabLightActive, 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_191059047(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_0081: 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_00be: 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 isIgnitionOn = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref isIgnitionOn, default(ForPrimitives)); int playerAnimIndex = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerAnimIndex); int ignitionAnimIndex = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref ignitionAnimIndex); target.__rpc_exec_stage = (__RpcExecStage)1; ((CruiserXLController)(object)target).CancelTryIgnitionRpc(setKeyInSlot, cabinLightOn, isIgnitionOn, playerAnimIndex, ignitionAnimIndex); 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_39759947(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).CancelSetPlayerInVehicleRpc(playerId); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1669503344(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_0031: 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_0040: 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) { int playerId = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerId); RpcParams ext = rpcParams.Ext; target.__rpc_exec_stage = (__RpcExecStage)1; ((CruiserXLController)(object)target).SetDriverInVehicleServerRpc(playerId, ext); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_829536932(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).SetDriverInVehicleOwnerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2597680848(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_0094: 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) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerId = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerId); bool isIgnitionOn = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref isIgnitionOn, default(ForPrimitives)); bool setKeyInSlot = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref setKeyInSlot, default(ForPrimitives)); bool setStarted = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref setStarted, default(ForPrimitives)); int playerAnimIndex = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerAnimIndex); target.__rpc_exec_stage = (__RpcExecStage)1; ((CruiserXLController)(object)target).SetDriverInVehicleNotOwnerRpc(playerId, isIgnitionOn, setKeyInSlot, setStarted, playerAnimIndex); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_4013101331(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 isIgnitionOn = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref isIgnitionOn, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((CruiserXLController)(object)target).OnDriverExitVehicleServerRpc(playerId, carLocation, carRotation, setIgnitionState, setKeyInSlot, cabinLightOn, isIgnitionOn); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_4270035134(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 isIgnitionOn = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref isIgnitionOn, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((CruiserXLController)(object)target).OnDriverExitVehicleRpc(playerId, carLocation, carRotation, setIgnitionState, setKeyInSlot, cabinLightOn, isIgnitionOn); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1015725535(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 middlePassengerInVehicleServerRpc = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref middlePassengerInVehicleServerRpc); target.__rpc_exec_stage = (__RpcExecStage)1; ((CruiserXLController)(object)target).SetMiddlePassengerInVehicleServerRpc(middlePassengerInVehicleServerRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3837509662(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 middlePassengerInVehicleRpc = default(NetworkBehaviourReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref middlePassengerInVehicleRpc, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)1; ((CruiserXLController)(object)target).SetMiddlePassengerInVehicleRpc(middlePassengerInVehicleRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1197815956(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_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_0060: 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) { NetworkBehaviourReference playerNetObjRef = default(NetworkBehaviourReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref playerNetObjRef, default(ForNetworkSerializable)); Vector3 exitPoint = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref exitPoint); target.__rpc_exec_stage = (__RpcExecStage)1; ((CruiserXLController)(object)target).OnMiddlePassengerExitVehicleRpc(playerNetObjRef, exitPoint); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3853468369(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 passengerInVehicleServerRpc = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref passengerInVehicleServerRpc); target.__rpc_exec_stage = (__RpcExecStage)1; ((CruiserXLController)(object)target).SetPassengerInVehicleServerRpc(passengerInVehicleServerRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2038294352(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 passengerInVehicleRpc = default(NetworkBehaviourReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref passengerInVehicleRpc, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)1; ((CruiserXLController)(object)target).SetPassengerInVehicleRpc(passengerInVehicleRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1439394877(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_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_0060: 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) { NetworkBehaviourReference playerNetObjRef = default(NetworkBehaviourReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref playerNetObjRef, default(ForNetworkSerializable)); Vector3 exitPoint = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref exitPoint); target.__rpc_exec_stage = (__RpcExecStage)1; ((CruiserXLController)(object)target).OnPassengerExitVehicleRpc(playerNetObjRef, exitPoint); 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_3475323633(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 heaterFanSpeedRpc = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref heaterFanSpeedRpc); target.__rpc_exec_stage = (__RpcExecStage)1; ((CruiserXLController)(object)target).SetHeaterFanSpeedRpc(heaterFanSpeedRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1374575140(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 heaterDirectionRpc = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref heaterDirectionRpc); 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_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_3263666580(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 songTime = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref songTime, default(ForPrimitives)); float syncedTime = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref syncedTime, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((CruiserXLController)(object)target).SyncRadioTimeRpc(songTime, syncedTime); 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 flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag, default(ForPrimitives)); int currentClip = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref currentClip); float num = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref num, default(ForPrimitives)); float lastRadioTime = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref lastRadioTime, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((CruiserXLController)(object)target).SetRadioRpc(flag, currentClip, num, 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_3539121039(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).SyncDrivetrainRpc(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_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_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_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_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_565346060(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //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_007a: 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 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); float turbulence = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref turbulence, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((CruiserXLController)(object)target).PushTruckRpc(pushPosition, dir, clip, turbulence); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3478470034(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //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_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_0080: 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); int clip = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref clip); float turbulence = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref turbulence, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((CruiserXLController)(object)target).PushTruckFromOwnerRpc(pushPosition, clip, turbulence); 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, BrakeFluidLow } public enum VoiceAlertPriority { None, Low, DoorAlert, Medium, IsIgnition, IsService, Override, IsImportant } namespace ScanVan { [BepInPlugin("scandal.scanvan", "ScanVan", "1.8.10")] [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.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] public class Plugin : BaseUnityPlugin { internal static VehicleControls VehicleControlsInstance; internal static bool initialized; public static Plugin Instance { get; private set; } internal static ManualLogSource Logger { get; private set; } internal static Harmony? Harmony { get; set; } public void Awake() { if (!initialized) { initialized = true; Logger = ((BaseUnityPlugin)this).Logger; Instance = this; VehicleControlsInstance = new VehicleControls(); UserConfig.InitConfig(); NetworkVariableInitalizer.Init(); Patch(); RadioManager.PreloadStations(); LogInfo("scandal.scanvan v1.8.10 has loaded!"); } } 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"); } LogDebug("Patching..."); CompatibilityUtils.Init(Harmony); Harmony.PatchAll(typeof(ScandalsTweaksPatches)); Harmony.PatchAll(typeof(BaboonBirdAIPatches)); Harmony.PatchAll(typeof(CadaverGrowthAIPatches)); Harmony.PatchAll(typeof(ForestGiantAIPatches)); Harmony.PatchAll(typeof(GiantKiwiAIPatches)); Harmony.PatchAll(typeof(MaskedPlayerEnemyPatches)); Harmony.PatchAll(typeof(MouthDogAIPatches)); Harmony.PatchAll(typeof(PumaAIPatches)); Harmony.PatchAll(typeof(RadMechAIPatches)); Harmony.PatchAll(typeof(RedLocustBeesPatches)); Harmony.PatchAll(typeof(SandWormAIPatches)); Harmony.PatchAll(typeof(ElevatorAnimationEventsPatches)); Harmony.PatchAll(typeof(GameNetworkManagerPatches)); Harmony.PatchAll(typeof(GrabbableObjectPatches)); Harmony.PatchAll(typeof(HUDManagerPatches)); Harmony.PatchAll(typeof(LandminePatches)); Harmony.PatchAll(typeof(PlayerControllerBPatches)); Harmony.PatchAll(typeof(StartOfRoundPatches)); Harmony.PatchAll(typeof(VehicleControllerPatches)); LogDebug("Finished patching!"); } internal static void Unpatch() { LogDebug("Unpatching..."); Harmony? harmony = Harmony; if (harmony != null) { harmony.UnpatchSelf(); } LogDebug("Finished unpatching!"); } [MethodImpl(MethodImplOptions.AggressiveInlining)] internal static void LogMessage(string messageLog) { Logger.LogMessage((object)messageLog); } [MethodImpl(MethodImplOptions.AggressiveInlining)] internal static void LogDebug(string debugLog) { Logger.LogDebug((object)debugLog); } [MethodImpl(MethodImplOptions.AggressiveInlining)] internal static void LogInfo(string infoLog) { Logger.LogInfo((object)infoLog); } [MethodImpl(MethodImplOptions.AggressiveInlining)] internal static void LogWarning(string warningLog) { Logger.LogWarning((object)warningLog); } [MethodImpl(MethodImplOptions.AggressiveInlining)] internal static void LogError(string errorLog) { Logger.LogError((object)errorLog); } } public static class MyPluginInfo { public const string PLUGIN_GUID = "scandal.scanvan"; public const string PLUGIN_NAME = "ScanVan"; public const string PLUGIN_VERSION = "1.8.10"; } } 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; } } internal static class CompatibilityUtils { internal const string GUID_LETHAL_LEVEL_LOADER = "imabatby.lethallevelloader"; internal const string GUID_SCANDALLIB = "scandal.scandallib"; internal const string GUID_SCANDALS_TWEAKS = "scandal.scandalstweaks"; internal const string GUID_INPUT_UTILS = "com.rune580.LethalCompanyInputUtils"; internal const string GUID_LETHALELEMENTS = "voxx.LethalElementsPlugin"; internal const string GUID_LETHALMIN = "NoteBoxz.LethalMin"; internal const string GUID_IMMERSIVE_VISOR = "ImmersiveVisor"; internal const string GUID_FIRST_PERSON_VIEW = "com.seeya.firstpersonview"; internal static bool INSTALLED_LETHALELEMENTS; internal static bool INSTALLED_LETHALMIN; internal static bool INSTALLED_IMMERSIVE_VISOR; internal static bool INSTALLED_FIRST_PERSON_VIEW; internal static void Init(Harmony harmony) { if (Chainloader.PluginInfos.ContainsKey("voxx.LethalElementsPlugin")) { INSTALLED_LETHALELEMENTS = true; harmony.PatchAll(typeof(LethalElementsCompatibility)); Plugin.LogDebug("CROSS-COMPATIBILITY - LethalElements detected."); } if (Chainloader.PluginInfos.ContainsKey("NoteBoxz.LethalMin")) { INSTALLED_LETHALMIN = true; harmony.PatchAll(typeof(LethalMinCompatibility)); Plugin.LogDebug("CROSS-COMPATIBILITY - LethalMin detected."); } if (Chainloader.PluginInfos.ContainsKey("ImmersiveVisor")) { INSTALLED_IMMERSIVE_VISOR = true; harmony.PatchAll(typeof(ImmersiveVisorCompatibility)); Plugin.LogDebug("CROSS-COMPATIBILITY - ImmersiveVisor detected."); } if (Chainloader.PluginInfos.ContainsKey("com.seeya.firstpersonview")) { INSTALLED_FIRST_PERSON_VIEW = true; harmony.PatchAll(typeof(FirstPersonViewCompatibility)); Plugin.LogDebug("CROSS-COMPATIBILITY - FirstPersonView detected."); } } } public static class References { internal static CadaverGrowthAI cadaverGrowthAI = null; internal static HashSet itemsInTruck = new HashSet(); } 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 MirrorsEnabled; 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", "Public-Domain Music", true, "[Host] If true, the radio will only be able to play vintage public-domain music"); MirrorsEnabled = config.Bind("General", "Enable Mirrors", true, "Enable rendering for the side mirrors? (may impact performance for low end hardware)"); 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 BrakePedalKey { 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 { internal static CruiserXLController vanController; internal static bool isSeatedInVan; public static bool IsEnemyInVan(EnemyAI enemyScript, CruiserXLController vanController) { //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)vanController.collisionTrigger.insideTruckNavMeshBounds).ClosestPoint(((Component)enemyScript).transform.position) == ((Component)enemyScript).transform.position || ((Collider)vanController.collisionTrigger.insideTruckNavMeshBounds).ClosestPoint(enemyScript.agent.destination) == enemyScript.agent.destination) { return true; } return false; } public static bool IsPlayerInVanBounds(CruiserXLController vanController) { return vanController.vanZone.playerInZone; } public static bool IsPlayerInVanCabin(CruiserXLController vanController) { return vanController.vanCabinZone.playerInZone; } public static bool IsPlayerInVanStorage(CruiserXLController vanController) { return vanController.vanStorageZone.playerInZone; } public static bool IsPlayerSeatedInVan() { return isSeatedInVan; } public static bool IsSeatedPlayerProtected(PlayerControllerB playerController, CruiserXLController vanController, bool checkWindows = false, bool windshieldCheck = false, bool velocityCheck = false, float velocityMagnitude = 0f) { float magnitude = ((Vector3)(ref ((VehicleController)vanController).averageVelocity)).magnitude; if (velocityCheck && magnitude > velocityMagnitude) { return true; } bool windshieldBroken = ((VehicleController)vanController).windshieldBroken; if (windshieldCheck && windshieldBroken) { return false; } bool flag = ((VehicleController)vanController).driverSideDoor.boolValue || (checkWindows && vanController.frontLeftWindow.isWindowOpen); bool flag2 = ((VehicleController)vanController).passengerSideDoor.boolValue || (checkWindows && vanController.frontRightWindow.isWindowOpen); if (((Object)(object)playerController == (Object)(object)((VehicleController)vanController).currentDriver && flag) || ((Object)(object)playerController == (Object)(object)vanController.currentMiddlePassenger && (flag || flag2)) || ((Object)(object)playerController == (Object)(object)((VehicleController)vanController).currentPassenger && flag2)) { return false; } return true; } public static bool IsPlayerProtectedByVan(PlayerControllerB playerController, CruiserXLController vanController, bool checkWindows = false, bool windshieldCheck = false, bool velocityCheck = false, float velocityMagnitude = 0f) { if (((VehicleController)vanController).carDestroyed) { return false; } float magnitude = ((Vector3)(ref ((VehicleController)vanController).averageVelocity)).magnitude; if (velocityCheck && magnitude > velocityMagnitude) { return true; } bool windshieldBroken = ((VehicleController)vanController).windshieldBroken; bool flag = ((VehicleController)vanController).driverSideDoor.boolValue || ((VehicleController)vanController).passengerSideDoor.boolValue; bool flag2 = vanController.frontLeftWindow.isWindowOpen || vanController.frontRightWindow.isWindowOpen; bool liftGateOpen = vanController.liftGateOpen; bool sideDoorOpen = vanController.sideDoorOpen; if ((IsPlayerInVanCabin(vanController) && flag) || (checkWindows && flag2) || (windshieldCheck && windshieldBroken)) { return false; } if (IsPlayerInVanStorage(vanController) && (liftGateOpen || sideDoorOpen)) { return false; } if (IsPlayerInVanBounds(vanController) && !IsPlayerInVanCabin(vanController) && !IsPlayerInVanStorage(vanController)) { return false; } return true; } public static bool IsPlayerNearVan(PlayerControllerB playerController, CruiserXLController vanController) { //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)vanController).mainRigidbody.position; Vector3 position2 = ((Component)playerController).transform.position; if (Vector3.Distance(position2, position) > 10f) { return false; } return true; } } } namespace ScanVan.Scripts { public class VanPhysicsRegion : PlayerPhysicsRegion { public CruiserXLController vanController = null; private float playerInsideInterval; private bool playerInsideThisFrame; private bool addedRegionToList; public bool playerInZone; public bool isRegionActive; public bool parentPlayerBodies; public void OnDestroy() { //IL_0183: Unknown result type (might be due to invalid IL or missing references) //IL_0189: Unknown result type (might be due to invalid IL or missing references) base.disablePhysicsRegion = true; if (StartOfRound.Instance.CurrentPlayerPhysicsRegions.Contains((PlayerPhysicsRegion)(object)this)) { StartOfRound.Instance.CurrentPlayerPhysicsRegions.Remove((PlayerPhysicsRegion)(object)this); } for (int i = 0; i < StartOfRound.Instance?.allPlayerScripts.Length; i++) { PlayerControllerB val = StartOfRound.Instance.allPlayerScripts[i]; if ((Object)(object)((Component)val).transform.parent == (Object)(object)base.physicsTransform) { Transform parent = (val.isInElevator ? val.playersManager.elevatorTransform : val.playersManager.playersContainer); ((Component)val).transform.SetParent(parent); Plugin.LogDebug($"ScanVan: Player {i} setting parent since physics region was destroyed."); } } if (!base.allowDroppingItems || (Object)(object)base.itemDropCollider == (Object)null) { return; } GrabbableObject[] componentsInChildren = ((Component)base.physicsTransform).GetComponentsInChildren(); for (int j = 0; j < componentsInChildren.Length; j++) { if ((Object)(object)RoundManager.Instance.mapPropsContainer != (Object)null) { ((Component)componentsInChildren[j]).transform.SetParent(RoundManager.Instance.mapPropsContainer.transform, true); } else { ((Component)componentsInChildren[j]).transform.SetParent((Transform)null, true); } if (!componentsInChildren[j].isHeld) { componentsInChildren[j].FallToGround(false, false, default(Vector3)); } } } public void OnTriggerStay(Collider other) { if (base.disablePhysicsRegion) { return; } PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController; if ((Object)(object)localPlayerController == (Object)null) { base.hasLocalPlayer = false; playerInZone = false; return; } string tag = ((Component)other).gameObject.tag; if (parentPlayerBodies && tag.StartsWith("PlayerRagdoll")) { PlayerControllerB val = null; DeadBodyInfo val2 = default(DeadBodyInfo); if (((Component)other).gameObject.TryGetComponent(ref val2)) { val = val2.playerScript; } if ((Object)(object)val != (Object)null && (Object)(object)val.deadBody != (Object)null && !val.deadBody.isParentedToPhysicsRegion) { val.deadBody.SetPhysicsParent(base.physicsTransform, base.physicsCollider); } } else if (((Component)other).gameObject.CompareTag("Player") && !((Object)(object)((Component)other).gameObject != (Object)(object)((Component)localPlayerController).gameObject)) { playerInsideThisFrame = true; playerInsideInterval = 0f; } } public void SetPhysicsRegionActive() { if (!isRegionActive) { if (addedRegionToList) { TryRemovePhysicsRegionFromList(); } } else { base.checkInterval = 0f; base.removePlayerNextFrame = false; TryAddPhysicsRegionToList(); } } public void SetPlayerZoneActive() { playerInZone = true; } public bool IsPhysicsRegionActive() { //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) return Vector3.Angle(((Component)this).transform.up, Vector3.up) <= base.maxTippingAngle && !base.disablePhysicsRegion; } public void TryRemovePhysicsRegionFromList() { StartOfRound.Instance?.CurrentPlayerPhysicsRegions?.Remove((PlayerPhysicsRegion)(object)this); addedRegionToList = false; base.hasLocalPlayer = false; base.removePlayerNextFrame = false; base.checkInterval = 0f; } public void TryAddPhysicsRegionToList() { if (!addedRegionToList && isRegionActive && StartOfRound.Instance.CurrentPlayerPhysicsRegions != null && !StartOfRound.Instance.CurrentPlayerPhysicsRegions.Contains((PlayerPhysicsRegion)(object)this)) { StartOfRound.Instance.CurrentPlayerPhysicsRegions.Add((PlayerPhysicsRegion)(object)this); addedRegionToList = true; base.hasLocalPlayer = true; } } public void Update() { if (base.disablePhysicsRegion) { base.physicsCollider.enabled = false; return; } isRegionActive = IsPhysicsRegionActive(); UpdatePhysicsRegion(); SetPhysicsRegionAndZone(ref base.checkInterval, ref base.removePlayerNextFrame, ref base.hasLocalPlayer, removeFromPhysicsList: true); } public void UpdatePhysicsRegion() { if (!playerInsideThisFrame) { if (playerInZone) { playerInZone = false; } return; } if (playerInsideThisFrame) { SetPhysicsRegionActive(); SetPlayerZoneActive(); } if (playerInsideInterval <= 0.15f) { playerInsideInterval += Time.deltaTime; return; } playerInsideThisFrame = false; playerInsideInterval = 0f; } public void SetPhysicsRegionAndZone(ref float interval, ref bool removeNextFrame, ref bool hasPlayer, bool removeFromPhysicsList = false) { if (!hasPlayer) { return; } if (interval <= 0.15f) { interval += Time.deltaTime; return; } if (!removeNextFrame) { removeNextFrame = true; return; } removeNextFrame = false; interval = 0f; hasPlayer = false; if (removeFromPhysicsList) { TryRemovePhysicsRegionFromList(); } } } public class VanPlayerZone : MonoBehaviour { public CruiserXLController vanController = null; public Transform physicsTransform = null; public Collider physicsCollider = null; private float playerInsideInterval; private bool playerInsideThisFrame; private bool removePlayerFromZoneNextFrame; private float checkZoneInterval; public bool unsetInZoneWhileSeated; public bool setInZoneWhileSeated; public bool playerInZone; public bool disableZone; public void OnEnable() { if (setInZoneWhileSeated && unsetInZoneWhileSeated) { Plugin.Logger.LogWarning((object)"ScanVan: 'Set in zone' and 'Unset in zone' are set simulteanously! this will cause issues!"); Plugin.Logger.LogWarning((object)"ScanVan: Fallback to set behaviour 'Set zone --> not seated'"); setInZoneWhileSeated = false; unsetInZoneWhileSeated = true; } else if (!setInZoneWhileSeated && !unsetInZoneWhileSeated) { Plugin.Logger.LogWarning((object)"ScanVan: 'Set in zone' and 'Unset in zone' are unset simulteanously! this will cause issues!"); Plugin.Logger.LogWarning((object)"ScanVan: Fallback to set behaviour 'Set zone --> not seated'"); setInZoneWhileSeated = false; unsetInZoneWhileSeated = true; } } public void OnDestroy() { disableZone = true; } public void OnTriggerStay(Collider other) { if (!disableZone) { PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController; if (!((Object)(object)localPlayerController == (Object)null) && ((Component)other).gameObject.CompareTag("Player") && !((Object)(object)((Component)other).gameObject != (Object)(object)((Component)localPlayerController).gameObject)) { playerInsideThisFrame = true; playerInsideInterval = 0f; } } } public void Update() { if (disableZone) { physicsCollider.enabled = false; } else if (VehicleUtils.IsPlayerSeatedInVan()) { if (setInZoneWhileSeated) { playerInZone = true; } else if (unsetInZoneWhileSeated) { playerInZone = false; } removePlayerFromZoneNextFrame = false; checkZoneInterval = 0f; } else { UpdatePlayerZone(); SetPlayerZone(ref checkZoneInterval, ref removePlayerFromZoneNextFrame, ref playerInZone); } } public void UpdatePlayerZone() { if (playerInsideThisFrame) { if (playerInsideThisFrame) { SetPlayerZoneActive(); } if (playerInsideInterval <= 0.15f) { playerInsideInterval += Time.deltaTime; return; } playerInsideThisFrame = false; playerInsideInterval = 0f; } } private void SetPlayerZoneActive() { checkZoneInterval = 0f; removePlayerFromZoneNextFrame = false; playerInZone = true; } public void SetPlayerZone(ref float checkInterval, ref bool removeNextFrame, ref bool hasPlayer) { if (hasPlayer) { if (checkInterval <= 0.15f) { checkInterval += Time.deltaTime; return; } if (!removeNextFrame) { removeNextFrame = true; return; } removeNextFrame = false; checkInterval = 0f; hasPlayer = false; } } } public class VanSeatAnimator : VehicleSeatAnimator { public CruiserXLController vehicleController = null; public override void OnPlayerLeaveGame() { if ((Object)(object)base.seatTrigger == (Object)(object)((VehicleController)vehicleController).driverSeatTrigger) { vehicleController.OnDriverLeaveGameServerRpc((int)base.seatTrigger.playerScriptInSpecialAnimation.playerClientId); } else if ((Object)(object)base.seatTrigger == (Object)(object)vehicleController.middlePassengerSeatTrigger) { vehicleController.OnMiddlePassengerLeaveGameRpc((int)base.seatTrigger.playerScriptInSpecialAnimation.playerClientId); } else if ((Object)(object)base.seatTrigger == (Object)(object)((VehicleController)vehicleController).passengerSeatTrigger) { vehicleController.OnPassengerLeaveGameRpc((int)base.seatTrigger.playerScriptInSpecialAnimation.playerClientId); } } public override void ResetPlayerData(PlayerControllerB player) { player.ladderCameraHorizontal = 0f; } public override void SetPlayerSeated(bool setSeated, PlayerControllerB localPlayer) { VehicleUtils.isSeatedInVan = setSeated; } } public class VanWindow : MonoBehaviour { public CruiserXLController vanController = null; public AudioSource windowAudio = null; public AudioClip windowOpen = null; public AudioClip windowClose = null; public bool isWindowOpen; public void OnWindowOpen() { isWindowOpen = true; } public void OnWindowClose() { isWindowOpen = false; } public void PlayWindowOpenAudio() { if ((Object)(object)windowAudio == (Object)null) { Plugin.LogWarning("No window audio source set for " + ((Object)((Component)this).gameObject).name); } else if ((Object)(object)windowOpen == (Object)null || (Object)(object)windowClose == (Object)null) { Plugin.LogWarning("No window audio clips set for " + ((Object)((Component)this).gameObject).name); } else { windowAudio.PlayOneShot(windowOpen); } } public void PlayWindowCloseAudio() { if ((Object)(object)windowAudio == (Object)null) { Plugin.LogWarning("No window audio source set for " + ((Object)((Component)this).gameObject).name); } else if ((Object)(object)windowOpen == (Object)null || (Object)(object)windowClose == (Object)null) { Plugin.LogWarning("No window audio clips set for " + ((Object)((Component)this).gameObject).name); } else { windowAudio.PlayOneShot(windowClose); } } } } 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 AudioClip keysAlertAlt = 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 bool useAltAudio; 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[21] { new VoiceAlertDefinition { alertType = ElectronicVoiceAlert.WasherFluidLow, triggerCondition = () => controller.ignitionOn && ignitionChimeFinished && randomServiceAlert == 19, resetCondition = () => !controller.ignitionOn || !ignitionChimeFinished, priority = VoiceAlertPriority.IsService }, new VoiceAlertDefinition { alertType = ElectronicVoiceAlert.DiskBrakePads, triggerCondition = () => controller.ignitionOn && ignitionChimeFinished && randomServiceAlert == 18, resetCondition = () => !controller.ignitionOn || !ignitionChimeFinished, priority = VoiceAlertPriority.IsService }, new VoiceAlertDefinition { alertType = ElectronicVoiceAlert.BrakeFluidLow, triggerCondition = () => controller.ignitionOn && ignitionChimeFinished && randomServiceAlert == 20, resetCondition = () => !controller.ignitionOn || !ignitionChimeFinished, priority = VoiceAlertPriority.IsService }, new VoiceAlertDefinition { alertType = ElectronicVoiceAlert.AllSystemsOk, triggerCondition = () => controller.ignitionOn && ignitionChimeFinished && !hasAlertedOnEngineStart && !audioIsPlaying && ((VehicleController)controller).carHP > 22, resetCondition = () => !controller.ignitionOn, 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.ignitionOn || isImportantAlert, priority = VoiceAlertPriority.Medium }, new VoiceAlertDefinition { alertType = ElectronicVoiceAlert.FuelLevel, triggerCondition = () => ((VehicleController)controller).carHP <= 38 && controller.ignitionOn, resetCondition = () => ((VehicleController)controller).carHP > 38 || !controller.ignitionOn || isImportantAlert, priority = VoiceAlertPriority.Low }, new VoiceAlertDefinition { alertType = ElectronicVoiceAlert.EngineCoolantLevel, triggerCondition = () => ((VehicleController)controller).carHP <= 30 && controller.ignitionOn, resetCondition = () => ((VehicleController)controller).carHP > 30 || !controller.ignitionOn || isImportantAlert, priority = VoiceAlertPriority.Low }, new VoiceAlertDefinition { alertType = ElectronicVoiceAlert.EngineOilLevel, triggerCondition = () => ((VehicleController)controller).carHP <= 25 && controller.ignitionOn, resetCondition = () => ((VehicleController)controller).carHP > 25 || !controller.ignitionOn || isImportantAlert, priority = VoiceAlertPriority.Low }, new VoiceAlertDefinition { alertType = ElectronicVoiceAlert.ChargeSysMalfunction, triggerCondition = () => ((VehicleController)controller).carHP <= 22 && controller.ignitionOn, resetCondition = () => ((VehicleController)controller).carHP > 22 || !controller.ignitionOn || isImportantAlert, priority = VoiceAlertPriority.Medium }, new VoiceAlertDefinition { alertType = ElectronicVoiceAlert.EngineOilPressure, triggerCondition = () => ((VehicleController)controller).carHP <= 16 && controller.ignitionOn, resetCondition = () => ((VehicleController)controller).carHP > 16 || !controller.ignitionOn || isImportantAlert, priority = VoiceAlertPriority.Low }, new VoiceAlertDefinition { alertType = ElectronicVoiceAlert.EngineTempAboveNormal, triggerCondition = () => ((VehicleController)controller).carHP <= 12 && randomOverheatClipToPlay == 15 && controller.ignitionOn, resetCondition = () => ((VehicleController)controller).carHP > 12 || !controller.ignitionOn || randomOverheatClipToPlay == 0 || isImportantAlert, priority = VoiceAlertPriority.Medium }, new VoiceAlertDefinition { alertType = ElectronicVoiceAlert.EngineOverheating, triggerCondition = () => ((VehicleController)controller).carHP <= 12 && randomOverheatClipToPlay == 16 && controller.ignitionOn, resetCondition = () => ((VehicleController)controller).carHP > 12 || !controller.ignitionOn || 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; } for (int i = 0; i < alerts.Length; i++) { VoiceAlertDefinition voiceAlertDefinition = alerts[i]; 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 ResetIgnitionOnStart() { isPlayingIgnitionChime = false; ignitionChimeStarted = false; hasAlertedOnEngineStart = false; isPlayingOnEngineStart = false; } public void SetIgnitionClips() { if (isImportantAlert && isKeysForgotten && !((VehicleController)controller).headlightsContainer.activeSelf && !((VehicleController)controller).keyIsInIgnition) { isImportantAlert = false; isKeysForgotten = false; ResetAudioClip(ElectronicVoiceAlert.HeadlampsOn); ResetAudioClip(ElectronicVoiceAlert.KeyInIgnition); SetThankYouClip(!controller.ignitionOn); return; } if (currentClipId != 2) { if ((!isImportantAlert || !isKeysForgotten) && ((VehicleController)controller).driverSideDoor.boolValue && (Object)(object)((VehicleController)controller).currentDriver == (Object)null && ((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 && (Object)(object)((VehicleController)controller).currentDriver == (Object)null && ((VehicleController)controller).headlightsContainer.activeSelf) { isImportantAlert = true; SetImportantAlert(5, 1); return; } if (!isKeysForgotten && ((VehicleController)controller).keyIsInIgnition && ((VehicleController)controller).driverSideDoor.boolValue && (Object)(object)((VehicleController)controller).currentDriver == (Object)null && !((VehicleController)controller).ignitionStarted) { 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(!controller.ignitionOn); return; } if (isKeysForgotten && !((VehicleController)controller).keyIsInIgnition && currentClipId != 2) { isKeysForgotten = false; isImportantAlert = false; ResetAudioClip(ElectronicVoiceAlert.HeadlampsOn); ResetAudioClip(ElectronicVoiceAlert.KeyInIgnition); SetThankYouClip(!controller.ignitionOn); return; } if ((isKeysForgotten || isImportantAlert) && (!((VehicleController)controller).driverSideDoor.boolValue || (Object)(object)((VehicleController)controller).currentDriver != (Object)null)) { isKeysForgotten = false; isImportantAlert = false; if (isPlayingIgnitionChime) { ignitionChimeStarted = false; hasAlertedOnEngineStart = false; } if (isPlayingOnEngineStart) { hasAlertedOnEngineStart = false; ResetAudioClip(ElectronicVoiceAlert.AllSystemsOk); } StopAudioClipIfPlaying(); return; } if (controller.ignitionOn) { if (!ignitionChimeStarted && currentClipId != 2 && !isImportantAlert && !isKeysForgotten) { isPlayingOnEngineStart = true; ignitionChimeStarted = true; hasAlertedOnEngineStart = false; ResetAudioClip(ElectronicVoiceAlert.HeadlampsOn); ResetAudioClip(ElectronicVoiceAlert.KeyInIgnition); ResetAudioClip(ElectronicVoiceAlert.AllSystemsOk); SetIgnitionChime(); } return; } for (int i = 0; i < alerts.Length; i++) { VoiceAlertDefinition voiceAlertDefinition = alerts[i]; if (voiceAlertDefinition.priority != VoiceAlertPriority.IsImportant) { voiceAlertDefinition.hasPlayed = false; } } ResetAudioClip(ElectronicVoiceAlert.ThankYou); ignitionChimeFinished = false; ignitionChimeStarted = false; hasAlertedOnEngineStart = false; randomOverheatClipToPlay = 0; } 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 val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(3748556394u, val3, val, (SendTo)5, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendRpc(ref val2, 3748556394u, val3, 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(bool setIgnitionOff = false) { if (setIgnitionOff) { ResetIgnitionOnStart(); } 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, setIgnitionOff); } [Rpc(/*Could not decode attribute arguments.*/)] public void SetThankYouClipRpc(bool isLamps, bool isKeys, bool setIgnitionOff) { //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)base.__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(3263664653u, val3, val, (SendTo)5, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref isLamps, default(ForPrimitives)); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref isKeys, default(ForPrimitives)); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref setIgnitionOff, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val2, 3263664653u, val3, val, (SendTo)5, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1) { base.__rpc_exec_stage = (__RpcExecStage)0; if (setIgnitionOff) { ResetIgnitionOnStart(); } 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 val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(2753757642u, val3, val, (SendTo)5, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, clipToPlay); BytePacker.WriteValueBitPacked(val2, clipType); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref isKeys, default(ForPrimitives)); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref isLamps, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val2, 2753757642u, val3, 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 val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(1132289964u, val3, val, (SendTo)5, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendRpc(ref val2, 1132289964u, val3, 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 val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(1220500623u, val3, val, (SendTo)5, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, clipToPlay); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref isThankYouClip, default(ForPrimitives)); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref isImportantWarning, default(ForPrimitives)); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref isIgnitionChime, default(ForPrimitives)); BytePacker.WriteValueBitPacked(val2, importantType); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref overridePlayback, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val2, 1220500623u, val3, 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.isSpecialVariant ? "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) { ((TMP_Text)clusterScreen).text = null; ((Behaviour)clusterLight).enabled = false; yield return (object)new WaitForSeconds(0.15f); ((TMP_Text)clusterScreen).text = clusterTexts[clipId]; ((Behaviour)clusterLight).enabled = true; voiceAudio.Stop(); voiceAudio.clip = voiceAudioClips[2]; 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(3263664653u, new RpcReceiveHandler(__rpc_handler_3263664653), "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_3263664653(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 isLamps = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref isLamps, default(ForPrimitives)); bool isKeys = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref isKeys, default(ForPrimitives)); bool setIgnitionOff = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref setIgnitionOff, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((EVAModule)(object)target).SetThankYouClipRpc(isLamps, isKeys, setIgnitionOff); 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 val2; if (num != 0) { SwitchToThreadPoolAwaitable val = UniTask.SwitchToThreadPool(); val2 = ((SwitchToThreadPoolAwaitable)(ref val)).GetAwaiter(); if (!((Awaiter)(ref val2)).IsCompleted) { num = (<>1__state = 0); <>u__1 = val2; d__33 d__ = this; ((AsyncUniTaskMethodBuilder)(ref <>t__builder)).AwaitUnsafeOnCompletedd__33>(ref val2, ref d__); return; } } else { val2 = <>u__1; <>u__1 = default(Awaiter); num = (<>1__state = -1); } ((Awaiter)(ref val2)).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 val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(157521969u, val3, val, (SendTo)6, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref setVolume, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val2, 157521969u, val3, 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 val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(3462253689u, val3, val, (SendTo)6, (RpcDelivery)0); bool flag = frequency != null; ((FastBufferWriter)(ref val2)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val2)).WriteValueSafe(frequency, false); } ((NetworkBehaviour)this).__endSendRpc(ref val2, 3462253689u, val3, 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 val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(1935879631u, val3, val, (SendTo)2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendRpc(ref val2, 1935879631u, val3, 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 val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(2808924688u, val3, val, (SendTo)6, (RpcDelivery)0); bool flag = guidString != null; ((FastBufferWriter)(ref val2)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val2)).WriteValueSafe(guidString, false); } ((NetworkBehaviour)this).__endSendRpc(ref val2, 2808924688u, val3, 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 val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(4129468706u, val3, val, (SendTo)6, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendRpc(ref val2, 4129468706u, val3, 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 val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(3593769423u, val3, val, (SendTo)6, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendRpc(ref val2, 3593769423u, val3, 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 val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(319200940u, val3, val, (SendTo)2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendRpc(ref val2, 319200940u, val3, 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 val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(171207481u, val3, val, (SendTo)2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendRpc(ref val2, 171207481u, val3, 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 val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(1648361472u, val3, val, (SendTo)6, (RpcDelivery)0); bool flag = guidString != null; ((FastBufferWriter)(ref val2)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val2)).WriteValueSafe(guidString, false); } ((FastBufferWriter)(ref val2)).WriteValueSafe(ref radioOn, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val2, 1648361472u, val3, 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 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; private bool enableRendering; 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; } for (int i = 0; i < mirrorCameras.Length; i++) { if (!((Object)(object)mirrorCameras[i] == (Object)null)) { ((Behaviour)mirrorCameras[i]).enabled = false; } } if (!UserConfig.MirrorsEnabled.Value || !VehicleUtils.isSeatedInVan) { ((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 TruckSoundManager : MonoBehaviour { public CruiserXLController controller = null; public OccludeAudio[] insideOcclusion = null; public OccludeAudio[] outsideOcclusion = null; public float checkInterval; 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 Update() { if ((Object)(object)controller == (Object)null) { return; } if (checkInterval < 0.5f) { checkInterval += Time.deltaTime; return; } checkInterval = 0f; 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; } bool carDestroyed = ((VehicleController)controller).carDestroyed; PlayerControllerBPatches.PlayerControllerBData playerControllerBData = PlayerControllerBPatches.playerData[val]; bool flag = playerControllerBData?.playerRidingInVanCab ?? false; bool flag2 = playerControllerBData?.playerRidingInVanStorage ?? false; bool flag3 = flag || flag2; UpdateRainAudio(controller, flag3); bool flag4 = carDestroyed || ((VehicleController)controller).driverSideDoor.boolValue || controller.frontLeftWindow.isWindowOpen || ((VehicleController)controller).passengerSideDoor.boolValue || controller.frontRightWindow.isWindowOpen || ((VehicleController)controller).windshieldBroken; bool flag5 = carDestroyed || controller.sideDoorOpen || controller.liftGateOpen; 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 playerControllerBData2 = PlayerControllerBPatches.playerData[val2]; if (playerControllerBData2 == null || (Object)(object)val2.currentVoiceChatIngameSettings?.voiceAudio == (Object)null || !((Component)val2.currentVoiceChatIngameSettings.voiceAudio).TryGetComponent(ref val3)) { continue; } bool playerRidingInVanCab = playerControllerBData2.playerRidingInVanCab; bool playerRidingInVanStorage = playerControllerBData2.playerRidingInVanStorage; bool flag6 = playerRidingInVanCab || playerRidingInVanStorage; if ((flag6 || flag3) && val2.speakingToWalkieTalkie && val.holdingWalkieTalkie) { playerControllerBData2.applyVoiceEffects = false; val2.voiceMuffledByEnemy = false; val3.overridingLowPass = true; val3.lowPassOverride = 4000f; continue; } if (!flag6 && !flag3) { if (playerControllerBData2.applyVoiceEffects) { playerControllerBData2.applyVoiceEffects = false; val2.voiceMuffledByEnemy = false; val3.overridingLowPass = false; } continue; } playerControllerBData2.applyVoiceEffects = true; bool flag7 = false; if (flag3) { if (flag6) { flag7 = false; } else if (flag) { flag7 = !flag4; } else if (flag2) { flag7 = !flag5; } } else if (flag6) { if (playerRidingInVanCab) { flag7 = !flag4; } else if (playerRidingInVanStorage) { flag7 = !flag5; } } else { flag7 = false; } if (flag3 && flag6 && ((flag && playerRidingInVanCab) || (flag2 && playerRidingInVanStorage))) { flag7 = false; } val2.voiceMuffledByEnemy = flag7; val3.overridingLowPass = flag7; if (flag7) { val3.lowPassOverride = 600f; } } for (int j = 0; j < insideOcclusion.Length; j++) { if (flag3) { insideOcclusion[j].overridingLowPass = false; } else { insideOcclusion[j].overridingLowPass = !flag4; } } for (int k = 0; k < outsideOcclusion.Length; k++) { if (flag3) { outsideOcclusion[k].overridingLowPass = !flag4; } else { outsideOcclusion[k].overridingLowPass = false; } } } public void UpdateRainAudio(CruiserXLController controller, bool perspectiveInVan = false) { if (!((VehicleController)controller).carDestroyed) { controller.roofRainAudioActive = Utilities.IsItRaining() && perspectiveInVan; } } } public class VanAnimationEvents : MonoBehaviour { } } namespace ScanVan.Patches { [HarmonyPatch(typeof(ElevatorAnimationEvents))] public static class ElevatorAnimationEventsPatches { [HarmonyPatch("ElevatorFullyRunning")] [HarmonyPrefix] private static void ElevatorAnimationEvents_Pre_ElevatorFullyRunning() { CruiserXLController vanController = VehicleUtils.vanController; if (!((Object)(object)vanController == (Object)null) && ((VehicleController)vanController).magnetedToShip) { TryDespawnItemsInVan(vanController); PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController; if (VehicleUtils.isSeatedInVan || VehicleUtils.IsPlayerInVanBounds(vanController)) { localPlayerController.isInElevator = true; } } } private static void TryDespawnItemsInVan(CruiserXLController vanController) { //IL_001d: 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_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002e: 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_0086: 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) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) if (!((NetworkBehaviour)RoundManager.Instance).IsServer) { return; } Bounds bounds = ((VehicleController)vanController).ontopOfTruckCollider.bounds; Bounds bounds2 = vanController.storageCompartment.bounds; foreach (GrabbableObject item in References.itemsInTruck) { if (References.itemsInTruck.Count != 0 && !((Object)(object)item == (Object)null) && ((((Bounds)(ref bounds2)).ClosestPoint(((Component)item).transform.position) == ((Component)item).transform.position && vanController.liftGateOpen) || ((Bounds)(ref bounds)).ClosestPoint(((Component)item).transform.position) == ((Component)item).transform.position)) { Plugin.LogDebug($"Item \"{((Object)item).name}\" (#{((Object)item).GetInstanceID()}) lost in orbit."); if ((Object)(object)((NetworkBehaviour)item).NetworkObject != (Object)null && ((NetworkBehaviour)item).NetworkObject.IsSpawned) { ((NetworkBehaviour)item).NetworkObject.Despawn(true); } else { Object.Destroy((Object)(object)((Component)item).gameObject); } } } } } [HarmonyPatch(typeof(GameNetworkManager))] public static class GameNetworkManagerPatches { [HarmonyPatch("Start")] [HarmonyPostfix] public static void GameNetworkManager_Post_Start() { ScanVanNetworker.Init(); } [HarmonyPatch("SaveItemsInShip")] [HarmonyPostfix] private static void GameNetworkManager_Post_SaveItemsInShip(GameNetworkManager __instance) { //IL_003d: 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) try { if (Object.op_Implicit((Object)(object)StartOfRound.Instance.attachedVehicle) && StartOfRound.Instance.attachedVehicle is CruiserXLController cruiserXLController) { SaveManager.Save("AttachedVanRotation", ((Quaternion)(ref ((VehicleController)cruiserXLController).magnetTargetRotation)).eulerAngles); SaveManager.Save("AttachedVanPosition", ((VehicleController)cruiserXLController).magnetTargetPosition); SaveManager.Save("AttachedVanTurbo", ((VehicleController)cruiserXLController).turboBoosts); SaveManager.Save("AttachedVanVariant", cruiserXLController.isSpecialVariant); SaveManager.Save("AttachedVanIgnition", ((VehicleController)cruiserXLController).ignitionStarted); SaveManager.Save("AttachedVanSteeringRotation", ((VehicleController)cruiserXLController).steeringWheelAnimFloat); SaveManager.Save("AttachedVanHealth", ((VehicleController)cruiserXLController).carHP); SaveManager.Save("AttachedVanServiceAlert", cruiserXLController.voiceModule.randomServiceAlert); SaveManager.Save("AttachedVanAltAlerts", cruiserXLController.voiceModule.useAltAudio); Plugin.LogMessage("Successfully saved Van data."); } else { SaveManager.Delete("AttachedVanRotation"); SaveManager.Delete("AttachedVanPosition"); SaveManager.Delete("AttachedVanTurbo"); SaveManager.Delete("AttachedVanVariant"); SaveManager.Delete("AttachedVanIgnition"); SaveManager.Delete("AttachedVanSteeringRotation"); SaveManager.Delete("AttachedVanHealth"); SaveManager.Delete("AttachedVanServiceAlert"); SaveManager.Delete("AttachedVanAltAlerts"); Plugin.LogMessage("Successfully deleted Van data."); } } catch (Exception ex) { Plugin.LogError("Exception caught saving Van data:\n" + ex); } } } [HarmonyPatch(typeof(GrabbableObject))] public static class GrabbableObjectPatches { [HarmonyPatch("Update")] [HarmonyPostfix] private static void GrabbableObject_Post_Update(GrabbableObject __instance) { if ((Object)(object)__instance == (Object)null || (Object)(object)GameNetworkManager.Instance.localPlayerController == (Object)null) { return; } CruiserXLController vanController = VehicleUtils.vanController; if (!((Object)(object)vanController == (Object)null)) { if (!((Object)(object)((Component)__instance).transform.parent == (Object)(object)((Component)vanController).transform) || __instance.isHeld || __instance.isHeldByEnemy) { References.itemsInTruck.Remove(__instance); } else { References.itemsInTruck.Add(__instance); } } } [HarmonyPatch("OnDestroy")] [HarmonyPostfix] private static void GrabbableObject_Post_OnDestroy(GrabbableObject __instance) { References.itemsInTruck.Remove(__instance); } } [HarmonyPatch(typeof(HUDManager))] public static class HUDManagerPatches { [HarmonyPatch("HelmetCondensationDrops")] [HarmonyPostfix] private static void HUDManager_Post_HelmetCondensationDrops(HUDManager __instance) { CruiserXLController vanController = VehicleUtils.vanController; if (!((Object)(object)vanController == (Object)null) && (VehicleUtils.IsPlayerInVanCabin(vanController) || VehicleUtils.IsPlayerInVanStorage(vanController))) { __instance.increaseHelmetCondensation = false; } } } [HarmonyPatch(typeof(Landmine))] public static class LandminePatches { [HarmonyPatch("SpawnExplosion")] [HarmonyPostfix] private static void Landmine_Post_SpawnExplosion(Landmine __instance, ref Vector3 explosionPosition, bool spawnExplosionEffect, ref float killRange, ref float damageRange, int nonLethalDamage, float physicsForce, GameObject overridePrefab, bool goThroughCar) { //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) if (NetworkManager.Singleton.IsHost) { CruiserXLController vanController = VehicleUtils.vanController; if (!((Object)(object)vanController == (Object)null) && ((NetworkBehaviour)vanController).IsSpawned && ((VehicleController)vanController).hasBeenSpawned && !vanController.alarmDebounce && !((VehicleController)vanController).ignitionStarted && !((VehicleController)vanController).carDestroyed && !((VehicleController)vanController).magnetedToShip && !(Vector3.Distance(((Component)vanController).transform.position, explosionPosition) > 7.5f) && !((float)Random.Range(9, 85) > 12f)) { vanController.alarmDebounce = true; vanController.TryBeginAlarm(); } } } [HarmonyPatch("SpawnExplosion")] [HarmonyPrefix] private static void Landmine_Pre_SpawnExplosion(Landmine __instance, Vector3 explosionPosition, bool spawnExplosionEffect, ref float killRange, ref float damageRange, int nonLethalDamage, float physicsForce, GameObject overridePrefab, bool goThroughCar) { //IL_003f: 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_0045: Unknown result type (might be due to invalid IL or missing references) CruiserXLController vanController = VehicleUtils.vanController; if (!((Object)(object)vanController == (Object)null) && VehicleUtils.IsPlayerNearVan(GameNetworkManager.Instance.localPlayerController, vanController) && !goThroughCar && ((VehicleUtils.IsPlayerInVanStorage(vanController) && vanController.storageCompartment.ClosestPoint(explosionPosition) != explosionPosition) || VehicleUtils.IsPlayerInVanCabin(vanController) || VehicleUtils.isSeatedInVan)) { killRange = -1f; damageRange = -1f; } } } [HarmonyPatch(typeof(PlayerControllerB))] public static class PlayerControllerBPatches { public class PlayerControllerBData { public bool applyVoiceEffects = false; public bool playerSeatedInVan; public bool playerRidingInVanCab; public bool playerRidingInVanStorage; public bool playerRidingOnVan; } private static bool usingSeatCamera; public static Dictionary playerData = new Dictionary(); public static float checkInterval; private static Quaternion armsMetarigParentRot = Quaternion.Euler(90f, 0f, 0f); private static Quaternion armsMetarigRot = Quaternion.Euler(-90f, 0f, 0f); private static Vector3 localArmsPos = new Vector3(0f, -0.008f, -0.43f); private static Quaternion localArmsRot = Quaternion.Euler(84.78056f, 0f, 0f); private static Vector3 playerBodyPos = Vector3.zero; private static Quaternion playerBodyRot = Quaternion.Euler(-90f, 0f, 0f); 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); } } [HarmonyPatch("Awake")] [HarmonyPostfix] private static void PlayerControllerB_Post_Awake(PlayerControllerB __instance) { RemoveStalePlayerData(); if (!playerData.ContainsKey(__instance)) { PlayerControllerBData value = new PlayerControllerBData(); playerData.Add(__instance, value); } } [HarmonyPatch("SpawnPlayerAnimation")] [HarmonyPostfix] private static void PlayerControllerB_Post_SpawnPlayerAnimation(PlayerControllerB __instance) { if (!((Object)(object)__instance != (Object)(object)GameNetworkManager.Instance.localPlayerController)) { ((Component)__instance).GetComponentInChildren().enabled = false; ((Renderer)__instance.thisPlayerModel).shadowCastingMode = (ShadowCastingMode)1; ((Component)__instance.localVisor).GetComponentInChildren().shadowCastingMode = (ShadowCastingMode)0; ((Renderer)__instance.thisPlayerModelLOD1).shadowCastingMode = (ShadowCastingMode)3; ((Renderer)__instance.thisPlayerModelLOD2).enabled = false; ((Component)__instance.thisPlayerModel).gameObject.layer = 23; ((Component)__instance.thisPlayerModelArms).gameObject.layer = 5; } } [HarmonyPatch("LateUpdate")] [HarmonyPrefix] public static void PlayerControllerB_Pre_LateUpdate(PlayerControllerB __instance) { if (!((Object)(object)__instance == (Object)null) && __instance.isPlayerControlled && !((Object)(object)__instance != (Object)(object)GameNetworkManager.Instance.localPlayerController)) { SetPlayerVehicleZone(__instance); } } private static void SetPlayerVehicleZone(PlayerControllerB playerController) { //IL_00de: Unknown result type (might be due to invalid IL or missing references) CruiserXLController vanController = VehicleUtils.vanController; PlayerControllerBData playerControllerBData = playerData[playerController]; bool isSeatedInVan = VehicleUtils.isSeatedInVan; bool flag = vanController?.vanCabinZone.playerInZone ?? false; bool flag2 = vanController?.vanStorageZone.playerInZone ?? false; bool flag3 = vanController?.vanZone.playerInZone ?? false; if (playerControllerBData.playerSeatedInVan != isSeatedInVan || playerControllerBData.playerRidingInVanCab != flag || playerControllerBData.playerRidingInVanStorage != flag2 || playerControllerBData.playerRidingOnVan != flag3) { playerData[playerController].playerSeatedInVan = VehicleUtils.isSeatedInVan; playerData[playerController].playerRidingInVanCab = flag; playerData[playerController].playerRidingInVanStorage = flag2; playerData[playerController].playerRidingOnVan = flag3; ScanVanNetworker.Instance?.SyncPlayerZoneRpc(NetworkObjectReference.op_Implicit(((NetworkBehaviour)playerController).NetworkObject), isSeatedInVan, flag2, flag, flag3); } } [HarmonyPatch("Update")] [HarmonyPrefix] public static void PlayerControllerB_Prefix_Update(PlayerControllerB __instance) { //IL_0065: 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_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_00a7: 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)) { if (usingSeatCamera && !VehicleUtils.isSeatedInVan) { usingSeatCamera = false; ((Component)__instance.gameplayCamera).transform.localPosition = Vector3.zero; __instance.horizontalClamp = 70f; } else if (VehicleUtils.isSeatedInVan && UserConfig.PreventKnockback.Value) { __instance.externalForceAutoFade = Vector3.zero; __instance.externalForces = Vector3.zero; } } } [HarmonyPatch("Update")] [HarmonyPostfix] public static void PlayerControllerB_Post_Update(PlayerControllerB __instance) { //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_00b7: 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_00c1: 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_00d3: 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_0129: 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) if ((Object)(object)__instance == (Object)null || __instance.isPlayerDead || !__instance.isPlayerControlled || (Object)(object)__instance != (Object)(object)GameNetworkManager.Instance.localPlayerController) { return; } CruiserXLController vanController = VehicleUtils.vanController; if ((Object)(object)vanController == (Object)null || !VehicleUtils.isSeatedInVan) { return; } usingSeatCamera = true; Vector3 zero = Vector3.zero; if (UserConfig.SeatBoostEnabled.Value) { ((Vector3)(ref zero))..ctor(0f, 0.09f * UserConfig.SeatBoostScale.Value, 0f); } 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)vanController.currentMiddlePassenger) { zero.x = Mathf.Sign(val.x) * ((70f - num) / 70f); } ((Component)__instance.gameplayCamera).transform.localPosition = zero; if ((Object)(object)__instance == (Object)(object)((VehicleController)vanController).currentDriver) { __instance.horizontalClamp = (vanController.frontLeftWindow.isWindowOpen ? 163f : 105f); if (__instance.ladderCameraHorizontal > 0f) { __instance.horizontalClamp = 163f; } } else if ((Object)(object)__instance == (Object)(object)((VehicleController)vanController).currentPassenger) { __instance.horizontalClamp = (vanController.frontRightWindow.isWindowOpen ? 163f : 105f); if (__instance.ladderCameraHorizontal < 0f) { __instance.horizontalClamp = 163f; } } } [HarmonyPatch("LateUpdate")] [HarmonyPostfix] private static void PlayerControllerB_Post_LateUpdate(PlayerControllerB __instance) { //IL_005d: 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_007f: 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_00a6: 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) if (!((Object)(object)__instance == (Object)null) && !__instance.isPlayerDead && __instance.isPlayerControlled && __instance.inVehicleAnimation && playerData[__instance].playerSeatedInVan) { ((Component)__instance.playerModelArmsMetarig.parent).transform.localRotation = armsMetarigParentRot; __instance.playerModelArmsMetarig.localRotation = armsMetarigRot; __instance.localArmsTransform.localPosition = localArmsPos; __instance.localArmsTransform.localRotation = localArmsRot; ((Component)__instance.playerBodyAnimator).transform.localPosition = playerBodyPos; ((Component)__instance.playerBodyAnimator).transform.localRotation = playerBodyRot; } } } [HarmonyPatch(typeof(StartOfRound))] public static class StartOfRoundPatches { [HarmonyPatch("Awake")] [HarmonyPrefix] private static void StartOfRound_Pre_Awake(StartOfRound __instance) { //IL_0019: Unknown result type (might be due to invalid IL or missing references) ScanVanNetworker.Create(); if (RadioManager._stations.Count == 0) { UniTaskExtensions.Forget(RadioManager.GetRadioStations()); } } [HarmonyPatch("SyncAlreadyHeldObjectsServerRpc")] [HarmonyPostfix] private static void StartOfRound_Post_SyncAlreadyHeldObjectsServerRpc(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.LogError("Attempted to send client data, but the Van is null? please report this to Scandal."); } else { cruiserXLController.SendClientSyncData(); } } catch (Exception ex) { Plugin.LogError("Exception caught sending saved Van data:\n" + ex); } } [HarmonyPatch("LoadAttachedVehicle")] [HarmonyPostfix] private static void StartOfRound_Post_LoadAttachedVehicle(StartOfRound __instance) { //IL_009f: 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_00bc: 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) if (!Object.op_Implicit((Object)(object)__instance.attachedVehicle) || !(__instance.attachedVehicle is CruiserXLController cruiserXLController)) { return; } try { if ((Object)(object)cruiserXLController == (Object)null) { Plugin.LogError("Attempted to load saved data, but the Van is null? please report this to Scandal."); return; } if (SaveManager.TryLoad("AttachedVanVariant", out var data)) { cruiserXLController.isSpecialVariant = data; cruiserXLController.SetVariant(cruiserXLController.isSpecialVariant); } if (SaveManager.TryLoad("AttachedVanPosition", out var data2) && SaveManager.TryLoad("AttachedVanRotation", out var data3)) { ((Component)cruiserXLController).transform.rotation = Quaternion.Euler(data3); ((Component)cruiserXLController).transform.position = StartOfRound.Instance.elevatorTransform.TransformPoint(data2); } if (SaveManager.TryLoad("AttachedVanTurbo", out var data4)) { ((VehicleController)cruiserXLController).turboBoosts = data4; } if (SaveManager.TryLoad("AttachedVanIgnition", out var data5)) { cruiserXLController.voiceModule.ignitionChimeStarted = data5; cruiserXLController.voiceModule.ignitionChimeFinished = data5; cruiserXLController.disableAnimations = !data5; cruiserXLController.inIgnitionAnimation = !data5; cruiserXLController.ignitionOn = data5; cruiserXLController.ignitionOn = data5; ((VehicleController)cruiserXLController).keyIsInIgnition = data5; cruiserXLController.SetIgnitionValues(trying: false, keyInHand: false, data5); cruiserXLController.SetIgnition(data5, data5); cruiserXLController.SetFrontCabinLightOn(data5); cruiserXLController.SetIgnitionTrigger(); if (data5) { cruiserXLController.dashboardSweepCoroutine = ((MonoBehaviour)cruiserXLController).StartCoroutine(cruiserXLController.DashboardSweepCoroutine()); } 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); } if (SaveManager.TryLoad("AttachedVanSteeringRotation", out var data6)) { cruiserXLController.syncedSteeringWheelRotation = data6; ((VehicleController)cruiserXLController).steeringWheelAnimFloat = data6; } if (SaveManager.TryLoad("AttachedVanHealth", out var data7)) { ((VehicleController)cruiserXLController).carHP = data7; } if (SaveManager.TryLoad("AttachedVanServiceAlert", out var data8)) { cruiserXLController.voiceModule.randomServiceAlert = data8; } if (SaveManager.TryLoad("AttachedVanAltAlerts", out var data9)) { cruiserXLController.voiceModule.useAltAudio = data9; } } catch (Exception ex) { Plugin.LogError("Exception caught loading saved Van data:\n" + ex); } } } [HarmonyPatch(typeof(VehicleController))] public static class VehicleControllerPatches { [HarmonyPatch("DisableVehicleCollisionForAllPlayers")] [HarmonyPrefix] private static bool VehicleController_Pre_DisableVehicleCollisionForAllPlayers(VehicleController __instance, bool __runOriginal) { if (!__runOriginal) { return false; } if (!(__instance is CruiserXLController cruiserXLController)) { return true; } cruiserXLController.DisableVehicleCollisionForAllPlayers(); return false; } [HarmonyPatch("EnableVehicleCollisionForAllPlayers")] [HarmonyPrefix] private static bool VehicleController_Pre_EnableVehicleCollisionForAllPlayers(VehicleController __instance, bool __runOriginal) { if (!__runOriginal) { return false; } if (!(__instance is CruiserXLController cruiserXLController)) { return true; } cruiserXLController.EnableVehicleCollisionForAllPlayers(); return false; } [HarmonyPatch("SetVehicleCollisionForPlayer")] [HarmonyPrefix] private static bool VehicleController_Pre_SetVehicleCollisionForPlayer(VehicleController __instance, bool __runOriginal, bool setEnabled, PlayerControllerB player) { if (!__runOriginal) { return false; } if (!(__instance is CruiserXLController cruiserXLController)) { return true; } cruiserXLController.SetVehicleCollisionForPlayer(setEnabled, player); return false; } [HarmonyPatch("SetBackDoorOpen")] [HarmonyPrefix] private static bool VehicleController_Pre_SetBackDoorOpen(VehicleController __instance, bool __runOriginal, bool open) { if (!__runOriginal) { return false; } if (!(__instance is CruiserXLController cruiserXLController)) { return true; } cruiserXLController.SetBackDoorOpen(open); return false; } [HarmonyPatch("SetFrontCabinLightOn")] [HarmonyPrefix] private static bool VehicleController_Pre_SetFrontCabinLightOn(VehicleController __instance, bool __runOriginal, bool setOn) { if (!__runOriginal) { return false; } if (!(__instance is CruiserXLController cruiserXLController)) { return true; } cruiserXLController.SetFrontCabinLightOn(setOn); return false; } [HarmonyPatch("AddEngineOil")] [HarmonyPrefix] private static bool VehicleController_Pre_AddEngineOil(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 VehicleController_Pre_AddTurboBoost(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 VehicleController_Pre_StartMagneting(VehicleController __instance, bool __runOriginal) { if (!__runOriginal) { return false; } if (!(__instance is CruiserXLController)) { return true; } return false; } [HarmonyPatch("CollectItemsInTruck")] [HarmonyPrefix] private static bool VehicleController_Pre_CollectItemsInTruck(VehicleController __instance, bool __runOriginal) { if (!__runOriginal) { return false; } if (!(__instance is CruiserXLController)) { return true; } return false; } [HarmonyPatch("DestroyCar")] [HarmonyPrefix] private static bool VehicleController_Pre_DestroyCar(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 VehicleController_Pre_ExitDriverSideSeat(VehicleController __instance, bool __runOriginal) { if (!__runOriginal) { return false; } if (!(__instance is CruiserXLController)) { return true; } return false; } [HarmonyPatch("ExitPassengerSideSeat")] [HarmonyPrefix] private static bool VehicleController_Pre_ExitPassengerSideSeat(VehicleController __instance, bool __runOriginal) { if (!__runOriginal) { return false; } if (!(__instance is CruiserXLController)) { return true; } return false; } [HarmonyPatch("CarReactToObstacle")] [HarmonyPrefix] private static bool VehicleController_Pre_CarReactToObstacle(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 VehicleController_Pre_DealPermanentDamage(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 VehicleController_Pre_DamagePlayerInVehicle(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; } cruiserXLController.DamagePlayerInVehicle(vel, magnitude); return false; } [HarmonyPatch("SetInternalStress")] [HarmonyPrefix] private static bool VehicleController_Pre_SetInternalStress(VehicleController __instance, bool __runOriginal, ref float carStressIncrease) { if (!__runOriginal) { return false; } if (!(__instance is CruiserXLController cruiserXLController)) { return true; } cruiserXLController.SetInternalStress(carStressIncrease); return false; } [HarmonyPatch("ToggleHeadlightsLocalClient")] [HarmonyPrefix] private static bool VehicleController_Pre_ToggleHeadlightsLocalClient(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 VehicleController_Pre_SpringDriverSeatLocalClient(VehicleController __instance, bool __runOriginal) { if (!__runOriginal) { return false; } if (!(__instance is CruiserXLController)) { return true; } return false; } [HarmonyPatch("SetRadioOnLocalClient")] [HarmonyPrefix] private static bool VehicleController_Pre_SetRadioOnLocalClient(VehicleController __instance, bool __runOriginal, ref bool on, ref bool setClip) { if (!__runOriginal) { return false; } if (!(__instance is CruiserXLController)) { return true; } return false; } [HarmonyPatch("SwitchRadio")] [HarmonyPrefix] private static bool VehicleController_Pre_SwitchRadio(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 VehicleController_Pre_ChangeRadioStation(VehicleController __instance, bool __runOriginal) { if (!__runOriginal) { return false; } if (!(__instance is CruiserXLController cruiserXLController)) { return true; } cruiserXLController.ChangeRadioStation(seekForward: true); return false; } [HarmonyPatch("StartTryCarIgnition")] [HarmonyPrefix] private static bool VehicleController_Pre_StartTryCarIgnition(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 VehicleController_Pre_CancelTryCarIgnition(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 VehicleController_Pre_RemoveKeyFromIgnition(VehicleController __instance, bool __runOriginal) { if (!__runOriginal) { return false; } if (!(__instance is CruiserXLController cruiserXLController)) { return true; } cruiserXLController.RemoveKeyFromIgnition(); return false; } } } namespace ScanVan.Patches.InternalUtils { [HarmonyPatch] public static class ScandalsTweaksPatches { public static bool IsPlayerInVan(PlayerControllerB player, bool checkTrunk = false) { if (PlayerControllerBPatches.playerData[player].playerSeatedInVan || PlayerControllerBPatches.playerData[player].playerRidingInVanCab || (checkTrunk && PlayerControllerBPatches.playerData[player].playerRidingInVanStorage)) { return true; } return false; } [HarmonyPatch(typeof(JLLCompatibility), "CanBlowPlayer")] [HarmonyPrefix] private static bool JLLCompatibility_Pre_CanBlowPlayer(PlayerControllerB player, ref bool __result) { if (IsPlayerInVan(player, checkTrunk: true)) { __result = false; return false; } return true; } [HarmonyPatch(typeof(JLLCompatibility), "CanDamagePlayer")] [HarmonyPrefix] private static bool JLLCompatibility_Pre_CanDamagePlayer(PlayerControllerB player, ref bool __result) { if (IsPlayerInVan(player, checkTrunk: true)) { __result = false; return false; } return true; } [HarmonyPatch(typeof(Utilities), "ShouldAllowSightThroughVehicle")] [HarmonyPrefix] private static bool Utilities_Pre_ShouldAllowSightThroughVehicle(PlayerControllerB player, EnemyAI enemy, ref bool __result) { if (IsPlayerInVan(player)) { __result = true; return false; } return true; } [HarmonyPatch(typeof(GiantKiwiAIPatches), "IsTargetPlayerInVehicle")] [HarmonyPrefix] private static bool GiantKiwiAIPatches_Pre_IsTargetPlayerInVehicle(GiantKiwiAI giantKiwiAi, VehicleController vehicleController, ref bool __result) { //IL_005a: 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_006f: Unknown result type (might be due to invalid IL or missing references) if (!(vehicleController is CruiserXLController cruiserXLController)) { return true; } PlayerControllerBPatches.PlayerControllerBData playerControllerBData = PlayerControllerBPatches.playerData[((EnemyAI)giantKiwiAi).targetPlayer]; if (playerControllerBData.playerSeatedInVan || playerControllerBData.playerRidingInVanCab || (playerControllerBData.playerRidingInVanStorage && !cruiserXLController.liftGateOpen) || ((VehicleController)cruiserXLController).ontopOfTruckCollider.ClosestPoint(((Component)((EnemyAI)giantKiwiAi).targetPlayer).transform.position) == ((Component)((EnemyAI)giantKiwiAi).targetPlayer).transform.position) { __result = true; return false; } return true; } [HarmonyPatch(typeof(BushWolfEnemyPatches), "IsTargetPlayerProtected")] [HarmonyPrefix] private static bool BushWolfEnemyPatches_Pre_IsTargetPlayerProtected(PlayerControllerB player, VehicleController vehicle, ref bool __result) { if (!(vehicle is CruiserXLController cruiserXLController)) { return true; } if (((Object)(object)((VehicleController)cruiserXLController).currentDriver == (Object)(object)player || (Object)(object)cruiserXLController.currentMiddlePassenger == (Object)(object)player || (Object)(object)((VehicleController)cruiserXLController).currentPassenger == (Object)(object)player) && VehicleUtils.IsSeatedPlayerProtected(player, cruiserXLController)) { __result = true; return false; } PlayerControllerBPatches.PlayerControllerBData playerControllerBData = PlayerControllerBPatches.playerData[player]; bool flag = playerControllerBData.playerRidingInVanCab && !((VehicleController)cruiserXLController).driverSideDoor.boolValue && !((VehicleController)cruiserXLController).passengerSideDoor.boolValue; bool flag2 = playerControllerBData.playerRidingInVanStorage && !cruiserXLController.liftGateOpen && !cruiserXLController.sideDoorOpen; if (flag || flag2) { __result = true; return false; } return true; } [HarmonyPatch(typeof(LandminePatches), "ShouldCheckCustomKnockback")] [HarmonyPrefix] private static bool LandminePatches_Pre_ShouldCheckCustomKnockback(ref bool __result) { if (VehicleUtils.isSeatedInVan) { __result = true; return false; } return true; } [HarmonyPatch(typeof(LandminePatches), "CanPlayerBeKnockedBack")] [HarmonyPrefix] private static bool LandminePatches_Pre_CanPlayerBeKnockedBack(ref bool __result) { if (VehicleUtils.isSeatedInVan && UserConfig.PreventKnockback.Value) { __result = false; return false; } return true; } } } namespace ScanVan.Patches.Enemies { [HarmonyPatch(typeof(BaboonBirdAI))] public static class BaboonBirdAIPatches { [HarmonyPatch("OnCollideWithPlayer")] [HarmonyPrefix] private static bool BaboonBirdAI_Pre_OnCollideWithPlayer(BaboonBirdAI __instance, Collider other, bool __runOriginal) { if (!__runOriginal) { return false; } CruiserXLController vanController = VehicleUtils.vanController; if ((Object)(object)vanController == (Object)null) { return true; } PlayerControllerB val = ((EnemyAI)__instance).MeetsStandardPlayerCollisionConditions(other, ((EnemyAI)__instance).inSpecialAnimation || __instance.doingKillAnimation, false); if ((Object)(object)val == (Object)null) { return true; } if (VehicleUtils.IsPlayerSeatedInVan()) { if (VehicleUtils.IsSeatedPlayerProtected(val, vanController, checkWindows: true, windshieldCheck: true, velocityCheck: true, 5f)) { return false; } return true; } bool flag = VehicleUtils.IsEnemyInVan((EnemyAI)(object)__instance, vanController); bool flag2 = VehicleUtils.IsPlayerInVanStorage(vanController); bool flag3 = vanController.liftGateOpen || vanController.sideDoorOpen; if (VehicleUtils.IsPlayerInVanBounds(vanController)) { if ((flag2 && !flag3 && !flag) || (!flag2 && flag)) { return false; } if (VehicleUtils.IsPlayerProtectedByVan(val, vanController, checkWindows: true, windshieldCheck: true, velocityCheck: true, 5f)) { return false; } return true; } if (flag) { return false; } return true; } } [HarmonyPatch(typeof(CadaverGrowthAI))] public static class CadaverGrowthAIPatches { [HarmonyPatch("Start")] [HarmonyPostfix] private static void CadaverGrowthAI_Post_Start(CadaverGrowthAI __instance) { if ((Object)(object)References.cadaverGrowthAI == (Object)null) { References.cadaverGrowthAI = __instance; } } [HarmonyPatch("OnDisable")] [HarmonyPostfix] private static void CadaverGrowthAI_Post_OnDisable(CadaverGrowthAI __instance) { if ((Object)(object)References.cadaverGrowthAI == (Object)(object)__instance) { References.cadaverGrowthAI = null; } } } [HarmonyPatch(typeof(EnemyAI))] public static class EnemyAIPatches { [HarmonyPatch("PlayerIsTargetable")] [HarmonyPostfix] private static void EnemyAI_Post_PlayerIsTargetable(EnemyAI __instance, PlayerControllerB playerScript, bool cannotBeInShip, bool overrideInsideFactoryCheck, bool checkForMineshaftStartTile, ref bool __result) { if (!(__instance is BushWolfEnemy)) { return; } CruiserXLController vanController = VehicleUtils.vanController; if ((Object)(object)vanController == (Object)null) { return; } if (((Object)(object)((VehicleController)vanController).currentDriver == (Object)(object)playerScript || (Object)(object)vanController.currentMiddlePassenger == (Object)(object)playerScript || (Object)(object)((VehicleController)vanController).currentPassenger == (Object)(object)playerScript) && VehicleUtils.IsSeatedPlayerProtected(playerScript, vanController, checkWindows: true)) { __result = false; return; } PlayerControllerBPatches.PlayerControllerBData playerControllerBData = PlayerControllerBPatches.playerData[playerScript]; bool flag = playerControllerBData.playerRidingInVanCab && !((VehicleController)vanController).driverSideDoor.boolValue && !((VehicleController)vanController).passengerSideDoor.boolValue; bool flag2 = playerControllerBData.playerRidingInVanStorage && !vanController.liftGateOpen && !vanController.sideDoorOpen; if (flag || flag2) { __result = false; } } } [HarmonyPatch(typeof(ForestGiantAI))] public static class ForestGiantAIPatches { [HarmonyPatch("AnimationEventA")] [HarmonyPrefix] private static bool ForestGiantAI_Pre_AnimationEventA(ForestGiantAI __instance, bool __runOriginal) { if (!__runOriginal) { return false; } CruiserXLController vanController = VehicleUtils.vanController; if ((Object)(object)vanController == (Object)null) { return true; } PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController; if ((Object)(object)localPlayerController == (Object)null) { return false; } if (VehicleUtils.IsPlayerInVanCabin(vanController) || VehicleUtils.IsPlayerInVanStorage(vanController) || VehicleUtils.IsPlayerSeatedInVan()) { return false; } return true; } [HarmonyPatch("OnCollideWithPlayer")] [HarmonyPrefix] private static bool ForestGiantAI_Pre_OnCollideWithPlayer(ForestGiantAI __instance, Collider other, bool __runOriginal) { if (!__runOriginal) { return false; } CruiserXLController vanController = VehicleUtils.vanController; if ((Object)(object)vanController == (Object)null) { return true; } PlayerControllerB val = ((EnemyAI)__instance).MeetsStandardPlayerCollisionConditions(other, __instance.inEatingPlayerAnimation, false); if ((Object)(object)val == (Object)null) { return true; } if (VehicleUtils.IsPlayerSeatedInVan()) { if (VehicleUtils.IsSeatedPlayerProtected(val, vanController, checkWindows: true, windshieldCheck: true, velocityCheck: true, 8f)) { return false; } return true; } if (VehicleUtils.IsPlayerInVanBounds(vanController)) { if (VehicleUtils.IsPlayerProtectedByVan(val, vanController, checkWindows: true, windshieldCheck: true, velocityCheck: true, 8f)) { return false; } return true; } return true; } } [HarmonyPatch(typeof(GiantKiwiAI))] public static class GiantKiwiAIPatches { [HarmonyPatch("IsEggInsideClosedTruck")] [HarmonyPrefix] private static bool GiantKiwiAI_Pre_IsEggInsideClosedTruck(GiantKiwiAI __instance, KiwiBabyItem egg, bool closedTruck, ref bool __result, bool __runOriginal) { if (!__runOriginal) { return false; } CruiserXLController vanController = VehicleUtils.vanController; if ((Object)(object)vanController == (Object)null) { return true; } if ((Object)(object)((GrabbableObject)egg).parentObject == (Object)(object)((Component)((VehicleController)vanController).physicsRegion.parentNetworkObject).transform) { __result = !vanController.liftGateOpen; return false; } return true; } [HarmonyPatch("AnimationEventB")] [HarmonyPrefix] private static void GiantKiwiAI_Pre_AnimationEventB(GiantKiwiAI __instance) { CruiserXLController vanController = VehicleUtils.vanController; if ((Object)(object)vanController == (Object)null) { return; } PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController; if ((Object)(object)localPlayerController == (Object)null || !localPlayerController.isPlayerControlled || localPlayerController.isPlayerDead) { return; } if (VehicleUtils.IsPlayerSeatedInVan()) { if (VehicleUtils.IsSeatedPlayerProtected(localPlayerController, vanController, checkWindows: true, windshieldCheck: true, velocityCheck: true, 10f)) { __instance.timeSinceHittingPlayer = 0.4f; } return; } bool flag = VehicleUtils.IsEnemyInVan((EnemyAI)(object)__instance, vanController); bool flag2 = VehicleUtils.IsPlayerInVanStorage(vanController); bool flag3 = vanController.liftGateOpen || vanController.sideDoorOpen; if (VehicleUtils.IsPlayerInVanBounds(vanController)) { if ((flag2 && !flag3 && !flag) || (!flag2 && flag)) { __instance.timeSinceHittingPlayer = 0.4f; } else if (VehicleUtils.IsPlayerProtectedByVan(localPlayerController, vanController, checkWindows: true, windshieldCheck: true, velocityCheck: true, 10f)) { __instance.timeSinceHittingPlayer = 0.4f; } } else if (flag) { __instance.timeSinceHittingPlayer = 0.4f; } } } [HarmonyPatch(typeof(MaskedPlayerEnemy))] public static class MaskedPlayerEnemyPatches { [HarmonyPatch("OnCollideWithPlayer")] [HarmonyPrefix] private static bool MaskedPlayerEnemy_Pre_OnCollideWithPlayer(MaskedPlayerEnemy __instance, Collider other, bool __runOriginal) { if (!__runOriginal) { return false; } CruiserXLController vanController = VehicleUtils.vanController; if ((Object)(object)vanController == (Object)null) { return true; } PlayerControllerB val = ((EnemyAI)__instance).MeetsStandardPlayerCollisionConditions(other, __instance.inKillAnimation || __instance.startingKillAnimationLocalClient || !__instance.enemyEnabled, false); if ((Object)(object)val == (Object)null) { return true; } if (VehicleUtils.IsPlayerSeatedInVan()) { if (VehicleUtils.IsSeatedPlayerProtected(val, vanController, checkWindows: false, windshieldCheck: false, velocityCheck: true, 5f)) { return false; } return true; } bool flag = VehicleUtils.IsEnemyInVan((EnemyAI)(object)__instance, vanController); bool flag2 = VehicleUtils.IsPlayerInVanStorage(vanController); bool flag3 = vanController.liftGateOpen || vanController.sideDoorOpen; if (VehicleUtils.IsPlayerInVanBounds(vanController)) { if ((flag2 && !flag3 && !flag) || (!flag2 && flag)) { return false; } if (VehicleUtils.IsPlayerProtectedByVan(val, vanController, checkWindows: false, windshieldCheck: false, velocityCheck: true, 5f)) { return false; } return true; } if (flag) { return false; } return true; } } [HarmonyPatch(typeof(MouthDogAI))] public static class MouthDogAIPatches { [HarmonyPatch("OnCollideWithPlayer")] [HarmonyPrefix] private static bool MouthDogAI_Pre_OnCollideWithPlayer(MouthDogAI __instance, Collider other, bool __runOriginal) { if (!__runOriginal) { return false; } CruiserXLController vanController = VehicleUtils.vanController; if ((Object)(object)vanController == (Object)null) { return true; } PlayerControllerB val = ((EnemyAI)__instance).MeetsStandardPlayerCollisionConditions(other, __instance.inKillAnimation, false); if ((Object)(object)val == (Object)null) { return true; } if (VehicleUtils.IsPlayerSeatedInVan()) { if (VehicleUtils.IsSeatedPlayerProtected(val, vanController, checkWindows: false, windshieldCheck: true, velocityCheck: true, 10f)) { return false; } return true; } if (VehicleUtils.IsPlayerInVanBounds(vanController)) { if (VehicleUtils.IsPlayerProtectedByVan(val, vanController, checkWindows: false, windshieldCheck: true, velocityCheck: true, 10f)) { return false; } return true; } return true; } } [HarmonyPatch(typeof(PumaAI))] public static class PumaAIPatches { [HarmonyPatch("OnCollideWithPlayer")] [HarmonyPrefix] private static bool PumaAI_Pre_OnCollideWithPlayer(PumaAI __instance, Collider other, bool __runOriginal) { if (!__runOriginal) { return false; } CruiserXLController vanController = VehicleUtils.vanController; if ((Object)(object)vanController == (Object)null) { return true; } PlayerControllerB val = ((EnemyAI)__instance).MeetsStandardPlayerCollisionConditions(other, false, false); if ((Object)(object)val == (Object)null) { return true; } if (VehicleUtils.IsPlayerSeatedInVan()) { if (VehicleUtils.IsSeatedPlayerProtected(val, vanController, checkWindows: true, windshieldCheck: true, velocityCheck: true, 10f)) { return false; } return true; } bool flag = VehicleUtils.IsEnemyInVan((EnemyAI)(object)__instance, vanController); bool flag2 = VehicleUtils.IsPlayerInVanStorage(vanController); bool flag3 = vanController.liftGateOpen || vanController.sideDoorOpen; if (VehicleUtils.IsPlayerInVanBounds(vanController)) { if ((flag2 && !flag3 && !flag) || (!flag2 && flag)) { return false; } if (VehicleUtils.IsPlayerProtectedByVan(val, vanController, checkWindows: true, windshieldCheck: true, velocityCheck: true, 10f)) { return false; } return true; } if (flag) { return false; } return true; } } [HarmonyPatch(typeof(RadMechAI))] public static class RadMechAIPatches { [HarmonyPatch("OnCollideWithPlayer")] [HarmonyPrefix] private static bool RadMechAI_Pre_OnCollideWithPlayer(RadMechAI __instance, Collider other, bool __runOriginal) { if (!__runOriginal) { return false; } CruiserXLController vanController = VehicleUtils.vanController; if ((Object)(object)vanController == (Object)null) { return true; } PlayerControllerB val = ((EnemyAI)__instance).MeetsStandardPlayerCollisionConditions(other, false, false); if ((Object)(object)val == (Object)null) { return true; } if (VehicleUtils.IsPlayerSeatedInVan()) { if (VehicleUtils.IsSeatedPlayerProtected(val, vanController, checkWindows: true, windshieldCheck: true)) { return false; } return true; } if (VehicleUtils.IsPlayerInVanBounds(vanController)) { if (VehicleUtils.IsPlayerProtectedByVan(val, vanController, checkWindows: true, windshieldCheck: true)) { return false; } return true; } return true; } } [HarmonyPatch(typeof(RedLocustBees))] public static class RedLocustBeesPatches { [HarmonyPatch("OnCollideWithPlayer")] [HarmonyPrefix] private static void RedLocustBees_Pre_OnCollideWithPlayer(RedLocustBees __instance, Collider other) { CruiserXLController vanController = VehicleUtils.vanController; if ((Object)(object)vanController == (Object)null) { return; } PlayerControllerB val = ((EnemyAI)__instance).MeetsStandardPlayerCollisionConditions(other, false, false); if ((Object)(object)val == (Object)null) { return; } if (VehicleUtils.IsPlayerSeatedInVan()) { if (VehicleUtils.IsSeatedPlayerProtected(val, vanController, checkWindows: true, windshieldCheck: false, velocityCheck: true, 5f)) { __instance.timeSinceHittingPlayer = 0f; } return; } bool flag = VehicleUtils.IsEnemyInVan((EnemyAI)(object)__instance, vanController); bool flag2 = VehicleUtils.IsPlayerInVanStorage(vanController); bool flag3 = vanController.liftGateOpen || vanController.sideDoorOpen; if (VehicleUtils.IsPlayerInVanBounds(vanController)) { if ((flag2 && !flag3 && !flag) || (!flag2 && flag)) { __instance.timeSinceHittingPlayer = 0f; } else if (VehicleUtils.IsPlayerProtectedByVan(val, vanController, checkWindows: true, windshieldCheck: false, velocityCheck: true, 5f)) { __instance.timeSinceHittingPlayer = 0f; } } else if (flag) { __instance.timeSinceHittingPlayer = 0f; } } } [HarmonyPatch(typeof(SandWormAI))] public static class SandWormAIPatches { [HarmonyPatch("EatPlayer")] [HarmonyPrefix] private static bool SandWormAI_Pre_EatPlayer(SandWormAI __instance, PlayerControllerB playerScript, bool __runOriginal) { if (!__runOriginal) { return false; } CruiserXLController vanController = VehicleUtils.vanController; if ((Object)(object)vanController == (Object)null) { return true; } if (VehicleUtils.IsPlayerSeatedInVan()) { return false; } if (VehicleUtils.IsPlayerInVanBounds(vanController)) { if (VehicleUtils.IsPlayerInVanCabin(vanController) || VehicleUtils.IsPlayerInVanStorage(vanController)) { return false; } return true; } return true; } } } 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 ScanVanNetworker : NetworkBehaviour { internal static GameObject networkPrefab; internal static ScanVanNetworker? Instance { get; private set; } internal NetworkVariable StreamerRadio { get; private set; } = new NetworkVariable(true, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); internal static void Init() { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Expected O, but got Unknown if ((Object)(object)networkPrefab != (Object)null) { Plugin.LogDebug("Skipped network handler registration, because it has already been initialized."); return; } try { networkPrefab = new GameObject("ScanVanNetworker") { hideFlags = (HideFlags)61 }; NetworkObject val = networkPrefab.AddComponent(); byte[] value = MD5.Create().ComputeHash(Encoding.UTF8.GetBytes(typeof(ScanVanNetworker).Assembly.GetName().Name + ((Object)networkPrefab).name)); val.GlobalObjectIdHash = BitConverter.ToUInt32(value, 0); networkPrefab.AddComponent(); NetworkManager.Singleton.PrefabHandler.AddNetworkPrefab(networkPrefab); Plugin.LogDebug("Successfully registered network handler. This is good news."); } catch (Exception arg) { Plugin.LogError($"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.LogError("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.LogWarning("There are 2 ScanVanNetworkers instantiated, and the wrong one was assigned as Instance. This shouldn't happen, but is recoverable."); Instance = this; } Plugin.LogDebug("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; } } [Rpc(/*Could not decode attribute arguments.*/)] internal void SyncPlayerZoneRpc(NetworkObjectReference player, bool setSeated, bool setStorage, bool setCab, bool setRiding) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_012b: 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_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_0108: 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_013a: 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 val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(2150580406u, val3, val, (SendTo)5, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref player, default(ForNetworkSerializable)); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref setSeated, default(ForPrimitives)); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref setStorage, default(ForPrimitives)); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref setCab, default(ForPrimitives)); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref setRiding, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val2, 2150580406u, val3, val, (SendTo)5, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 1) { return; } base.__rpc_exec_stage = (__RpcExecStage)0; NetworkObject val4 = default(NetworkObject); if (((NetworkObjectReference)(ref player)).TryGet(ref val4, (NetworkManager)null)) { PlayerControllerB val5 = default(PlayerControllerB); if (!((Component)val4).TryGetComponent(ref val5)) { Plugin.LogError("Failed to find player network object!"); return; } PlayerControllerBPatches.PlayerControllerBData playerControllerBData = PlayerControllerBPatches.playerData[val5]; if (playerControllerBData == null) { Plugin.LogError($"Failed to find player data. clientId? {val5.playerClientId}"); return; } playerControllerBData.playerSeatedInVan = setSeated; playerControllerBData.playerRidingInVanCab = setCab; playerControllerBData.playerRidingInVanStorage = setStorage; playerControllerBData.playerRidingOnVan = setRiding; } else { Plugin.LogError("Failed to set player zone data."); } } protected override void __initializeVariables() { if (StreamerRadio == null) { throw new Exception("ScanVanNetworker.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); ((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 ((NetworkBehaviour)this).__registerRpc(2150580406u, new RpcReceiveHandler(__rpc_handler_2150580406), "SyncPlayerZoneRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_2150580406(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_009b: 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_00b0: 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_00da: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { NetworkObjectReference player = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref player, default(ForNetworkSerializable)); bool setSeated = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref setSeated, default(ForPrimitives)); bool setStorage = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref setStorage, default(ForPrimitives)); bool setCab = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref setCab, default(ForPrimitives)); bool setRiding = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref setRiding, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((ScanVanNetworker)(object)target).SyncPlayerZoneRpc(player, setSeated, setStorage, setCab, setRiding); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "ScanVanNetworker"; } } } 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_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Expected O, but got Unknown int num = <>1__state; try { if ((uint)num > 1u) { } try { TaskAwaiter> taskAwaiter; TaskAwaiter taskAwaiter2; if (num != 0) { if (num == 1) { taskAwaiter = <>u__2; <>u__2 = default(TaskAwaiter>); num = (<>1__state = -1); goto IL_011f; } Plugin.LogDebug("Searching Radio API for stations."); taskAwaiter2 = GetRadioBrowserApiUrl().GetAwaiter(); if (!taskAwaiter2.IsCompleted) { num = (<>1__state = 0); <>u__1 = taskAwaiter2; d__2 d__ = this; ((AsyncUniTaskMethodBuilder)(ref <>t__builder)).AwaitUnsafeOnCompleted, d__2>(ref taskAwaiter2, ref d__); return; } } else { taskAwaiter2 = <>u__1; <>u__1 = default(TaskAwaiter); num = (<>1__state = -1); } <>s__4 = taskAwaiter2.GetResult(); 5__1 = <>s__4; <>s__4 = null; 5__2 = new RadioBrowserClient(5__1, (string)null); taskAwaiter = 5__2.Stations.GetByVotesAsync(7500u).GetAwaiter(); if (!taskAwaiter.IsCompleted) { num = (<>1__state = 1); <>u__2 = taskAwaiter; d__2 d__ = this; ((AsyncUniTaskMethodBuilder)(ref <>t__builder)).AwaitUnsafeOnCompleted>, d__2>(ref taskAwaiter, ref d__); return; } goto IL_011f; IL_011f: <>s__5 = taskAwaiter.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.LogDebug("Finished searching radio API for stations."); Plugin.LogDebug($"Found {_stations.Count}."); 5__1 = null; 5__2 = null; 5__3 = null; } catch (Exception ex) { 5__6 = ex; Plugin.LogError("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.LogDebug(val.Name); Plugin.LogDebug(val.StationUuid.ToString()); 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.LogDebug($"Success status code for {hostName}? {result.IsSuccessStatusCode}, Ip for {hostName}? {ipAddress}"); if (result.IsSuccessStatusCode) { lastRoundTripTime = reply.RoundtripTime; searchUrl = hostName; } } } catch (SocketException) { Plugin.LogWarning("Cannot ping socket."); } } return searchUrl; } } } namespace ScanVan.Compatibility { [HarmonyPatch] public static class FirstPersonViewCompatibility { [HarmonyPatch(typeof(CruiserXLController), "SetKeyEffects")] [HarmonyPrefix] public static void HaulerController_Pre_SetCarKeyEffects(CruiserXLController __instance, ref bool localUseBodyHands) { if (LocalBodyViewController.LocalBodyShown) { localUseBodyHands = true; } } } [HarmonyPatch] public static class ImmersiveVisorCompatibility { [HarmonyPatch(typeof(VisorRainState), "LineCastForCeiling")] [HarmonyPrefix] public static bool VisorRainState_Pre_LineCastForCeiling(VisorRainState __instance, ref bool __result) { CruiserXLController vanController = VehicleUtils.vanController; if ((Object)(object)vanController == (Object)null) { return true; } if (VehicleUtils.IsPlayerSeatedInVan() || VehicleUtils.IsPlayerInVanCabin(vanController) || VehicleUtils.IsPlayerInVanStorage(vanController)) { __result = true; return false; } return true; } } [HarmonyPatch] public static class LethalElementsCompatibility { public static bool IsVanCabinEnclosed(CruiserXLController controller) { return !((VehicleController)controller).driverSideDoor.boolValue && !((VehicleController)controller).passengerSideDoor.boolValue && !controller.frontLeftWindow.isWindowOpen && !controller.frontRightWindow.isWindowOpen && !((VehicleController)controller).windshieldBroken; } public static bool IsVanStorageEnclosed(CruiserXLController controller) { return !controller.liftGateOpen && !controller.sideDoorOpen; } public static bool IsPlayerInVanBounds(CruiserXLController controller) { return VehicleUtils.IsPlayerInVanBounds(controller); } public static bool IsPlayerInVanCabin(CruiserXLController controller) { return VehicleUtils.IsPlayerInVanCabin(controller); } public static bool IsPlayerInVanStorage(CruiserXLController controller) { return VehicleUtils.IsPlayerInVanStorage(controller); } public static bool IsPlayerInVanCabinOrStorage(CruiserXLController controller) { return VehicleUtils.IsPlayerInVanStorage(controller) || VehicleUtils.IsPlayerInVanCabin(controller); } public static bool IsVanBlowerOnAndHot(CruiserXLController controller) { return ((VehicleController)controller).ignitionStarted && controller.heaterOn && controller.isHeaterWarm && !controller.isHeaterCold; } public static bool IsVanBlowerOnAndCool(CruiserXLController controller) { return ((VehicleController)controller).ignitionStarted && controller.heaterOn && !controller.isHeaterWarm && controller.isHeaterCold; } public static bool IsPlayerOnOutsideOfVan(CruiserXLController controller) { return IsPlayerInVanBounds(controller) && !IsPlayerInVanStorage(controller) && !IsPlayerInVanCabin(controller); } public static bool IsIndoorLighting(PlayerControllerB localPlayer) { return (Object)(object)localPlayer.currentAudioTrigger != (Object)null && localPlayer.currentAudioTrigger.insideLighting; } [HarmonyPatch(typeof(PlayerEffectsManager), "SetPlayerTemperature")] [HarmonyPrefix] public static void PlayerEffectsManager_Pre_SetPlayerTemperature(PlayerEffectsManager __instance, float temperatureDelta) { if ((Object)(object)HeatwaveWeather.Instance == (Object)null || !((BaseWeather)HeatwaveWeather.Instance).IsActive) { return; } CruiserXLController vanController = VehicleUtils.vanController; if ((Object)(object)vanController == (Object)null || (!IsPlayerInVanBounds(vanController) && !IsPlayerInVanCabin(vanController) && !IsPlayerInVanStorage(vanController))) { return; } bool flag = IsVanCabinEnclosed(vanController); bool flag2 = IsVanStorageEnclosed(vanController); bool flag3 = IsVanBlowerOnAndCool(vanController); bool flag4 = IsVanBlowerOnAndHot(vanController); bool flag5 = IsPlayerOnOutsideOfVan(vanController); PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController; bool flag6 = IsIndoorLighting(localPlayerController); if ((IsPlayerInVanCabin(vanController) && flag) || (IsPlayerInVanStorage(vanController) && flag2)) { if (!flag6) { if (flag3) { PlayerEffectsManager.heatTransferRate = 0.25f * (float)vanController.heaterSpeed; } else if (flag4) { PlayerEffectsManager.heatTransferRate = 1.15f * (float)vanController.heaterSpeed; } else { PlayerEffectsManager.heatTransferRate = 0.75f; } } else { PlayerEffectsManager.heatTransferRate = 1f; } } else { PlayerEffectsManager.heatTransferRate = 1f; } if (flag5) { PlayerEffectsManager.heatTransferRate = 1f; } } [HarmonyPatch(typeof(CruiserXLController), "Start")] [HarmonyPostfix] public static void CruiserXLController_Post_Start(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)); } [HarmonyPatch(typeof(CruiserXLController), "FixedUpdate")] [HarmonyPostfix] public static void CruiserXLController_Post_FixedUpdate(CruiserXLController __instance) { if (SnowPatches.IsSnowActive()) { SnowTrackersManager.UpdateFootprintTracker((MonoBehaviour)(object)__instance, !__instance.allWheelsAirborne); } } [HarmonyPatch(typeof(SnowfallVFXManager), "Update")] [HarmonyPostfix] public static void SnowfallVFXManager_Post_Update_VFX() { CruiserXLController vanController = VehicleUtils.vanController; if (!((Object)(object)vanController == (Object)null) && (IsPlayerInVanBounds(vanController) || IsPlayerInVanCabin(vanController) || IsPlayerInVanStorage(vanController)) && IsPlayerInVanCabinOrStorage(vanController)) { PlayerEffectsManager.isUnderSnow = false; SnowfallVFXManager.snowMovementHindranceMultiplier = 1f; } } [HarmonyPatch(typeof(BlizzardWeather), "SetColdZoneState")] [HarmonyPrefix] public static bool BlizzardWeather_Pre_SetColdZoneState(BlizzardWeather __instance) { CruiserXLController vanController = VehicleUtils.vanController; if ((Object)(object)vanController == (Object)null) { return true; } if (IsPlayerInVanBounds(vanController) || IsPlayerInVanCabin(vanController) || IsPlayerInVanStorage(vanController)) { return false; } return true; } [HarmonyPatch(typeof(SnowfallWeather), "SetColdZoneState")] [HarmonyPrefix] public static bool SnowfallWeather_Pre_SetColdZoneState(SnowfallWeather __instance) { if ((Object)(object)BlizzardWeather.Instance == (Object)null) { return true; } CruiserXLController vanController = VehicleUtils.vanController; if ((Object)(object)vanController == (Object)null) { return true; } if (!IsPlayerInVanBounds(vanController) && !IsPlayerInVanCabin(vanController) && !IsPlayerInVanStorage(vanController)) { return true; } bool flag = IsVanCabinEnclosed(vanController); bool flag2 = IsVanStorageEnclosed(vanController); bool flag3 = IsPlayerOnOutsideOfVan(vanController); PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController; bool flag4 = IsIndoorLighting(localPlayerController); if (IsPlayerInVanCabin(vanController)) { if (flag) { if (((VehicleController)vanController).ignitionStarted && vanController.heaterOn) { PlayerEffectsManager.isInColdZone = vanController.isHeaterCold; } else { PlayerEffectsManager.isInColdZone = !flag4; } } else { PlayerEffectsManager.isInColdZone = IsWindAllowedVehicle(localPlayerController, vanController) && BlizzardWeather.Instance.isLocalPlayerInWind; } return false; } if (IsPlayerInVanStorage(vanController)) { if (flag2) { if (((VehicleController)vanController).ignitionStarted && vanController.heaterOn) { PlayerEffectsManager.isInColdZone = vanController.isHeaterCold; } else { PlayerEffectsManager.isInColdZone = !flag4; } } else { PlayerEffectsManager.isInColdZone = IsWindAllowedVehicle(localPlayerController, vanController) && BlizzardWeather.Instance.isLocalPlayerInWind; } return false; } if (flag3) { PlayerEffectsManager.isInColdZone = IsWindAllowedVehicle(localPlayerController, vanController) && BlizzardWeather.Instance.isLocalPlayerInWind; return false; } return true; } [HarmonyPatch(typeof(BlizzardWeather), "Update")] [HarmonyPrefix] public static bool BlizzardWeather_Pre_Update(BlizzardWeather __instance) { CruiserXLController vanController = VehicleUtils.vanController; if ((Object)(object)vanController == (Object)null) { return true; } if (!IsPlayerInVanBounds(vanController) && !IsPlayerInVanCabin(vanController) && !IsPlayerInVanStorage(vanController)) { return true; } bool flag = IsVanCabinEnclosed(vanController); bool flag2 = IsVanStorageEnclosed(vanController); bool flag3 = IsPlayerInVanCabinOrStorage(vanController); bool flag4 = IsPlayerOnOutsideOfVan(vanController); PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController; bool flag5 = IsIndoorLighting(localPlayerController); SnowfallWeather instance = SnowfallWeather.Instance; if (instance != null) { instance.Update(); } if (flag3) { if ((IsPlayerInVanCabin(vanController) && flag) || (IsPlayerInVanStorage(vanController) && flag2)) { __instance.isPlayerInBlizzard = false; } else { __instance.isPlayerInBlizzard = __instance.isLocalPlayerInWind; } if (((VehicleController)vanController).ignitionStarted && vanController.heaterOn) { PlayerEffectsManager.heatTransferRate = 0.25f * (float)vanController.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 (IsIndoorLighting(localPlayer)) { return false; } bool flag = IsVanCabinEnclosed(controller); bool flag2 = IsVanStorageEnclosed(controller); bool flag3 = IsPlayerOnOutsideOfVan(controller); if ((IsPlayerInVanCabin(controller) && !flag) || (IsPlayerInVanStorage(controller) && !flag2)) { return true; } if (flag3) { return true; } return false; } [HarmonyPatch(typeof(HeatwavePatches), "CheckConditionsForHeatingStop")] [HarmonyPrefix] public static bool HeatwavePatches_Pre_CheckConditionsForHeatingStop(PlayerControllerB playerController, ref bool __result) { CruiserXLController vanController = VehicleUtils.vanController; if ((Object)(object)vanController == (Object)null) { return true; } if (!IsPlayerInVanBounds(vanController) && !IsPlayerInVanCabin(vanController) && !IsPlayerInVanStorage(vanController)) { return true; } bool flag = IsVanCabinEnclosed(vanController); bool flag2 = IsVanStorageEnclosed(vanController); bool flag3 = IsVanBlowerOnAndCool(vanController); bool flag4 = IsVanBlowerOnAndHot(vanController); bool flag5 = IsPlayerOnOutsideOfVan(vanController); PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController; bool flag6 = IsIndoorLighting(localPlayerController); if ((IsPlayerInVanCabin(vanController) && flag) || (IsPlayerInVanStorage(vanController) && 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; } [HarmonyPatch(typeof(HeatwavePatches), "CheckConditionsForHeatingPause")] [HarmonyPrefix] public static bool HeatwavePatches_Pre_CheckConditionsForHeatingPause(PlayerControllerB playerController, ref bool __result) { CruiserXLController vanController = VehicleUtils.vanController; if ((Object)(object)vanController == (Object)null) { return true; } if (!IsPlayerInVanBounds(vanController) && !IsPlayerInVanCabin(vanController) && !IsPlayerInVanStorage(vanController)) { return true; } __result = false; return false; } } [HarmonyPatch] public static class LethalMinCompatibility { [HarmonyPatch(typeof(PikminVehicleController), "InitializeReferences")] [HarmonyPrefix] public static bool PikminVehicleController_Pre_InitializeReferences(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; } [HarmonyPatch(typeof(CruiserXLCollisionTrigger), "OnTriggerEnter")] [HarmonyPrefix] public static bool CruiserXLCollisionTrigger_Pre_OnTriggerEnter(CruiserXLCollisionTrigger __instance, 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.LogError($"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 != StreamingPlaybackState.Stopped); 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 != StreamingPlaybackState.Stopped) { 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 != StreamingPlaybackState.Stopped && 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.LogMessage("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 val2; if (num != 0) { SwitchToThreadPoolAwaitable val = UniTask.SwitchToThreadPool(); val2 = ((SwitchToThreadPoolAwaitable)(ref val)).GetAwaiter(); if (!((Awaiter)(ref val2)).IsCompleted) { num = (<>1__state = 0); <>u__1 = val2; d__4 d__ = this; ((AsyncUniTaskMethodBuilder)(ref <>t__builder)).AwaitUnsafeOnCompletedd__4>(ref val2, ref d__); return; } } else { val2 = <>u__1; <>u__1 = default(Awaiter); num = (<>1__state = -1); } ((Awaiter)(ref val2)).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 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 { } }