Decompiled source of Chat Mute v1.0.1

BepInEx/plugins/ChatMute/ChatMute.dll

Decompiled a month ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using ComputerysModdingUtilities;
using HarmonyLib;
using HeathenEngineering.DEMO;
using HeathenEngineering.SteamworksIntegration;
using Microsoft.CodeAnalysis;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: StraftatMod(true)]
[assembly: TargetFramework(".NETFramework,Version=v4.7.1", FrameworkDisplayName = ".NET Framework 4.7.1")]
[assembly: AssemblyCompany("STRAFTATMod")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("6.9.4.20")]
[assembly: AssemblyInformationalVersion("6.9.4.20")]
[assembly: AssemblyProduct("debugPlgn")]
[assembly: AssemblyTitle("STRAFTATMod")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("6.9.4.20")]
[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 STRAFMOD
{
	public static class MyPluginInfo
	{
		public const string PLUGIN_GUID = "STRAFTATMod";

		public const string PLUGIN_NAME = "debugPlgn";

		public const string PLUGIN_VERSION = "6.9.4.20";
	}
}
namespace STRAFTATMod
{
	[BepInPlugin("dimolade.dimolade.ChatMute", "Chat Mute", "1.0.0.0")]
	public class Loader : BaseUnityPlugin
	{
		private void Awake()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Expected O, but got Unknown
			Harmony val = new Harmony("dimolade.harmony.ChatMute");
			val.PatchAll();
		}
	}
	[HarmonyPatch(typeof(LobbyChatUILogic), "HandleChatMessage")]
	internal class ChatPatcher
	{
		private static bool Prefix(LobbyChatUILogic __instance, ref LobbyChatMsg message)
		{
			if (((UserData)(ref message.sender)).IsMe)
			{
				return true;
			}
			GameObject[] array = GameObject.FindGameObjectsWithTag("ClientInstance");
			foreach (GameObject val in array)
			{
				if (val.GetComponent<ClientInstance>().PlayerSteamID == ((UserData)(ref message.sender)).SteamId)
				{
					return !val.GetComponent<AudioSource>().mute;
				}
			}
			return true;
		}
	}
}