using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using System.Text.RegularExpressions;
using BepInEx;
using HarmonyLib;
using Microsoft.CodeAnalysis;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyCompany("NewFishNotifier")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyDescription("On-Together Mod")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("NewFishNotifier")]
[assembly: AssemblyTitle("NewFishNotifier")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.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 NewFishNotifier
{
[BepInPlugin("com.jordon.newfishnotifier", "New Fish Notifier", "1.0.0")]
public class NewFishNotifierPlugin : BaseUnityPlugin
{
private void Awake()
{
Harmony.CreateAndPatchAll(typeof(FishCatchPatch), (string)null);
((BaseUnityPlugin)this).Logger.LogInfo((object)"New Fish Notifier loaded!");
}
}
[HarmonyPatch(typeof(FishingUIManager))]
public static class FishCatchPatch
{
[HarmonyPatch("UpdateFishCatalogue")]
[HarmonyPrefix]
public static void OnFishCaught(int rarity, int fish, float size, FishSource source)
{
//IL_000e: Unknown result type (might be due to invalid IL or missing references)
//IL_000f: Unknown result type (might be due to invalid IL or missing references)
//IL_0011: Unknown result type (might be due to invalid IL or missing references)
//IL_0013: Unknown result type (might be due to invalid IL or missing references)
//IL_0014: Unknown result type (might be due to invalid IL or missing references)
//IL_0026: Expected I4, but got Unknown
//IL_0062: Unknown result type (might be due to invalid IL or missing references)
//IL_0067: Unknown result type (might be due to invalid IL or missing references)
//IL_0069: 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_008f: Unknown result type (might be due to invalid IL or missing references)
//IL_0099: Unknown result type (might be due to invalid IL or missing references)
PlayerDataZip playerDataZip = MonoSingleton<DataManager>.I.PlayerDataZip;
List<FishCatalogue> list = null;
switch ((int)source)
{
case 0:
list = playerDataZip.FishCatalogues;
break;
case 1:
list = playerDataZip.FreshFishCatalogues;
break;
case 2:
list = playerDataZip.GarbageCatalogues;
break;
}
if (list != null && rarity < list.Count)
{
FishCatalogue val = list[rarity];
if (fish < val.Caughts.Count && !val.Caughts[fish])
{
string fishName = GetFishName(source, fish);
FishRarity val2 = (FishRarity)rarity;
string text = ((object)(FishRarity)(ref val2)).ToString();
NetworkSingleton<TextChannelManager>.I.AddNotification("You caught a NEW " + text + " " + fishName + "!");
}
}
}
private static string GetFishName(FishSource source, int index)
{
//IL_000d: Unknown result type (might be due to invalid IL or missing references)
//IL_000e: Unknown result type (might be due to invalid IL or missing references)
//IL_000f: Unknown result type (might be due to invalid IL or missing references)
//IL_0010: Unknown result type (might be due to invalid IL or missing references)
//IL_0011: Unknown result type (might be due to invalid IL or missing references)
//IL_0023: Expected I4, but got Unknown
//IL_0043: Unknown result type (might be due to invalid IL or missing references)
//IL_0048: 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_007f: Unknown result type (might be due to invalid IL or missing references)
//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
//IL_00b6: Unknown result type (might be due to invalid IL or missing references)
FishingSettings i = ScriptableSingleton<FishingSettings>.I;
string text = "Unknown";
Fish val;
switch ((int)source)
{
case 0:
if (index < i.Fishes.Count)
{
val = i.Fishes[index];
text = ((object)(FishType)(ref val.FishType)).ToString();
}
break;
case 1:
if (index < i.FreshFishes.Count)
{
val = i.FreshFishes[index];
text = ((object)(FishType)(ref val.FishType)).ToString();
}
break;
case 2:
if (index < i.Garbages.Count)
{
val = i.Garbages[index];
text = ((object)(FishType)(ref val.FishType)).ToString();
}
break;
}
return AddSpacesToSentence(text);
}
private static string AddSpacesToSentence(string text)
{
if (string.IsNullOrEmpty(text))
{
return "";
}
return Regex.Replace(text, "([a-z])([A-Z])", "$1 $2");
}
}
}