Decompiled source of Vandal Electronics Scanvan v1.9.26

BepInEx/plugins/scanvan/RadioBrowser.dll

Decompiled a day ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Net.NetworkInformation;
using System.Net.Sockets;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Threading.Tasks;
using System.Web;
using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;
using RadioBrowser.Api;
using RadioBrowser.Internals;
using RadioBrowser.Internals.JsonConverters;
using RadioBrowser.Models;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("bt")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyCopyright("(c) 2020 by bt, GPL v3")]
[assembly: AssemblyDescription("Radio Browser API wrapper")]
[assembly: AssemblyFileVersion("0.7.0.0")]
[assembly: AssemblyInformationalVersion("0.7.0")]
[assembly: AssemblyProduct("RadioBrowser")]
[assembly: AssemblyTitle("RadioBrowser")]
[assembly: AssemblyMetadata("RepositoryUrl", "https://git.sr.ht/youkai/RadioBrowser.NET")]
[assembly: AssemblyVersion("0.7.0.0")]
namespace RadioBrowser
{
	public interface IRadioBrowserClient
	{
		Search Search { get; }

		Lists Lists { get; }

		Stations Stations { get; }

		RadioBrowser.Internals.HttpClient HttpClient { get; }

		Modify Modify { get; }
	}
	public class RadioBrowserClient : IRadioBrowserClient
	{
		public Search Search { get; }

		public Lists Lists { get; }

		public Stations Stations { get; }

		public RadioBrowser.Internals.HttpClient HttpClient { get; }

		public Modify Modify { get; }

		public RadioBrowserClient(string apiUrl = null, string customUserAgent = null)
		{
			Converters converters = new Converters();
			HttpClient = new RadioBrowser.Internals.HttpClient(apiUrl, customUserAgent);
			Search = new Search(HttpClient, converters);
			Lists = new Lists(HttpClient, converters);
			Stations = new Stations(HttpClient, converters);
			Modify = new Modify(HttpClient, converters);
		}
	}
}
namespace RadioBrowser.Models
{
	public class ActionResult
	{
		public bool Ok { get; set; }

		public string Message { get; set; }
	}
	public class AddStationResult : ActionResult
	{
		public Guid Uuid { get; set; }
	}
	public class AdvancedSearchOptions
	{
		public string Name { get; set; }

		public string NameExact { get; set; }

		public string Country { get; set; }

		public bool? CountryExact { get; set; }

		public string Countrycode { get; set; }

		public string State { get; set; }

		public bool? StateExact { get; set; }

		public string Language { get; set; }

		public string LanguageExact { get; set; }

		public bool? TagExact { get; set; }

		public string TagList { get; set; }

		public string Codec { get; set; }

		public uint? BitrateMin { get; set; }

		public uint? BitrateMax { get; set; }

		public string Order { get; set; }

		public bool? Reverse { get; set; }

		public uint? Offset { get; set; }

		public uint? Limit { get; set; }
	}
	public class ClickResult : ActionResult
	{
		public Guid StationUuid { get; set; }

		public string Name { get; set; }

		public Uri Url { get; set; }
	}
	public class NameAndCount
	{
		public string Name { get; set; }

		public uint Stationcount { get; set; }
	}
	public class NewStation
	{
		public string Name { get; set; }

		public Uri Url { get; set; }

		public Uri Homepage { get; set; }

		public Uri Favicon { get; set; }

		public string Country { get; set; }

		public string CountryCode { get; set; }

		public string State { get; set; }

		public string Language { get; set; }

		public string Tags { get; set; }
	}
	public class State : NameAndCount
	{
		public string Country { get; set; }
	}
	public class StationInfo
	{
		public Guid ChangeUuid { get; set; }

		public Guid StationUuid { get; set; }

		public string Name { get; set; }

		[JsonConverter(typeof(UriConverter))]
		public Uri Url { get; set; }

		[JsonProperty("url_resolved")]
		[JsonConverter(typeof(UriConverter))]
		public Uri UrlResolved { get; set; }

		[JsonConverter(typeof(UriConverter))]
		public Uri Homepage { get; set; }

		[JsonConverter(typeof(UriConverter))]
		public Uri Favicon { get; set; }

		[JsonConverter(typeof(ListConverter))]
		public List<string> Tags { get; set; }

		public string CountryCode { get; set; }

		[JsonConverter(typeof(ListConverter))]
		public List<string> Language { get; set; }

		public int Votes { get; set; }

		[JsonConverter(typeof(DateTimeConverter))]
		public DateTime LastChangeTime { get; set; }

		public string Codec { get; set; }

		public int Bitrate { get; set; }

		[JsonConverter(typeof(BoolConverter))]
		public bool Hls { get; set; }

		[JsonConverter(typeof(BoolConverter))]
		public bool LastCheckOk { get; set; }

		[JsonConverter(typeof(DateTimeConverter))]
		public DateTime LastCheckTime { get; set; }

		[JsonConverter(typeof(DateTimeConverter))]
		public DateTime LastCheckOkTime { get; set; }

		[JsonConverter(typeof(DateTimeConverter))]
		public DateTime LastLocalCheckTime { get; set; }

		[JsonConverter(typeof(DateTimeConverter))]
		public DateTime ClickTimestamp { get; set; }

		public int ClickCount { get; set; }

		public int ClickTrend { get; set; }
	}
}
namespace RadioBrowser.Internals
{
	internal class Converters
	{
		private readonly JsonSerializerSettings _jsonSerializerSettings;

		internal Converters()
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Expected O, but got Unknown
			//IL_0030: Expected O, but got Unknown
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_003c: Expected O, but got Unknown
			_jsonSerializerSettings = new JsonSerializerSettings
			{
				ContractResolver = (IContractResolver)new DefaultContractResolver
				{
					NamingStrategy = (NamingStrategy)new CamelCaseNamingStrategy
					{
						ProcessDictionaryKeys = true,
						OverrideSpecifiedNames = false
					}
				},
				NullValueHandling = (NullValueHandling)1
			};
		}

		internal List<StationInfo> ToStationsList(string json)
		{
			return JsonConvert.DeserializeObject<List<StationInfo>>(json, _jsonSerializerSettings);
		}

		internal List<NameAndCount> ToNameAndCountList(string json)
		{
			return JsonConvert.DeserializeObject<List<NameAndCount>>(json, _jsonSerializerSettings);
		}

		internal List<State> ToStatesList(string json)
		{
			return JsonConvert.DeserializeObject<List<State>>(json, _jsonSerializerSettings);
		}

		internal ActionResult ToActionResult(string json)
		{
			return JsonConvert.DeserializeObject<ActionResult>(json, _jsonSerializerSettings);
		}

		internal ClickResult ToClickResult(string json)
		{
			return JsonConvert.DeserializeObject<ClickResult>(json, _jsonSerializerSettings);
		}

		internal AddStationResult ToAddStationResult(string json)
		{
			return JsonConvert.DeserializeObject<AddStationResult>(json, _jsonSerializerSettings);
		}

		internal static string GetQueryString(object obj)
		{
			IEnumerable<string> source = from p in obj.GetType().GetProperties()
				where p.GetValue(obj, null) != null
				select char.ToLowerInvariant(p.Name[0]) + p.Name.Substring(1) + "=" + HttpUtility.UrlEncode(Convert.ToString(p.GetValue(obj, null)));
			return string.Join("&", source.ToArray());
		}
	}
	public class HttpClient
	{
		private readonly System.Net.Http.HttpClient _httpClient;

		public string ApiUrl { get; }

		public string UserAgent { get; }

		internal HttpClient(string apiUrl, string userAgent)
		{
			ApiUrl = apiUrl ?? GetRadioBrowserApiUrl();
			UserAgent = userAgent ?? "RadioBrowser.NET Library/0.4";
			_httpClient = new System.Net.Http.HttpClient();
			_httpClient.DefaultRequestHeaders.Add("User-Agent", UserAgent);
		}

		private static string GetRadioBrowserApiUrl()
		{
			IPAddress[] hostAddresses = Dns.GetHostAddresses("all.api.radio-browser.info");
			long num = long.MaxValue;
			string text = "de1.api.radio-browser.info";
			IPAddress[] array = hostAddresses;
			foreach (IPAddress iPAddress in array)
			{
				try
				{
					PingReply pingReply = new Ping().Send(iPAddress);
					if (pingReply != null && pingReply.RoundtripTime < num)
					{
						num = pingReply.RoundtripTime;
						text = iPAddress.ToString();
					}
				}
				catch (SocketException)
				{
				}
			}
			IPHostEntry hostEntry = Dns.GetHostEntry(text);
			if (!string.IsNullOrEmpty(hostEntry.HostName))
			{
				text = hostEntry.HostName;
			}
			return text;
		}

		internal async Task<string> GetAsync(string endpoint)
		{
			HttpResponseMessage httpResponseMessage = await _httpClient.GetAsync("https://" + ApiUrl + "/json/" + endpoint);
			return (!httpResponseMessage.IsSuccessStatusCode) ? null : (await httpResponseMessage.Content.ReadAsStringAsync());
		}
	}
}
namespace RadioBrowser.Internals.JsonConverters
{
	public class BoolConverter : JsonConverter
	{
		public override bool CanConvert(Type objectType)
		{
			return objectType == typeof(bool);
		}

		public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
		{
			//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_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0009: Invalid comparison between Unknown and I4
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Invalid comparison between Unknown and I4
			//IL_0045: Unknown result type (might be due to invalid IL or missing references)
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			//IL_005d: Unknown result type (might be due to invalid IL or missing references)
			JsonToken tokenType = reader.TokenType;
			if ((int)tokenType != 7)
			{
				if ((int)tokenType == 9)
				{
					return reader.Value.ToString() == "1";
				}
				JsonToken tokenType2 = reader.TokenType;
				throw new JsonSerializationException("Unexpected token type: " + ((object)(JsonToken)(ref tokenType2)).ToString());
			}
			return Convert.ToInt32(reader.Value) == 1;
		}

		public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
		{
			throw new NotSupportedException();
		}
	}
	public class DateTimeConverter : JsonConverter<DateTime>
	{
		public override DateTime ReadJson(JsonReader reader, Type objectType, DateTime existingValue, bool hasExistingValue, JsonSerializer serializer)
		{
			try
			{
				return DateTime.ParseExact((string)reader.Value, "yyyy-MM-dd HH:mm:ss", CultureInfo.CurrentCulture);
			}
			catch (FormatException)
			{
				return new DateTime(0L);
			}
		}

		public override void WriteJson(JsonWriter writer, DateTime value, JsonSerializer serializer)
		{
			throw new NotSupportedException();
		}
	}
	public class ListConverter : JsonConverter<List<string>>
	{
		public override List<string> ReadJson(JsonReader reader, Type objectType, List<string> existingValue, bool hasExistingValue, JsonSerializer serializer)
		{
			return (from s in ((string)reader.Value)?.Split(',')
				select s.Trim()).ToList();
		}

		public override void WriteJson(JsonWriter writer, List<string> value, JsonSerializer serializer)
		{
			throw new NotSupportedException();
		}
	}
	public class UriConverter : JsonConverter<Uri>
	{
		public override Uri ReadJson(JsonReader reader, Type objectType, Uri existingValue, bool hasExistingValue, JsonSerializer serializer)
		{
			try
			{
				return new Uri((string)reader.Value);
			}
			catch (UriFormatException)
			{
				return null;
			}
		}

		public override void WriteJson(JsonWriter writer, Uri value, JsonSerializer serializer)
		{
			throw new NotSupportedException();
		}
	}
}
namespace RadioBrowser.Api
{
	public class Lists
	{
		private readonly Converters _converters;

		private readonly RadioBrowser.Internals.HttpClient _httpClient;

		internal Lists(RadioBrowser.Internals.HttpClient httpClient, Converters converters)
		{
			_httpClient = httpClient;
			_converters = converters;
		}

		public async Task<List<StationInfo>> GetAllStationsAsync()
		{
			Converters converters = _converters;
			return converters.ToStationsList(await _httpClient.GetAsync("stations"));
		}

		public async Task<List<NameAndCount>> GetCountriesAsync(string filter = null)
		{
			List<NameAndCount> result;
			if (filter == null)
			{
				Converters converters = _converters;
				result = converters.ToNameAndCountList(await _httpClient.GetAsync("countries"));
			}
			else
			{
				Converters converters = _converters;
				result = converters.ToNameAndCountList(await _httpClient.GetAsync("countries/" + filter));
			}
			return result;
		}

		public async Task<List<NameAndCount>> GetCountriesCodesAsync(string filter = null)
		{
			List<NameAndCount> result;
			if (filter == null)
			{
				Converters converters = _converters;
				result = converters.ToNameAndCountList(await _httpClient.GetAsync("countrycodes"));
			}
			else
			{
				Converters converters = _converters;
				result = converters.ToNameAndCountList(await _httpClient.GetAsync("countrycodes/" + filter));
			}
			return result;
		}

		public async Task<List<NameAndCount>> GetCodecsAsync(string filter = null)
		{
			List<NameAndCount> result;
			if (filter == null)
			{
				Converters converters = _converters;
				result = converters.ToNameAndCountList(await _httpClient.GetAsync("codecs"));
			}
			else
			{
				Converters converters = _converters;
				result = converters.ToNameAndCountList(await _httpClient.GetAsync("codecs/" + filter));
			}
			return result;
		}

		public async Task<List<State>> GetStatesAsync(string filter = null)
		{
			List<State> result;
			if (filter == null)
			{
				Converters converters = _converters;
				result = converters.ToStatesList(await _httpClient.GetAsync("states"));
			}
			else
			{
				Converters converters = _converters;
				result = converters.ToStatesList(await _httpClient.GetAsync("states/" + filter));
			}
			return result;
		}

		public async Task<List<NameAndCount>> GetLanguagesAsync(string filter = null)
		{
			List<NameAndCount> result;
			if (filter == null)
			{
				Converters converters = _converters;
				result = converters.ToNameAndCountList(await _httpClient.GetAsync("languages"));
			}
			else
			{
				Converters converters = _converters;
				result = converters.ToNameAndCountList(await _httpClient.GetAsync("languages/" + filter));
			}
			return result;
		}

		public async Task<List<NameAndCount>> GetTagsAsync(string filter = null)
		{
			List<NameAndCount> result;
			if (filter == null)
			{
				Converters converters = _converters;
				result = converters.ToNameAndCountList(await _httpClient.GetAsync("tags"));
			}
			else
			{
				Converters converters = _converters;
				result = converters.ToNameAndCountList(await _httpClient.GetAsync("tags/" + filter));
			}
			return result;
		}
	}
	public class Modify
	{
		private readonly Converters _converters;

		private readonly RadioBrowser.Internals.HttpClient _httpClient;

		internal Modify(RadioBrowser.Internals.HttpClient httpClient, Converters converters)
		{
			_httpClient = httpClient;
			_converters = converters;
		}

		public async Task<ClickResult> ClickAsync(Guid uuid)
		{
			string json = await _httpClient.GetAsync($"/url/{uuid}");
			return _converters.ToClickResult(json);
		}

		public async Task<ActionResult> VoteAsync(Guid uuid)
		{
			string json = await _httpClient.GetAsync($"/vote/{uuid}");
			return _converters.ToActionResult(json);
		}

		public async Task<AddStationResult> AddStationAsync(NewStation newStation)
		{
			string json = await _httpClient.GetAsync("json/add/" + Converters.GetQueryString(newStation));
			return _converters.ToAddStationResult(json);
		}
	}
	public class Search
	{
		private readonly Converters _converters;

		private readonly RadioBrowser.Internals.HttpClient _httpClient;

		internal Search(RadioBrowser.Internals.HttpClient httpClient, Converters converters)
		{
			_httpClient = httpClient;
			_converters = converters;
		}

		public async Task<List<StationInfo>> AdvancedAsync(AdvancedSearchOptions searchOptions)
		{
			string json = await _httpClient.GetAsync("stations/search?" + Converters.GetQueryString(searchOptions));
			return _converters.ToStationsList(json);
		}

		public async Task<List<StationInfo>> ByNameAsync(string name)
		{
			string json = await _httpClient.GetAsync("stations/search?name=" + name);
			return _converters.ToStationsList(json);
		}

		public async Task<List<StationInfo>> ByUuidAsync(Guid uuid)
		{
			string json = await _httpClient.GetAsync("stations/byuuid?uuids=" + uuid);
			return _converters.ToStationsList(json);
		}

		public async Task<List<StationInfo>> ByUrlAsync(string url)
		{
			string json = await _httpClient.GetAsync("stations/byurl?url=" + url);
			return _converters.ToStationsList(json);
		}
	}
	public class Stations
	{
		private readonly Converters _converters;

		private readonly RadioBrowser.Internals.HttpClient _httpClient;

		internal Stations(RadioBrowser.Internals.HttpClient httpClient, Converters converters)
		{
			_httpClient = httpClient;
			_converters = converters;
		}

		public async Task<List<StationInfo>> GetByClicksAsync(uint limit = 0u)
		{
			Converters converters;
			if (limit == 0)
			{
				converters = _converters;
				return converters.ToStationsList(await _httpClient.GetAsync("stations/topclick"));
			}
			converters = _converters;
			return converters.ToStationsList(await _httpClient.GetAsync($"stations/topclick/{limit}"));
		}

		public async Task<List<StationInfo>> GetByVotesAsync(uint limit = 0u)
		{
			Converters converters;
			if (limit == 0)
			{
				converters = _converters;
				return converters.ToStationsList(await _httpClient.GetAsync("stations/topvote"));
			}
			converters = _converters;
			return converters.ToStationsList(await _httpClient.GetAsync($"stations/topvote/{limit}"));
		}

		public async Task<List<StationInfo>> GetByRecentClickAsync(uint limit = 0u)
		{
			Converters converters;
			if (limit == 0)
			{
				converters = _converters;
				return converters.ToStationsList(await _httpClient.GetAsync("stations/lastclick"));
			}
			converters = _converters;
			return converters.ToStationsList(await _httpClient.GetAsync($"stations/lastclick/{limit}"));
		}

		public async Task<List<StationInfo>> GetByLastChangesAsync(uint limit = 0u)
		{
			Converters converters;
			if (limit == 0)
			{
				converters = _converters;
				return converters.ToStationsList(await _httpClient.GetAsync("stations/lastchange"));
			}
			converters = _converters;
			return converters.ToStationsList(await _httpClient.GetAsync($"stations/lastchange/{limit}"));
		}

		public async Task<List<StationInfo>> GetByCodecAsync(string codec, uint limit = 0u)
		{
			Converters converters;
			if (limit == 0)
			{
				converters = _converters;
				return converters.ToStationsList(await _httpClient.GetAsync("stations/bycodec/" + codec));
			}
			converters = _converters;
			return converters.ToStationsList(await _httpClient.GetAsync($"stations/bycodec/{codec}/{limit}"));
		}
	}
}

BepInEx/plugins/scanvan/scandal.scanvan.dll

Decompiled a day ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Net.NetworkInformation;
using System.Net.Sockets;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Cryptography;
using System.Security.Permissions;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Configuration;
using BepInEx.Logging;
using Cysharp.Threading.Tasks;
using Cysharp.Threading.Tasks.CompilerServices;
using FirstPersonView;
using GameNetcodeStuff;
using HarmonyLib;
using LethalCompanyInputUtils.Api;
using LethalMin;
using Microsoft.CodeAnalysis;
using NAudio.Wave;
using RadioBrowser;
using RadioBrowser.Models;
using ScanVan;
using ScanVan.Behaviour;
using ScanVan.ClipLoading;
using ScanVan.Compatibility;
using ScanVan.Managers;
using ScanVan.Networking;
using ScanVan.Scripts;
using ScanVan.Utils;
using ScandalLib.Interfaces;
using ScandalLib.Patches;
using ScandalLib.Scripts;
using ScandalsTweaks.Scripts;
using ScandalsTweaks.Utils;
using TMPro;
using Unity.Netcode;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.InputSystem;
using UnityEngine.Networking;
using UnityEngine.Rendering;
using UnityEngine.Rendering.HighDefinition;
using UnityEngine.UI;
using VoxxWeatherPlugin.Patches;
using VoxxWeatherPlugin.Utils;
using scandal.scanvan.NetcodePatcher;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: IgnoresAccessChecksTo("Assembly-CSharp-firstpass")]
[assembly: IgnoresAccessChecksTo("Assembly-CSharp")]
[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("scandal.scanvan")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.9.24.0")]
[assembly: AssemblyInformationalVersion("1.9.24+0ddd33a3ff59580f43bc67058349b04f98729f1a")]
[assembly: AssemblyProduct("ScanVan")]
[assembly: AssemblyTitle("scandal.scanvan")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.9.24.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
[module: NetcodePatchedAssembly]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableAttribute : Attribute
	{
		public readonly byte[] NullableFlags;

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

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

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

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
public class CruiserXLCollisionTrigger : MonoBehaviour
{
	public CruiserXLController mainScript;

	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_0367: Unknown result type (might be due to invalid IL or missing references)
		//IL_0377: Unknown result type (might be due to invalid IL or missing references)
		//IL_037c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0381: Unknown result type (might be due to invalid IL or missing references)
		//IL_038b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0390: Unknown result type (might be due to invalid IL or missing references)
		//IL_00be: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d3: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d8: 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_00e9: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ee: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f3: 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_00fe: Unknown result type (might be due to invalid IL or missing references)
		//IL_0142: Unknown result type (might be due to invalid IL or missing references)
		//IL_0152: Unknown result type (might be due to invalid IL or missing references)
		//IL_0157: 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_018b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0190: Unknown result type (might be due to invalid IL or missing references)
		//IL_01b9: Unknown result type (might be due to invalid IL or missing references)
		//IL_01c1: Unknown result type (might be due to invalid IL or missing references)
		//IL_01c7: Unknown result type (might be due to invalid IL or missing references)
		//IL_042d: Unknown result type (might be due to invalid IL or missing references)
		//IL_043e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0449: Unknown result type (might be due to invalid IL or missing references)
		//IL_044e: Unknown result type (might be due to invalid IL or missing references)
		//IL_02a7: Unknown result type (might be due to invalid IL or missing references)
		//IL_02b2: Unknown result type (might be due to invalid IL or missing references)
		//IL_02bd: Unknown result type (might be due to invalid IL or missing references)
		//IL_0472: Unknown result type (might be due to invalid IL or missing references)
		//IL_0477: Unknown result type (might be due to invalid IL or missing references)
		//IL_0488: Unknown result type (might be due to invalid IL or missing references)
		//IL_04a6: Unknown result type (might be due to invalid IL or missing references)
		//IL_04ab: Unknown result type (might be due to invalid IL or missing references)
		//IL_04bc: Unknown result type (might be due to invalid IL or missing references)
		//IL_0212: Unknown result type (might be due to invalid IL or missing references)
		//IL_0266: Unknown result type (might be due to invalid IL or missing references)
		//IL_026b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0539: Unknown result type (might be due to invalid IL or missing references)
		//IL_053e: Unknown result type (might be due to invalid IL or missing references)
		//IL_054f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0554: Unknown result type (might be due to invalid IL or missing references)
		//IL_0556: Unknown result type (might be due to invalid IL or missing references)
		//IL_0569: Expected I4, but got Unknown
		//IL_057a: Unknown result type (might be due to invalid IL or missing references)
		//IL_057f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0587: Unknown result type (might be due to invalid IL or missing references)
		//IL_05b0: Unknown result type (might be due to invalid IL or missing references)
		//IL_05b5: Unknown result type (might be due to invalid IL or missing references)
		//IL_05bd: Unknown result type (might be due to invalid IL or missing references)
		//IL_05e6: Unknown result type (might be due to invalid IL or missing references)
		//IL_05eb: Unknown result type (might be due to invalid IL or missing references)
		//IL_05f3: Unknown result type (might be due to invalid IL or missing references)
		if (!((VehicleController)mainScript).hasBeenSpawned || (((VehicleController)mainScript).magnetedToShip && ((VehicleController)mainScript).magnetTime > 0.8f))
		{
			return;
		}
		if (((Component)other).CompareTag("Player"))
		{
			PlayerControllerB val = default(PlayerControllerB);
			if (!((Component)other).TryGetComponent<PlayerControllerB>(ref val) || Time.realtimeSinceStartup - timeSinceHittingPlayer < 0.25f)
			{
				return;
			}
			Transform physicsTransform = ((VehicleController)mainScript).physicsRegion.physicsTransform;
			if ((Object)(object)val.physicsParent == (Object)(object)physicsTransform || (Object)(object)val.overridePhysicsParent == (Object)(object)physicsTransform || Time.realtimeSinceStartup - timeSinceHittingPlayer < 0.25f)
			{
				return;
			}
			float num = ((Vector3)(ref ((VehicleController)mainScript).averageVelocity)).magnitude;
			if (num < 2f)
			{
				return;
			}
			Vector3 val2 = ((Component)val).transform.position - ((VehicleController)mainScript).mainRigidbody.position;
			float num2 = Vector3.Angle(Vector3.Normalize(((VehicleController)mainScript).averageVelocity * 1000f), Vector3.Normalize(val2 * 1000f));
			if (num2 > 70f)
			{
				return;
			}
			if (num2 < 30f && mainScript.wheelRPM > 400f)
			{
				num += 6f;
			}
			if ((((Component)val.gameplayCamera).transform.position - ((VehicleController)mainScript).mainRigidbody.position).y < -0.1f)
			{
				num *= 2f;
			}
			timeSinceHittingPlayer = Time.realtimeSinceStartup;
			Vector3 val3 = Vector3.ClampMagnitude(((VehicleController)mainScript).averageVelocity, 40f);
			if ((Object)(object)val == (Object)(object)GameNetworkManager.Instance.localPlayerController)
			{
				if (num > 20f)
				{
					GameNetworkManager.Instance.localPlayerController.KillPlayer(val3, true, (CauseOfDeath)8, 9, default(Vector3), false);
				}
				else
				{
					int num3 = 0;
					if (num > 15f)
					{
						num3 = 80;
					}
					else if (num > 12f)
					{
						num3 = 60;
					}
					else if (num > 8f)
					{
						num3 = 40;
					}
					if (num3 > 0)
					{
						GameNetworkManager.Instance.localPlayerController.DamagePlayer(num3, true, true, (CauseOfDeath)8, 0, false, val3);
					}
				}
				if (!GameNetworkManager.Instance.localPlayerController.isPlayerDead && ((Vector3)(ref GameNetworkManager.Instance.localPlayerController.externalForceAutoFade)).sqrMagnitude < ((Vector3)(ref ((VehicleController)mainScript).averageVelocity)).sqrMagnitude)
				{
					GameNetworkManager.Instance.localPlayerController.externalForceAutoFade = ((VehicleController)mainScript).averageVelocity;
				}
			}
			else if (((NetworkBehaviour)mainScript).IsOwner && ((Vector3)(ref ((VehicleController)mainScript).averageVelocity)).magnitude > 1.8f)
			{
				mainScript.CarReactToObstacle(((VehicleController)mainScript).averageVelocity, ((Component)val).transform.position, ((VehicleController)mainScript).averageVelocity, (CarObstacleType)0);
			}
		}
		else
		{
			EnemyAICollisionDetect val4 = default(EnemyAICollisionDetect);
			if (!((Component)other).gameObject.CompareTag("Enemy") || Time.realtimeSinceStartup - timeSinceHittingEnemy < 0.25f || !((Component)other).TryGetComponent<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)) || val4.mainScript is BushWolfEnemy)
				{
					return;
				}
				EnemyAI obj2 = val4.mainScript;
				MouthDogAI val6 = (MouthDogAI)(object)((obj2 is MouthDogAI) ? obj2 : null);
				if (((!((Object)(object)val6 != (Object)null) || !Object.op_Implicit((Object)(object)val6) || val6.suspicionLevel <= 8) && !((VehicleController)mainScript).ignitionStarted) || Vector3.Angle(((VehicleController)mainScript).averageVelocity, ((Component)val4.mainScript).transform.position - ((Component)this).transform.position) > 130f || ((Collider)insideTruckNavMeshBounds).ClosestPoint(((Component)val4.mainScript).transform.position) == ((Component)val4.mainScript).transform.position || ((Collider)insideTruckNavMeshBounds).ClosestPoint(val4.mainScript.agent.destination) == val4.mainScript.agent.destination)
				{
					return;
				}
				bool dealDamage = false;
				for (int i = 0; i < enemiesLastHit.Length; i++)
				{
					if ((Object)(object)enemiesLastHit[i] == (Object)(object)val4.mainScript && (Time.realtimeSinceStartup - timeSinceHittingEnemy < 0.6f || ((Vector3)(ref ((VehicleController)mainScript).averageVelocity)).magnitude < 4f))
					{
						dealDamage = true;
					}
				}
				timeSinceHittingEnemy = Time.realtimeSinceStartup;
				Vector3 position = ((Component)val4).transform.position;
				bool flag = false;
				EnemySize enemySize = val4.mainScript.enemyType.EnemySize;
				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;
					}
				}
			}
		}
	}
}
public class CruiserXLController : VehicleController
{
	[Header("Variety")]
	public VanVariant vanVariant = VanVariant.Default;

	private const string A_DOOR_IS_AJAR = "a door is ajar";

	private const string DONT_FORGET_YOUR_KEYS = "dont forget your keys";

	public Material vanMaterial;

	public Texture2D defaultVanTex;

	public VanCameraManager cameraManager;

	public Material steelBoltMaterial;

	public Material genericMaterial;

	public GameObject frontLeftLowBeamLightObj;

	public GameObject frontRightLowBeamLightObj;

	public GameObject frontLeftHighBeamLightObj;

	public GameObject frontRightHighBeamLightObj;

	public GameObject frontLeftLightObj;

	public GameObject frontRightLightObj;

	public GameObject frontLeftBlinkerLightObj;

	public GameObject frontRightBlinkerLightObj;

	public Light frontLeftBlinkerLight;

	public Light frontRightBlinkerLight;

	public AnimatedObjectTrigger windshieldWipers;

	public GameObject windshieldWipersObj;

	public Animator windshieldWipersAnimator;

	public GameObject roofRailsObj;

	public GameObject roofRailsInteractObj;

	public GameObject leftMirrorObj;

	public GameObject centerMirrorObj;

	public GameObject rightMirrorObj;

	public Camera leftCameraMirror;

	public Camera centerCameraMirror;

	public Camera rightCameraMirror;

	public MeshRenderer leftMirrorMesh;

	public MeshRenderer centerMirrorMesh;

	public MeshRenderer rightMirrorMesh;

	public MeshFilter interiorMeshFilter;

	public MeshFilter mainBodyMeshFilter;

	public MeshFilter mainBodyLodMeshFilter;

	public MeshFilter leftDoorMeshFilter;

	public MeshFilter leftDoorLodMeshFilter;

	public MeshFilter rightDoorMeshFilter;

	public MeshFilter rightDoorLodMeshFilter;

	public MeshFilter lowBeamMeshFilter;

	public MeshFilter lowBeamLodMeshFilter;

	public MeshFilter highBeamMeshFilter;

	public MeshFilter highBeamLodMeshFilter;

	public MeshFilter leftSignalMeshFilter;

	public MeshFilter leftSignalLodMeshFilter;

	public MeshFilter rightSignalMeshFilter;

	public MeshFilter rightSignalLodMeshFilter;

	public MeshFilter hoodMeshFilter;

	public MeshFilter hoodLodMeshFilter;

	public MeshFilter steeringWheelMeshFilter;

	public MeshRenderer steeringWheelMesh;

	public MeshFilter frontLeftWheelMeshFilter;

	public MeshFilter frontRightWheelMeshFilter;

	public MeshFilter backLeftWheelMeshFilter;

	public MeshFilter backRightWheelMeshFilter;

	public MeshFilter backLeftBrakeMeshFilter;

	public MeshFilter backRightBrakeMeshFilter;

	public Texture2D creasmanVanTex;

	public GameObject creasmanWindshieldWipersObj;

	public Animator creasmanWindshieldWipersAnimator;

	public AudioClip creasmanRevEngineStart;

	public AudioClip creasmanEngineStartSuccessful;

	public AudioClip creasmanEngineRun;

	public AudioClip creasmanEngineRun2;

	public AudioClip creasmanEngineRev;

	public AudioClip creasmanEngineStall;

	public Camera creasmanLeftCameraMirror;

	public Camera creasmanRightCameraMirror;

	public GameObject creasmanFogBeamContainer;

	public GameObject creasmanLeftMirrorObj;

	public GameObject creasmanRightMirrorObj;

	public MeshRenderer creasmanLeftMirrorMesh;

	public MeshRenderer creasmanRightMirrorMesh;

	public MeshFilter creasmanInteriorMeshFilter;

	public Material creasmanClusterDialsOffMat;

	public Material creasmanClusterDialsOnMat;

	public AnimationCurve creasmanEnginePowerCurve;

	public AudioClip creasmanHornAudioClip;

	public AudioClip creasmanAlarmAudioClip;

	public MeshRenderer creasmanFogLampsMesh;

	public GameObject creasmanFogLampsObj;

	public MeshFilter creasmanMainBodyMeshFilter;

	public MeshFilter creasmanMainBodyLodMeshFilter;

	public MeshFilter creasmanLeftDoorMeshFilter;

	public MeshFilter creasmanLeftDoorLodMeshFilter;

	public MeshFilter creasmanRightDoorMeshFilter;

	public MeshFilter creasmanRightDoorLodMeshFilter;

	public MeshFilter creasmanHoodMeshFilter;

	public MeshFilter creasmanHoodLodMeshFilter;

	public MeshFilter creasmanLowBeamMeshFilter;

	public MeshFilter creasmanLowBeamLodMeshFilter;

	public MeshFilter creasmanHighBeamMeshFilter;

	public MeshFilter creasmanHighBeamLodMeshFilter;

	public MeshFilter creasmanLeftSignalMeshFilter;

	public MeshFilter creasmanLeftSignalLodMeshFilter;

	public MeshFilter creasmanRightSignalMeshFilter;

	public MeshFilter creasmanRightSignalLodMeshFilter;

	public MeshFilter creasmanSteeringWheelMeshFilter;

	public MeshFilter creasmanFrontLeftWheelMeshFilter;

	public MeshFilter creasmanFrontRightWheelMeshFilter;

	public MeshFilter creasmanBackLeftWheelMeshFilter;

	public MeshFilter creasmanBackRightWheelMeshFilter;

	public MeshFilter creasmanBackLeftBrakeMeshFilter;

	public MeshFilter creasmanBackRightBrakeMeshFilter;

	public bool hasVehicleDisplay = true;

	public bool hasFogLamps;

	public Texture2D jensonVanTex;

	public Material jensonDialsOnMat;

	public Material jensonClusterOnMat;

	public Material jensonRadioOnMat;

	public Material jensonHeaterOnMat;

	public Material jensonWindowOnMat;

	public Light radioLightCol;

	public Light heaterLightCol;

	public Light clusterLightCol;

	public Light leftWindowLightCol;

	public Light rightWindowLightCol;

	public bool disableElectricMirrors;

	[Header("Physics")]
	public List<WheelCollider> wheels;

	public AnimationCurve steeringWheelCurve;

	public CruiserXLCollisionTrigger collisionTrigger;

	public Rigidbody playerPhysicsBody;

	public AnimationCurve engineCurve;

	public AnimationCurve enginePowerCurve;

	public Vector3 lastVelocity;

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

	public Vector3 previousVehiclePosition;

	public Quaternion previousVehicleRotation;

	private float timeSinceLastCollision;

	public bool hasDeliveredVehicle;

	public bool frontWheelsGrounded;

	public bool backWheelsGrounded;

	public bool allWheelsAirborne;

	public bool allWheelsGrounded;

	private float timeSinceUntethered;

	public bool usingSwitchIgnition;

	public bool engineStalled;

	public bool handbrakeEngaged;

	public bool inReverse;

	public bool inNeutral;

	public bool clutchPedalPressed;

	public bool lastClutchPedalPressed;

	public float brakeInput;

	public float clutchInput;

	public float gasInput;

	public float throttleInput;

	public float clutchSpeed;

	public float minClutchReturnSpeed;

	public float clutchReturnSpeed;

	public float stallTimer;

	public float clutchFriction;

	public float clutchEngagement;

	public float throttleReleaseSpeed;

	public float maxThrottleSpeed;

	public float throttleSpeed;

	public float inclineCompensation;

	public float maxInclineCompensation = 4.1f;

	public const float minInclineCompensation = 1.78f;

	public const float maxInclineCompensationAngle = 32f;

	public float forwardWheelSpeed;

	public float reverseWheelSpeed;

	public float frontWheelRPM;

	public float backWheelRPM;

	public float wheelRPM;

	private const float maxAutoCenterSpeed = 8f;

	private float steeringAngle;

	private float forwardsSlip;

	public float baseForwardStiffness = 1f;

	public float baseSidewaysStiffness = 0.75f;

	public float currentMotorTorque;

	public float currentBrakeTorque;

	public float maxBrakingPower;

	public float enginePower;

	public float engineReversePower;

	public float timeAtLastGearboxDamage;

	public int baseTransmissionHP = 20;

	public int syncedTransmissionHP;

	public int transmissionHP;

	public float[] gearRatios;

	public float diffRatio;

	public int currentGear;

	[Header("Networking/Player")]
	private bool receivedVariantSyncData;

	private bool receivedClientSyncData;

	private bool receivedNetworkSyncData;

	private bool shakingCamera;

	public ExtendedPhysicsRegion vanZone;

	public ExtendedPlayerZone vanCabinZone;

	public ExtendedPlayerZone vanStorageZone;

	public Collider itemSafetyBounds;

	public Collider vehicleBounds;

	public CapsuleCollider cabinPoint;

	public Collider storageCompartment;

	public PlayerControllerB lastDriver;

	public PlayerControllerB playerWhoShifted;

	public VanSeatAnimator frontLeftSeat;

	public VanSeatAnimator frontMiddleSeat;

	public VanSeatAnimator frontRightSeat;

	public PlayerControllerB currentMiddlePassenger;

	public InteractTrigger middlePassengerSeatTrigger;

	public InteractTrigger driversSideWindow;

	public InteractTrigger passengersSideWindow;

	public AnimatedObjectTrigger driversSideWindowTrigger;

	public AnimatedObjectTrigger passengersSideWindowTrigger;

	public bool localPlayerInMiddlePassengerSeat;

	public float syncedSteeringWheelRotation;

	public float syncedFrontWheelRPM;

	public float syncedBackWheelRPM;

	public float syncedWheelRPM;

	public float syncedEngineRPM;

	public float syncedCurrentMotorTorque;

	public float syncedCurrentBrakeTorque;

	public int syncedCarHP;

	public bool syncedDrivePedalPressed;

	public bool syncedBrakePedalPressed;

	public bool syncedClutchPedalPressed;

	public float tyreStress;

	public bool wheelSlipping;

	public bool wheelSkidActive;

	public float syncEffectsInterval;

	public float syncTorqueInterval;

	public float syncDrivetrainInterval;

	[Header("VFX")]
	public GameObject heaterDirectionLever;

	public GameObject heaterTempLever;

	public GameObject fanSpeedLever;

	public MeshRenderer heaterBaseMesh;

	public MeshRenderer windshieldMesh;

	public GameObject[] disableOnDestroy;

	public GameObject[] enableOnDestroy;

	public GameObject windshieldObject;

	public InteractTrigger pushTruckTrigger;

	public MeshRenderer leftBrakeMesh;

	public MeshRenderer rightBrakeMesh;

	public MeshRenderer backLeftBrakeMesh;

	public MeshRenderer backRightBrakeMesh;

	public Collider[] weatherEffectBlockers;

	public Collider ignitionCollider;

	public Animator handbrakeAnimator;

	public ScanNodeProperties scanNode;

	public GameObject blinkerLightsContainer;

	public GameObject sideDoorContainer;

	public InteractTrigger hoodTrigger;

	public Animator leftDoorAnimator;

	public Animator rightDoorAnimator;

	public Coroutine dashboardSweepCoroutine;

	public Light hazardWarningLight;

	public Light leftSignalLight;

	public Light rightSignalLight;

	public SpriteRenderer hazardWarningSymbol;

	public SpriteRenderer leftSignalSymbol;

	public SpriteRenderer rightSignalSymbol;

	public Light vehicleDisplayLight;

	public SpriteRenderer vehicleDisplay;

	public Light parkingBrakeLight;

	public Light checkEngineLight;

	public Light alertLight;

	public Light seatBeltLight;

	public Light oilLevelLight;

	public Light batteryLight;

	public Light coolantLevelLight;

	public Light dippedBeamLight;

	public Light highBeamLight;

	public Light immobiliserLight;

	public SpriteRenderer parkingBrakeSymbol;

	public SpriteRenderer checkEngineLightSymbol;

	public SpriteRenderer alertLightSymbol;

	public SpriteRenderer seatbeltLightSymbol;

	public SpriteRenderer oilLevelLightSymbol;

	public SpriteRenderer batteryLightSymbol;

	public SpriteRenderer coolantLevelLightSymbol;

	public SpriteRenderer dippedBeamLightSymbol;

	public SpriteRenderer highBeamLightSymbol;

	public SpriteRenderer immobiliserSymbol;

	public Animator ignitionAnimator;

	public GameObject carKeyContainer;

	public GameObject carKeyInHand;

	public Transform ignitionKeyPosition;

	public GameObject headlightSwitch;

	public MeshRenderer lowBeamMesh;

	public MeshRenderer highBeamMesh;

	public GameObject highBeamContainer;

	public GameObject clusterLightsContainer;

	public MeshRenderer leftDoorMesh;

	public MeshRenderer rightDoorMesh;

	public MeshRenderer radioMesh;

	public MeshRenderer radioPowerDial;

	public MeshRenderer radioVolumeDial;

	public GameObject radioLight;

	public GameObject heaterLight;

	public GameObject leftWindowLight;

	public GameObject rightWindowLight;

	public TextMeshPro radioTime;

	public TextMeshPro radioFrequency;

	public GameObject sideLightsContainer;

	public MeshRenderer sideTopLightsMesh;

	public AnimationCurve oilPressureNeedleCurve;

	public AnimationCurve turboPressureNeedleCurve;

	public MeshRenderer interiorMesh;

	public MeshRenderer speedometerMesh;

	public MeshRenderer tachometerMesh;

	public MeshRenderer oilPressureMesh;

	public MeshRenderer lowBeamMeshLod;

	public MeshRenderer highBeamMeshLod;

	public MeshRenderer backLightsMeshLod;

	public MeshRenderer sideTopLightsMeshLod;

	public MeshRenderer leftBlinkerMeshLod;

	public MeshRenderer rightBlinkerMeshLod;

	public MeshRenderer leftBlinkerMesh;

	public MeshRenderer rightBlinkerMesh;

	public Transform speedometerTransform;

	public Transform tachometerTransform;

	public Transform oilPressureTransform;

	public VanWindow frontLeftWindow;

	public VanWindow frontRightWindow;

	public InteractTrigger domeLightTrigger;

	public Animator headlampSwitchAnimator;

	public Animator hvacAnimator;

	private Coroutine blinkersCoroutine;

	public InteractTrigger windscreenWipersTrigger;

	public InteractTrigger startIgnitionTrigger;

	public GameObject reverseLightsContainer;

	public MeshRenderer reverseLightsMesh;

	public Transform tempPushTransform;

	private bool setAudiosMuted;

	public bool treatingPlayerInfection;

	public float maxSpeedometerRot = -225f;

	public float maxTachometerRot = -112.5f;

	public string[] upShiftString;

	public string[] downShiftString;

	public bool smoothRotation;

	public bool heaterOn;

	public int heaterTemperature;

	public int heaterSpeed;

	public float steeringWheelAnimValue;

	public float steeringSpeed;

	public bool inIgnitionAnimation;

	public float odometerValue;

	public bool isHeaterCold;

	public bool isHeaterWarm;

	private const float handbrakePullSpeed = 70f;

	private float handbrakeAnimValue;

	private float timeAtLastHandbrakePull;

	private static readonly Vector3 ignitionKeyScale = Vector3.one;

	private static readonly Vector3 LHD_Pos_Local = new Vector3(0.0489f, 0.1371f, -0.1566f);

	private static readonly Vector3 LHD_Pos_Server = new Vector3(0.0366f, 0.1023f, -0.1088f);

	private static readonly Vector3 LHD_Rot_Local = new Vector3(-3.446f, 3.193f, 172.642f);

	private static readonly Vector3 LHD_Rot_Server = new Vector3(-191.643f, 174.051f, -7.768005f);

	public int currentSweepStage;

	public bool hasSweepedDashboard;

	public bool hazardsBlinking;

	public bool hazardsOn;

	public bool reverseLightsOn;

	private float speedometerValue = 850f;

	private float speedometerFloat;

	private float tachometerFloat;

	public float headlampSwitchAnimFloat;

	public float hvacFanSpeedAnimFloat;

	public float hvacFanDirectionAnimFloat;

	public float hvacFanTemperatureAnimFloat;

	public bool disableAnimations;

	public bool lowBeamsOn;

	public bool highBeamsOn;

	public bool overrideCabinLightSwitch;

	public bool cabinLightSwitchEnabled = true;

	private float oilPressureFloat;

	private float turboPressureFloat;

	public bool overdriveSwitchEnabled;

	public bool ignitionOn;

	public bool isCabinLightOn;

	public bool liftGateOpen;

	public bool sideDoorOpen;

	private const string STEERING_WHEEL_SPEED = "steeringWheelTurnSpeed";

	private const string ANIMATION_SPEED = "animationSpeed";

	private const string CAR_ANIM = "SA_CarAnim";

	private const string JUMP_WHILE_IN_CAR = "SA_JumpInCar";

	private const string CAR_HANDBRAKE_ON_ENGAGEMENT = "SA_CarHandbrakeOn";

	private const string CAR_HANDBRAKE_OFF_ENGAGEMENT = "SA_CarHandbrakeOff";

	private const string HANDBRAKE_ENGAGEMENT = "engagement";

	private const string UPPER_BODY_RADIO_ON = "U_Radio_TurnOn_LHD";

	private const string LEFT_ARM_RADIO_ON = "L_Radio_TurnOn_LHD";

	private const string RIGHT_ARM_RADIO_ON = "R_Radio_TurnOn_LHD";

	private const string UPPER_BODY_HANDBRAKE_ON = "U_EngageHandbrake";

	private const string LEFT_ARM_HANDBRAKE_ON = "L_EngageHandbrake";

	private const string RIGHT_ARM_HANDBRAKE_ON = "R_EngageHandbrake";

	private const string UPPER_BODY_HANDBRAKE_OFF = "U_DisengageHandbrake";

	private const string LEFT_ARM_HANDBRAKE_OFF = "L_DisengageHandbrake";

	private const string RIGHT_ARM_HANDBRAKE_OFF = "R_DisengageHandbrake";

	private const string HVAC_TEMPERATURE_FLOAT = "temperature";

	private const string HVAC_FAN_SPEED_FLOAT = "fanSpeed";

	private const string HVAC_DIRECTION_FLOAT = "direction";

	private const string DOOR_ELECTRIC_MIRROR_BOOL = "mirrorOpen";

	private const string HOOD_OPENING_HOLDTIP = "[ Opening hood ]";

	private const string HOOD_CLOSING_HOLDTIP = "[ Closing hood ]";

	private const string HEADLAMP_SWITCH_FLOAT = "switch";

	private const string DOMELIGHT_IGNITION_HOVERTIP = "Switch cabin light : [LMB]";

	private const string DOMELIGHT_OFF_HOVERTIP = "Switch cabin light : [LMB] (Off)";

	private const string DOMELIGHT_ON_HOVERTIP = "Switch cabin light : [LMB] (On)";

	private const string HOOD_ANIMATION_BOOL = "hoodOpen";

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

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

	private const string DOOR_EXIT_HOLDTIP = "[ Exiting ]";

	private const string WINDOW_DISABLED_HOLDTIP = "[ No ignition power ]";

	private const string UNTWIST_KEY_HOVERTIP = "Untwist key : [LMB]";

	private const string UNTWIST_KEY_HOLDTIP = "[ Untwisting key ]";

	private const string TRYIGNITION_KEY_HOVERTIP = "Try ignition : [LMB] (Hold)";

	private const string TRYIGNITION_KEY_HOLDTIP = "[ Trying ignition ]";

	private const string REMOVE_KEY_HOVERTIP = "Remove key : [LMB]";

	private const string REMOVE_KEY_HOLDTIP = "[ Removing key ]";

	private const string PLAYER_MOVEMENT = "Move";

	private const string CAMERA_SHAKE_CONSTANT = "ShakingConstant";

	private const int DEFAULT_PLAYER_ANIMATION = 0;

	private const int SITTING_IN_SEAT_HANDS_ON_WHEEL = 1;

	private const int INSERT_IGNITION_KEY = 2;

	private const int UNTWIST_IGNITION_KEY = 3;

	private const int UNTWIST_IGNITION_KEY_IN = 7;

	private const int REMOVE_IGNITION_KEY = 8;

	private const int RETWIST_IGNITION_KEY_IN_IGNITION = 12;

	private const int DEFAULT_IGNITION_SLOT = 0;

	private const int STARTED_IGNITION_SLOT = 1;

	private const int UNTWIST_IGNITION_SLOT = 7;

	private const int UNTWIST_IGNITION_KEY_FALLBACK = 13;

	private const float DEFAULT_ANIMATION_SPEED = 0.5f;

	private const string IGNITION_ANIM = "SA_IgnitionAnim";

	private const string REMOVE_IN_IGNITION = "SA_RemoveInIgnition";

	[Header("Audio")]
	public EVAModule voiceModule;

	public RadioBehaviour liveRadioController;

	public AnimationCurve idleVolumeCurve;

	public AnimationCurve revVolumeCurve;

	public AudioSource[] allVehicleAudios;

	public AudioClip[] streamerRadioClips;

	public AudioSource roofAudio;

	public AudioSource cabinLightSwitchAudio;

	public AudioClip cabinLightSwitchToggle;

	public AudioSource handbrakeAudio;

	public AudioClip handbrakeOn;

	public AudioClip handbrakeOff;

	public AudioClip[] clutchInClips;

	public AudioClip[] clutchOutClips;

	public AudioSource miscEngineAudio;

	public AudioSource engineAudio3;

	public AudioClip stallEngine;

	public AudioClip blinkOn;

	public AudioClip blinkOff;

	public AudioClip[] gearCrunchSounds;

	public AudioClip[] shiftSounds;

	public AudioSource roofRainAudio;

	public AudioSource carKeySounds;

	public AudioSource wiperAudio;

	public AudioSource backUpBeeperAudio;

	private Coroutine vanAlarmCoroutine;

	public AudioSource alarmAudio;

	public AudioSource heaterAudio;

	public bool roofRainAudioActive;

	private float engineThrottleVolume = 1f;

	private float timeSinceTogglingRadio;

	public bool alarmDebounce;

	private float timeAtLastAlarmPing;

	private float timeAtLastEVAPing;

	private float lastSongTime;

	public const float minFrequency = 75.55f;

	public const float maxFrequency = 255.5f;

	public bool isFmRadio;

	private float syncedSongTime;

	private float timeLastSyncedRadio;

	private float radioPingTimestamp;

	[Header("Materials")]
	public Material blinkerOffMat;

	public Material blinkerOnMat;

	public Material clusterDialsOffMat;

	public Material clusterDialsOnMat;

	public Material heaterOffMat;

	public Material heaterOnMat;

	public Material greyLightOffMat;

	public Material redLightOffMat;

	public Material clusterOffMaterial;

	public Material clusterOnMaterial;

	public Material radioOffMaterial;

	public Material radioOnMaterial;

	public Material windowOffMaterial;

	public Material windowOnMaterial;

	public Material windshieldMat;

	[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 override void OnNetworkSpawn()
	{
		((NetworkBehaviour)this).OnNetworkSpawn();
		if (((NetworkBehaviour)this).NetworkManager.IsServer && !IsInShipPhaseAndNotLoadingLevel())
		{
			Random random = new Random(StartOfRound.Instance.randomMapSeed);
			ChooseVanVariant(random);
			ChooseAltVoiceAlerts(random);
			InitializeVanRpc(voiceModule.randomServiceAlert, voiceModule.useAltAudio);
		}
	}

	internal void ChooseVanVariant(Random random)
	{
		double num = random.NextDouble() * 100.0;
		float num2 = 1.6f;
		float num3 = 9f;
		if (ScanVanNetworker.Instance.overrideChance || num < (double)num2)
		{
			vanVariant = VanVariant.Creasman;
		}
		else if (num < (double)(num2 + num3))
		{
			vanVariant = VanVariant.JCJenson;
		}
		else
		{
			vanVariant = VanVariant.Default;
		}
		ScanVanNetworker.Instance.overrideChance = false;
		SetVanVariantRpc((int)vanVariant);
		SetVanVariant();
	}

	internal void ChooseAltVoiceAlerts(Random random)
	{
		if (random.Next(100) < 37)
		{
			voiceModule.randomServiceAlert = random.Next(18, 21);
		}
		if (random.Next(100) < 10)
		{
			voiceModule.useAltAudio = true;
			voiceModule.voiceAudioClips[4] = voiceModule.keysAlertAlt;
			voiceModule.voiceAudioClips[6] = voiceModule.doorAlertAlt;
			voiceModule.voiceAudioClips[7] = voiceModule.doorAlertAlt;
			voiceModule.voiceAudioClips[8] = voiceModule.doorAlertAlt;
			voiceModule.voiceAudioClips[9] = voiceModule.doorAlertAlt;
			voiceModule.clusterTexts[4] = "dont forget your keys";
			voiceModule.clusterTexts[6] = "a door is ajar";
			voiceModule.clusterTexts[7] = "a door is ajar";
			voiceModule.clusterTexts[8] = "a door is ajar";
			voiceModule.clusterTexts[9] = "a door is ajar";
		}
	}

	[Rpc(/*Could not decode attribute arguments.*/)]
	public void SetVanVariantRpc(int setVariant)
	{
		//IL_0024: Unknown result type (might be due to invalid IL or missing references)
		//IL_002e: Invalid comparison between Unknown and I4
		//IL_0099: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a3: Invalid comparison between Unknown and I4
		//IL_0043: Unknown result type (might be due to invalid IL or missing references)
		//IL_004b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0051: Unknown result type (might be due to invalid IL or missing references)
		//IL_005f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0064: Unknown result type (might be due to invalid IL or missing references)
		//IL_0068: Unknown result type (might be due to invalid IL or missing references)
		//IL_0080: Unknown result type (might be due to invalid IL or missing references)
		//IL_0084: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b2: 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(3809358322u, val3, val, (SendTo)3, (RpcDelivery)0);
			BytePacker.WriteValueBitPacked(val2, setVariant);
			((NetworkBehaviour)this).__endSendRpc(ref val2, 3809358322u, val3, val, (SendTo)3, (RpcDelivery)0);
		}
		if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1)
		{
			((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0;
			if (!receivedVariantSyncData)
			{
				receivedVariantSyncData = true;
				vanVariant = (VanVariant)setVariant;
				SetVanVariant();
			}
		}
	}

	[Rpc(/*Could not decode attribute arguments.*/)]
	public void InitializeVanRpc(int serviceAlert, bool useAlt)
	{
		//IL_0024: Unknown result type (might be due to invalid IL or missing references)
		//IL_002e: Invalid comparison between Unknown and I4
		//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
		//IL_00be: Invalid comparison between Unknown and I4
		//IL_0043: Unknown result type (might be due to invalid IL or missing references)
		//IL_004b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0051: Unknown result type (might be due to invalid IL or missing references)
		//IL_005f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0064: Unknown result type (might be due to invalid IL or missing references)
		//IL_0068: Unknown result type (might be due to invalid IL or missing references)
		//IL_0081: Unknown result type (might be due to invalid IL or missing references)
		//IL_0087: Unknown result type (might be due to invalid IL or missing references)
		//IL_009b: Unknown result type (might be due to invalid IL or missing references)
		//IL_009f: Unknown result type (might be due to invalid IL or missing references)
		//IL_00cd: Unknown result type (might be due to invalid IL or missing references)
		NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
		if (networkManager == null || !networkManager.IsListening)
		{
			return;
		}
		if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1)
		{
			RpcAttributeParams val = default(RpcAttributeParams);
			RpcParams val3 = default(RpcParams);
			FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(2934651884u, val3, val, (SendTo)3, (RpcDelivery)0);
			BytePacker.WriteValueBitPacked(val2, serviceAlert);
			((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref useAlt, default(ForPrimitives));
			((NetworkBehaviour)this).__endSendRpc(ref val2, 2934651884u, val3, val, (SendTo)3, (RpcDelivery)0);
		}
		if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1)
		{
			return;
		}
		((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0;
		if (!receivedNetworkSyncData)
		{
			receivedNetworkSyncData = true;
			voiceModule.randomServiceAlert = serviceAlert;
			voiceModule.useAltAudio = useAlt;
			if (useAlt)
			{
				voiceModule.voiceAudioClips[4] = voiceModule.keysAlertAlt;
				voiceModule.voiceAudioClips[6] = voiceModule.doorAlertAlt;
				voiceModule.voiceAudioClips[7] = voiceModule.doorAlertAlt;
				voiceModule.voiceAudioClips[8] = voiceModule.doorAlertAlt;
				voiceModule.voiceAudioClips[9] = voiceModule.doorAlertAlt;
				voiceModule.clusterTexts[4] = "dont forget your keys";
				voiceModule.clusterTexts[6] = "a door is ajar";
				voiceModule.clusterTexts[7] = "a door is ajar";
				voiceModule.clusterTexts[8] = "a door is ajar";
				voiceModule.clusterTexts[9] = "a door is ajar";
			}
		}
	}

	public void SetVanVariant()
	{
		//IL_0044: Unknown result type (might be due to invalid IL or missing references)
		//IL_0049: Unknown result type (might be due to invalid IL or missing references)
		//IL_0064: Unknown result type (might be due to invalid IL or missing references)
		//IL_0069: Unknown result type (might be due to invalid IL or missing references)
		//IL_0084: Unknown result type (might be due to invalid IL or missing references)
		//IL_0089: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b6: Unknown result type (might be due to invalid IL or missing references)
		//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d6: Unknown result type (might be due to invalid IL or missing references)
		//IL_00db: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f6: 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_011f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0124: Unknown result type (might be due to invalid IL or missing references)
		//IL_0148: Unknown result type (might be due to invalid IL or missing references)
		//IL_014d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0171: Unknown result type (might be due to invalid IL or missing references)
		//IL_0176: Unknown result type (might be due to invalid IL or missing references)
		//IL_019a: Unknown result type (might be due to invalid IL or missing references)
		//IL_019f: Unknown result type (might be due to invalid IL or missing references)
		//IL_01c3: Unknown result type (might be due to invalid IL or missing references)
		//IL_01c8: Unknown result type (might be due to invalid IL or missing references)
		//IL_01f1: Unknown result type (might be due to invalid IL or missing references)
		//IL_01f6: Unknown result type (might be due to invalid IL or missing references)
		//IL_021a: Unknown result type (might be due to invalid IL or missing references)
		//IL_021f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0243: Unknown result type (might be due to invalid IL or missing references)
		//IL_0248: Unknown result type (might be due to invalid IL or missing references)
		//IL_02a5: Unknown result type (might be due to invalid IL or missing references)
		//IL_02aa: Unknown result type (might be due to invalid IL or missing references)
		//IL_02cb: Unknown result type (might be due to invalid IL or missing references)
		//IL_02d0: Unknown result type (might be due to invalid IL or missing references)
		//IL_02f6: Unknown result type (might be due to invalid IL or missing references)
		//IL_02fb: Unknown result type (might be due to invalid IL or missing references)
		//IL_0401: Unknown result type (might be due to invalid IL or missing references)
		//IL_042b: Unknown result type (might be due to invalid IL or missing references)
		//IL_042d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0434: Unknown result type (might be due to invalid IL or missing references)
		//IL_0440: Unknown result type (might be due to invalid IL or missing references)
		//IL_044c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0458: Unknown result type (might be due to invalid IL or missing references)
		//IL_0503: 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_052c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0531: 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_057b: Unknown result type (might be due to invalid IL or missing references)
		//IL_059f: Unknown result type (might be due to invalid IL or missing references)
		//IL_05c3: Unknown result type (might be due to invalid IL or missing references)
		//IL_05e7: Unknown result type (might be due to invalid IL or missing references)
		//IL_060b: Unknown result type (might be due to invalid IL or missing references)
		//IL_062f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0653: Unknown result type (might be due to invalid IL or missing references)
		//IL_0677: Unknown result type (might be due to invalid IL or missing references)
		//IL_069b: Unknown result type (might be due to invalid IL or missing references)
		//IL_06bf: Unknown result type (might be due to invalid IL or missing references)
		//IL_09ec: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a10: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a45: Unknown result type (might be due to invalid IL or missing references)
		//IL_0b36: Unknown result type (might be due to invalid IL or missing references)
		//IL_0b3b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0b56: Unknown result type (might be due to invalid IL or missing references)
		//IL_0b5b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0b76: Unknown result type (might be due to invalid IL or missing references)
		//IL_0b7b: Unknown result type (might be due to invalid IL or missing references)
		switch (vanVariant)
		{
		case VanVariant.Default:
			vanMaterial.mainTexture = (Texture)(object)defaultVanTex;
			base.headlightsOffMat.color = Color32.op_Implicit(new Color32((byte)113, (byte)110, (byte)101, byte.MaxValue));
			base.headlightsOnMat.color = Color32.op_Implicit(new Color32((byte)113, (byte)110, (byte)101, byte.MaxValue));
			blinkerOffMat.color = Color32.op_Implicit(new Color32((byte)113, (byte)110, (byte)101, byte.MaxValue));
			break;
		case VanVariant.JCJenson:
			vanMaterial.mainTexture = (Texture)(object)jensonVanTex;
			base.headlightsOffMat.color = Color32.op_Implicit(new Color32((byte)113, (byte)110, (byte)101, byte.MaxValue));
			base.headlightsOnMat.color = Color32.op_Implicit(new Color32((byte)113, (byte)110, (byte)101, byte.MaxValue));
			blinkerOffMat.color = Color32.op_Implicit(new Color32((byte)113, (byte)110, (byte)101, byte.MaxValue));
			radioLightCol.color = Color32.op_Implicit(new Color32((byte)250, (byte)254, (byte)170, byte.MaxValue));
			leftWindowLightCol.color = Color32.op_Implicit(new Color32((byte)250, (byte)254, (byte)170, byte.MaxValue));
			rightWindowLightCol.color = Color32.op_Implicit(new Color32((byte)250, (byte)254, (byte)170, byte.MaxValue));
			heaterLightCol.color = Color32.op_Implicit(new Color32((byte)250, (byte)254, (byte)170, byte.MaxValue));
			clusterLightCol.color = Color32.op_Implicit(new Color32((byte)250, (byte)254, (byte)222, byte.MaxValue));
			voiceModule.clusterLight.color = Color32.op_Implicit(new Color32((byte)250, (byte)254, (byte)222, byte.MaxValue));
			vehicleDisplay.color = Color32.op_Implicit(new Color32((byte)250, (byte)254, (byte)222, byte.MaxValue));
			vehicleDisplayLight.color = Color32.op_Implicit(new Color32((byte)250, (byte)254, (byte)222, byte.MaxValue));
			clusterDialsOnMat = jensonDialsOnMat;
			clusterOnMaterial = jensonClusterOnMat;
			radioOnMaterial = jensonRadioOnMat;
			heaterOnMat = jensonHeaterOnMat;
			windowOnMaterial = jensonWindowOnMat;
			((Graphic)radioTime).color = Color32.op_Implicit(new Color32(byte.MaxValue, (byte)204, (byte)51, byte.MaxValue));
			((Graphic)radioFrequency).color = Color32.op_Implicit(new Color32(byte.MaxValue, (byte)204, (byte)51, byte.MaxValue));
			((Graphic)voiceModule.clusterScreen).color = Color32.op_Implicit(new Color32(byte.MaxValue, (byte)204, (byte)51, byte.MaxValue));
			voiceModule.clusterTexts[0] = "sys status: [ok]";
			voiceModule.clusterTexts[15] = "high temp!";
			voiceModule.clusterTexts[13] = "error: wd606";
			break;
		case VanVariant.Creasman:
		{
			vanMaterial.mainTexture = (Texture)(object)creasmanVanTex;
			base.MinEngineRPM = 900f;
			base.MaxEngineRPM = 6500f;
			base.engineIntensityPercentage = base.MaxEngineRPM;
			base.EngineTorque = 100f;
			maxInclineCompensation = 5.5f;
			base.steeringWheelTurnSpeed = 5f;
			steeringSpeed = 9.5f;
			base.mainRigidbody.maxLinearVelocity = 80f;
			base.mainRigidbody.drag = 0.01f;
			clutchReturnSpeed = 2.5f;
			clutchSpeed = 4.25f;
			throttleReleaseSpeed = 3.8f;
			maxThrottleSpeed = 3.5f;
			maxSpeedometerRot = -185f;
			maxTachometerRot = -147.5f;
			JointSpring suspensionSpring = new JointSpring
			{
				spring = 30000f,
				damper = 4800f,
				targetPosition = 0.7f
			};
			base.FrontRightWheel.suspensionSpring = suspensionSpring;
			base.FrontLeftWheel.suspensionSpring = suspensionSpring;
			base.BackRightWheel.suspensionSpring = suspensionSpring;
			base.BackLeftWheel.suspensionSpring = suspensionSpring;
			interiorMeshFilter.mesh = creasmanInteriorMeshFilter.mesh;
			Material[] sharedMaterials = ((Renderer)interiorMesh).sharedMaterials;
			clusterDialsOffMat = creasmanClusterDialsOffMat;
			clusterDialsOnMat = creasmanClusterDialsOnMat;
			sharedMaterials[3] = creasmanClusterDialsOffMat;
			((Renderer)interiorMesh).sharedMaterials = sharedMaterials;
			roofRailsObj.SetActive(false);
			roofRailsInteractObj.SetActive(false);
			leftMirrorObj.SetActive(false);
			centerMirrorObj.SetActive(false);
			rightMirrorObj.SetActive(false);
			base.headlightsOffMat.color = Color32.op_Implicit(new Color32((byte)176, (byte)176, (byte)176, byte.MaxValue));
			base.headlightsOnMat.color = Color32.op_Implicit(new Color32((byte)176, (byte)176, (byte)176, byte.MaxValue));
			blinkerOffMat.color = Color32.op_Implicit(new Color32((byte)201, (byte)145, (byte)110, byte.MaxValue));
			frontLeftBlinkerLightObj.transform.localPosition = new Vector3(2f, -0.97f, 5.555f);
			frontLeftBlinkerLightObj.transform.localRotation = Quaternion.Euler(0f, 60f, 0f);
			frontRightBlinkerLightObj.transform.localPosition = new Vector3(-2f, -0.97f, 5.555f);
			frontRightBlinkerLightObj.transform.localRotation = Quaternion.Euler(0f, -60f, 0f);
			frontLeftLowBeamLightObj.transform.localPosition = new Vector3(-1.535f, 1.63f, 4.932f);
			frontRightLowBeamLightObj.transform.localPosition = new Vector3(1.535f, 1.63f, 4.932f);
			frontLeftHighBeamLightObj.transform.localPosition = new Vector3(-0.705f, 1.645f, 4.855f);
			frontRightHighBeamLightObj.transform.localPosition = new Vector3(0.705f, 1.645f, 4.855f);
			frontLeftLightObj.transform.localPosition = new Vector3(-1.165f, 1.74f, 5.135f);
			frontRightLightObj.transform.localPosition = new Vector3(1.165f, 1.74f, 5.135f);
			creasmanFogLampsObj.SetActive(true);
			hasFogLamps = true;
			mainBodyMeshFilter.mesh = creasmanMainBodyMeshFilter.mesh;
			mainBodyLodMeshFilter.mesh = creasmanMainBodyLodMeshFilter.mesh;
			leftDoorMeshFilter.mesh = creasmanLeftDoorMeshFilter.mesh;
			leftDoorLodMeshFilter.mesh = creasmanLeftDoorLodMeshFilter.mesh;
			steeringWheelMeshFilter.mesh = creasmanSteeringWheelMeshFilter.mesh;
			Material[] sharedMaterials2 = (Material[])(object)new Material[2] { genericMaterial, steelBoltMaterial };
			((Renderer)steeringWheelMesh).sharedMaterials = sharedMaterials2;
			rightDoorMeshFilter.mesh = creasmanRightDoorMeshFilter.mesh;
			rightDoorLodMeshFilter.mesh = creasmanRightDoorLodMeshFilter.mesh;
			hoodMeshFilter.mesh = creasmanHoodMeshFilter.mesh;
			hoodLodMeshFilter.mesh = creasmanHoodLodMeshFilter.mesh;
			lowBeamMeshFilter.mesh = creasmanLowBeamMeshFilter.mesh;
			lowBeamLodMeshFilter.mesh = creasmanLowBeamLodMeshFilter.mesh;
			highBeamMeshFilter.mesh = creasmanHighBeamMeshFilter.mesh;
			highBeamLodMeshFilter.mesh = creasmanHighBeamLodMeshFilter.mesh;
			leftSignalMeshFilter.mesh = creasmanLeftSignalMeshFilter.mesh;
			leftSignalLodMeshFilter.mesh = creasmanLeftSignalLodMeshFilter.mesh;
			rightSignalMeshFilter.mesh = creasmanRightSignalMeshFilter.mesh;
			rightSignalLodMeshFilter.mesh = creasmanRightSignalLodMeshFilter.mesh;
			frontLeftWheelMeshFilter.mesh = creasmanFrontLeftWheelMeshFilter.mesh;
			frontRightWheelMeshFilter.mesh = creasmanFrontRightWheelMeshFilter.mesh;
			backLeftWheelMeshFilter.mesh = creasmanBackLeftWheelMeshFilter.mesh;
			backRightWheelMeshFilter.mesh = creasmanBackRightWheelMeshFilter.mesh;
			backLeftBrakeMeshFilter.mesh = creasmanBackLeftBrakeMeshFilter.mesh;
			backRightBrakeMeshFilter.mesh = creasmanBackRightBrakeMeshFilter.mesh;
			base.hornAudio.Stop();
			base.hornAudio.clip = creasmanHornAudioClip;
			alarmAudio.Stop();
			alarmAudio.clip = creasmanAlarmAudioClip;
			base.engineAudio2.Stop();
			base.engineAudio2.clip = creasmanEngineRun2;
			disableElectricMirrors = true;
			hasVehicleDisplay = false;
			((Renderer)vehicleDisplay).enabled = false;
			((Behaviour)vehicleDisplayLight).enabled = false;
			speedometerValue = 1200f;
			diffRatio = 4.75f;
			gearRatios = new float[5] { -4f, 4.5f, 2.4f, 1.6f, 1.12f };
			((Behaviour)windshieldWipersAnimator).enabled = false;
			windshieldWipersObj.SetActive(false);
			creasmanWindshieldWipersObj.SetActive(true);
			((Behaviour)creasmanWindshieldWipersAnimator).enabled = true;
			((Component)base.windwiperPhysicsBody1).GetComponent<BoxCollider>().center = new Vector3(-0.775f, 0.02f, 0f);
			((Component)base.windwiperPhysicsBody2).GetComponent<BoxCollider>().center = new Vector3(-0.775f, 0.02f, 0f);
			windshieldWipers.triggerAnimator = creasmanWindshieldWipersAnimator;
			((Component)wiperAudio).transform.localPosition = new Vector3(0f, 0.5f, 3.327f);
			((Behaviour)cameraManager).enabled = false;
			((Behaviour)leftCameraMirror).enabled = false;
			((Behaviour)centerCameraMirror).enabled = false;
			((Behaviour)rightCameraMirror).enabled = false;
			((Renderer)leftMirrorMesh).enabled = false;
			((Renderer)centerMirrorMesh).enabled = false;
			((Renderer)rightMirrorMesh).enabled = false;
			creasmanLeftMirrorObj.SetActive(true);
			creasmanRightMirrorObj.SetActive(true);
			Camera[] cameraMirrors = (Camera[])(object)new Camera[2] { creasmanLeftCameraMirror, creasmanRightCameraMirror };
			cameraManager.cameraMirrors = cameraMirrors;
			MeshRenderer[] meshMirrors = (MeshRenderer[])(object)new MeshRenderer[2] { creasmanLeftMirrorMesh, creasmanRightMirrorMesh };
			cameraManager.meshMirrors = meshMirrors;
			((Behaviour)cameraManager).enabled = true;
			break;
		}
		default:
			vanMaterial.mainTexture = (Texture)(object)defaultVanTex;
			base.headlightsOffMat.color = Color32.op_Implicit(new Color32((byte)113, (byte)110, (byte)101, byte.MaxValue));
			base.headlightsOnMat.color = Color32.op_Implicit(new Color32((byte)113, (byte)110, (byte)101, byte.MaxValue));
			blinkerOffMat.color = Color32.op_Implicit(new Color32((byte)113, (byte)110, (byte)101, byte.MaxValue));
			break;
		}
	}

	public void OnEnable()
	{
		VehicleUtils.vanController = 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();
		base.physicsRegion.priority = 1;
		base.syncedPosition = ((Component)this).transform.position;
		base.syncedRotation = ((Component)this).transform.rotation;
		usingSwitchIgnition = false;
		InitializeVan();
	}

	private void InitializeVan()
	{
		//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
		base.carTooltips = new string[4] { "Gas/Brake pedal : [W/S]", "Clutch pedal : [L-Shift]", "Change gear : [Scroll]", "Switch action : [LMB]" };
		transmissionHP = baseTransmissionHP;
		syncedTransmissionHP = baseTransmissionHP;
		if (IsInShipPhaseAndNotLoadingLevel())
		{
			base.carHP = base.baseCarHP;
			syncedCarHP = base.baseCarHP;
		}
		SetWheelFriction();
		base.mainRigidbody.maxLinearVelocity = base.carMaxSpeed;
		base.mainRigidbody.maxAngularVelocity = 4f;
		base.mainRigidbody.automaticCenterOfMass = false;
		base.mainRigidbody.centerOfMass = new Vector3(0f, -0.26f, 0.25f);
		base.mainRigidbody.automaticInertiaTensor = false;
		base.FrontLeftWheel.sprungMass = 228.2732f;
		base.FrontRightWheel.sprungMass = 228.2732f;
		base.BackLeftWheel.sprungMass = 271.7272f;
		base.BackRightWheel.sprungMass = 271.7272f;
	}

	private void SetWheelFriction()
	{
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		//IL_0045: Unknown result type (might be due to invalid IL or missing references)
		//IL_0046: Unknown result type (might be due to invalid IL or missing references)
		//IL_004d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0059: Unknown result type (might be due to invalid IL or missing references)
		//IL_0065: Unknown result type (might be due to invalid IL or missing references)
		//IL_0071: Unknown result type (might be due to invalid IL or missing references)
		//IL_0079: Unknown result type (might be due to invalid IL or missing references)
		//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
		//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c4: 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_00dc: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e8: Unknown result type (might be due to invalid IL or missing references)
		WheelFrictionCurve val = default(WheelFrictionCurve);
		((WheelFrictionCurve)(ref val)).extremumSlip = 1f;
		((WheelFrictionCurve)(ref val)).extremumValue = 0.6f;
		((WheelFrictionCurve)(ref val)).asymptoteSlip = 0.8f;
		((WheelFrictionCurve)(ref val)).asymptoteValue = 0.5f;
		((WheelFrictionCurve)(ref val)).stiffness = baseForwardStiffness;
		WheelFrictionCurve forwardFriction = val;
		base.FrontRightWheel.forwardFriction = forwardFriction;
		base.FrontLeftWheel.forwardFriction = forwardFriction;
		base.BackRightWheel.forwardFriction = forwardFriction;
		base.BackLeftWheel.forwardFriction = forwardFriction;
		val = default(WheelFrictionCurve);
		((WheelFrictionCurve)(ref val)).extremumSlip = 0.7f;
		((WheelFrictionCurve)(ref val)).extremumValue = 1f;
		((WheelFrictionCurve)(ref val)).asymptoteSlip = 0.8f;
		((WheelFrictionCurve)(ref val)).asymptoteValue = 1f;
		((WheelFrictionCurve)(ref val)).stiffness = baseSidewaysStiffness;
		WheelFrictionCurve sidewaysFriction = val;
		base.FrontRightWheel.sidewaysFriction = sidewaysFriction;
		base.FrontLeftWheel.sidewaysFriction = sidewaysFriction;
		base.BackRightWheel.sidewaysFriction = sidewaysFriction;
		base.BackLeftWheel.sidewaysFriction = sidewaysFriction;
	}

	public void Start()
	{
		//IL_009c: 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_00b5: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
		((MonoBehaviour)this).StartCoroutine(SetRainCollision());
		base.decals = (DecalProjector[])(object)new DecalProjector[24];
		if (!StartOfRound.Instance.inShipPhase || IsInShipPhaseAndLoadingLevel())
		{
			base.FrontLeftWheel.brakeTorque = maxBrakingPower;
			base.FrontRightWheel.brakeTorque = maxBrakingPower;
			base.BackLeftWheel.brakeTorque = maxBrakingPower;
			base.BackRightWheel.brakeTorque = maxBrakingPower;
			base.currentRadioClip = 0;
		}
		else
		{
			base.loadedVehicleFromSave = true;
			base.mainRigidbody.isKinematic = true;
			((Component)this).transform.position = StartOfRound.Instance.magnetPoint.position + StartOfRound.Instance.magnetPoint.forward * 7f;
			base.magnetedToShip = true;
			base.inDropshipAnimation = false;
			hasDeliveredVehicle = true;
			base.hasBeenSpawned = true;
			StartMagneting();
		}
	}

	public IEnumerator SetRainCollision()
	{
		yield return (object)new WaitForSeconds(4f);
		ParticleSystem[] 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 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_005e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0114: Unknown result type (might be due to invalid IL or missing references)
		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)));
			return;
		}
		if (base.turboBoosts > 0)
		{
			AddTurboBoostRpc(base.turboBoosts);
		}
		ClientSyncDataRpc(base.carHP, base.steeringWheelAnimFloat, base.keyIsInIgnition, base.ignitionStarted, ignitionOn, (int)vanVariant, base.EngineRPM, wheelRPM, frontWheelRPM, backWheelRPM, voiceModule.randomServiceAlert, voiceModule.useAltAudio, odometerValue, isCabinLightOn, cabinLightSwitchEnabled, overrideCabinLightSwitch, overdriveSwitchEnabled, heaterOn, heaterSpeed, isHeaterCold, isHeaterWarm, 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(1293212815u, rpcParams, val, (SendTo)8, (RpcDelivery)0);
			BytePacker.WriteValueBitPacked(val2, setCarHealth);
			((NetworkBehaviour)this).__endSendRpc(ref val2, 1293212815u, 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 carHealth, float wheelRot, bool setKeyInSlot, bool setStarted, bool setIgnitionOn, int setVariant, float engineSpeed, float wheelSpeed, float frontWheelSpeed, float backWheelSpeed, int serviceAlert, bool useAltVoices, float odometerMileage, bool setCabinLightOn, bool setCabinLightSwitch, bool setCabinLightOverride, bool setOverdrive, bool setHeaterOn, int setHeaterSpeed, bool setHeaterCold, bool setHeaterWarm, 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_0299: Unknown result type (might be due to invalid IL or missing references)
		//IL_02a3: 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_00ef: Unknown result type (might be due to invalid IL or missing references)
		//IL_0108: Unknown result type (might be due to invalid IL or missing references)
		//IL_010e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0123: Unknown result type (might be due to invalid IL or missing references)
		//IL_0129: Unknown result type (might be due to invalid IL or missing references)
		//IL_013e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0144: Unknown result type (might be due to invalid IL or missing references)
		//IL_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_0168: 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_0187: Unknown result type (might be due to invalid IL or missing references)
		//IL_019c: Unknown result type (might be due to invalid IL or missing references)
		//IL_01a2: Unknown result type (might be due to invalid IL or missing references)
		//IL_01b7: Unknown result type (might be due to invalid IL or missing references)
		//IL_01bd: Unknown result type (might be due to invalid IL or missing references)
		//IL_01d2: Unknown result type (might be due to invalid IL or missing references)
		//IL_01d8: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ed: Unknown result type (might be due to invalid IL or missing references)
		//IL_01f3: Unknown result type (might be due to invalid IL or missing references)
		//IL_0208: Unknown result type (might be due to invalid IL or missing references)
		//IL_020e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0223: Unknown result type (might be due to invalid IL or missing references)
		//IL_0229: Unknown result type (might be due to invalid IL or missing references)
		//IL_0232: Unknown result type (might be due to invalid IL or missing references)
		//IL_024b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0251: Unknown result type (might be due to invalid IL or missing references)
		//IL_0266: Unknown result type (might be due to invalid IL or missing references)
		//IL_026c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0280: Unknown result type (might be due to invalid IL or missing references)
		//IL_0284: Unknown result type (might be due to invalid IL or missing references)
		//IL_02b2: 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(601524665u, rpcParams, val, (SendTo)8, (RpcDelivery)0);
			BytePacker.WriteValueBitPacked(val2, carHealth);
			((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref wheelRot, default(ForPrimitives));
			((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));
			BytePacker.WriteValueBitPacked(val2, setVariant);
			((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));
			BytePacker.WriteValueBitPacked(val2, serviceAlert);
			((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref useAltVoices, default(ForPrimitives));
			((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref odometerMileage, 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 setCabinLightOverride, default(ForPrimitives));
			((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref setOverdrive, default(ForPrimitives));
			((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref setHeaterOn, default(ForPrimitives));
			BytePacker.WriteValueBitPacked(val2, setHeaterSpeed);
			((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref setHeaterCold, default(ForPrimitives));
			((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref setHeaterWarm, default(ForPrimitives));
			((NetworkBehaviour)this).__endSendRpc(ref val2, 601524665u, 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;
			vanVariant = (VanVariant)setVariant;
			SetVanVariant();
			base.carHP = carHealth;
			syncedCarHP = carHealth;
			syncedSteeringWheelRotation = wheelRot;
			base.steeringWheelAnimFloat = wheelRot;
			disableAnimations = !setStarted;
			heaterOn = setHeaterOn;
			heaterSpeed = setHeaterSpeed;
			isHeaterCold = setHeaterCold;
			isHeaterWarm = setHeaterWarm;
			ignitionOn = setIgnitionOn;
			voiceModule.randomServiceAlert = serviceAlert;
			voiceModule.useAltAudio = useAltVoices;
			if (useAltVoices)
			{
				voiceModule.voiceAudioClips[4] = voiceModule.keysAlertAlt;
				voiceModule.voiceAudioClips[6] = voiceModule.doorAlertAlt;
				voiceModule.voiceAudioClips[7] = voiceModule.doorAlertAlt;
				voiceModule.voiceAudioClips[8] = voiceModule.doorAlertAlt;
				voiceModule.voiceAudioClips[9] = voiceModule.doorAlertAlt;
				voiceModule.clusterTexts[4] = "dont forget your keys";
				voiceModule.clusterTexts[6] = "a door is ajar";
				voiceModule.clusterTexts[7] = "a door is ajar";
				voiceModule.clusterTexts[8] = "a door is ajar";
				voiceModule.clusterTexts[9] = "a door is ajar";
			}
			odometerValue = odometerMileage;
			overdriveSwitchEnabled = setOverdrive;
			SetIgnitionKeyValues(setKeyInHand: false, setKeyInSlot);
			overrideCabinLightSwitch = setCabinLightOverride;
			cabinLightSwitchEnabled = setCabinLightSwitch;
			SetIgnition(setStarted, setCabinLightOn);
			domeLightTrigger.hoverTip = GetCabinLightHoverTip();
			SetIgnitionInteractTrigger();
			if (setIgnitionOn)
			{
				dashboardSweepCoroutine = ((MonoBehaviour)this).StartCoroutine(DashboardSweepCoroutine());
				TrySetMirrorsFolded(setStarted);
			}
			if (hasVehicleDisplay)
			{
				SetSymbolActive(vehicleDisplay, vehicleDisplayLight, setIgnitionOn);
			}
			SetWindowInteractTriggers(setIgnitionOn);
			ignitionCollider.enabled = setIgnitionOn;
			ignitionAnimator.SetInteger("SA_IgnitionAnim", setStarted ? 1 : 0);
			syncedEngineRPM = engineSpeed;
			syncedWheelRPM = wheelSpeed;
			syncedFrontWheelRPM = frontWheelSpeed;
			syncedBackWheelRPM = backWheelSpeed;
		}
	}

	private string GetCabinLightHoverTip()
	{
		if (!overrideCabinLightSwitch && !cabinLightSwitchEnabled)
		{
			return "Switch cabin light : [LMB] (On)";
		}
		if (overrideCabinLightSwitch)
		{
			return "Switch cabin light : [LMB]";
		}
		return "Switch cabin light : [LMB] (Off)";
	}

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

	public void SetSideDoorOpen(bool open)
	{
		sideDoorOpen = open;
	}

	public void SetCabinLightSwitchLocalClient()
	{
		SetCabinLightSwitchOwnerRpc();
	}

	[Rpc(/*Could not decode attribute arguments.*/)]
	private void SetCabinLightSwitchOwnerRpc()
	{
		//IL_0024: Unknown result type (might be due to invalid IL or missing references)
		//IL_002e: Invalid comparison between Unknown and I4
		//IL_009a: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a4: Invalid comparison between Unknown and I4
		//IL_0043: Unknown result type (might be due to invalid IL or missing references)
		//IL_004b: Unknown result type (might be due to invalid IL or missing references)
		//IL_005f: Unknown result type (might be due to invalid IL or missing references)
		//IL_006d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0072: Unknown result type (might be due to invalid IL or missing references)
		//IL_0081: Unknown result type (might be due to invalid IL or missing references)
		//IL_0085: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
		NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
		if (networkManager == null || !networkManager.IsListening)
		{
			return;
		}
		if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1)
		{
			RpcAttributeParams val = new RpcAttributeParams
			{
				RequireOwnership = false
			};
			RpcParams val3 = default(RpcParams);
			FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(1187453226u, val3, val, (SendTo)0, (RpcDelivery)0);
			((NetworkBehaviour)this).__endSendRpc(ref val2, 1187453226u, val3, val, (SendTo)0, (RpcDelivery)0);
		}
		if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1)
		{
			((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0;
			if (!overrideCabinLightSwitch && !cabinLightSwitchEnabled)
			{
				overrideCabinLightSwitch = true;
				cabinLightSwitchEnabled = true;
				roofAudio.PlayOneShot(cabinLightSwitchToggle);
				base.frontCabinLightContainer.SetActive(true);
				((Renderer)base.frontCabinLightMesh).material = base.headlightsOnMat;
				string text = "Switch cabin light : [LMB] (On)";
				domeLightTrigger.hoverTip = text;
				SetCabinLightSwitchRpc(switchState: true, cabLightOn: true, setOverride: true, text);
			}
			else if (overrideCabinLightSwitch)
			{
				overrideCabinLightSwitch = false;
				cabinLightSwitchEnabled = true;
				roofAudio.PlayOneShot(cabinLightSwitchToggle);
				bool flag = isCabinLightOn && base.keyIsInIgnition && ignitionOn && cabinLightSwitchEnabled;
				base.frontCabinLightContainer.SetActive(flag);
				((Renderer)base.frontCabinLightMesh).material = (Material)(flag ? ((object)base.headlightsOnMat) : ((object)greyLightOffMat));
				string text = "Switch cabin light : [LMB]";
				domeLightTrigger.hoverTip = text;
				SetCabinLightSwitchRpc(switchState: true, flag, setOverride: false, text);
			}
			else
			{
				overrideCabinLightSwitch = false;
				cabinLightSwitchEnabled = false;
				roofAudio.PlayOneShot(cabinLightSwitchToggle);
				base.frontCabinLightContainer.SetActive(false);
				((Renderer)base.frontCabinLightMesh).material = greyLightOffMat;
				string text = "Switch cabin light : [LMB] (Off)";
				domeLightTrigger.hoverTip = text;
				SetCabinLightSwitchRpc(switchState: false, cabLightOn: false, setOverride: false, text);
			}
		}
	}

	[Rpc(/*Could not decode attribute arguments.*/)]
	private void SetCabinLightSwitchRpc(bool switchState, bool cabLightOn, bool setOverride, string setMessage)
	{
		//IL_0024: Unknown result type (might be due to invalid IL or missing references)
		//IL_002e: Invalid comparison between Unknown and I4
		//IL_0129: Unknown result type (might be due to invalid IL or missing references)
		//IL_0133: Invalid comparison between Unknown and I4
		//IL_0043: Unknown result type (might be due to invalid IL or missing references)
		//IL_004b: Unknown result type (might be due to invalid IL or missing references)
		//IL_005f: Unknown result type (might be due to invalid IL or missing references)
		//IL_006d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0072: Unknown result type (might be due to invalid IL or missing references)
		//IL_0082: Unknown result type (might be due to invalid IL or missing references)
		//IL_0088: Unknown result type (might be due to invalid IL or missing references)
		//IL_009d: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
		//IL_00be: Unknown result type (might be due to invalid IL or missing references)
		//IL_00de: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e4: Unknown result type (might be due to invalid IL or missing references)
		//IL_0142: Unknown result type (might be due to invalid IL or missing references)
		//IL_0110: Unknown result type (might be due to invalid IL or missing references)
		//IL_0114: Unknown result type (might be due to invalid IL or missing references)
		NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
		if (networkManager == null || !networkManager.IsListening)
		{
			return;
		}
		if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1)
		{
			RpcAttributeParams val = new RpcAttributeParams
			{
				RequireOwnership = false
			};
			RpcParams val3 = default(RpcParams);
			FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(396020993u, val3, val, (SendTo)5, (RpcDelivery)0);
			((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref switchState, default(ForPrimitives));
			((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref cabLightOn, default(ForPrimitives));
			((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref setOverride, default(ForPrimitives));
			bool flag = setMessage != null;
			((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref flag, default(ForPrimitives));
			if (flag)
			{
				((FastBufferWriter)(ref val2)).WriteValueSafe(setMessage, false);
			}
			((NetworkBehaviour)this).__endSendRpc(ref val2, 396020993u, val3, val, (SendTo)5, (RpcDelivery)0);
		}
		if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1)
		{
			((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0;
			overrideCabinLightSwitch = setOverride;
			cabinLightSwitchEnabled = switchState;
			roofAudio.PlayOneShot(cabinLightSwitchToggle);
			base.frontCabinLightContainer.SetActive(cabLightOn);
			((Renderer)base.frontCabinLightMesh).material = (Material)(cabLightOn ? ((object)base.headlightsOnMat) : ((object)greyLightOffMat));
			domeLightTrigger.hoverTip = setMessage;
		}
	}

	public void SetFrontCabinLightOn(bool setOn)
	{
		isCabinLightOn = setOn;
		if (overrideCabinLightSwitch)
		{
			if (!base.frontCabinLightContainer.activeSelf)
			{
				base.frontCabinLightContainer.SetActive(true);
				((Renderer)base.frontCabinLightMesh).material = base.headlightsOnMat;
			}
		}
		else if (cabinLightSwitchEnabled)
		{
			base.frontCabinLightContainer.SetActive(setOn);
			((Renderer)base.frontCabinLightMesh).material = (Material)(setOn ? ((object)base.headlightsOnMat) : ((object)greyLightOffMat));
		}
		else
		{
			base.frontCabinLightContainer.SetActive(false);
			((Renderer)base.frontCabinLightMesh).material = greyLightOffMat;
		}
	}

	public void ToggleHandbrake()
	{
		if (!base.localPlayerInControl && (Object)(object)base.currentDriver != (Object)null)
		{
			return;
		}
		float realtimeSinceStartup = Time.realtimeSinceStartup;
		if (base.localPlayerInControl && realtimeSinceStartup - timeAtLastHandbrakePull < 0.78f)
		{
			return;
		}
		timeAtLastHandbrakePull = realtimeSinceStartup;
		handbrakeEngaged = !handbrakeEngaged;
		if (base.ignitionStarted)
		{
			if (handbrakeEngaged)
			{
				PlayCombinedOccupantAnimation(base.currentDriver, "U_EngageHandbrake", "L_EngageHandbrake", "R_EngageHandbrake", 0.075f);
			}
			else
			{
				PlayCombinedOccupantAnimation(base.currentDriver, "U_DisengageHandbrake", "L_DisengageHandbrake", "R_DisengageHandbrake", 0.075f);
			}
		}
		if (handbrakeEngaged)
		{
			handbrakeAudio.PlayOneShot(handbrakeOn);
		}
		else
		{
			handbrakeAudio.PlayOneShot(handbrakeOff);
		}
		SetHandbrakeRpc(handbrakeEngaged);
	}

	[Rpc(/*Could not decode attribute arguments.*/)]
	public void SetHandbrakeRpc(bool setHandbrake)
	{
		//IL_0024: Unknown result type (might be due to invalid IL or missing references)
		//IL_002e: Invalid comparison between Unknown and I4
		//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
		//IL_00bf: Invalid comparison between Unknown and I4
		//IL_0043: Unknown result type (might be due to invalid IL or missing references)
		//IL_004b: Unknown result type (might be due to invalid IL or missing references)
		//IL_005f: Unknown result type (might be due to invalid IL or missing references)
		//IL_006d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0072: Unknown result type (might be due to invalid IL or missing references)
		//IL_0082: Unknown result type (might be due to invalid IL or missing references)
		//IL_0088: Unknown result type (might be due to invalid IL or missing references)
		//IL_009c: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
		NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
		if (networkManager == null || !networkManager.IsListening)
		{
			return;
		}
		if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1)
		{
			RpcAttributeParams val = new RpcAttributeParams
			{
				RequireOwnership = false
			};
			RpcParams val3 = default(RpcParams);
			FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(1779906441u, val3, val, (SendTo)5, (RpcDelivery)0);
			((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref setHandbrake, default(ForPrimitives));
			((NetworkBehaviour)this).__endSendRpc(ref val2, 1779906441u, val3, val, (SendTo)5, (RpcDelivery)0);
		}
		if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1)
		{
			return;
		}
		((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0;
		if (handbrakeEngaged == setHandbrake)
		{
			return;
		}
		timeAtLastHandbrakePull = Time.realtimeSinceStartup;
		handbrakeEngaged = setHandbrake;
		if (base.ignitionStarted)
		{
			if (handbrakeEngaged)
			{
				PlayCombinedOccupantAnimation(base.currentDriver, "U_EngageHandbrake", "L_EngageHandbrake", "R_EngageHandbrake", 0.075f);
			}
			else
			{
				PlayCombinedOccupantAnimation(base.currentDriver, "U_DisengageHandbrake", "L_DisengageHandbrake", "R_DisengageHandbrake", 0.075f);
			}
		}
		if (handbrakeEngaged)
		{
			handbrakeAudio.PlayOneShot(handbrakeOn);
		}
		else
		{
			handbrakeAudio.PlayOneShot(handbrakeOff);
		}
	}

	public void SetWindowInteractTriggers(bool isIgnitionOn)
	{
		driversSideWindow.holdInteraction = !isIgnitionOn;
		passengersSideWindow.holdInteraction = !isIgnitionOn;
		if (!isIgnitionOn)
		{
			driversSideWindow.holdTip = "[ No ignition power ]";
			passengersSideWindow.holdTip = "[ No ignition power ]";
		}
		else
		{
			driversSideWindow.holdTip = null;
			passengersSideWindow.holdTip = null;
		}
	}

	public void TrySetMirrorsFolded(bool setFolded)
	{
		if (!disableElectricMirrors)
		{
			leftDoorAnimator.SetBool("mirrorOpen", setFolded);
			rightDoorAnimator.SetBool("mirrorOpen", setFolded);
		}
	}

	public void SetIgnitionInteractTrigger()
	{
		if (base.localPlayerInControl || !((Object)(object)base.currentDriver != (Object)null))
		{
			if (base.ignitionStarted)
			{
				startIgnitionTrigger.hoverTip = "Untwist key : [LMB]";
				startIgnitionTrigger.holdTip = "[ Untwisting key ]";
				startIgnitionTrigger.timeToHold = 0.5f;
				startIgnitionTrigger.timeToHoldSpeedMultiplier = 1f;
				startIgnitionTrigger.currentCooldownValue = 1f;
			}
			else if (base.keyIsInIgnition)
			{
				bool flag = usingSwitchIgnition || (Object)(object)base.currentDriver == (Object)null;
				startIgnitionTrigger.hoverTip = (flag ? "Remove key : [LMB]" : "Try ignition : [LMB] (Hold)");
				startIgnitionTrigger.holdTip = (flag ? "[ Removing key ]" : "[ Trying ignition ]");
				startIgnitionTrigger.timeToHold = (flag ? 0.5f : 1f);
				startIgnitionTrigger.timeToHoldSpeedMultiplier = (flag ? 1f : 0f);
			}
			else
			{
				startIgnitionTrigger.hoverTip = "Try ignition : [LMB] (Hold)";
				startIgnitionTrigger.holdTip = "[ Trying ignition ]";
				startIgnitionTrigger.timeToHold = 1f;
				startIgnitionTrigger.timeToHoldSpeedMultiplier = 0f;
			}
		}
	}

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

	private IEnumerator TryIgnition(bool isLocalDriver)
	{
		if ((Object)(object)base.currentDriver == (Object)null)
		{
			base.keyIgnitionCoroutine = null;
			yield break;
		}
		if (base.keyIsInIgnition)
		{
			base.currentDriver.playerBodyAnimator.SetInteger("SA_CarAnim", 12);
			int integer = base.currentDriver.playerBodyAnimator.GetInteger("SA_CarAnim");
			ignitionAnimator.SetInteger("SA_IgnitionAnim", integer);
			SetIgnitionInteractTrigger();
			SetIgnitionKeyValues(setKeyInHand: true, setKeyInSlot: true);
			yield return (object)new WaitForSeconds(0.02f);
			carKeySounds.PlayOneShot(base.twistKey);
			SetIgnitionKeyValues(setKeyInHand: true, setKeyInSlot: true);
			yield return (object)new WaitForSeconds(0.1467f);
		}
		else
		{
			base.currentDriver.playerBodyAnimator.SetInteger("SA_CarAnim", 2);
			ignitionAnimator.SetInteger("SA_IgnitionAnim", 2);
			SetIgnitionInteractTrigger();
			SetIgnitionKeyValues(setKeyInHand: true, setKeyInSlot: false);
			yield return (object)new WaitForSeconds(0.6f);
			carKeySounds.PlayOneShot(base.insertKey);
			SetIgnitionKeyValues(setKeyInHand: true, setKeyInSlot: true);
			SetIgnitionInteractTrigger();
			yield return (object)new WaitForSeconds(0.2f);
			carKeySounds.PlayOneShot(base.twistKey);
			SetIgnitionKeyValues(setKeyInHand: true, setKeyInSlot: true);
			yield return (object)new WaitForSeconds(0.185f);
		}
		if (!isLocalDriver)
		{
			yield break;
		}
		bool clutchInterlock = clutchPedalPressed && clutchEngagement <= 0.31f;
		ignitionOn = true;
		SetIgnitionKeyValues(setKeyInHand: true, setKeyInSlot: true);
		SetFrontCabinLightOn(ignitionOn);
		SetIgnitionInteractTrigger();
		SetWindowInteractTriggers(ignitionOn);
		if (dashboardSweepCoroutine == null && !hasSweepedDashboard)
		{
			dashboardSweepCoroutine = ((MonoBehaviour)this).StartCoroutine(DashboardSweepCoroutine());
		}
		TrySetMirrorsFolded(ignitionOn);
		if (hasVehicleDisplay)
		{
			SetSymbolActive(vehicleDisplay, vehicleDisplayLight, active: true);
		}
		TryStartIgnitionRpc(clutchInterlock);
		if (!clutchInterlock)
		{
			yield break;
		}
		PlayIgnitionAudio();
		yield return (object)new WaitForSeconds(Random.Range(0.8f, 2f));
		if ((float)Random.Range(0, 100) < base.chanceToStartIgnition && clutchInterlock)
		{
			CancelIgnitionAnimation(isStarted: true, setIgnitionAnim: true);
			disableAnimations = false;
			inIgnitionAnimation = false;
			ignitionOn = true;
			PlayerControllerB currentDriver = base.currentDriver;
			if (currentDriver != null)
			{
				currentDriver.playerBodyAnimator.SetInteger("SA_CarAnim", 1);
			}
			SetIgnitionKeyValues(setKeyInHand: false, setKeyInSlot: true);
			SetIgnition(setStarted: true, setCabinLight: true);
			SetIgnitionInteractTrigger();
			StartIgnitionRpc(setTriggers: false);
		}
		else
		{
			base.chanceToStartIgnition += 22f;
			base.chanceToStartIgnition = Mathf.Clamp(base.chanceToStartIgnition, 0f, 101f);
		}
	}

	[Rpc(/*Could not decode attribute arguments.*/)]
	public void TryIgnitionRpc(bool setKeyInSlot, bool setCabinLight, bool hasStalled)
	{
		//IL_0024: Unknown result type (might be due to invalid IL or missing references)
		//IL_002e: Invalid comparison between Unknown and I4
		//IL_00eb: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f5: Invalid comparison between Unknown and I4
		//IL_0043: Unknown result type (might be due to invalid IL or missing references)
		//IL_004b: Unknown result type (might be due to invalid IL or missing references)
		//IL_005f: Unknown result type (might be due to invalid IL or missing references)
		//IL_006d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0072: Unknown result type (might be due to invalid IL or missing references)
		//IL_0082: Unknown result type (might be due to invalid IL or missing references)
		//IL_0088: Unknown result type (might be due to invalid IL or missing references)
		//IL_009d: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
		//IL_00be: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d6: Unknown result type (might be due to invalid IL or missing references)
		//IL_0104: Unknown result type (might be due to invalid IL or missing references)
		NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
		if (networkManager == null || !networkManager.IsListening)
		{
			return;
		}
		if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1)
		{
			RpcAttributeParams val = new RpcAttributeParams
			{
				RequireOwnership = false
			};
			RpcParams val3 = default(RpcParams);
			FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(3540053645u, val3, val, (SendTo)5, (RpcDelivery)0);
			((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref setKeyInSlot, default(ForPrimitives));
			((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref setCabinLight, default(ForPrimitives));
			((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref hasStalled, default(ForPrimitives));
			((NetworkBehaviour)this).__endSendRpc(ref val2, 3540053645u, val3, val, (SendTo)5, (RpcDelivery)0);
		}
		if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1)
		{
			((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0;
			CancelIgnitionCoroutine();
			disableAnimations = true;
			inIgnitionAnimation = true;
			SetIgnitionKeyValues(setKeyInHand: false, setKeyInSlot);
			if (isCabinLightOn != setCabinLight)
			{
				SetFrontCabinLightOn(setCabinLight);
			}
			engineStalled = hasStalled;
			base.keyIgnitionCoroutine = ((MonoBehaviour)this).StartCoroutine(TryIgnition(isLocalDriver: false));
		}
	}

	[Rpc(/*Could not decode attribute arguments.*/)]
	public void TryStartIgnitionRpc(bool shiftInterlock)
	{
		//IL_0024: Unknown result type (might be due to invalid IL or missing references)
		//IL_002e: Invalid comparison between Unknown and I4
		//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
		//IL_00bf: Invalid comparison between Unknown and I4
		//IL_0043: Unknown result type (might be due to invalid IL or missing references)
		//IL_004b: Unknown result type (might be due to invalid IL or missing references)
		//IL_005f: Unknown result type (might be due to invalid IL or missing references)
		//IL_006d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0072: Unknown result type (might be due to invalid IL or missing references)
		//IL_0082: Unknown result type (might be due to invalid IL or missing references)
		//IL_0088: Unknown result type (might be due to invalid IL or missing references)
		//IL_009c: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
		NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
		if (networkManager == null || !networkManager.IsListening)
		{
			return;
		}
		if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1)
		{
			RpcAttributeParams val = new RpcAttributeParams
			{
				RequireOwnership = false
			};
			RpcParams val3 = default(RpcParams);
			FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(2290489169u, val3, val, (SendTo)5, (RpcDelivery)0);
			((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref shiftInterlock, default(ForPrimitives));
			((NetworkBehaviour)this).__endSendRpc(ref val2, 2290489169u, val3, val, (SendTo)5, (RpcDelivery)0);
		}
		if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1)
		{
			((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0;
			ignitionOn = true;
			SetIgnitionKeyValues(setKeyInHand: true, setKeyInSlot: true);
			SetFrontCabinLightOn(ignitionOn);
			SetWindowInteractTriggers(ignitionOn);
			if (dashboardSweepCoroutine == null && !hasSweepedDashboard)
			{
				dashboardSweepCoroutine = ((MonoBehaviour)this).StartCoroutine(DashboardSweepCoroutine());
			}
			TrySetMirrorsFolded(ignitionOn);
			if (hasVehicleDisplay)
			{
				SetSymbolActive(vehicleDisplay, vehicleDisplayLight, active: true);
			}
			if (shiftInterlock)
			{
				PlayIgnitionAudio();
			}
		}
	}

	public void PlayIgnitionAudio()
	{
		base.engineAudio1.Stop();
		if (vanVariant == VanVariant.Creasman)
		{
			base.engineAudio1.clip = creasmanRevEngineStart;
			base.engineAudio1.volume = 0.7f;
			base.engineAudio1.PlayOneShot(creasmanEngineRev);
		}
		else
		{
			base.engineAudio1.clip = base.revEngineStart;
			base.engineAudio1.volume = 0.7f;
			base.engineAudio1.PlayOneShot(base.engineRev);
		}
		base.engineAudio1.pitch = 1f;
		base.carEngine1AudioActive = true;
	}

	public void CancelTryCarIgnition()
	{
		if (base.localPlayerInControl && !usingSwitchIgnition && !base.ignitionStarted && inIgnitionAnimation && (inIgnitionAnimation || !startIgnitionTrigger.isBeingHeldByPlayer))
		{
			CancelIgnitionAnimation();
			base.carEngine1AudioActive = false;
			disableAnimations = true;
			inIgnitionAnimation = false;
			SetIgnitionInteractTrigger();
			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");
			int num = integer2;
			if (integer == 13)
			{
				num = 3;
			}
			ignitionAnimator.SetInteger("SA_IgnitionAnim", num);
			CancelTryIgnitionRpc(base.keyIsInIgnition, isCabinLightOn, ignitionOn, integer2, num);
		}
	}

	[Rpc(/*Could not decode attribute arguments.*/)]
	public void CancelTryIgnitionR