Please disclose if your mod was created primarily 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 NoMoreCheatCompany v1.0.3
NoMoreCheatCompany.dll
Decompiled 2 years agousing System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using BepInEx.Logging; using GameNetcodeStuff; using HarmonyLib; using NoMoreCheatCompany.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: AssemblyTitle("NoMoreCheatCompany")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("NoMoreCheatCompany")] [assembly: AssemblyCopyright("Copyright © 2024")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("fa45ba87-70ba-4d08-bcb5-fa8bb4d4232e")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")] [assembly: AssemblyVersion("1.0.0.0")] namespace NoMoreCheatCompany { [BepInPlugin("com.NoMoreCheatCompany", "NoMoreCheatCompany", "1.0.3")] public class NoMoreCheatCompany : BaseUnityPlugin { private const string modGUID = "com.NoMoreCheatCompany"; private const string modName = "NoMoreCheatCompany"; private const string modVersion = "1.0.3"; private readonly Harmony harmony = new Harmony("com.NoMoreCheatCompany"); private static NoMoreCheatCompany Instance; internal ManualLogSource mls; private void Awake() { if ((Object)(object)Instance == (Object)null) { Instance = this; } mls = Logger.CreateLogSource("com.NoMoreCheatCompany"); mls.LogInfo((object)"[NoMoreCheatCompany] Loaded"); harmony.PatchAll(typeof(NoMoreCheatCompany)); harmony.PatchAll(typeof(NoGodMod)); harmony.PatchAll(typeof(NoSpeedHacking)); harmony.PatchAll(typeof(Teleportation)); harmony.PatchAll(typeof(InfiniteStamina)); harmony.PatchAll(typeof(LoadLobby)); mls.LogInfo((object)"[NoMoreCheatCompany] Patching successful."); } } } namespace NoMoreCheatCompany.Patches { [HarmonyPatch(typeof(PlayerControllerB))] internal class InfiniteStamina { [HarmonyPatch("LateUpdate")] [HarmonyPostfix] private static void InfiniteStaminaCheck(ref PlayerControllerB __instance) { if (__instance.isSprinting && __instance.sprintMeter < 0f) { HUDManager.Instance.AddTextToChatOnServer("[NoMoreCheatCompany] Player " + __instance.playerUsername + " is cheating. (Infinite Stamina)", -1); } } } [HarmonyPatch(typeof(PlayerControllerB))] internal class LoadLobby { [HarmonyPatch("SpawnPlayerAnimation")] [HarmonyPostfix] private static void SpawnMessage(ref PlayerControllerB __instance) { if (((NetworkBehaviour)__instance).IsHost) { HUDManager.Instance.AddTextToChatOnServer("[NoMoreCheatCompany] You're lobby is protected by NoMoreCheatCompany.", -1); } } } [HarmonyPatch(typeof(PlayerControllerB))] internal class NoGodMod { [HarmonyPatch("DamagePlayerFromOtherClientServerRpc")] [HarmonyPostfix] private static void GodModCheck(ref PlayerControllerB __instance, ref int damageAmount) { if (damageAmount > 0) { if (Mathf.Approximately((float)__instance.health, (float)(__instance.health - damageAmount))) { return; } HUDManager.Instance.AddTextToChatOnServer("[NoMoreCheatCompany] Player " + __instance.playerUsername + " detected cheating (GodMode)", -1); if (!((NetworkBehaviour)__instance).IsHost) { NetworkManager.Singleton.DisconnectClient(__instance.playerClientId, "NoMoreCheatCompany - Using godmode."); } } if (__instance.health > 100) { HUDManager.Instance.AddTextToChatOnServer("[NoMoreCheatCompany] Player " + __instance.playerUsername + " detected cheating (GodMode)", -1); if (!((NetworkBehaviour)__instance).IsHost) { NetworkManager.Singleton.DisconnectClient(__instance.playerClientId, "NoMoreCheatCompany - Using godmode."); } } if (__instance.health < 0) { HUDManager.Instance.AddTextToChatOnServer("[NoMoreCheatCompany] Player " + __instance.playerUsername + " detected cheating (GodMode)", -1); } } } [HarmonyPatch(typeof(PlayerControllerB))] internal class NoSpeedHacking { [HarmonyPatch("Update")] [HarmonyPostfix] private static void SpeedhackCheck(ref PlayerControllerB __instance) { if (__instance.isSprinting && (float)__instance.velocityAverageCount > 1f) { HUDManager.Instance.AddTextToChatOnServer("[NoMoreCheatCompany] Player " + __instance.playerUsername + " is cheating. (SpeedHacking)", -1); if (!((NetworkBehaviour)__instance).IsHost) { NetworkManager.Singleton.DisconnectClient(__instance.playerClientId, "NoMoreCheatCompany - Using speed hacking."); } } } } [HarmonyPatch(typeof(PlayerControllerB))] internal class Teleportation { [HarmonyPatch("Update")] [HarmonyPostfix] private static void TeleportationCheck(ref PlayerControllerB __instance) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) if (!__instance.teleportedLastFrame && ((Component)__instance).transform.position.y < -1000f) { HUDManager.Instance.AddTextToChatOnServer("[NoMoreCheatCompany] Player " + __instance.playerUsername + " is cheating. (Teleportation)", -1); if (!((NetworkBehaviour)__instance).IsHost) { NetworkManager.Singleton.DisconnectClient(__instance.playerClientId, "NoMoreCheatCompany - Using speed hacking."); } } } } }