Decompiled source of ArtifactOfPrestige v1.3.1

ArtifactOfPrestige.dll

Decompiled 3 months ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Configuration;
using BepInEx.Logging;
using Microsoft.CodeAnalysis;
using Newtonsoft.Json;
using On.RoR2;
using ProperSave;
using R2API;
using RiskOfOptions;
using RiskOfOptions.OptionConfigs;
using RiskOfOptions.Options;
using RoR2;
using UnityEngine;
using UnityEngine.Networking;

[assembly: AssemblyTitle("ArtifactOfPrestige")]
[assembly: AssemblyProduct("ArtifactOfPrestige")]
[assembly: AssemblyInformationalVersion("1.0.0+b7d622571b17c146864bfe3258eecd29cef395e6")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyCompany("ArtifactOfPrestige")]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: CompilationRelaxations(8)]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: RefSafetyRules(11)]
[module: UnverifiableCode]
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 ArtifactOfPrestige
{
	internal class Artifact : ArtifactBase
	{
		public static ConfigEntry<int> TimesToPrintMessageOnStart;

		public Color pink = new Color(0.8f, 0.13f, 0.6f, 1f);

		public override string ArtifactName => "Artifact of Prestige";

		public override string ArtifactLangTokenName => "ARTIFACT_OF_PRESTIGE";

		public override string ArtifactDescription => "At least one Shrine of the Mountain spawns every stage. Shrine of the Mountain effects are permanent.";

		public override Sprite ArtifactEnabledIcon => Assets.mainAssetBundle.LoadAsset<Sprite>("enabled.png");

		public override Sprite ArtifactDisabledIcon => Assets.mainAssetBundle.LoadAsset<Sprite>("disabled.png");

		public override void Init(ConfigFile config)
		{
			CreateLang();
			CreateArtifact();
			Hooks();
		}

		public override void Hooks()
		{
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Expected O, but got Unknown
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: 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_0074: Unknown result type (might be due to invalid IL or missing references)
			//IL_007e: Expected O, but got Unknown
			Run.onRunStartGlobal += ResetValues;
			Stage.onStageStartGlobal += SetValues;
			TeleporterInteraction.AddShrineStack += new hook_AddShrineStack(UpdateValues);
			SceneDirector.PopulateScene += new hook_PopulateScene(SpawnShrine);
			TeleporterInteraction.onTeleporterChargedGlobal += HideLocalIndicators;
			ShrineBossBehavior.Start += new hook_Start(ShrineMat);
			TeleporterInteraction.Awake += new hook_Awake(TPMat);
			if (ProperSaveCompatibility.enabled)
			{
				ProperSaveCompatibility.AddEvent(SavePrestigeSettings);
			}
		}

		private void SavePrestigeSettings(Dictionary<string, object> dict)
		{
			if (base.ArtifactEnabled)
			{
				string value = JsonConvert.SerializeObject((object)new ArtifactOfPrestige_ProperSaveObj());
				dict.Add("ArtifactOfPrestigeObj", value);
			}
		}

		private void LoadProperSave()
		{
			if (ProperSaveCompatibility.enabled && base.ArtifactEnabled && ProperSaveCompatibility.IsLoading)
			{
				string moddedData = ProperSaveCompatibility.GetModdedData("ArtifactOfPrestigeObj");
				ArtifactOfPrestige_ProperSaveObj artifactOfPrestige_ProperSaveObj = JsonConvert.DeserializeObject<ArtifactOfPrestige_ProperSaveObj>(moddedData);
				ArtifactOfPrestige.bonusRewardCount = artifactOfPrestige_ProperSaveObj.bonusRewardCount;
				ArtifactOfPrestige.shrineBonusStacks = artifactOfPrestige_ProperSaveObj.shrineBonusStacks;
				ArtifactOfPrestige.NetworkshowExtraBossesIndicator = artifactOfPrestige_ProperSaveObj.NetworkshowExtraBossesIndicator;
			}
		}

		private void UpdateValues(orig_AddShrineStack orig, TeleporterInteraction self)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Invalid comparison between Unknown and I4
			if ((int)self.activationState <= 1)
			{
				ArtifactOfPrestige.bonusRewardCount++;
				ArtifactOfPrestige.NetworkshowExtraBossesIndicator = true;
				Networking.InvokeAddIndicator(base.ArtifactEnabled);
			}
			orig.Invoke(self);
		}

		private void SetValues(Stage stage)
		{
			ArtifactOfPrestige.localIndicators = new List<GameObject>();
			ArtifactOfPrestige.offset = 0;
			if (ArtifactOfPrestige.stackOutsidePrestige.Value && !base.ArtifactEnabled)
			{
				ArtifactOfPrestige.shrineBonusStacks = 0;
			}
			TeleporterInteraction instance = TeleporterInteraction.instance;
			if (instance == null || !Object.op_Implicit((Object)(object)instance) || !base.ArtifactEnabled)
			{
				return;
			}
			TeleporterInteraction instance2 = TeleporterInteraction.instance;
			if (NetworkServer.active)
			{
				instance2.bossGroup.bonusRewardCount = ArtifactOfPrestige.bonusRewardCount;
				instance2.shrineBonusStacks = ArtifactOfPrestige.shrineBonusStacks;
				instance2.NetworkshowExtraBossesIndicator = ArtifactOfPrestige.NetworkshowExtraBossesIndicator;
			}
			if (ArtifactOfPrestige.shrineBonusStacks > 1 && ArtifactOfPrestige.stackingIndicators.Value)
			{
				for (int i = 0; i < ArtifactOfPrestige.shrineBonusStacks - 1; i++)
				{
					LocalAddIndicator();
				}
			}
		}

		private void ShrineMat(orig_Start orig, ShrineBossBehavior self)
		{
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			if ((base.ArtifactEnabled && ArtifactOfPrestige.colouredIndicators.Value) || ArtifactOfPrestige.colouredOutsidePrestige.Value)
			{
				MeshRenderer component = ((Component)((Component)self).gameObject.transform.Find("Symbol")).GetComponent<MeshRenderer>();
				Material[] materials = ((Renderer)component).materials;
				materials[0].SetColor("_TintColor", ArtifactOfPrestige.indicatorColor.Value);
				((Renderer)component).materials = materials;
			}
			orig.Invoke(self);
		}

		private void TPMat(orig_Awake orig, TeleporterInteraction self)
		{
			//IL_004f: Unknown result type (might be due to invalid IL or missing references)
			orig.Invoke(self);
			if ((base.ArtifactEnabled && ArtifactOfPrestige.colouredIndicators.Value) || ArtifactOfPrestige.colouredOutsidePrestige.Value)
			{
				MeshRenderer component = self.bossShrineIndicator.GetComponent<MeshRenderer>();
				Material[] materials = ((Renderer)component).materials;
				materials[0].SetColor("_TintColor", ArtifactOfPrestige.indicatorColor.Value);
				((Renderer)component).materials = materials;
			}
		}

		private void ResetValues(Run run)
		{
			if (base.ArtifactEnabled || ArtifactOfPrestige.stackOutsidePrestige.Value)
			{
				ArtifactOfPrestige.ResetValues();
			}
			LoadProperSave();
		}

		private void SpawnShrine(orig_PopulateScene orig, SceneDirector self)
		{
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_0039: Expected O, but got Unknown
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			//IL_004d: Unknown result type (might be due to invalid IL or missing references)
			//IL_004f: Unknown result type (might be due to invalid IL or missing references)
			//IL_005a: Expected O, but got Unknown
			//IL_0055: Unknown result type (might be due to invalid IL or missing references)
			//IL_005f: Expected O, but got Unknown
			if (base.ArtifactEnabled && SceneInfo.instance.countsAsStage && Object.op_Implicit((Object)(object)self.teleporterSpawnCard))
			{
				Xoroshiro128Plus val = new Xoroshiro128Plus(self.rng.nextUlong);
				DirectorCore.instance.TrySpawnObject(new DirectorSpawnRequest(LegacyResourcesAPI.Load<SpawnCard>("SpawnCards/InteractableSpawnCard/iscShrineBoss"), new DirectorPlacementRule
				{
					placementMode = (PlacementMode)4
				}, val));
			}
			orig.Invoke(self);
		}

		private void HideLocalIndicators(TeleporterInteraction teleporterInteraction)
		{
			if (!base.ArtifactEnabled && !ArtifactOfPrestige.stackOutsidePrestige.Value)
			{
				return;
			}
			foreach (GameObject localIndicator in ArtifactOfPrestige.localIndicators)
			{
				localIndicator.SetActive(false);
			}
		}

		private void LocalAddIndicator()
		{
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_004f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			TeleporterInteraction instance = TeleporterInteraction.instance;
			GameObject bossShrineIndicator = instance.bossShrineIndicator;
			GameObject val = Object.Instantiate<GameObject>(bossShrineIndicator);
			val.transform.parent = ((Component)instance).gameObject.transform;
			val.transform.position = bossShrineIndicator.transform.position + new Vector3(0f, (float)(ArtifactOfPrestige.offset + 2), 0f);
			ArtifactOfPrestige.offset += 2;
			val.SetActive(true);
			ArtifactOfPrestige.localIndicators.Add(val);
		}
	}
	public abstract class ArtifactBase
	{
		public ArtifactDef ArtifactDef;

		public abstract string ArtifactName { get; }

		public abstract string ArtifactLangTokenName { get; }

		public abstract string ArtifactDescription { get; }

		public abstract Sprite ArtifactEnabledIcon { get; }

		public abstract Sprite ArtifactDisabledIcon { get; }

		public bool ArtifactEnabled => RunArtifactManager.instance.IsArtifactEnabled(ArtifactDef);

		public abstract void Init(ConfigFile config);

		protected void CreateLang()
		{
			LanguageAPI.Add("ARTIFACT_" + ArtifactLangTokenName + "_NAME", ArtifactName);
			LanguageAPI.Add("ARTIFACT_" + ArtifactLangTokenName + "_DESCRIPTION", ArtifactDescription);
		}

		protected void CreateArtifact()
		{
			ArtifactDef = ScriptableObject.CreateInstance<ArtifactDef>();
			ArtifactDef.cachedName = "ARTIFACT_" + ArtifactLangTokenName;
			ArtifactDef.nameToken = "ARTIFACT_" + ArtifactLangTokenName + "_NAME";
			ArtifactDef.descriptionToken = "ARTIFACT_" + ArtifactLangTokenName + "_DESCRIPTION";
			ArtifactDef.smallIconSelectedSprite = ArtifactEnabledIcon;
			ArtifactDef.smallIconDeselectedSprite = ArtifactDisabledIcon;
			ContentAddition.AddArtifactDef(ArtifactDef);
		}

		public abstract void Hooks();
	}
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInPlugin("Miyowi.ArtifactOfPrestige", "ArtifactOfPrestige", "1.3.1")]
	public class ArtifactOfPrestige : BaseUnityPlugin
	{
		public static ArtifactOfPrestige instance;

		internal static GameObject CentralNetworkObject;

		private static GameObject _centralNetworkObjectSpawned;

		public const string PluginGUID = "Miyowi.ArtifactOfPrestige";

		public const string PluginAuthor = "Miyowi";

		public const string PluginName = "ArtifactOfPrestige";

		public const string PluginVersion = "1.3.1";

		public static PluginInfo pluginInfo;

		public List<ArtifactBase> Artifacts = new List<ArtifactBase>();

		public static int bonusRewardCount = 0;

		public static int shrineBonusStacks = 0;

		public static int offset = 0;

		public static bool NetworkshowExtraBossesIndicator = false;

		public static List<GameObject> localIndicators = new List<GameObject>();

		public static ConfigEntry<bool> stackingIndicators { get; set; }

		public static ConfigEntry<bool> colouredIndicators { get; set; }

		public static ConfigEntry<Color> indicatorColor { get; set; }

		public static ConfigEntry<bool> stackOutsidePrestige { get; set; }

		public static ConfigEntry<bool> colouredOutsidePrestige { get; set; }

		public void Awake()
		{
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_002f: Expected O, but got Unknown
			//IL_00be: Unknown result type (might be due to invalid IL or missing references)
			instance = this;
			pluginInfo = ((BaseUnityPlugin)this).Info;
			Log.Init(((BaseUnityPlugin)this).Logger);
			Assets.PopulateAssets();
			GameObject val = new GameObject("tmpGo");
			val.AddComponent<NetworkIdentity>();
			CentralNetworkObject = PrefabAPI.InstantiateClone(val, "somethingUnique");
			Object.Destroy((Object)(object)val);
			CentralNetworkObject.AddComponent<Networking>();
			stackingIndicators = ((BaseUnityPlugin)this).Config.Bind<bool>("Artifact of Prestige", "Stacking Indicators", true, "When more than one Shrine of the Mountain is activated, Shrine of the Mountain indicators stack above each other on the teleporter.");
			colouredIndicators = ((BaseUnityPlugin)this).Config.Bind<bool>("Artifact of Prestige", "Coloured Indicator", true, "Shrine of the Mountain indicators are coloured differently to normal.");
			indicatorColor = ((BaseUnityPlugin)this).Config.Bind<Color>("Artifact of Prestige", "Indicator Colour", new Color(0.8f, 0.13f, 0.6f, 1f), "If 'Coloured Indicator' is enabled, the colour that indicators are changed to.");
			stackOutsidePrestige = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "Stacking Indicators Outside Prestige", false, "Stacking Shrine of the Mountain indicators occurs in regular runs. Overrides 'Stacking Indicators'.");
			colouredOutsidePrestige = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "Coloured Indicators Outside Prestige", false, "Shrine of the Mountain indicators are coloured to the value set by 'Indicator Colour' in regular runs. Overrides 'Coloured Indicator'.");
			if (RiskOfOptionsCompatibility.enabled)
			{
				RiskOfOptionsCompatibility.OptionsInit();
			}
			IEnumerable<Type> enumerable = from type in Assembly.GetExecutingAssembly().GetTypes()
				where !type.IsAbstract && type.IsSubclassOf(typeof(ArtifactBase))
				select type;
			foreach (Type item in enumerable)
			{
				ArtifactBase artifactBase = (ArtifactBase)Activator.CreateInstance(item);
				if (ValidateArtifact(artifactBase, Artifacts))
				{
					artifactBase.Init(((BaseUnityPlugin)this).Config);
				}
			}
		}

		public static void CheckNetworkObject()
		{
			if (NetworkServer.active && !Object.op_Implicit((Object)(object)_centralNetworkObjectSpawned))
			{
				_centralNetworkObjectSpawned = Object.Instantiate<GameObject>(CentralNetworkObject);
				NetworkServer.Spawn(_centralNetworkObjectSpawned);
			}
		}

		public static void ResetValues()
		{
			localIndicators = new List<GameObject>();
			bonusRewardCount = 0;
			shrineBonusStacks = 0;
			offset = 0;
			NetworkshowExtraBossesIndicator = false;
		}

		public bool ValidateArtifact(ArtifactBase artifact, List<ArtifactBase> artifactList)
		{
			bool value = ((BaseUnityPlugin)this).Config.Bind<bool>("Artifact: " + artifact.ArtifactName, "Enable Artifact?", true, "Should this artifact appear for selection?").Value;
			if (value)
			{
				artifactList.Add(artifact);
			}
			return value;
		}
	}
	public static class Assets
	{
		public static AssetBundle mainAssetBundle = null;

		internal static string assetBundleName = "artifactofprestigeicons";

		internal static string assemblyDir => Path.GetDirectoryName(ArtifactOfPrestige.pluginInfo.Location);

		public static void PopulateAssets()
		{
			mainAssetBundle = AssetBundle.LoadFromFile(Path.Combine(assemblyDir, assetBundleName));
		}
	}
	public static class RiskOfOptionsCompatibility
	{
		private static bool? _enabled;

		public static bool enabled
		{
			get
			{
				if (!_enabled.HasValue)
				{
					_enabled = Chainloader.PluginInfos.ContainsKey("com.rune580.riskofoptions");
				}
				return _enabled.Value;
			}
		}

		[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
		public static void OptionsInit()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_0010: Expected O, but got Unknown
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Expected O, but got Unknown
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Expected O, but got Unknown
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Expected O, but got Unknown
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0045: Expected O, but got Unknown
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: Expected O, but got Unknown
			ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(ArtifactOfPrestige.stackingIndicators));
			ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(ArtifactOfPrestige.colouredIndicators));
			ModSettingsManager.AddOption((BaseOption)new ColorOption(ArtifactOfPrestige.indicatorColor, new ColorOptionConfig()));
			ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(ArtifactOfPrestige.stackOutsidePrestige));
			ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(ArtifactOfPrestige.colouredOutsidePrestige));
			ModSettingsManager.SetModDescription("Allows customisation of how the artifact affects Shrine of the Mountain visuals, or to enable the visuals even without the artifact because it's kinda cool I think.");
			Sprite modIcon = Assets.mainAssetBundle.LoadAsset<Sprite>("icon.png");
			ModSettingsManager.SetModIcon(modIcon);
		}
	}
	public static class ProperSaveCompatibility
	{
		private static bool? _enabled;

		public static bool enabled
		{
			get
			{
				if (!_enabled.HasValue)
				{
					_enabled = Chainloader.PluginInfos.ContainsKey("com.KingEnderBrine.ProperSave");
				}
				return _enabled.Value;
			}
		}

		public static bool IsLoading
		{
			[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
			get
			{
				return Loading.IsLoading;
			}
		}

		[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
		public static void AddEvent(Action<Dictionary<string, object>> action)
		{
			SaveFile.OnGatherSaveData += action;
		}

		[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
		public static string GetModdedData(string name)
		{
			return Loading.CurrentSave.GetModdedData<string>(name);
		}
	}
	public class ArtifactOfPrestige_ProperSaveObj
	{
		public int bonusRewardCount;

		public int shrineBonusStacks;

		public bool NetworkshowExtraBossesIndicator;

		public ArtifactOfPrestige_ProperSaveObj()
		{
			bonusRewardCount = ArtifactOfPrestige.bonusRewardCount;
			shrineBonusStacks = ArtifactOfPrestige.shrineBonusStacks;
			NetworkshowExtraBossesIndicator = ArtifactOfPrestige.NetworkshowExtraBossesIndicator;
		}
	}
	internal static class Log
	{
		private static ManualLogSource _logSource;

		internal static void Init(ManualLogSource logSource)
		{
			_logSource = logSource;
		}

		internal static void Debug(object data)
		{
			_logSource.LogDebug(data);
		}

		internal static void Error(object data)
		{
			_logSource.LogError(data);
		}

		internal static void Fatal(object data)
		{
			_logSource.LogFatal(data);
		}

		internal static void Info(object data)
		{
			_logSource.LogInfo(data);
		}

		internal static void Message(object data)
		{
			_logSource.LogMessage(data);
		}

		internal static void Warning(object data)
		{
			_logSource.LogWarning(data);
		}
	}
	public class Networking : NetworkBehaviour
	{
		private static Networking instance;

		private static int kRpcRpcAddIndicator;

		private void Awake()
		{
			instance = this;
		}

		public static void InvokeAddIndicator(bool artifactEnabled)
		{
			ArtifactOfPrestige.CheckNetworkObject();
			instance.CallRpcAddIndicator(artifactEnabled);
		}

		[ClientRpc]
		private void RpcAddIndicator(bool artifactEnabled)
		{
			//IL_0086: 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_00a2: Unknown result type (might be due to invalid IL or missing references)
			if ((artifactEnabled && ArtifactOfPrestige.stackingIndicators.Value) || ArtifactOfPrestige.stackOutsidePrestige.Value)
			{
				ArtifactOfPrestige.shrineBonusStacks++;
			}
			if (ArtifactOfPrestige.shrineBonusStacks > 1 && ArtifactOfPrestige.stackingIndicators.Value)
			{
				TeleporterInteraction val = TeleporterInteraction.instance;
				GameObject bossShrineIndicator = val.bossShrineIndicator;
				GameObject val2 = Object.Instantiate<GameObject>(bossShrineIndicator);
				val2.transform.parent = ((Component)val).gameObject.transform;
				val2.transform.position = bossShrineIndicator.transform.position + new Vector3(0f, (float)(ArtifactOfPrestige.offset + 2), 0f);
				ArtifactOfPrestige.offset += 2;
				val2.SetActive(true);
				ArtifactOfPrestige.localIndicators.Add(val2);
			}
		}

		private void UNetVersion()
		{
		}

		protected static void InvokeRpcRpcAddIndicator(NetworkBehaviour obj, NetworkReader reader)
		{
			if (!NetworkClient.active)
			{
				Debug.LogError((object)"RPC RpcAddIndicator called on server.");
			}
			else
			{
				((Networking)(object)obj).RpcAddIndicator(reader.ReadBoolean());
			}
		}

		public void CallRpcAddIndicator(bool artifactEnabled)
		{
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Expected O, but got Unknown
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			if (!NetworkServer.active)
			{
				Debug.LogError((object)"RPC Function RpcAddIndicator called on client.");
				return;
			}
			NetworkWriter val = new NetworkWriter();
			val.Write((short)0);
			val.Write((short)2);
			val.WritePackedUInt32((uint)kRpcRpcAddIndicator);
			val.Write(((Component)this).GetComponent<NetworkIdentity>().netId);
			val.Write(artifactEnabled);
			((NetworkBehaviour)this).SendRPCInternal(val, 0, "RpcAddIndicator");
		}

		static Networking()
		{
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: Expected O, but got Unknown
			kRpcRpcAddIndicator = -432996424;
			NetworkBehaviour.RegisterRpcDelegate(typeof(Networking), kRpcRpcAddIndicator, new CmdDelegate(InvokeRpcRpcAddIndicator));
			NetworkCRC.RegisterBehaviour("Networking", 0);
		}

		public override bool OnSerialize(NetworkWriter writer, bool forceAll)
		{
			bool result = default(bool);
			return result;
		}

		public override void OnDeserialize(NetworkReader reader, bool initialState)
		{
		}
	}
}