Decompiled source of Company Hauler v2.2.34

BepInEx/plugins/companyhauler/glojam.CompanyHauler.dll

Decompiled 3 days ago
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.Permissions;
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Configuration;
using BepInEx.Logging;
using CompanyHauler.Compatibility;
using CompanyHauler.Scripts;
using CompanyHauler.Utils;
using FirstPersonView;
using GameNetcodeStuff;
using HarmonyLib;
using LethalCompanyInputUtils.Api;
using LethalMin;
using Microsoft.CodeAnalysis;
using ScandalLib.Interfaces;
using ScandalLib.Patches;
using ScandalLib.Scripts;
using ScandalsTweaks.Scripts;
using ScandalsTweaks.Utils;
using TMPro;
using Unity.Netcode;
using UnityEngine;
using UnityEngine.InputSystem;
using UnityEngine.Rendering.HighDefinition;
using UnityEngine.UI;
using VoxxWeatherPlugin.Patches;
using VoxxWeatherPlugin.Utils;
using glojam.CompanyHauler.NetcodePatcher;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: IgnoresAccessChecksTo("FirstPersonView")]
[assembly: IgnoresAccessChecksTo("NoteBoxz.LethalMin")]
[assembly: IgnoresAccessChecksTo("scandal.scandallib")]
[assembly: IgnoresAccessChecksTo("scandal.scandalstweaks")]
[assembly: IgnoresAccessChecksTo("Unity.Netcode.Runtime")]
[assembly: IgnoresAccessChecksTo("voxx.LethalElementsPlugin")]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("glojam.CompanyHauler")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("2.2.33.0")]
[assembly: AssemblyInformationalVersion("2.2.33+2cdf2f0d767535455cd5c76901ab6683d4b9dbef")]
[assembly: AssemblyProduct("CompanyHauler")]
[assembly: AssemblyTitle("glojam.CompanyHauler")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("2.2.33.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
[module: NetcodePatchedAssembly]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableAttribute : Attribute
	{
		public readonly byte[] NullableFlags;

		public NullableAttribute(byte P_0)
		{
			NullableFlags = new byte[1] { P_0 };
		}

		public NullableAttribute(byte[] P_0)
		{
			NullableFlags = P_0;
		}
	}
	[CompilerGenerated]
	[Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableContextAttribute : Attribute
	{
		public readonly byte Flag;

		public NullableContextAttribute(byte P_0)
		{
			Flag = P_0;
		}
	}
	[CompilerGenerated]
	[Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
public class HaulerCollisionTrigger : MonoBehaviour
{
	public HaulerController mainScript;

	public BoxCollider insideTruckNavMeshBounds;

	public EnemyAI[] enemiesLastHit;

	private float timeSinceHittingPlayer;

	private float timeSinceHittingEnemy;

	private int enemyIndex;

	public void Start()
	{
		enemiesLastHit = (EnemyAI[])(object)new EnemyAI[3];
	}

	public void OnTriggerEnter(Collider other)
	{
		//IL_00af: Unknown result type (might be due to invalid IL or missing references)
		//IL_00bf: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c4: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c9: 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_00da: Unknown result type (might be due to invalid IL or missing references)
		//IL_00df: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e4: Unknown result type (might be due to invalid IL or missing references)
		//IL_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_036f: Unknown result type (might be due to invalid IL or missing references)
		//IL_037f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0384: Unknown result type (might be due to invalid IL or missing references)
		//IL_0389: Unknown result type (might be due to invalid IL or missing references)
		//IL_0393: Unknown result type (might be due to invalid IL or missing references)
		//IL_0398: Unknown result type (might be due to invalid IL or missing references)
		//IL_0133: Unknown result type (might be due to invalid IL or missing references)
		//IL_0143: Unknown result type (might be due to invalid IL or missing references)
		//IL_0148: Unknown result type (might be due to invalid IL or missing references)
		//IL_03e4: Unknown result type (might be due to invalid IL or missing references)
		//IL_03f5: Unknown result type (might be due to invalid IL or missing references)
		//IL_0400: Unknown result type (might be due to invalid IL or missing references)
		//IL_0405: Unknown result type (might be due to invalid IL or missing references)
		//IL_0172: Unknown result type (might be due to invalid IL or missing references)
		//IL_017c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0181: Unknown result type (might be due to invalid IL or missing references)
		//IL_0429: Unknown result type (might be due to invalid IL or missing references)
		//IL_042e: Unknown result type (might be due to invalid IL or missing references)
		//IL_043f: Unknown result type (might be due to invalid IL or missing references)
		//IL_045d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0462: Unknown result type (might be due to invalid IL or missing references)
		//IL_0473: Unknown result type (might be due to invalid IL or missing references)
		//IL_02af: Unknown result type (might be due to invalid IL or missing references)
		//IL_02ba: Unknown result type (might be due to invalid IL or missing references)
		//IL_02c5: Unknown result type (might be due to invalid IL or missing references)
		//IL_01c2: Unknown result type (might be due to invalid IL or missing references)
		//IL_01c9: Unknown result type (might be due to invalid IL or missing references)
		//IL_01cf: Unknown result type (might be due to invalid IL or missing references)
		//IL_053c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0541: 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_0557: Unknown result type (might be due to invalid IL or missing references)
		//IL_0559: Unknown result type (might be due to invalid IL or missing references)
		//IL_056c: Expected I4, but got Unknown
		//IL_021a: Unknown result type (might be due to invalid IL or missing references)
		//IL_026e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0273: Unknown result type (might be due to invalid IL or missing references)
		//IL_057d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0582: Unknown result type (might be due to invalid IL or missing references)
		//IL_058a: Unknown result type (might be due to invalid IL or missing references)
		//IL_05b3: Unknown result type (might be due to invalid IL or missing references)
		//IL_05b8: Unknown result type (might be due to invalid IL or missing references)
		//IL_05c0: Unknown result type (might be due to invalid IL or missing references)
		//IL_05e9: Unknown result type (might be due to invalid IL or missing references)
		//IL_05ee: Unknown result type (might be due to invalid IL or missing references)
		//IL_05f6: Unknown result type (might be due to invalid IL or missing references)
		//IL_0508: Unknown result type (might be due to invalid IL or missing references)
		//IL_050e: Invalid comparison between Unknown and I4
		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);
			}
			else
			{
				if (val4.mainScript is BushWolfEnemy)
				{
					return;
				}
				EnemyAI obj = val4.mainScript;
				FlowerSnakeEnemy val5 = (FlowerSnakeEnemy)(object)((obj is FlowerSnakeEnemy) ? obj : null);
				if ((val5 != null && Object.op_Implicit((Object)(object)val5.clingingToPlayer)) || 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;
				switch ((int)enemySize)
				{
				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
{
	[BepInPlugin("glojam.CompanyHauler", "CompanyHauler", "2.2.33")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	public class Plugin : BaseUnityPlugin
	{
		internal static VehicleControls VehicleControlsInstance;

		internal static bool initialized;

		public static Plugin Instance { get; private set; }

		internal static ManualLogSource Logger { get; private set; }

		internal static Harmony? Harmony { get; set; }

		public void Awake()
		{
			if (!initialized)
			{
				initialized = true;
				Logger = ((BaseUnityPlugin)this).Logger;
				Instance = this;
				VehicleControlsInstance = new VehicleControls();
				UserConfig.InitConfig();
				Patch();
				LogInfo("glojam.CompanyHauler v2.2.33 has loaded!");
			}
		}

		internal static void Patch()
		{
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Expected O, but got Unknown
			if (Harmony == null)
			{
				Harmony = new Harmony("glojam.CompanyHauler");
			}
			LogDebug("Patching...");
			CompatibilityUtils.Init(Harmony);
			Harmony.PatchAll();
			LogDebug("Finished patching!");
		}

		internal static void Unpatch()
		{
			LogDebug("Unpatching...");
			Harmony? harmony = Harmony;
			if (harmony != null)
			{
				harmony.UnpatchSelf();
			}
			LogDebug("Finished unpatching!");
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		internal static void LogMessage(string messageLog)
		{
			Logger.LogMessage((object)messageLog);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		internal static void LogDebug(string debugLog)
		{
			Logger.LogDebug((object)debugLog);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		internal static void LogInfo(string infoLog)
		{
			Logger.LogInfo((object)infoLog);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		internal static void LogWarning(string warningLog)
		{
			Logger.LogWarning((object)warningLog);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		internal static void LogError(string errorLog)
		{
			Logger.LogError((object)errorLog);
		}
	}
	public static class MyPluginInfo
	{
		public const string PLUGIN_GUID = "glojam.CompanyHauler";

		public const string PLUGIN_NAME = "CompanyHauler";

		public const string PLUGIN_VERSION = "2.2.33";
	}
}
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_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			Bounds bounds = renderer.bounds;
			GeometryUtility.CalculateFrustumPlanes(playersCamera, frustumPlanes);
			if (GeometryUtility.TestPlanesAABB(frustumPlanes, bounds))
			{
				return true;
			}
			return false;
		}
	}
	internal static class CompatibilityUtils
	{
		internal const string GUID_LETHAL_LEVEL_LOADER = "imabatby.lethallevelloader";

		internal const string GUID_SCANDALLIB = "scandal.scandallib";

		internal const string GUID_SCANDALS_TWEAKS = "scandal.scandalstweaks";

		internal const string GUID_INPUT_UTILS = "com.rune580.LethalCompanyInputUtils";

		internal const string GUID_LETHALELEMENTS = "voxx.LethalElementsPlugin";

		internal const string GUID_LETHALMIN = "NoteBoxz.LethalMin";

		internal const string GUID_FIRST_PERSON_VIEW = "com.seeya.firstpersonview";

		internal static bool INSTALLED_LETHALELEMENTS;

		internal static bool INSTALLED_LETHALMIN;

		internal static bool INSTALLED_FIRST_PERSON_VIEW;

		internal static void Init(Harmony harmony)
		{
			if (Chainloader.PluginInfos.ContainsKey("voxx.LethalElementsPlugin"))
			{
				INSTALLED_LETHALELEMENTS = true;
				harmony.PatchAll(typeof(LethalElementsCompatibility));
				Plugin.LogDebug("CROSS-COMPATIBILITY - LethalElements detected");
			}
			if (Chainloader.PluginInfos.ContainsKey("NoteBoxz.LethalMin"))
			{
				INSTALLED_LETHALMIN = true;
				harmony.PatchAll(typeof(LethalMinCompatibility));
				Plugin.LogDebug("CROSS-COMPATIBILITY - LethalMin detected");
			}
			if (Chainloader.PluginInfos.ContainsKey("com.seeya.firstpersonview"))
			{
				INSTALLED_FIRST_PERSON_VIEW = true;
				harmony.PatchAll(typeof(FirstPersonViewCompatibility));
				Plugin.LogDebug("CROSS-COMPATIBILITY - FirstPersonView detected");
			}
		}
	}
	internal class UserConfig
	{
		internal static ConfigEntry<bool> haulerMirror;

		internal static ConfigEntry<bool> RecenterWheel;

		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)");
			RecenterWheel = config.Bind<bool>("Quality Of Life", "Automatically Center Wheel", false, "Should the wheel be automatically re-centered?");
			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();
		}
	}
	internal class VehicleControls : LcInputActions
	{
		[InputAction(/*Could not decode attribute arguments.*/)]
		public InputAction GasPedalKey { get; set; }

		[InputAction(/*Could not decode attribute arguments.*/)]
		public InputAction BrakePedalKey { get; set; }

		[InputAction(/*Could not decode attribute arguments.*/)]
		public InputAction JumpKey { get; set; }

		[InputAction(/*Could not decode attribute arguments.*/)]
		public InputAction ToggleMagnetKey { get; set; }
	}
	public static class VehicleUtils
	{
		internal static HaulerController pickupController;

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		internal static bool IsPlayerLocal(PlayerControllerB? player)
		{
			if ((Object)(object)player != (Object)null)
			{
				return (Object)(object)player == (Object)(object)GameNetworkManager.Instance.localPlayerController;
			}
			return false;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static bool IsPlayerNearPickup(PlayerControllerB? playerScript, HaulerController? pickupScript)
		{
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)playerScript != (Object)null && (Object)(object)pickupScript != (Object)null)
			{
				return Vector3.Distance(((Component)playerScript).transform.position, ((VehicleController)pickupScript).mainRigidbody.position) <= 10f;
			}
			return false;
		}
	}
}
namespace CompanyHauler.Behaviour
{
	public class HaulerCameraManager : MonoBehaviour
	{
		public HaulerController mainController;

		public MeshRenderer[] meshMirrors;

		public Camera[] cameraMirrors;

		private bool disableRendering;

		private bool renderingEnabled;

		public float cameraFramerate;

		public int camerasToRenderPerFrame = 1;

		private float elapsed;

		private int nextCameraToRender;

		private float cameraRenderCountRemainder;

		public void LateUpdate()
		{
			if ((Object)(object)mainController == (Object)null || cameraMirrors == null || meshMirrors == null || !((NetworkBehaviour)mainController).IsSpawned || ((VehicleController)mainController).destroyNextFrame || ((VehicleController)mainController).carDestroyed)
			{
				return;
			}
			PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController;
			if ((Object)(object)localPlayerController == (Object)null)
			{
				return;
			}
			disableRendering = !UserConfig.haulerMirror.Value || !mainController.IsPlayerSeatedInCar();
			if (disableRendering)
			{
				renderingEnabled = false;
				for (int i = 0; i < cameraMirrors.Length; i++)
				{
					if (!((Object)(object)cameraMirrors[i] == (Object)null) && !((Object)(object)meshMirrors[i] == (Object)null))
					{
						((Behaviour)cameraMirrors[i]).enabled = false;
						((Renderer)meshMirrors[i]).enabled = false;
					}
				}
				return;
			}
			if (!renderingEnabled)
			{
				renderingEnabled = true;
				for (int j = 0; j < cameraMirrors.Length; j++)
				{
					if (!((Object)(object)cameraMirrors[j] == (Object)null) && !((Object)(object)meshMirrors[j] == (Object)null))
					{
						((Behaviour)cameraMirrors[j]).enabled = false;
						((Renderer)meshMirrors[j]).enabled = true;
					}
				}
			}
			int num = 0;
			for (int k = 0; k < cameraMirrors.Length; k++)
			{
				if (!((Object)(object)cameraMirrors[k] == (Object)null) && !((Object)(object)meshMirrors[k] == (Object)null))
				{
					((Behaviour)cameraMirrors[k]).enabled = false;
					if (((Renderer)(object)meshMirrors[k]).IsVisibleToPlayersLocalCamera(localPlayerController.gameplayCamera))
					{
						num++;
					}
				}
			}
			elapsed += Time.deltaTime;
			if (elapsed < 1f / cameraFramerate)
			{
				return;
			}
			elapsed = 0f;
			float num2 = (float)camerasToRenderPerFrame * (float)num / (float)cameraMirrors.Length;
			cameraRenderCountRemainder += num2;
			int num3 = (nextCameraToRender + cameraMirrors.Length - 1) % cameraMirrors.Length;
			while (cameraRenderCountRemainder >= 1f)
			{
				if ((Object)(object)meshMirrors[nextCameraToRender] != (Object)null && (Object)(object)cameraMirrors[nextCameraToRender] != (Object)null && ((Renderer)(object)meshMirrors[nextCameraToRender]).IsVisibleToPlayersLocalCamera(localPlayerController.gameplayCamera))
				{
					((Renderer)meshMirrors[nextCameraToRender]).enabled = true;
					((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;

		public void OnSunroofOpen()
		{
			haulerController.sunroofOpen = true;
		}

		public void OnSunroofClose()
		{
			haulerController.sunroofOpen = false;
		}
	}
	public class HaulerController : VehicleController
	{
		[Header("DEBUG")]
		public bool isInTestMode;

		public float debugMotorTorque;

		public float debugBrakeTorque;

		public float debugSteeringAngle;

		[Header("Networking")]
		private bool receivedClientSyncData;

		public bool syncedDrivePedalPressed;

		public bool syncedBrakePedalPressed;

		public float tyreStress;

		public bool wheelSlipping;

		public bool wheelSkidActive;

		public float syncedEngineRPM;

		public float syncedFrontWheelRPM;

		public float syncedBackWheelRPM;

		public float syncedWheelRPM;

		public int syncedCarHP;

		public float syncEffectsInterval;

		public float syncTorqueInterval;

		public float syncDrivetrainInterval;

		public float syncedSteeringRotation;

		public float syncedCurrentMotorTorque;

		public float syncedCurrentBrakeTorque;

		private float syncedSongTime;

		[Header("Player")]
		public ExtendedPhysicsRegion vehicleZone;

		public ExtendedPlayerZone vehicleCabZone;

		public PlayerControllerB lastDriver;

		public PlayerControllerB playerWhoShifted;

		public PlayerControllerB? currentBackLeftPassenger;

		public PlayerControllerB? currentBackMiddlePassenger;

		public PlayerControllerB? currentBackRightPassenger;

		public HaulerSeatAnimator frontLeftSeat;

		public HaulerSeatAnimator frontRightSeat;

		public HaulerSeatAnimator backLeftSeat;

		public HaulerSeatAnimator backSeat;

		public HaulerSeatAnimator backRightSeat;

		public Transform[] backLeftExitPoints;

		public Transform[] backRightExitPoints;

		public AnimatedObjectTrigger backLeftDoor;

		public AnimatedObjectTrigger backRightDoor;

		public InteractTrigger backLeftDoorTrigger;

		public InteractTrigger backRightDoorTrigger;

		public InteractTrigger backLeftPassengerSeatTrigger;

		public InteractTrigger backPassengerSeatTrigger;

		public InteractTrigger backRightPassengerSeatTrigger;

		public bool localPlayerInBackLeftPassengerSeat;

		public bool localPlayerInMiddlePassengerSeat;

		public bool localPlayerInBackRightPassengerSeat;

		[Header("Physics")]
		public HaulerWheelCollider frontLeftWheel;

		public HaulerWheelCollider frontRightWheel;

		public HaulerWheelCollider backLeftWheel;

		public HaulerWheelCollider backRightWheel;

		public HaulerCollisionTrigger collisionTrigger;

		public float timeSinceLastCollision;

		public List<WheelCollider> allWheels;

		private WheelHit[] wheelHits = (WheelHit[])(object)new WheelHit[4];

		public Rigidbody playerPhysicsBody;

		public AnimationCurve steeringCurve;

		public Vector3 previousVehiclePosition;

		public Quaternion previousVehicleRotation;

		public AnimationCurve engineCurve;

		public AnimationCurve enginePowerCurve;

		public float torqueBoost = 1.25f;

		public float enginePower;

		public float engineReversePower;

		public bool forwardSlipping;

		public bool sidewaySlipping;

		public Coroutine shiftGearCoroutine;

		public float[] gearRatios;

		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;

		public Collider[] weatherEffectBlockers;

		public InteractTrigger startIgnitionTrigger;

		public InteractTrigger stopIgnitionTrigger;

		public Animator ignitionAnimator;

		public GameObject carKeyContainer;

		public GameObject keyItemHolder;

		public Transform ignitionKeyPosition;

		private static readonly Vector3 ignitionKeyScale = new Vector3(1f, 1f, 1f);

		private static readonly Vector3 keyPosLocal = new Vector3(0.05029682f, 0.1181492f, -0.09794867f);

		private static readonly Vector3 keyPosServer = new Vector3(0.0414306f, 0.09218378f, -0.09290992f);

		private static readonly Vector3 keyRotLocal = new Vector3(29.962f, -2.063f, -3.106f);

		private static readonly Vector3 keyRotServer = new Vector3(29.427f, -5.158f, -53.66f);

		public HaulerWindow frontLeftWindow;

		public HaulerWindow frontRightWindow;

		public HaulerWindow backLeftWindow;

		public HaulerWindow backRightWindow;

		public Material needleOnMaterial;

		public Material needleOffMaterial;

		public Material tachometerOnMaterial;

		public Material tachometerOffMaterial;

		public Material speedometerOnMaterial;

		public Material speedometerOffMaterial;

		public GameObject gaugeLightContainer;

		public Image speedometerImage;

		public Image tachometerImage;

		public MeshRenderer speedometerMesh;

		public MeshRenderer tachometerMesh;

		public Transform speedometerTransform;

		public Transform tachometerTransform;

		public Collider startIgnitionCollider;

		public Collider stopIgnitionCollider;

		public float speedometerFloat;

		public float tachometerFloat;

		private Coroutine dashboardSweepCoroutine;

		private int currentSweepStage;

		private bool hasSweepedDashboard;

		public SpriteRenderer tractionControlSymbol;

		private bool tractionControlLightActive;

		public SpriteRenderer checkEngineSymbol;

		private bool hasPlayedCheckEngineWarning;

		private bool checkEngineLightActive;

		public SpriteRenderer coolantLevelSymbol;

		private bool coolantLevelLightActive;

		public SpriteRenderer immobiliserSymbol;

		public SpriteRenderer leftSignalSymbol;

		public SpriteRenderer hazardSignalSymbol;

		public SpriteRenderer rightSignalSymbol;

		public SpriteRenderer dippedBeamSymbol;

		private bool dippedBeamLightActive;

		public SpriteRenderer mainBeamSymbol;

		private bool mainBeamLightActive;

		public SpriteRenderer oilLevelSymbol;

		private bool oilLevelLightActive;

		public SpriteRenderer parkingBrakeSymbol;

		private bool parkingBrakeLightActive;

		public SpriteRenderer batteryLowSymbol;

		private bool batteryLowLightActive;

		public bool brakeLightsOn;

		public GameObject centerMountedLightContainer;

		public MeshRenderer centerMountedLight;

		public Material backLightOffMat;

		public Transform tempPushTransform;

		public MeshRenderer windshieldMesh;

		public AnimatedObjectTrigger windowWipers;

		public bool automaticWipersOn;

		private bool setAudiosMuted;

		public bool tailgateOpen;

		public bool sunroofOpen;

		public bool isCabinLightToggled;

		public bool isCabinLightOn;

		public float playerSteeringWheelAnimFloat;

		public float syncedPlayerSteeringAnim;

		public float shiftSpeed = 25f;

		public bool gaugesOn;

		public bool headlampsOn;

		public bool disableAnimations;

		public bool inIgnitionAnimation;

		public bool ignitionOn;

		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";

		private const string DOOR_ENTER_HOVERTIP = "Use door : [LMB]";

		private const string DOOR_EXIT_HOVERTIP = "Exit : [LMB]";

		private const string HOOD_ANIMATION_BOOL = "hoodOpen";

		private const string PLAYER_MOVEMENT = "Move";

		[Header("Destruction")]
		public GameObject[] disableOnDestroy;

		public GameObject mainBodyContainer;

		public GameObject sunroofContainer;

		public GameObject hoodDoorContainer;

		public GameObject frontLeftDoorContainer;

		public GameObject frontRightDoorContainer;

		public GameObject backLeftDoorContainer;

		public GameObject backRightDoorContainer;

		[Header("Audio")]
		public AudioSource roofRainAudio;

		public AudioSource cabinAudio;

		public AudioClip ignitionChime;

		public AudioClip chimeSoundWarning;

		public AudioSource carKeyAudio;

		public AudioClip dashButtonPress;

		public AudioSource windshieldAudio;

		public AudioSource roofInteractionAudio;

		public AudioSource leftDashboardAudio;

		public AudioSource centerDashboardAudio;

		public AudioSource rightDashboardAudio;

		public bool roofRainAudioActive;

		public bool hasPlayedIgnitionChime;

		public float timeLastSyncedRadio;

		public float radioPingTimestamp;

		public float asymSlip = 0.87f;

		public float asymVlaue = 0.94f;

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static bool IsInShipPhaseAndNotLoadingLevel()
		{
			if (StartOfRound.Instance.inShipPhase)
			{
				return !StartOfRound.Instance.beganLoadingNewLevel;
			}
			return false;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static bool IsInShipPhaseAndLoadingLevel()
		{
			if (StartOfRound.Instance.inShipPhase)
			{
				return StartOfRound.Instance.beganLoadingNewLevel;
			}
			return false;
		}

		public void OnEnable()
		{
			VehicleUtils.pickupController = this;
		}

		public void Awake()
		{
			//IL_005d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_006e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0073: Unknown result type (might be due to invalid IL or missing references)
			base.ragdollPhysicsBody.interpolation = (RigidbodyInterpolation)0;
			base.windwiperPhysicsBody1.interpolation = (RigidbodyInterpolation)0;
			base.windwiperPhysicsBody2.interpolation = (RigidbodyInterpolation)0;
			playerPhysicsBody.interpolation = (RigidbodyInterpolation)0;
			playerPhysicsBody.constraints = (RigidbodyConstraints)126;
			base.backDoorOpen = true;
			((VehicleController)this).Awake();
			((PlayerPhysicsRegion)vehicleZone).priority = 1;
			base.syncedPosition = ((Component)this).transform.position;
			base.syncedRotation = ((Component)this).transform.rotation;
			InitializePickup();
		}

		public void SetBackDoorOpen(bool open)
		{
			tailgateOpen = open;
		}

		public void Start()
		{
			//IL_0113: Unknown result type (might be due to invalid IL or missing references)
			//IL_0122: Unknown result type (might be due to invalid IL or missing references)
			//IL_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)
			((MonoBehaviour)this).StartCoroutine(SetRainCollision());
			if (maxBrakeTorque > maxParkingBrakeTorque)
			{
				maxBrakeTorque = maxParkingBrakeTorque - 100f;
			}
			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 && !IsInShipPhaseAndLoadingLevel())
			{
				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();
			}
		}

		public void SendClientSyncData(ulong clientId)
		{
			//IL_000e: 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_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: 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_00e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ed: Expected I4, but got Unknown
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			if (base.magnetedToShip)
			{
				Vector3 eulerAngles = ((Quaternion)(ref base.magnetTargetRotation)).eulerAngles;
				MagnetCarRpc(base.magnetTargetPosition, eulerAngles, base.magnetStartPosition, base.magnetStartRotation, RoundManager.Instance.tempTransform.eulerAngles, base.averageVelocityAtMagnetStart);
			}
			if (base.carDestroyed)
			{
				SyncDestroyedCarForClientRpc(base.carHP, RpcParams.op_Implicit(((NetworkBehaviour)this).RpcTarget.Single(clientId, (RpcTargetUse)0)));
			}
			else
			{
				ClientSyncDataRpc(base.carHP, base.keyIsInIgnition, base.ignitionStarted, ignitionOn, isCabinLightOn, isCabinLightToggled, headlampsOn, base.windshieldBroken, (int)base.gear, base.EngineRPM, wheelRPM, frontWheelRPM, backWheelRPM, currentMotorTorque, currentBrakeTorque, base.radioOn, base.radioTurnedOnBefore, base.currentRadioClip, RpcParams.op_Implicit(((NetworkBehaviour)this).RpcTarget.Single(clientId, (RpcTargetUse)0)));
			}
		}

		[Rpc(/*Could not decode attribute arguments.*/)]
		public void SyncDestroyedCarForClientRpc(int setCarHealth, 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)
			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(879248919u, rpcParams, val, (SendTo)8, (RpcDelivery)0);
				BytePacker.WriteValueBitPacked(val2, setCarHealth);
				((NetworkBehaviour)this).__endSendRpc(ref val2, 879248919u, rpcParams, val, (SendTo)8, (RpcDelivery)0);
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1)
			{
				((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0;
				if (!receivedClientSyncData)
				{
					receivedClientSyncData = true;
					base.carHP = setCarHealth;
					syncedCarHP = setCarHealth;
					base.timeAtLastDamage = Time.realtimeSinceStartup;
					DestroyCar();
				}
			}
		}

		[Rpc(/*Could not decode attribute arguments.*/)]
		public void ClientSyncDataRpc(int setCarHealth, bool setKeyInSlot, bool setStarted, bool setIgnitionOn, bool setCabinLightOn, bool setCabinLightSwitch, bool setHeadlightsOn, bool setWindowBroken, int currentGear, float engineSpeed, float wheelSpeed, float frontWheelSpeed, float backWheelSpeed, float setMotorTorque, float setBrakeTorque, bool setRadioOn, bool setRadioOnBefore, int radioClip, 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_0256: Unknown result type (might be due to invalid IL or missing references)
			//IL_0260: Invalid comparison between Unknown and I4
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0072: Unknown result type (might be due to invalid IL or missing references)
			//IL_0076: Unknown result type (might be due to invalid IL or missing references)
			//IL_008f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0095: Unknown result type (might be due to invalid IL or missing references)
			//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0101: Unknown result type (might be due to invalid IL or missing references)
			//IL_0116: Unknown result type (might be due to invalid IL or missing references)
			//IL_011c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0131: Unknown result type (might be due to invalid IL or missing references)
			//IL_0137: Unknown result type (might be due to invalid IL or missing references)
			//IL_0140: Unknown result type (might be due to invalid IL or missing references)
			//IL_0159: Unknown result type (might be due to invalid IL or missing references)
			//IL_015f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0174: Unknown result type (might be due to invalid IL or missing references)
			//IL_017a: Unknown result type (might be due to invalid IL or missing references)
			//IL_018f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0195: Unknown result type (might be due to invalid IL or missing references)
			//IL_01aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0201: Unknown result type (might be due to invalid IL or missing references)
			//IL_0216: Unknown result type (might be due to invalid IL or missing references)
			//IL_021c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0225: Unknown result type (might be due to invalid IL or missing references)
			//IL_023d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0241: Unknown result type (might be due to invalid IL or missing references)
			//IL_026f: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c7: Invalid comparison between Unknown and I4
			//IL_02d7: 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(1572298743u, rpcParams, val, (SendTo)8, (RpcDelivery)0);
				BytePacker.WriteValueBitPacked(val2, setCarHealth);
				((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref setKeyInSlot, default(ForPrimitives));
				((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref setStarted, default(ForPrimitives));
				((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref setIgnitionOn, default(ForPrimitives));
				((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref setCabinLightOn, default(ForPrimitives));
				((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref setCabinLightSwitch, default(ForPrimitives));
				((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref setHeadlightsOn, default(ForPrimitives));
				((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref setWindowBroken, default(ForPrimitives));
				BytePacker.WriteValueBitPacked(val2, currentGear);
				((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref engineSpeed, default(ForPrimitives));
				((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref wheelSpeed, default(ForPrimitives));
				((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref frontWheelSpeed, default(ForPrimitives));
				((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref backWheelSpeed, default(ForPrimitives));
				((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref setMotorTorque, default(ForPrimitives));
				((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref setBrakeTorque, default(ForPrimitives));
				((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref setRadioOn, default(ForPrimitives));
				((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref setRadioOnBefore, default(ForPrimitives));
				BytePacker.WriteValueBitPacked(val2, radioClip);
				((NetworkBehaviour)this).__endSendRpc(ref val2, 1572298743u, rpcParams, val, (SendTo)8, (RpcDelivery)0);
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1)
			{
				return;
			}
			((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0;
			if (!receivedClientSyncData)
			{
				receivedClientSyncData = true;
				if (!base.windshieldBroken && setWindowBroken)
				{
					BreakWindshield();
				}
				if (headlampsOn != setHeadlightsOn)
				{
					headlampsOn = setHeadlightsOn;
					base.headlightsContainer.SetActive(setHeadlightsOn);
					SetHeadlightMaterial(setHeadlightsOn);
				}
				if ((int)base.gear != currentGear)
				{
					base.timeAtLastGearShift = Time.realtimeSinceStartup;
					base.gear = (CarGearShift)currentGear;
				}
				base.carHP = setCarHealth;
				syncedCarHP = setCarHealth;
				disableAnimations = !setStarted;
				ignitionOn = setIgnitionOn;
				SetIgnitionKeyValues(setKeyInHand: false, setKeyInSlot);
				isCabinLightToggled = setCabinLightSwitch;
				SetIgnition(setStarted, setCabinLightOn);
				SetDashboardGaugesOn(setIgnitionOn);
				if (setStarted)
				{
					dashboardSweepCoroutine = ((MonoBehaviour)this).StartCoroutine(DashboardSweepCoroutine());
				}
				ignitionAnimator.SetInteger("SAIgnition_Anim", setStarted ? 1 : 0);
				base.radioTurnedOnBefore = setRadioOnBefore;
				base.currentRadioClip = radioClip;
				if (!base.radioOn && setRadioOn)
				{
					SetRadioOnLocalClient(on: true);
				}
				currentMotorTorque = setMotorTorque;
				currentBrakeTorque = setBrakeTorque;
				syncedEngineRPM = engineSpeed;
				syncedWheelRPM = wheelSpeed;
				syncedFrontWheelRPM = frontWheelSpeed;
				syncedBackWheelRPM = backWheelSpeed;
			}
		}

		public IEnumerator SetRainCollision()
		{
			yield return (object)new WaitForSeconds(4f);
			ParticleSystem[] array = (ParticleSystem[])(object)new ParticleSystem[13]
			{
				References.rainParticles,
				References.rainHitParticles,
				References.stormyRainParticles,
				References.stormyRainHitParticles,
				References.wesleyHurricaneRainParticles,
				References.wesleyHurricaneRainHitParticles,
				References.wesleyHurricaneSandParticles,
				References.wesleyForsakenRainParticles,
				References.wesleyForsakenRainHitParticles,
				References.kenjiAcidRainParticles,
				References.kenjiAcidRainHitParticles,
				References.kenjiAcidStormyRainParticles,
				References.kenjiAcidStormyRainHitParticles
			};
			ParticleSystem[] array2 = array;
			foreach (ParticleSystem val in array2)
			{
				if ((Object)(object)val == (Object)null)
				{
					continue;
				}
				TriggerModule trigger = val.trigger;
				Collider[] array3 = weatherEffectBlockers;
				foreach (Collider val2 in array3)
				{
					if ((Object)(object)val2 != (Object)null)
					{
						((TriggerModule)(ref trigger)).AddCollider((Component)(object)val2);
					}
				}
			}
		}

		public void ChangeGear_Forward(CallbackContext context)
		{
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: 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_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: 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_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Invalid comparison between Unknown and I4
			//IL_003d: Unknown result type (might be due to invalid IL or missing references)
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0034: Invalid comparison between I4 and Unknown
			if ((int)base.gear != setGear)
			{
				PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController;
				base.timeAtLastGearShift = Time.realtimeSinceStartup;
				playerWhoShifted = 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)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_0100: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1)
				{
					RpcAttributeParams val = new RpcAttributeParams
					{
						RequireOwnership = false
					};
					RpcParams val3 = default(RpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(3646988633u, val3, val, (SendTo)5, (RpcDelivery)0);
					BytePacker.WriteValueBitPacked(val2, playerId);
					BytePacker.WriteValueBitPacked(val2, setGear);
					BytePacker.WriteValueBitPacked(val2, gearIndex);
					((NetworkBehaviour)this).__endSendRpc(ref val2, 3646988633u, val3, val, (SendTo)5, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1)
				{
					((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0;
					PlayerControllerB val4 = StartOfRound.Instance.allPlayerScripts[playerId];
					base.timeAtLastGearShift = Time.realtimeSinceStartup;
					playerWhoShifted = val4;
					base.gear = (CarGearShift)setGear;
					base.gearStickAudio.PlayOneShot(base.gearStickAudios[gearIndex]);
				}
			}
		}

		public void SetFrontCabinLightOn(bool setOn)
		{
			if (!setOn || !isCabinLightToggled)
			{
				isCabinLightOn = setOn;
				base.frontCabinLightContainer.SetActive(setOn);
				((Renderer)base.frontCabinLightMesh).material = (setOn ? base.headlightsOnMat : base.headlightsOffMat);
			}
		}

		public void ToggleCabinLights()
		{
			ToggleCabinLightsOwnerRpc();
		}

		[Rpc(/*Could not decode attribute arguments.*/)]
		public void ToggleCabinLightsOwnerRpc()
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_009a: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a4: Invalid comparison between Unknown and I4
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0072: Unknown result type (might be due to invalid IL or missing references)
			//IL_0081: Unknown result type (might be due to invalid IL or missing references)
			//IL_0085: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1)
				{
					RpcAttributeParams val = new RpcAttributeParams
					{
						RequireOwnership = false
					};
					RpcParams val3 = default(RpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(1606966662u, val3, val, (SendTo)0, (RpcDelivery)0);
					((NetworkBehaviour)this).__endSendRpc(ref val2, 1606966662u, val3, val, (SendTo)0, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1)
				{
					((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0;
					isCabinLightToggled = !isCabinLightToggled;
					ToggleCabinLightsLocalClient(isCabinLightToggled, ignitionOn);
					ToggleCabinLightsRpc(isCabinLightToggled, ignitionOn);
				}
			}
		}

		[Rpc(/*Could not decode attribute arguments.*/)]
		public void ToggleCabinLightsRpc(bool setToggle, bool isIgnitionOn)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00da: Invalid comparison between Unknown and I4
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0072: Unknown result type (might be due to invalid IL or missing references)
			//IL_0082: Unknown result type (might be due to invalid IL or missing references)
			//IL_0088: Unknown result type (might be due to invalid IL or missing references)
			//IL_009d: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e9: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1)
				{
					RpcAttributeParams val = new RpcAttributeParams
					{
						RequireOwnership = false
					};
					RpcParams val3 = default(RpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(559298925u, val3, val, (SendTo)5, (RpcDelivery)0);
					((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref setToggle, default(ForPrimitives));
					((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref isIgnitionOn, default(ForPrimitives));
					((NetworkBehaviour)this).__endSendRpc(ref val2, 559298925u, val3, val, (SendTo)5, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1)
				{
					((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0;
					isCabinLightToggled = setToggle;
					ToggleCabinLightsLocalClient(isCabinLightToggled, isIgnitionOn);
				}
			}
		}

		public void ToggleCabinLightsLocalClient(bool setToggle, bool isIgnitionOn)
		{
			if (setToggle)
			{
				SetFrontCabinLightOn(setOn: false);
			}
			else
			{
				SetFrontCabinLightOn(isIgnitionOn);
			}
		}

		public void StartTryCarIgnition()
		{
			if (base.localPlayerInControl && !base.ignitionStarted && !inIgnitionAnimation && (!inIgnitionAnimation || !startIgnitionTrigger.isBeingHeldByPlayer))
			{
				CancelIgnitionCoroutine();
				disableAnimations = true;
				inIgnitionAnimation = true;
				base.keyIgnitionCoroutine = ((MonoBehaviour)this).StartCoroutine(TryIgnition(isLocalDriver: true));
				TryIgnitionRpc(base.keyIsInIgnition, ignitionOn);
			}
		}

		private IEnumerator TryIgnition(bool isLocalDriver)
		{
			if ((Object)(object)base.currentDriver == (Object)null)
			{
				base.keyIgnitionCoroutine = null;
				yield break;
			}
			if (base.keyIsInIgnition)
			{
				SetIgnitionKeyValues(setKeyInHand: true, setKeyInSlot: true);
				base.currentDriver.playerBodyAnimator.SetInteger("SA_CarAnim", 12);
				ignitionAnimator.SetInteger("SAIgnition_Anim", 12);
				yield return (object)new WaitForSeconds(0.02f);
				carKeyAudio.PlayOneShot(base.twistKey);
				SetIgnitionKeyValues(setKeyInHand: true, setKeyInSlot: true);
				yield return (object)new WaitForSeconds(0.1467f);
			}
			else
			{
				SetIgnitionKeyValues(setKeyInHand: true, setKeyInSlot: false);
				base.currentDriver.playerBodyAnimator.SetInteger("SA_CarAnim", 2);
				ignitionAnimator.SetInteger("SAIgnition_Anim", 2);
				yield return (object)new WaitForSeconds(0.6f);
				carKeyAudio.PlayOneShot(base.insertKey);
				SetIgnitionKeyValues(setKeyInHand: true, setKeyInSlot: true);
				yield return (object)new WaitForSeconds(0.2f);
				carKeyAudio.PlayOneShot(base.twistKey);
				SetIgnitionKeyValues(setKeyInHand: true, setKeyInSlot: true);
				yield return (object)new WaitForSeconds(0.18f);
			}
			SetIgnitionKeyValues(setKeyInHand: true, setKeyInSlot: true);
			if (!isLocalDriver)
			{
				yield break;
			}
			bool flag = (int)base.gear == 3;
			if (flag)
			{
				PlayIgnitionAudio();
			}
			if (!ignitionOn)
			{
				ignitionOn = true;
				if (dashboardSweepCoroutine == null && !hasSweepedDashboard)
				{
					dashboardSweepCoroutine = ((MonoBehaviour)this).StartCoroutine(DashboardSweepCoroutine());
				}
			}
			SetIgnitionKeyValues(setKeyInHand: true, setKeyInSlot: true);
			SetFrontCabinLightOn(ignitionOn);
			SetDashboardGaugesOn(on: true);
			TryStartIgnitionRpc(flag);
			if (!flag)
			{
				yield break;
			}
			yield return (object)new WaitForSeconds(Random.Range(0.7f, 1.4f));
			if ((float)Random.Range(0, 100) < base.chanceToStartIgnition)
			{
				CancelIgnitionAnimation(isStarted: true, setIgnitionAnim: true);
				disableAnimations = false;
				inIgnitionAnimation = false;
				PlayerControllerB currentDriver = base.currentDriver;
				if (currentDriver != null)
				{
					currentDriver.playerBodyAnimator.SetInteger("SA_CarAnim", 1);
				}
				SetIgnitionKeyValues(setKeyInHand: false, setKeyInSlot: true);
				SetIgnition(setStarted: true, setCabinLight: true);
				SetDashboardGaugesOn(on: true);
				StartIgnitionRpc();
			}
			else
			{
				base.chanceToStartIgnition += 14f;
				base.chanceToStartIgnition = Mathf.Clamp(base.chanceToStartIgnition, 0f, 101f);
			}
		}

		[Rpc(/*Could not decode attribute arguments.*/)]
		public void TryIgnitionRpc(bool setKeyInSlot, bool isIgnitionOn)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cc: Invalid comparison between Unknown and I4
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Unknown result type (might be due to invalid IL or missing references)
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0064: Unknown result type (might be due to invalid IL or missing references)
			//IL_0074: Unknown result type (might be due to invalid IL or missing references)
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_008f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0095: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_00db: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1)
			{
				RpcAttributeParams val = default(RpcAttributeParams);
				RpcParams val3 = default(RpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(1565903847u, val3, val, (SendTo)1, (RpcDelivery)0);
				((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref setKeyInSlot, default(ForPrimitives));
				((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref isIgnitionOn, default(ForPrimitives));
				((NetworkBehaviour)this).__endSendRpc(ref val2, 1565903847u, val3, val, (SendTo)1, (RpcDelivery)0);
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1)
			{
				return;
			}
			((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0;
			CancelIgnitionCoroutine();
			disableAnimations = true;
			inIgnitionAnimation = true;
			SetIgnitionKeyValues(setKeyInHand: false, setKeyInSlot);
			if (ignitionOn != isIgnitionOn)
			{
				ignitionOn = isIgnitionOn;
				SetFrontCabinLightOn(isIgnitionOn);
				if (dashboardSweepCoroutine == null && !hasSweepedDashboard)
				{
					dashboardSweepCoroutine = ((MonoBehaviour)this).StartCoroutine(DashboardSweepCoroutine());
				}
			}
			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_00a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: Invalid comparison between Unknown and I4
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Unknown result type (might be due to invalid IL or missing references)
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0064: Unknown result type (might be due to invalid IL or missing references)
			//IL_0074: Unknown result type (might be due to invalid IL or missing references)
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_008e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0092: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1)
			{
				RpcAttributeParams val = default(RpcAttributeParams);
				RpcParams val3 = default(RpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(1377561967u, val3, val, (SendTo)1, (RpcDelivery)0);
				((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref shiftInterlock, default(ForPrimitives));
				((NetworkBehaviour)this).__endSendRpc(ref val2, 1377561967u, val3, val, (SendTo)1, (RpcDelivery)0);
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1)
			{
				return;
			}
			((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0;
			if (shiftInterlock)
			{
				PlayIgnitionAudio();
			}
			if (!ignitionOn)
			{
				ignitionOn = true;
				if (dashboardSweepCoroutine == null && !hasSweepedDashboard)
				{
					dashboardSweepCoroutine = ((MonoBehaviour)this).StartCoroutine(DashboardSweepCoroutine());
				}
			}
			SetIgnitionKeyValues(setKeyInHand: true, setKeyInSlot: true);
			SetFrontCabinLightOn(ignitionOn);
			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 && inIgnitionAnimation && (inIgnitionAnimation || !startIgnitionTrigger.isBeingHeldByPlayer))
			{
				PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController;
				int integer = localPlayerController.playerBodyAnimator.GetInteger("SA_CarAnim");
				if (integer == 0 && base.keyIsInIgnition)
				{
					localPlayerController.playerBodyAnimator.SetInteger("SA_CarAnim", 13);
				}
				else if ((integer == 2 || integer == 12) && base.keyIsInIgnition)
				{
					localPlayerController.playerBodyAnimator.SetInteger("SA_CarAnim", 3);
				}
				else
				{
					localPlayerController.playerBodyAnimator.SetInteger("SA_CarAnim", 0);
				}
				int integer2 = localPlayerController.playerBodyAnimator.GetInteger("SA_CarAnim");
				CancelIgnitionAnimation();
				base.carEngine1AudioActive = false;
				disableAnimations = true;
				inIgnitionAnimation = false;
				int num = integer2;
				if (integer == 13)
				{
					num = 3;
				}
				ignitionAnimator.SetInteger("SAIgnition_Anim", num);
				CancelTryIgnitionRpc(base.keyIsInIgnition, ignitionOn, integer2, num);
			}
		}

		[Rpc(/*Could not decode attribute arguments.*/)]
		public void CancelTryIgnitionRpc(bool setKeyInSlot, bool isIgnitionOn, int playerAnimIndex, int ignitionAnimIndex)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e6: Invalid comparison between Unknown and I4
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Unknown result type (might be due to invalid IL or missing references)
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0064: Unknown result type (might be due to invalid IL or missing references)
			//IL_0074: Unknown result type (might be due to invalid IL or missing references)
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_008f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0095: Unknown result type (might be due to invalid IL or missing references)
			//IL_009e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f5: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1)
			{
				RpcAttributeParams val = default(RpcAttributeParams);
				RpcParams val3 = default(RpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(4062380867u, val3, val, (SendTo)1, (RpcDelivery)0);
				((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref setKeyInSlot, default(ForPrimitives));
				((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref isIgnitionOn, default(ForPrimitives));
				BytePacker.WriteValueBitPacked(val2, playerAnimIndex);
				BytePacker.WriteValueBitPacked(val2, ignitionAnimIndex);
				((NetworkBehaviour)this).__endSendRpc(ref val2, 4062380867u, val3, val, (SendTo)1, (RpcDelivery)0);
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1)
			{
				return;
			}
			((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0;
			CancelIgnitionAnimation();
			base.carEngine1AudioActive = 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);
			}
			SetIgnitionKeyValues(setKeyInHand: false, setKeyInSlot);
			SetDashboardGaugesOn(isIgnitionOn);
			if (ignitionOn != isIgnitionOn)
			{
				ignitionOn = isIgnitionOn;
				SetFrontCabinLightOn(ignitionOn);
				if (dashboardSweepCoroutine == null && !hasSweepedDashboard)
				{
					dashboardSweepCoroutine = ((MonoBehaviour)this).StartCoroutine(DashboardSweepCoroutine());
				}
			}
		}

		[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_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Invalid comparison between Unknown and I4
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Unknown result type (might be due to invalid IL or missing references)
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0064: Unknown result type (might be due to invalid IL or missing references)
			//IL_0073: Unknown result type (might be due to invalid IL or missing references)
			//IL_0077: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1)
			{
				RpcAttributeParams val = default(RpcAttributeParams);
				RpcParams val3 = default(RpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(2218070621u, val3, val, (SendTo)1, (RpcDelivery)0);
				((NetworkBehaviour)this).__endSendRpc(ref val2, 2218070621u, val3, val, (SendTo)1, (RpcDelivery)0);
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1)
			{
				return;
			}
			((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0;
			CancelIgnitionAnimation(isStarted: true, setIgnitionAnim: true);
			disableAnimations = false;
			inIgnitionAnimation = false;
			PlayerControllerB currentDriver = base.currentDriver;
			if (currentDriver != null)
			{
				currentDriver.playerBodyAnimator.SetInteger("SA_CarAnim", 1);
			}
			SetIgnitionKeyValues(setKeyInHand: false, setKeyInSlot: true);
			SetIgnition(setStarted: true, setCabinLight: true);
			if (!ignitionOn)
			{
				ignitionOn = true;
				if (dashboardSweepCoroutine == null && !hasSweepedDashboard)
				{
					dashboardSweepCoroutine = ((MonoBehaviour)this).StartCoroutine(DashboardSweepCoroutine());
				}
			}
			SetDashboardGaugesOn(on: true);
		}

		public void SetIgnition(bool setStarted, bool setCabinLight)
		{
			SetFrontCabinLightOn(setCabinLight);
			if (base.ignitionStarted != setStarted)
			{
				base.ignitionStarted = setStarted;
				base.carEngine1AudioActive = setStarted;
				if (setStarted)
				{
					startIgnitionCollider.enabled = false;
					stopIgnitionCollider.enabled = true;
					startIgnitionTrigger.currentCooldownValue = startIgnitionTrigger.cooldownTime;
					stopIgnitionTrigger.currentCooldownValue = stopIgnitionTrigger.cooldownTime;
					base.carExhaustParticle.Play();
					base.engineAudio1.Stop();
					base.engineAudio1.PlayOneShot(base.engineStartSuccessful);
					base.engineAudio1.clip = base.engineRun;
				}
				else
				{
					startIgnitionCollider.enabled = true;
					stopIgnitionCollider.enabled = false;
					startIgnitionTrigger.currentCooldownValue = startIgnitionTrigger.cooldownTime;
					stopIgnitionTrigger.currentCooldownValue = stopIgnitionTrigger.cooldownTime;
					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();
			}
		}

		private IEnumerator RemoveKey()
		{
			disableAnimations = true;
			inIgnitionAnimation = false;
			PlayerControllerB currentDriver = base.currentDriver;
			if (currentDriver != null)
			{
				currentDriver.playerBodyAnimator.SetInteger("SA_CarAnim", 6);
			}
			playerSteeringWheelAnimFloat = 0.5f;
			syncedPlayerSteeringAnim = 0.5f;
			ignitionAnimator.SetInteger("SAIgnition_Anim", 6);
			yield return (object)new WaitForSeconds(0.28f);
			SetIgnitionKeyValues(setKeyInHand: true, setKeyInSlot: false);
			carKeyAudio.PlayOneShot(base.removeKey);
			SetIgnition(setStarted: false, setCabinLight: false);
			ignitionOn = false;
			hasPlayedIgnitionChime = false;
			CancelDashboardSweep();
			SetDashboardGaugesOn(on: false);
			yield return (object)new WaitForSeconds(0.73f);
			SetIgnitionKeyValues(setKeyInHand: false, setKeyInSlot: false);
			PlayerControllerB currentDriver2 = base.currentDriver;
			if (currentDriver2 != null)
			{
				currentDriver2.playerBodyAnimator.SetFloat("animationSpeed", 0.5f);
			}
			base.keyIgnitionCoroutine = null;
		}

		[Rpc(/*Could not decode attribute arguments.*/)]
		public void RemoveKeyFromIgnitionRpc()
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Invalid comparison between Unknown and I4
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Unknown result type (might be due to invalid IL or missing references)
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0064: Unknown result type (might be due to invalid IL or missing references)
			//IL_0073: Unknown result type (might be due to invalid IL or missing references)
			//IL_0077: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1)
				{
					RpcAttributeParams val = default(RpcAttributeParams);
					RpcParams val3 = default(RpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(2004876350u, val3, val, (SendTo)1, (RpcDelivery)0);
					((NetworkBehaviour)this).__endSendRpc(ref val2, 2004876350u, val3, val, (SendTo)1, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1)
				{
					((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0;
					CancelIgnitionCoroutine();
					base.keyIgnitionCoroutine = ((MonoBehaviour)this).StartCoroutine(RemoveKey());
					base.chanceToStartIgnition = 10f;
				}
			}
		}

		public void CancelIgnitionAnimation(bool isStarted = false, bool setIgnitionAnim = false)
		{
			CancelIgnitionCoroutine();
			base.keyIsInDriverHand = false;
			if (setIgnitionAnim)
			{
				ignitionAnimator.SetInteger("SAIgnition_Anim", isStarted ? 1 : 0);
			}
		}

		public void CancelIgnitionCoroutine()
		{
			if (base.keyIgnitionCoroutine != null)
			{
				((MonoBehaviour)this).StopCoroutine(base.keyIgnitionCoroutine);
				base.keyIgnitionCoroutine = null;
			}
		}

		public void SetIgnitionKeyValues(bool setKeyInHand, bool setKeyInSlot)
		{
			base.keyIsInDriverHand = setKeyInHand;
			base.keyIsInIgnition = setKeyInSlot;
		}

		public void SetTriggerHoverTip(InteractTrigger trigger, string tip)
		{
			trigger.hoverTip = tip;
		}

		[Rpc(/*Could not decode attribute arguments.*/)]
		public void CancelSetPlayerInVehicleRpc(NetworkBehaviourReference playerNetObjRef)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bf: Invalid comparison between Unknown and I4
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0072: Unknown result type (might be due to invalid IL or missing references)
			//IL_0082: Unknown result type (might be due to invalid IL or missing references)
			//IL_0088: Unknown result type (might be due to invalid IL or missing references)
			//IL_009c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1)
			{
				RpcAttributeParams val = new RpcAttributeParams
				{
					RequireOwnership = false
				};
				RpcParams val3 = default(RpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(3143167123u, val3, val, (SendTo)6, (RpcDelivery)0);
				((FastBufferWriter)(ref val2)).WriteValueSafe<NetworkBehaviourReference>(ref playerNetObjRef, default(ForNetworkSerializable));
				((NetworkBehaviour)this).__endSendRpc(ref val2, 3143167123u, val3, val, (SendTo)6, (RpcDelivery)0);
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1)
			{
				((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0;
				PlayerControllerB player = default(PlayerControllerB);
				if (!((NetworkBehaviourReference)(ref playerNetObjRef)).TryGet<PlayerControllerB>(ref player, (NetworkManager)null))
				{
					Plugin.LogError("CancelSetPlayerInVehicleRpc failed to find player reference from network behaviour!");
				}
				else if (VehicleUtils.IsPlayerLocal(player))
				{
					InteractTriggerPatches.CancelVehicleSeatInteraction();
				}
			}
		}

		public void SetDriverInVehicle()
		{
			//IL_000b: 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: Unknown result type (might be due to invalid IL or missing references)
			SetDriverInVehicleServerRpc(NetworkBehaviourReference.op_Implicit((NetworkBehaviour)(object)GameNetworkManager.Instance.localPlayerController));
		}

		[Rpc(/*Could not decode attribute arguments.*/)]
		public void SetDriverInVehicleServerRpc(NetworkBehaviourReference playerNetObjRef, 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_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_0109: Unknown result type (might be due to invalid IL or missing references)
			//IL_011d: Unknown result type (might be due to invalid IL or missing references)
			//IL_011e: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1)
			{
				RpcAttributeParams val = new RpcAttributeParams
				{
					RequireOwnership = false
				};
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(3028432934u, rpcParams, val, (SendTo)2, (RpcDelivery)0);
				((FastBufferWriter)(ref val2)).WriteValueSafe<NetworkBehaviourReference>(ref playerNetObjRef, default(ForNetworkSerializable));
				((NetworkBehaviour)this).__endSendRpc(ref val2, 3028432934u, rpcParams, val, (SendTo)2, (RpcDelivery)0);
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1)
			{
				((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0;
				PlayerControllerB val3 = default(PlayerControllerB);
				if (!((NetworkBehaviourReference)(ref playerNetObjRef)).TryGet<PlayerControllerB>(ref val3, (NetworkManager)null))
				{
					Plugin.LogError("SetDriverInVehicleServerRpc failed to find player reference from network behaviour!");
					return;
				}
				if (val3.isPlayerDead || !val3.isPlayerControlled || (Object)(object)base.currentDriver != (Object)null)
				{
					CancelSetPlayerInVehicleRpc(playerNetObjRef);
					return;
				}
				base.currentDriver = val3;
				((NetworkBehaviour)this).NetworkObject.ChangeOwnership(rpcParams.Receive.SenderClientId);
				SetDriverInVehicleOwnerRpc();
			}
		}

		[Rpc(/*Could not decode attribute arguments.*/)]
		public void SetDriverInVehicleOwnerRpc()
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_009a: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a4: Invalid comparison between Unknown and I4
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0072: Unknown result type (might be due to invalid IL or missing references)
			//IL_0081: Unknown result type (might be due to invalid IL or missing references)
			//IL_0085: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_022c: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1)
			{
				RpcAttributeParams val = new RpcAttributeParams
				{
					RequireOwnership = false
				};
				RpcParams val3 = default(RpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(3992045072u, val3, val, (SendTo)0, (RpcDelivery)0);
				((NetworkBehaviour)this).__endSendRpc(ref val2, 3992045072u, val3, val, (SendTo)0, (RpcDelivery)0);
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1)
			{
				((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0;
				((VehicleSeatAnimator)frontLeftSeat).SetLocalPlayerIntoSeat();
				ActivateControl();
				disableAnimations = !base.ignitionStarted;
				inIgnitionAnimation = false;
				SetTriggerHoverTip(base.driverSideDoorTrigger, "Exit : [LMB]");
				startIgnitionTrigger.isBeingHeldByPlayer = false;
				stopIgnitionTrigger.isBeingHeldByPlayer = false;
				CancelIgnitionAnimation(base.ignitionStarted, setIgnitionAnim: true);
				PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController;
				if (base.ignitionStarted)
				{
					localPlayerController.playerBodyAnimator.SetInteger("SA_CarAnim", 1);
				}
				else
				{
					localPlayerController.playerBodyAnimator.SetInteger("SA_CarAnim", 0);
				}
				int integer = localPlayerController.playerBodyAnimator.GetInteger("SA_CarAnim");
				localPlayerController.playerBodyAnimator.SetFloat("animationSpeed", 0.5f);
				playerSteeringWheelAnimFloat = 0.5f;
				syncedPlayerSteeringAnim = 0.5f;
				if (ignitionOn && dashboardSweepCoroutine == null && !hasSweepedDashboard)
				{
					dashboardSweepCoroutine = ((MonoBehaviour)this).StartCoroutine(DashboardSweepCoroutine());
				}
				else if (!ignitionOn && (dashboardSweepCoroutine != null || hasSweepedDashboard))
				{
					CancelDashboardSweep();
				}
				SetIgnition(base.ignitionStarted, ignitionOn);
				SetDashboardGaugesOn(ignitionOn);
				if (base.driverSideDoor.boolValue)
				{
					base.driverSideDoor.TriggerAnimation(localPlayerController);
				}
				if (!base.setControlTips)
				{
					base.setControlTips = true;
					HUDManager.Instance.ChangeControlTipMultiple(base.carTooltips, false, (Item)null);
				}
				SetDriverInVehicleNotOwnerRpc(NetworkBehaviourReference.op_Implicit((NetworkBehaviour)(object)localPlayerController), ignitionOn, base.keyIsInIgnition, base.ignitionStarted, integer);
			}
		}

		[Rpc(/*Could not decode attribute arguments.*/)]
		public void SetDriverInVehicleNotOwnerRpc(NetworkBehaviourReference playerNetObjRef, bool isIgnitionOn, bool setKeyInSlot, bool setStarted, int playerAnimIndex)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_0105: Unknown result type (might be due to invalid IL or missing references)
			//IL_010f: Invalid comparison between Unknown and I4
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Unknown result type (might be due to invalid IL or missing references)
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0064: Unknown result type (might be due to invalid IL or missing references)
			//IL_0074: Unknown result type (might be due to invalid IL or missing references)
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_008f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0095: Unknown result type (might be due to invalid IL or missing references)
			//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_011e: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1)
			{
				RpcAttributeParams val = default(RpcAttributeParams);
				RpcParams val3 = default(RpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(3217134118u, val3, val, (SendTo)1, (RpcDelivery)0);
				((FastBufferWriter)(ref val2)).WriteValueSafe<NetworkBehaviourReference>(ref playerNetObjRef, default(ForNetworkSerializable));
				((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref isIgnitionOn, default(ForPrimitives));
				((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref setKeyInSlot, default(ForPrimitives));
				((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref setStarted, default(ForPrimitives));
				BytePacker.WriteValueBitPacked(val2, playerAnimIndex);
				((NetworkBehaviour)this).__endSendRpc(ref val2, 3217134118u, val3, val, (SendTo)1, (RpcDelivery)0);
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1)
			{
				return;
			}
			((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0;
			PlayerControllerB val4 = default(PlayerControllerB);
			if (!((NetworkBehaviourReference)(ref playerNetObjRef)).TryGet<PlayerControllerB>(ref val4, (NetworkManager)null))
			{
				Plugin.LogError("SetDriverInVehicleNotOwnerRpc failed to find player reference from network behaviour!");
				return;
			}
			base.currentDriver = val4;
			base.driverSeatTrigger.interactable = false;
			((VehicleSeatAnimator)frontLeftSeat).SetPlayerAnimations(val4, false);
			base.drivePedalPressed = false;
			base.brakePedalPressed = false;
			disableAnimations = !setStarted;
			inIgnitionAnimation = false;
			startIgnitionTrigger.isBeingHeldByPlayer = false;
			stopIgnitionTrigger.isBeingHeldByPlayer = false;
			CancelIgnitionAnimation(setStarted, setIgnitionAnim: true);
			val4.playerBodyAnimator.SetInteger("SA_CarAnim", playerAnimIndex);
			val4.playerBodyAnimator.SetFloat("animationSpeed", 0.5f);
			base.steeringAnimValue = 0f;
			playerSteeringWheelAnimFloat = 0.5f;
			syncedPlayerSteeringAnim = 0.5f;
			base.keyIsInIgnition = setKeyInSlot;
			if (isIgnitionOn && !ignitionOn)
			{
				ignitionOn = true;
				if (dashboardSweepCoroutine == null && !hasSweepedDashboard)
				{
					dashboardSweepCoroutine = ((MonoBehaviour)this).StartCoroutine(DashboardSweepCoroutine());
				}
			}
			else if (!isIgnitionOn && ignitionOn)
			{
				ignitionOn = false;
				if (dashboardSweepCoroutine != null || hasSweepedDashboard)
				{
					CancelDashboardSweep();
				}
			}
			SetIgnition(setStarted, isIgnitionOn);
			SetDashboardGaugesOn(isIgnitionOn);
		}

		public void OnDriverExitVehicle()
		{
			//IL_0145: Unknown result type (might be due to invalid IL or missing references)
			//IL_014a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0156: Unknown result type (might be due to invalid IL or missing references)
			//IL_015b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0162: Unknown result type (might be due to invalid IL or missing references)
			//IL_0168: Unknown result type (might be due to invalid IL or missing references)
			//IL_016e: 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 && VehicleUtils.IsPlayerLocal(base.currentDriver))
			{
				DisableControl();
				disableAnimations = !base.ignitionStarted;
				inIgnitionAnimation = false;
				SetTriggerHoverTip(base.driverSideDoorTrigger, "Use door : [LMB]");
				startIgnitionTrigger.isBeingHeldByPlayer = false;
				stopIgnitionTrigger.isBeingHeldByPlayer = false;
				CancelIgnitionAnimation(base.ignitionStarted, setIgnitionAnim: true);
				PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController;
				localPlayerController.playerBodyAnimator.SetInteger("SA_CarAnim", 0);
				localPlayerController.playerBodyAnimator.SetFloat("animationSpeed", 0.5f);
				playerSteeringWheelAnimFloat = 0.5f;
				syncedPlayerSteeringAnim = 0.5f;
				if (ignitionOn && dashboardSweepCoroutine == null && !hasSweepedDashboard)
				{
					dashboardSweepCoroutine = ((MonoBehaviour)this).StartCoroutine(DashboardSweepCoroutine());
				}
				else if (!ignitionOn && (dashboardSweepCoroutine != null || hasSweepedDashboard))
				{
					CancelDashboardSweep();
				}
				SetIgnition(base.ignitionStarted, ignitionOn);
				SetDashboardGaugesOn(ignitionOn);
				base.chanceToStartIgnition = 10f;
				base.syncedPosition = ((Component)this).transform.position;
				base.syncedRotation = ((Component)this).transform.rotation;
				OnDriverExitVehicleServerRpc(NetworkBehaviourReference.op_Implicit((NetworkBehaviour)(object)localPlayerController), base.syncedPosition, base.syncedRotation, base.keyIsInIgnition, base.ignitionStarted, ignitionOn);
			}
		}

		[Rpc(/*Could not decode attribute arguments.*/)]
		public void OnDriverExitVehicleServerRpc(NetworkBehaviourReference playerNetObjRef, Vector3 carLocation, Quaternion carRotation, bool setKeyInSlot, bool setStarted, bool isIgnitionOn)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_0112: Unknown result type (might be due to invalid IL or missing references)
			//IL_011c: Invalid comparison between Unknown and I4
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Unknown result type (might be due to invalid IL or missing references)
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0064: Unknown result type (might be due to invalid IL or missing references)
			//IL_0074: Unknown result type (might be due to invalid IL or missing references)
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00af: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_00df: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_012b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0131: Unknown result type (might be due to invalid IL or missing references)
			//IL_0132: Unknown result type (might be due to invalid IL or missing references)
			//IL_0133: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1)
				{
					RpcAttributeParams val = default(RpcAttributeParams);
					RpcParams val3 = default(RpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(200360831u, val3, val, (SendTo)2, (RpcDelivery)0);
					((FastBufferWriter)(ref val2)).WriteValueSafe<NetworkBehaviourReference>(ref playerNetObjRef, default(ForNet