using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using AbandonedCompanyAssets.NetcodePatcher;
using AbandonedCompanyAssets.itemStuff;
using BepInEx;
using BepInEx.Logging;
using GameNetcodeStuff;
using LethalLib.Modules;
using Microsoft.CodeAnalysis;
using Unity.Netcode;
using UnityEngine;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: IgnoresAccessChecksTo("")]
[assembly: AssemblyCompany("AbandonedCompanyAssets")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyDescription("Find abandoned company assets.")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("AbandonedCompanyAssets")]
[assembly: AssemblyTitle("AbandonedCompanyAssets")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
[module: NetcodePatchedAssembly]
internal class <Module>
{
static <Module>()
{
}
}
namespace Microsoft.CodeAnalysis
{
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
internal sealed class EmbeddedAttribute : Attribute
{
}
}
namespace System.Runtime.CompilerServices
{
[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;
}
}
}
namespace AbandonedCompanyAssets
{
public static class Configs
{
public static bool spawnEquipmentInFacility = true;
public static int maxEquipmentSpawns = 8;
public static int minEquipmentSpawns = 2;
}
public static class assetCall
{
private static string assetFile = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "abandonedcompanypropertyitems");
public static AssetBundle bundle = AssetBundle.LoadFromFile(assetFile);
}
[BepInPlugin("AbandonedCompanyAssets", "AbandonedCompanyAssets", "1.0.0")]
public class Plugin : BaseUnityPlugin
{
private enum spawnRate
{
Legendary = 5,
Epic = 10,
Rare = 20,
Uncommon = 30,
Common = 40,
Extremely_Common = 50,
Too_Common = 75,
Cheating = 1000,
NonSpawning = 0
}
internal static ManualLogSource ACALog;
public static Item candle = assetCall.bundle.LoadAsset<Item>("Assets/Items/candle/candleItem.asset");
public static Item glowstick = assetCall.bundle.LoadAsset<Item>("Assets/Items/glowstick/glowstickItem.asset");
public static Item GlowstickDroppedItem = assetCall.bundle.LoadAsset<Item>("Assets/Items/glowstick/glowstickItem(Dropped).asset");
public static Item lighter = assetCall.bundle.LoadAsset<Item>("Assets/Items/lighter/Lighter.asset");
public static Item bulletLighter = assetCall.bundle.LoadAsset<Item>("Assets/Items/bulletLighter/bulletLighter.asset");
public static GameObject webBurnParticles = assetCall.bundle.LoadAsset<GameObject>("Assets/Items/lighter/webFire.prefab");
public static Item signalFlareItem = assetCall.bundle.LoadAsset<Item>("Assets/Items/emergencyFlare/signalFlareItem.asset");
public static GameObject signalFlareParticles = assetCall.bundle.LoadAsset<GameObject>("Assets/Items/emergencyFlare/signalFlare (1) 1.prefab");
public static Plugin instance;
public void Awake()
{
instance = this;
ACALog = ((BaseUnityPlugin)this).Logger;
Type[] types = Assembly.GetExecutingAssembly().GetTypes();
for (int i = 0; i < types.Length; i++)
{
MethodInfo[] methods = types[i].GetMethods(BindingFlags.Instance | BindingFlags.Static | BindingFlags.NonPublic);
foreach (MethodInfo methodInfo in methods)
{
if (methodInfo.GetCustomAttributes(typeof(RuntimeInitializeOnLoadMethodAttribute), inherit: false).Length != 0)
{
methodInfo.Invoke(null, null);
}
}
}
NetworkPrefabs.RegisterNetworkPrefab(candle.spawnPrefab);
NetworkPrefabs.RegisterNetworkPrefab(glowstick.spawnPrefab);
NetworkPrefabs.RegisterNetworkPrefab(GlowstickDroppedItem.spawnPrefab);
NetworkPrefabs.RegisterNetworkPrefab(lighter.spawnPrefab);
NetworkPrefabs.RegisterNetworkPrefab(webBurnParticles);
NetworkPrefabs.RegisterNetworkPrefab(bulletLighter.spawnPrefab);
NetworkPrefabs.RegisterNetworkPrefab(signalFlareItem.spawnPrefab);
NetworkPrefabs.RegisterNetworkPrefab(signalFlareParticles);
Utilities.FixMixerGroups(candle.spawnPrefab);
Utilities.FixMixerGroups(GlowstickDroppedItem.spawnPrefab);
Utilities.FixMixerGroups(glowstick.spawnPrefab);
Utilities.FixMixerGroups(lighter.spawnPrefab);
Utilities.FixMixerGroups(bulletLighter.spawnPrefab);
Utilities.FixMixerGroups(bulletLighter.spawnPrefab);
Utilities.FixMixerGroups(signalFlareItem.spawnPrefab);
Utilities.FixMixerGroups(webBurnParticles);
Utilities.FixMixerGroups(signalFlareParticles);
Items.RegisterScrap(GlowstickDroppedItem, 5, (LevelTypes)(-1));
Items.RegisterScrap(candle, 10, (LevelTypes)(-1));
Items.RegisterScrap(lighter, 20, (LevelTypes)(-1));
Items.RegisterScrap(bulletLighter, 2, (LevelTypes)(-1));
lighter.toolTips = new string[1] { "Light Flip Lighter : [LMB]" };
bulletLighter.toolTips = new string[1] { "Light Bullet Lighter : [LMB]" };
candle.toolTips = new string[1] { "Use item : [LMB]" };
glowstick.toolTips = new string[1] { "Drop Glowstick : [LMB]" };
CandleStuff.minFail = 1;
CandleStuff.maxFail = 4;
TerminalNode val = ScriptableObject.CreateInstance<TerminalNode>();
val.clearPreviousText = true;
val.displayText = "The Candle. A cheap but extremely unreliable method of lighting your way. The Company is not responsible for any fires.\n\n";
Items.RegisterShopItem(candle, (TerminalNode)null, (TerminalNode)null, val, 7);
Items.RegisterShopItem(glowstick, 20);
Items.RegisterShopItem(signalFlareItem, 100);
((BaseUnityPlugin)this).Logger.LogInfo((object)"Plugin AbandonedCompanyAssets is loaded!");
}
}
public static class PluginInfo
{
public const string PLUGIN_GUID = "AbandonedCompanyAssets";
public const string PLUGIN_NAME = "AbandonedCompanyAssets";
public const string PLUGIN_VERSION = "1.0.0";
}
}
namespace AbandonedCompanyAssets.itemStuff
{
internal class AbandonedFlashlightStuff
{
}
internal class CandleStuff : GrabbableObject
{
private ParticleSystem particles;
private Light lighting;
private AudioSource audioSource;
private PlayerControllerB player;
public AudioClip flame;
public AudioClip lightFlame;
public AudioClip blowFlame;
public PlayerControllerB currentPlayer;
private int failNumber = Random.Range(minFail, maxFail);
private int failCount;
private int totalFailCount;
public static int minFail;
public static int maxFail;
private bool currentlyLit;
public float defaultLightIntensity;
public float defaultLightRange;
public float randomFailTimeMax;
private float randomFailTime;
public override void Start()
{
((GrabbableObject)this).Start();
failNumber = Random.Range(minFail, maxFail);
particles = ((Component)this).GetComponentInChildren<ParticleSystem>();
lighting = ((Component)this).GetComponentInChildren<Light>();
audioSource = ((Component)this).GetComponentInChildren<AudioSource>();
particles.Stop();
particles.Clear();
if ((Object)(object)particles == (Object)null)
{
Plugin.ACALog.LogDebug((object)"WHERE THE FUCK ARE MY PARTICLES");
}
if ((Object)(object)lighting == (Object)null)
{
Plugin.ACALog.LogDebug((object)"WHERE THE FUCK ARE MY PARTICLES");
}
}
public override int GetItemDataToSave()
{
((GrabbableObject)this).GetItemDataToSave();
short num = (short)failNumber;
short num2 = (short)totalFailCount;
return (num << 16) | (num2 & 0xFFFF);
}
public override void LoadItemSaveData(int saveData)
{
((GrabbableObject)this).LoadItemSaveData(saveData);
short num = (short)(saveData >> 16);
short num2 = (short)(saveData & 0xFFFF);
failNumber = num;
totalFailCount = num2;
saveData = 0;
}
public override void Update()
{
//IL_0010: Unknown result type (might be due to invalid IL or missing references)
//IL_0016: Invalid comparison between Unknown and I4
//IL_0022: Unknown result type (might be due to invalid IL or missing references)
//IL_0028: Invalid comparison between Unknown and I4
((GrabbableObject)this).Update();
if (((int)RoundManager.Instance.currentLevel.currentWeather == 1 || (int)RoundManager.Instance.currentLevel.currentWeather == 4 || GameNetworkManager.Instance.localPlayerController.isUnderwater) && !GameNetworkManager.Instance.localPlayerController.isInsideFactory && !GameNetworkManager.Instance.localPlayerController.isInHangarShipRoom && currentlyLit)
{
totalFailCount++;
lightCandle(grabbing: false, freshCandle: false);
}
if (currentlyLit)
{
if (randomFailTimeMax == 0f && totalFailCount < failNumber)
{
randomFailTimeMax = Random.Range(90f, 220f);
}
else if (totalFailCount < failNumber)
{
randomFailTime += Time.deltaTime;
}
if (randomFailTime > randomFailTimeMax)
{
if (Random.Range(0, 100) > 60)
{
particles.Stop();
particles.Clear();
candleStart(startCandle: false);
lightCandle(grabbing: false, freshCandle: false);
randomFailTime = 0f;
}
else
{
randomFailTime /= 2f;
}
}
}
if (currentlyLit)
{
if (lighting.range < defaultLightRange)
{
Light obj = lighting;
obj.range += Time.deltaTime * 3f;
}
}
else if (lighting.range > 0f)
{
Light obj2 = lighting;
obj2.range -= Time.deltaTime * 10f;
}
}
public override void DiscardItem()
{
((GrabbableObject)this).DiscardItem();
if (currentlyLit)
{
particles.Play();
candleStart(startCandle: true);
}
else
{
particles.Stop();
particles.Clear();
candleStart(startCandle: false);
}
}
public override void PocketItem()
{
((GrabbableObject)this).PocketItem();
if (currentlyLit)
{
audioSource.pitch = Random.Range(0.9f, 1.1f);
audioSource.PlayOneShot(blowFlame);
particles.Stop();
particles.Clear();
candleStart(startCandle: false);
lightCandle(grabbing: false, freshCandle: false);
}
}
public override void ItemActivate(bool used, bool buttonDown = true)
{
//IL_0012: Unknown result type (might be due to invalid IL or missing references)
//IL_0018: Invalid comparison between Unknown and I4
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_002a: Invalid comparison between Unknown and I4
//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
//IL_00b0: Invalid comparison between Unknown and I4
((GrabbableObject)this).ItemActivate(used, buttonDown);
if ((int)RoundManager.Instance.currentLevel.currentWeather == 1 || (int)RoundManager.Instance.currentLevel.currentWeather == 4)
{
if (!GameNetworkManager.Instance.localPlayerController.isInsideFactory && !GameNetworkManager.Instance.localPlayerController.isInHangarShipRoom)
{
totalFailCount++;
audioSource.pitch = Random.Range(0.4f, 0.6f);
audioSource.PlayOneShot(blowFlame);
}
else
{
lightCandle(grabbing: false, freshCandle: false);
}
}
Plugin.ACALog.LogInfo((object)"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA");
if ((int)RoundManager.Instance.currentLevel.currentWeather != 1)
{
lightCandle(grabbing: false, freshCandle: false);
}
}
private void candleStart(bool startCandle)
{
if (startCandle)
{
audioSource.clip = flame;
audioSource.pitch = Random.Range(0.9f, 1.1f);
audioSource.loop = true;
audioSource.Play();
}
else
{
audioSource.Stop();
}
}
public void lightCandle(bool grabbing, bool freshCandle)
{
currentPlayer = GameNetworkManager.Instance.localPlayerController;
int num = (int)currentPlayer.insanityLevel / 2;
int num2 = Random.Range(1, 100);
int num3 = Random.Range(1, 100 - num);
if (currentPlayer.insanityLevel >= 15f && (double)num2 >= (double)num3 * 3.5 && !grabbing && !currentlyLit && totalFailCount < failNumber && !freshCandle)
{
failCount++;
totalFailCount++;
particles.Stop();
particles.Clear();
candleStart(startCandle: false);
audioSource.pitch = Random.Range(0.4f, 0.6f);
audioSource.PlayOneShot(blowFlame);
candleIsLitServerRpc(lit: false, deadCandle: false);
}
else if (!currentlyLit && totalFailCount < failNumber && !freshCandle)
{
particles.Play();
candleStart(startCandle: true);
audioSource.pitch = Random.Range(0.9f, 1.1f);
audioSource.PlayOneShot(lightFlame);
failCount = 0;
candleIsLitServerRpc(lit: true, deadCandle: false);
}
else if (totalFailCount < failNumber)
{
particles.Stop();
candleStart(startCandle: false);
audioSource.pitch = Random.Range(0.9f, 1.1f);
audioSource.PlayOneShot(blowFlame);
candleIsLitServerRpc(lit: false, deadCandle: false);
}
else
{
particles.Stop();
candleStart(startCandle: false);
candleIsLitServerRpc(lit: false, deadCandle: true);
}
}
[ServerRpc]
private void candleIsLitServerRpc(bool lit, bool deadCandle)
{
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: Invalid comparison between Unknown and I4
//IL_0108: Unknown result type (might be due to invalid IL or missing references)
//IL_0112: Invalid comparison between Unknown and I4
//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
//IL_00c3: Unknown result type (might be due to invalid IL or missing references)
//IL_00c9: Unknown result type (might be due to invalid IL or missing references)
//IL_00de: Unknown result type (might be due to invalid IL or missing references)
//IL_00e4: Unknown result type (might be due to invalid IL or missing references)
//IL_00f8: 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_0084: Invalid comparison between Unknown and I4
NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
if (networkManager == null || !networkManager.IsListening)
{
return;
}
if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
{
if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId)
{
if ((int)networkManager.LogLevel <= 1)
{
Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!");
}
return;
}
ServerRpcParams val = default(ServerRpcParams);
FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2351022155u, val, (RpcDelivery)0);
((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref lit, default(ForPrimitives));
((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref deadCandle, default(ForPrimitives));
((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2351022155u, val, (RpcDelivery)0);
}
if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
{
candleIsLitClientRpc(lit, !deadCandle);
if (deadCandle)
{
candleIsLitClientRpc(lit: false, deadCandle: true);
}
}
}
[ClientRpc]
private void candleIsLitClientRpc(bool lit, bool deadCandle)
{
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: Invalid comparison between Unknown and I4
//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
//IL_00cc: Invalid comparison between Unknown and I4
//IL_005f: 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_006d: Unknown result type (might be due to invalid IL or missing references)
//IL_007d: 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_0098: Unknown result type (might be due to invalid IL or missing references)
//IL_009e: Unknown result type (might be due to invalid IL or missing references)
//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
if (networkManager == null || !networkManager.IsListening)
{
return;
}
if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
{
ClientRpcParams val = default(ClientRpcParams);
FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(207752887u, val, (RpcDelivery)0);
((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref lit, default(ForPrimitives));
((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref deadCandle, default(ForPrimitives));
((NetworkBehaviour)this).__endSendClientRpc(ref val2, 207752887u, val, (RpcDelivery)0);
}
if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
{
if (lit)
{
currentlyLit = true;
}
else
{
currentlyLit = false;
}
}
}
protected override void __initializeVariables()
{
((GrabbableObject)this).__initializeVariables();
}
[RuntimeInitializeOnLoadMethod]
internal static void InitializeRPCS_CandleStuff()
{
//IL_0011: Unknown result type (might be due to invalid IL or missing references)
//IL_001b: Expected O, but got Unknown
//IL_002c: Unknown result type (might be due to invalid IL or missing references)
//IL_0036: Expected O, but got Unknown
NetworkManager.__rpc_func_table.Add(2351022155u, new RpcReceiveHandler(__rpc_handler_2351022155));
NetworkManager.__rpc_func_table.Add(207752887u, new RpcReceiveHandler(__rpc_handler_207752887));
}
private static void __rpc_handler_2351022155(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
{
//IL_0023: Unknown result type (might be due to invalid IL or missing references)
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_0029: Unknown result type (might be due to invalid IL or missing references)
//IL_007c: 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_0097: 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_00ac: Unknown result type (might be due to invalid IL or missing references)
//IL_00ca: Unknown result type (might be due to invalid IL or missing references)
//IL_004b: Unknown result type (might be due to invalid IL or missing references)
//IL_0055: Invalid comparison between Unknown and I4
NetworkManager networkManager = target.NetworkManager;
if (networkManager == null || !networkManager.IsListening)
{
return;
}
if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId)
{
if ((int)networkManager.LogLevel <= 1)
{
Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!");
}
}
else
{
bool lit = default(bool);
((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref lit, default(ForPrimitives));
bool deadCandle = default(bool);
((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref deadCandle, default(ForPrimitives));
target.__rpc_exec_stage = (__RpcExecStage)1;
((CandleStuff)(object)target).candleIsLitServerRpc(lit, deadCandle);
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
private static void __rpc_handler_207752887(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
{
//IL_002f: Unknown result type (might be due to invalid IL or missing references)
//IL_0035: Unknown result type (might be due to invalid IL or missing references)
//IL_004a: Unknown result type (might be due to invalid IL or missing references)
//IL_0050: 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_007d: Unknown result type (might be due to invalid IL or missing references)
NetworkManager networkManager = target.NetworkManager;
if (networkManager != null && networkManager.IsListening)
{
bool lit = default(bool);
((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref lit, default(ForPrimitives));
bool deadCandle = default(bool);
((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref deadCandle, default(ForPrimitives));
target.__rpc_exec_stage = (__RpcExecStage)2;
((CandleStuff)(object)target).candleIsLitClientRpc(lit, deadCandle);
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
[MethodImpl(MethodImplOptions.NoInlining)]
protected internal override string __getTypeName()
{
return "CandleStuff";
}
}
internal class GlowstickStuff : GrabbableObject
{
public PlayerControllerB currentPlayer;
private int currentState;
public Light lighting;
public AudioClip glowstickSnap;
public bool droppedStick;
public override void Start()
{
((GrabbableObject)this).Start();
((Component)this).GetComponentInChildren<GrabbableObject>().insertedBattery.charge = 560f;
lighting = ((Component)this).GetComponentInChildren<Light>();
Plugin.ACALog.LogInfo((object)"STARTASTATASETASTASTDGA,");
((GrabbableObject)this).EnablePhysics(true);
((GrabbableObject)this).EnableItemMeshes(true);
}
public override void Update()
{
((GrabbableObject)this).Update();
if (droppedStick)
{
Battery insertedBattery = ((Component)this).GetComponentInChildren<GrabbableObject>().insertedBattery;
insertedBattery.charge -= Time.deltaTime % 60f;
if (((Component)this).GetComponentInChildren<GrabbableObject>().insertedBattery.charge < 3f)
{
glowstickDieServerRpc();
if ((double)lighting.range > 0.05)
{
((Collider)((Component)this).GetComponentInChildren<BoxCollider>()).enabled = false;
}
}
}
if (!RoundManager.Instance.begunSpawningEnemies && droppedStick && ((Component)this).gameObject.GetComponentInChildren<NetworkObject>().IsOwner)
{
deleteSticksServerRpc();
}
}
public override void PocketItem()
{
((GrabbableObject)this).PocketItem();
isGlowstickLitServerRpc(lit: false);
}
public override void EquipItem()
{
((GrabbableObject)this).EquipItem();
isGlowstickLitServerRpc(lit: true);
}
public override int GetItemDataToSave()
{
((GrabbableObject)this).GetItemDataToSave();
Plugin.ACALog.LogInfo((object)("Save Data:" + currentState));
return currentState;
}
public override void LoadItemSaveData(int saveData)
{
((GrabbableObject)this).LoadItemSaveData(saveData);
currentState = saveData;
Plugin.ACALog.LogInfo((object)("Load Data:" + saveData));
for (int i = 0; i < currentState; i++)
{
((Component)((Component)this).gameObject.transform.GetChild(i)).gameObject.SetActive(false);
}
}
public override void ItemActivate(bool used, bool buttonDown = true)
{
//IL_007c: Unknown result type (might be due to invalid IL or missing references)
//IL_0090: Unknown result type (might be due to invalid IL or missing references)
((GrabbableObject)this).ItemActivate(used, buttonDown);
Plugin.ACALog.LogInfo((object)currentState);
Plugin.ACALog.LogInfo((object)Plugin.GlowstickDroppedItem.spawnPrefab.gameObject);
Plugin.ACALog.LogInfo((object)((NetworkBehaviour)this).OwnerClientId);
currentState++;
Plugin.ACALog.LogInfo((object)"AGAGAGDSAGHFASHPOKAGMDAOFPIGJKMPADF0OGL,");
if (!droppedStick)
{
GlowstickSpawnServerRpc(((Component)this).gameObject.transform.position, ((Component)GameNetworkManager.Instance.localPlayerController).transform.rotation);
}
}
[ServerRpc]
private void deleteSticksServerRpc()
{
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: Invalid comparison between Unknown and I4
//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
//IL_00dc: Invalid comparison between Unknown and I4
//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
//IL_00c2: 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_0084: Invalid comparison between Unknown and I4
NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
if (networkManager == null || !networkManager.IsListening)
{
return;
}
if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
{
if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId)
{
if ((int)networkManager.LogLevel <= 1)
{
Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!");
}
return;
}
ServerRpcParams val = default(ServerRpcParams);
FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(734536924u, val, (RpcDelivery)0);
((NetworkBehaviour)this).__endSendServerRpc(ref val2, 734536924u, val, (RpcDelivery)0);
}
if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
{
((Component)this).gameObject.GetComponent<NetworkObject>().ChangeOwnership(((NetworkBehaviour)this).OwnerClientId);
deleteClientRpc();
}
}
[ClientRpc]
private void deleteClientRpc()
{
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: Invalid comparison between Unknown and I4
//IL_008c: Unknown result type (might be due to invalid IL or missing references)
//IL_0096: Invalid comparison between Unknown and I4
//IL_005f: 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_006d: Unknown result type (might be due to invalid IL or missing references)
//IL_007c: 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 != 2 && (networkManager.IsServer || networkManager.IsHost))
{
ClientRpcParams val = default(ClientRpcParams);
FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3677327553u, val, (RpcDelivery)0);
((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3677327553u, val, (RpcDelivery)0);
}
if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost) && ((Component)this).gameObject.GetComponentInChildren<NetworkObject>().IsOwner)
{
Object.Destroy((Object)(object)((Component)this).gameObject);
}
}
}
[ServerRpc]
private void GlowstickSpawnServerRpc(Vector3 position, Quaternion rotation)
{
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: Invalid comparison between Unknown and I4
//IL_00ec: Unknown result type (might be due to invalid IL or missing references)
//IL_00f6: Invalid comparison between Unknown and I4
//IL_0130: Unknown result type (might be due to invalid IL or missing references)
//IL_0131: Unknown result type (might be due to invalid IL or missing references)
//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
//IL_00dc: 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_0084: Invalid comparison between Unknown and I4
NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
if (networkManager == null || !networkManager.IsListening)
{
return;
}
if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
{
if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId)
{
if ((int)networkManager.LogLevel <= 1)
{
Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!");
}
return;
}
ServerRpcParams val = default(ServerRpcParams);
FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(1423229295u, val, (RpcDelivery)0);
((FastBufferWriter)(ref val2)).WriteValueSafe(ref position);
((FastBufferWriter)(ref val2)).WriteValueSafe(ref rotation);
((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1423229295u, val, (RpcDelivery)0);
}
if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
{
GlowstickStackClientRpc();
GameObject val3 = Object.Instantiate<GameObject>(Plugin.GlowstickDroppedItem.spawnPrefab.gameObject, position, rotation, StartOfRound.Instance.propsContainer);
val3.GetComponent<NetworkObject>().SpawnWithOwnership(((NetworkBehaviour)this).OwnerClientId, false);
if (currentState < 3)
{
val3.GetComponent<NetworkObject>().ChangeOwnership(((NetworkBehaviour)this).OwnerClientId);
val3.GetComponentInChildren<AudioSource>().pitch = Random.Range(0.9f, 1.1f);
val3.GetComponentInChildren<AudioSource>().PlayOneShot(glowstickSnap);
val3.GetComponentInChildren<GrabbableObject>().grabbable = false;
}
}
}
[ServerRpc]
private void isGlowstickLitServerRpc(bool lit)
{
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: Invalid comparison between Unknown and I4
//IL_00ed: Unknown result type (might be due to invalid IL or missing references)
//IL_00f7: Invalid comparison between Unknown and I4
//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
//IL_00c3: Unknown result type (might be due to invalid IL or missing references)
//IL_00c9: Unknown result type (might be due to invalid IL or missing references)
//IL_00dd: 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_0084: Invalid comparison between Unknown and I4
NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
if (networkManager == null || !networkManager.IsListening)
{
return;
}
if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
{
if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId)
{
if ((int)networkManager.LogLevel <= 1)
{
Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!");
}
return;
}
ServerRpcParams val = default(ServerRpcParams);
FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(1054161706u, val, (RpcDelivery)0);
((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref lit, default(ForPrimitives));
((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1054161706u, val, (RpcDelivery)0);
}
if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
{
isGlowstickLitClientRpc(lit);
}
}
[ClientRpc]
private void isGlowstickLitClientRpc(bool lit)
{
//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_005f: 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_006d: Unknown result type (might be due to invalid IL or missing references)
//IL_007d: 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_0097: 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 != 2 && (networkManager.IsServer || networkManager.IsHost))
{
ClientRpcParams val = default(ClientRpcParams);
FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(402954236u, val, (RpcDelivery)0);
((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref lit, default(ForPrimitives));
((NetworkBehaviour)this).__endSendClientRpc(ref val2, 402954236u, val, (RpcDelivery)0);
}
if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
{
if (lit)
{
((Behaviour)lighting).enabled = true;
}
else
{
((Behaviour)lighting).enabled = false;
}
}
}
[ServerRpc]
private void glowstickDieServerRpc()
{
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: Invalid comparison between Unknown and I4
//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
//IL_00dc: Invalid comparison between Unknown and I4
//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
//IL_00c2: 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_0084: Invalid comparison between Unknown and I4
NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
if (networkManager == null || !networkManager.IsListening)
{
return;
}
if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
{
if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId)
{
if ((int)networkManager.LogLevel <= 1)
{
Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!");
}
return;
}
ServerRpcParams val = default(ServerRpcParams);
FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3923035235u, val, (RpcDelivery)0);
((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3923035235u, val, (RpcDelivery)0);
}
if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
{
glowstickDieClientRpc();
}
}
[ClientRpc]
private void glowstickDieClientRpc()
{
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: Invalid comparison between Unknown and I4
//IL_008c: Unknown result type (might be due to invalid IL or missing references)
//IL_0096: Invalid comparison between Unknown and I4
//IL_005f: 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_006d: Unknown result type (might be due to invalid IL or missing references)
//IL_007c: 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 != 2 && (networkManager.IsServer || networkManager.IsHost))
{
ClientRpcParams val = default(ClientRpcParams);
FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2386388057u, val, (RpcDelivery)0);
((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2386388057u, val, (RpcDelivery)0);
}
if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
{
Light obj = lighting;
obj.intensity -= Time.deltaTime * 3f;
Light obj2 = lighting;
obj2.range -= Time.deltaTime * 3f;
}
}
}
[ClientRpc]
private void GlowstickStackClientRpc()
{
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: Invalid comparison between Unknown and I4
//IL_008c: Unknown result type (might be due to invalid IL or missing references)
//IL_0096: Invalid comparison between Unknown and I4
//IL_005f: 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_006d: Unknown result type (might be due to invalid IL or missing references)
//IL_007c: 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 != 2 && (networkManager.IsServer || networkManager.IsHost))
{
ClientRpcParams val = default(ClientRpcParams);
FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(211096720u, val, (RpcDelivery)0);
((NetworkBehaviour)this).__endSendClientRpc(ref val2, 211096720u, val, (RpcDelivery)0);
}
if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
{
((Component)((Component)this).gameObject.transform.GetChild(currentState)).gameObject.SetActive(false);
if (currentState == 3)
{
base.playerHeldBy.DestroyItemInSlotAndSync(base.playerHeldBy.currentItemSlot);
}
}
}
protected override void __initializeVariables()
{
((GrabbableObject)this).__initializeVariables();
}
[RuntimeInitializeOnLoadMethod]
internal static void InitializeRPCS_GlowstickStuff()
{
//IL_0011: Unknown result type (might be due to invalid IL or missing references)
//IL_001b: Expected O, but got Unknown
//IL_002c: Unknown result type (might be due to invalid IL or missing references)
//IL_0036: Expected O, but got Unknown
//IL_0047: Unknown result type (might be due to invalid IL or missing references)
//IL_0051: Expected O, but got Unknown
//IL_0062: Unknown result type (might be due to invalid IL or missing references)
//IL_006c: Expected O, but got Unknown
//IL_007d: Unknown result type (might be due to invalid IL or missing references)
//IL_0087: Expected O, but got Unknown
//IL_0098: Unknown result type (might be due to invalid IL or missing references)
//IL_00a2: Expected O, but got Unknown
//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
//IL_00bd: Expected O, but got Unknown
//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
//IL_00d8: Expected O, but got Unknown
NetworkManager.__rpc_func_table.Add(734536924u, new RpcReceiveHandler(__rpc_handler_734536924));
NetworkManager.__rpc_func_table.Add(3677327553u, new RpcReceiveHandler(__rpc_handler_3677327553));
NetworkManager.__rpc_func_table.Add(1423229295u, new RpcReceiveHandler(__rpc_handler_1423229295));
NetworkManager.__rpc_func_table.Add(1054161706u, new RpcReceiveHandler(__rpc_handler_1054161706));
NetworkManager.__rpc_func_table.Add(402954236u, new RpcReceiveHandler(__rpc_handler_402954236));
NetworkManager.__rpc_func_table.Add(3923035235u, new RpcReceiveHandler(__rpc_handler_3923035235));
NetworkManager.__rpc_func_table.Add(2386388057u, new RpcReceiveHandler(__rpc_handler_2386388057));
NetworkManager.__rpc_func_table.Add(211096720u, new RpcReceiveHandler(__rpc_handler_211096720));
}
private static void __rpc_handler_734536924(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
{
//IL_0023: Unknown result type (might be due to invalid IL or missing references)
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_0029: 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_008c: 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_0055: Invalid comparison between Unknown and I4
NetworkManager networkManager = target.NetworkManager;
if (networkManager == null || !networkManager.IsListening)
{
return;
}
if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId)
{
if ((int)networkManager.LogLevel <= 1)
{
Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!");
}
}
else
{
target.__rpc_exec_stage = (__RpcExecStage)1;
((GlowstickStuff)(object)target).deleteSticksServerRpc();
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
private static void __rpc_handler_3677327553(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
{
//IL_0029: Unknown result type (might be due to invalid IL or missing references)
//IL_003f: Unknown result type (might be due to invalid IL or missing references)
NetworkManager networkManager = target.NetworkManager;
if (networkManager != null && networkManager.IsListening)
{
target.__rpc_exec_stage = (__RpcExecStage)2;
((GlowstickStuff)(object)target).deleteClientRpc();
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
private static void __rpc_handler_1423229295(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
{
//IL_0023: Unknown result type (might be due to invalid IL or missing references)
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_0029: Unknown result type (might be due to invalid IL or missing references)
//IL_0090: Unknown result type (might be due to invalid IL or missing references)
//IL_009b: Unknown result type (might be due to invalid IL or missing references)
//IL_009f: Unknown result type (might be due to invalid IL or missing references)
//IL_00ae: 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_0055: Invalid comparison between Unknown and I4
NetworkManager networkManager = target.NetworkManager;
if (networkManager == null || !networkManager.IsListening)
{
return;
}
if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId)
{
if ((int)networkManager.LogLevel <= 1)
{
Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!");
}
}
else
{
Vector3 position = default(Vector3);
((FastBufferReader)(ref reader)).ReadValueSafe(ref position);
Quaternion rotation = default(Quaternion);
((FastBufferReader)(ref reader)).ReadValueSafe(ref rotation);
target.__rpc_exec_stage = (__RpcExecStage)1;
((GlowstickStuff)(object)target).GlowstickSpawnServerRpc(position, rotation);
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
private static void __rpc_handler_1054161706(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
{
//IL_0023: Unknown result type (might be due to invalid IL or missing references)
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_0029: Unknown result type (might be due to invalid IL or missing references)
//IL_007c: 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_0091: Unknown result type (might be due to invalid IL or missing references)
//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
//IL_004b: Unknown result type (might be due to invalid IL or missing references)
//IL_0055: Invalid comparison between Unknown and I4
NetworkManager networkManager = target.NetworkManager;
if (networkManager == null || !networkManager.IsListening)
{
return;
}
if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId)
{
if ((int)networkManager.LogLevel <= 1)
{
Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!");
}
}
else
{
bool lit = default(bool);
((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref lit, default(ForPrimitives));
target.__rpc_exec_stage = (__RpcExecStage)1;
((GlowstickStuff)(object)target).isGlowstickLitServerRpc(lit);
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
private static void __rpc_handler_402954236(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
{
//IL_002f: Unknown result type (might be due to invalid IL or missing references)
//IL_0035: Unknown result type (might be due to invalid IL or missing references)
//IL_0044: Unknown result type (might be due to invalid IL or missing references)
//IL_005e: Unknown result type (might be due to invalid IL or missing references)
NetworkManager networkManager = target.NetworkManager;
if (networkManager != null && networkManager.IsListening)
{
bool lit = default(bool);
((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref lit, default(ForPrimitives));
target.__rpc_exec_stage = (__RpcExecStage)2;
((GlowstickStuff)(object)target).isGlowstickLitClientRpc(lit);
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
private static void __rpc_handler_3923035235(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
{
//IL_0023: Unknown result type (might be due to invalid IL or missing references)
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_0029: 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_008c: 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_0055: Invalid comparison between Unknown and I4
NetworkManager networkManager = target.NetworkManager;
if (networkManager == null || !networkManager.IsListening)
{
return;
}
if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId)
{
if ((int)networkManager.LogLevel <= 1)
{
Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!");
}
}
else
{
target.__rpc_exec_stage = (__RpcExecStage)1;
((GlowstickStuff)(object)target).glowstickDieServerRpc();
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
private static void __rpc_handler_2386388057(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
{
//IL_0029: Unknown result type (might be due to invalid IL or missing references)
//IL_003f: Unknown result type (might be due to invalid IL or missing references)
NetworkManager networkManager = target.NetworkManager;
if (networkManager != null && networkManager.IsListening)
{
target.__rpc_exec_stage = (__RpcExecStage)2;
((GlowstickStuff)(object)target).glowstickDieClientRpc();
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
private static void __rpc_handler_211096720(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
{
//IL_0029: Unknown result type (might be due to invalid IL or missing references)
//IL_003f: Unknown result type (might be due to invalid IL or missing references)
NetworkManager networkManager = target.NetworkManager;
if (networkManager != null && networkManager.IsListening)
{
target.__rpc_exec_stage = (__RpcExecStage)2;
((GlowstickStuff)(object)target).GlowstickStackClientRpc();
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
[MethodImpl(MethodImplOptions.NoInlining)]
protected internal override string __getTypeName()
{
return "GlowstickStuff";
}
}
internal class lighterStuff : GrabbableObject
{
private Light lighting;
private ParticleSystem flame;
private AudioSource audiosource;
public AudioClip lighterflick;
public AudioClip burningflame;
public AudioClip lighterclose;
public float fuel;
private int currentstate;
private float timerdelay;
private bool lighterlit;
private float savedfuel;
private bool lighterdead;
private bool pocketingitem;
public bool usesfueltowebburn;
public bool getsextrafuel;
public override void LoadItemSaveData(int saveData)
{
((GrabbableObject)this).LoadItemSaveData(saveData);
Plugin.ACALog.LogInfo((object)("Load Data:" + saveData));
fuel = saveData;
if (saveData <= 0)
{
lighterdead = true;
}
else if (saveData > 0)
{
savedfuel = saveData;
}
}
public override int GetItemDataToSave()
{
((GrabbableObject)this).GetItemDataToSave();
Plugin.ACALog.LogInfo((object)("Save Data:" + (int)Mathf.Round(fuel)));
return (int)Mathf.Round(fuel);
}
public override void Start()
{
((GrabbableObject)this).Start();
currentstate = 0;
lighting = ((Component)this).GetComponentInChildren<Light>();
flame = ((Component)this).GetComponentInChildren<ParticleSystem>();
audiosource = ((Component)this).GetComponentInChildren<AudioSource>();
((Component)this).GetComponentInChildren<GrabbableObject>().insertedBattery.charge = fuel;
if (savedfuel < 0f)
{
fuel = savedfuel;
}
else if (!lighterdead)
{
if (getsextrafuel)
{
fuel = Random.Range(500, 2000);
}
else
{
fuel = Random.Range(300, 1500);
}
}
lighterServerRpc();
}
public override void ItemActivate(bool used, bool buttonDown = true)
{
((GrabbableObject)this).ItemActivate(used, buttonDown);
if (currentstate == 0)
{
currentstate = 1;
}
else
{
currentstate = 0;
}
timerdelay = 0f;
lighterServerRpc();
Plugin.ACALog.LogInfo((object)currentstate);
}
public override void PocketItem()
{
((GrabbableObject)this).PocketItem();
if (currentstate == 1)
{
pocketingitem = true;
timerdelay = 0f;
currentstate = 0;
lighterlit = false;
lighterServerRpc();
}
}
public override void EquipItem()
{
((GrabbableObject)this).EquipItem();
if (pocketingitem)
{
currentstate = 1;
pocketingitem = false;
lighterServerRpc();
lighterServerRpc();
}
}
public override void Update()
{
//IL_003b: Unknown result type (might be due to invalid IL or missing references)
//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
//IL_0103: Unknown result type (might be due to invalid IL or missing references)
((GrabbableObject)this).Update();
if (GameNetworkManager.Instance.localPlayerController.isUnderwater && !lighterdead)
{
lighterDeadServerRpc();
currentstate = 0;
}
Collider[] array = Physics.OverlapSphere(((Component)GameNetworkManager.Instance.localPlayerController).transform.position, 2f, 2097152);
if (currentstate == 1 && lighterlit && !lighterdead)
{
Collider[] array2 = array;
foreach (Collider val in array2)
{
if (((Object)((Component)val).gameObject).name == "WebContainer")
{
SandSpiderWebTrap component = ((Component)val).gameObject.GetComponent<SandSpiderWebTrap>();
if (((NetworkBehaviour)this).IsHost)
{
component.mainScript.BreakWebClientRpc(((Component)component).transform.position, (int)GameNetworkManager.Instance.localPlayerController.playerClientId);
}
else
{
component.mainScript.BreakWebServerRpc(component.trapID, (int)GameNetworkManager.Instance.localPlayerController.playerClientId);
}
fireSpawnServerRpc(component.centerOfWeb.position);
if (usesfueltowebburn)
{
fuel -= Random.Range(30, 60);
}
}
}
}
if (currentstate == 1 && !pocketingitem)
{
timerdelay += Time.deltaTime;
if (!lighterdead)
{
fuel -= Time.deltaTime;
}
}
if ((double)timerdelay > 0.9 && currentstate == 1)
{
lighterOnServerRpc();
lighterlit = true;
}
if (fuel <= 0f && !lighterdead)
{
currentstate = 0;
lighterDeadServerRpc();
lighterServerRpc();
}
}
[ServerRpc(RequireOwnership = false)]
private void lighterOnServerRpc()
{
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: Invalid comparison between Unknown and I4
//IL_008c: Unknown result type (might be due to invalid IL or missing references)
//IL_0096: Invalid comparison between Unknown and I4
//IL_005f: 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_006d: Unknown result type (might be due to invalid IL or missing references)
//IL_007c: 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 && (networkManager.IsClient || networkManager.IsHost))
{
ServerRpcParams val = default(ServerRpcParams);
FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3191699503u, val, (RpcDelivery)0);
((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3191699503u, val, (RpcDelivery)0);
}
if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
{
lighterOnClientRpc();
}
}
}
[ClientRpc]
private void lighterOnClientRpc()
{
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: Invalid comparison between Unknown and I4
//IL_008c: Unknown result type (might be due to invalid IL or missing references)
//IL_0096: Invalid comparison between Unknown and I4
//IL_005f: 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_006d: Unknown result type (might be due to invalid IL or missing references)
//IL_007c: 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 != 2 && (networkManager.IsServer || networkManager.IsHost))
{
ClientRpcParams val = default(ClientRpcParams);
FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(4039549238u, val, (RpcDelivery)0);
((NetworkBehaviour)this).__endSendClientRpc(ref val2, 4039549238u, val, (RpcDelivery)0);
}
if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost) && fuel > 5f)
{
((Behaviour)lighting).enabled = true;
flame.Play();
timerdelay = 0f;
audiosource.clip = burningflame;
audiosource.pitch = Random.Range(0.9f, 1.1f);
audiosource.loop = true;
audiosource.Play();
}
}
}
[ServerRpc(RequireOwnership = false)]
private void lighterServerRpc()
{
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: Invalid comparison between Unknown and I4
//IL_008c: Unknown result type (might be due to invalid IL or missing references)
//IL_0096: Invalid comparison between Unknown and I4
//IL_005f: 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_006d: Unknown result type (might be due to invalid IL or missing references)
//IL_007c: 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 && (networkManager.IsClient || networkManager.IsHost))
{
ServerRpcParams val = default(ServerRpcParams);
FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2515912864u, val, (RpcDelivery)0);
((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2515912864u, val, (RpcDelivery)0);
}
if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
{
lighterClientRpc();
}
}
}
[ClientRpc]
private void lighterClientRpc()
{
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: Invalid comparison between Unknown and I4
//IL_008c: Unknown result type (might be due to invalid IL or missing references)
//IL_0096: Invalid comparison between Unknown and I4
//IL_005f: 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_006d: Unknown result type (might be due to invalid IL or missing references)
//IL_007c: 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 != 2 && (networkManager.IsServer || networkManager.IsHost))
{
ClientRpcParams val = default(ClientRpcParams);
FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3066410833u, val, (RpcDelivery)0);
((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3066410833u, val, (RpcDelivery)0);
}
if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 || (!networkManager.IsClient && !networkManager.IsHost))
{
return;
}
if (currentstate == 0)
{
if (!pocketingitem)
{
((Component)((Component)this).gameObject.transform.GetChild(1)).gameObject.SetActive(false);
((Component)((Component)this).gameObject.transform.GetChild(0)).gameObject.SetActive(true);
}
flame.Clear();
flame.Stop();
audiosource.Stop();
audiosource.PlayOneShot(lighterclose);
((Behaviour)lighting).enabled = false;
lighterlit = false;
}
else
{
if (!pocketingitem)
{
((Component)((Component)this).gameObject.transform.GetChild(0)).gameObject.SetActive(false);
((Component)((Component)this).gameObject.transform.GetChild(1)).gameObject.SetActive(true);
}
audiosource.PlayOneShot(lighterflick);
}
}
[ServerRpc(RequireOwnership = false)]
private void lighterDeadServerRpc()
{
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: Invalid comparison between Unknown and I4
//IL_008c: Unknown result type (might be due to invalid IL or missing references)
//IL_0096: Invalid comparison between Unknown and I4
//IL_005f: 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_006d: Unknown result type (might be due to invalid IL or missing references)
//IL_007c: 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 && (networkManager.IsClient || networkManager.IsHost))
{
ServerRpcParams val = default(ServerRpcParams);
FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(153992748u, val, (RpcDelivery)0);
((NetworkBehaviour)this).__endSendServerRpc(ref val2, 153992748u, val, (RpcDelivery)0);
}
if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
{
lighterDeadClientRpc();
}
}
}
[ClientRpc]
private void lighterDeadClientRpc()
{
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: Invalid comparison between Unknown and I4
//IL_008c: Unknown result type (might be due to invalid IL or missing references)
//IL_0096: Invalid comparison between Unknown and I4
//IL_005f: 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_006d: Unknown result type (might be due to invalid IL or missing references)
//IL_007c: 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 != 2 && (networkManager.IsServer || networkManager.IsHost))
{
ClientRpcParams val = default(ClientRpcParams);
FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1118566489u, val, (RpcDelivery)0);
((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1118566489u, val, (RpcDelivery)0);
}
if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
{
fuel = 0f;
lighterdead = true;
}
}
}
[ServerRpc(RequireOwnership = false)]
private void fireSpawnServerRpc(Vector3 position)
{
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: Invalid comparison between Unknown and I4
//IL_0099: Unknown result type (might be due to invalid IL or missing references)
//IL_00a3: Invalid comparison between Unknown and I4
//IL_005f: 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_006d: Unknown result type (might be due to invalid IL or missing references)
//IL_0089: Unknown result type (might be due to invalid IL or missing references)
//IL_00c9: 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 && (networkManager.IsClient || networkManager.IsHost))
{
ServerRpcParams val = default(ServerRpcParams);
FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(1276072043u, val, (RpcDelivery)0);
((FastBufferWriter)(ref val2)).WriteValueSafe(ref position);
((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1276072043u, val, (RpcDelivery)0);
}
if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
{
fireSpawnClientRpc(position);
}
}
}
[ClientRpc]
private void fireSpawnClientRpc(Vector3 position)
{
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: Invalid comparison between Unknown and I4
//IL_0099: Unknown result type (might be due to invalid IL or missing references)
//IL_00a3: Invalid comparison between Unknown and I4
//IL_005f: 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_006d: Unknown result type (might be due to invalid IL or missing references)
//IL_0089: Unknown result type (might be due to invalid IL or missing references)
//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
//IL_00d5: Unknown result type (might be due to invalid IL or missing references)
//IL_00db: Unknown result type (might be due to invalid IL or missing references)
NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
if (networkManager != null && networkManager.IsListening)
{
if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
{
ClientRpcParams val = default(ClientRpcParams);
FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(606520659u, val, (RpcDelivery)0);
((FastBufferWriter)(ref val2)).WriteValueSafe(ref position);
((NetworkBehaviour)this).__endSendClientRpc(ref val2, 606520659u, val, (RpcDelivery)0);
}
if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
{
Object.Instantiate<GameObject>(Plugin.webBurnParticles.gameObject, position, default(Quaternion), StartOfRound.Instance.propsContainer);
}
}
}
protected override void __initializeVariables()
{
((GrabbableObject)this).__initializeVariables();
}
[RuntimeInitializeOnLoadMethod]
internal static void InitializeRPCS_lighterStuff()
{
//IL_0011: Unknown result type (might be due to invalid IL or missing references)
//IL_001b: Expected O, but got Unknown
//IL_002c: Unknown result type (might be due to invalid IL or missing references)
//IL_0036: Expected O, but got Unknown
//IL_0047: Unknown result type (might be due to invalid IL or missing references)
//IL_0051: Expected O, but got Unknown
//IL_0062: Unknown result type (might be due to invalid IL or missing references)
//IL_006c: Expected O, but got Unknown
//IL_007d: Unknown result type (might be due to invalid IL or missing references)
//IL_0087: Expected O, but got Unknown
//IL_0098: Unknown result type (might be due to invalid IL or missing references)
//IL_00a2: Expected O, but got Unknown
//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
//IL_00bd: Expected O, but got Unknown
//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
//IL_00d8: Expected O, but got Unknown
NetworkManager.__rpc_func_table.Add(3191699503u, new RpcReceiveHandler(__rpc_handler_3191699503));
NetworkManager.__rpc_func_table.Add(4039549238u, new RpcReceiveHandler(__rpc_handler_4039549238));
NetworkManager.__rpc_func_table.Add(2515912864u, new RpcReceiveHandler(__rpc_handler_2515912864));
NetworkManager.__rpc_func_table.Add(3066410833u, new RpcReceiveHandler(__rpc_handler_3066410833));
NetworkManager.__rpc_func_table.Add(153992748u, new RpcReceiveHandler(__rpc_handler_153992748));
NetworkManager.__rpc_func_table.Add(1118566489u, new RpcReceiveHandler(__rpc_handler_1118566489));
NetworkManager.__rpc_func_table.Add(1276072043u, new RpcReceiveHandler(__rpc_handler_1276072043));
NetworkManager.__rpc_func_table.Add(606520659u, new RpcReceiveHandler(__rpc_handler_606520659));
}
private static void __rpc_handler_3191699503(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
{
//IL_0029: Unknown result type (might be due to invalid IL or missing references)
//IL_003f: Unknown result type (might be due to invalid IL or missing references)
NetworkManager networkManager = target.NetworkManager;
if (networkManager != null && networkManager.IsListening)
{
target.__rpc_exec_stage = (__RpcExecStage)1;
((lighterStuff)(object)target).lighterOnServerRpc();
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
private static void __rpc_handler_4039549238(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
{
//IL_0029: Unknown result type (might be due to invalid IL or missing references)
//IL_003f: Unknown result type (might be due to invalid IL or missing references)
NetworkManager networkManager = target.NetworkManager;
if (networkManager != null && networkManager.IsListening)
{
target.__rpc_exec_stage = (__RpcExecStage)2;
((lighterStuff)(object)target).lighterOnClientRpc();
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
private static void __rpc_handler_2515912864(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
{
//IL_0029: Unknown result type (might be due to invalid IL or missing references)
//IL_003f: Unknown result type (might be due to invalid IL or missing references)
NetworkManager networkManager = target.NetworkManager;
if (networkManager != null && networkManager.IsListening)
{
target.__rpc_exec_stage = (__RpcExecStage)1;
((lighterStuff)(object)target).lighterServerRpc();
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
private static void __rpc_handler_3066410833(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
{
//IL_0029: Unknown result type (might be due to invalid IL or missing references)
//IL_003f: Unknown result type (might be due to invalid IL or missing references)
NetworkManager networkManager = target.NetworkManager;
if (networkManager != null && networkManager.IsListening)
{
target.__rpc_exec_stage = (__RpcExecStage)2;
((lighterStuff)(object)target).lighterClientRpc();
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
private static void __rpc_handler_153992748(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
{
//IL_0029: Unknown result type (might be due to invalid IL or missing references)
//IL_003f: Unknown result type (might be due to invalid IL or missing references)
NetworkManager networkManager = target.NetworkManager;
if (networkManager != null && networkManager.IsListening)
{
target.__rpc_exec_stage = (__RpcExecStage)1;
((lighterStuff)(object)target).lighterDeadServerRpc();
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
private static void __rpc_handler_1118566489(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
{
//IL_0029: Unknown result type (might be due to invalid IL or missing references)
//IL_003f: Unknown result type (might be due to invalid IL or missing references)
NetworkManager networkManager = target.NetworkManager;
if (networkManager != null && networkManager.IsListening)
{
target.__rpc_exec_stage = (__RpcExecStage)2;
((lighterStuff)(object)target).lighterDeadClientRpc();
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
private static void __rpc_handler_1276072043(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
{
//IL_0036: Unknown result type (might be due to invalid IL or missing references)
//IL_0041: Unknown result type (might be due to invalid IL or missing references)
//IL_0050: Unknown result type (might be due to invalid IL or missing references)
NetworkManager networkManager = target.NetworkManager;
if (networkManager != null && networkManager.IsListening)
{
Vector3 position = default(Vector3);
((FastBufferReader)(ref reader)).ReadValueSafe(ref position);
target.__rpc_exec_stage = (__RpcExecStage)1;
((lighterStuff)(object)target).fireSpawnServerRpc(position);
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
private static void __rpc_handler_606520659(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
{
//IL_0036: Unknown result type (might be due to invalid IL or missing references)
//IL_0041: Unknown result type (might be due to invalid IL or missing references)
//IL_0050: Unknown result type (might be due to invalid IL or missing references)
NetworkManager networkManager = target.NetworkManager;
if (networkManager != null && networkManager.IsListening)
{
Vector3 position = default(Vector3);
((FastBufferReader)(ref reader)).ReadValueSafe(ref position);
target.__rpc_exec_stage = (__RpcExecStage)2;
((lighterStuff)(object)target).fireSpawnClientRpc(position);
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
[MethodImpl(MethodImplOptions.NoInlining)]
protected internal override string __getTypeName()
{
return "lighterStuff";
}
}
internal class SignalFlare : GrabbableObject
{
private Vector3 currentplayeposition;
private bool flareused;
private int monsteractivity;
private ParticleSystem particles;
public AudioClip thumpSound;
private AudioSource audiosource;
private bool deletestarted;
private float time;
public override void Start()
{
((GrabbableObject)this).Start();
particles = ((Component)this).GetComponentInChildren<ParticleSystem>();
audiosource = ((Component)this).GetComponent<AudioSource>();
}
public override void Update()
{
((GrabbableObject)this).Update();
if (deletestarted)
{
time += Time.deltaTime;
}
if ((double)time > 0.3)
{
base.playerHeldBy.DestroyItemInSlotAndSync(base.playerHeldBy.currentItemSlot);
}
}
public override void ItemActivate(bool used, bool buttonDown = true)
{
//IL_0050: Unknown result type (might be due to invalid IL or missing references)
//IL_0055: Unknown result type (might be due to invalid IL or missing references)
//IL_0078: Unknown result type (might be due to invalid IL or missing references)
((GrabbableObject)this).ItemActivate(used, buttonDown);
audiosource.PlayOneShot(thumpSound);
if (!GameNetworkManager.Instance.localPlayerController.isInsideFactory & !GameNetworkManager.Instance.localPlayerController.isInHangarShipRoom)
{
currentplayeposition = ((Component)GameNetworkManager.Instance.localPlayerController).transform.position;
currentplayeposition.y += Random.Range(80, 180);
fireFlareServerRpc(currentplayeposition);
flareused = true;
monsteractivity = Random.Range(0, 10);
monsterRoundManagerServerRpc(monsteractivity);
}
}
[ServerRpc]
private void monsterRoundManagerServerRpc(int activity)
{
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: Invalid comparison between Unknown and I4
//IL_00df: Unknown result type (might be due to invalid IL or missing references)
//IL_00e9: Invalid comparison between Unknown and I4
//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
//IL_00b7: Unknown result type (might be due to invalid IL or missing references)
//IL_00cf: 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_0084: Invalid comparison between Unknown and I4
NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
if (networkManager == null || !networkManager.IsListening)
{
return;
}
if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
{
if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId)
{
if ((int)networkManager.LogLevel <= 1)
{
Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!");
}
return;
}
ServerRpcParams val = default(ServerRpcParams);
FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2707969770u, val, (RpcDelivery)0);
BytePacker.WriteValueBitPacked(val2, activity);
((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2707969770u, val, (RpcDelivery)0);
}
if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
{
Plugin.ACALog.LogInfo((object)activity);
switch (activity)
{
case 8:
Plugin.ACALog.LogInfo((object)("Default Power Level: " + RoundManager.Instance.currentLevel.maxOutsideEnemyPowerCount));
RoundManager.Instance.currentLevel.maxEnemyPowerCount = RoundManager.Instance.currentLevel.maxEnemyPowerCount * 5;
RoundManager.Instance.currentLevel.maxDaytimeEnemyPowerCount = RoundManager.Instance.currentLevel.maxDaytimeEnemyPowerCount * 5;
RoundManager.Instance.currentLevel.maxOutsideEnemyPowerCount = RoundManager.Instance.currentLevel.maxOutsideEnemyPowerCount * 5;
Plugin.ACALog.LogInfo((object)("Edited Power Level: " + RoundManager.Instance.currentLevel.maxOutsideEnemyPowerCount));
fireFlareClientRpc(2);
break;
case 3:
case 4:
Plugin.ACALog.LogInfo((object)("Default Power Level: " + RoundManager.Instance.currentLevel.maxOutsideEnemyPowerCount));
RoundManager.Instance.currentLevel.maxEnemyPowerCount = RoundManager.Instance.currentLevel.maxEnemyPowerCount * 2;
RoundManager.Instance.currentLevel.maxDaytimeEnemyPowerCount = RoundManager.Instance.currentLevel.maxDaytimeEnemyPowerCount * 2;
RoundManager.Instance.currentLevel.maxOutsideEnemyPowerCount = RoundManager.Instance.currentLevel.maxOutsideEnemyPowerCount * 2;
Plugin.ACALog.LogInfo((object)("Edited Power Level: " + RoundManager.Instance.currentLevel.maxOutsideEnemyPowerCount));
fireFlareClientRpc(1);
break;
default:
fireFlareClientRpc(0);
break;
}
}
}
[ServerRpc]
private void fireFlareServerRpc(Vector3 position)
{
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: Invalid comparison between Unknown and I4
//IL_00df: Unknown result type (might be due to invalid IL or missing references)
//IL_00e9: Invalid comparison between Unknown and I4
//IL_0118: Unknown result type (might be due to invalid IL or missing references)
//IL_011b: Unknown result type (might be due to invalid IL or missing references)
//IL_0121: Unknown result type (might be due to invalid IL or missing references)
//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
//IL_00cf: 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_0084: Invalid comparison between Unknown and I4
NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
if (networkManager == null || !networkManager.IsListening)
{
return;
}
if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
{
if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId)
{
if ((int)networkManager.LogLevel <= 1)
{
Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!");
}
return;
}
ServerRpcParams val = default(ServerRpcParams);
FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3902926514u, val, (RpcDelivery)0);
((FastBufferWriter)(ref val2)).WriteValueSafe(ref position);
((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3902926514u, val, (RpcDelivery)0);
}
if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
{
Object.Instantiate<GameObject>(Plugin.signalFlareParticles.gameObject, position, default(Quaternion), StartOfRound.Instance.propsContainer).GetComponent<NetworkObject>().SpawnWithOwnership(((NetworkBehaviour)this).OwnerClientId, false);
}
}
[ClientRpc]
private void fireFlareClientRpc(int message)
{
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: Invalid comparison between Unknown and I4
//IL_0099: Unknown result type (might be due to invalid IL or missing references)
//IL_00a3: Invalid comparison between Unknown and I4
//IL_005f: 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_006d: Unknown result type (might be due to invalid IL or missing references)
//IL_0071: Unknown result type (might be due to invalid IL or missing references)
//IL_0089: 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 != 2 && (networkManager.IsServer || networkManager.IsHost))
{
ClientRpcParams val = default(ClientRpcParams);
FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1751827331u, val, (RpcDelivery)0);
BytePacker.WriteValueBitPacked(val2, message);
((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1751827331u, val, (RpcDelivery)0);
}
if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
{
particles.Play();
if (message == 1 && !GameNetworkManager.Instance.localPlayerController.isInsideFactory)
{
HUDManager.Instance.DisplayTip("WARNING!", "Increase in moon activity detected.", true, false, "LC_Tip1");
}
if (message == 2 && !GameNetworkManager.Instance.localPlayerController.isInsideFactory)
{
HUDManager.Instance.DisplayTip("URGENT WARNING!", "MASSIVE INCREASE IN MOON ACTIVITY DETECTED, EVACTUATION ADVISED.", true, false, "LC_Tip1");
}
deletestarted = true;
}
}
protected override void __initializeVariables()
{
((GrabbableObject)this).__initializeVariables();
}
[RuntimeInitializeOnLoadMethod]
internal static void InitializeRPCS_SignalFlare()
{
//IL_0011: Unknown result type (might be due to invalid IL or missing references)
//IL_001b: Expected O, but got Unknown
//IL_002c: Unknown result type (might be due to invalid IL or missing references)
//IL_0036: Expected O, but got Unknown
//IL_0047: Unknown result type (might be due to invalid IL or missing references)
//IL_0051: Expected O, but got Unknown
NetworkManager.__rpc_func_table.Add(2707969770u, new RpcReceiveHandler(__rpc_handler_2707969770));
NetworkManager.__rpc_func_table.Add(3902926514u, new RpcReceiveHandler(__rpc_handler_3902926514));
NetworkManager.__rpc_func_table.Add(1751827331u, new RpcReceiveHandler(__rpc_handler_1751827331));
}
private static void __rpc_handler_2707969770(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
{
//IL_0023: Unknown result type (might be due to invalid IL or missing references)
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_0029: Unknown result type (might be due to invalid IL or missing references)
//IL_0070: 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_009d: 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_0055: Invalid comparison between Unknown and I4
NetworkManager networkManager = target.NetworkManager;
if (networkManager == null || !networkManager.IsListening)
{
return;
}
if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId)
{
if ((int)networkManager.LogLevel <= 1)
{
Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!");
}
}
else
{
int activity = default(int);
ByteUnpacker.ReadValueBitPacked(reader, ref activity);
target.__rpc_exec_stage = (__RpcExecStage)1;
((SignalFlare)(object)target).monsterRoundManagerServerRpc(activity);
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
private static void __rpc_handler_3902926514(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
{
//IL_0023: Unknown result type (might be due to invalid IL or missing references)
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_0029: 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_008e: 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_004b: Unknown result type (might be due to invalid IL or missing references)
//IL_0055: Invalid comparison between Unknown and I4
NetworkManager networkManager = target.NetworkManager;
if (networkManager == null || !networkManager.IsListening)
{
return;
}
if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId)
{
if ((int)networkManager.LogLevel <= 1)
{
Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!");
}
}
else
{
Vector3 position = default(Vector3);
((FastBufferReader)(ref reader)).ReadValueSafe(ref position);
target.__rpc_exec_stage = (__RpcExecStage)1;
((SignalFlare)(object)target).fireFlareServerRpc(position);
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
private static void __rpc_handler_1751827331(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
{
//IL_0023: 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_0050: Unknown result type (might be due to invalid IL or missing references)
NetworkManager networkManager = target.NetworkManager;
if (networkManager != null && networkManager.IsListening)
{
int message = default(int);
ByteUnpacker.ReadValueBitPacked(reader, ref message);
target.__rpc_exec_stage = (__RpcExecStage)2;
((SignalFlare)(object)target).fireFlareClientRpc(message);
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
[MethodImpl(MethodImplOptions.NoInlining)]
protected internal override string __getTypeName()
{
return "SignalFlare";
}
}
}
namespace AbandonedCompanyAssets.Behaviours
{
internal class AutoPlaySounds : MonoBehaviour
{
private AudioSource audiosource;
public AudioClip startaudio;
public AudioClip audio1;
public AudioClip audioloop;
public float audioclipdelay;
public float audioloopdelay;
private bool sound1;
private bool sound2;
private float time;
private void Start()
{
audiosource = ((Component)this).GetComponentInChildren<AudioSource>();
audiosource.PlayOneShot(startaudio);
}
private void Update()
{
time += Time.deltaTime;
if (time > audioclipdelay && !sound1)
{
Plugin.ACALog.LogInfo((object)"Playing Sound 1");
audiosource.PlayOneShot(audio1);
sound1 = true;
}
if (time > audioloopdelay && !sound2)
{
audiosource.clip = audioloop;
audiosource.loop = true;
audiosource.Play();
sound2 = true;
}
}
}
internal class DimThenKill : MonoBehaviour
{
private Light lightsource;
public bool dimin;
public float killafterseconds;
private float time;
public float dimrate;
public float defaultrange;
public float dimindelay;
private void Start()
{
lightsource = ((Component)this).GetComponentInChildren<Light>();
Plugin.ACALog.LogInfo((object)defaultrange);
if (dimrate == 0f)
{
dimrate = 0.005f;
}
}
private void Update()
{
time += Time.deltaTime;
if (time > dimindelay && time < killafterseconds && lightsource.range < defaultrange)
{
Light obj = lightsource;
obj.range += dimrate;
}
if (time > killafterseconds)
{
if (lightsource.range > 0f)
{
Light obj2 = lightsource;
obj2.range -= dimrate;
}
else if (lightsource.range <= 0f && ((Component)this).gameObject.GetComponentInChildren<NetworkObject>().IsOwner)
{
deleteThisServerRpc();
}
}
}
[ServerRpc]
private void deleteThisServerRpc()
{
Object.Destroy((Object)(object)((Component)this).gameObject);
}
}
internal class FlickeringLight : MonoBehaviour
{
private Light lightSource;
public float minIntensity = 100f;
public float maxIntensity = 200f;
public int smoothing = 35;
private Queue<float> smoothQueue;
private float lastSum = 1f;
public void Reset()
{
smoothQueue.Clear();
lastSum = 0f;
}
public void Start()
{
smoothQueue = new Queue<float>(smoothing);
if ((Object)(object)lightSource == (Object)null)
{
lightSource = ((Component)this).GetComponentInChildren<Light>();
}
}
public void Update()
{
if (!((Object)(object)lightSource == (Object)null))
{
while (smoothQueue.Count >= smoothing)
{
lastSum -= smoothQueue.Dequeue();
}
float num = Random.Range(minIntensity, maxIntensity);
smoothQueue.Enqueue(num);
lastSum += num;
lightSource.intensity = lastSum / (float)smoothQueue.Count;
}
}
}
}
namespace System.Runtime.CompilerServices
{
[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
internal sealed class IgnoresAccessChecksToAttribute : Attribute
{
public IgnoresAccessChecksToAttribute(string assemblyName)
{
}
}
}
namespace AbandonedCompanyAssets.NetcodePatcher
{
[AttributeUsage(AttributeTargets.Module)]
internal class NetcodePatchedAssemblyAttribute : Attribute
{
}
}