using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Net.NetworkInformation;
using System.Net.Sockets;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Cryptography;
using System.Security.Permissions;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Configuration;
using BepInEx.Logging;
using Cysharp.Threading.Tasks;
using Cysharp.Threading.Tasks.CompilerServices;
using GameNetcodeStuff;
using HarmonyLib;
using LethalCompanyInputUtils.Api;
using LethalMin;
using Microsoft.CodeAnalysis;
using NAudio.Wave;
using RadioBrowser;
using RadioBrowser.Models;
using ScanVan;
using ScanVan.Behaviour;
using ScanVan.ClipLoading;
using ScanVan.Compatibility;
using ScanVan.Managers;
using ScanVan.Networking;
using ScanVan.Patches;
using ScanVan.Utils;
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;
using Woecust.ImmersiveVisor;
using scandal.scanvan.NetcodePatcher;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: IgnoresAccessChecksTo("Assembly-CSharp-firstpass")]
[assembly: IgnoresAccessChecksTo("Assembly-CSharp")]
[assembly: IgnoresAccessChecksTo("ImmersiveVisor")]
[assembly: IgnoresAccessChecksTo("NoteBoxz.LethalMin")]
[assembly: IgnoresAccessChecksTo("scandal.scandalstweaks")]
[assembly: IgnoresAccessChecksTo("Unity.Netcode.Runtime")]
[assembly: IgnoresAccessChecksTo("voxx.LethalElementsPlugin")]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("scandal.scanvan")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.3.9.0")]
[assembly: AssemblyInformationalVersion("1.3.9+57fd1df4b1d28b3ffb44f465ec736e8eb6d9803a")]
[assembly: AssemblyProduct("ScanVan")]
[assembly: AssemblyTitle("scandal.scanvan")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.3.9.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_040b: Unknown result type (might be due to invalid IL or missing references)
//IL_0411: Invalid comparison between Unknown and I4
//IL_00ee: Unknown result type (might be due to invalid IL or missing references)
//IL_00fe: Unknown result type (might be due to invalid IL or missing references)
//IL_0103: Unknown result type (might be due to invalid IL or missing references)
//IL_0108: Unknown result type (might be due to invalid IL or missing references)
//IL_0110: 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_011f: Unknown result type (might be due to invalid IL or missing references)
//IL_0124: Unknown result type (might be due to invalid IL or missing references)
//IL_012b: Unknown result type (might be due to invalid IL or missing references)
//IL_0130: Unknown result type (might be due to invalid IL or missing references)
//IL_018b: Unknown result type (might be due to invalid IL or missing references)
//IL_019b: Unknown result type (might be due to invalid IL or missing references)
//IL_01a0: Unknown result type (might be due to invalid IL or missing references)
//IL_01d4: Unknown result type (might be due to invalid IL or missing references)
//IL_01de: Unknown result type (might be due to invalid IL or missing references)
//IL_01e3: Unknown result type (might be due to invalid IL or missing references)
//IL_0219: Unknown result type (might be due to invalid IL or missing references)
//IL_0221: Unknown result type (might be due to invalid IL or missing references)
//IL_0227: Unknown result type (might be due to invalid IL or missing references)
//IL_0334: Unknown result type (might be due to invalid IL or missing references)
//IL_033f: Unknown result type (might be due to invalid IL or missing references)
//IL_034a: Unknown result type (might be due to invalid IL or missing references)
//IL_04be: Unknown result type (might be due to invalid IL or missing references)
//IL_04cf: Unknown result type (might be due to invalid IL or missing references)
//IL_04da: Unknown result type (might be due to invalid IL or missing references)
//IL_04df: Unknown result type (might be due to invalid IL or missing references)
//IL_0291: Unknown result type (might be due to invalid IL or missing references)
//IL_02ec: Unknown result type (might be due to invalid IL or missing references)
//IL_02f1: Unknown result type (might be due to invalid IL or missing references)
//IL_0527: Unknown result type (might be due to invalid IL or missing references)
//IL_052c: Unknown result type (might be due to invalid IL or missing references)
//IL_053d: Unknown result type (might be due to invalid IL or missing references)
//IL_055b: Unknown result type (might be due to invalid IL or missing references)
//IL_0560: Unknown result type (might be due to invalid IL or missing references)
//IL_0571: Unknown result type (might be due to invalid IL or missing references)
//IL_0616: Unknown result type (might be due to invalid IL or missing references)
//IL_061b: Unknown result type (might be due to invalid IL or missing references)
//IL_062c: Unknown result type (might be due to invalid IL or missing references)
//IL_0631: Unknown result type (might be due to invalid IL or missing references)
//IL_0633: Unknown result type (might be due to invalid IL or missing references)
//IL_0635: Unknown result type (might be due to invalid IL or missing references)
//IL_0637: Unknown result type (might be due to invalid IL or missing references)
//IL_064a: Expected I4, but got Unknown
//IL_065b: Unknown result type (might be due to invalid IL or missing references)
//IL_0660: 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_0691: Unknown result type (might be due to invalid IL or missing references)
//IL_0696: Unknown result type (might be due to invalid IL or missing references)
//IL_069e: Unknown result type (might be due to invalid IL or missing references)
//IL_06c7: Unknown result type (might be due to invalid IL or missing references)
//IL_06cc: Unknown result type (might be due to invalid IL or missing references)
//IL_06d4: 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)
{
return;
}
Transform physicsTransform = ((VehicleController)mainScript).physicsRegion.physicsTransform;
if ((Object)(object)val.physicsParent == (Object)(object)physicsTransform || (Object)(object)val.overridePhysicsParent == (Object)(object)physicsTransform || Time.realtimeSinceStartup - timeSinceHittingPlayer < 0.25f)
{
return;
}
float num = ((Vector3)(ref ((VehicleController)mainScript).averageVelocity)).magnitude;
if (num < 2f)
{
return;
}
Vector3 val2 = ((Component)val).transform.position - ((VehicleController)mainScript).mainRigidbody.position;
float num2 = Vector3.Angle(Vector3.Normalize(((VehicleController)mainScript).averageVelocity * 1000f), Vector3.Normalize(val2 * 1000f));
if (num2 > 70f)
{
return;
}
if (num2 < 30f && mainScript.wheelRPM > 400f)
{
num += 6f;
}
if ((((Component)val.gameplayCamera).transform.position - ((VehicleController)mainScript).mainRigidbody.position).y < -0.1f)
{
num *= 2f;
}
timeSinceHittingPlayer = Time.realtimeSinceStartup;
Vector3 val3 = Vector3.ClampMagnitude(((VehicleController)mainScript).averageVelocity, 40f);
if ((Object)(object)val == (Object)(object)GameNetworkManager.Instance.localPlayerController)
{
if (num > 20f)
{
GameNetworkManager.Instance.localPlayerController.KillPlayer(val3, true, (CauseOfDeath)8, 9, default(Vector3), false);
}
else
{
int num3 = 0;
if (num > 15f)
{
num3 = 80;
}
else if (num > 12f)
{
num3 = 60;
}
else if (num > 8f)
{
num3 = 40;
}
if (num3 > 0)
{
GameNetworkManager.Instance.localPlayerController.DamagePlayer(num3, true, true, (CauseOfDeath)8, 0, false, val3);
}
}
if (!GameNetworkManager.Instance.localPlayerController.isPlayerDead && ((Vector3)(ref GameNetworkManager.Instance.localPlayerController.externalForceAutoFade)).sqrMagnitude < ((Vector3)(ref ((VehicleController)mainScript).averageVelocity)).sqrMagnitude)
{
GameNetworkManager.Instance.localPlayerController.externalForceAutoFade = ((VehicleController)mainScript).averageVelocity;
}
}
else if (((NetworkBehaviour)mainScript).IsOwner && ((Vector3)(ref ((VehicleController)mainScript).averageVelocity)).magnitude > 1.8f)
{
mainScript.CarReactToObstacle(((VehicleController)mainScript).averageVelocity, ((Component)val).transform.position, ((VehicleController)mainScript).averageVelocity, (CarObstacleType)0);
}
}
else
{
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 Material rareWindowOn = null;
public Texture2D defaultTruckTex = null;
public Texture2D rareTruckTex = null;
public Light radioLightCol = null;
public Light heaterLightCol = null;
public Light clusterLightCol = null;
public Light leftWindowLightCol = null;
public Light rightWindowLightCol = null;
public float specialChance;
public bool isSpecial;
public Light jcJensonLight = null;
public SpriteRenderer jcJensonSymbol = null;
public GameObject jcJensonSymbolObj = 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 brakeInput;
public float clutchInput;
public float gasInput;
public int baseTransmissionHp = 20;
public int transmissionHp;
public bool usingSwitchIgnition;
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 extraWeight = 0f;
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 itemSafetyBounds = null;
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;
public int syncedCarHP;
public bool syncedDrivePedalPressed;
public bool syncedBrakePedalPressed;
public bool syncedClutchPedalPressed;
public float tyreStress;
public bool wheelSlipping;
public 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 Collider ignitionCollider = 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 Light hazardWarningLight = null;
public Light leftSignalLight = null;
public Light rightSignalLight = null;
public SpriteRenderer hazardWarningSymbol = null;
public SpriteRenderer leftSignalSymbol = null;
public SpriteRenderer rightSignalSymbol = null;
public Light vehicleDisplayLight = null;
public SpriteRenderer vehicleDisplay = null;
public Light parkingBrakeLight = null;
public Light checkEngineLight = null;
public Light alertLight = null;
public Light seatBeltLight = null;
public Light oilLevelLight = null;
public Light batteryLight = null;
public Light coolantLevelLight = null;
public Light dippedBeamLight = null;
public Light highBeamLight = null;
public Light immobiliserLight = null;
public SpriteRenderer parkingBrakeSymbol = null;
public SpriteRenderer checkEngineLightSymbol = null;
public SpriteRenderer alertLightSymbol = null;
public SpriteRenderer seatbeltLightSymbol = null;
public SpriteRenderer oilLevelLightSymbol = null;
public SpriteRenderer batteryLightSymbol = null;
public SpriteRenderer coolantLevelLightSymbol = null;
public SpriteRenderer dippedBeamLightSymbol = null;
public SpriteRenderer highBeamLightSymbol = null;
public SpriteRenderer immobiliserSymbol = null;
public Animator ignitionAnimator = null;
public GameObject carKeyContainer = null;
public GameObject carKeyInHand = null;
public Transform ignitionKeyPosition = null;
public GameObject headlightSwitch = null;
public MeshRenderer lowBeamMesh = null;
public MeshRenderer highBeamMesh = null;
public GameObject highBeamContainer = null;
public GameObject clusterLightsContainer = null;
public MeshRenderer leftDoorMesh = null;
public MeshRenderer rightDoorMesh = null;
public MeshRenderer radioMesh = null;
public MeshRenderer radioPowerDial = null;
public MeshRenderer radioVolumeDial = null;
public GameObject radioLight = null;
public GameObject heaterLight = null;
public GameObject leftWindowLight = null;
public GameObject rightWindowLight = null;
public TextMeshPro radioTime = null;
public TextMeshPro radioFrequency = null;
public GameObject sideLightsContainer = null;
public MeshRenderer sideTopLightsMesh = null;
public AnimationCurve oilPressureNeedleCurve = null;
public AnimationCurve turboPressureNeedleCurve = null;
public MeshRenderer interiorMesh = null;
public MeshRenderer speedometerMesh = null;
public MeshRenderer tachometerMesh = null;
public MeshRenderer oilPressureMesh = null;
public MeshRenderer lowBeamMeshLod = null;
public MeshRenderer highBeamMeshLod = null;
public MeshRenderer backLightsMeshLod = null;
public MeshRenderer sideTopLightsMeshLod = null;
public MeshRenderer leftBlinkerMeshLod = null;
public MeshRenderer rightBlinkerMeshLod = null;
public MeshRenderer leftBlinkerMesh = null;
public MeshRenderer rightBlinkerMesh = null;
public Transform speedometerTransform = null;
public Transform tachometerTransform = null;
public Transform oilPressureTransform = null;
private Coroutine blinkersCoroutine = null;
public InteractTrigger windscreenWipersTrigger = null;
public InteractTrigger startIgnitionTrigger = null;
public InteractTrigger stopIgnitionTrigger = null;
public GameObject reverseLightsContainer = null;
public MeshRenderer reverseLightsMesh = null;
public Animator manualShiftAnimator = null;
public bool treatingPlayerInfection;
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 smoothRotation;
public bool heaterOn;
public float heaterTemp;
public float heaterSpeed;
public float steeringWheelAnimValue;
public float steeringSpeed;
public bool windshieldShattered;
public bool inIgnitionAnimation;
public bool isHeaterCold;
public bool isHeaterWarm;
private Vector3 ignitionKeyScale = new Vector3(0.06f, 0.06f, 0.06f);
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;
public int currentSweepStage;
public bool hasSweepedDashboard;
public bool hazardsBlinking;
public bool hazardsOn;
public bool reverseLightsOn;
private float speedometerFloat;
private float tachometerFloat;
public bool disableAnimations;
public bool lowBeamsOn;
public bool highBeamsOn;
public bool cabinLightSwitchEnabled = true;
private float oilPressureFloat;
private float turboPressureFloat;
public 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 roofAudio = null;
public AudioSource cabinLightSwitchAudio = null;
public AudioClip cabinLightSwitchToggle = null;
public AudioSource handbrakeAudio = null;
public AudioClip handbrakeOn = null;
public AudioClip handbrakeOff = null;
public AudioSource engineAudio4 = null;
public AudioSource engineAudio3 = null;
public AudioClip stallEngine = null;
public AudioClip blinkOn = null;
public AudioClip blinkOff = null;
public AudioClip[] gearCrunchSounds = null;
public AudioClip[] shiftSounds = null;
public AudioSource roofRainAudio = null;
public AudioSource carKeySounds = null;
public AudioSource wiperAudio = null;
private Coroutine truckAlarmCoroutine = null;
public AudioSource alarmAudio = null;
public AudioSource heaterAudio = null;
public bool engineKnockingAudioActive;
public float engineKnockSpeed;
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;
public 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 windowOffMaterial = null;
public Material windowOnMaterial = 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(4283610501u, val2, val, (SendTo)6, (RpcDelivery)0);
((FastBufferWriter)(ref val3)).WriteValueSafe<bool>(ref special, default(ForPrimitives));
((NetworkBehaviour)this).__endSendRpc(ref val3, 4283610501u, 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_00b4: Unknown result type (might be due to invalid IL or missing references)
//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
//IL_00de: Unknown result type (might be due to invalid IL or missing references)
//IL_00e3: Unknown result type (might be due to invalid IL or missing references)
//IL_010d: 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_0170: Unknown result type (might be due to invalid IL or missing references)
//IL_0175: Unknown result type (might be due to invalid IL or missing references)
//IL_0197: Unknown result type (might be due to invalid IL or missing references)
//IL_019c: Unknown result type (might be due to invalid IL or missing references)
//IL_01c3: Unknown result type (might be due to invalid IL or missing references)
//IL_01c8: Unknown result type (might be due to invalid IL or missing references)
if (isJenson)
{
truckMat.mainTexture = (Texture)(object)rareTruckTex;
radioLightCol.color = Color32.op_Implicit(new Color32((byte)250, (byte)254, (byte)170, byte.MaxValue));
leftWindowLightCol.color = Color32.op_Implicit(new Color32((byte)250, (byte)254, (byte)170, byte.MaxValue));
rightWindowLightCol.color = Color32.op_Implicit(new Color32((byte)250, (byte)254, (byte)170, byte.MaxValue));
heaterLightCol.color = Color32.op_Implicit(new Color32((byte)250, (byte)254, (byte)170, byte.MaxValue));
clusterLightCol.color = Color32.op_Implicit(new Color32((byte)250, (byte)254, (byte)222, byte.MaxValue));
voiceModule.clusterLight.color = Color32.op_Implicit(new Color32((byte)250, (byte)254, (byte)222, byte.MaxValue));
clusterDialsOnMat = rareTruckDialsOn;
clusterOnMaterial = rareTruckClusterOn;
radioOnMaterial = rareTruckRadioOn;
heaterOnMat = rareHeaterOn;
windowOnMaterial = rareWindowOn;
((Graphic)radioTime).color = Color32.op_Implicit(new Color32(byte.MaxValue, (byte)204, (byte)51, byte.MaxValue));
((Graphic)radioFrequency).color = Color32.op_Implicit(new Color32(byte.MaxValue, (byte)204, (byte)51, byte.MaxValue));
((Graphic)voiceModule.clusterScreen).color = Color32.op_Implicit(new Color32(byte.MaxValue, (byte)204, (byte)51, byte.MaxValue));
voiceModule.clusterTexts[0] = "sys status: [ok]";
voiceModule.clusterTexts[15] = "high temp!";
voiceModule.clusterTexts[13] = "error: wd606";
}
else
{
truckMat.mainTexture = (Texture)(object)defaultTruckTex;
}
}
public void OnEnable()
{
References.truckController = this;
}
public void Awake()
{
//IL_006a: Unknown result type (might be due to invalid IL or missing references)
//IL_006f: Unknown result type (might be due to invalid IL or missing references)
//IL_007b: Unknown result type (might be due to invalid IL or missing references)
//IL_0080: Unknown result type (might be due to invalid IL or missing references)
//IL_0096: Unknown result type (might be due to invalid IL or missing references)
//IL_009c: Unknown result type (might be due to invalid IL or missing references)
//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
//IL_00c3: Unknown result type (might be due to invalid IL or missing references)
//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
//IL_00e4: Unknown result type (might be due to invalid IL or missing references)
//IL_00ea: Unknown result type (might be due to invalid IL or missing references)
//IL_00ef: Unknown result type (might be due to invalid IL or missing references)
base.ragdollPhysicsBody.interpolation = (RigidbodyInterpolation)1;
base.windwiperPhysicsBody1.interpolation = (RigidbodyInterpolation)1;
base.windwiperPhysicsBody2.interpolation = (RigidbodyInterpolation)1;
playerPhysicsBody.interpolation = (RigidbodyInterpolation)1;
((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;
usingSwitchIgnition = false;
ignitionCollider.enabled = false;
base.backDoorOpen = true;
SetTruckStats();
}
private void SetTruckStats()
{
//IL_0264: Unknown result type (might be due to invalid IL or missing references)
//IL_027e: Unknown result type (might be due to invalid IL or missing references)
//IL_02a8: Unknown result type (might be due to invalid IL or missing references)
//IL_02a9: Unknown result type (might be due to invalid IL or missing references)
//IL_0338: Unknown result type (might be due to invalid IL or missing references)
//IL_0345: Unknown result type (might be due to invalid IL or missing references)
//IL_0352: Unknown result type (might be due to invalid IL or missing references)
//IL_035f: Unknown result type (might be due to invalid IL or missing references)
base.idleSpeed = 80f;
base.pushForceMultiplier = 162f;
base.carTooltips = new string[4] { "Gas pedal: [W]", "Brake pedal: [S]", "Clutch pedal: [L-Shift]", "Remove key: [LMB + E]" };
base.turboBoostForce = 10000f;
base.turboBoostUpwardForce = 23000f;
steeringSpeed = 6f;
baseSteeringWheelTurnSpeed = 4.2f;
base.steeringWheelTurnSpeed = baseSteeringWheelTurnSpeed;
handbrakeEngaged = true;
inNeutral = true;
throttleSpeed = 1f;
maxThrottleSpeed = 2f;
throttleReleaseSpeed = 3f;
baseTransmissionHp = 20;
transmissionHp = baseTransmissionHp;
clutchSpeed = 4f;
clutchReturnSpeed = 1.5f;
minClutchReturnSpeed = 0.5f;
base.jumpForce = 4150f;
base.brakeSpeed = 10000f;
maxBrakingPower = 12000f;
base.speed = 60f;
base.stability = 0.4f;
engineAudio3.volume = 0.9f;
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.26f, 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()
{
//IL_00bd: 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_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)
((MonoBehaviour)this).StartCoroutine(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.loadedVehicleFromSave = true;
base.mainRigidbody.isKinematic = true;
((Component)this).transform.position = StartOfRound.Instance.magnetPoint.position + StartOfRound.Instance.magnetPoint.forward * 7f;
base.magnetedToShip = true;
base.inDropshipAnimation = false;
hasDeliveredVehicle = true;
base.hasBeenSpawned = true;
StartMagneting();
}
}
public IEnumerator SetCarRainCollisions()
{
yield return (object)new WaitForSeconds(4f);
ParticleSystem[] particleTriggers = (ParticleSystem[])(object)new ParticleSystem[9]
{
GlobalReferences.rainParticles,
GlobalReferences.rainHitParticles,
GlobalReferences.stormyRainParticles,
GlobalReferences.stormyRainHitParticles,
GlobalReferences.wesleyHurricaneRainParticles,
GlobalReferences.wesleyHurricaneRainHitParticles,
GlobalReferences.wesleyHurricaneSandParticles,
GlobalReferences.wesleyForsakenRainParticles,
GlobalReferences.wesleyForsakenRainHitParticles
};
for (int i = 0; i < particleTriggers.Length; i++)
{
if ((Object)(object)particleTriggers[i] == (Object)null)
{
Plugin.Logger.LogDebug((object)"weather particle or trigger is null!");
continue;
}
TriggerModule trigger = particleTriggers[i].trigger;
for (int j = 0; j < weatherEffectBlockers.Length; j++)
{
int index = ((TriggerModule)(ref trigger)).colliderCount + j;
((TriggerModule)(ref trigger)).SetCollider(index, (Component)(object)weatherEffectBlockers[j]);
}
trigger = default(TriggerModule);
}
}
public void SendClientSyncData()
{
//IL_0012: Unknown result type (might be due to invalid IL or missing references)
//IL_0017: Unknown result type (might be due to invalid IL or missing references)
//IL_001a: Unknown result type (might be due to invalid IL or missing references)
//IL_001f: Unknown result type (might be due to invalid IL or missing references)
//IL_0021: Unknown result type (might be due to invalid IL or missing references)
//IL_0027: Unknown result type (might be due to invalid IL or missing references)
//IL_0036: Unknown result type (might be due to invalid IL or missing references)
//IL_003c: Unknown result type (might be due to invalid IL or missing references)
if (base.magnetedToShip)
{
Vector3 eulerAngles = ((Quaternion)(ref base.magnetTargetRotation)).eulerAngles;
MagnetCarRpc(base.magnetTargetPosition, eulerAngles, base.magnetStartPosition, base.magnetStartRotation, RoundManager.Instance.tempTransform.eulerAngles, base.averageVelocityAtMagnetStart);
}
if (base.turboBoosts > 0)
{
AddTurboBoostRpc(base.turboBoosts);
}
if (base.ignitionStarted)
{
StartIgnitionRpc(setTriggers: true);
}
SyncClientDataRpc(base.carHP, base.steeringWheelAnimFloat, base.ignitionStarted, isSpecial);
}
[Rpc(/*Could not decode attribute arguments.*/)]
public void SyncClientDataRpc(int carHealth, 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_00ea: Unknown result type (might be due to invalid IL or missing references)
//IL_00f4: Invalid comparison between Unknown and I4
//IL_0043: Unknown result type (might be due to invalid IL or missing references)
//IL_004b: Unknown result type (might be due to invalid IL or missing references)
//IL_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_00d1: Unknown result type (might be due to invalid IL or missing references)
//IL_00d5: Unknown result type (might be due to invalid IL or missing references)
//IL_0103: Unknown result type (might be due to invalid IL or missing references)
NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
if (networkManager == null || !networkManager.IsListening)
{
return;
}
if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1)
{
RpcAttributeParams val = default(RpcAttributeParams);
RpcParams val2 = default(RpcParams);
FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(718438838u, val2, val, (SendTo)3, (RpcDelivery)0);
BytePacker.WriteValueBitPacked(val3, carHealth);
((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, 718438838u, 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;
}
}
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;
roofAudio.PlayOneShot(cabinLightSwitchToggle);
bool flag = isCabLightOn && base.keyIsInIgnition && electricsOn && 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(4155263600u, 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, 4155263600u, val2, val, (SendTo)5, (RpcDelivery)0);
}
if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1)
{
((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0;
cabinLightSwitchEnabled = switchState;
roofAudio.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(2820477147u, val2, val, (SendTo)5, (RpcDelivery)0);
((FastBufferWriter)(ref val3)).WriteValueSafe<bool>(ref setOn, default(ForPrimitives));
((NetworkBehaviour)this).__endSendRpc(ref val3, 2820477147u, 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()
{
if (!((Object)(object)base.currentDriver != (Object)null) || base.localPlayerInControl)
{
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(1779906441u, val2, val, (SendTo)5, (RpcDelivery)0);
((FastBufferWriter)(ref val3)).WriteValueSafe<bool>(ref setHandbrake, default(ForPrimitives));
((NetworkBehaviour)this).__endSendRpc(ref val3, 1779906441u, 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 TrySetCarIgnitionTriggers()
{
if (base.localPlayerInControl || !((Object)(object)base.currentDriver != (Object)null))
{
if (base.ignitionStarted)
{
startIgnitionTrigger.hoverTip = "Untwist key : [LMB]";
startIgnitionTrigger.holdTip = "[ Untwisting key ]";
startIgnitionTrigger.timeToHold = 0.75f;
startIgnitionTrigger.timeToHoldSpeedMultiplier = 1f;
}
else if (base.keyIsInIgnition)
{
bool flag = usingSwitchIgnition || (Object)(object)base.currentDriver == (Object)null;
startIgnitionTrigger.hoverTip = (flag ? "Remove key : [LMB]" : "Try ignition : [LMB] (Hold)");
startIgnitionTrigger.holdTip = (flag ? "[ Removing Key ]" : "[ Trying ignition ]");
startIgnitionTrigger.timeToHold = (flag ? 0.75f : 1f);
startIgnitionTrigger.timeToHoldSpeedMultiplier = (flag ? 1f : 0f);
}
else
{
startIgnitionTrigger.hoverTip = "Try ignition : [LMB] (Hold)";
startIgnitionTrigger.holdTip = "[ Trying ignition ]";
startIgnitionTrigger.timeToHold = 1f;
startIgnitionTrigger.timeToHoldSpeedMultiplier = 0f;
}
}
}
public void StartTryCarIgnition()
{
if (!usingSwitchIgnition && base.localPlayerInControl && !base.ignitionStarted)
{
if (base.keyIgnitionCoroutine != null)
{
((MonoBehaviour)this).StopCoroutine(base.keyIgnitionCoroutine);
base.keyIgnitionCoroutine = null;
}
disableAnimations = true;
inIgnitionAnimation = true;
TryIgnitionRpc(base.keyIsInIgnition, isCabLightOn, engineStalled);
TrySetCarIgnitionTriggers();
base.keyIgnitionCoroutine = ((MonoBehaviour)this).StartCoroutine(TryIgnition(isLocalDriver: true));
}
}
private IEnumerator TryIgnition(bool isLocalDriver)
{
if ((Object)(object)base.currentDriver == (Object)null)
{
base.keyIgnitionCoroutine = null;
yield break;
}
if (base.keyIsInIgnition)
{
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);
}
}
}
int animIndex = base.currentDriver.playerBodyAnimator.GetInteger("SA_CarAnim");
if (animIndex == 9)
{
animIndex = 12;
}
ignitionAnimator.SetInteger("SAIgnition_Anim", animIndex);
TrySetCarIgnitionTriggers();
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);
}
ignitionAnimator.SetInteger("SAIgnition_Anim", 2);
TrySetCarIgnitionTriggers();
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);
TrySetCarIgnitionTriggers();
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);
TrySetCarIgnitionTriggers();
driversSideWindow.interactable = electricsOn;
passengersSideWindow.interactable = electricsOn;
if (dashboardSymbolPreStartup == null && !hasSweepedDashboard)
{
dashboardSymbolPreStartup = ((MonoBehaviour)this).StartCoroutine(PreIgnitionSymbolCheck());
}
SetSymbolActive(vehicleDisplay, vehicleDisplayLight, active: true);
if (!clutchInterlock)
{
yield break;
}
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)
{
disableAnimations = false;
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, setIgnitionAnim: true);
startIgnitionTrigger.StopInteraction();
TrySetCarIgnitionTriggers();
startIgnitionTrigger.StopInteraction();
startIgnitionTrigger.currentCooldownValue = 1f;
StartIgnitionRpc(setTriggers: false);
}
else
{
base.chanceToStartIgnition += 22f;
base.chanceToStartIgnition = Mathf.Clamp(base.chanceToStartIgnition, 0f, 99f);
}
}
[Rpc(/*Could not decode attribute arguments.*/)]
public void TryIgnitionRpc(bool setKeyInSlot, bool 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(3540053645u, 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, 3540053645u, 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);
base.keyIgnitionCoroutine = null;
}
disableAnimations = true;
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(2290489169u, val2, val, (SendTo)5, (RpcDelivery)0);
((FastBufferWriter)(ref val3)).WriteValueSafe<bool>(ref shiftInterlock, default(ForPrimitives));
((NetworkBehaviour)this).__endSendRpc(ref val3, 2290489169u, 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());
}
SetSymbolActive(vehicleDisplay, vehicleDisplayLight, active: true);
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 (!usingSwitchIgnition && base.localPlayerInControl && !base.ignitionStarted)
{
CancelIgnitionAnimation(ignitionOn: false, setIgnitionAnim: false);
disableAnimations = true;
inIgnitionAnimation = false;
TrySetCarIgnitionTriggers();
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);
}
int integer = base.currentDriver.playerBodyAnimator.GetInteger("SA_CarAnim");
ignitionAnimator.SetInteger("SAIgnition_Anim", integer);
CancelTryIgnitionRpc(base.keyIsInIgnition, isCabLightOn, electricsOn, integer);
}
}
[Rpc(/*Could not decode attribute arguments.*/)]
public void CancelTryIgnitionRpc(bool setKeyInSlot, bool cabinLightOn, bool preIgnition, int currentAnimIndex)
{
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: Invalid comparison between Unknown and I4
//IL_00f8: Unknown result type (might be due to invalid IL or missing references)
//IL_0102: Invalid comparison between Unknown and I4
//IL_0043: Unknown result type (might be due to invalid IL or missing references)
//IL_004b: Unknown result type (might be due to invalid IL or missing references)
//IL_005f: Unknown result type (might be due to invalid IL or missing references)
//IL_006d: Unknown result type (might be due to invalid IL or missing references)
//IL_0072: Unknown result type (might be due to invalid IL or missing references)
//IL_0082: Unknown result type (might be due to invalid IL or missing references)
//IL_0088: Unknown result type (might be due to invalid IL or missing references)
//IL_009d: Unknown result type (might be due to invalid IL or missing references)
//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
//IL_00be: Unknown result type (might be due to invalid IL or missing references)
//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
//IL_00df: Unknown result type (might be due to invalid IL or missing references)
//IL_00e3: Unknown result type (might be due to invalid IL or missing references)
//IL_0111: Unknown result type (might be due to invalid IL or missing references)
NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
if (networkManager == null || !networkManager.IsListening)
{
return;
}
if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1)
{
RpcAttributeParams val = new RpcAttributeParams
{
RequireOwnership = false
};
RpcParams val2 = default(RpcParams);
FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(1131385462u, 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));
BytePacker.WriteValueBitPacked(val3, currentAnimIndex);
((NetworkBehaviour)this).__endSendRpc(ref val3, 1131385462u, 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, setIgnitionAnim: false);
disableAnimations = true;
inIgnitionAnimation = false;
PlayerControllerB currentDriver = base.currentDriver;
if (currentDriver != null)
{
currentDriver.playerBodyAnimator.SetInteger("SA_CarAnim", currentAnimIndex);
}
ignitionAnimator.SetInteger("SAIgnition_Anim", currentAnimIndex);
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(bool setTriggers)
{
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: Invalid comparison between Unknown and I4
//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
//IL_00bf: Invalid comparison between Unknown and I4
//IL_0043: Unknown result type (might be due to invalid IL or missing references)
//IL_004b: Unknown result type (might be due to invalid IL or missing references)
//IL_005f: Unknown result type (might be due to invalid IL or missing references)
//IL_006d: Unknown result type (might be due to invalid IL or missing references)
//IL_0072: Unknown result type (might be due to invalid IL or missing references)
//IL_0082: Unknown result type (might be due to invalid IL or missing references)
//IL_0088: Unknown result type (might be due to invalid IL or missing references)
//IL_009c: Unknown result type (might be due to invalid IL or missing references)
//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
if (networkManager == null || !networkManager.IsListening)
{
return;
}
if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1)
{
RpcAttributeParams val = new RpcAttributeParams
{
RequireOwnership = false
};
RpcParams val2 = default(RpcParams);
FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(4118721524u, val2, val, (SendTo)5, (RpcDelivery)0);
((FastBufferWriter)(ref val3)).WriteValueSafe<bool>(ref setTriggers, default(ForPrimitives));
((NetworkBehaviour)this).__endSendRpc(ref val3, 4118721524u, val2, val, (SendTo)5, (RpcDelivery)0);
}
if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1)
{
((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0;
disableAnimations = false;
inIgnitionAnimation = false;
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, setIgnitionAnim: true);
if (setTriggers)
{
TrySetCarIgnitionTriggers();
}
}
}
public void SetIgnition(bool started, bool cabLightOn)
{
SetFrontCabinLightOn(cabLightOn);
base.carEngine1AudioActive = started;
if (started)
{
disableAnimations = false;
inIgnitionAnimation = false;
electricsOn = true;
if (started != base.ignitionStarted)
{
base.ignitionStarted = true;
base.carExhaustParticle.Play();
base.engineAudio1.Stop();
base.engineAudio1.PlayOneShot(base.engineStartSuccessful);
base.engineAudio1.clip = base.engineRun;
}
}
else
{
base.ignitionStarted = false;
base.carExhaustParticle.Stop(true, (ParticleSystemStopBehavior)1);
}
}
public void UntwistKeyInIgnition()
{
if ((!base.keyIsInIgnition || base.ignitionStarted || usingSwitchIgnition) && (!((Object)(object)base.currentDriver != (Object)null) || base.localPlayerInControl) && base.ignitionStarted && !inIgnitionAnimation)
{
if (base.keyIgnitionCoroutine != null)
{
((MonoBehaviour)this).StopCoroutine(base.keyIgnitionCoroutine);
base.keyIgnitionCoroutine = null;
}
base.keyIgnitionCoroutine = ((MonoBehaviour)this).StartCoroutine(UntwistKey());
TrySetCarIgnitionTriggers();
UntwistKeyInIgnitionRpc();
}
}
private IEnumerator UntwistKey()
{
disableAnimations = true;
inIgnitionAnimation = false;
PlayerControllerB currentDriver = base.currentDriver;
if (currentDriver != null)
{
currentDriver.playerBodyAnimator.SetInteger("SA_CarAnim", 7);
}
ignitionAnimator.SetInteger("SAIgnition_Anim", 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);
engineAudio3.volume = 0.775f;
engineAudio3.PlayOneShot(stallEngine);
TrySetCarIgnitionTriggers();
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(1677604189u, val2, val, (SendTo)5, (RpcDelivery)0);
((NetworkBehaviour)this).__endSendRpc(ref val3, 1677604189u, 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 = null;
}
base.keyIgnitionCoroutine = ((MonoBehaviour)this).StartCoroutine(UntwistKey());
}
}
public void RemoveKeyFromIgnition()
{
if ((!base.keyIsInIgnition || usingSwitchIgnition || !base.localPlayerInControl) && (!((Object)(object)base.currentDriver != (Object)null) || base.localPlayerInControl) && !base.ignitionStarted && base.keyIsInIgnition && !inIgnitionAnimation)
{
if (base.keyIgnitionCoroutine != null)
{
((MonoBehaviour)this).StopCoroutine(base.keyIgnitionCoroutine);
base.keyIgnitionCoroutine = null;
}
base.keyIgnitionCoroutine = ((MonoBehaviour)this).StartCoroutine(RemoveKey());
TrySetCarIgnitionTriggers();
usingSwitchIgnition = false;
base.chanceToStartIgnition = 20f;
RemoveKeyFromIgnitionRpc();
}
}
private IEnumerator RemoveKey()
{
disableAnimations = true;
inIgnitionAnimation = false;
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);
}
}
ignitionAnimator.SetInteger("SAIgnition_Anim", 0);
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;
SetSymbolActive(vehicleDisplay, vehicleDisplayLight, active: false);
driversSideWindow.interactable = false;
passengersSideWindow.interactable = false;
TrySetCarIgnitionTriggers();
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(2078953510u, val2, val, (SendTo)5, (RpcDelivery)0);
((NetworkBehaviour)this).__endSendRpc(ref val3, 2078953510u, 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 = null;
}
base.keyIgnitionCoroutine = ((MonoBehaviour)this).StartCoroutine(RemoveKey());
}
}
public IEnumerator PreIgnitionSymbolCheck()
{
SetSymbolActive(dippedBeamLightSymbol, dippedBeamLight, active: true);
SetSymbolActive(highBeamLightSymbol, highBeamLight, active: true);
SetSymbolActive(parkingBrakeSymbol, parkingBrakeLight, active: true);
SetSymbolActive(seatbeltLightSymbol, seatBeltLight, active: true);
SetSymbolActive(oilLevelLightSymbol, oilLevelLight, active: true);
SetSymbolActive(batteryLightSymbol, batteryLight, active: true);
SetSymbolActive(coolantLevelLightSymbol, coolantLevelLight, active: true);
SetSymbolActive(alertLightSymbol, alertLight, active: true);
SetSymbolActive(checkEngineLightSymbol, checkEngineLight, active: true);
currentSweepStage = 1;
yield return (object)new WaitForSeconds(1f);
SetSymbolActive(dippedBeamLightSymbol, dippedBeamLight, lowBeamsOn);
SetSymbolActive(highBeamLightSymbol, highBeamLight, highBeamsOn);
currentSweepStage = 2;
yield return (object)new WaitForSeconds(1f);
SetSymbolActive(seatbeltLightSymbol, seatBeltLight, active: false);
SetSymbolActive(parkingBrakeSymbol, parkingBrakeLight, handbrakeEngaged);
currentSweepStage = 3;
yield return (object)new WaitForSeconds(1f);
SetSymbolActive(oilLevelLightSymbol, oilLevelLight, base.carHP <= 25);
SetSymbolActive(batteryLightSymbol, batteryLight, !base.ignitionStarted || base.carHP <= 22);
SetSymbolActive(coolantLevelLightSymbol, coolantLevelLight, base.carHP <= 30);
SetSymbolActive(alertLightSymbol, alertLight, base.carHP <= 16);
SetSymbolActive(checkEngineLightSymbol, checkEngineLight, base.carHP <= 38);
currentSweepStage = 4;
hasSweepedDashboard = true;
}
private void StopPreIgnitionChecks()
{
hasSweepedDashboard = false;
currentSweepStage = 0;
SetSymbolActive(dippedBeamLightSymbol, dippedBeamLight, active: false);
SetSymbolActive(highBeamLightSymbol, highBeamLight, active: false);
SetSymbolActive(parkingBrakeSymbol, parkingBrakeLight, active: false);
SetSymbolActive(seatbeltLightSymbol, seatBeltLight, active: false);
SetSymbolActive(oilLevelLightSymbol, oilLevelLight, active: false);
SetSymbolActive(batteryLightSymbol, batteryLight, active: false);
SetSymbolActive(coolantLevelLightSymbol, coolantLevelLight, active: false);
SetSymbolActive(alertLightSymbol, alertLight, active: false);
SetSymbolActive(checkEngineLightSymbol, checkEngineLight, active: false);
}
public void CancelIgnitionAnimation(bool ignitionOn, bool setIgnitionAnim)
{
if (base.keyIgnitionCoroutine != null)
{
((MonoBehaviour)this).StopCoroutine(base.keyIgnitionCoroutine);
base.keyIgnitionCoroutine = null;
}
base.keyIsInDriverHand = false;
twistingKey = false;
base.carEngine1AudioActive = ignitionOn;
if (setIgnitionAnim)
{
ignitionAnimator.SetInteger("SAIgnition_Anim", ignitionOn ? 1 : 0);
}
}
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 && !StartOfRound.Instance.inShipPhase)
{
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(3762133933u, val2, val, (SendTo)2, (RpcDelivery)0);
BytePacker.WriteValueBitPacked(val3, playerId);
((NetworkBehaviour)this).__endSendRpc(ref val3, 3762133933u, 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)
{
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(437116846u, val2, val, (SendTo)0, (RpcDelivery)0);
((NetworkBehaviour)this).__endSendRpc(ref val3, 437116846u, 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]");
ignitionCollider.enabled = true;
startIgnitionTrigger.isBeingHeldByPlayer = false;
engineStalled = false;
TrySetCarIgnitionTriggers();
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(2905056547u, val2, val, (SendTo)1, (RpcDelivery)0);
BytePacker.WriteValueBitPacked(val3, playerId);
((NetworkBehaviour)this).__endSendRpc(ref val3, 2905056547u, 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);
ignitionCollider.enabled = false;
startIgnitionTrigger.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_013c: 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_014d: Unknown result type (might be due to invalid IL or missing references)
//IL_0152: Unknown result type (might be due to invalid IL or missing references)
//IL_016e: Unknown result type (might be due to invalid IL or missing references)
//IL_0179: Unknown result type (might be due to invalid IL or missing references)
//IL_0196: Unknown result type (might be due to invalid IL or missing references)
//IL_019c: Unknown result type (might be due to invalid IL or missing references)
if (((NetworkBehaviour)this).IsSpawned && !((Object)(object)((NetworkBehaviour)this).NetworkManager == (Object)null) && ((NetworkBehaviour)this).NetworkManager.IsListening)
{
PlayerUtils.disableAnimationSync = false;
base.localPlayerInControl = false;
DisableVehicleCollisionForAllPlayers();
SetTriggerHoverTip(base.driverSideDoorTrigger, "Use door : [LMB]");
disableAnimations = !base.ignitionStarted;
inIgnitionAnimation = false;
usingSwitchIgnition = false;
ignitionCollider.enabled = true;
startIgnitionTrigger.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, setIgnitionAnim: true);
base.chanceToStartIgnition = 20f;
SetIgnition(base.ignitionStarted, isCabLightOn);
TrySetCarIgnitionTriggers();
engineStalled = false;
base.syncedPosition = ((Component)this).transform.position;
base.syncedRotation = ((Component)this).transform.rotation;
OnDriverExitServerRpc((int)GameNetworkManager.Instance.localPlayerController.playerClientId, ((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(int playerId, 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_00c1: Unknown result type (might be due to invalid IL or missing references)
//IL_00cb: Invalid comparison between Unknown and I4
//IL_0043: Unknown result type (might be due to invalid IL or missing references)
//IL_004b: Unknown result type (might be due to invalid IL or missing references)
//IL_005f: Unknown result type (might be due to invalid IL or missing references)
//IL_006d: Unknown result type (might be due to invalid IL or missing references)
//IL_0072: Unknown result type (might be due to invalid IL or missing references)
//IL_0076: Unknown result type (might be due to invalid IL or missing references)
//IL_00a8: Unknown result type (might be due to invalid IL or missing references)
//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
//IL_00da: Unknown result type (might be due to invalid IL or missing references)
//IL_010a: 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_0111: 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)
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(2452258268u, val2, val, (SendTo)2, (RpcDelivery)0);
BytePacker.WriteValueBitPacked(val3, playerId);
((Fast