Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of AutoPauseSoloMultiplayer v1.0.0
AutoPauseSoloMultiplayer/BunsRoR2Mods.dll
Decompiled a day agousing System; 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 BepInEx; using BepInEx.Logging; using Microsoft.CodeAnalysis; using On.RoR2; using On.RoR2.UI; using RoR2; using RoR2.UI; [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("BunsRoR2Mods")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("BunsRoR2Mods")] [assembly: AssemblyTitle("BunsRoR2Mods")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [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 BunsRoR2Mods { [BepInPlugin("Lilybunvy.AutoPauseSoloMultiplayer", "AutoPauseSoloMultiplayer", "1.0.0")] public class AutoPauseSoloMultiplayer : BaseUnityPlugin { public const string PluginAuthor = "Lilybunvy"; public const string PluginName = "AutoPauseSoloMultiplayer"; public const string PluginGUID = "Lilybunvy.AutoPauseSoloMultiplayer"; public const string PluginVersion = "1.0.0"; public bool isCurrentlyActive; public void Awake() { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Expected O, but got Unknown //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Expected O, but got Unknown //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Expected O, but got Unknown Log.Init(((BaseUnityPlugin)this).Logger); isCurrentlyActive = false; PauseScreenController.Awake += new hook_Awake(OnPauseMenuOpened); Chat.SendPlayerPausedMessage += new hook_SendPlayerPausedMessage(SendPlayerPausedMessageOverride); Chat.SendPlayerResumedMessage += new hook_SendPlayerResumedMessage(SendPlayerResumedMessageOverride); } private void OnPauseMenuOpened(orig_Awake orig, PauseScreenController self) { orig.Invoke(self); if (!RoR2Application.isInMultiPlayer) { return; } if (Run.instance.participatingPlayerCount != 1) { if (isCurrentlyActive) { ShowPauseButton(self); isCurrentlyActive = false; } } else if (PauseStopController.instance.allowMultiplayerPause && PauseManager.IsAbleToPause) { isCurrentlyActive = true; self.ServerPauseGameButton(); self.resumeButtonTimer = 0f; HidePauseButton(self); } } private void HidePauseButton(PauseScreenController screen) { screen.pauseButtonObject.SetActive(false); } private void ShowPauseButton(PauseScreenController screen) { screen.pauseButtonObject.SetActive(true); } private void SendPlayerPausedMessageOverride(orig_SendPlayerPausedMessage orig, string playerName) { if (!isCurrentlyActive) { orig.Invoke(playerName); } } private void SendPlayerResumedMessageOverride(orig_SendPlayerResumedMessage orig, string playerName) { if (!isCurrentlyActive) { orig.Invoke(playerName); } } } internal static class Log { private static ManualLogSource _logSource; internal static void Init(ManualLogSource logSource) { _logSource = logSource; } private static string Format(object data, string file, int line) { string fileName = Path.GetFileName(file); return $"[{fileName}:{line}] {data}"; } internal static void Debug(object data, [CallerFilePath] string file = "", [CallerLineNumber] int line = 0) { _logSource.LogDebug((object)Format(data, file, line)); } internal static void Error(object data, [CallerFilePath] string file = "", [CallerLineNumber] int line = 0) { _logSource.LogError((object)Format(data, file, line)); } internal static void Fatal(object data, [CallerFilePath] string file = "", [CallerLineNumber] int line = 0) { _logSource.LogFatal((object)Format(data, file, line)); } internal static void Info(object data, [CallerFilePath] string file = "", [CallerLineNumber] int line = 0) { _logSource.LogInfo((object)Format(data, file, line)); } internal static void Message(object data, [CallerFilePath] string file = "", [CallerLineNumber] int line = 0) { _logSource.LogMessage((object)Format(data, file, line)); } internal static void Warning(object data, [CallerFilePath] string file = "", [CallerLineNumber] int line = 0) { _logSource.LogWarning((object)Format(data, file, line)); } } }