Decompiled source of Vandal Electronics Scanvan v1.0.3

BepInEx/plugins/scanvan/RadioBrowser.dll

Decompiled an hour 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.CruiserXL.dll

Decompiled an hour 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.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 CruiserXL;
using CruiserXL.Behaviour;
using CruiserXL.ClipLoading;
using CruiserXL.Compatibility;
using CruiserXL.Managers;
using CruiserXL.Networking;
using CruiserXL.Patches;
using CruiserXL.Utils;
using Cysharp.Threading.Tasks;
using Cysharp.Threading.Tasks.CompilerServices;
using GameNetcodeStuff;
using HarmonyLib;
using LethalCompanyInputUtils.Api;
using Microsoft.CodeAnalysis;
using NAudio.Wave;
using RadioBrowser;
using RadioBrowser.Models;
using Scandal.CruiserXL.NetcodePatcher;
using ScandalsTweaks.Patches;
using ScandalsTweaks.Utils;
using TMPro;
using Unity.Netcode;
using UnityEngine;
using UnityEngine.AI;
using UnityEngine.Audio;
using UnityEngine.Events;
using UnityEngine.InputSystem;
using UnityEngine.Networking;
using UnityEngine.Rendering;
using UnityEngine.Rendering.HighDefinition;
using UnityEngine.UI;
using VoxxWeatherPlugin.Patches;
using VoxxWeatherPlugin.Utils;
using VoxxWeatherPlugin.Weathers;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: IgnoresAccessChecksTo("Assembly-CSharp-firstpass")]
[assembly: IgnoresAccessChecksTo("Assembly-CSharp")]
[assembly: IgnoresAccessChecksTo("ScandalsTweaks")]
[assembly: IgnoresAccessChecksTo("Unity.Netcode.Runtime")]
[assembly: IgnoresAccessChecksTo("voxx.LethalElementsPlugin")]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("Scandal.CruiserXL")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.3.0")]
[assembly: AssemblyInformationalVersion("1.0.3+ba9d93fda983b6425d2d341b5a81344ff795b21b")]
[assembly: AssemblyProduct("CruiserXL")]
[assembly: AssemblyTitle("Scandal.CruiserXL")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.3.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
[module: NetcodePatchedAssembly]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableAttribute : Attribute
	{
		public readonly byte[] NullableFlags;

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

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

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

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

	public BoxCollider insideTruckNavMeshBounds = null;

	public EnemyAI[] enemiesLastHit = null;

	private float timeSinceHittingPlayer;

	private float timeSinceHittingEnemy;

	private int enemyIndex;

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

	public void OnTriggerEnter(Collider other)
	{
		//IL_0447: Unknown result type (might be due to invalid IL or missing references)
		//IL_044d: Invalid comparison between Unknown and I4
		//IL_00d9: 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_00fb: Unknown result type (might be due to invalid IL or missing references)
		//IL_0105: Unknown result type (might be due to invalid IL or missing references)
		//IL_010a: Unknown result type (might be due to invalid IL or missing references)
		//IL_010f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0116: Unknown result type (might be due to invalid IL or missing references)
		//IL_011b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0174: Unknown result type (might be due to invalid IL or missing references)
		//IL_0184: Unknown result type (might be due to invalid IL or missing references)
		//IL_0189: Unknown result type (might be due to invalid IL or missing references)
		//IL_01bb: Unknown result type (might be due to invalid IL or missing references)
		//IL_01c5: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ca: Unknown result type (might be due to invalid IL or missing references)
		//IL_0370: Unknown result type (might be due to invalid IL or missing references)
		//IL_037b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0386: Unknown result type (might be due to invalid IL or missing references)
		//IL_04fa: Unknown result type (might be due to invalid IL or missing references)
		//IL_050b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0516: Unknown result type (might be due to invalid IL or missing references)
		//IL_051b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0258: Unknown result type (might be due to invalid IL or missing references)
		//IL_0260: 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_0563: Unknown result type (might be due to invalid IL or missing references)
		//IL_0568: Unknown result type (might be due to invalid IL or missing references)
		//IL_0579: Unknown result type (might be due to invalid IL or missing references)
		//IL_0597: Unknown result type (might be due to invalid IL or missing references)
		//IL_059c: Unknown result type (might be due to invalid IL or missing references)
		//IL_05ad: Unknown result type (might be due to invalid IL or missing references)
		//IL_02cd: Unknown result type (might be due to invalid IL or missing references)
		//IL_0328: Unknown result type (might be due to invalid IL or missing references)
		//IL_032d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0652: Unknown result type (might be due to invalid IL or missing references)
		//IL_0657: Unknown result type (might be due to invalid IL or missing references)
		//IL_0668: Unknown result type (might be due to invalid IL or missing references)
		//IL_066d: Unknown result type (might be due to invalid IL or missing references)
		//IL_066f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0671: Unknown result type (might be due to invalid IL or missing references)
		//IL_0673: Unknown result type (might be due to invalid IL or missing references)
		//IL_0686: Expected I4, but got Unknown
		//IL_0697: Unknown result type (might be due to invalid IL or missing references)
		//IL_069c: Unknown result type (might be due to invalid IL or missing references)
		//IL_06a4: Unknown result type (might be due to invalid IL or missing references)
		//IL_06cd: Unknown result type (might be due to invalid IL or missing references)
		//IL_06d2: Unknown result type (might be due to invalid IL or missing references)
		//IL_06da: Unknown result type (might be due to invalid IL or missing references)
		//IL_0703: Unknown result type (might be due to invalid IL or missing references)
		//IL_0708: Unknown result type (might be due to invalid IL or missing references)
		//IL_0710: Unknown result type (might be due to invalid IL or missing references)
		if (!((VehicleController)mainScript).hasBeenSpawned || (((VehicleController)mainScript).magnetedToShip && ((VehicleController)mainScript).magnetTime > 0.8f))
		{
			return;
		}
		if (((Component)other).CompareTag("Player"))
		{
			PlayerControllerB val = default(PlayerControllerB);
			((Component)other).TryGetComponent<PlayerControllerB>(ref val);
			if ((Object)(object)val == (Object)null || ((VehicleController)mainScript).localPlayerInPassengerSeat || mainScript.localPlayerInMiddlePassengerSeat || 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 ((Object)(object)((VehicleController)mainScript).physicsRegion.physicsTransform == (Object)(object)GameNetworkManager.Instance.localPlayerController.physicsParent || (Object)(object)GameNetworkManager.Instance.localPlayerController.overridePhysicsParent == (Object)(object)((VehicleController)mainScript).physicsRegion.physicsTransform)
				{
					return;
				}
				if (num > 20f)
				{
					GameNetworkManager.Instance.localPlayerController.KillPlayer(val3, true, (CauseOfDeath)8, 9, default(Vector3), false);
				}
				else
				{
					int num3 = 0;
					if (num > 15f)
					{
						num3 = 80;
					}
					else if (num > 12f)
					{
						num3 = 60;
					}
					else if (num > 8f)
					{
						num3 = 40;
					}
					if (num3 > 0)
					{
						GameNetworkManager.Instance.localPlayerController.DamagePlayer(num3, true, true, (CauseOfDeath)8, 0, false, val3);
					}
				}
				if (!GameNetworkManager.Instance.localPlayerController.isPlayerDead && ((Vector3)(ref GameNetworkManager.Instance.localPlayerController.externalForceAutoFade)).sqrMagnitude < ((Vector3)(ref ((VehicleController)mainScript).averageVelocity)).sqrMagnitude)
				{
					GameNetworkManager.Instance.localPlayerController.externalForceAutoFade = ((VehicleController)mainScript).averageVelocity;
				}
			}
			else if (((NetworkBehaviour)mainScript).IsOwner && ((Vector3)(ref ((VehicleController)mainScript).averageVelocity)).magnitude > 1.8f)
			{
				mainScript.CarReactToObstacle(((VehicleController)mainScript).averageVelocity, ((Component)val).transform.position, ((VehicleController)mainScript).averageVelocity, (CarObstacleType)0);
			}
		}
		else
		{
			if (!((Component)other).gameObject.CompareTag("Enemy") || Time.realtimeSinceStartup - timeSinceHittingEnemy < 0.25f)
			{
				return;
			}
			EnemyAICollisionDetect val4 = default(EnemyAICollisionDetect);
			((Component)other).TryGetComponent<EnemyAICollisionDetect>(ref val4);
			if ((Object)(object)val4 == (Object)null || (Object)(object)val4.mainScript == (Object)null || val4.mainScript.isEnemyDead || (!val4.mainScript.enemyType.canDie && (int)val4.mainScript.enemyType.SizeLimit == 0))
			{
				return;
			}
			EnemyAI obj = val4.mainScript;
			MouthDogAI val5 = (MouthDogAI)(object)((obj is MouthDogAI) ? obj : null);
			if ((!((Object)(object)val5 != (Object)null) || !Object.op_Implicit((Object)(object)val5) || val5.suspicionLevel <= 8) && !((VehicleController)mainScript).ignitionStarted)
			{
				return;
			}
			Object navMeshOwner = val4.mainScript.agent.navMeshOwner;
			Behaviour val6 = (Behaviour)(object)((navMeshOwner is Behaviour) ? navMeshOwner : null);
			if (((Object)(object)val6 != (Object)null && ((Component)val6).transform.IsChildOf(((Component)mainScript).transform)) || Vector3.Angle(((VehicleController)mainScript).averageVelocity, ((Component)val4.mainScript).transform.position - ((Component)this).transform.position) > 130f || ((mainScript.liftGateOpen || mainScript.sideDoorOpen) && (((Collider)insideTruckNavMeshBounds).ClosestPoint(((Component)val4.mainScript).transform.position) == ((Component)val4.mainScript).transform.position || ((Collider)insideTruckNavMeshBounds).ClosestPoint(val4.mainScript.agent.destination) == val4.mainScript.agent.destination)))
			{
				return;
			}
			bool dealDamage = false;
			for (int i = 0; i < enemiesLastHit.Length; i++)
			{
				if ((Object)(object)enemiesLastHit[i] == (Object)(object)val4.mainScript && (Time.realtimeSinceStartup - timeSinceHittingEnemy < 0.6f || ((Vector3)(ref ((VehicleController)mainScript).averageVelocity)).magnitude < 4f))
				{
					dealDamage = true;
				}
			}
			timeSinceHittingEnemy = Time.realtimeSinceStartup;
			Vector3 position = ((Component)val4).transform.position;
			bool flag = false;
			EnemySize enemySize = val4.mainScript.enemyType.EnemySize;
			EnemySize val7 = enemySize;
			switch ((int)val7)
			{
			case 0:
				flag = mainScript.CarReactToObstacle(((VehicleController)mainScript).averageVelocity, position, ((VehicleController)mainScript).averageVelocity, (CarObstacleType)1, 1f, val4.mainScript, dealDamage);
				break;
			case 1:
				flag = mainScript.CarReactToObstacle(((VehicleController)mainScript).averageVelocity, position, ((VehicleController)mainScript).averageVelocity, (CarObstacleType)1, 3f, val4.mainScript, dealDamage);
				break;
			case 2:
				flag = mainScript.CarReactToObstacle(((VehicleController)mainScript).averageVelocity, position, ((VehicleController)mainScript).averageVelocity, (CarObstacleType)1, 2f, val4.mainScript, dealDamage);
				break;
			}
			if (flag)
			{
				enemyIndex = (enemyIndex + 1) % 3;
				enemiesLastHit[enemyIndex] = val4.mainScript;
				return;
			}
			for (int j = 0; j < enemiesLastHit.Length; j++)
			{
				if ((Object)(object)enemiesLastHit[j] == (Object)(object)val4.mainScript)
				{
					enemiesLastHit[j] = null;
				}
			}
		}
	}
}
public class CruiserXLController : VehicleController
{
	[Header("Modules")]
	public EVAModule voiceModule = null;

	[Header("Variation")]
	public Material truckMat = null;

	public Material rareTruckDialsOn = null;

	public Material rareTruckClusterOn = null;

	public Material rareTruckRadioOn = null;

	public Material rareHeaterOn = null;

	public Texture2D defaultTruckTex = null;

	public Texture2D rareTruckTex = null;

	public Light radioLightCol = null;

	public Light heaterLightCol = null;

	public Light clusterLightCol = null;

	public float specialChance;

	public bool isSpecial;

	public GameObject jcJensonSymbolObj = null;

	public SpriteRenderer jcJensonSymbol = null;

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

	public AnimationCurve steeringWheelCurve = null;

	public NavMeshObstacle navObstacle = null;

	public CapsuleCollider cabinPoint = null;

	public CruiserXLCollisionTrigger collisionTrigger = null;

	public Rigidbody playerPhysicsBody = null;

	public AnimationCurve engineCurve = null;

	public AnimationCurve enginePowerCurve = null;

	public Coroutine automaticTransmissionCoroutine = null;

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

	public Vector3 lastVelocity;

	public Vector3 previousVehiclePosition;

	public bool allWheelsAirborne;

	private float timeSinceUntethered;

	public float clutchSpeed;

	public float minClutchReturnSpeed;

	public float clutchReturnSpeed;

	public float stallTimer;

	public bool engineStalled = false;

	public float clutchSlip;

	public float clutchEngagement;

	public bool clutchPedalPressed;

	public float enginePower;

	public float engineReversePower;

	public float throttleReleaseSpeed;

	public float maxThrottleSpeed;

	public float throttleSpeed;

	public float inclineCompensation;

	public float throttleInput;

	public bool handbrakeEngaged;

	public bool inReverse;

	public bool inNeutral;

	public float[] gearRatios = null;

	public float diffRatio;

	public int currentGear;

	public float upShiftThreshold = 2500f;

	public float downShiftThreshold = 1100f;

	public float lastShiftTime = 0f;

	public float shiftCooldown = 0.6f;

	public float shiftTime = 0.15f;

	public float forwardWheelSpeed;

	public float reverseWheelSpeed;

	public float frontWheelRPM;

	public float backWheelRPM;

	public float wheelRPM;

	private float timeSinceLastCollision;

	private float steeringDecay = 1f;

	private float forwardsSlip;

	public float baseForwardStiffness = 1f;

	public float baseSidewaysStiffness = 0.75f;

	public float wheelTorque;

	public float wheelBrakeTorque;

	public bool hasDeliveredVehicle;

	public float maxBrakingPower;

	public float baseSteeringWheelTurnSpeed;

	[Header("Multiplayer")]
	public Collider vehicleBounds = null;

	public Collider storageCompartment = null;

	public PlayerControllerB playerWhoShifted = null;

	public VehiclePlayerSeat frontLeftSeat = null;

	public VehiclePlayerSeat frontMiddleSeat = null;

	public VehiclePlayerSeat frontRightSeat = null;

	public PlayerControllerB currentMiddlePassenger = null;

	public InteractTrigger middlePassengerSeatTrigger = null;

	public InteractTrigger driversSideWindow = null;

	public InteractTrigger passengersSideWindow = null;

	public AnimatedObjectTrigger driversSideWindowTrigger = null;

	public AnimatedObjectTrigger passengersSideWindowTrigger = null;

	public Vector3 playerPositionOffset;

	public Vector3 seatNodePositionOffset;

	public Vector2 syncedMoveInputVector;

	public bool localPlayerInMiddlePassengerSeat;

	public float syncedWheelRotation;

	public float syncedFrontWheelRPM;

	public float syncedBackWheelRPM;

	public float syncedWheelRPM;

	public float syncedEngineRPM;

	public float syncedMotorTorque;

	public float syncedBrakeTorque;

	private int syncedCarHP;

	private bool syncedDrivePedalPressed;

	private bool syncedBrakePedalPressed;

	private bool syncedClutchPedalPressed;

	private float tyreStress;

	private bool wheelSlipping;

	private float syncCarEffectsInterval;

	public float syncWheelTorqueInterval;

	public float syncCarDrivetrainInterval;

	[Header("Effects")]
	public GameObject heaterDirectionLever = null;

	public GameObject heaterTempLever = null;

	public GameObject fanSpeedLever = null;

	public MeshRenderer heaterBaseMesh = null;

	public MeshRenderer windshieldMesh = null;

	public GameObject[] disableOnDestroy = null;

	public GameObject[] enableOnDestroy = null;

	public GameObject windshieldObject = null;

	public InteractTrigger pushTruckTrigger = null;

	public MeshRenderer leftBrakeMesh = null;

	public MeshRenderer rightBrakeMesh = null;

	public MeshRenderer backLeftBrakeMesh = null;

	public MeshRenderer backRightBrakeMesh = null;

	public Collider[] weatherEffectBlockers = null;

	public Animator handbrakeAnimator = null;

	public ScanNodeProperties scanNode = null;

	public GameObject blinkerLightsContainer = null;

	public GameObject sideDoorContainer = null;

	public GameObject leftElectricMirror = null;

	public GameObject rightElectricMirror = null;

	public Coroutine dashboardSymbolPreStartup = null;

	public SpriteRenderer hazardWarningSymbol = null;

	public SpriteRenderer leftSignalSymbol = null;

	public SpriteRenderer rightSignalSymbol = null;

	public SpriteRenderer parkingBrakeSymbol = null;

	public SpriteRenderer checkEngineLightSymbol = null;

	public SpriteRenderer alertLightSymbol = null;

	public SpriteRenderer seatbeltLightSymbol = null;

	public SpriteRenderer oilLevelLightSymbol = null;

	public SpriteRenderer batteryLightSymbol = null;

	public SpriteRenderer coolantLevelLightSymbol = null;

	public SpriteRenderer dippedBeamLightSymbol = null;

	public SpriteRenderer highBeamLightSymbol = null;

	public GameObject carKeyContainer = null;

	public GameObject carKeyInHand = null;

	public GameObject ignitionBarrel = null;

	public Transform ignitionBarrelNotTurnedPosition = null;

	public Transform ignitionBarrelTurnedPosition = null;

	public Transform ignitionBarrelTryingPos = null;

	public Transform ignitionTryingPosition = null;

	public GameObject headlightSwitch = null;

	public MeshRenderer lowBeamMesh = null;

	public MeshRenderer highBeamMesh = null;

	public GameObject highBeamContainer = null;

	public GameObject clusterLightsContainer = null;

	public MeshRenderer radioMesh = null;

	public MeshRenderer radioPowerDial = null;

	public MeshRenderer radioVolumeDial = null;

	public GameObject radioLight = null;

	public GameObject heaterLight = null;

	public TextMeshPro radioTime = null;

	public TextMeshPro radioFrequency = null;

	public GameObject sideLightsContainer = null;

	public MeshRenderer sideTopLightsMesh = null;

	public AnimationCurve oilPressureNeedleCurve = null;

	public AnimationCurve turboPressureNeedleCurve = null;

	public MeshRenderer interiorMesh = null;

	public MeshRenderer speedometerMesh = null;

	public MeshRenderer tachometerMesh = null;

	public MeshRenderer oilPressureMesh = null;

	public MeshRenderer lowBeamMeshLod = null;

	public MeshRenderer highBeamMeshLod = null;

	public MeshRenderer backLightsMeshLod = null;

	public MeshRenderer sideTopLightsMeshLod = null;

	public MeshRenderer leftBlinkerMeshLod = null;

	public MeshRenderer rightBlinkerMeshLod = null;

	public MeshRenderer leftBlinkerMesh = null;

	public MeshRenderer rightBlinkerMesh = null;

	public Transform speedometerTransform = null;

	public Transform tachometerTransform = null;

	public Transform oilPressureTransform = null;

	public GameObject driverCameraNode = null;

	public GameObject passengerCameraNode = null;

	public GameObject driverCameraPositionNode = null;

	public GameObject passengerCameraPositionNode = null;

	private Coroutine blinkersCoroutine = null;

	public InteractTrigger startIgnitionTrigger = null;

	public InteractTrigger stopIgnitionTrigger = null;

	public GameObject reverseLightsContainer = null;

	public MeshRenderer reverseLightsMesh = null;

	public Animator manualShiftAnimator = null;

	public AudioClip[] shiftSounds = null;

	public string[] upShiftString = null;

	public string[] downShiftString = null;

	public float mirrorAngleFloat;

	public float lightSwitchFloat;

	public float heatSpeedFloat;

	public float heatDirectionFloat;

	public float heatPositionFloat;

	public bool heaterOn;

	public float heaterTemp;

	public float heaterSpeed;

	public float steeringWheelAnimValue;

	public float steeringSpeed;

	public bool windshieldShattered;

	private bool inIgnitionAnimation;

	public bool clutchTipSet;

	public bool isHeaterCold;

	public bool isHeaterWarm;

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

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

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

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

	public float ignitionRotSpeed = 45f;

	private int currentSweepStage;

	private bool hasSweepedDashboard;

	public bool hazardsBlinking;

	private bool hazardsOn;

	private bool reverseLightsOn;

	private float speedometerFloat;

	private float tachometerFloat;

	private bool lowBeamsOn;

	private bool highBeamsOn;

	private bool cabinLightSwitchEnabled = true;

	private float oilPressureFloat;

	private float turboPressureFloat;

	private bool overdriveSwitchEnabled;

	public bool correctedPosition;

	public bool twistingKey;

	public bool electricsOn;

	public bool isCabLightOn;

	public bool liftGateOpen;

	public bool sideDoorOpen;

	[Header("Audio")]
	public AudioSource[] allVehicleAudios = null;

	public AudioClip[] streamerRadioClips = null;

	public AudioSource cabinLightSwitchAudio = null;

	public AudioClip cabinLightSwitchToggle = null;

	public AudioSource handbrakeAudio = null;

	public AudioClip handbrakeOn = null;

	public AudioClip handbrakeOff = null;

	public AudioClip blinkOn = null;

	public AudioClip blinkOff = null;

	public AudioSource carKeySounds = null;

	public AudioSource wiperAudio = null;

	private Coroutine truckAlarmCoroutine = null;

	public AudioSource alarmAudio = null;

	public AudioSource heaterAudio = null;

	private float timeSinceTogglingRadio;

	public bool alarmDebounce;

	private float timeAtLastAlarmPing;

	private float timeAtLastEVAPing;

	[Header("Radio")]
	public RadioBehaviour liveRadioController = null;

	private float lastSongTime;

	public float minFrequency = 75.55f;

	public float maxFrequency = 255.5f;

	private bool isFmRadio = false;

	private float timeLastSyncedRadio;

	private float radioPingTimestamp;

	[Header("Materials")]
	public Material blinkerOnMat = null;

	public Material clusterDialsOffMat = null;

	public Material clusterDialsOnMat = null;

	public Material heaterOffMat = null;

	public Material heaterOnMat = null;

	public Material greyLightOffMat = null;

	public Material redLightOffMat = null;

	public Material clusterOffMaterial = null;

	public Material clusterOnMaterial = null;

	public Material radioOffMaterial = null;

	public Material radioOnMaterial = null;

	public Material windshieldMat = null;

	public override void OnNetworkSpawn()
	{
		((NetworkBehaviour)this).OnNetworkSpawn();
		if (!StartOfRound.Instance.inShipPhase && ((NetworkBehaviour)this).IsServer)
		{
			specialChance = 0.09f;
			Random random = new Random(StartOfRound.Instance.randomMapSeed);
			isSpecial = random.NextDouble() < (double)specialChance;
			SetSpecialVariantRpc(isSpecial);
		}
	}

	[Rpc(/*Could not decode attribute arguments.*/)]
	public void SetSpecialVariantRpc(bool special)
	{
		//IL_0024: Unknown result type (might be due to invalid IL or missing references)
		//IL_002e: Invalid comparison between Unknown and I4
		//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b1: Invalid comparison between Unknown and I4
		//IL_0043: Unknown result type (might be due to invalid IL or missing references)
		//IL_004b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0051: Unknown result type (might be due to invalid IL or missing references)
		//IL_005f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0064: Unknown result type (might be due to invalid IL or missing references)
		//IL_0074: Unknown result type (might be due to invalid IL or missing references)
		//IL_007a: Unknown result type (might be due to invalid IL or missing references)
		//IL_008e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0092: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
		NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
		if (networkManager != null && networkManager.IsListening)
		{
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1)
			{
				RpcAttributeParams val = default(RpcAttributeParams);
				RpcParams val2 = default(RpcParams);
				FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(3080744872u, val2, val, (SendTo)6, (RpcDelivery)0);
				((FastBufferWriter)(ref val3)).WriteValueSafe<bool>(ref special, default(ForPrimitives));
				((NetworkBehaviour)this).__endSendRpc(ref val3, 3080744872u, val2, val, (SendTo)6, (RpcDelivery)0);
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1)
			{
				((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0;
				isSpecial = special;
				SetVariant(isSpecial);
			}
		}
	}

	public void SetVariant(bool isJenson)
	{
		//IL_0036: Unknown result type (might be due to invalid IL or missing references)
		//IL_003b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0060: Unknown result type (might be due to invalid IL or missing references)
		//IL_0065: Unknown result type (might be due to invalid IL or missing references)
		//IL_008a: Unknown result type (might be due to invalid IL or missing references)
		//IL_008f: Unknown result type (might be due to invalid IL or missing references)
		//IL_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_0115: Unknown result type (might be due to invalid IL or missing references)
		//IL_011a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0141: Unknown result type (might be due to invalid IL or missing references)
		//IL_0146: Unknown result type (might be due to invalid IL or missing references)
		if (isJenson)
		{
			truckMat.mainTexture = (Texture)(object)rareTruckTex;
			radioLightCol.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));
			clusterDialsOnMat = rareTruckDialsOn;
			clusterOnMaterial = rareTruckClusterOn;
			radioOnMaterial = rareTruckRadioOn;
			heaterOnMat = rareHeaterOn;
			jcJensonSymbolObj.SetActive(true);
			((Graphic)radioTime).color = Color32.op_Implicit(new Color32(byte.MaxValue, (byte)204, (byte)51, byte.MaxValue));
			((Graphic)radioFrequency).color = Color32.op_Implicit(new Color32(byte.MaxValue, (byte)204, (byte)51, byte.MaxValue));
			((Graphic)voiceModule.clusterScreen).color = Color32.op_Implicit(new Color32(byte.MaxValue, (byte)204, (byte)51, byte.MaxValue));
			voiceModule.clusterTexts[0] = "sys status: [ok]";
			voiceModule.clusterTexts[15] = "high temp!";
			voiceModule.clusterTexts[13] = "error: wd606";
		}
		else
		{
			truckMat.mainTexture = (Texture)(object)defaultTruckTex;
		}
	}

	public void Awake()
	{
		//IL_007d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0082: Unknown result type (might be due to invalid IL or missing references)
		//IL_008e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0093: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
		//IL_00af: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
		//IL_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_00f7: Unknown result type (might be due to invalid IL or missing references)
		//IL_00fd: Unknown result type (might be due to invalid IL or missing references)
		//IL_0102: Unknown result type (might be due to invalid IL or missing references)
		References.truckController = this;
		base.ragdollPhysicsBody.interpolation = (RigidbodyInterpolation)1;
		base.windwiperPhysicsBody1.interpolation = (RigidbodyInterpolation)1;
		base.windwiperPhysicsBody2.interpolation = (RigidbodyInterpolation)1;
		playerPhysicsBody.interpolation = (RigidbodyInterpolation)1;
		FixAllAudios(allVehicleAudios);
		((VehicleController)this).Awake();
		((Component)playerPhysicsBody).transform.SetParent(RoundManager.Instance.VehiclesContainer);
		base.physicsRegion.priority = 1;
		base.syncedPosition = ((Component)this).transform.position;
		base.syncedRotation = ((Component)this).transform.rotation;
		Transform transform = ((Component)base.driverSeatTrigger.playerPositionNode).transform;
		transform.localPosition += seatNodePositionOffset;
		Transform transform2 = ((Component)middlePassengerSeatTrigger.playerPositionNode).transform;
		transform2.localPosition += seatNodePositionOffset;
		Transform transform3 = ((Component)base.passengerSeatTrigger.playerPositionNode).transform;
		transform3.localPosition += seatNodePositionOffset;
		startIgnitionTrigger.holdTip = "[ Trying ignition ]";
		startIgnitionTrigger.hoverTip = "Try ignition : [LMB]";
		base.removeKeyIgnitionTrigger.SetActive(false);
		stopIgnitionTrigger.hoverTip = "Remove key : [LMB]";
		stopIgnitionTrigger.holdTip = "[ No key! ]";
		base.backDoorOpen = true;
		SetTruckStats();
	}

	public void FixAllAudios(AudioSource[] audiosArray)
	{
		foreach (AudioSource val in audiosArray)
		{
			val.outputAudioMixerGroup = References.diageticSFXGroup;
		}
	}

	private void SetTruckStats()
	{
		//IL_0213: Unknown result type (might be due to invalid IL or missing references)
		//IL_022d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0257: Unknown result type (might be due to invalid IL or missing references)
		//IL_0258: Unknown result type (might be due to invalid IL or missing references)
		//IL_02e7: Unknown result type (might be due to invalid IL or missing references)
		//IL_02f4: Unknown result type (might be due to invalid IL or missing references)
		//IL_0301: Unknown result type (might be due to invalid IL or missing references)
		//IL_030e: Unknown result type (might be due to invalid IL or missing references)
		base.idleSpeed = 80f;
		base.pushForceMultiplier = 162f;
		base.turboBoostForce = 10000f;
		base.turboBoostUpwardForce = 23000f;
		steeringSpeed = 6f;
		baseSteeringWheelTurnSpeed = 4.2f;
		base.steeringWheelTurnSpeed = baseSteeringWheelTurnSpeed;
		handbrakeEngaged = true;
		inNeutral = true;
		throttleSpeed = 1f;
		maxThrottleSpeed = 2f;
		throttleReleaseSpeed = 3f;
		clutchSpeed = 4f;
		clutchReturnSpeed = 1.5f;
		minClutchReturnSpeed = 0.5f;
		base.jumpForce = 3600f;
		base.brakeSpeed = 10000f;
		maxBrakingPower = 12000f;
		base.speed = 60f;
		base.stability = 0.4f;
		heaterTemp = 1f;
		isHeaterWarm = true;
		base.torqueForce = 1.75f;
		base.carMaxSpeed = 60f;
		base.pushVerticalOffsetAmount = 1.25f;
		base.baseCarHP = 46;
		if (!StartOfRound.Instance.inShipPhase)
		{
			base.carHP = base.baseCarHP;
		}
		base.MinEngineRPM = 800f;
		base.MaxEngineRPM = 5000f;
		base.engineIntensityPercentage = base.MaxEngineRPM;
		base.carAcceleration = 350f;
		base.EngineTorque = 100f;
		engineReversePower = 6100f;
		SetWheelFriction();
		base.mainRigidbody.maxLinearVelocity = base.carMaxSpeed;
		base.mainRigidbody.maxAngularVelocity = 4f;
		base.chanceToStartIgnition = Random.Range(12, 45);
		base.FrontLeftWheel.mass = 150f;
		base.FrontRightWheel.mass = 150f;
		base.BackLeftWheel.mass = 150f;
		base.BackRightWheel.mass = 150f;
		base.mainRigidbody.automaticCenterOfMass = false;
		base.mainRigidbody.centerOfMass = new Vector3(0f, -0.32f, 0.25f);
		base.mainRigidbody.automaticInertiaTensor = false;
		JointSpring val = default(JointSpring);
		val.spring = 18000f;
		val.damper = 3800f;
		val.targetPosition = 0.7f;
		JointSpring suspensionSpring = val;
		base.FrontLeftWheel.sprungMass = 228.2732f;
		base.FrontRightWheel.sprungMass = 228.2732f;
		base.BackLeftWheel.sprungMass = 271.7272f;
		base.BackRightWheel.sprungMass = 271.7272f;
		base.FrontRightWheel.forceAppPointDistance = 0.47f;
		base.FrontLeftWheel.forceAppPointDistance = 0.47f;
		base.BackRightWheel.forceAppPointDistance = 0.4f;
		base.BackLeftWheel.forceAppPointDistance = 0.4f;
		base.FrontRightWheel.suspensionSpring = suspensionSpring;
		base.FrontLeftWheel.suspensionSpring = suspensionSpring;
		base.BackRightWheel.suspensionSpring = suspensionSpring;
		base.BackLeftWheel.suspensionSpring = suspensionSpring;
		base.FrontRightWheel.wheelDampingRate = 3.1f;
		base.FrontLeftWheel.wheelDampingRate = 3.1f;
		base.BackRightWheel.wheelDampingRate = 3.1f;
		base.BackLeftWheel.wheelDampingRate = 3.1f;
		base.FrontRightWheel.suspensionDistance = 0.4f;
		base.FrontLeftWheel.suspensionDistance = 0.4f;
		base.BackRightWheel.suspensionDistance = 0.4f;
		base.BackLeftWheel.suspensionDistance = 0.4f;
	}

	private void SetWheelFriction()
	{
		//IL_0003: Unknown result type (might be due to invalid IL or missing references)
		//IL_004b: Unknown result type (might be due to invalid IL or missing references)
		//IL_004c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0053: Unknown result type (might be due to invalid IL or missing references)
		//IL_0060: Unknown result type (might be due to invalid IL or missing references)
		//IL_006d: Unknown result type (might be due to invalid IL or missing references)
		//IL_007a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0083: Unknown result type (might be due to invalid IL or missing references)
		//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
		//IL_00cc: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d3: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e0: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ed: Unknown result type (might be due to invalid IL or missing references)
		//IL_00fa: Unknown result type (might be due to invalid IL or missing references)
		WheelFrictionCurve val = default(WheelFrictionCurve);
		((WheelFrictionCurve)(ref val)).extremumSlip = 1f;
		((WheelFrictionCurve)(ref val)).extremumValue = 0.6f;
		((WheelFrictionCurve)(ref val)).asymptoteSlip = 0.8f;
		((WheelFrictionCurve)(ref val)).asymptoteValue = 0.5f;
		((WheelFrictionCurve)(ref val)).stiffness = baseForwardStiffness;
		WheelFrictionCurve forwardFriction = val;
		base.FrontRightWheel.forwardFriction = forwardFriction;
		base.FrontLeftWheel.forwardFriction = forwardFriction;
		base.BackRightWheel.forwardFriction = forwardFriction;
		base.BackLeftWheel.forwardFriction = forwardFriction;
		val = default(WheelFrictionCurve);
		((WheelFrictionCurve)(ref val)).extremumSlip = 0.7f;
		((WheelFrictionCurve)(ref val)).extremumValue = 1f;
		((WheelFrictionCurve)(ref val)).asymptoteSlip = 0.8f;
		((WheelFrictionCurve)(ref val)).asymptoteValue = 1f;
		((WheelFrictionCurve)(ref val)).stiffness = baseSidewaysStiffness;
		WheelFrictionCurve sidewaysFriction = val;
		base.FrontRightWheel.sidewaysFriction = sidewaysFriction;
		base.FrontLeftWheel.sidewaysFriction = sidewaysFriction;
		base.BackRightWheel.sidewaysFriction = sidewaysFriction;
		base.BackLeftWheel.sidewaysFriction = sidewaysFriction;
	}

	public void Start()
	{
		SetCarRainCollisions();
		base.FrontLeftWheel.brakeTorque = maxBrakingPower;
		base.FrontRightWheel.brakeTorque = maxBrakingPower;
		base.BackLeftWheel.brakeTorque = maxBrakingPower;
		base.BackRightWheel.brakeTorque = maxBrakingPower;
		base.currentRadioClip = new Random(StartOfRound.Instance.randomMapSeed).Next(0, base.radioClips.Length);
		base.decals = (DecalProjector[])(object)new DecalProjector[24];
		if (StartOfRound.Instance.inShipPhase)
		{
			base.magnetedToShip = true;
			base.loadedVehicleFromSave = true;
			hasDeliveredVehicle = true;
			base.inDropshipAnimation = false;
			base.hasBeenSpawned = true;
			StartMagneting();
		}
	}

	public void SetCarRainCollisions()
	{
		//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_001f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0024: Unknown result type (might be due to invalid IL or missing references)
		//IL_0030: Unknown result type (might be due to invalid IL or missing references)
		//IL_0035: Unknown result type (might be due to invalid IL or missing references)
		//IL_0041: Unknown result type (might be due to invalid IL or missing references)
		//IL_0046: Unknown result type (might be due to invalid IL or missing references)
		TriggerModule[] array = (TriggerModule[])(object)new TriggerModule[4]
		{
			References.rainParticles.trigger,
			References.rainHitParticles.trigger,
			References.stormyRainParticles.trigger,
			References.stormyRainHitParticles.trigger
		};
		if (array == null)
		{
			Plugin.Logger.LogError((object)"rain particles are null! this will cause issues!");
			return;
		}
		for (int i = 0; i < array.Length; i++)
		{
			for (int j = 0; j < weatherEffectBlockers.Length; j++)
			{
				int num = ((TriggerModule)(ref array[i])).colliderCount + j;
				((TriggerModule)(ref array[i])).SetCollider(num, (Component)(object)weatherEffectBlockers[j]);
			}
		}
	}

	public void SendClientSyncData()
	{
		//IL_003d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0042: Unknown result type (might be due to invalid IL or missing references)
		//IL_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_004c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0052: Unknown result type (might be due to invalid IL or missing references)
		//IL_0061: Unknown result type (might be due to invalid IL or missing references)
		//IL_0067: Unknown result type (might be due to invalid IL or missing references)
		if (base.turboBoosts > 0)
		{
			AddTurboBoostRpc(base.turboBoosts);
		}
		if (base.ignitionStarted)
		{
			StartIgnitionRpc();
		}
		if (base.magnetedToShip)
		{
			Vector3 eulerAngles = ((Quaternion)(ref base.magnetTargetRotation)).eulerAngles;
			MagnetCarRpc(base.magnetTargetPosition, eulerAngles, base.magnetStartPosition, base.magnetStartRotation, RoundManager.Instance.tempTransform.eulerAngles, base.averageVelocityAtMagnetStart);
		}
		SyncClientDataRpc(base.carHP, windshieldShattered, base.windshieldBroken, base.steeringWheelAnimFloat, base.ignitionStarted, isSpecial);
	}

	[Rpc(/*Could not decode attribute arguments.*/)]
	public void SyncClientDataRpc(int carHealth, bool windowShattered, bool windowBroken, float wheelRot, bool ignOn, bool isJenson)
	{
		//IL_0024: Unknown result type (might be due to invalid IL or missing references)
		//IL_002e: Invalid comparison between Unknown and I4
		//IL_0120: Unknown result type (might be due to invalid IL or missing references)
		//IL_012a: Invalid comparison between Unknown and I4
		//IL_0043: Unknown result type (might be due to invalid IL or missing references)
		//IL_004b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0051: Unknown result type (might be due to invalid IL or missing references)
		//IL_005f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0064: Unknown result type (might be due to invalid IL or missing references)
		//IL_0068: Unknown result type (might be due to invalid IL or missing references)
		//IL_0081: Unknown result type (might be due to invalid IL or missing references)
		//IL_0087: Unknown result type (might be due to invalid IL or missing references)
		//IL_009c: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a2: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b7: Unknown result type (might be due to invalid IL or missing references)
		//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d8: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ed: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
		//IL_0107: Unknown result type (might be due to invalid IL or missing references)
		//IL_010b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0139: Unknown result type (might be due to invalid IL or missing references)
		NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
		if (networkManager == null || !networkManager.IsListening)
		{
			return;
		}
		if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1)
		{
			RpcAttributeParams val = default(RpcAttributeParams);
			RpcParams val2 = default(RpcParams);
			FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(1093981684u, val2, val, (SendTo)3, (RpcDelivery)0);
			BytePacker.WriteValueBitPacked(val3, carHealth);
			((FastBufferWriter)(ref val3)).WriteValueSafe<bool>(ref windowShattered, default(ForPrimitives));
			((FastBufferWriter)(ref val3)).WriteValueSafe<bool>(ref windowBroken, default(ForPrimitives));
			((FastBufferWriter)(ref val3)).WriteValueSafe<float>(ref wheelRot, default(ForPrimitives));
			((FastBufferWriter)(ref val3)).WriteValueSafe<bool>(ref ignOn, default(ForPrimitives));
			((FastBufferWriter)(ref val3)).WriteValueSafe<bool>(ref isJenson, default(ForPrimitives));
			((NetworkBehaviour)this).__endSendRpc(ref val3, 1093981684u, val2, val, (SendTo)3, (RpcDelivery)0);
		}
		if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1)
		{
			return;
		}
		((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0;
		if (!((NetworkBehaviour)this).IsHost)
		{
			isSpecial = isJenson;
			SetVariant(isSpecial);
			base.carHP = carHealth;
			syncedWheelRotation = wheelRot;
			base.steeringWheelAnimFloat = wheelRot;
			if (ignOn)
			{
				dashboardSymbolPreStartup = ((MonoBehaviour)this).StartCoroutine(PreIgnitionSymbolCheck());
			}
			driversSideWindow.interactable = ignOn;
			if (windowShattered)
			{
				ShatterWindshield();
			}
			if (windowBroken)
			{
				BreakWindshield();
			}
		}
	}

	public void SetBackDoorOpen(bool open)
	{
		//IL_0011: Unknown result type (might be due to invalid IL or missing references)
		RoundManager.Instance.PlayAudibleNoise(base.backDoorContainer.transform.position, 21f, 0.9f, 0, false, 2692);
		liftGateOpen = open;
	}

	public void SetSideDoorOpen(bool open)
	{
		//IL_0011: Unknown result type (might be due to invalid IL or missing references)
		RoundManager.Instance.PlayAudibleNoise(sideDoorContainer.transform.position, 21f, 0.9f, 0, false, 2692);
		sideDoorOpen = open;
	}

	public void SetCabinLightSwitchLocalClient()
	{
		cabinLightSwitchEnabled = !cabinLightSwitchEnabled;
		cabinLightSwitchAudio.PlayOneShot(cabinLightSwitchToggle);
		bool flag = isCabLightOn && base.keyIsInIgnition && cabinLightSwitchEnabled;
		base.frontCabinLightContainer.SetActive(flag);
		((Renderer)base.frontCabinLightMesh).material = (Material)(flag ? ((object)base.headlightsOnMat) : ((object)greyLightOffMat));
		SetCabinLightSwitchRpc(cabinLightSwitchEnabled, flag);
	}

	[Rpc(/*Could not decode attribute arguments.*/)]
	private void SetCabinLightSwitchRpc(bool switchState, bool cabLightOn)
	{
		//IL_0024: Unknown result type (might be due to invalid IL or missing references)
		//IL_002e: Invalid comparison between Unknown and I4
		//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
		//IL_00da: Invalid comparison between Unknown and I4
		//IL_0043: Unknown result type (might be due to invalid IL or missing references)
		//IL_004b: Unknown result type (might be due to invalid IL or missing references)
		//IL_005f: Unknown result type (might be due to invalid IL or missing references)
		//IL_006d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0072: Unknown result type (might be due to invalid IL or missing references)
		//IL_0082: Unknown result type (might be due to invalid IL or missing references)
		//IL_0088: Unknown result type (might be due to invalid IL or missing references)
		//IL_009d: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b7: Unknown result type (might be due to invalid IL or missing references)
		//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e9: Unknown result type (might be due to invalid IL or missing references)
		NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
		if (networkManager != null && networkManager.IsListening)
		{
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1)
			{
				RpcAttributeParams val = new RpcAttributeParams
				{
					RequireOwnership = false
				};
				RpcParams val2 = default(RpcParams);
				FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(1973883828u, val2, val, (SendTo)5, (RpcDelivery)0);
				((FastBufferWriter)(ref val3)).WriteValueSafe<bool>(ref switchState, default(ForPrimitives));
				((FastBufferWriter)(ref val3)).WriteValueSafe<bool>(ref cabLightOn, default(ForPrimitives));
				((NetworkBehaviour)this).__endSendRpc(ref val3, 1973883828u, val2, val, (SendTo)5, (RpcDelivery)0);
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1)
			{
				((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0;
				cabinLightSwitchEnabled = switchState;
				cabinLightSwitchAudio.PlayOneShot(cabinLightSwitchToggle);
				base.frontCabinLightContainer.SetActive(cabLightOn);
				((Renderer)base.frontCabinLightMesh).material = (Material)(cabLightOn ? ((object)base.headlightsOnMat) : ((object)greyLightOffMat));
			}
		}
	}

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

	[Rpc(/*Could not decode attribute arguments.*/)]
	public void SetFrontCabinLightRpc(bool setOn)
	{
		//IL_0024: Unknown result type (might be due to invalid IL or missing references)
		//IL_002e: Invalid comparison between Unknown and I4
		//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
		//IL_00bf: Invalid comparison between Unknown and I4
		//IL_0043: Unknown result type (might be due to invalid IL or missing references)
		//IL_004b: Unknown result type (might be due to invalid IL or missing references)
		//IL_005f: Unknown result type (might be due to invalid IL or missing references)
		//IL_006d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0072: Unknown result type (might be due to invalid IL or missing references)
		//IL_0082: Unknown result type (might be due to invalid IL or missing references)
		//IL_0088: Unknown result type (might be due to invalid IL or missing references)
		//IL_009c: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
		NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
		if (networkManager != null && networkManager.IsListening)
		{
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1)
			{
				RpcAttributeParams val = new RpcAttributeParams
				{
					RequireOwnership = false
				};
				RpcParams val2 = default(RpcParams);
				FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(382947015u, val2, val, (SendTo)5, (RpcDelivery)0);
				((FastBufferWriter)(ref val3)).WriteValueSafe<bool>(ref setOn, default(ForPrimitives));
				((NetworkBehaviour)this).__endSendRpc(ref val3, 382947015u, val2, val, (SendTo)5, (RpcDelivery)0);
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1)
			{
				((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0;
				SetFrontCabinLightOn(setOn);
			}
		}
	}

	public void ToggleHandbrake()
	{
		handbrakeEngaged = !handbrakeEngaged;
		handbrakeAnimator.SetBool("engaged", handbrakeEngaged);
		if (handbrakeEngaged)
		{
			handbrakeAudio.PlayOneShot(handbrakeOn);
		}
		else
		{
			handbrakeAudio.PlayOneShot(handbrakeOff);
		}
		SetHandbrakeRpc(handbrakeEngaged);
	}

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

	public void StartTryCarIgnition()
	{
		if (base.localPlayerInControl && !base.ignitionStarted)
		{
			if (base.keyIgnitionCoroutine != null)
			{
				((MonoBehaviour)this).StopCoroutine(base.keyIgnitionCoroutine);
			}
			inIgnitionAnimation = true;
			TryIgnitionRpc(base.keyIsInIgnition, isCabLightOn, engineStalled);
			base.keyIgnitionCoroutine = ((MonoBehaviour)this).StartCoroutine(TryIgnition(isLocalDriver: true));
		}
	}

	private IEnumerator TryIgnition(bool isLocalDriver)
	{
		if (base.keyIsInIgnition)
		{
			if (engineStalled)
			{
				PlayerControllerB currentDriver = base.currentDriver;
				if (currentDriver != null)
				{
					currentDriver.playerBodyAnimator.SetInteger("SA_CarAnim", 9);
				}
			}
			else
			{
				PlayerControllerB currentDriver2 = base.currentDriver;
				if (currentDriver2 != null && currentDriver2.playerBodyAnimator.GetInteger("SA_CarAnim") == 3)
				{
					PlayerControllerB currentDriver3 = base.currentDriver;
					if (currentDriver3 != null)
					{
						currentDriver3.playerBodyAnimator.SetInteger("SA_CarAnim", 2);
					}
				}
				else
				{
					PlayerControllerB currentDriver4 = base.currentDriver;
					if (currentDriver4 != null)
					{
						currentDriver4.playerBodyAnimator.SetInteger("SA_CarAnim", 12);
					}
				}
			}
			base.removeKeyIgnitionTrigger.SetActive(true);
			engineStalled = false;
			SetKeyIgnitionValues(trying: true, keyInHand: true, keyInSlot: true);
			yield return (object)new WaitForSeconds(0.02f);
			carKeySounds.PlayOneShot(base.twistKey);
			SetKeyIgnitionValues(trying: true, keyInHand: true, keyInSlot: true);
			yield return (object)new WaitForSeconds(0.1467f);
		}
		else
		{
			PlayerControllerB currentDriver5 = base.currentDriver;
			if (currentDriver5 != null)
			{
				currentDriver5.playerBodyAnimator.SetInteger("SA_CarAnim", 2);
			}
			stopIgnitionTrigger.holdTip = "[ Can't remove yet! ]";
			SetKeyIgnitionValues(trying: false, keyInHand: true, keyInSlot: false);
			yield return (object)new WaitForSeconds(0.6f);
			carKeySounds.PlayOneShot(base.insertKey);
			SetKeyIgnitionValues(trying: false, keyInHand: true, keyInSlot: true);
			base.removeKeyIgnitionTrigger.SetActive(base.keyIsInIgnition);
			yield return (object)new WaitForSeconds(0.2f);
			carKeySounds.PlayOneShot(base.twistKey);
			SetKeyIgnitionValues(trying: true, keyInHand: true, keyInSlot: true);
			yield return (object)new WaitForSeconds(0.185f);
		}
		if (!isLocalDriver)
		{
			yield break;
		}
		bool clutchInterlock = clutchPedalPressed && clutchEngagement <= 0.31f;
		TryStartIgnitionRpc(clutchInterlock);
		SetKeyIgnitionValues(trying: true, keyInHand: true, keyInSlot: true);
		electricsOn = true;
		SetFrontCabinLightOn(electricsOn);
		driversSideWindow.interactable = electricsOn;
		passengersSideWindow.interactable = electricsOn;
		if (dashboardSymbolPreStartup == null && !hasSweepedDashboard)
		{
			dashboardSymbolPreStartup = ((MonoBehaviour)this).StartCoroutine(PreIgnitionSymbolCheck());
		}
		if (clutchInterlock)
		{
			base.engineAudio1.Stop();
			base.engineAudio1.clip = base.revEngineStart;
			base.engineAudio1.volume = 0.7f;
			base.engineAudio1.PlayOneShot(base.engineRev);
			base.engineAudio1.pitch = 1f;
			base.carEngine1AudioActive = true;
			yield return (object)new WaitForSeconds(Random.Range(0.8f, 2f));
			if ((float)Random.Range(0, 100) < base.chanceToStartIgnition && clutchInterlock)
			{
				inIgnitionAnimation = false;
				electricsOn = true;
				PlayerControllerB currentDriver6 = base.currentDriver;
				if (currentDriver6 != null)
				{
					currentDriver6.playerBodyAnimator.SetInteger("SA_CarAnim", 1);
				}
				SetKeyIgnitionValues(trying: false, keyInHand: false, keyInSlot: true);
				SetIgnition(started: true, cabLightOn: true);
				SetFrontCabinLightOn(base.keyIsInIgnition);
				CancelIgnitionAnimation(ignitionOn: true);
				StartIgnitionRpc();
			}
			else
			{
				base.chanceToStartIgnition += 20f;
				base.chanceToStartIgnition = Mathf.Clamp(base.chanceToStartIgnition, 0f, 99f);
			}
		}
		else if (!clutchTipSet)
		{
			clutchTipSet = true;
			HUDManager.Instance.DisplayTip("Tip!", "Try depressing the clutch pedal", false, false, "LC_Tip1");
		}
	}

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

	[Rpc(/*Could not decode attribute arguments.*/)]
	public void TryStartIgnitionRpc(bool shiftInterlock)
	{
		//IL_0024: Unknown result type (might be due to invalid IL or missing references)
		//IL_002e: Invalid comparison between Unknown and I4
		//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
		//IL_00bf: Invalid comparison between Unknown and I4
		//IL_0043: Unknown result type (might be due to invalid IL or missing references)
		//IL_004b: Unknown result type (might be due to invalid IL or missing references)
		//IL_005f: Unknown result type (might be due to invalid IL or missing references)
		//IL_006d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0072: Unknown result type (might be due to invalid IL or missing references)
		//IL_0082: Unknown result type (might be due to invalid IL or missing references)
		//IL_0088: Unknown result type (might be due to invalid IL or missing references)
		//IL_009c: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
		NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
		if (networkManager == null || !networkManager.IsListening)
		{
			return;
		}
		if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1)
		{
			RpcAttributeParams val = new RpcAttributeParams
			{
				RequireOwnership = false
			};
			RpcParams val2 = default(RpcParams);
			FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(1568881639u, val2, val, (SendTo)5, (RpcDelivery)0);
			((FastBufferWriter)(ref val3)).WriteValueSafe<bool>(ref shiftInterlock, default(ForPrimitives));
			((NetworkBehaviour)this).__endSendRpc(ref val3, 1568881639u, val2, val, (SendTo)5, (RpcDelivery)0);
		}
		if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1)
		{
			((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0;
			SetKeyIgnitionValues(trying: true, keyInHand: true, keyInSlot: true);
			electricsOn = true;
			SetFrontCabinLightOn(electricsOn);
			driversSideWindow.interactable = electricsOn;
			passengersSideWindow.interactable = electricsOn;
			if (dashboardSymbolPreStartup == null && !hasSweepedDashboard)
			{
				dashboardSymbolPreStartup = ((MonoBehaviour)this).StartCoroutine(PreIgnitionSymbolCheck());
			}
			if (shiftInterlock)
			{
				base.engineAudio1.Stop();
				base.engineAudio1.clip = base.revEngineStart;
				base.engineAudio1.volume = 0.7f;
				base.engineAudio1.PlayOneShot(base.engineRev);
				base.engineAudio1.pitch = 1f;
				base.carEngine1AudioActive = true;
			}
		}
	}

	public void CancelTryCarIgnition()
	{
		if (base.localPlayerInControl && !base.ignitionStarted)
		{
			CancelIgnitionAnimation(ignitionOn: false);
			inIgnitionAnimation = false;
			stopIgnitionTrigger.holdTip = "[ Removing key ]";
			if (GameNetworkManager.Instance.localPlayerController.playerBodyAnimator.GetInteger("SA_CarAnim") == 2 && base.keyIsInIgnition)
			{
				GameNetworkManager.Instance.localPlayerController.playerBodyAnimator.SetInteger("SA_CarAnim", 3);
			}
			else if (GameNetworkManager.Instance.localPlayerController.playerBodyAnimator.GetInteger("SA_CarAnim") == 12 || GameNetworkManager.Instance.localPlayerController.playerBodyAnimator.GetInteger("SA_CarAnim") == 9)
			{
				GameNetworkManager.Instance.localPlayerController.playerBodyAnimator.SetInteger("SA_CarAnim", 3);
			}
			else
			{
				GameNetworkManager.Instance.localPlayerController.playerBodyAnimator.SetInteger("SA_CarAnim", 0);
			}
			CancelTryIgnitionRpc(base.keyIsInIgnition, isCabLightOn, electricsOn);
		}
	}

	[Rpc(/*Could not decode attribute arguments.*/)]
	public void CancelTryIgnitionRpc(bool setKeyInSlot, bool cabinLightOn, bool preIgnition)
	{
		//IL_0024: Unknown result type (might be due to invalid IL or missing references)
		//IL_002e: Invalid comparison between Unknown and I4
		//IL_00eb: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f5: Invalid comparison between Unknown and I4
		//IL_0043: Unknown result type (might be due to invalid IL or missing references)
		//IL_004b: Unknown result type (might be due to invalid IL or missing references)
		//IL_005f: Unknown result type (might be due to invalid IL or missing references)
		//IL_006d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0072: Unknown result type (might be due to invalid IL or missing references)
		//IL_0082: Unknown result type (might be due to invalid IL or missing references)
		//IL_0088: Unknown result type (might be due to invalid IL or missing references)
		//IL_009d: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
		//IL_00be: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d6: Unknown result type (might be due to invalid IL or missing references)
		//IL_0104: Unknown result type (might be due to invalid IL or missing references)
		NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
		if (networkManager == null || !networkManager.IsListening)
		{
			return;
		}
		if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1)
		{
			RpcAttributeParams val = new RpcAttributeParams
			{
				RequireOwnership = false
			};
			RpcParams val2 = default(RpcParams);
			FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(2529428815u, val2, val, (SendTo)5, (RpcDelivery)0);
			((FastBufferWriter)(ref val3)).WriteValueSafe<bool>(ref setKeyInSlot, default(ForPrimitives));
			((FastBufferWriter)(ref val3)).WriteValueSafe<bool>(ref cabinLightOn, default(ForPrimitives));
			((FastBufferWriter)(ref val3)).WriteValueSafe<bool>(ref preIgnition, default(ForPrimitives));
			((NetworkBehaviour)this).__endSendRpc(ref val3, 2529428815u, val2, val, (SendTo)5, (RpcDelivery)0);
		}
		if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1)
		{
			return;
		}
		((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0;
		CancelIgnitionAnimation(ignitionOn: false);
		inIgnitionAnimation = false;
		stopIgnitionTrigger.holdTip = "[ Removing key ]";
		PlayerControllerB currentDriver = base.currentDriver;
		if (currentDriver != null && currentDriver.playerBodyAnimator.GetInteger("SA_CarAnim") == 2 && setKeyInSlot)
		{
			PlayerControllerB currentDriver2 = base.currentDriver;
			if (currentDriver2 != null)
			{
				currentDriver2.playerBodyAnimator.SetInteger("SA_CarAnim", 3);
			}
		}
		else
		{
			PlayerControllerB currentDriver3 = base.currentDriver;
			if (currentDriver3 == null || currentDriver3.playerBodyAnimator.GetInteger("SA_CarAnim") != 12)
			{
				PlayerControllerB currentDriver4 = base.currentDriver;
				if (currentDriver4 == null || currentDriver4.playerBodyAnimator.GetInteger("SA_CarAnim") != 9)
				{
					PlayerControllerB currentDriver5 = base.currentDriver;
					if (currentDriver5 != null)
					{
						currentDriver5.playerBodyAnimator.SetInteger("SA_CarAnim", 0);
					}
					goto IL_01f5;
				}
			}
			PlayerControllerB currentDriver6 = base.currentDriver;
			if (currentDriver6 != null)
			{
				currentDriver6.playerBodyAnimator.SetInteger("SA_CarAnim", 3);
			}
		}
		goto IL_01f5;
		IL_01f5:
		if (setKeyInSlot && !base.keyIsInIgnition)
		{
			carKeySounds.PlayOneShot(base.insertKey);
		}
		SetKeyIgnitionValues(trying: false, keyInHand: false, setKeyInSlot);
		base.removeKeyIgnitionTrigger.SetActive(base.keyIsInIgnition);
		if (!base.keyIsInIgnition)
		{
			return;
		}
		if (cabinLightOn && !isCabLightOn)
		{
			SetFrontCabinLightOn(cabinLightOn);
		}
		if (preIgnition && !electricsOn)
		{
			electricsOn = true;
			driversSideWindow.interactable = electricsOn;
			passengersSideWindow.interactable = electricsOn;
			if (dashboardSymbolPreStartup == null && !hasSweepedDashboard)
			{
				dashboardSymbolPreStartup = ((MonoBehaviour)this).StartCoroutine(PreIgnitionSymbolCheck());
			}
		}
	}

	[Rpc(/*Could not decode attribute arguments.*/)]
	public void StartIgnitionRpc()
	{
		//IL_0024: Unknown result type (might be due to invalid IL or missing references)
		//IL_002e: Invalid comparison between Unknown and I4
		//IL_009a: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a4: Invalid comparison between Unknown and I4
		//IL_0043: Unknown result type (might be due to invalid IL or missing references)
		//IL_004b: Unknown result type (might be due to invalid IL or missing references)
		//IL_005f: Unknown result type (might be due to invalid IL or missing references)
		//IL_006d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0072: Unknown result type (might be due to invalid IL or missing references)
		//IL_0081: Unknown result type (might be due to invalid IL or missing references)
		//IL_0085: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
		NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
		if (networkManager == null || !networkManager.IsListening)
		{
			return;
		}
		if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1)
		{
			RpcAttributeParams val = new RpcAttributeParams
			{
				RequireOwnership = false
			};
			RpcParams val2 = default(RpcParams);
			FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(4204919238u, val2, val, (SendTo)5, (RpcDelivery)0);
			((NetworkBehaviour)this).__endSendRpc(ref val3, 4204919238u, val2, val, (SendTo)5, (RpcDelivery)0);
		}
		if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1)
		{
			((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0;
			inIgnitionAnimation = false;
			electricsOn = true;
			PlayerControllerB currentDriver = base.currentDriver;
			if (currentDriver != null)
			{
				currentDriver.playerBodyAnimator.SetInteger("SA_CarAnim", 1);
			}
			SetKeyIgnitionValues(trying: false, keyInHand: false, keyInSlot: true);
			SetIgnition(started: true, cabLightOn: true);
			SetFrontCabinLightOn(base.keyIsInIgnition);
			CancelIgnitionAnimation(ignitionOn: true);
		}
	}

	public void SetIgnition(bool started, bool cabLightOn)
	{
		SetFrontCabinLightOn(cabLightOn);
		base.carEngine1AudioActive = started;
		if (started)
		{
			inIgnitionAnimation = false;
			electricsOn = true;
			startIgnitionTrigger.holdTip = "[ Already started! ]";
			stopIgnitionTrigger.hoverTip = "Untwist key : [LMB]";
			stopIgnitionTrigger.holdTip = "[ Untwisting key ]";
			if (started != base.ignitionStarted)
			{
				base.ignitionStarted = true;
				base.carExhaustParticle.Play();
				base.engineAudio1.Stop();
				base.engineAudio1.PlayOneShot(base.engineStartSuccessful);
				base.engineAudio1.clip = base.engineRun;
			}
		}
		else
		{
			startIgnitionTrigger.holdTip = "[ Trying ignition ]";
			stopIgnitionTrigger.hoverTip = "Remove key : [LMB]";
			stopIgnitionTrigger.holdTip = (base.keyIsInIgnition ? "[ Removing key ]" : "[ No key! ]");
			base.ignitionStarted = false;
			base.carExhaustParticle.Stop(true, (ParticleSystemStopBehavior)1);
		}
	}

	public void UntwistKeyInIgnition()
	{
		if ((!((Object)(object)base.currentDriver != (Object)null) || base.localPlayerInControl) && base.ignitionStarted)
		{
			if (base.keyIgnitionCoroutine != null)
			{
				((MonoBehaviour)this).StopCoroutine(base.keyIgnitionCoroutine);
			}
			base.keyIgnitionCoroutine = ((MonoBehaviour)this).StartCoroutine(UntwistKey());
			UntwistKeyInIgnitionRpc();
		}
	}

	private IEnumerator UntwistKey()
	{
		PlayerControllerB currentDriver = base.currentDriver;
		if (currentDriver != null)
		{
			currentDriver.playerBodyAnimator.SetInteger("SA_CarAnim", 7);
		}
		yield return (object)new WaitForSeconds(0.08f);
		if (dashboardSymbolPreStartup != null)
		{
			((MonoBehaviour)this).StopCoroutine(dashboardSymbolPreStartup);
			dashboardSymbolPreStartup = null;
			StopPreIgnitionChecks();
		}
		carKeySounds.PlayOneShot(base.twistKey);
		SetKeyIgnitionValues(trying: false, keyInHand: false, keyInSlot: true);
		SetIgnition(started: false, cabLightOn: true);
		yield return (object)new WaitForSeconds(0.08f);
		base.keyIgnitionCoroutine = null;
	}

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

	public void RemoveKeyFromIgnition()
	{
		if (((Object)(object)base.currentDriver != (Object)null && !base.localPlayerInControl) || base.ignitionStarted || !base.keyIsInIgnition)
		{
			return;
		}
		if (base.keyIgnitionCoroutine != null)
		{
			if (inIgnitionAnimation)
			{
				return;
			}
			((MonoBehaviour)this).StopCoroutine(base.keyIgnitionCoroutine);
		}
		base.keyIgnitionCoroutine = ((MonoBehaviour)this).StartCoroutine(RemoveKey());
		base.chanceToStartIgnition = 20f;
		RemoveKeyFromIgnitionRpc();
	}

	private IEnumerator RemoveKey()
	{
		PlayerControllerB currentDriver = base.currentDriver;
		if (currentDriver != null && currentDriver.playerBodyAnimator.GetInteger("SA_CarAnim") == 0)
		{
			PlayerControllerB currentDriver2 = base.currentDriver;
			if (currentDriver2 != null)
			{
				currentDriver2.playerBodyAnimator.SetTrigger("SA_RemoveInIgnition");
			}
		}
		else
		{
			PlayerControllerB currentDriver3 = base.currentDriver;
			if (currentDriver3 != null)
			{
				currentDriver3.playerBodyAnimator.SetInteger("SA_CarAnim", 8);
			}
		}
		engineStalled = false;
		yield return (object)new WaitForSeconds(base.ignitionStarted ? 0.18f : 0.26f);
		if (dashboardSymbolPreStartup != null)
		{
			((MonoBehaviour)this).StopCoroutine(dashboardSymbolPreStartup);
			dashboardSymbolPreStartup = null;
			StopPreIgnitionChecks();
		}
		base.removeKeyIgnitionTrigger.SetActive(false);
		carKeySounds.PlayOneShot(base.removeKey);
		SetKeyIgnitionValues(trying: false, keyInHand: true, keyInSlot: false);
		SetIgnition(started: false, cabLightOn: false);
		electricsOn = false;
		driversSideWindow.interactable = false;
		passengersSideWindow.interactable = false;
		yield return (object)new WaitForSeconds(0.73f);
		SetKeyIgnitionValues(trying: false, keyInHand: false, keyInSlot: false);
		base.keyIgnitionCoroutine = null;
	}

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

	public IEnumerator PreIgnitionSymbolCheck()
	{
		if (jcJensonSymbolObj.activeSelf)
		{
			((Renderer)jcJensonSymbol).enabled = true;
		}
		((Renderer)parkingBrakeSymbol).enabled = true;
		((Renderer)checkEngineLightSymbol).enabled = true;
		((Renderer)alertLightSymbol).enabled = true;
		((Renderer)seatbeltLightSymbol).enabled = true;
		((Renderer)dippedBeamLightSymbol).enabled = true;
		((Renderer)highBeamLightSymbol).enabled = true;
		((Renderer)oilLevelLightSymbol).enabled = true;
		((Renderer)batteryLightSymbol).enabled = true;
		((Renderer)coolantLevelLightSymbol).enabled = true;
		currentSweepStage = 1;
		yield return (object)new WaitForSeconds(1f);
		((Renderer)dippedBeamLightSymbol).enabled = lowBeamsOn;
		((Renderer)highBeamLightSymbol).enabled = highBeamsOn;
		currentSweepStage = 2;
		yield return (object)new WaitForSeconds(1f);
		((Renderer)seatbeltLightSymbol).enabled = false;
		((Renderer)parkingBrakeSymbol).enabled = handbrakeEngaged;
		currentSweepStage = 3;
		yield return (object)new WaitForSeconds(1f);
		((Renderer)oilLevelLightSymbol).enabled = base.carHP <= 15;
		((Renderer)batteryLightSymbol).enabled = !base.ignitionStarted;
		((Renderer)coolantLevelLightSymbol).enabled = base.carHP <= 19;
		((Renderer)alertLightSymbol).enabled = base.carHP <= 12;
		((Renderer)checkEngineLightSymbol).enabled = base.carHP <= 21;
		currentSweepStage = 4;
		hasSweepedDashboard = true;
	}

	private void StopPreIgnitionChecks()
	{
		hasSweepedDashboard = false;
		currentSweepStage = 0;
		if (jcJensonSymbolObj.activeSelf)
		{
			((Renderer)jcJensonSymbol).enabled = false;
		}
		((Renderer)parkingBrakeSymbol).enabled = false;
		((Renderer)checkEngineLightSymbol).enabled = false;
		((Renderer)alertLightSymbol).enabled = false;
		((Renderer)seatbeltLightSymbol).enabled = false;
		((Renderer)dippedBeamLightSymbol).enabled = false;
		((Renderer)highBeamLightSymbol).enabled = false;
		((Renderer)oilLevelLightSymbol).enabled = false;
		((Renderer)batteryLightSymbol).enabled = false;
		((Renderer)coolantLevelLightSymbol).enabled = false;
	}

	public void CancelIgnitionAnimation(bool ignitionOn)
	{
		if (base.keyIgnitionCoroutine != null)
		{
			((MonoBehaviour)this).StopCoroutine(base.keyIgnitionCoroutine);
			base.keyIgnitionCoroutine = null;
		}
		base.keyIsInDriverHand = false;
		twistingKey = false;
		base.carEngine1AudioActive = ignitionOn;
	}

	public void SetKeyIgnitionValues(bool trying, bool keyInHand, bool keyInSlot)
	{
		twistingKey = trying;
		base.keyIsInDriverHand = keyInHand;
		base.keyIsInIgnition = keyInSlot;
	}

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

	public void SetDriverInCar()
	{
		if (base.hasBeenSpawned && !base.carDestroyed && !Object.op_Implicit((Object)(object)GameNetworkManager.Instance.localPlayerController.inAnimationWithEnemy) && !GameNetworkManager.Instance.localPlayerController.inVehicleAnimation)
		{
			if ((Object)(object)base.currentDriver != (Object)null)
			{
				GameNetworkManager.Instance.localPlayerController.CancelSpecialTriggerAnimations();
				HUDManager.Instance.DisplayTip("Seat occupied", "You cannot enter an occupied seat! aborting!", false, false, "LC_Tip1");
			}
			else
			{
				SetDriverInCarServerRpc((int)GameNetworkManager.Instance.localPlayerController.playerClientId);
			}
		}
	}

	[Rpc(/*Could not decode attribute arguments.*/)]
	public void SetDriverInCarServerRpc(int playerId)
	{
		//IL_0024: Unknown result type (might be due to invalid IL or missing references)
		//IL_002e: Invalid comparison between Unknown and I4
		//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b1: Invalid comparison between Unknown and I4
		//IL_0043: Unknown result type (might be due to invalid IL or missing references)
		//IL_004b: Unknown result type (might be due to invalid IL or missing references)
		//IL_005f: Unknown result type (might be due to invalid IL or missing references)
		//IL_006d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0072: Unknown result type (might be due to invalid IL or missing references)
		//IL_0076: Unknown result type (might be due to invalid IL or missing references)
		//IL_008e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0092: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
		NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
		if (networkManager == null || !networkManager.IsListening)
		{
			return;
		}
		if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1)
		{
			RpcAttributeParams val = new RpcAttributeParams
			{
				RequireOwnership = false
			};
			RpcParams val2 = default(RpcParams);
			FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(1853574879u, val2, val, (SendTo)2, (RpcDelivery)0);
			BytePacker.WriteValueBitPacked(val3, playerId);
			((NetworkBehaviour)this).__endSendRpc(ref val3, 1853574879u, val2, val, (SendTo)2, (RpcDelivery)0);
		}
		if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1)
		{
			((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0;
			PlayerControllerB val4 = StartOfRound.Instance.allPlayerScripts[playerId];
			if ((Object)(object)val4 == (Object)null || val4.isPlayerDead || !val4.isPlayerControlled || (Object)(object)base.currentDriver != (Object)null || ((Object)(object)base.currentDriver != (Object)null && (Object)(object)base.currentDriver != (Object)(object)val4))
			{
				CancelSetPlayerInVehicleClientRpc(playerId);
				return;
			}
			base.currentDriver = StartOfRound.Instance.allPlayerScripts[playerId];
			((NetworkBehaviour)this).NetworkObject.ChangeOwnership(StartOfRound.Instance.allPlayerScripts[playerId].actualClientId);
			SetDriverInCarOwnerRpc();
			SetDriverInCarClientsRpc(playerId);
		}
	}

	[Rpc(/*Could not decode attribute arguments.*/)]
	public void SetDriverInCarOwnerRpc()
	{
		//IL_0024: Unknown result type (might be due to invalid IL or missing references)
		//IL_002e: Invalid comparison between Unknown and I4
		//IL_009a: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a4: Invalid comparison between Unknown and I4
		//IL_0043: Unknown result type (might be due to invalid IL or missing references)
		//IL_004b: Unknown result type (might be due to invalid IL or missing references)
		//IL_005f: Unknown result type (might be due to invalid IL or missing references)
		//IL_006d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0072: Unknown result type (might be due to invalid IL or missing references)
		//IL_0081: Unknown result type (might be due to invalid IL or missing references)
		//IL_0085: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
		NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
		if (networkManager == null || !networkManager.IsListening)
		{
			return;
		}
		if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1)
		{
			RpcAttributeParams val = new RpcAttributeParams
			{
				RequireOwnership = false
			};
			RpcParams val2 = default(RpcParams);
			FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(3910689u, val2, val, (SendTo)0, (RpcDelivery)0);
			((NetworkBehaviour)this).__endSendRpc(ref val3, 3910689u, val2, val, (SendTo)0, (RpcDelivery)0);
		}
		if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1)
		{
			((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0;
			PlayerUtils.disableAnimationSync = true;
			SetVehicleCollisionForPlayer(setEnabled: false, GameNetworkManager.Instance.localPlayerController);
			InteractTriggerPatches.specialInteractCoroutine = ((MonoBehaviour)this).StartCoroutine(InteractTriggerPatches.SpecialTruckInteractAnimation(base.driverSeatTrigger, GameNetworkManager.Instance.localPlayerController, this, frontLeftSeat));
			ActivateControl();
			SetTriggerHoverTip(base.driverSideDoorTrigger, "Exit : [LMB]");
			startIgnitionTrigger.isBeingHeldByPlayer = false;
			stopIgnitionTrigger.isBeingHeldByPlayer = false;
			engineStalled = false;
			GameNetworkManager.Instance.localPlayerController.playerBodyAnimator.SetFloat("animationSpeed", 0.5f);
			if (base.keyIsInIgnition)
			{
				GameNetworkManager.Instance.localPlayerController.playerBodyAnimator.SetInteger("SA_CarAnim", 0);
			}
			if (base.ignitionStarted)
			{
				GameNetworkManager.Instance.localPlayerController.playerBodyAnimator.SetInteger("SA_CarAnim", 1);
			}
			if (base.driverSideDoor.boolValue)
			{
				base.driverSideDoor.TriggerAnimation(GameNetworkManager.Instance.localPlayerController);
			}
		}
	}

	[Rpc(/*Could not decode attribute arguments.*/)]
	public void SetDriverInCarClientsRpc(int playerId)
	{
		//IL_0024: Unknown result type (might be due to invalid IL or missing references)
		//IL_002e: Invalid comparison between Unknown and I4
		//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b1: Invalid comparison between Unknown and I4
		//IL_0043: Unknown result type (might be due to invalid IL or missing references)
		//IL_004b: Unknown result type (might be due to invalid IL or missing references)
		//IL_005f: Unknown result type (might be due to invalid IL or missing references)
		//IL_006d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0072: Unknown result type (might be due to invalid IL or missing references)
		//IL_0076: Unknown result type (might be due to invalid IL or missing references)
		//IL_008e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0092: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
		NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
		if (networkManager == null || !networkManager.IsListening)
		{
			return;
		}
		if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1)
		{
			RpcAttributeParams val = new RpcAttributeParams
			{
				RequireOwnership = false
			};
			RpcParams val2 = default(RpcParams);
			FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(186550849u, val2, val, (SendTo)1, (RpcDelivery)0);
			BytePacker.WriteValueBitPacked(val3, playerId);
			((NetworkBehaviour)this).__endSendRpc(ref val3, 186550849u, val2, val, (SendTo)1, (RpcDelivery)0);
		}
		if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1)
		{
			((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0;
			base.currentDriver = StartOfRound.Instance.allPlayerScripts[playerId];
			SetVehicleCollisionForPlayer(setEnabled: false, base.currentDriver);
			startIgnitionTrigger.isBeingHeldByPlayer = false;
			stopIgnitionTrigger.isBeingHeldByPlayer = false;
			engineStalled = false;
			frontLeftSeat.ReplacePlayerAnimator(StartOfRound.Instance.allPlayerScripts[playerId], isLocalPlayer: false, base.driverSeatTrigger);
			if (base.keyIsInIgnition)
			{
				base.currentDriver.playerBodyAnimator.SetInteger("SA_CarAnim", 0);
			}
			if (base.ignitionStarted)
			{
				base.currentDriver.playerBodyAnimator.SetInteger("SA_CarAnim", 1);
			}
		}
	}

	public void ExitDriverSideSeat()
	{
		//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
		//IL_0086: Unknown result type (might be due to invalid IL or missing references)
		if (base.localPlayerInControl)
		{
			GameNetworkManager.Instance.localPlayerController.playerBodyAnimator.SetInteger("SA_CarAnim", 0);
			int num = CanExitCar(passengerSide: false);
			if (num == 0 && !base.driverSideDoor.boolValue)
			{
				base.driverSideDoor.TriggerAnimation(GameNetworkManager.Instance.localPlayerController);
			}
			if (num != -1)
			{
				GameNetworkManager.Instance.localPlayerController.TeleportPlayer(base.driverSideExitPoints[num].position, false, 0f, false, true);
			}
			else
			{
				GameNetworkManager.Instance.localPlayerController.TeleportPlayer(base.driverSideExitPoints[1].position, false, 0f, false, true);
			}
		}
	}

	public void OnDriverExit()
	{
		//IL_00e5: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ea: Unknown result type (might be due to invalid IL or missing references)
		//IL_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_0107: Unknown result type (might be due to invalid IL or missing references)
		//IL_0112: Unknown result type (might be due to invalid IL or missing references)
		//IL_012f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0135: Unknown result type (might be due to invalid IL or missing references)
		PlayerUtils.disableAnimationSync = false;
		base.localPlayerInControl = false;
		DisableVehicleCollisionForAllPlayers();
		SetTriggerHoverTip(base.driverSideDoorTrigger, "Use door : [LMB]");
		startIgnitionTrigger.isBeingHeldByPlayer = false;
		stopIgnitionTrigger.isBeingHeldByPlayer = false;
		GameNetworkManager.Instance.localPlayerController.playerBodyAnimator.SetInteger("SA_CarAnim", 0);
		PlayerUtils.ResetHUDToolTips(GameNetworkManager.Instance.localPlayerController);
		if ((Object)(object)base.currentDriver != (Object)(object)GameNetworkManager.Instance.localPlayerController)
		{
			HUDManager.Instance.DisplayTip("Err?", "This state should not occur! aborting!", false, false, "LC_Tip1");
			return;
		}
		DisableControl();
		CancelIgnitionAnimation(base.ignitionStarted);
		base.chanceToStartIgnition = 20f;
		SetIgnition(base.ignitionStarted, isCabLightOn);
		engineStalled = false;
		base.syncedPosition = ((Component)this).transform.position;
		base.syncedRotation = ((Component)this).transform.rotation;
		OnDriverExitServerRpc(((Component)this).transform.position, ((Component)this).transform.rotation);
		OnDriverExitRpc((int)GameNetworkManager.Instance.localPlayerController.playerClientId, base.syncedPosition, base.syncedRotation, base.ignitionStarted, base.keyIsInIgnition, isCabLightOn, electricsOn);
	}

	[Rpc(/*Could not decode attribute arguments.*/)]
	public void OnDriverExitServerRpc(Vector3 carLocation, Quaternion carRotation)
	{
		//IL_0024: Unknown result type (might be due to invalid IL or missing references)
		//IL_002e: Invalid comparison between Unknown and I4
		//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
		//IL_00be: Invalid comparison between Unknown and I4
		//IL_0043: Unknown result type (might be due to invalid IL or missing references)
		//IL_004b: Unknown result type (might be due to invalid IL or missing references)
		//IL_005f: Unknown result type (might be due to invalid IL or missing references)
		//IL_006d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0072: Unknown result type (might be due to invalid IL or missing references)
		//IL_009b: Unknown result type (might be due to invalid IL or missing references)
		//IL_009f: Unknown result type (might be due to invalid IL or missing references)
		//IL_00cd: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d5: Unknown result type (might be due to invalid IL or missing references)
		//IL_00db: Unknown result type (might be due to invalid IL or missing references)
		//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
		NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
		if (networkManager != null && networkManager.IsListening)
		{
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1)
			{
				RpcAttributeParams val = new RpcAttributeParams
				{
					RequireOwnership = false
				};
				RpcParams val2 = default(RpcParams);
				FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(4059499845u, val2, val, (SendTo)2, (RpcDelivery)0);
				((FastBufferWriter)(ref val3)).WriteValueSafe(ref carLocation);
				((FastBufferWriter)(ref val3)).WriteValueSafe(ref carRotation);
				((NetworkBehaviour)this).__endSendRpc(ref val3, 4059499845u, val2, val, (SendTo)2, (RpcDelivery)0);
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1)
			{
				((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0;
				base.syncedPosition = carLocation;
				base.syncedRotation = carRotation;
				base.drivePedalPressed = false;
				base.brakePedalPressed = false;
				base.currentDriver = null;
				((NetworkBehaviour)this).NetworkObject.ChangeOwnership(StartOfRound.Instance.allPlayerScripts[0].actualClientId);
			}
		}
	}

	[Rpc(/*Could not decode attribute arguments.*/)]
	public void OnDriverExitRpc(int playerId, Vector3 carLocation, Quaternion carRotation, bool setIgnitionState, bool setKeyInSlot, bool cabinLightOn, bool preIgnition)
	{
		//IL_0024: Unknown result type (might be due to invalid IL or missing references)
		//IL_002e: Invalid comparison between Unknown and I4
		//IL_012d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0137: Invalid comparison between Unknown and I4
		//IL_0043: Unknown result type (might be due to invalid IL or missing references)
		//IL_004b: Unknown result type (might be due to invalid IL or missing references)
		//IL_005f: Unknown result type (might be due to invalid IL or missing references)
		//IL_006d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0072: Unknown result type (might be due to invalid IL or missing references)
		//IL_0076: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
		//IL_00af: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c4: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ca: Unknown result type (might be due to invalid IL or missing references)
		//IL_00df: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e5: Unknown result type (might be due to invalid IL or missing references)
		//IL_00fa: Unknown result type (might be due to invalid IL or missing references)
		//IL_0100: Unknown result type (might be due to invalid IL or missing references)
		//IL_0114: Unknown result type (might be due to invalid IL or missing references)
		//IL_0118: Unknown result type (might be due to invalid IL or missing references)
		//IL_0146: Unknown result type (might be due to invalid IL or missing references)
		//IL_014d: Unknown result type (might be due to invalid IL or missing references)
		//IL_014e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0154: Unknown result type (might be due to invalid IL or missing references)
		//IL_0155: Unknown result type (might be due to invalid IL or missing references)
		NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
		if (networkManager == null || !networkManager.IsListening)
		{
			return;
		}
		if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1)
		{
			RpcAttributeParams val = new RpcAttributeParams
			{
				RequireOwnership = false
			};
			RpcParams val2 = default(RpcParams);
			FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(2603805779u, val2, val, (SendTo)5, (RpcDelivery)0);
			BytePacker.WriteValueBitPacked(val3, playerId);
			((FastBufferWriter)(ref val3)).WriteValueSafe(ref carLocation);
			((FastBufferWriter)(ref val3)).WriteValueSafe(ref carRotation);
			((FastBufferWriter)(ref val3)).WriteValueSafe<bool>(ref setIgnitionState, default(ForPrimitives));
			((FastBufferWriter)(ref val3)).WriteValueSafe<bool>(ref setKeyInSlot, default(ForPrimitives));
			((FastBufferWriter)(ref val3)).WriteValueSafe<bool>(ref cabinLightOn, default(ForPrimitives));
			((FastBufferWriter)(ref val3)).WriteValueSafe<bool>(ref preIgnition, default(ForPrimitives));
			((NetworkBehaviour)this).__endSendRpc(ref val3, 2603805779u, val2, val, (SendTo)5, (RpcDelivery)0);
		}
		if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1)
		{
			((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0;
			base.syncedPosition = carLocation;
			base.syncedRotation = carRotation;
			base.drivePedalPressed = false;
			base.brakePedalPressed = false;
			base.currentDriver = null;
			electricsOn = preIgnition;
			base.keyIsInIgnition = setKeyInSlot;
			base.ignitionStarted = setIgnitionState;
			startIgnitionTrigger.isBeingHeldByPlayer = false;
			stopIgnitionTrigger.isBeingHeldByPlayer = false;
			frontLeftSeat.ReturnPlayerAnimator(StartOfRound.Instance.allPlayerScripts[playerId], isLocalPlayer: false, base.driverSeatTrigger);
			CancelIgnitionAnimation(base.ignitionStarted);
			SetIgnition(base.ignitionStarted, cabinLightOn);
			engineStalled = false;
			if (base.localPlayerInPassengerSeat || localPlayerInMiddlePassengerSeat)
			{
				SetVehicleCollisionForPlayer(setEnabled: false, GameNetworkManager.