Decompiled source of MoreAds v2.0.2

MoreAds.dll

Decompiled 2 weeks ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Reflection.Emit;
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 GameNetcodeStuff;
using HarmonyLib;
using LethalConfig;
using LethalConfig.ConfigItems;
using LethalConfig.ConfigItems.Options;
using LobbyCompatibility.Enums;
using LobbyCompatibility.Features;
using Microsoft.CodeAnalysis;
using MoreAds.Compat;
using MoreAds.Configs;
using MoreAds.Patches;
using Unity.Netcode;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("MoreAds")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyDescription("Get enough dystopian hellscape in real life? Hate ads? Say no more!")]
[assembly: AssemblyFileVersion("2.0.2.0")]
[assembly: AssemblyInformationalVersion("2.0.2+97d5e5def7db013b7338a3acbdca67cf172571ef")]
[assembly: AssemblyProduct("MoreAds")]
[assembly: AssemblyTitle("MoreAds")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("2.0.2.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
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 MoreAds
{
	[BepInPlugin("com.github.cdusold.LethalMoreAds", "MoreAds", "2.0.2")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	public class Plugin : BaseUnityPlugin
	{
		private readonly Harmony harmony = new Harmony("cdusold.LethalMoreAds");

		internal static readonly bool debug = true;

		private static Plugin Instance;

		public static ManualLogSource logger;

		private void Awake()
		{
			if ((Object)(object)Instance == (Object)null)
			{
				Instance = this;
			}
			logger = ((BaseUnityPlugin)this).Logger;
			((BaseUnityPlugin)this).Logger.LogInfo((object)"Mod cdusold.LethalMoreAds is loaded!");
			ConfigManager.Init(((BaseUnityPlugin)this).Config);
			if (Chainloader.PluginInfos.ContainsKey("ainavt.lc.lethalconfig"))
			{
				LethalConfigManager.Init(((BaseUnityPlugin)this).Config);
			}
			if (Chainloader.PluginInfos.ContainsKey("BMX.LobbyCompatibility"))
			{
				LobbyCompatibilityManager.Init();
			}
			harmony.PatchAll(typeof(Plugin));
			harmony.PatchAll(typeof(HUDManagerPatch));
			harmony.PatchAll(typeof(TimeOfDayPatch));
			harmony.PatchAll(typeof(PlayerControllerBPatch));
		}
	}
	public static class PluginInfo
	{
		public const string PLUGIN_GUID = "MoreAds";

		public const string PLUGIN_NAME = "MoreAds";

		public const string PLUGIN_VERSION = "2.0.2";
	}
}
namespace MoreAds.Patches
{
	[HarmonyPatch(typeof(HUDManager))]
	internal class HUDManagerPatch
	{
		private static string ChooseSaleText()
		{
			string text = "AVAILABLE NOW!";
			int num = 0;
			for (int i = 0; i < ConfigManager.SalesTextList.Count; i++)
			{
				num += ConfigManager.SalesTextList[i].Item2;
			}
			int num2 = new Random(StartOfRound.Instance.randomMapSeed + TimeOfDayPatch.adCount).Next(0, num);
			for (int j = 0; j < ConfigManager.SalesTextList.Count; j++)
			{
				if (num2 < ConfigManager.SalesTextList[j].Item2)
				{
					text = ConfigManager.SalesTextList[j].Item1;
					break;
				}
				num2 -= ConfigManager.SalesTextList[j].Item2;
			}
			text = text.Replace("{me}", GameNetworkManager.Instance.localPlayerController.playerUsername);
			text = text.Replace("&comma;", ",");
			text = text.Replace("&colon;", ":");
			if (text.Contains("{player}"))
			{
				string playerUsername = StartOfRound.Instance.allPlayerScripts[new Random(StartOfRound.Instance.randomMapSeed + TimeOfDayPatch.adCount + 1).Next(0, StartOfRound.Instance.connectedPlayersAmount + 1)].playerUsername;
				text = text.Replace("{player}", playerUsername);
			}
			if (text.Contains("{planet}"))
			{
				Terminal val = Object.FindObjectOfType<Terminal>();
				string planetName = val.moonsCatalogueList[new Random(StartOfRound.Instance.randomMapSeed + TimeOfDayPatch.adCount + 2).Next(0, val.moonsCatalogueList.Length)].PlanetName;
				text = text.Replace("{planet}", planetName);
			}
			if (text.Contains("{here}"))
			{
				string planetName2 = StartOfRound.Instance.currentLevel.PlanetName;
				text = text.Replace("{here}", planetName2);
			}
			if (Plugin.debug)
			{
				Plugin.logger.LogInfo((object)("Sale text chosen: " + text));
			}
			return text;
		}

		[HarmonyPatch("ChooseAdItem")]
		[HarmonyPrefix]
		private static bool ChooseAdItemPre()
		{
			Plugin.logger.LogInfo((object)"Ad starting, setting check timer.");
			Traverse.Create((object)TimeOfDay.Instance).Field("adWaitInterval").SetValue((object)600f);
			if (!((NetworkBehaviour)HUDManager.Instance).IsServer)
			{
				return true;
			}
			for (int num = ((Component)HUDManager.Instance.advertItemParent).transform.childCount - 1; num >= 0; num--)
			{
				Object.Destroy((Object)(object)((Component)((Component)HUDManager.Instance.advertItemParent).transform.GetChild(num)).gameObject);
			}
			HUDManager.Instance.advertItem = null;
			int num2 = 100;
			int num3 = -1;
			Terminal val = Object.FindObjectOfType<Terminal>();
			List<TerminalNode> list = new List<TerminalNode>();
			if (Plugin.debug)
			{
				Plugin.logger.LogInfo((object)"Ad possible items:");
			}
			for (int i = 0; i < val.ShipDecorSelection.Count; i++)
			{
				if (Plugin.debug)
				{
					Plugin.logger.LogInfo((object)("- " + StartOfRound.Instance.unlockablesList.unlockables[val.ShipDecorSelection[i].shipUnlockableID].unlockableName));
				}
				if (!StartOfRound.Instance.unlockablesList.unlockables[val.ShipDecorSelection[i].shipUnlockableID].hasBeenUnlockedByPlayer && !ConfigManager.BlacklistItems.Contains(StartOfRound.Instance.unlockablesList.unlockables[val.ShipDecorSelection[i].shipUnlockableID].unlockableName))
				{
					list.Add(val.ShipDecorSelection[i]);
				}
			}
			List<int> list2 = new List<int>();
			for (int j = 0; j < val.buyableItemsList.Length; j++)
			{
				if (Plugin.debug)
				{
					Plugin.logger.LogInfo((object)("- " + val.buyableItemsList[j].itemName));
				}
				if (!ConfigManager.BlacklistItems.Contains(val.buyableItemsList[j].itemName))
				{
					list2.Add(j);
					for (int k = 0; k < (100 - val.itemSalesPercentages[j]) / 10; k++)
					{
						list2.Add(j);
					}
				}
			}
			string text = "";
			string text2 = ChooseSaleText();
			num3 = Random.Range(0, val.buyableItemsList.Length + list.Count);
			if (num3 >= list.Count)
			{
				Debug.Log((object)"Picking a tool to hawk.");
				num3 -= list.Count;
				num3 = list2[num3];
				num2 = val.itemSalesPercentages[num3];
				Item val2 = val.buyableItemsList[num3];
				HUDManager.Instance.CreateToolAdModelAndDisplayAdClientRpc(num2, num3);
				HUDManager.Instance.CreateToolAdModel(num2, val2);
				if (num2 <= 70)
				{
					text2 = $"{100 - num2}% OFF!";
				}
				text = val2.itemName;
			}
			else
			{
				Debug.Log((object)"Putting furniture in the ad");
				int num4 = -1;
				for (int l = 0; l < val.ShipDecorSelection.Count; l++)
				{
					if (val.ShipDecorSelection[l].shipUnlockableID == list[num3].shipUnlockableID)
					{
						num4 = l;
						break;
					}
				}
				try
				{
					HUDManager.Instance.CreateFurnitureAdModelAndDisplayAdClientRpc(num4);
					HUDManager.Instance.CreateFurnitureAdModel(StartOfRound.Instance.unlockablesList.unlockables[list[num3].shipUnlockableID]);
					text = StartOfRound.Instance.unlockablesList.unlockables[list[num3].shipUnlockableID].unlockableName;
				}
				catch (ArgumentException ex)
				{
					Plugin.logger.LogWarning((object)("Error creating furniture ad model: " + ex.Message));
					Plugin.logger.LogWarning((object)(ex.StackTrace ?? ""));
					return false;
				}
			}
			if (text2.Contains("{product}"))
			{
				text2 = text2.Replace("{product}", text);
			}
			if (text2.Contains("/"))
			{
				string[] array = text2.Split('/');
				text = array[0].Trim();
				text2 = array[1].Trim();
			}
			HUDManager.Instance.BeginDisplayAd(text, text2);
			return false;
		}

		[HarmonyPatch("CreateToolAdModelAndDisplayAdClientRpc")]
		[HarmonyPrefix]
		private static bool CreateToolAdModelAndDisplayAdClientRpcReplacement(int itemIndex)
		{
			NetworkManager networkManager = ((NetworkBehaviour)HUDManager.Instance).NetworkManager;
			if (networkManager == null || !networkManager.IsListening || networkManager.IsHost || ((NetworkBehaviour)HUDManager.Instance).IsServer)
			{
				return true;
			}
			int num = (int)Traverse.Create((object)HUDManager.Instance).Field("__rpc_exec_stage").GetValue();
			if (Plugin.debug)
			{
				Plugin.logger.LogInfo((object)$"__rpc_exec_stage: {num}");
			}
			int num2 = 2;
			if (Plugin.debug)
			{
				try
				{
					Type value = Traverse.Create((object)HUDManager.Instance).Field("__RpcExecStage").GetValue<Type>();
					num2 = (int)value.GetField("Client").GetValue(value);
					if (Plugin.debug)
					{
						Plugin.logger.LogInfo((object)$"___RpcExecStage.Client: {num2}");
					}
				}
				catch (Exception)
				{
				}
			}
			if (num != num2 && (networkManager.IsServer || networkManager.IsHost))
			{
				return true;
			}
			if (num == num2 && (networkManager.IsClient || networkManager.IsHost) && !((NetworkBehaviour)HUDManager.Instance).IsServer)
			{
				for (int num3 = ((Component)HUDManager.Instance.advertItemParent).transform.childCount - 1; num3 >= 0; num3--)
				{
					Object.Destroy((Object)(object)((Component)((Component)HUDManager.Instance.advertItemParent).transform.GetChild(num3)).gameObject);
				}
				HUDManager.Instance.advertItem = null;
				Terminal val = Object.FindObjectOfType<Terminal>();
				Item val2 = val.buyableItemsList[itemIndex];
				int num4 = val.itemSalesPercentages[itemIndex];
				if (!GameNetworkManager.Instance.localPlayerController.isPlayerDead)
				{
					HUDManager.Instance.CreateToolAdModel(num4, val2);
				}
				string text = ChooseSaleText();
				string text2 = val2.itemName;
				if (num4 <= 70)
				{
					text = $"{100 - num4}% OFF!";
				}
				if (text.Contains("{product}"))
				{
					text = text.Replace("{product}", val2.itemName);
				}
				if (text.Contains("/"))
				{
					string[] array = text.Split('/');
					text2 = array[0].Trim();
					text = array[1].Trim();
				}
				HUDManager.Instance.BeginDisplayAd(text2, text);
			}
			return false;
		}

		[HarmonyPatch("displayAd")]
		[HarmonyPostfix]
		private static void displayAdPost()
		{
			Plugin.logger.LogInfo((object)"Ad done, reset stuff.");
			TimeOfDayPatch.AdIncrement();
		}
	}
	[HarmonyPatch(typeof(PlayerControllerB))]
	internal class PlayerControllerBPatch
	{
		[HarmonyPatch("KillPlayerServerRpc")]
		[HarmonyPostfix]
		private static void OnDeath()
		{
			int num = ((TimeOfDay.Instance.daysUntilDeadline <= 1) ? ConfigManager.ChanceOnDeathLastDay.Value : ConfigManager.ChanceOnDeath.Value);
			if (Plugin.debug)
			{
				Plugin.logger.LogInfo((object)$"OnDeath: {num}% chance.");
			}
			if (num > 0 && (num >= 100 || Random.Range(0, 100) < num))
			{
				if (Plugin.debug)
				{
					Plugin.logger.LogInfo((object)"OnDeath: Trigger successful.");
				}
				if (ConfigManager.PlayOnDeath.Value == ConfigManager.NextAdAction.Immediately)
				{
					TimeOfDayPatch.RollAds();
				}
				else if (ConfigManager.PlayOnDeath.Value == ConfigManager.NextAdAction.RerollNext)
				{
					TimeOfDayPatch.PokeAds();
				}
			}
		}

		[HarmonyPatch("DamagePlayerServerRpc")]
		[HarmonyPostfix]
		private static void OnHurt()
		{
			int num = ((TimeOfDay.Instance.daysUntilDeadline <= 1) ? ConfigManager.ChanceOnHurtLastDay.Value : ConfigManager.ChanceOnHurt.Value);
			if (Plugin.debug)
			{
				Plugin.logger.LogInfo((object)$"OnHurt: {num}% chance.");
			}
			if (num > 0 && (num >= 100 || Random.Range(0, 100) < num))
			{
				if (Plugin.debug)
				{
					Plugin.logger.LogInfo((object)"OnHurt: Trigger successful.");
				}
				if (ConfigManager.PlayOnHurt.Value == ConfigManager.NextAdAction.Immediately)
				{
					TimeOfDayPatch.RollAds();
				}
				else if (ConfigManager.PlayOnHurt.Value == ConfigManager.NextAdAction.RerollNext)
				{
					TimeOfDayPatch.PokeAds();
				}
			}
		}
	}
	[HarmonyPatch(typeof(TimeOfDay))]
	internal class TimeOfDayPatch
	{
		public static int adCount { get; private set; }

		public static int quotaAdCount { get; private set; }

		[HarmonyPatch("Start")]
		[HarmonyPostfix]
		private static void StartPostfix()
		{
			quotaAdCount = 0;
			Plugin.logger.LogInfo((object)"quotaAdCount loaded as 0.");
		}

		[HarmonyPatch("SetNewProfitQuota")]
		[HarmonyPrefix]
		private static bool SetNewProfitQuota()
		{
			Plugin.logger.LogInfo((object)"Quota ad count reset.");
			quotaAdCount = 0;
			return true;
		}

		[HarmonyPatch("SetTimeForAdToPlay")]
		[HarmonyPrefix]
		private static bool SetTimeForAdToPlay()
		{
			if (Plugin.debug)
			{
				Plugin.logger.LogWarning((object)"POIK: SetTimeForAdToPlay was called.");
			}
			SetGameToAllowAds();
			adCount = 0;
			if (CanSetAd())
			{
				int num = ((TimeOfDay.Instance.daysUntilDeadline <= 1) ? ConfigManager.ChanceOnLandingLastDay.Value : ConfigManager.ChanceOnLanding.Value);
				if (Plugin.debug)
				{
					Plugin.logger.LogInfo((object)$"Chance on landing: {num}% chance.");
				}
				int num2 = ((TimeOfDay.Instance.daysUntilDeadline <= 1) ? ConfigManager.ChanceForFirstAdLastDay.Value : ConfigManager.ChanceForFirstAd.Value);
				if (Plugin.debug)
				{
					Plugin.logger.LogInfo((object)$"Chance for first ad: {num2}% chance.");
				}
				if (num > 0 && (num >= 100 || Random.Range(0, 100) < num))
				{
					if (Plugin.debug)
					{
						Plugin.logger.LogInfo((object)"Chance on landing: Trigger successful.");
					}
					TimeOfDay.Instance.normalizedTimeToShowAd = ConfigManager.EarliestTimeToShowAd.Value;
				}
				else if (num2 > 0 && (num2 >= 100 || Random.Range(0, 100) < num2))
				{
					if (Plugin.debug)
					{
						Plugin.logger.LogInfo((object)"Chance for first ad: Trigger successful.");
					}
					TimeOfDay.Instance.normalizedTimeToShowAd = RollAdTime();
				}
				else
				{
					if (Plugin.debug)
					{
						Plugin.logger.LogInfo((object)"No ad scheduled on landing.");
					}
					TimeOfDay.Instance.normalizedTimeToShowAd = -1f;
				}
			}
			else
			{
				if (Plugin.debug)
				{
					Plugin.logger.LogInfo((object)"I believe we've reached max ad-itude.");
				}
				TimeOfDay.Instance.normalizedTimeToShowAd = -1f;
			}
			Traverse.Create((object)TimeOfDay.Instance).Field("adWaitInterval").SetValue((object)0f);
			return false;
		}

		[HarmonyPatch("GetClientInfo")]
		[HarmonyPostfix]
		private static void GetClientInfoPost()
		{
			SetGameToAllowAds();
		}

		[HarmonyPatch("MeetsRequirementsToShowAd")]
		[HarmonyPostfix]
		private static void MeetsRequirementsToShowAdPatch(ref bool __result)
		{
			__result = true;
		}

		[HarmonyPatch("DisplayAdAtScheduledTime")]
		[HarmonyTranspiler]
		private static IEnumerable<CodeInstruction> DisplayAdAtScheduledTimeTranspiler(IEnumerable<CodeInstruction> instructions)
		{
			//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bc: Expected O, but got Unknown
			List<CodeInstruction> list = new List<CodeInstruction>(instructions);
			for (int i = 1; i < list.Count; i++)
			{
				if (Plugin.debug)
				{
					Plugin.logger.LogInfo((object)$"Instruction {i}: {list[i].opcode} {list[i].operand}");
				}
				if (list[i].opcode == OpCodes.Ldc_I4_1 && list[i - 1].opcode == OpCodes.Ldfld && list[i - 1].operand.ToString().Contains("livingPlayers"))
				{
					list[i] = new CodeInstruction(OpCodes.Ldc_I4_0, (object)null);
					if (Plugin.debug)
					{
						Plugin.logger.LogInfo((object)$"Changed instruction {i} to Ldc_I4_0.");
					}
					Plugin.logger.LogInfo((object)"Patched ads to display even if only one player is alive.");
					break;
				}
			}
			return list;
		}

		[HarmonyPatch("DisplayAdAtScheduledTime")]
		[HarmonyPrefix]
		private static bool DisplayAdAtScheduledTime()
		{
			float value = Traverse.Create((object)TimeOfDay.Instance).Field("adWaitInterval").GetValue<float>();
			if (value > 0f)
			{
				Traverse.Create((object)TimeOfDay.Instance).Field("adWaitInterval").SetValue((object)(value - Time.deltaTime));
				return false;
			}
			if (!CanShowAd())
			{
				return false;
			}
			SetGameToAllowAds();
			return true;
		}

		[HarmonyPatch("ReceiveInfoFromClientForShowingAdServerRpc")]
		[HarmonyPrefix]
		private static bool ReceiveInfoFromClientForShowingAdServerRpcPre(ref bool doesntMeetRequirements)
		{
			if (doesntMeetRequirements)
			{
				Plugin.logger.LogInfo((object)$"Doesn't meet requirements: {doesntMeetRequirements}");
				doesntMeetRequirements = false;
			}
			return true;
		}

		private static bool CanSetAd()
		{
			if (TimeOfDay.Instance.normalizedTimeOfDay > ConfigManager.LatestTimeToShowAd.Value)
			{
				return false;
			}
			if (ConfigManager.MaxAdsPerDay.Value != -1 && adCount >= ConfigManager.MaxAdsPerDay.Value)
			{
				return false;
			}
			if (ConfigManager.MaxAdsPerQuota.Value != -1 && quotaAdCount >= ConfigManager.MaxAdsPerQuota.Value)
			{
				return false;
			}
			if (StartOfRound.Instance.livingPlayers <= 0)
			{
				return false;
			}
			return true;
		}

		private static bool CanShowAd()
		{
			if (TimeOfDay.Instance.normalizedTimeOfDay < ConfigManager.EarliestTimeToShowAd.Value)
			{
				return false;
			}
			if (TimeOfDay.Instance.normalizedTimeOfDay > 0.9f)
			{
				return false;
			}
			if (ConfigManager.MaxAdsPerDay.Value != -1 && adCount >= ConfigManager.MaxAdsPerDay.Value)
			{
				return false;
			}
			if (ConfigManager.MaxAdsPerQuota.Value != -1 && quotaAdCount >= ConfigManager.MaxAdsPerQuota.Value)
			{
				return false;
			}
			return true;
		}

		public static void AdIncrement()
		{
			adCount++;
			Plugin.logger.LogInfo((object)$"Ad #{adCount} shown.");
			quotaAdCount++;
			Plugin.logger.LogInfo((object)$"This quota has had {quotaAdCount} ads.");
			Traverse.Create((object)TimeOfDay.Instance).Field("adWaitInterval").SetValue((object)ConfigManager.MinimumTimeBetweenAds.Value);
			SetGameToAllowAds();
			if (CanSetAd())
			{
				ResetAdTime();
			}
		}

		private static void SetGameToAllowAds()
		{
			TimeOfDay.Instance.hasShownAdThisQuota = false;
			Traverse.Create((object)TimeOfDay.Instance).Field("checkingIfClientsAreReadyForAd").SetValue((object)false);
		}

		private static float RollAdTime()
		{
			return Random.Range(Math.Max(TimeOfDay.Instance.normalizedTimeOfDay, ConfigManager.EarliestTimeToShowAd.Value), ConfigManager.LatestTimeToShowAd.Value);
		}

		private static void ResetAdTime()
		{
			SetGameToAllowAds();
			int num = ((TimeOfDay.Instance.daysUntilDeadline <= 1) ? ConfigManager.ChanceForFirstAdLastDay.Value : ConfigManager.ChanceForFirstAd.Value);
			if (Plugin.debug)
			{
				Plugin.logger.LogInfo((object)$"Resetting ad time with {num}% chance.");
			}
			if (num > 0 && (num >= 100 || Random.Range(0, 100) < num))
			{
				TimeOfDay.Instance.normalizedTimeToShowAd = RollAdTime();
				if (Plugin.debug)
				{
					Plugin.logger.LogInfo((object)$"Ad time reset to {TimeOfDay.Instance.normalizedTimeToShowAd} (normalized time of day).");
				}
			}
			else
			{
				TimeOfDay.Instance.normalizedTimeToShowAd = -1f;
				if (Plugin.debug)
				{
					Plugin.logger.LogInfo((object)"Ad time reset to -1 (no ad scheduled).");
				}
			}
		}

		private static void RerollAdTime()
		{
			TimeOfDay.Instance.normalizedTimeToShowAd = Math.Min(TimeOfDay.Instance.normalizedTimeToShowAd, RollAdTime());
			if (Plugin.debug)
			{
				Plugin.logger.LogInfo((object)$"Ad time rerolled to {TimeOfDay.Instance.normalizedTimeToShowAd} (normalized time of day).");
			}
		}

		public static void RollAds()
		{
			if (CanSetAd())
			{
				Plugin.logger.LogInfo((object)"Rolling ads...");
				TimeOfDay.Instance.normalizedTimeToShowAd = TimeOfDay.Instance.normalizedTimeOfDay;
			}
		}

		public static void PokeAds()
		{
			if (CanSetAd())
			{
				Plugin.logger.LogInfo((object)"Poking ads...");
				RerollAdTime();
			}
		}
	}
}
namespace MoreAds.Configs
{
	internal class ConfigManager
	{
		public enum NextAdAction
		{
			Immediately,
			RerollNext,
			None
		}

		public static ConfigManager Instance { get; private set; }

		public static ConfigEntry<int> MaxAdsPerDay { get; private set; }

		public static ConfigEntry<int> MaxAdsPerQuota { get; private set; }

		public static ConfigEntry<int> ChanceOnLanding { get; private set; }

		public static ConfigEntry<int> ChanceOnLandingLastDay { get; private set; }

		public static ConfigEntry<int> ChanceForFirstAd { get; private set; }

		public static ConfigEntry<int> ChanceForFirstAdLastDay { get; private set; }

		public static ConfigEntry<int> ChanceForReset { get; private set; }

		public static ConfigEntry<int> ChanceForResetLastDay { get; private set; }

		public static ConfigEntry<float> EarliestTimeToShowAd { get; private set; }

		public static ConfigEntry<float> LatestTimeToShowAd { get; private set; }

		public static ConfigEntry<float> MinimumTimeBetweenAds { get; private set; }

		public static ConfigEntry<NextAdAction> PlayOnDeath { get; private set; }

		public static ConfigEntry<int> ChanceOnDeath { get; private set; }

		public static ConfigEntry<int> ChanceOnDeathLastDay { get; private set; }

		public static ConfigEntry<NextAdAction> PlayOnHurt { get; private set; }

		public static ConfigEntry<int> ChanceOnHurt { get; private set; }

		public static ConfigEntry<int> ChanceOnHurtLastDay { get; private set; }

		public static ConfigEntry<string> Blacklist { get; private set; }

		public static List<string> BlacklistItems
		{
			get
			{
				if (Blacklist == null || string.IsNullOrEmpty(Blacklist.Value))
				{
					return new List<string>();
				}
				return Blacklist.Value.Split(',').ToList();
			}
		}

		public static ConfigEntry<string> SalesText { get; private set; }

		public static List<Tuple<string, int>> SalesTextList
		{
			get
			{
				if (SalesText == null || string.IsNullOrEmpty(SalesText.Value))
				{
					return new List<Tuple<string, int>>();
				}
				int result;
				return (from s in SalesText.Value.Split(',')
					select s.Split(':') into parts
					where parts.Length == 2 && int.TryParse(parts[1], out result)
					select new Tuple<string, int>(parts[0], int.Parse(parts[1]))).ToList();
			}
		}

		public static void Init(ConfigFile config)
		{
			if (Instance == null)
			{
				Instance = new ConfigManager(config);
			}
		}

		private static void SanitizeSalesText()
		{
			string[] array = SalesText.Value.Split(',');
			int num = 0;
			if (Plugin.debug)
			{
				Plugin.logger.LogInfo((object)"Sales texts:");
			}
			for (int i = 0; i < array.Length; i++)
			{
				string[] array2 = array[i].Split(':');
				if (array2.Length != 2 || !int.TryParse(array2[1], out var result) || result < 0)
				{
					string[] obj = new string[2]
					{
						array2[0],
						null
					};
					int num2 = ++num;
					obj[1] = num2.ToString();
					array2 = obj;
					array[i] = string.Join(":", array2);
				}
				else
				{
					num = result;
				}
				if (Plugin.debug)
				{
					Plugin.logger.LogInfo((object)("- " + array[i]));
				}
			}
			SalesText.SettingChanged -= SalesTextHook;
			SalesText.Value = string.Join(",", array);
			SalesText.SettingChanged += SalesTextHook;
		}

		private static void SalesTextHook(object sender, EventArgs args)
		{
			SanitizeSalesText();
		}

		private ConfigManager(ConfigFile config)
		{
			if (Plugin.debug)
			{
				Plugin.logger.LogInfo((object)"Initializing ConfigManager...");
			}
			MaxAdsPerDay = config.Bind<int>("General", "Max ads per day", -1, "Maximum number of ads to show per day. -1 means unlimited.");
			MaxAdsPerQuota = config.Bind<int>("General", "Max ads per quota", -1, "Maximum number of ads to show each quota. -1 means unlimited. Vanilla is 1");
			ChanceOnLanding = config.Bind<int>("General", "Chance to play ad on landing", 100, "Chance to show an ad as soon as possible upon landing. In percent. Vanilla is 0%.");
			ChanceOnLandingLastDay = config.Bind<int>("General", "Chance to play ad on landing on last day", 100, "Chance to show an ad as soon as possible upon landing on the last day before quota is due. In percent. Vanilla is 0%.");
			ChanceForFirstAd = config.Bind<int>("General", "Chance to play at least one ad without other triggers", 100, "Chance for an ad to be scheduled on landing, if the one during landing is skipped. In percent. Vanilla is 33%. (Except on final day when it's 60% but there's no setting for that yet.)");
			ChanceForFirstAdLastDay = config.Bind<int>("General", "Chance to play at least one ad without other triggers on last day", 100, "Chance for an ad to be scheduled on landing on the last day before quota is due, if the one during landing is skipped. In percent. Vanilla is 60%.");
			ChanceForReset = config.Bind<int>("General", "Chance to schedule an ad after one is played", 100, "Chance for an ad to be scheduled on landing, if the one during landing is skipped. In percent. Vanilla is 0%");
			ChanceForResetLastDay = config.Bind<int>("General", "Chance to schedule an ad after one is played on last day", 100, "Chance for an ad to be scheduled on landing on the last day before quota is due, if the one during landing is skipped. In percent. Vanilla is 0%");
			EarliestTimeToShowAd = config.Bind<float>("General", "Earliest time to show ad", 0f, "The earliest time in the day to show an ad, in normalized time (0.0f to 1.0f). Vanilla is 0.0f.");
			LatestTimeToShowAd = config.Bind<float>("General", "Latest time to show ad", 0.9f, "The latest time in the day to show an ad, in normalized time (0.0f to 1.0f). Vanilla is 0.7f.");
			MinimumTimeBetweenAds = config.Bind<float>("General", "Minimum time between ads (seconds)", 60f, "The minimum time in seconds between ads.");
			PlayOnDeath = config.Bind<NextAdAction>("General", "Play ad on death", NextAdAction.RerollNext, "What to do with ads when the player dies. Options: Immediately, RerollNext, None.");
			ChanceOnDeath = config.Bind<int>("General", "Chance to play ad on death", 100, "Chance to apply the action above when the player dies. In percent. If you want more control.");
			ChanceOnDeathLastDay = config.Bind<int>("General", "Chance to play ad on death on last day", 100, "Chance to apply the action above when the player dies on the last day before quota is due. In percent. If you want more control.");
			PlayOnHurt = config.Bind<NextAdAction>("General", "Play ad on hurt", NextAdAction.RerollNext, "What to do with ads when the player is hurt. Options: Immediately, RerollNext, None.");
			ChanceOnHurt = config.Bind<int>("General", "Chance to play ad on hurt", 100, "Chance to apply the action above when the player is hurt. In percent. If you want more control.");
			ChanceOnHurtLastDay = config.Bind<int>("General", "Chance to play ad on hurt on last day", 100, "Chance to apply the action above when the player is hurt on the last day before quota is due. In percent. If you want more control.");
			Blacklist = config.Bind<string>("General", "Blacklist", "Bee Suit,Bunny Suit,Green suit,Hazard suit,Pajama suit,Purple Suit", "List of item names to never show. Use the exact name as it appears in the game, comma separated.");
			SalesText = config.Bind<string>("General", "Sales Text", "CURES CANCER!:3,NO WAY!:3,LIMITED TIME ONLY!:24,GET YOURS TODAY!:30,AVAILABLE NOW!:40", "List of sales text to use for ads. Format: 'Text:Weight', comma separated. Defaults to vanilla values.");
			SanitizeSalesText();
			SalesText.SettingChanged += SalesTextHook;
		}
	}
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	internal class LethalConfigManager
	{
		public static LethalConfigManager Instance { get; private set; }

		public static void Init(ConfigFile config)
		{
			if (Instance == null)
			{
				Instance = new LethalConfigManager(config);
			}
		}

		private LethalConfigManager(ConfigFile config)
		{
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Expected O, but got Unknown
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Expected O, but got Unknown
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Expected O, but got Unknown
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_0040: Expected O, but got Unknown
			//IL_0046: 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_0052: Expected O, but got Unknown
			//IL_0053: Unknown result type (might be due to invalid IL or missing references)
			//IL_005b: Expected O, but got Unknown
			//IL_005c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0069: Expected O, but got Unknown
			//IL_0064: Unknown result type (might be due to invalid IL or missing references)
			//IL_006e: Expected O, but got Unknown
			//IL_0074: Unknown result type (might be due to invalid IL or missing references)
			//IL_0079: Unknown result type (might be due to invalid IL or missing references)
			//IL_0080: Expected O, but got Unknown
			//IL_0081: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: Expected O, but got Unknown
			//IL_008a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0097: Expected O, but got Unknown
			//IL_0092: Unknown result type (might be due to invalid IL or missing references)
			//IL_009c: Expected O, but got Unknown
			//IL_00a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ae: Expected O, but got Unknown
			//IL_00af: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b7: Expected O, but got Unknown
			//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c5: Expected O, but got Unknown
			//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ca: Expected O, but got Unknown
			//IL_00d0: 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_00dc: Expected O, but got Unknown
			//IL_00dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e5: Expected O, but got Unknown
			//IL_00e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f3: Expected O, but got Unknown
			//IL_00ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f8: Expected O, but got Unknown
			//IL_00fe: Unknown result type (might be due to invalid IL or missing references)
			//IL_0103: Unknown result type (might be due to invalid IL or missing references)
			//IL_010a: Expected O, but got Unknown
			//IL_010b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0113: Expected O, but got Unknown
			//IL_0114: Unknown result type (might be due to invalid IL or missing references)
			//IL_0121: Expected O, but got Unknown
			//IL_011c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0126: Expected O, but got Unknown
			//IL_012c: 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_0138: Expected O, but got Unknown
			//IL_0139: Unknown result type (might be due to invalid IL or missing references)
			//IL_0141: Expected O, but got Unknown
			//IL_0142: Unknown result type (might be due to invalid IL or missing references)
			//IL_014f: Expected O, but got Unknown
			//IL_014a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0154: Expected O, but got Unknown
			//IL_015a: Unknown result type (might be due to invalid IL or missing references)
			//IL_015f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0166: Expected O, but got Unknown
			//IL_0167: Unknown result type (might be due to invalid IL or missing references)
			//IL_016f: Expected O, but got Unknown
			//IL_0170: Unknown result type (might be due to invalid IL or missing references)
			//IL_017d: Expected O, but got Unknown
			//IL_0178: Unknown result type (might be due to invalid IL or missing references)
			//IL_0182: Expected O, but got Unknown
			//IL_0188: Unknown result type (might be due to invalid IL or missing references)
			//IL_018d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0198: Expected O, but got Unknown
			//IL_0199: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a4: Expected O, but got Unknown
			//IL_01a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b2: Expected O, but got Unknown
			//IL_01ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b7: Expected O, but got Unknown
			//IL_01bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01cd: Expected O, but got Unknown
			//IL_01ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d9: Expected O, but got Unknown
			//IL_01da: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e7: Expected O, but got Unknown
			//IL_01e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ec: Expected O, but got Unknown
			//IL_01f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0202: Expected O, but got Unknown
			//IL_0203: Unknown result type (might be due to invalid IL or missing references)
			//IL_020e: Expected O, but got Unknown
			//IL_020f: Unknown result type (might be due to invalid IL or missing references)
			//IL_021c: Expected O, but got Unknown
			//IL_0217: Unknown result type (might be due to invalid IL or missing references)
			//IL_0221: Expected O, but got Unknown
			//IL_0238: Unknown result type (might be due to invalid IL or missing references)
			//IL_023d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0244: Expected O, but got Unknown
			//IL_0245: Unknown result type (might be due to invalid IL or missing references)
			//IL_024d: Expected O, but got Unknown
			//IL_024e: Unknown result type (might be due to invalid IL or missing references)
			//IL_025b: Expected O, but got Unknown
			//IL_0256: Unknown result type (might be due to invalid IL or missing references)
			//IL_0260: Expected O, but got Unknown
			//IL_0266: Unknown result type (might be due to invalid IL or missing references)
			//IL_026b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0272: Expected O, but got Unknown
			//IL_0273: Unknown result type (might be due to invalid IL or missing references)
			//IL_027b: Expected O, but got Unknown
			//IL_027c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0289: Expected O, but got Unknown
			//IL_0284: Unknown result type (might be due to invalid IL or missing references)
			//IL_028e: Expected O, but got Unknown
			//IL_02a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_02aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b1: Expected O, but got Unknown
			//IL_02b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ba: Expected O, but got Unknown
			//IL_02bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c8: Expected O, but got Unknown
			//IL_02c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_02cd: Expected O, but got Unknown
			//IL_02d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_02df: Expected O, but got Unknown
			//IL_02e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e8: Expected O, but got Unknown
			//IL_02e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f6: Expected O, but got Unknown
			//IL_02f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_02fb: Expected O, but got Unknown
			//IL_0302: Unknown result type (might be due to invalid IL or missing references)
			//IL_030c: Expected O, but got Unknown
			//IL_0313: Unknown result type (might be due to invalid IL or missing references)
			//IL_031d: Expected O, but got Unknown
			LethalConfigManager.SetModDescription("Wait... This isn't an adblocker?");
			ConfigEntry<int> maxAdsPerDay = ConfigManager.MaxAdsPerDay;
			IntSliderOptions val = new IntSliderOptions();
			((BaseRangeOptions<int>)val).Min = -1;
			((BaseRangeOptions<int>)val).Max = 100;
			((BaseOptions)val).RequiresRestart = false;
			LethalConfigManager.AddConfigItem((BaseConfigItem)new IntSliderConfigItem(maxAdsPerDay, val));
			ConfigEntry<int> maxAdsPerQuota = ConfigManager.MaxAdsPerQuota;
			IntSliderOptions val2 = new IntSliderOptions();
			((BaseRangeOptions<int>)val2).Min = -1;
			((BaseRangeOptions<int>)val2).Max = 100;
			((BaseOptions)val2).RequiresRestart = false;
			LethalConfigManager.AddConfigItem((BaseConfigItem)new IntSliderConfigItem(maxAdsPerQuota, val2));
			ConfigEntry<int> chanceOnLanding = ConfigManager.ChanceOnLanding;
			IntSliderOptions val3 = new IntSliderOptions();
			((BaseRangeOptions<int>)val3).Min = 0;
			((BaseRangeOptions<int>)val3).Max = 100;
			((BaseOptions)val3).RequiresRestart = false;
			LethalConfigManager.AddConfigItem((BaseConfigItem)new IntSliderConfigItem(chanceOnLanding, val3));
			ConfigEntry<int> chanceOnLandingLastDay = ConfigManager.ChanceOnLandingLastDay;
			IntSliderOptions val4 = new IntSliderOptions();
			((BaseRangeOptions<int>)val4).Min = 0;
			((BaseRangeOptions<int>)val4).Max = 100;
			((BaseOptions)val4).RequiresRestart = false;
			LethalConfigManager.AddConfigItem((BaseConfigItem)new IntSliderConfigItem(chanceOnLandingLastDay, val4));
			ConfigEntry<int> chanceForFirstAd = ConfigManager.ChanceForFirstAd;
			IntSliderOptions val5 = new IntSliderOptions();
			((BaseRangeOptions<int>)val5).Min = 0;
			((BaseRangeOptions<int>)val5).Max = 100;
			((BaseOptions)val5).RequiresRestart = false;
			LethalConfigManager.AddConfigItem((BaseConfigItem)new IntSliderConfigItem(chanceForFirstAd, val5));
			ConfigEntry<int> chanceForFirstAdLastDay = ConfigManager.ChanceForFirstAdLastDay;
			IntSliderOptions val6 = new IntSliderOptions();
			((BaseRangeOptions<int>)val6).Min = 0;
			((BaseRangeOptions<int>)val6).Max = 100;
			((BaseOptions)val6).RequiresRestart = false;
			LethalConfigManager.AddConfigItem((BaseConfigItem)new IntSliderConfigItem(chanceForFirstAdLastDay, val6));
			ConfigEntry<int> chanceForReset = ConfigManager.ChanceForReset;
			IntSliderOptions val7 = new IntSliderOptions();
			((BaseRangeOptions<int>)val7).Min = 0;
			((BaseRangeOptions<int>)val7).Max = 100;
			((BaseOptions)val7).RequiresRestart = false;
			LethalConfigManager.AddConfigItem((BaseConfigItem)new IntSliderConfigItem(chanceForReset, val7));
			ConfigEntry<int> chanceForResetLastDay = ConfigManager.ChanceForResetLastDay;
			IntSliderOptions val8 = new IntSliderOptions();
			((BaseRangeOptions<int>)val8).Min = 0;
			((BaseRangeOptions<int>)val8).Max = 100;
			((BaseOptions)val8).RequiresRestart = false;
			LethalConfigManager.AddConfigItem((BaseConfigItem)new IntSliderConfigItem(chanceForResetLastDay, val8));
			ConfigEntry<float> earliestTimeToShowAd = ConfigManager.EarliestTimeToShowAd;
			FloatSliderOptions val9 = new FloatSliderOptions();
			((BaseRangeOptions<float>)val9).Min = 0f;
			((BaseRangeOptions<float>)val9).Max = 1f;
			((BaseOptions)val9).RequiresRestart = false;
			LethalConfigManager.AddConfigItem((BaseConfigItem)new FloatSliderConfigItem(earliestTimeToShowAd, val9));
			ConfigEntry<float> latestTimeToShowAd = ConfigManager.LatestTimeToShowAd;
			FloatSliderOptions val10 = new FloatSliderOptions();
			((BaseRangeOptions<float>)val10).Min = 0f;
			((BaseRangeOptions<float>)val10).Max = 1f;
			((BaseOptions)val10).RequiresRestart = false;
			LethalConfigManager.AddConfigItem((BaseConfigItem)new FloatSliderConfigItem(latestTimeToShowAd, val10));
			ConfigEntry<float> minimumTimeBetweenAds = ConfigManager.MinimumTimeBetweenAds;
			FloatSliderOptions val11 = new FloatSliderOptions();
			((BaseRangeOptions<float>)val11).Min = 0f;
			((BaseRangeOptions<float>)val11).Max = 300f;
			((BaseOptions)val11).RequiresRestart = false;
			LethalConfigManager.AddConfigItem((BaseConfigItem)new FloatSliderConfigItem(minimumTimeBetweenAds, val11));
			LethalConfigManager.AddConfigItem((BaseConfigItem)(object)new EnumDropDownConfigItem<ConfigManager.NextAdAction>(ConfigManager.PlayOnDeath, false));
			ConfigEntry<int> chanceOnDeath = ConfigManager.ChanceOnDeath;
			IntSliderOptions val12 = new IntSliderOptions();
			((BaseRangeOptions<int>)val12).Min = 0;
			((BaseRangeOptions<int>)val12).Max = 100;
			((BaseOptions)val12).RequiresRestart = false;
			LethalConfigManager.AddConfigItem((BaseConfigItem)new IntSliderConfigItem(chanceOnDeath, val12));
			ConfigEntry<int> chanceOnDeathLastDay = ConfigManager.ChanceOnDeathLastDay;
			IntSliderOptions val13 = new IntSliderOptions();
			((BaseRangeOptions<int>)val13).Min = 0;
			((BaseRangeOptions<int>)val13).Max = 100;
			((BaseOptions)val13).RequiresRestart = false;
			LethalConfigManager.AddConfigItem((BaseConfigItem)new IntSliderConfigItem(chanceOnDeathLastDay, val13));
			LethalConfigManager.AddConfigItem((BaseConfigItem)(object)new EnumDropDownConfigItem<ConfigManager.NextAdAction>(ConfigManager.PlayOnHurt, false));
			ConfigEntry<int> chanceOnHurt = ConfigManager.ChanceOnHurt;
			IntSliderOptions val14 = new IntSliderOptions();
			((BaseRangeOptions<int>)val14).Min = 0;
			((BaseRangeOptions<int>)val14).Max = 100;
			((BaseOptions)val14).RequiresRestart = false;
			LethalConfigManager.AddConfigItem((BaseConfigItem)new IntSliderConfigItem(chanceOnHurt, val14));
			ConfigEntry<int> chanceOnHurtLastDay = ConfigManager.ChanceOnHurtLastDay;
			IntSliderOptions val15 = new IntSliderOptions();
			((BaseRangeOptions<int>)val15).Min = 0;
			((BaseRangeOptions<int>)val15).Max = 100;
			((BaseOptions)val15).RequiresRestart = false;
			LethalConfigManager.AddConfigItem((BaseConfigItem)new IntSliderConfigItem(chanceOnHurtLastDay, val15));
			LethalConfigManager.AddConfigItem((BaseConfigItem)new TextInputFieldConfigItem(ConfigManager.Blacklist, false));
			LethalConfigManager.AddConfigItem((BaseConfigItem)new TextInputFieldConfigItem(ConfigManager.SalesText, false));
		}
	}
}
namespace MoreAds.Compat
{
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	internal class LobbyCompatibilityManager
	{
		public static LobbyCompatibilityManager Instance { get; private set; }

		public static void Init()
		{
			if (Instance == null)
			{
				Instance = new LobbyCompatibilityManager();
			}
		}

		private LobbyCompatibilityManager()
		{
			PluginHelper.RegisterPlugin("MoreAds", new Version("2.0.2"), (CompatibilityLevel)1, (VersionStrictness)0);
		}
	}
}