Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of Company Hauler v2.0.7
BepInEx/plugins/hauler/glojam.CompanyHauler.dll
Decompiled 2 weeks ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Linq; 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 BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using BepInEx.Logging; using CompanyHauler.Compatibility; using CompanyHauler.Networking; using CompanyHauler.Patches; using CompanyHauler.Scripts; using CompanyHauler.Utils; using GameNetcodeStuff; using HarmonyLib; using LethalMin; using Microsoft.CodeAnalysis; using ScandalsTweaks.Patches; using ScandalsTweaks.Scripts; using ScandalsTweaks.Utils; using TMPro; using Unity.Netcode; using UnityEngine; using UnityEngine.InputSystem; using UnityEngine.Rendering.HighDefinition; using UnityEngine.UI; using Woecust.ImmersiveVisor; using glojam.CompanyHauler.NetcodePatcher; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: IgnoresAccessChecksTo("ImmersiveVisor")] [assembly: IgnoresAccessChecksTo("NoteBoxz.LethalMin")] [assembly: IgnoresAccessChecksTo("scandal.scandalstweaks")] [assembly: IgnoresAccessChecksTo("Unity.Netcode.Runtime")] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("glojam.CompanyHauler")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("2.0.7.0")] [assembly: AssemblyInformationalVersion("2.0.7+001c725ecc2d58bf480f9aec93c97422a3ef273c")] [assembly: AssemblyProduct("CompanyHauler")] [assembly: AssemblyTitle("glojam.CompanyHauler")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("2.0.7.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] [module: NetcodePatchedAssembly] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte P_0) { Flag = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } public class HaulerCollisionTrigger : MonoBehaviour { public HaulerController 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_0454: Unknown result type (might be due to invalid IL or missing references) //IL_0464: Unknown result type (might be due to invalid IL or missing references) //IL_0469: Unknown result type (might be due to invalid IL or missing references) //IL_046e: Unknown result type (might be due to invalid IL or missing references) //IL_0478: Unknown result type (might be due to invalid IL or missing references) //IL_047d: 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_00ff: 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_0111: 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_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_04ca: Unknown result type (might be due to invalid IL or missing references) //IL_04db: Unknown result type (might be due to invalid IL or missing references) //IL_04e6: Unknown result type (might be due to invalid IL or missing references) //IL_04eb: Unknown result type (might be due to invalid IL or missing references) //IL_0519: Unknown result type (might be due to invalid IL or missing references) //IL_051e: Unknown result type (might be due to invalid IL or missing references) //IL_052f: 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_019c: 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_054d: Unknown result type (might be due to invalid IL or missing references) //IL_0552: Unknown result type (might be due to invalid IL or missing references) //IL_0563: 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_01df: 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_023b: Unknown result type (might be due to invalid IL or missing references) //IL_0242: Unknown result type (might be due to invalid IL or missing references) //IL_0248: Unknown result type (might be due to invalid IL or missing references) //IL_0355: Unknown result type (might be due to invalid IL or missing references) //IL_0360: Unknown result type (might be due to invalid IL or missing references) //IL_036b: Unknown result type (might be due to invalid IL or missing references) //IL_061d: Unknown result type (might be due to invalid IL or missing references) //IL_0623: Invalid comparison between Unknown and I4 //IL_02b2: Unknown result type (might be due to invalid IL or missing references) //IL_065f: Unknown result type (might be due to invalid IL or missing references) //IL_0664: Unknown result type (might be due to invalid IL or missing references) //IL_0675: Unknown result type (might be due to invalid IL or missing references) //IL_067a: Unknown result type (might be due to invalid IL or missing references) //IL_067c: Unknown result type (might be due to invalid IL or missing references) //IL_067e: Unknown result type (might be due to invalid IL or missing references) //IL_0680: Unknown result type (might be due to invalid IL or missing references) //IL_0693: Expected I4, but got Unknown //IL_030d: Unknown result type (might be due to invalid IL or missing references) //IL_0312: Unknown result type (might be due to invalid IL or missing references) //IL_06a4: Unknown result type (might be due to invalid IL or missing references) //IL_06a9: Unknown result type (might be due to invalid IL or missing references) //IL_06b1: Unknown result type (might be due to invalid IL or missing references) //IL_06da: Unknown result type (might be due to invalid IL or missing references) //IL_06df: Unknown result type (might be due to invalid IL or missing references) //IL_06e7: Unknown result type (might be due to invalid IL or missing references) //IL_0710: Unknown result type (might be due to invalid IL or missing references) //IL_0715: Unknown result type (might be due to invalid IL or missing references) //IL_071d: 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<PlayerControllerB>(ref val) || Time.realtimeSinceStartup - timeSinceHittingPlayer < 0.25f) { return; } Transform physicsTransform = ((VehicleController)mainScript).physicsRegion.physicsTransform; if ((Object)(object)val.overridePhysicsParent == (Object)(object)physicsTransform || (Object)(object)val.physicsParent == (Object)(object)physicsTransform) { return; } float num = Mathf.Abs(((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 ((Object)(object)physicsTransform == (Object)(object)GameNetworkManager.Instance.localPlayerController.physicsParent) { return; } if (num > 20f) { GameNetworkManager.Instance.localPlayerController.KillPlayer(val3, true, (CauseOfDeath)8, 0, 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<EnemyAICollisionDetect>(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); return; } EnemyAI obj = val4.mainScript; FlowerSnakeEnemy val5 = (FlowerSnakeEnemy)(object)((obj is FlowerSnakeEnemy) ? obj : null); if ((val5 != null && Object.op_Implicit((Object)(object)val5.clingingToPlayer)) || 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; } } if (((Vector3)(ref ((VehicleController)mainScript).averageVelocity)).magnitude < 6f && (!((VehicleController)mainScript).ignitionStarted || (int)((VehicleController)mainScript).gear == 3 || Mathf.Abs(mainScript.wheelRPM) < 40f)) { dealDamage = false; } timeSinceHittingEnemy = Time.realtimeSinceStartup; Vector3 position = ((Component)val4).transform.position; bool flag = false; EnemySize enemySize = val4.mainScript.enemyType.EnemySize; EnemySize val6 = enemySize; switch ((int)val6) { 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; } } } } } namespace CompanyHauler { internal class HaulerConfig { internal static ConfigEntry<bool> haulerMirror; internal static void InitConfig() { ConfigFile config = ((BaseUnityPlugin)Plugin.Instance).Config; config.SaveOnConfigSet = false; haulerMirror = config.Bind<bool>("General", "Enable Mirrors", true, "Enable rendering for the side mirrors? (may impact performance for low end hardware)"); ClearOrphanedEntries(config); config.Save(); config.SaveOnConfigSet = true; } private static void ClearOrphanedEntries(ConfigFile cfg) { PropertyInfo propertyInfo = AccessTools.Property(typeof(ConfigFile), "OrphanedEntries"); Dictionary<ConfigDefinition, string> dictionary = (Dictionary<ConfigDefinition, string>)propertyInfo.GetValue(cfg); dictionary.Clear(); } } [BepInPlugin("glojam.CompanyHauler", "CompanyHauler", "2.0.7")] [BepInDependency(/*Could not decode attribute arguments.*/)] public class Plugin : BaseUnityPlugin { public static Plugin Instance { get; private set; } internal static ManualLogSource Logger { get; private set; } internal static Harmony? Harmony { get; set; } public void Awake() { Logger = ((BaseUnityPlugin)this).Logger; Instance = this; HaulerConfig.InitConfig(); Patch(); Logger.LogInfo((object)"glojam.CompanyHauler v2.0.7 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("glojam.CompanyHauler"); } Logger.LogDebug((object)"Patching..."); Harmony.PatchAll(); if (IsModPresent("NoteBoxz.LethalMin")) { LethalMinCompatibility.PatchAllCompatibilityMethods(Harmony); } if (IsModPresent("ImmersiveVisor")) { ImmersiveVisorCompatibility.PatchAllCompatibilityMethods(Harmony); } Logger.LogDebug((object)"Finished patching!"); } internal static void Unpatch() { Logger.LogDebug((object)"Unpatching..."); Harmony? harmony = Harmony; if (harmony != null) { harmony.UnpatchSelf(); } Logger.LogDebug((object)"Finished unpatching!"); } internal static bool IsModPresent(string name) { return Chainloader.PluginInfos.ContainsKey(name); } } public static class MyPluginInfo { public const string PLUGIN_GUID = "glojam.CompanyHauler"; public const string PLUGIN_NAME = "CompanyHauler"; public const string PLUGIN_VERSION = "2.0.7"; } } namespace CompanyHauler.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 PlayerUtils { internal static bool disableAnimationSync; internal static bool isSeatedInPickup; } internal static class References { internal static ItemDropship itemShip; internal static HaulerController pickupController; } public static class VehicleUtils { public static bool IsEnemyInPickup(EnemyAI enemyScript, HaulerController pickupController) { //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)pickupController.collisionTrigger.insideTruckNavMeshBounds).ClosestPoint(((Component)enemyScript).transform.position) == ((Component)enemyScript).transform.position || ((Collider)pickupController.collisionTrigger.insideTruckNavMeshBounds).ClosestPoint(enemyScript.agent.destination) == enemyScript.agent.destination) { return true; } return false; } public static bool IsPlayerSeatedInPickup() { return PlayerUtils.isSeatedInPickup; } public static bool IsPlayerInPickupBounds(HaulerController pickupController) { return pickupController.vehicleZone.playerInZone; } public static bool IsPlayerInPickupCab(HaulerController pickupController) { return pickupController.vehicleCabZone.playerInZone; } public static bool IsSeatedPlayerProtected(PlayerControllerB playerController, HaulerController pickupController, bool checkSunroof = false, bool checkWindows = false, bool windshieldCheck = false, bool velocityCheck = false, float velocityMagnitude = 0f) { float magnitude = ((Vector3)(ref ((VehicleController)pickupController).averageVelocity)).magnitude; if (velocityCheck && magnitude > velocityMagnitude) { return true; } bool windshieldBroken = ((VehicleController)pickupController).windshieldBroken; bool sunroofOpen = pickupController.sunroofOpen; bool flag = (Object)(object)playerController == (Object)(object)((VehicleController)pickupController).currentDriver || (Object)(object)playerController == (Object)(object)((VehicleController)pickupController).currentPassenger; if ((checkSunroof && sunroofOpen) || (flag && windshieldCheck && windshieldBroken)) { return false; } bool flag2 = ((VehicleController)pickupController).driverSideDoor.boolValue || (checkWindows && pickupController.frontLeftWindow.isWindowOpen); bool flag3 = ((VehicleController)pickupController).passengerSideDoor.boolValue || (checkWindows && pickupController.frontRightWindow.isWindowOpen); bool flag4 = pickupController.backLeftDoor.boolValue || (checkWindows && pickupController.backLeftWindow.isWindowOpen); bool flag5 = pickupController.backRightDoor.boolValue || (checkWindows && pickupController.backRightWindow.isWindowOpen); if (((Object)(object)playerController == (Object)(object)((VehicleController)pickupController).currentDriver && flag2) || ((Object)(object)playerController == (Object)(object)((VehicleController)pickupController).currentPassenger && flag3)) { return false; } if (((Object)(object)playerController == (Object)(object)pickupController.currentBackLeftPassenger && flag4) || ((Object)(object)playerController == (Object)(object)pickupController.currentMiddlePassenger && (flag4 || flag5)) || ((Object)(object)playerController == (Object)(object)pickupController.currentBackRightPassenger && flag5)) { return false; } return true; } public static bool IsPlayerProtectedByPickup(PlayerControllerB playerController, HaulerController pickupController, bool checkSunroof = false, bool checkWindows = false, bool windshieldCheck = false, bool velocityCheck = false, float velocityMagnitude = 0f) { if (((VehicleController)pickupController).carDestroyed) { return false; } float magnitude = ((Vector3)(ref ((VehicleController)pickupController).averageVelocity)).magnitude; if (velocityCheck && magnitude > velocityMagnitude) { return true; } bool windshieldBroken = ((VehicleController)pickupController).windshieldBroken; bool sunroofOpen = pickupController.sunroofOpen; bool flag = ((VehicleController)pickupController).driverSideDoor.boolValue || ((VehicleController)pickupController).passengerSideDoor.boolValue || pickupController.backLeftDoor.boolValue || pickupController.backRightDoor.boolValue; bool flag2 = pickupController.frontLeftWindow.isWindowOpen || pickupController.frontRightWindow.isWindowOpen || pickupController.backLeftWindow.isWindowOpen || pickupController.backRightWindow.isWindowOpen; bool tailgateOpen = pickupController.tailgateOpen; if ((IsPlayerInPickupCab(pickupController) && flag) || (checkSunroof && sunroofOpen) || (checkWindows && flag2) || (windshieldCheck && windshieldBroken)) { return false; } if (IsPlayerInPickupBounds(pickupController) && !IsPlayerInPickupCab(pickupController)) { return false; } return true; } public static bool IsPlayerNearPickup(PlayerControllerB playerController, HaulerController pickupController) { //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)pickupController).mainRigidbody.position; Vector3 position2 = ((Component)playerController).transform.position; if (Vector3.Distance(position2, position) > 10f) { return false; } return true; } } } namespace CompanyHauler.Behaviour { public class HaulerCameraManager : MonoBehaviour { public HaulerController mainController = null; public MeshRenderer leftMirrorMesh = null; public MeshRenderer rightMirrorMesh = null; public MeshRenderer[] meshMirrors = null; public Camera[] cameraMirrors = null; public float cameraFramerate; public int camerasToRenderPerFrame = 1; private float elapsed; private int nextCameraToRender = 0; private float cameraRenderCountRemainder = 0f; public void LateUpdate() { if ((Object)(object)mainController == (Object)null || !((NetworkBehaviour)mainController).IsSpawned || ((VehicleController)mainController).carDestroyed) { return; } PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController; if ((Object)(object)localPlayerController == (Object)null) { return; } for (int i = 0; i < cameraMirrors.Length; i++) { if (!((Object)(object)cameraMirrors[i] == (Object)null)) { ((Behaviour)cameraMirrors[i]).enabled = false; } } if (!HaulerConfig.haulerMirror.Value || !PlayerUtils.isSeatedInPickup) { ((Renderer)leftMirrorMesh).enabled = false; ((Renderer)rightMirrorMesh).enabled = false; return; } elapsed += Time.deltaTime; if (elapsed < 1f / cameraFramerate) { return; } elapsed = 0f; ((Renderer)leftMirrorMesh).enabled = true; ((Renderer)rightMirrorMesh).enabled = true; int num = 0; for (int j = 0; j < cameraMirrors.Length; j++) { if (((Renderer)(object)meshMirrors[j]).IsVisibleToPlayersLocalCamera(localPlayerController.gameplayCamera)) { num++; } } float num2 = (float)camerasToRenderPerFrame * (float)num / (float)cameraMirrors.Length; cameraRenderCountRemainder += num2; int num3 = (nextCameraToRender + cameraMirrors.Length - 1) % cameraMirrors.Length; while (cameraRenderCountRemainder >= 0f) { if (((Renderer)(object)meshMirrors[nextCameraToRender]).IsVisibleToPlayersLocalCamera(localPlayerController.gameplayCamera)) { ((Behaviour)cameraMirrors[nextCameraToRender]).enabled = true; cameraRenderCountRemainder -= 1f; } nextCameraToRender = (nextCameraToRender + 1) % cameraMirrors.Length; if (nextCameraToRender == num3) { break; } } } } } namespace CompanyHauler.Scripts { public class HaulerAnimationEvents : MonoBehaviour { public HaulerController haulerController = null; public void OnSunroofOpen() { haulerController.sunroofOpen = true; } public void OnSunroofClose() { haulerController.sunroofOpen = false; } } public class HaulerController : VehicleController { [CompilerGenerated] private sealed class <ChangeGear>d__383 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public bool shiftUp; public HaulerController <>4__this; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <ChangeGear>d__383(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSeconds(<>4__this.shiftTime); <>1__state = 1; return true; case 1: <>1__state = -1; if (shiftUp) { <>4__this.currentGear++; } else { <>4__this.currentGear--; } <>4__this.shiftGearCoroutine = null; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class <RemoveKey>d__243 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public HaulerController <>4__this; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <RemoveKey>d__243(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Expected O, but got Unknown //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: { <>1__state = -1; <>4__this.disableAnimations = true; <>4__this.inIgnitionAnimation = false; PlayerControllerB currentDriver = ((VehicleController)<>4__this).currentDriver; if (currentDriver != null) { currentDriver.playerBodyAnimator.SetInteger("SA_CarAnim", 6); } <>4__this.ignitionAnimator.SetInteger("SAIgnition_Anim", 6); <>2__current = (object)new WaitForSeconds(0.28f); <>1__state = 1; return true; } case 1: <>1__state = -1; <>4__this.SetKeyIgnitionValues(keyTwisting: false, keyInHand: true, keyInSlot: false); <>4__this.carKeyAudio.PlayOneShot(((VehicleController)<>4__this).removeKey); <>4__this.SetIgnition(started: false, cabLightOn: false); <>4__this.accessoryMode = false; <>4__this.hasPlayedIgnitionChime = false; <>4__this.CancelDashboardSweep(); <>4__this.SetDashboardGaugesOn(on: false); <>2__current = (object)new WaitForSeconds(0.73f); <>1__state = 2; return true; case 2: <>1__state = -1; <>4__this.SetKeyIgnitionValues(keyTwisting: false, keyInHand: false, keyInSlot: false); ((VehicleController)<>4__this).keyIgnitionCoroutine = null; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class <SetCarRainCollisions>d__224 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public HaulerController <>4__this; private ParticleSystem[] <particleTriggers>5__1; private int <i>5__2; private TriggerModule <trigger>5__3; private int <j>5__4; private int <index>5__5; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <SetCarRainCollisions>d__224(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) <particleTriggers>5__1 = null; <trigger>5__3 = default(TriggerModule); <>1__state = -2; } private bool MoveNext() { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Expected O, but got Unknown //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSeconds(4f); <>1__state = 1; return true; case 1: <>1__state = -1; <particleTriggers>5__1 = (ParticleSystem[])(object)new ParticleSystem[9] { GlobalReferences.rainParticles, GlobalReferences.rainHitParticles, GlobalReferences.stormyRainParticles, GlobalReferences.stormyRainHitParticles, GlobalReferences.wesleyHurricaneRainParticles, GlobalReferences.wesleyHurricaneRainHitParticles, GlobalReferences.wesleyHurricaneSandParticles, GlobalReferences.wesleyForsakenRainParticles, GlobalReferences.wesleyForsakenRainHitParticles }; <i>5__2 = 0; while (<i>5__2 < <particleTriggers>5__1.Length) { if ((Object)(object)<particleTriggers>5__1[<i>5__2] == (Object)null) { Plugin.Logger.LogDebug((object)"Hauler: Weather particle or Trigger is null!"); } else { <trigger>5__3 = <particleTriggers>5__1[<i>5__2].trigger; <j>5__4 = 0; while (<j>5__4 < <>4__this.weatherEffectBlockers.Length) { <index>5__5 = ((TriggerModule)(ref <trigger>5__3)).colliderCount + <j>5__4; ((TriggerModule)(ref <trigger>5__3)).SetCollider(<index>5__5, (Component)(object)<>4__this.weatherEffectBlockers[<j>5__4]); <j>5__4++; } <trigger>5__3 = default(TriggerModule); } <i>5__2++; } return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class <TryDashboardSweep>d__306 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public HaulerController <>4__this; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <TryDashboardSweep>d__306(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Expected O, but got Unknown //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>4__this.SetSymbolActive(<>4__this.leftSignalSymbol, spriteActive: true); <>4__this.SetSymbolActive(<>4__this.hazardSignalSymbol, spriteActive: true); <>4__this.SetSymbolActive(<>4__this.rightSignalSymbol, spriteActive: true); <>4__this.currentSweepStage = 0; <>2__current = (object)new WaitForSeconds(0.48f); <>1__state = 1; return true; case 1: <>1__state = -1; <>4__this.SetSymbolActive(<>4__this.immobiliserSymbol, spriteActive: false); <>4__this.currentSweepStage = 1; <>2__current = (object)new WaitForSeconds(0.35f); <>1__state = 2; return true; case 2: <>1__state = -1; <>4__this.SetSymbolActive(<>4__this.leftSignalSymbol, spriteActive: false); <>4__this.SetSymbolActive(<>4__this.hazardSignalSymbol, spriteActive: false); <>4__this.SetSymbolActive(<>4__this.rightSignalSymbol, spriteActive: false); <>4__this.currentSweepStage = 2; <>4__this.hasSweepedDashboard = true; <>4__this.dashboardSymbolCoroutine = null; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class <TryIgnition>d__234 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public bool isLocalDriver; public HaulerController <>4__this; private bool <shiftInterlock>5__1; private int <animIndex>5__2; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <TryIgnition>d__234(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_01a5: Unknown result type (might be due to invalid IL or missing references) //IL_01af: Expected O, but got Unknown //IL_025f: Unknown result type (might be due to invalid IL or missing references) //IL_0269: Expected O, but got Unknown //IL_02aa: Unknown result type (might be due to invalid IL or missing references) //IL_02b4: Expected O, but got Unknown //IL_02ec: Unknown result type (might be due to invalid IL or missing references) //IL_02f2: Invalid comparison between Unknown and I4 //IL_0214: Unknown result type (might be due to invalid IL or missing references) //IL_021e: Expected O, but got Unknown //IL_015a: Unknown result type (might be due to invalid IL or missing references) //IL_0164: Expected O, but got Unknown //IL_03ca: Unknown result type (might be due to invalid IL or missing references) //IL_03d4: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: { <>1__state = -1; if ((Object)(object)((VehicleController)<>4__this).currentDriver == (Object)null) { ((VehicleController)<>4__this).keyIgnitionCoroutine = null; return false; } if (((VehicleController)<>4__this).keyIsInIgnition) { <>4__this.SetKeyIgnitionValues(keyTwisting: false, keyInHand: true, keyInSlot: true); if (((VehicleController)<>4__this).currentDriver.playerBodyAnimator.GetInteger("SA_CarAnim") == 3 || ((VehicleController)<>4__this).currentDriver.playerBodyAnimator.GetInteger("SA_CarAnim") == 13) { ((VehicleController)<>4__this).currentDriver.playerBodyAnimator.SetInteger("SA_CarAnim", 2); } else { ((VehicleController)<>4__this).currentDriver.playerBodyAnimator.SetInteger("SA_CarAnim", 12); } <animIndex>5__2 = ((VehicleController)<>4__this).currentDriver.playerBodyAnimator.GetInteger("SA_CarAnim"); <>4__this.ignitionAnimator.SetInteger("SAIgnition_Anim", <animIndex>5__2); <>2__current = (object)new WaitForSeconds(0.02f); <>1__state = 1; return true; } PlayerControllerB currentDriver2 = ((VehicleController)<>4__this).currentDriver; if (currentDriver2 != null) { currentDriver2.playerBodyAnimator.SetInteger("SA_CarAnim", 2); } <>4__this.ignitionAnimator.SetInteger("SAIgnition_Anim", 2); <>4__this.SetKeyIgnitionValues(keyTwisting: false, keyInHand: true, keyInSlot: false); <>2__current = (object)new WaitForSeconds(0.6f); <>1__state = 3; return true; } case 1: <>1__state = -1; <>4__this.carKeyAudio.PlayOneShot(((VehicleController)<>4__this).twistKey); <>4__this.SetKeyIgnitionValues(keyTwisting: true, keyInHand: true, keyInSlot: true); <>2__current = (object)new WaitForSeconds(0.1467f); <>1__state = 2; return true; case 2: <>1__state = -1; goto IL_02c5; case 3: <>1__state = -1; <>4__this.carKeyAudio.PlayOneShot(((VehicleController)<>4__this).insertKey); <>4__this.SetKeyIgnitionValues(keyTwisting: false, keyInHand: true, keyInSlot: true); <>2__current = (object)new WaitForSeconds(0.2f); <>1__state = 4; return true; case 4: <>1__state = -1; <>4__this.carKeyAudio.PlayOneShot(((VehicleController)<>4__this).twistKey); <>4__this.SetKeyIgnitionValues(keyTwisting: true, keyInHand: true, keyInSlot: true); <>2__current = (object)new WaitForSeconds(0.18f); <>1__state = 5; return true; case 5: <>1__state = -1; goto IL_02c5; case 6: { <>1__state = -1; if ((float)Random.Range(0, 100) < ((VehicleController)<>4__this).chanceToStartIgnition) { <>4__this.inIgnitionAnimation = false; <>4__this.accessoryMode = true; PlayerControllerB currentDriver = ((VehicleController)<>4__this).currentDriver; if (currentDriver != null) { currentDriver.playerBodyAnimator.SetInteger("SA_CarAnim", 1); } <>4__this.SetKeyIgnitionValues(keyTwisting: false, keyInHand: false, keyInSlot: true); <>4__this.SetIgnition(started: true, cabLightOn: true); <>4__this.SetFrontCabinLightOn(<>4__this.accessoryMode); <>4__this.SetDashboardGaugesOn(on: true); <>4__this.CancelIgnitionAnimation(ignitionOn: true, setIgnitionAnim: true); <>4__this.StartIgnitionRpc(); } else { ((VehicleController)<>4__this).chanceToStartIgnition = ((VehicleController)<>4__this).chanceToStartIgnition + 14f; ((VehicleController)<>4__this).chanceToStartIgnition = Mathf.Clamp(((VehicleController)<>4__this).chanceToStartIgnition, 0f, 99f); } return false; } IL_02c5: <>4__this.SetKeyIgnitionValues(keyTwisting: true, keyInHand: true, keyInSlot: true); if (!isLocalDriver) { return false; } <shiftInterlock>5__1 = (int)((VehicleController)<>4__this).gear == 3; if (<shiftInterlock>5__1) { <>4__this.PlayIgnitionAudio(); } <>4__this.accessoryMode = true; if (!<>4__this.hasSweepedDashboard && <>4__this.dashboardSymbolCoroutine == null) { <>4__this.dashboardSymbolCoroutine = ((MonoBehaviour)<>4__this).StartCoroutine(<>4__this.TryDashboardSweep()); } <>4__this.SetKeyIgnitionValues(keyTwisting: true, keyInHand: true, keyInSlot: true); <>4__this.SetFrontCabinLightOn(<>4__this.accessoryMode); <>4__this.SetDashboardGaugesOn(on: true); <>4__this.TryStartIgnitionRpc(<shiftInterlock>5__1); if (!<shiftInterlock>5__1) { return false; } <>2__current = (object)new WaitForSeconds(Random.Range(0.7f, 1.4f)); <>1__state = 6; return true; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class <jerkCarUpward>d__409 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public Vector3 dir; public HaulerController <>4__this; private Vector3 <jerkForce>5__1; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <jerkCarUpward>d__409(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: 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_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_00e0: 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_0106: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_013a: 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_0151: Unknown result type (might be due to invalid IL or missing references) //IL_015b: Expected O, but got Unknown //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; if (!((NetworkBehaviour)<>4__this).IsOwner) { ((VehicleController)<>4__this).jumpingInCar = false; return false; } <>2__current = (object)new WaitForSeconds(0.16f); <>1__state = 1; return true; case 1: <>1__state = -1; <jerkForce>5__1 = ((Component)<>4__this).transform.TransformDirection(new Vector3(dir.x, 0f, dir.y)); ((VehicleController)<>4__this).mainRigidbody.AddForce(<jerkForce>5__1 * ((VehicleController)<>4__this).turboBoostForce * 0.22f + Vector3.up * ((VehicleController)<>4__this).turboBoostUpwardForce * 0.1f, (ForceMode)1); ((VehicleController)<>4__this).mainRigidbody.AddForceAtPosition(Vector3.up * ((VehicleController)<>4__this).jumpForce, ((Component)((VehicleController)<>4__this).hoodFireAudio).transform.position - Vector3.up * 2f, (ForceMode)1); <>2__current = (object)new WaitForSeconds(0.15f); <>1__state = 2; return true; case 2: <>1__state = -1; ((VehicleController)<>4__this).jumpingInCar = false; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [Header("DEBUG")] public bool isInTestMode = false; public float debugMotorTorque; public float debugBrakeTorque; public float debugSteeringAngle; [Header("Networking")] public Vector2 syncedMoveInputVector; public bool syncedDrivePedalPressed; public bool syncedBrakePedalPressed; internal bool syncedTyreSlipping; internal float syncedTyreStress; internal float syncedEngineRPM; internal float syncedFrontWheelRPM; internal float syncedBackWheelRPM; internal float syncedWheelRPM; internal int syncedCarHP; internal float syncEffectsInterval; internal float syncTorqueInterval; internal float syncDrivetrainInterval; internal float syncedSteeringWheelRotation; internal float syncedCurrentMotorTorque; internal float syncedCurrentBrakeTorque; [Header("Player")] public HaulerPhysicsRegion vehicleZone = null; public HaulerPlayerZone vehicleCabZone = null; public PlayerControllerB lastDriver = null; public PlayerControllerB playerWhoShifted = null; public PlayerControllerB? currentBackLeftPassenger = null; public PlayerControllerB? currentMiddlePassenger = null; public PlayerControllerB? currentBackRightPassenger = null; public HaulerSeatAnimator frontLeftSeat = null; public HaulerSeatAnimator frontRightSeat = null; public HaulerSeatAnimator backLeftSeat = null; public HaulerSeatAnimator backSeat = null; public HaulerSeatAnimator backRightSeat = null; public Transform[] backLeftExitPoints = null; public Transform[] backRightExitPoints = null; public AnimatedObjectTrigger backLeftDoor = null; public AnimatedObjectTrigger backRightDoor = null; public InteractTrigger backLeftDoorTrigger = null; public InteractTrigger backRightDoorTrigger = null; public InteractTrigger backLeftPassengerSeatTrigger = null; public InteractTrigger backPassengerSeatTrigger = null; public InteractTrigger backRightPassengerSeatTrigger = null; public bool localPlayerInBackLeftPassengerSeat; public bool localPlayerInMiddlePassengerSeat; public bool localPlayerInBackRightPassengerSeat; internal const string STEERING_WHEEL_SPEED = "steeringWheelTurnSpeed"; internal const string ANIMATION_SPEED = "animationSpeed"; internal const string IGNITION_ANIM = "SAIgnition_Anim"; internal const string CAR_ANIM = "SA_CarAnim"; internal const string JUMP_WHILE_IN_CAR = "SA_JumpInCar"; internal const string CAR_MOTION_TIME = "SA_CarMotionTime"; [Header("Physics")] public HaulerWheelCollider frontLeftWheel = null; public HaulerWheelCollider frontRightWheel = null; public HaulerWheelCollider backLeftWheel = null; public HaulerWheelCollider backRightWheel = null; public HaulerCollisionTrigger collisionTrigger = null; public float timeSinceLastCollision; public List<WheelCollider> allWheels = null; public WheelHit[] wheelHits = (WheelHit[])(object)new WheelHit[4]; public Rigidbody playerPhysicsBody = null; public Vector3 previousVehiclePosition; public Quaternion previousVehicleRotation; public AnimationCurve engineCurve = null; public AnimationCurve enginePowerCurve = null; public float torqueBoost = 1.25f; public float enginePower; public float engineReversePower; public Coroutine shiftGearCoroutine = null; public float[] gearRatios = null; public float diffRatio; public int currentGear; public float upShiftThreshold; public float downShiftThreshold; public float lastShiftTime; public float shiftCooldown; public float shiftTime; public float steeringWheelAnimValue; public float normalisedCarHP; public float currentSteeringWheelAnimValue; public float steeringReturnSpeed; public float steeringSpeed; public float carDeacceleration; public float minTorque; public float maxReverseTorque; public float maxForwardTorque; public float inclineBoost; public float minInclineBoost; public float maxInclineBoost; public float maxInclineBoostAngle = 32f; public bool allowBoostTorque; public float forwardBoostSpeed; public float reverseBoostSpeed; public float boostReturnSpeed; public float boostMultiplierLimit; public float forwardBoostThreshold; public float reverseBoostThreshold; public float boostMultiplier; public float reverseCarAcceleration; public float brakeAcceleration; public float maxBrakeTorque; public float maxParkingBrakeTorque; public float currentMotorTorque; public float currentBrakeTorque; public float steeringAngle; public float maxSteeringAngle; public float forwardWheelSpeed; public float reverseWheelSpeed; public float fRpmDiff; public float bRpmDiff; public float frontWheelsRPM; public float backWheelsRPM; public float wheelRPM; public float frontWheelRPM; public float backWheelRPM; public bool backWheelsGrounded; public bool allWheelsGrounded; public bool allWheelsAirborne; public float forwardsSlip; public float sidewaysSlip; public bool hasDeliveredVehicle; [Header("VFX")] public TextMeshPro radioScreen = null; private Coroutine radioOnCoroutine = null; public Collider[] weatherEffectBlockers = null; public InteractTrigger startIgnitionTrigger = null; public InteractTrigger stopIgnitionTrigger = null; public Animator ignitionAnimator = null; public GameObject carKeyContainer = null; public GameObject keyItemHolder = null; public Transform ignitionKeyPosition = null; private Vector3 ignitionKeyScale = new Vector3(1f, 1f, 1f); private Vector3 keyPosLocal = new Vector3(0.05029682f, 0.1181492f, -0.09794867f); private Vector3 keyPosServer = new Vector3(0.0414306f, 0.09218378f, -0.09290992f); private Vector3 keyRotLocal = new Vector3(29.962f, -2.063f, -3.106f); private Vector3 keyRotServer = new Vector3(29.427f, -5.158f, -53.66f); public HaulerWindow frontLeftWindow = null; public HaulerWindow frontRightWindow = null; public HaulerWindow backLeftWindow = null; public HaulerWindow backRightWindow = null; public Material needleOnMaterial = null; public Material needleOffMaterial = null; public Material tachometerOnMaterial = null; public Material tachometerOffMaterial = null; public Material speedometerOnMaterial = null; public Material speedometerOffMaterial = null; public GameObject gaugeLightContainer = null; public Image speedometerImage = null; public Image tachometerImage = null; public MeshRenderer speedometerMesh = null; public MeshRenderer tachometerMesh = null; public Transform speedometerTransform = null; public Transform tachometerTransform = null; public float speedometerFloat; public float tachometerFloat; private Coroutine dashboardSymbolCoroutine = null; private int currentSweepStage; private bool hasSweepedDashboard; public SpriteRenderer tractionControlSymbol = null; private bool tractionControlLightActive; public SpriteRenderer checkEngineSymbol = null; private bool hasPlayedCheckEngineWarning; private bool checkEngineLightActive; public SpriteRenderer coolantLevelSymbol = null; private bool coolantLevelLightActive; public SpriteRenderer immobiliserSymbol = null; public SpriteRenderer leftSignalSymbol = null; public SpriteRenderer hazardSignalSymbol = null; public SpriteRenderer rightSignalSymbol = null; public SpriteRenderer dippedBeamSymbol = null; private bool dippedBeamLightActive; public SpriteRenderer mainBeamSymbol = null; private bool mainBeamLightActive; public SpriteRenderer oilLevelSymbol = null; private bool oilLevelLightActive; public SpriteRenderer parkingBrakeSymbol = null; private bool parkingBrakeLightActive; public SpriteRenderer batteryLowSymbol = null; private bool batteryLowLightActive; public bool brakeLightsOn; public GameObject centerMountedLightContainer = null; public MeshRenderer centerMountedLight = null; public Material backLightOffMat = null; public MeshRenderer windshieldMesh = null; public AnimatedObjectTrigger windowWipers = null; public PlayAudioAnimationEvent windowWipersEvent = null; public bool automaticWipersOn; private string[] carTooltips = new string[3] { "Gas pedal: [W]", "Brake pedal: [S]", "Boost: [Space]" }; public bool tailgateOpen; public bool sunroofOpen; public bool cabLightToggled; public float playerSteeringWheelAnimFloat; public float syncedPlayerSteeringAnim; public float shiftSpeed = 25f; public bool gaugesOn; public bool headlampsOn; public bool disableAnimations; public bool inIgnitionAnimation; public bool accessoryMode; public bool twistingKey; [Header("Destruction")] public GameObject[] disableOnDestroy = null; public GameObject mainBodyContainer = null; public GameObject sunroofContainer = null; public GameObject hoodDoorContainer = null; public GameObject frontLeftDoorContainer = null; public GameObject frontRightDoorContainer = null; public GameObject backLeftDoorContainer = null; public GameObject backRightDoorContainer = null; [Header("Audio")] public AudioSource roofRainAudio = null; public AudioSource cabinAudio = null; public AudioClip ignitionChime = null; public AudioClip chimeSoundWarning = null; public AudioSource carKeyAudio = null; public AudioClip dashButtonPress = null; public AudioSource windshieldAudio = null; public AudioSource roofInteractionAudio = null; public AudioSource leftDashboardAudio = null; public AudioSource centerDashboardAudio = null; public AudioSource rightDashboardAudio = null; public bool roofRainAudioActive; public bool hasPlayedIgnitionChime; public float timeLastSyncedRadio; public float radioPingTimestamp; public void OnEnable() { References.pickupController = 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) 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; SetTruckStats(); } public void SetBackDoorOpen(bool open) { tailgateOpen = open; } public void Start() { //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_0130: 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) ((MonoBehaviour)this).StartCoroutine(SetCarRainCollisions()); if (maxBrakeTorque > maxParkingBrakeTorque) { maxBrakeTorque = maxParkingBrakeTorque; } base.carHP = base.baseCarHP; base.FrontLeftWheel.brakeTorque = maxParkingBrakeTorque; base.FrontRightWheel.brakeTorque = maxParkingBrakeTorque; base.BackLeftWheel.brakeTorque = maxParkingBrakeTorque; base.BackRightWheel.brakeTorque = maxParkingBrakeTorque; base.currentRadioClip = new Random(StartOfRound.Instance.randomMapSeed).Next(0, base.radioClips.Length); base.radioAudio.clip = base.radioClips[base.currentRadioClip]; base.decals = (DecalProjector[])(object)new DecalProjector[24]; if (StartOfRound.Instance.inShipPhase) { base.magnetedToShip = true; base.loadedVehicleFromSave = true; hasDeliveredVehicle = true; base.inDropshipAnimation = false; base.hasBeenSpawned = true; SetVehicleKinematic(setKinematic: true); ((Component)this).transform.position = StartOfRound.Instance.magnetPoint.position + StartOfRound.Instance.magnetPoint.forward * 7f; StartMagneting(); } } [IteratorStateMachine(typeof(<SetCarRainCollisions>d__224))] public IEnumerator SetCarRainCollisions() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <SetCarRainCollisions>d__224(0) { <>4__this = this }; } public void ChangeGear_Forward(CallbackContext context) { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Expected I4, but got Unknown if (((CallbackContext)(ref context)).performed && base.localPlayerInControl) { int num = (int)base.gear; if (num < 3) { ShiftToGearAndSync(num + 1); } } } public void ChangeGear_Backward(CallbackContext context) { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Expected I4, but got Unknown if (((CallbackContext)(ref context)).performed && base.localPlayerInControl) { int num = (int)base.gear; if (num > 1) { ShiftToGearAndSync(num - 1); } } } public void ShiftToGearAndSync(int setGear) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Invalid comparison between Unknown and I4 //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Invalid comparison between I4 and Unknown if ((int)base.gear != setGear) { base.timeAtLastGearShift = Time.realtimeSinceStartup; playerWhoShifted = GameNetworkManager.Instance.localPlayerController; int num = 0; if (setGear != 3) { num = ((setGear > (int)base.gear) ? 1 : 2); } base.gear = (CarGearShift)setGear; base.gearStickAudio.PlayOneShot(base.gearStickAudios[num]); ShiftToGearRpc((int)GameNetworkManager.Instance.localPlayerController.playerClientId, setGear, num); } } [Rpc(/*Could not decode attribute arguments.*/)] public void ShiftToGearRpc(int playerId, int setGear, int gearIndex) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_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_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(3646988633u, val2, val, (SendTo)5, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val3, playerId); BytePacker.WriteValueBitPacked(val3, setGear); BytePacker.WriteValueBitPacked(val3, gearIndex); ((NetworkBehaviour)this).__endSendRpc(ref val3, 3646988633u, val2, val, (SendTo)5, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; base.timeAtLastGearShift = Time.realtimeSinceStartup; playerWhoShifted = StartOfRound.Instance.allPlayerScripts[playerId]; base.gear = (CarGearShift)setGear; base.gearStickAudio.PlayOneShot(base.gearStickAudios[gearIndex]); } } } public void SetFrontCabinLightOn(bool setOn) { if (!setOn || !cabLightToggled) { base.frontCabinLightContainer.SetActive(setOn); ((Renderer)base.frontCabinLightMesh).material = (setOn ? base.headlightsOnMat : base.headlightsOffMat); } } public void ToggleCabinLights() { cabLightToggled = !cabLightToggled; ToggleCabinLightsLocalClient(cabLightToggled, accessoryMode); ToggleCabinLightsRpc(cabLightToggled, accessoryMode); } public void ToggleCabinLightsLocalClient(bool setToggle, bool accessoryMode) { if (setToggle) { SetFrontCabinLightOn(setOn: false); } else { SetFrontCabinLightOn(accessoryMode); } } [Rpc(/*Could not decode attribute arguments.*/)] public void ToggleCabinLightsRpc(bool setToggle, bool accessoriesOnThisFrame) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(559298925u, val2, val, (SendTo)5, (RpcDelivery)0); ((FastBufferWriter)(ref val3)).WriteValueSafe<bool>(ref setToggle, default(ForPrimitives)); ((FastBufferWriter)(ref val3)).WriteValueSafe<bool>(ref accessoriesOnThisFrame, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val3, 559298925u, val2, val, (SendTo)5, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; cabLightToggled = setToggle; ToggleCabinLightsLocalClient(cabLightToggled, accessoriesOnThisFrame); } } } public void StartTryCarIgnition() { if (base.localPlayerInControl && !base.ignitionStarted) { CancelIgnitionCoroutine(); disableAnimations = true; inIgnitionAnimation = true; base.keyIgnitionCoroutine = ((MonoBehaviour)this).StartCoroutine(TryIgnition(isLocalDriver: true)); TryIgnitionRpc(base.keyIsInIgnition, accessoryMode); } } [IteratorStateMachine(typeof(<TryIgnition>d__234))] private IEnumerator TryIgnition(bool isLocalDriver) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <TryIgnition>d__234(0) { <>4__this = this, isLocalDriver = isLocalDriver }; } [Rpc(/*Could not decode attribute arguments.*/)] public void TryIgnitionRpc(bool setKeyInSlot, bool accessoriesActive) { //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) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(1565903847u, val2, val, (SendTo)5, (RpcDelivery)0); ((FastBufferWriter)(ref val3)).WriteValueSafe<bool>(ref setKeyInSlot, default(ForPrimitives)); ((FastBufferWriter)(ref val3)).WriteValueSafe<bool>(ref accessoriesActive, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val3, 1565903847u, val2, val, (SendTo)5, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (!base.ignitionStarted) { CancelIgnitionCoroutine(); disableAnimations = true; inIgnitionAnimation = true; SetKeyIgnitionValues(keyTwisting: false, keyInHand: false, setKeyInSlot); if (accessoryMode != accessoriesActive) { accessoryMode = accessoriesActive; SetFrontCabinLightOn(accessoryMode); } base.keyIgnitionCoroutine = ((MonoBehaviour)this).StartCoroutine(TryIgnition(isLocalDriver: false)); } } [Rpc(/*Could not decode attribute arguments.*/)] public void TryStartIgnitionRpc(bool shiftInterlock) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(1377561967u, val2, val, (SendTo)5, (RpcDelivery)0); ((FastBufferWriter)(ref val3)).WriteValueSafe<bool>(ref shiftInterlock, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val3, 1377561967u, val2, val, (SendTo)5, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (shiftInterlock) { PlayIgnitionAudio(); } accessoryMode = true; if (!hasSweepedDashboard && dashboardSymbolCoroutine == null) { dashboardSymbolCoroutine = ((MonoBehaviour)this).StartCoroutine(TryDashboardSweep()); } SetKeyIgnitionValues(keyTwisting: true, keyInHand: true, keyInSlot: true); SetFrontCabinLightOn(accessoryMode); SetDashboardGaugesOn(on: true); } } private void PlayIgnitionAudio() { if (!hasPlayedIgnitionChime) { hasPlayedIgnitionChime = true; cabinAudio.Play(); } base.engineAudio1.Stop(); base.engineAudio1.clip = base.revEngineStart; base.engineAudio1.volume = 0.7f; base.engineAudio1.PlayOneShot(base.engineRev); base.carEngine1AudioActive = true; base.engineAudio1.pitch = 1f; } public void CancelTryCarIgnition() { if (base.localPlayerInControl && !base.ignitionStarted && base.keyIgnitionCoroutine != null && (base.keyIgnitionCoroutine != null || !startIgnitionTrigger.isBeingHeldByPlayer)) { PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController; if (localPlayerController.playerBodyAnimator.GetInteger("SA_CarAnim") == 2 && base.keyIsInIgnition) { localPlayerController.playerBodyAnimator.SetInteger("SA_CarAnim", 3); } else if (localPlayerController.playerBodyAnimator.GetInteger("SA_CarAnim") == 12 && base.keyIsInIgnition) { localPlayerController.playerBodyAnimator.SetInteger("SA_CarAnim", 3); } else { localPlayerController.playerBodyAnimator.SetInteger("SA_CarAnim", 0); } CancelIgnitionAnimation(ignitionOn: false, setIgnitionAnim: false); disableAnimations = true; inIgnitionAnimation = false; int integer = localPlayerController.playerBodyAnimator.GetInteger("SA_CarAnim"); int num = integer; if (integer == 13) { num = 3; } ignitionAnimator.SetInteger("SAIgnition_Anim", num); CancelTryIgnitionRpc(base.keyIsInIgnition, accessoryMode, integer, num); } } [Rpc(/*Could not decode attribute arguments.*/)] public void CancelTryIgnitionRpc(bool setKeyInSlot, bool accessoriesActive, 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_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_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_00ac: 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_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(4062380867u, val2, val, (SendTo)5, (RpcDelivery)0); ((FastBufferWriter)(ref val3)).WriteValueSafe<bool>(ref setKeyInSlot, default(ForPrimitives)); ((FastBufferWriter)(ref val3)).WriteValueSafe<bool>(ref accessoriesActive, default(ForPrimitives)); BytePacker.WriteValueBitPacked(val3, playerAnimIndex); BytePacker.WriteValueBitPacked(val3, ignitionAnimIndex); ((NetworkBehaviour)this).__endSendRpc(ref val3, 4062380867u, val2, val, (SendTo)5, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; CancelIgnitionAnimation(ignitionOn: false, setIgnitionAnim: false); disableAnimations = true; inIgnitionAnimation = false; PlayerControllerB currentDriver = base.currentDriver; if (currentDriver != null) { currentDriver.playerBodyAnimator.SetInteger("SA_CarAnim", playerAnimIndex); } ignitionAnimator.SetInteger("SAIgnition_Anim", ignitionAnimIndex); if (setKeyInSlot && !base.keyIsInIgnition) { carKeyAudio.PlayOneShot(base.insertKey); } SetKeyIgnitionValues(keyTwisting: false, keyInHand: false, setKeyInSlot); SetDashboardGaugesOn(accessoriesActive); if (accessoryMode != accessoriesActive) { accessoryMode = accessoriesActive; SetFrontCabinLightOn(accessoryMode); } } } [Rpc(/*Could not decode attribute arguments.*/)] public void StartIgnitionRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(2218070621u, val2, val, (SendTo)5, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendRpc(ref val3, 2218070621u, val2, val, (SendTo)5, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; disableAnimations = false; inIgnitionAnimation = false; PlayerControllerB currentDriver = base.currentDriver; if (currentDriver != null) { currentDriver.playerBodyAnimator.SetInteger("SA_CarAnim", 1); } SetKeyIgnitionValues(keyTwisting: false, keyInHand: false, keyInSlot: true); SetIgnition(started: true, cabLightOn: true); SetFrontCabinLightOn(accessoryMode); SetDashboardGaugesOn(on: true); CancelIgnitionAnimation(ignitionOn: true, setIgnitionAnim: true); } } public void SetIgnition(bool started, bool cabLightOn) { SetFrontCabinLightOn(cabLightOn); base.carEngine1AudioActive = started; if (started) { disableAnimations = false; inIgnitionAnimation = false; base.startKeyIgnitionTrigger.SetActive(false); base.removeKeyIgnitionTrigger.SetActive(true); if (started != base.ignitionStarted) { base.ignitionStarted = true; base.carExhaustParticle.Play(); base.engineAudio1.Stop(); base.engineAudio1.PlayOneShot(base.engineStartSuccessful); base.engineAudio1.clip = base.engineRun; } } else { base.startKeyIgnitionTrigger.SetActive(true); base.removeKeyIgnitionTrigger.SetActive(false); base.ignitionStarted = false; base.carExhaustParticle.Stop(true, (ParticleSystemStopBehavior)1); } } public void RemoveKeyFromIgnition() { if (base.localPlayerInControl && base.ignitionStarted && !inIgnitionAnimation) { CancelIgnitionCoroutine(); base.keyIgnitionCoroutine = ((MonoBehaviour)this).StartCoroutine(RemoveKey()); base.chanceToStartIgnition = 10f; RemoveKeyFromIgnitionRpc(); } } [IteratorStateMachine(typeof(<RemoveKey>d__243))] private IEnumerator RemoveKey() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <RemoveKey>d__243(0) { <>4__this = this }; } [Rpc(/*Could not decode attribute arguments.*/)] public void RemoveKeyFromIgnitionRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(2004876350u, val2, val, (SendTo)5, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendRpc(ref val3, 2004876350u, val2, val, (SendTo)5, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (base.ignitionStarted) { CancelIgnitionCoroutine(); base.keyIgnitionCoroutine = ((MonoBehaviour)this).StartCoroutine(RemoveKey()); } } } public void CancelIgnitionAnimation(bool ignitionOn, bool setIgnitionAnim) { CancelIgnitionCoroutine(); base.carEngine1AudioActive = ignitionOn; twistingKey = false; base.keyIsInDriverHand = false; if (setIgnitionAnim) { ignitionAnimator.SetInteger("SAIgnition_Anim", ignitionOn ? 1 : 0); } } internal void CancelIgnitionCoroutine() { if (base.keyIgnitionCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(base.keyIgnitionCoroutine); base.keyIgnitionCoroutine = null; } } public void SetKeyIgnitionValues(bool keyTwisting, bool keyInHand, bool keyInSlot) { twistingKey = keyTwisting; base.keyIsInDriverHand = keyInHand; base.keyIsInIgnition = keyInSlot; } public void SetTriggerHoverTip(InteractTrigger trigger, string tip) { trigger.hoverTip = tip; } [Rpc(/*Could not decode attribute arguments.*/)] public void CancelSetPlayerInVehicleClientRpc(int playerId) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(2613342545u, val2, val, (SendTo)6, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val3, playerId); ((NetworkBehaviour)this).__endSendRpc(ref val3, 2613342545u, val2, val, (SendTo)6, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if ((int)GameNetworkManager.Instance.localPlayerController.playerClientId == playerId) { HUDManager.Instance.DisplayTip("Kicked from vehicle", "You have been forcefully kicked to prevent a softlock!", false, false, "LC_Tip1"); } } } public void SetDriverInCar() { //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) SetDriverInCarServerRpc((int)GameNetworkManager.Instance.localPlayerController.playerClientId); } [Rpc(/*Could not decode attribute arguments.*/)] protected void SetDriverInCarServerRpc(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_010f: 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_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 }; FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(3575576769u, rpcParams, val, (SendTo)2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, playerId); ((NetworkBehaviour)this).__endSendRpc(ref val2, 3575576769u, 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)) { base.currentDriver = val3; ((NetworkBehaviour)this).NetworkObject.ChangeOwnership(rpcParams.Receive.SenderClientId); SetDriverInCarOwnerRpc(NetworkBehaviourReference.op_Implicit((NetworkBehaviour)(object)val3)); } } } [Rpc(/*Could not decode attribute arguments.*/)] protected void SetDriverInCarOwnerRpc(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) //IL_0206: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(2061638504u, val2, val, (SendTo)0, (RpcDelivery)0); ((FastBufferWriter)(ref val3)).WriteValueSafe<NetworkBehaviourReference>(ref playerNetObjRef, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendRpc(ref val3, 2061638504u, val2, val, (SendTo)0, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; PlayerUtils.disableAnimationSync = true; ((VehicleSeatAnimator)frontLeftSeat).SetLocalPlayerIntoSeat(); ActivateControl(); SetTriggerHoverTip(base.driverSideDoorTrigger, "Exit : [LMB]"); startIgnitionTrigger.isBeingHeldByPlayer = false; stopIgnitionTrigger.isBeingHeldByPlayer = false; CancelIgnitionCoroutine(); GameNetworkManager.Instance.localPlayerController.playerBodyAnimator.SetFloat("animationSpeed", 0.5f); playerSteeringWheelAnimFloat = 0.5f; syncedPlayerSteeringAnim = 0.5f; if (base.keyIsInIgnition) { GameNetworkManager.Instance.localPlayerController.playerBodyAnimator.SetInteger("SA_CarAnim", 0); } else if (base.ignitionStarted) { GameNetworkManager.Instance.localPlayerController.playerBodyAnimator.SetInteger("SA_CarAnim", 1); } else { GameNetworkManager.Instance.localPlayerController.playerBodyAnimator.SetInteger("SA_CarAnim", 0); } int integer = GameNetworkManager.Instance.localPlayerController.playerBodyAnimator.GetInteger("SA_CarAnim"); if (base.driverSideDoor.boolValue) { base.driverSideDoor.TriggerAnimation(GameNetworkManager.Instance.localPlayerController); } SetDriverInCarNotOwnerRpc(NetworkBehaviourReference.op_Implicit((NetworkBehaviour)(object)GameNetworkManager.Instance.localPlayerController), accessoryMode, base.keyIsInIgnition, base.ignitionStarted, integer); } } [Rpc(/*Could not decode attribute arguments.*/)] public void SetDriverInCarNotOwnerRpc(NetworkBehaviourReference playerNetObjRef, bool accessoriesActive, bool setKeyInSlot, bool engineStarted, int currentAnimIndex) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_011d: 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_00e2: 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_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(388386796u, val2, val, (SendTo)1, (RpcDelivery)0); ((FastBufferWriter)(ref val3)).WriteValueSafe<NetworkBehaviourReference>(ref playerNetObjRef, default(ForNetworkSerializable)); ((FastBufferWriter)(ref val3)).WriteValueSafe<bool>(ref accessoriesActive, default(ForPrimitives)); ((FastBufferWriter)(ref val3)).WriteValueSafe<bool>(ref setKeyInSlot, default(ForPrimitives)); ((FastBufferWriter)(ref val3)).WriteValueSafe<bool>(ref engineStarted, default(ForPrimitives)); BytePacker.WriteValueBitPacked(val3, currentAnimIndex); ((NetworkBehaviour)this).__endSendRpc(ref val3, 388386796u, val2, val, (SendTo)1, (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<PlayerControllerB>(ref val4, (NetworkManager)null)) { Plugin.Logger.LogError((object)"SetDriverIntoCarNotOwnerRpc failed to find player object reference from network behaviour!"); return; } base.currentDriver = val4; ((VehicleSeatAnimator)frontLeftSeat).SetPlayerAnimations(val4, false); startIgnitionTrigger.isBeingHeldByPlayer = false; stopIgnitionTrigger.isBeingHeldByPlayer = false; CancelIgnitionCoroutine(); val4.playerBodyAnimator.SetFloat("animationSpeed", 0.5f); playerSteeringWheelAnimFloat = 0.5f; syncedPlayerSteeringAnim = 0.5f; SetDashboardGaugesOn(gaugesOn); accessoryMode = accessoriesActive; SetFrontCabinLightOn(accessoriesActive); base.keyIsInIgnition = setKeyInSlot; base.ignitionStarted = engineStarted; val4.playerBodyAnimator.SetInteger("SA_CarAnim", currentAnimIndex); } } public void OnDriverExitCar() { //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_0130: 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_0145: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) if (((NetworkBehaviour)this).IsSpawned && !((Object)(object)((NetworkBehaviour)this).NetworkManager == (Object)null) && ((NetworkBehaviour)this).NetworkManager.IsListening) { PlayerUtils.disableAnimationSync = false; base.localPlayerInControl = false; SetTriggerHoverTip(base.driverSideDoorTrigger, "Use door : [LMB]"); disableAnimations = !base.ignitionStarted; inIgnitionAnimation = false; startIgnitionTrigger.isBeingHeldByPlayer = false; stopIgnitionTrigger.isBeingHeldByPlayer = false; GameNetworkManager.Instance.localPlayerController.playerBodyAnimator.SetInteger("SA_CarAnim", 0); GlobalUtilities.ResetHUDToolTips(GameNetworkManager.Instance.localPlayerController); if ((Object)(object)base.currentDriver != (Object)(object)GameNetworkManager.Instance.localPlayerController) { HUDManager.Instance.DisplayTip("Err?", "This state should not occur! aborting!", false, false, "LC_Tip1"); return; } DisableControl(); CancelIgnitionAnimation(base.ignitionStarted, setIgnitionAnim: true); SetIgnition(base.ignitionStarted, accessoryMode); base.chanceToStartIgnition = 10f; base.syncedPosition = ((Component)this).transform.position; base.syncedRotation = ((Component)this).transform.rotation; OnDriverExitCarRpc(NetworkBehaviourReference.op_Implicit((NetworkBehaviour)(object)GameNetworkManager.Instance.localPlayerController), base.syncedPosition, base.syncedRotation, base.keyIsInIgnition, base.ignitionStarted, accessoryMode); } } [Rpc(/*Could not decode attribute arguments.*/)] public void OnDriverExitCarRpc(NetworkBehaviourReference playerNetObjRef, Vector3 carLocation, Quaternion carRotation, bool setKeyInSlot, bool engineStarted, bool accessoriesActive) { //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_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_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_00d2: 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) //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 ref