Decompiled source of Eights v0.4.87
Eights.dll
Decompiled a month ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Globalization; using System.IO; using System.Linq; using System.Reflection; using System.Reflection.Emit; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using System.Text; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using BepInEx.Logging; using ComputerysModdingUtilities; using FishNet; using FishNet.Connection; using FishNet.Managing; using FishNet.Managing.Scened; using FishNet.Object; using HarmonyLib; using Microsoft.CodeAnalysis; using ModMenu.Api; using ModMenu.Behaviours.OptionList.ValueControllers; using MyceliumNetworking; using Steamworks; using TMPro; using UnityEngine; using UnityEngine.InputSystem; using UnityEngine.Rendering; using UnityEngine.SceneManagement; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: StraftatMod(false)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("Eights")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("0.4.87.0")] [assembly: AssemblyInformationalVersion("0.4.87+ad18c257ecd16f3891d2b0911bb003f03d3bc7d7")] [assembly: AssemblyProduct("Straftat Eights")] [assembly: AssemblyTitle("Eights")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("0.4.87.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte P_0) { Flag = P_0; } } [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 Eights { [BepInPlugin("Eights", "Straftat Eights", "0.4.87")] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInProcess("STRAFTAT.exe")] public class Plugin : BaseUnityPlugin { internal const uint AssassintatModId = 3141592658u; internal static ConfigEntry<bool> AssassintatEnabled; internal static ConfigEntry<int> MaximumBloodEffects; internal const uint CapturetatModId = 1618033995u; internal static ConfigEntry<bool> CapturetatEnabled; internal const uint ChambertatModId = 2718281829u; internal static ConfigEntry<bool> ChambertatEnabled; internal const uint CountertatModId = 1618034002u; internal static ConfigEntry<bool> CountertatEnabled; internal const uint FfatatModId = 2718281828u; internal static ConfigEntry<bool> FfatatEnabled; internal const uint GlobalModifiersModId = 1892737465u; internal static ConfigEntry<bool> MovementTweaksEnabled; internal static ConfigEntry<bool> WallJumpEnabled; internal static ConfigEntry<bool> WallJumpBoostEnabled; internal static ConfigEntry<bool> SlidingEnabled; internal static ConfigEntry<bool> SilentWalking; internal static ConfigEntry<bool> SlideBoostEnabled; internal static ConfigEntry<int> MoveSpeedPercent; internal static ConfigEntry<int> AdsSpeedPercent; internal static ConfigEntry<int> GravityPercent; internal static ConfigEntry<int> MomentumPercent; internal static ConfigEntry<int> AirSpeedRatioPercent; internal static ConfigEntry<int> ShootingSpeedPercent; internal static ConfigEntry<bool> PlayerRadarEnabled; internal const uint GlobalWeaponsModId = 1618033991u; internal static ConfigEntry<bool> WeaponTweaksEnabled; internal static ConfigEntry<string> AllowedWeapons; internal static ConfigEntry<int> SpareMagazines; internal static ConfigEntry<bool> DefaultKnife; internal static ConfigEntry<string> GuntatWeaponOrder; internal const uint GuntatModId = 1618033990u; internal static ConfigEntry<bool> GuntatEnabled; internal const uint HardtatModId = 1618033994u; internal const float HardtatSpawnRandomness = 0.35f; internal static ConfigEntry<bool> HardtatEnabled; internal const uint HealthSettingsModId = 1892737466u; internal static ConfigEntry<int> MaxHealthPercent; internal static ConfigEntry<bool> HealthTweaksEnabled; internal static ConfigEntry<bool> HealthRegenEnabled; internal static ConfigEntry<int> HealthRegenDelaySeconds; internal static ConfigEntry<int> HealthRegenRate; internal static ConfigEntry<bool> HunttatEnabled; internal static ConfigEntry<bool> NinjatatEnabled; internal static ConfigEntry<bool> TanktatEnabled; internal const uint HvtatModId = 3141592657u; internal static ConfigEntry<bool> HvtatEnabled; internal const uint InfectedtatModId = 2718281832u; internal static ConfigEntry<bool> InfectedtatEnabled; internal const uint InfideltatModId = 2718281831u; internal static ConfigEntry<bool> InfideltatEnabled; internal const uint JuggertatModId = 3141592656u; internal static ConfigEntry<bool> JuggertatEnabled; internal const uint MichaeltatModId = 3141592654u; internal static ConfigEntry<bool> MichaeltatEnabled; internal const uint NifetatModId = 2718281833u; internal static ConfigEntry<bool> NifetatEnabled; internal static ManualLogSource Logger; internal static Plugin Instance; internal const uint PotatoInftatModId = 2718281834u; internal static ConfigEntry<bool> PotatoInftatEnabled; internal const uint PotatotatModId = 2718281830u; internal static ConfigEntry<bool> PotatotatEnabled; internal const uint RatatatModId = 3141592655u; internal static ConfigEntry<bool> RatatatEnabled; internal const uint MyceliumTransportModId = 1618033993u; internal const uint SndtatModId = 1618033996u; internal static ConfigEntry<bool> SndtatEnabled; internal const uint SnipertatModId = 1618033992u; internal static ConfigEntry<bool> SnipertatEnabled; internal const uint StraftatModId = 3141592653u; internal static ConfigEntry<bool> StraftatEnabled; internal const uint TdmtatModId = 1618033997u; internal const float TdmtatSpawnRandomness = 0.35f; internal static ConfigEntry<bool> TdmtatEnabled; private void InitializeAssassintat() { AssassintatEnabled = ModeConfigMigration.BindModeEnabled(((BaseUnityPlugin)this).Config, "Game Modes Enabled", "Assassintat", "A hidden Assassintat hunts the public King while bodyguards protect the King, with role weapons unlocking after a delay. Killing the King awards the Assassintat 50 points; eliminating the Assassintat awards the King 30 points, each surviving bodyguard 10 points, and a bodyguard killer 20 extra points, with the first player to reach the configured point limit winning."); AssassintatEnabled.SettingChanged += delegate { AssassintatState.PushSettingsIfHost(); GameModeManager.OnSettingsChanged(); }; MyceliumNetwork.RegisterNetworkObject((object)this, 3141592658u, 0); ModeLobbyDataSync.RegisterKeys("Eights_Assassintat_Settings", "Eights_Assassintat_Live"); MyceliumNetwork.LobbyCreated += AssassintatState.OnLobbyEntered; MyceliumNetwork.LobbyEntered += AssassintatState.OnLobbyEntered; MyceliumNetwork.LobbyLeft += AssassintatState.OnLobbyLeft; MyceliumNetwork.LobbyDataUpdated += AssassintatState.OnLobbyDataUpdated; MyceliumNetwork.PlayerEntered += AssassintatState.OnPlayerEntered; MyceliumNetwork.PlayerLeft += AssassintatState.OnPlayerLeft; } [CustomRPC] public void SyncAssassintatSettings(CSteamID hostId, int roundId, int revision, bool enabled, RPCInfo info) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) if (NetworkAuthority.IsHostSender(info) && AssassintatState.TryAcceptSettingsSnapshot(hostId, roundId, revision)) { AssassintatState.ApplySettings(enabled); } } [CustomRPC] public void SyncAssassintatLiveState(CSteamID hostId, int kingPlayerId, string scoresData, int winnerId, int takeId, bool weaponsUnlocked, int weaponDelaySeconds, float takeTimeRemaining, int roundId, int revision, RPCInfo info) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) if (NetworkAuthority.IsHostSender(info)) { AssassintatState.ApplyLiveState(hostId, kingPlayerId, scoresData, winnerId, takeId, weaponsUnlocked, weaponDelaySeconds, takeTimeRemaining, roundId, revision); } } [CustomRPC] public void SyncAssassintatRole(CSteamID hostId, int playerId, int takeId, bool isAssassintat, bool isKing, bool announce, int weaponDelaySeconds, RPCInfo info) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) if (NetworkAuthority.IsHostSender(info)) { AssassintatState.ApplyLocalRole(hostId, playerId, takeId, isAssassintat, isKing, announce, weaponDelaySeconds); } } [CustomRPC] public void AssassintatAnnounce(string text, RPCInfo info) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) if (NetworkAuthority.IsHostSender(info)) { GameModeHud.ReceiveAnnouncement(text, 3f, showHud: true); } } private void InitializeBloodCleanup() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Expected O, but got Unknown MaximumBloodEffects = ((BaseUnityPlugin)this).Config.Bind<int>("Global Settings", "Maximum Blood Effects", 25, new ConfigDescription("Local visual limit for live blood effects. Older effects are removed first.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 50), Array.Empty<object>())); BloodCleanupState.ApplyMaximumBloodEffects(MaximumBloodEffects.Value); MaximumBloodEffects.SettingChanged += delegate { if (!MyceliumNetwork.InLobby || MyceliumNetwork.IsHost) { BloodCleanupState.ApplyMaximumBloodEffects(MaximumBloodEffects.Value); } GlobalModifiersState.PushIfHost(); }; } private void InitializeCapturetat() { CapturetatEnabled = ModeConfigMigration.BindModeEnabled(((BaseUnityPlugin)this).Config, "Game Modes Enabled", "Capturetat", "Teams steal the enemy flag and return it to their own base while protecting their flag. Each capture awards 25 points, and the first team to reach the configured point limit wins; after time expires, respawns stop and sudden death resolves the match."); CapturetatEnabled.SettingChanged += delegate { CapturetatState.PushSettingsIfHost(); GameModeManager.OnSettingsChanged(); }; MyceliumNetwork.RegisterNetworkObject((object)this, 1618033995u, 0); ModeLobbyDataSync.RegisterKeys("Eights_CTF_Settings", "Eights_CTF_Live"); MyceliumNetwork.LobbyCreated += CapturetatState.OnLobbyEntered; MyceliumNetwork.LobbyEntered += CapturetatState.OnLobbyEntered; MyceliumNetwork.LobbyLeft += CapturetatState.OnLobbyLeft; MyceliumNetwork.LobbyDataUpdated += CapturetatState.OnLobbyDataUpdated; MyceliumNetwork.PlayerEntered += CapturetatState.OnPlayerEntered; MyceliumNetwork.PlayerLeft += CapturetatState.OnPlayerLeft; } [CustomRPC] public void SyncCapturetatSettings(CSteamID hostId, int roundId, int revision, bool enabled, bool ignoredLegacySpawnerFlag, RPCInfo info) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) if (NetworkAuthority.IsHostSender(info) && CapturetatState.TryAcceptSettingsSnapshot(hostId, roundId, revision)) { CapturetatState.ApplySettings(enabled); } } [CustomRPC] public void SyncCapturetatLiveState(CSteamID hostId, string assignmentsData, int teamCount, string scoresData, string flagsData, float matchTimeRemaining, bool suddenDeath, int roundId, int revision, RPCInfo info) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) if (NetworkAuthority.IsHostSender(info)) { CapturetatState.ApplyLiveState(hostId, assignmentsData, teamCount, scoresData, flagsData, matchTimeRemaining, suddenDeath, roundId, revision); } } private void InitializeChambertat() { ChambertatEnabled = ModeConfigMigration.BindModeEnabled(((BaseUnityPlugin)this).Config, "Game Modes Enabled", "Chambertat", "Each player gets one pistol shot and a Couperet, with no respawns during the take. The last player alive wins 50 points, and the first player to reach the configured point limit wins."); ChambertatEnabled.SettingChanged += delegate { ChambertatState.PushSettingsIfHost(); GameModeManager.OnSettingsChanged(); }; MyceliumNetwork.RegisterNetworkObject((object)this, 2718281829u, 0); ModeLobbyDataSync.RegisterKeys("Eights_Chambertat_Settings", "Eights_Chambertat_Live"); MyceliumNetwork.LobbyCreated += ChambertatState.OnLobbyEntered; MyceliumNetwork.LobbyEntered += ChambertatState.OnLobbyEntered; MyceliumNetwork.LobbyDataUpdated += ChambertatState.OnLobbyDataUpdated; MyceliumNetwork.PlayerEntered += ChambertatState.OnPlayerEntered; MyceliumNetwork.PlayerLeft += ChambertatState.OnPlayerLeft; } [CustomRPC] public void SyncChambertatSettings(CSteamID hostId, int roundId, int revision, bool enabled, RPCInfo info) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) if (NetworkAuthority.IsHostSender(info) && ChambertatState.TryAcceptSettingsSnapshot(hostId, roundId, revision)) { ChambertatState.ApplySettings(enabled); } } [CustomRPC] public void SyncChambertatLiveState(CSteamID hostId, string aliveData, string bulletsData, string scoresData, int takeId, int winnerId, float loadoutSecondsRemaining, int roundId, int revision, RPCInfo info) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) if (NetworkAuthority.IsHostSender(info)) { ChambertatState.ApplyLiveState(hostId, aliveData, bulletsData, scoresData, takeId, winnerId, loadoutSecondsRemaining, roundId, revision); } } [CustomRPC] public void ChambertatAnnounce(string text, RPCInfo info) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) if (NetworkAuthority.IsHostSender(info)) { GameModeHud.ReceiveAnnouncement(text, 3f, showHud: true); } } private void InitializeCountertat() { CountertatEnabled = ModeConfigMigration.BindModeEnabled(((BaseUnityPlugin)this).Config, "Game Modes Enabled", "Countertat", "Two fixed teams fight over the bomb. Aboubi attacks, Shadow Force defends, and each take assigns weapons by player slot."); CountertatEnabled.SettingChanged += delegate { CountertatState.PushSettingsIfHost(); GameModeManager.OnSettingsChanged(); }; MyceliumNetwork.RegisterNetworkObject((object)this, 1618034002u, 0); ModeLobbyDataSync.RegisterKeys("Eights_Countertat_Settings"); MyceliumNetwork.LobbyCreated += CountertatState.OnLobbyEntered; MyceliumNetwork.LobbyEntered += CountertatState.OnLobbyEntered; MyceliumNetwork.LobbyLeft += CountertatState.OnLobbyLeft; MyceliumNetwork.LobbyDataUpdated += CountertatState.OnLobbyDataUpdated; MyceliumNetwork.PlayerEntered += CountertatState.OnPlayerEntered; } [CustomRPC] public void SyncCountertatSettings(CSteamID hostId, int roundId, int revision, bool enabled, RPCInfo info) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) if (NetworkAuthority.IsHostSender(info) && CountertatState.TryAcceptSettingsSnapshot(hostId, roundId, revision)) { CountertatState.ApplySettings(enabled); } } private void InitializeFfatat() { FfatatEnabled = ModeConfigMigration.BindModeEnabled(((BaseUnityPlugin)this).Config, "Game Modes Enabled", "Ffatat", "Every player fights independently and respawns after death. Each kill awards 10 points, and the first player to reach the configured point limit wins."); FfatatEnabled.SettingChanged += delegate { FfatatState.PushSettingsIfHost(); GameModeManager.OnSettingsChanged(); }; MyceliumNetwork.RegisterNetworkObject((object)this, 2718281828u, 0); ModeLobbyDataSync.RegisterKeys("Eights_Ffatat_Settings", "Eights_Ffatat_Live"); MyceliumNetwork.LobbyCreated += FfatatState.OnLobbyEntered; MyceliumNetwork.LobbyEntered += FfatatState.OnLobbyEntered; MyceliumNetwork.LobbyDataUpdated += FfatatState.OnLobbyDataUpdated; MyceliumNetwork.PlayerEntered += FfatatState.OnPlayerEntered; MyceliumNetwork.PlayerLeft += FfatatState.OnPlayerLeft; } [CustomRPC] public void SyncFfatatSettings(CSteamID hostId, int roundId, int revision, bool enabled, RPCInfo info) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) if (NetworkAuthority.IsHostSender(info) && FfatatState.TryAcceptSettingsSnapshot(hostId, roundId, revision)) { FfatatState.ApplySettings(enabled); } } [CustomRPC] public void SyncFfatatLiveState(CSteamID hostId, string killsData, int winnerId, int roundId, int revision, RPCInfo info) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) if (NetworkAuthority.IsHostSender(info)) { FfatatState.ApplyLiveState(hostId, killsData, winnerId, roundId, revision); } } [CustomRPC] public void FfatatAnnounce(string text, RPCInfo info) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) if (NetworkAuthority.IsHostSender(info)) { GameModeHud.ReceiveAnnouncement(text, 3f, showHud: true); } } private void InitializeGlobalModifiers() { //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: 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_0150: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Expected O, but got Unknown //IL_0187: Unknown result type (might be due to invalid IL or missing references) //IL_0191: Expected O, but got Unknown //IL_01c7: Unknown result type (might be due to invalid IL or missing references) //IL_01d1: Expected O, but got Unknown //IL_01fb: Unknown result type (might be due to invalid IL or missing references) //IL_0205: Expected O, but got Unknown MovementTweaksEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Movement Settings", "Movement Tweaks Enabled", true, "Host-controlled: master switch. Turn off for pure stock Straftat movement."); WallJumpEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Movement Settings", "Enable Wall Jump", true, "Host-controlled: allows wall jumping for everyone in the lobby."); WallJumpBoostEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Movement Settings", "Enable Wall Jump Speed Boost", false, "Host-controlled: whether wall jumping gives the usual Straftat horizontal speed kick (chaining wall jumps for extra speed)."); SlidingEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Movement Settings", "Enable Sliding", true, "Host-controlled: allows crouch-sliding for everyone in the lobby."); SlideBoostEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Movement Settings", "Enable Slide Speed Boost", false, "Host-controlled: whether sliding gives the usual Straftat speed boost. Disable to slide like most other games."); SilentWalking = ((BaseUnityPlugin)this).Config.Bind<bool>("Movement Settings", "Silent walking", true, "Host-controlled: mutes walking footsteps while sprint footsteps remain audible."); MoveSpeedPercent = ((BaseUnityPlugin)this).Config.Bind<int>("Movement Settings", "Move Speed %", 100, new ConfigDescription("Host-controlled: overall movement speed as a percent of normal.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(50, 200), Array.Empty<object>())); AdsSpeedPercent = ((BaseUnityPlugin)this).Config.Bind<int>("Movement Settings", "ADS Speed %", 100, new ConfigDescription("Host-controlled: movement speed while aiming down sights, as a percent of normal.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(50, 100), Array.Empty<object>())); GravityPercent = ((BaseUnityPlugin)this).Config.Bind<int>("Movement Settings", "Gravity %", 100, new ConfigDescription("Host-controlled: gravity as a percent of normal. Lower = floatier jumps and slower falling.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(10, 100), Array.Empty<object>())); MomentumPercent = ((BaseUnityPlugin)this).Config.Bind<int>("Movement Settings", "Momentum %", 100, new ConfigDescription("Host-controlled: how much weight/inertia is behind movement. 100% = stock Straftat snappiness. Higher = heavier, slower to speed up/stop/turn. Lower = snappier, near-instant direction changes.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(10, 400), Array.Empty<object>())); AirSpeedRatioPercent = ((BaseUnityPlugin)this).Config.Bind<int>("Movement Settings", "Air Move Speed %", (int)MathF.Round(116.666664f), new ConfigDescription("Host-controlled: air move speed (not air control) as a percent of ground move speed. Stock Straftat is already faster sprinting in the air than on the ground (the default reflects that real ratio). Lower this to slow players down in the air.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(50, 200), Array.Empty<object>())); ShootingSpeedPercent = ((BaseUnityPlugin)this).Config.Bind<int>("Movement Settings", "Shooting Speed %", 100, new ConfigDescription("Host-controlled: movement speed while shooting as a percent of normal. 100% = no slowdown.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(10, 100), Array.Empty<object>())); WallJumpEnabled.SettingChanged += delegate { GlobalModifiersState.PushIfHost(); }; MovementTweaksEnabled.SettingChanged += delegate { GlobalModifiersState.PushIfHost(); }; SlidingEnabled.SettingChanged += delegate { GlobalModifiersState.PushIfHost(); }; SilentWalking.SettingChanged += delegate { GlobalModifiersState.PushIfHost(); }; SlideBoostEnabled.SettingChanged += delegate { GlobalModifiersState.PushIfHost(); }; WallJumpBoostEnabled.SettingChanged += delegate { GlobalModifiersState.PushIfHost(); }; MoveSpeedPercent.SettingChanged += delegate { GlobalModifiersState.PushIfHost(); }; AdsSpeedPercent.SettingChanged += delegate { GlobalModifiersState.PushIfHost(); }; GravityPercent.SettingChanged += delegate { GlobalModifiersState.PushIfHost(); }; MomentumPercent.SettingChanged += delegate { GlobalModifiersState.PushIfHost(); }; AirSpeedRatioPercent.SettingChanged += delegate { GlobalModifiersState.PushIfHost(); }; ShootingSpeedPercent.SettingChanged += delegate { GlobalModifiersState.PushIfHost(); }; PlayerRadarEnabled.SettingChanged += delegate { GlobalModifiersState.PushIfHost(); }; MyceliumNetwork.RegisterNetworkObject((object)this, 1892737465u, 0); ModeLobbyDataSync.RegisterKeys("Eights_GlobalModifiers_Settings"); MyceliumNetwork.LobbyCreated += GlobalModifiersState.OnLobbyEntered; MyceliumNetwork.LobbyEntered += GlobalModifiersState.OnLobbyEntered; MyceliumNetwork.LobbyDataUpdated += GlobalModifiersState.OnLobbyDataUpdated; MyceliumNetwork.PlayerEntered += GlobalModifiersState.OnPlayerEntered; } [CustomRPC] public void SyncMovementSettings(CSteamID hostId, int roundId, int revision, bool enabled, bool wallJump, bool sliding, bool slideBoost, bool wallJumpBoost, int moveSpeedPercent, int adsSpeedPercent, int gravityPercent, int momentumPercent, int airSpeedRatioPercent, int shootingSpeedPercent, bool playerRadarEnabled, int maximumBloodEffects, bool silentWalking, RPCInfo info) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) if (NetworkAuthority.IsHostSender(info) && GlobalModifiersState.TryAcceptSettingsSnapshot(hostId, roundId, revision)) { GlobalModifiersState.Apply(enabled, wallJump, sliding, slideBoost, wallJumpBoost, moveSpeedPercent, adsSpeedPercent, gravityPercent, momentumPercent, airSpeedRatioPercent, shootingSpeedPercent, playerRadarEnabled, maximumBloodEffects, silentWalking); } } private void InitializeGlobalWeapons() { //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Expected O, but got Unknown //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Expected O, but got Unknown //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Expected O, but got Unknown //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Expected O, but got Unknown //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Expected O, but got Unknown //IL_01a3: Unknown result type (might be due to invalid IL or missing references) //IL_01aa: Expected O, but got Unknown WeaponTweaksEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Weapon Settings", "Weapon Tweaks Enabled", true, "Host-controlled: enables weapon override rules."); AllowedWeapons = ((BaseUnityPlugin)this).Config.Bind<string>("Weapon Settings", "Allowed Weapons", "AK-K, AR15, Dispenser, HK_G11, Yangtse, Kusma, M2000, QCW05, SMG, Warden", "Host-controlled: exact weapon IDs allowed on spawners and team-mode loadouts."); SpareMagazines = ((BaseUnityPlugin)this).Config.Bind<int>("Weapon Settings", "Spare Magazines", 6, new ConfigDescription("Host-controlled: spare magazines granted with a weapon pickup.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(2, 10), Array.Empty<object>())); DefaultKnife = ((BaseUnityPlugin)this).Config.Bind<bool>("Weapon Settings", "Default Knife", false, "Host-controlled: when on, gives players a Couperet while they have no gun in supported gun modes. The knife is removed when they pick up a gun."); ConfigDefinition val = new ConfigDefinition("Game Mode Settings", "Gun Game Weapon Order"); ConfigDefinition val2 = new ConfigDefinition("Weapon Settings", "Gun Game Weapons"); bool num = ((BaseUnityPlugin)this).Config.Keys.Contains(val); bool flag = ((BaseUnityPlugin)this).Config.Keys.Contains(val2); ConfigEntry<string> val3 = (num ? ((BaseUnityPlugin)this).Config.Bind<string>(val, "Glock, Webley, SMG, Bukanee, Shotgun, AR15, QCW05, HK_G11, M2000, Couperet", new ConfigDescription("Host-controlled: exact prefab IDs in progression order.", (AcceptableValueBase)null, Array.Empty<object>())) : null); ConfigEntry<string> obj = (flag ? ((BaseUnityPlugin)this).Config.Bind<string>(val2, "Glock, Webley, SMG, Bukanee, Shotgun, AR15, QCW05, HK_G11, M2000, Couperet", new ConfigDescription("Host-controlled: exact prefab IDs in progression order.", (AcceptableValueBase)null, Array.Empty<object>())) : null); GuntatWeaponOrder = ((BaseUnityPlugin)this).Config.Bind<string>("Weapon Settings", "Guntat Weapons", obj?.Value ?? val3?.Value ?? "Glock, Webley, SMG, Bukanee, Shotgun, AR15, QCW05, HK_G11, M2000, Couperet", "Host-controlled: exact prefab IDs in progression order."); ((BaseUnityPlugin)this).Config.Remove(val); ((BaseUnityPlugin)this).Config.Remove(val2); if (num || flag) { ((BaseUnityPlugin)this).Config.Save(); } ConfigDefinition val4 = new ConfigDefinition("Weapon Settings", "F8 Cycle Weapons"); if (((BaseUnityPlugin)this).Config.Keys.Contains(val4)) { ((BaseUnityPlugin)this).Config.Remove(val4); ((BaseUnityPlugin)this).Config.Save(); } WeaponTweaksEnabled.SettingChanged += delegate { WeaponSettingsState.PushIfHost(); }; AllowedWeapons.SettingChanged += delegate { WeaponSettingsState.PushIfHost(); }; SpareMagazines.SettingChanged += delegate { WeaponSettingsState.PushIfHost(); }; DefaultKnife.SettingChanged += delegate { WeaponSettingsState.PushIfHost(); }; GuntatWeaponOrder.SettingChanged += delegate { GuntatState.PushSettingsIfHost(); }; MyceliumNetwork.RegisterNetworkObject((object)this, 1618033991u, 0); ModeLobbyDataSync.RegisterKeys("Eights_GlobalWeapons_Settings"); MyceliumNetwork.LobbyCreated += WeaponSettingsState.OnLobbyEntered; MyceliumNetwork.LobbyEntered += WeaponSettingsState.OnLobbyEntered; MyceliumNetwork.LobbyDataUpdated += WeaponSettingsState.OnLobbyDataUpdated; MyceliumNetwork.PlayerEntered += WeaponSettingsState.OnPlayerEntered; MyceliumNetwork.PlayerLeft += WeaponSettingsState.OnPlayerLeft; } [CustomRPC] public void SyncWeaponSettings(CSteamID hostId, int roundId, int revision, bool enabled, string allowedWeapons, int spareMagazines, bool defaultKnife, RPCInfo info) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) if (NetworkAuthority.IsHostSender(info) && WeaponSettingsState.TryAcceptSettingsSnapshot(hostId, roundId, revision)) { WeaponSettingsState.Apply(enabled, allowedWeapons, spareMagazines, defaultKnife); } } [CustomRPC] public void RequestDefaultKnifeFallback(int playerId, int requestId, int roundId, RPCInfo info) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) if (MyceliumNetwork.IsHost && NetworkAuthority.IsPlayerSender(info, playerId)) { WeaponSettingsState.TryGrantDefaultKnifeFallback(playerId, requestId, roundId); } } [CustomRPC] public void RequestWeaponAmmoReload(int playerId, int requestId, int roundId, int weaponObjectId, bool rightHand, RPCInfo info) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) if (MyceliumNetwork.IsHost && roundId == GameModeManager.RoundId && NetworkAuthority.IsPlayerSender(info, playerId) && WeaponAmmoTuning.TryAcceptReloadRequest(info.SenderSteamID, requestId)) { WeaponAmmoTuning.ApplyServerReload(playerId, requestId, weaponObjectId, rightHand); } } [CustomRPC] public void SyncWeaponAmmoReload(int playerId, int requestId, int roundId, int weaponObjectId, int currentAmmo, int spareRounds, bool rightHand, RPCInfo info) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) if (NetworkAuthority.IsHostSender(info)) { WeaponAmmoTuning.ApplyOwnerReloadSnapshot(playerId, requestId, roundId, weaponObjectId, currentAmmo, spareRounds, rightHand); } } [CustomRPC] public void AttachServerGrantedWeapon(int playerId, bool rightHand, int weaponObjectId, RPCInfo info) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) if (NetworkAuthority.IsHostSender(info) && NetworkAuthority.IsLocalPlayer(playerId)) { WeaponService.AttachGrantedWeaponForOwner(playerId, rightHand, weaponObjectId); } } private void InitializeGuntat() { GuntatEnabled = ModeConfigMigration.BindModeEnabled(((BaseUnityPlugin)this).Config, "Game Modes Enabled", "Guntat", "Players advance through the configured weapon list by getting kills, receiving the next weapon after each progression step. Each kill adds 10 progression points, and the first player to complete the weapon progression wins."); GuntatEnabled.SettingChanged += delegate { GuntatState.PushSettingsIfHost(); GameModeManager.OnSettingsChanged(); }; MyceliumNetwork.RegisterNetworkObject((object)this, 1618033990u, 0); ModeLobbyDataSync.RegisterKeys("Eights_Guntat_Settings", "Eights_Guntat_Live"); MyceliumNetwork.LobbyCreated += GuntatState.OnLobbyEntered; MyceliumNetwork.LobbyEntered += GuntatState.OnLobbyEntered; MyceliumNetwork.LobbyDataUpdated += GuntatState.OnLobbyDataUpdated; MyceliumNetwork.PlayerEntered += GuntatState.OnPlayerEntered; MyceliumNetwork.PlayerLeft += GuntatState.OnPlayerLeft; } [CustomRPC] public void SyncGuntatSettings(CSteamID hostId, int roundId, int revision, bool enabled, string? weaponOrder, RPCInfo info) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) if (NetworkAuthority.IsHostSender(info) && GuntatState.TryAcceptSettingsSnapshot(hostId, roundId, revision, "gun-game-rpc")) { GuntatState.ApplySettings(enabled, weaponOrder ?? string.Empty); } } [CustomRPC] public void SyncGuntatLiveState(CSteamID hostId, string? progressData, int roundId, int revision, RPCInfo info) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) if (NetworkAuthority.IsHostSender(info)) { GuntatState.ApplyLiveState(hostId, progressData ?? string.Empty, roundId, revision, "gun-game-rpc"); } } private void InitializeHardtat() { HardtatEnabled = ModeConfigMigration.BindModeEnabled(((BaseUnityPlugin)this).Config, "Game Modes Enabled", "Hardtat", "Teams rotate between map hardpoints and earn 1 point for every second of uncontested control. The first team to reach the configured point limit wins; if the match timer expires while tied, play continues until a team takes the lead."); HardtatEnabled.SettingChanged += delegate { HardtatState.PushSettingsIfHost(); GameModeManager.OnSettingsChanged(); }; MyceliumNetwork.RegisterNetworkObject((object)this, 1618033994u, 0); ModeLobbyDataSync.RegisterKeys("Eights_Hardtat_Settings", "Eights_Hardtat_Live"); MyceliumNetwork.LobbyCreated += HardtatState.OnLobbyEntered; MyceliumNetwork.LobbyEntered += HardtatState.OnLobbyEntered; MyceliumNetwork.LobbyDataUpdated += HardtatState.OnLobbyDataUpdated; MyceliumNetwork.PlayerEntered += HardtatState.OnPlayerEntered; MyceliumNetwork.PlayerLeft += HardtatState.OnPlayerLeft; } [CustomRPC] public void SyncHardtatSettings(CSteamID hostId, int roundId, int revision, bool enabled, bool ignoredLegacySpawnerFlag, RPCInfo info) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) if (NetworkAuthority.IsHostSender(info) && HardtatState.TryAcceptSettingsSnapshot(hostId, roundId, revision)) { HardtatState.ApplySettings(enabled); } } [CustomRPC] public void SyncHardtatLiveState(CSteamID hostId, string assignmentsData, int teamCount, string scoresData, int objectiveIndex, float objectiveElapsed, float contestTimeRemaining, int controller, bool overtime, int roundId, int revision, RPCInfo info) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) if (NetworkAuthority.IsHostSender(info)) { HardtatState.ApplyLiveState(hostId, assignmentsData, teamCount, scoresData, objectiveIndex, objectiveElapsed, contestTimeRemaining, controller, overtime, roundId, revision); } } private void InitializeHealthSettings() { //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Expected O, but got Unknown //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Expected O, but got Unknown //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Expected O, but got Unknown HealthTweaksEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Health Settings", "Health Tweaks Enabled", true, "Host-controlled: master switch. Turn off to restore normal health and disable regeneration."); MaxHealthPercent = ((BaseUnityPlugin)this).Config.Bind<int>("Health Settings", "Max Health %", 100, new ConfigDescription("Host-controlled: max health as a percent of normal.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(10, 400), Array.Empty<object>())); HealthRegenEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Health Settings", "Enable Health Regen", true, "Host-controlled: enables health regeneration after taking damage."); HealthRegenDelaySeconds = ((BaseUnityPlugin)this).Config.Bind<int>("Health Settings", "Regen Delay (seconds)", 5, new ConfigDescription("Host-controlled: delay after taking damage before health regeneration starts.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(2, 15), Array.Empty<object>())); HealthRegenRate = ((BaseUnityPlugin)this).Config.Bind<int>("Health Settings", "Regen Rate (health per second)", 150, new ConfigDescription("Host-controlled: displayed HUD health restored per second after the regen delay.", (AcceptableValueBase)(object)new AcceptableValueList<int>(new int[6] { 50, 100, 150, 200, 300, 400 }), Array.Empty<object>())); if (HealthRegenRate.Value != 50 && HealthRegenRate.Value != 100 && HealthRegenRate.Value != 150 && HealthRegenRate.Value != 200 && HealthRegenRate.Value != 300 && HealthRegenRate.Value != 400) { HealthRegenRate.Value = 150; } HealthTweaksEnabled.SettingChanged += delegate { HealthSettingsState.PushIfHost(); }; MaxHealthPercent.SettingChanged += delegate { HealthSettingsState.PushIfHost(); }; HealthRegenEnabled.SettingChanged += delegate { HealthSettingsState.PushIfHost(); }; HealthRegenDelaySeconds.SettingChanged += delegate { HealthSettingsState.PushIfHost(); }; HealthRegenRate.SettingChanged += delegate { HealthSettingsState.PushIfHost(); }; MyceliumNetwork.RegisterNetworkObject((object)this, 1892737466u, 0); ModeLobbyDataSync.RegisterKeys("Eights_HealthSettings_Settings"); MyceliumNetwork.LobbyCreated += HealthSettingsState.OnLobbyEntered; MyceliumNetwork.LobbyEntered += HealthSettingsState.OnLobbyEntered; MyceliumNetwork.LobbyDataUpdated += HealthSettingsState.OnLobbyDataUpdated; MyceliumNetwork.PlayerEntered += HealthSettingsState.OnPlayerEntered; } [CustomRPC] public void SyncHealthSettings(CSteamID hostId, int roundId, int revision, bool enabled, int maxHealthPercent, bool regenEnabled, int regenDelaySeconds, int regenRate, RPCInfo info) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) if (NetworkAuthority.IsHostSender(info) && HealthSettingsState.TryAcceptSettingsSnapshot(hostId, roundId, revision)) { HealthSettingsState.Apply(enabled, maxHealthPercent, regenEnabled, regenDelaySeconds, regenRate); } } private void InitializeHunttat() { HunttatEnabled = ModeConfigMigration.BindModeEnabled(((BaseUnityPlugin)this).Config, "Game Modes Enabled", "Hunttat", "Hunters with Tromblonj fight Rabbits with Smith Carbine in single-life team takes. Sides swap each take; when time expires, the first team to hold the first hardpoint uncontested for 5 seconds wins the take."); HunttatEnabled.SettingChanged += delegate { HuntModesState.PushSettingsIfHost(HunttatDefinition.Value, HunttatEnabled.Value); GameModeManager.OnSettingsChanged(); }; MyceliumNetwork.RegisterNetworkObject((object)this, HunttatDefinition.Value.ModId, 0); ModeLobbyDataSync.RegisterKeys(HunttatDefinition.Value.SettingsLobbyDataKey, HunttatDefinition.Value.LiveLobbyDataKey); HuntModesState.SubscribeLifecycleEvents(); } [CustomRPC] public void SyncHunttatSettings(CSteamID hostId, int roundId, int revision, bool enabled, RPCInfo info) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) if (GameModeManager.IsActive(GameMode.Hunttat) && NetworkAuthority.IsHostSender(info) && HuntModesState.TryAcceptSettingsSnapshot(HunttatDefinition.Value, hostId, roundId, revision)) { HuntModesState.ApplySettings(enabled); } } [CustomRPC] public void SyncHunttatLiveState(CSteamID hostId, string assignmentsData, int teamCount, string scoresData, int takeId, int takeWinnerId, int winnerId, float takeTimeRemaining, bool tieBreakActive, int tieBreakController, float tieBreakHoldProgress, int roundId, int revision, RPCInfo info) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) if (GameModeManager.IsActive(GameMode.Hunttat) && NetworkAuthority.IsHostSender(info)) { HuntModesState.ApplyLiveState(HunttatDefinition.Value, hostId, assignmentsData, teamCount, scoresData, takeId, takeWinnerId, winnerId, takeTimeRemaining, tieBreakActive, tieBreakController, tieBreakHoldProgress, roundId, revision); } } private void InitializeNinjatat() { NinjatatEnabled = ModeConfigMigration.BindModeEnabled(((BaseUnityPlugin)this).Config, "Game Modes Enabled", "Ninjatat", "Ninjas with Katanas fight Hunters with FG42s in single-life team takes. Sides swap each take; when time expires, the first team to hold the first hardpoint uncontested for 5 seconds wins the take."); NinjatatEnabled.SettingChanged += delegate { HuntModesState.PushSettingsIfHost(); GameModeManager.OnSettingsChanged(); }; MyceliumNetwork.RegisterNetworkObject((object)this, NinjatatDefinition.Value.ModId, 0); ModeLobbyDataSync.RegisterKeys(NinjatatDefinition.Value.SettingsLobbyDataKey, NinjatatDefinition.Value.LiveLobbyDataKey); HuntModesState.SubscribeLifecycleEvents(); } [CustomRPC] public void SyncNinjatatSettings(CSteamID hostId, int roundId, int revision, bool enabled, RPCInfo info) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) if (GameModeManager.IsActive(GameMode.Ninjatat) && NetworkAuthority.IsHostSender(info) && HuntModesState.TryAcceptSettingsSnapshot(NinjatatDefinition.Value, hostId, roundId, revision)) { HuntModesState.ApplySettings(enabled); } } [CustomRPC] public void SyncNinjatatLiveState(CSteamID hostId, string assignmentsData, int teamCount, string scoresData, int takeId, int takeWinnerId, int winnerId, float takeTimeRemaining, bool tieBreakActive, int tieBreakController, float tieBreakHoldProgress, int roundId, int revision, RPCInfo info) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) if (GameModeManager.IsActive(GameMode.Ninjatat) && NetworkAuthority.IsHostSender(info)) { HuntModesState.ApplyLiveState(NinjatatDefinition.Value, hostId, assignmentsData, teamCount, scoresData, takeId, takeWinnerId, winnerId, takeTimeRemaining, tieBreakActive, tieBreakController, tieBreakHoldProgress, roundId, revision); } } private void InitializeTanktat() { TanktatEnabled = ModeConfigMigration.BindModeEnabled(((BaseUnityPlugin)this).Config, "Game Modes Enabled", "Tanktat", "Both teams use HK_Caws. Every player has 400 health, cannot regenerate, jump, or slide, and stays crouched while moving slowly in single-life team takes. Sides swap each take; when time expires, the first team to hold the first hardpoint uncontested for 5 seconds wins the take."); TanktatEnabled.SettingChanged += delegate { HuntModesState.PushSettingsIfHost(TanktatDefinition.Value, TanktatEnabled.Value); GameModeManager.OnSettingsChanged(); }; MyceliumNetwork.RegisterNetworkObject((object)this, TanktatDefinition.Value.ModId, 0); ModeLobbyDataSync.RegisterKeys(TanktatDefinition.Value.SettingsLobbyDataKey, TanktatDefinition.Value.LiveLobbyDataKey); HuntModesState.SubscribeLifecycleEvents(); } [CustomRPC] public void SyncTanktatSettings(CSteamID hostId, int roundId, int revision, bool enabled, RPCInfo info) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) if (GameModeManager.IsActive(GameMode.Tanktat) && NetworkAuthority.IsHostSender(info) && HuntModesState.TryAcceptSettingsSnapshot(TanktatDefinition.Value, hostId, roundId, revision)) { HuntModesState.ApplySettings(enabled); } } [CustomRPC] public void SyncTanktatLiveState(CSteamID hostId, string assignmentsData, int teamCount, string scoresData, int takeId, int takeWinnerId, int winnerId, float takeTimeRemaining, bool tieBreakActive, int tieBreakController, float tieBreakHoldProgress, int roundId, int revision, RPCInfo info) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) if (GameModeManager.IsActive(GameMode.Tanktat) && NetworkAuthority.IsHostSender(info)) { HuntModesState.ApplyLiveState(TanktatDefinition.Value, hostId, assignmentsData, teamCount, scoresData, takeId, takeWinnerId, winnerId, takeTimeRemaining, tieBreakActive, tieBreakController, tieBreakHoldProgress, roundId, revision); } } private void InitializeHvtat() { HvtatEnabled = ModeConfigMigration.BindModeEnabled(((BaseUnityPlugin)this).Config, "Game Modes Enabled", "Hvtat", "The first legitimate killer becomes the High-Value Target and earns 3 points each second while alive. Other players hunt the Hvtat, and killing them transfers the role; the first player to reach the configured point limit wins."); HvtatEnabled.SettingChanged += delegate { HvtatState.PushSettingsIfHost(); GameModeManager.OnSettingsChanged(); }; MyceliumNetwork.RegisterNetworkObject((object)this, 3141592657u, 0); ModeLobbyDataSync.RegisterKeys("Eights_Hvtat_Settings", "Eights_Hvtat_Live"); MyceliumNetwork.LobbyCreated += HvtatState.OnLobbyEntered; MyceliumNetwork.LobbyEntered += HvtatState.OnLobbyEntered; MyceliumNetwork.LobbyDataUpdated += HvtatState.OnLobbyDataUpdated; MyceliumNetwork.PlayerEntered += HvtatState.OnPlayerEntered; MyceliumNetwork.PlayerLeft += HvtatState.OnPlayerLeft; } [CustomRPC] public void SyncHvtatSettings(CSteamID hostId, int roundId, int revision, bool enabled, RPCInfo info) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) if (NetworkAuthority.IsHostSender(info) && HvtatState.TryAcceptSettingsSnapshot(hostId, roundId, revision)) { HvtatState.ApplySettings(enabled); } } [CustomRPC] public void SyncHvtatLiveState(CSteamID hostId, int hvtPlayerId, string pointsData, int winnerId, int roundId, int revision, RPCInfo info) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) if (NetworkAuthority.IsHostSender(info)) { HvtatState.ApplyLiveState(hostId, hvtPlayerId, pointsData, winnerId, roundId, revision); } } [CustomRPC] public void HvtatAnnounce(string text, RPCInfo info) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) if (NetworkAuthority.IsHostSender(info)) { GameModeHud.ReceiveAnnouncement(text, 3f, showHud: true); } } [CustomRPC] public void HvtatAnnounceTarget(string text, RPCInfo info) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) if (NetworkAuthority.IsHostSender(info)) { GameModeHud.AnnounceTarget(ClientInstance.ReplaceAllPlayerNameTags(text)); } } private void InitializeInfectedtat() { InfectedtatEnabled = ModeConfigMigration.BindModeEnabled(((BaseUnityPlugin)this).Config, "Game Modes Enabled", "Infectedtat", "The host selects one infected player. Infectedtat players use Couperets and cannot pick up guns; survivors use 10 health and random allowed weapons. Survivors who die become infected."); InfectedtatEnabled.SettingChanged += delegate { InfectedtatState.PushSettingsIfHost(); GameModeManager.OnSettingsChanged(); }; MyceliumNetwork.RegisterNetworkObject((object)this, 2718281832u, 0); ModeLobbyDataSync.RegisterKeys("Eights_Infectedtat_Settings", "Eights_Infectedtat_Live"); MyceliumNetwork.LobbyCreated += InfectedtatState.OnLobbyEntered; MyceliumNetwork.LobbyEntered += InfectedtatState.OnLobbyEntered; MyceliumNetwork.LobbyDataUpdated += InfectedtatState.OnLobbyDataUpdated; MyceliumNetwork.PlayerEntered += InfectedtatState.OnPlayerEntered; MyceliumNetwork.PlayerLeft += InfectedtatState.OnPlayerLeft; } [CustomRPC] public void SyncInfectedtatSettings(CSteamID hostId, int roundId, int revision, bool enabled, RPCInfo info) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) if (NetworkAuthority.IsHostSender(info) && InfectedtatState.TryAcceptSettingsSnapshot(hostId, roundId, revision)) { InfectedtatState.ApplySettings(enabled); } } [CustomRPC] public void SyncInfectedtatLiveState(CSteamID hostId, int initialInfectedtatPlayerId, string infectedData, string scoresData, int winnerId, int roundId, int revision, RPCInfo info) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) if (NetworkAuthority.IsHostSender(info)) { InfectedtatState.ApplyLiveState(hostId, initialInfectedtatPlayerId, infectedData, scoresData, winnerId, roundId, revision); } } private void InitializeInfideltat() { InfideltatEnabled = ModeConfigMigration.BindModeEnabled(((BaseUnityPlugin)this).Config, "Game Modes Enabled", "Infideltat", "One hidden Infideltat faces the terrorists, with delayed weapons and different health and movement rules for each role. Terrorists earn 30 points for killing the Infideltat, while the Infideltat earns 50 points for outliving all terrorists; the first to reach the configured point limit wins."); InfideltatEnabled.SettingChanged += delegate { InfideltatState.PushSettingsIfHost(); GameModeManager.OnSettingsChanged(); }; MyceliumNetwork.RegisterNetworkObject((object)this, 2718281831u, 0); ModeLobbyDataSync.RegisterKeys("Eights_Infideltat_Settings", "Eights_Infideltat_Live"); MyceliumNetwork.LobbyCreated += InfideltatState.OnLobbyEntered; MyceliumNetwork.LobbyEntered += InfideltatState.OnLobbyEntered; MyceliumNetwork.LobbyDataUpdated += InfideltatState.OnLobbyDataUpdated; MyceliumNetwork.PlayerEntered += InfideltatState.OnPlayerEntered; MyceliumNetwork.PlayerLeft += InfideltatState.OnPlayerLeft; } [CustomRPC] public void SyncInfideltatSettings(CSteamID hostId, int roundId, int revision, bool enabled, RPCInfo info) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) if (NetworkAuthority.IsHostSender(info) && InfideltatState.TryAcceptSettingsSnapshot(hostId, roundId, revision)) { InfideltatState.ApplySettings(enabled); } } [CustomRPC] public void SyncInfideltatLiveState(CSteamID hostId, string scoresData, int winnerId, int takeId, bool weaponsUnlocked, float takeTimeRemaining, int roundId, int revision, RPCInfo info) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) if (NetworkAuthority.IsHostSender(info)) { InfideltatState.ApplyLiveState(hostId, scoresData, winnerId, takeId, weaponsUnlocked, takeTimeRemaining, roundId, revision); } } [CustomRPC] public void SyncInfideltatRole(CSteamID hostId, int takeId, bool isInfideltat, bool announce, RPCInfo info) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) if (NetworkAuthority.IsHostSender(info)) { InfideltatState.ApplyLocalRole(hostId, takeId, isInfideltat, announce); } } [CustomRPC] public void SyncInfideltatBeep(CSteamID hostId, int takeId, int beepId, Vector3 position, RPCInfo info) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) if (NetworkAuthority.IsHostSender(info)) { InfideltatState.ApplyInfideltatBeep(hostId, takeId, beepId, position); } } private void InitializeJuggertat() { JuggertatEnabled = ModeConfigMigration.BindModeEnabled(((BaseUnityPlugin)this).Config, "Game Modes Enabled", "Juggertat", "The first killer becomes the powerful Juggertat, while everyone else hunts them for the crown. Normal kills award 10 points, killing the Juggertat awards 20 points to the new holder, and the first player to reach the configured point limit wins."); JuggertatEnabled.SettingChanged += delegate { JuggertatState.PushSettingsIfHost(); GameModeManager.OnSettingsChanged(); }; MyceliumNetwork.RegisterNetworkObject((object)this, 3141592656u, 0); ModeLobbyDataSync.RegisterKeys("Eights_Juggertat_Settings", "Eights_Juggertat_Live"); MyceliumNetwork.LobbyCreated += JuggertatState.OnLobbyEntered; MyceliumNetwork.LobbyEntered += JuggertatState.OnLobbyEntered; MyceliumNetwork.LobbyDataUpdated += JuggertatState.OnLobbyDataUpdated; MyceliumNetwork.PlayerEntered += JuggertatState.OnPlayerEntered; MyceliumNetwork.PlayerLeft += JuggertatState.OnPlayerLeft; } [CustomRPC] public void SyncJuggertatSettings(CSteamID hostId, int roundId, int revision, bool enabled, RPCInfo info) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) if (NetworkAuthority.IsHostSender(info) && JuggertatState.TryAcceptSettingsSnapshot(hostId, roundId, revision)) { JuggertatState.ApplySettings(enabled); } } [CustomRPC] public void SyncJuggertatLiveState(CSteamID hostId, int juggernautPlayerId, int juggernautKills, string pointsData, int roundId, int revision, RPCInfo info) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) if (NetworkAuthority.IsHostSender(info)) { JuggertatState.ApplyLiveState(hostId, juggernautPlayerId, juggernautKills, pointsData, roundId, revision); } } [CustomRPC] public void JuggertatAnnounce(string text, RPCInfo info) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) if (NetworkAuthority.IsHostSender(info)) { GameModeHud.ReceiveAnnouncement(text, 3f, showHud: true); } } [CustomRPC] public void JuggertatAnnounceTarget(string text, RPCInfo info) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) if (NetworkAuthority.IsHostSender(info)) { GameModeHud.AnnounceTarget(ClientInstance.ReplaceAllPlayerNameTags(text)); } } private void InitializeMichaeltat() { MichaeltatEnabled = ModeConfigMigration.BindModeEnabled(((BaseUnityPlugin)this).Config, "Game Modes Enabled", "Michaeltat", "Michael hunts the other players with a Couperet while everyone else tries to stay alive. Michael moves 10% faster. Everyone has 10 health until the final battle, when the last survivor gets a Couperet and both final players return to 100 health. If at least two players remain after 90 seconds, the take ends without awarding points."); MichaeltatEnabled.SettingChanged += delegate { MichaeltatState.PushSettingsIfHost(); GameModeManager.OnSettingsChanged(); }; MyceliumNetwork.RegisterNetworkObject((object)this, 3141592654u, 0); ModeLobbyDataSync.RegisterKeys("Eights_Michaeltat_Settings", "Eights_Michaeltat_Live"); MyceliumNetwork.LobbyCreated += MichaeltatState.OnLobbyEntered; MyceliumNetwork.LobbyEntered += MichaeltatState.OnLobbyEntered; MyceliumNetwork.LobbyDataUpdated += MichaeltatState.OnLobbyDataUpdated; MyceliumNetwork.PlayerEntered += MichaeltatState.OnPlayerEntered; MyceliumNetwork.PlayerLeft += MichaeltatState.OnPlayerLeft; } [CustomRPC] public void SyncMichaeltatSettings(CSteamID hostId, int roundId, int revision, bool enabled, RPCInfo info) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) if (NetworkAuthority.IsHostSender(info) && MichaeltatState.TryAcceptSettingsSnapshot(hostId, roundId, revision)) { MichaeltatState.ApplySettings(enabled); } } [CustomRPC] public void SyncMichaeltatLiveState(CSteamID hostId, int michaelPlayerId, int survivorCount, bool oneVsOne, string scoresData, float timeRemaining, int roundId, int revision, RPCInfo info) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) if (NetworkAuthority.IsHostSender(info)) { MichaeltatState.ApplyLiveState(hostId, michaelPlayerId, survivorCount, oneVsOne, scoresData, timeRemaining, roundId, revision); } } [CustomRPC] public void MichaeltatAnnounce(string text, RPCInfo info) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) if (NetworkAuthority.IsHostSender(info)) { GameModeHud.ReceiveAnnouncement(text, 3f, showHud: true); } } private void InitializeNifetat() { NifetatEnabled = ModeConfigMigration.BindModeEnabled(((BaseUnityPlugin)this).Config, "Game Modes Enabled", "Nifetat", "Melee-only Ffatat. Every player has 10 health and uses one randomly selected melee weapon each round."); NifetatEnabled.SettingChanged += delegate { NifetatState.PushSettingsIfHost(); GameModeManager.OnSettingsChanged(); }; MyceliumNetwork.RegisterNetworkObject((object)this, 2718281833u, 0); ModeLobbyDataSync.RegisterKeys("Eights_Nifetat_Settings", "Eights_Nifetat_Live"); MyceliumNetwork.LobbyCreated += NifetatState.OnLobbyEntered; MyceliumNetwork.LobbyEntered += NifetatState.OnLobbyEntered; MyceliumNetwork.LobbyDataUpdated += NifetatState.OnLobbyDataUpdated; MyceliumNetwork.PlayerEntered += NifetatState.OnPlayerEntered; MyceliumNetwork.PlayerLeft += NifetatState.OnPlayerLeft; } [CustomRPC] public void SyncNifetatSettings(CSteamID hostId, int roundId, int revision, bool enabled, RPCInfo info) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) if (NetworkAuthority.IsHostSender(info) && NifetatState.TryAcceptSettingsSnapshot(hostId, roundId, revision)) { NifetatState.ApplySettings(enabled); } } [CustomRPC] public void SyncNifetatLiveState(CSteamID hostId, string selectedWeapon, string killsData, int winnerId, int roundId, int revision, RPCInfo info) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) if (NetworkAuthority.IsHostSender(info)) { NifetatState.ApplyLiveState(hostId, selectedWeapon, killsData, winnerId, roundId, revision); } } private void Awake() { //IL_03cb: Unknown result type (might be due to invalid IL or missing references) //IL_03d5: Expected O, but got Unknown Instance = this; Logger = ((BaseUnityPlugin)this).Logger; InitializeSafely("compatibility checks", FishNetCompatibility.LogPreflight); InitializeSafely("Mycelium transport recovery", MyceliumTransportRecovery.Initialize); InitializeSafely("weapon service", WeaponService.Initialize); InitializeSafely("game mode manager", GameModeManager.Initialize); InitializeSafely("shared player lookup", PlayerLookup.Initialize); InitializeSafely("ModMenu integration", ModMenuIntegration.Initialize); InitializeSafely("shared player outline", PlayerOutline.Initialize); InitializeSafely("blood cleanup", InitializeBloodCleanup); InitializeSafely("global modifiers", InitializeGlobalModifiers); InitializeSafely("health settings", InitializeHealthSettings); InitializeSafely("global weapons", InitializeGlobalWeapons); InitializeSafely("Straftat", InitializeStraftat); InitializeSafely("Michaeltat", InitializeMichaeltat); InitializeSafely("Ratatat", InitializeRatatat); InitializeSafely("Hvtat", InitializeHvtat); InitializeSafely("Infectedtat", InitializeInfectedtat); InitializeSafely("PotatoInftat", InitializePotatoInftat); InitializeSafely("Chambertat", InitializeChambertat); InitializeSafely("Potatotat", InitializePotatotat); InitializeSafely("Infideltat", InitializeInfideltat); InitializeSafely("Assassintat", InitializeAssassintat); InitializeSafely("Ffatat", InitializeFfatat); InitializeSafely("Nifetat", InitializeNifetat); InitializeSafely("Juggertat", InitializeJuggertat); InitializeSafely("Guntat", InitializeGuntat); InitializeSafely("Snipertat", InitializeSnipertat); InitializeSafely("Hardtat", InitializeHardtat); InitializeSafely("Capturetat", InitializeCapturetat); InitializeSafely("Sndtat", InitializeSndtat); InitializeSafely("Countertat", InitializeCountertat); InitializeSafely("Tdmtat", InitializeTdmtat); InitializeSafely("Ninjatat", InitializeNinjatat); InitializeSafely("Hunttat", InitializeHunttat); InitializeSafely("Tanktat", InitializeTanktat); try { ((BaseUnityPlugin)this).Config.Save(); } catch (Exception ex) { Logger.LogWarning((object)("[Startup] Could not save config: " + ex.GetBaseException().Message)); } try { ((Component)this).gameObject.AddComponent<GameModeHud>(); } catch (Exception ex2) { Logger.LogError((object)("[GameModeHud] Startup failed: " + ex2.GetBaseException().Message)); } PatchAllSafely(new Harmony("Eights")); } private static void InitializeSafely(string featureName, Action initialize) { try { initialize(); } catch (Exception ex) { Logger.LogError((object)("[Startup] Failed to initialize " + featureName + ": " + ex.GetBaseException().Message)); } } private static void PatchAllSafely(Harmony harmony) { Type[] array; try { array = (from type2 in AccessTools.GetTypesFromAssembly(typeof(Plugin).Assembly) where type2.GetCustomAttributes(typeof(HarmonyPatch), inherit: false).Length != 0 select type2).OrderBy<Type, string>((Type type2) => type2.FullName, StringComparer.Ordinal).ToArray(); } catch (Exception ex) { Logger.LogError((object)("[Harmony] Could not discover patch classes: " + ex.GetBaseException().Message)); return; } Type[] array2 = array; foreach (Type type in array2) { try { if (harmony.CreateClassProcessor(type).Patch().Count() == 0) { HarmonyPatchStatus.RecordFailure(type, "no patch target was installed"); Logger.LogError((object)("[Harmony] Disabled patch class " + type.FullName + ": no patch target was installed.")); } } catch (Exception ex2) { HarmonyPatchStatus.RecordFailure(type, ex2.GetBaseException().Message); Logger.LogError((object)("[Harmony] Disabled patch class " + type.FullName + ": " + ex2.GetBaseException().Message)); } } } private void Update() { BloodCleanupState.Update(); PositionMarkerDebug.Update(); MyceliumTransportRecovery.Update(); GameModeManager.EnsureVanillaScene(); GameModeManager.UpdateRoundEndCountdown(); GameModeManager.PeriodicPushIfHost(); GameModeManager.PeriodicActiveModePushIfHost(); GameModeManager.PollLobbyStateIfClient(); PlayerNameSync.PeriodicPushIfHost(); PlayerNameSync.PollIfClient(); StraftatState.ServerTick(Time.unscaledDeltaTime); StraftatState.ClientTick(Time.unscaledDeltaTime); CapturetatState.ServerTick(Time.unscaledDeltaTime); HardtatState.ServerTick(Time.unscaledDeltaTime); JuggertatState.ServerTick(Time.unscaledDeltaTime); HvtatState.ServerTick(Time.unscaledDeltaTime); RatatatState.ServerTick(Time.unscaledDeltaTime); MichaeltatState.ServerTick(Time.unscaledDeltaTime); MichaeltatState.ClientTick(Time.unscaledDeltaTime); InfideltatState.ServerTick(Time.unscaledDeltaTime); InfideltatState.ClientTick(Time.unscaledDeltaTime); AssassintatState.ServerTick(Time.unscaledDeltaTime); AssassintatState.ClientTick(Time.unscaledDeltaTime); SndtatState.ServerTick(Time.unscaledDeltaTime); HuntModesState.ServerTick(Time.unscaledDeltaTime); ModeTimeoutState.ServerTick(Time.unscaledDeltaTime); ModeTimeoutState.ClientTick(Time.unscaledDeltaTime); SndtatState.PollLocalInput(); SndtatState.ApplyLocalMovementLock(); GlobalModifiersState.PeriodicPushIfHost(); GlobalModifiersState.PollSettingsIfClient(); HealthSettingsState.PeriodicPushIfHost(); HealthSettingsState.PollSettingsIfClient(); GameModeHud.PeriodicPushTakeResult(); HealthSettingsState.ServerTick(); WeaponSettingsState.PeriodicPushIfHost(); WeaponSettingsState.PollSettingsIfClient(); GameModeManager.EnsureActiveModeLoadouts(); PlayerOutline.EnforceOutline(); TeammateMarker.Enforce(); HardtatMarker.Update(); HuntModesMarker.Update(); CapturetatMarker.Update(); SndtatMarker.Update(); RespawnProtection.Update(); } private void InitializePotatoInftat() { PotatoInftatEnabled = ModeConfigMigration.BindModeEnabled(((BaseUnityPlugin)this).Config, "Game Modes Enabled", "PotatoInftat", "Infectedtat players use HandGrenades instead of Couperets. Survivors use 10 health and random allowed weapons; survivors who die become infected."); PotatoInftatEnabled.SettingChanged += delegate { PotatoInftatState.PushSettingsIfHost(); GameModeManager.OnSettingsChanged(); }; MyceliumNetwork.RegisterNetworkObject((object)this, 2718281834u, 0); ModeLobbyDataSync.RegisterKeys("Eights_PotatoInftat_Settings", "Eights_PotatoInftat_Live"); MyceliumNetwork.LobbyCreated += PotatoInftatState.OnLobbyEntered; MyceliumNetwork.LobbyEntered += PotatoInftatState.OnLobbyEntered; MyceliumNetwork.LobbyDataUpdated += PotatoInftatState.OnLobbyDataUpdated; MyceliumNetwork.PlayerEntered += PotatoInftatState.OnPlayerEntered; MyceliumNetwork.PlayerLeft += PotatoInftatState.OnPlayerLeft; } [CustomRPC] public void SyncPotatoInftatSettings(CSteamID hostId, int roundId, int revision, bool enabled, RPCInfo info) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) if (NetworkAuthority.IsHostSender(info) && PotatoInftatState.TryAcceptSettingsSnapshot(hostId, roundId, revision)) { PotatoInftatState.ApplySettings(enabled); } } [CustomRPC] public void SyncPotatoInftatLiveState(CSteamID hostId, int initialInfectedtatPlayerId, string infectedData, string scoresData, int winnerId, int roundId, int revision, RPCInfo info) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) if (NetworkAuthority.IsHostSender(info)) { PotatoInftatState.ApplyLiveState(hostId, initialInfectedtatPlayerId, infectedData, scoresData, winnerId, roundId, revision); } } private void InitializePotatotat() { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Expected O, but got Unknown //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Expected O, but got Unknown PotatotatEnabled = ModeConfigMigration.BindModeEnabled(((BaseUnityPlugin)this).Config, "Game Modes Enabled", "Potatotat", "The grenade holder passes the potato to their victim on a kill. Other players score 20 points per kill and progress through Elephant, Smith Carbine, Shotgun, Gust, and Tromblonj. A grenade death resets the victim to 0 points. Reach 100 points to win with the Tromblonj."); ConfigDefinition val = new ConfigDefinition("Weapon Settings", "Hot Potato Weapons"); ConfigDefinition val2 = new ConfigDefinition("Weapon Settings", "Potatotat Weapons"); bool num = ((BaseUnityPlugin)this).Config.Keys.Contains(val) || ((BaseUnityPlugin)this).Config.Keys.Contains(val2); ((BaseUnityPlugin)this).Config.Remove(val); ((BaseUnityPlugin)this).Config.Remove(val2); if (num) { ((BaseUnityPlugin)this).Config.Save(); } PotatotatEnabled.SettingChanged += delegate { PotatotatState.PushSettingsIfHost(); GameModeManager.OnSettingsChanged(); }; MyceliumNetwork.RegisterNetworkObject((object)this, 2718281830u, 0); ModeLobbyDataSync.RegisterKeys("Eights_Potatotat_Settings", "Eights_Potatotat_Live"); MyceliumNetwork.LobbyCreated += PotatotatState.OnLobbyEntered; MyceliumNetwork.LobbyEntered += PotatotatState.OnLobbyEntered; MyceliumNetwork.LobbyDataUpdated += PotatotatState.OnLobbyDataUpdated; MyceliumNetwork.PlayerEntered += PotatotatState.OnPlayerEntered; MyceliumNetwork.PlayerLeft += PotatotatState.OnPlayerLeft; } [CustomRPC] public void SyncPotatotatSettings(CSteamID hostId, int roundId, int revision, bool enabled, RPCInfo info) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) if (NetworkAuthority.IsHostSender(info) && PotatotatState.TryAcceptSettingsSnapshot(hostId, roundId, revision)) { PotatotatState.ApplySettings(enabled); } } [CustomRPC] public void SyncPotatotatLiveState(CSteamID hostId, string killsData, int potatoPlayerId, int winnerId, int roundId, int revision, RPCInfo info) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) if (NetworkAuthority.IsHostSender(info)) { PotatotatState.ApplyLiveState(hostId, killsData, potatoPlayerId, winnerId, roundId, revision); } } [CustomRPC] public void PotatotatAnnounce(string text, RPCInfo info) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) if (NetworkAuthority.IsHostSender(info)) { GameModeHud.ReceiveAnnouncement(text, 3f, showHud: true); } } private void InitializeRatatat() { RatatatEnabled = ModeConfigMigration.BindModeEnabled(((BaseUnityPlugin)this).Config, "Game Modes Enabled", "Ratatat", "One player becomes the Rat and earns 3 points each second while alive, while the other players hunt them. Killing the Rat awards 10 points, and the first player to reach the configured point limit wins."); RatatatEnabled.SettingChanged += delegate { RatatatState.PushSettingsIfHost(); GameModeManager.OnSettingsChanged(); }; MyceliumNetwork.RegisterNetworkObject((object)this, 3141592655u, 0); ModeLobbyDataSync.RegisterKeys("Eights_Ratatat_Settings", "Eights_Ratatat_Live"); MyceliumNetwork.LobbyCreated += RatatatState.OnLobbyEntered; MyceliumNetwork.LobbyEntered += RatatatState.OnLobbyEntered; MyceliumNetwork.LobbyDataUpdated += RatatatState.OnLobbyDataUpdated; MyceliumNetwork.PlayerEntered += RatatatState.OnPlayerEntered; MyceliumNetwork.PlayerLeft += RatatatState.OnPlayerLeft; } [CustomRPC] public void SyncRatatatSettings(CSteamID hostId, int roundId, int revision, bool enabled, RPCInfo info) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) if (NetworkAuthority.IsHostSender(info) && RatatatState.TryAcceptSettingsSnapshot(hostId, roundId, revision)) { RatatatState.ApplySettings(enabled); } } [CustomRPC] public void SyncRatatatLiveState(CSteamID hostId, int ratPlayerId, string pointsData, int winnerId, int roundId, int revision, RPCInfo info) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) if (NetworkAuthority.IsHostSender(info)) { RatatatState.ApplyLiveState(hostId, ratPlayerId, pointsData, winnerId, roundId, revision); } } [CustomRPC] public void RatatatAnnounce(string text, RPCInfo info) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) if (NetworkAuthority.IsHostSender(info)) { GameModeHud.ReceiveAnnouncement(text, 3f, showHud: true); } } [CustomRPC] public void RequestSkipRound(int playerId, RPCInfo info) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) if (MyceliumNetwork.IsHost && NetworkAuthority.IsPlayerSender(info, playerId)) { GameModeManager.SkipCurrentRound(); } } [CustomRPC] public void RequestSkipMap(int playerId, RPCInfo info) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) if (MyceliumNetwork.IsHost && NetworkAuthority.IsPlayerSender(info, playerId)) { GameModeManager.SkipCurrentMap(); } } [CustomRPC] public void RequestMixupTeams(int playerId, RPCInfo info) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) if (MyceliumNetwork.IsHost && NetworkAuthority.IsPlayerSender(info, playerId)) { GameModeManager.MixupTeams(); } } [CustomRPC] public void SyncScorePopup(int amount, RPCInfo info) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) if (NetworkAuthority.IsHostSender(info) && amount > 0 && amount <= 100) { GameModeHud.ShowScorePopup(amount); } } [CustomRPC] public void SyncGameModeAnnouncement(string text, float durationSeconds, bool showHud, RPCInfo info) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) if (!MyceliumNetwork.IsHost && NetworkAuthority.IsHostSender(info) && !string.IsNullOrWhiteSpace(text) && !float.IsNaN(durationSeconds) && !float.IsInfinity(durationSeconds)) { GameModeHud.ReceiveAnnouncement(text, Mathf.Clamp(durationSeconds, 1f, 8f), showHud); } } [CustomRPC] public void SyncTakeResult(int resultId, string text, float durationSeconds, RPCInfo info) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) if (!MyceliumNetwork.IsHost && NetworkAuthority.IsHostSender(info) && resultId >= 0 && !string.IsNullOrWhiteSpace(text) && !float.IsNaN(durationSeconds) && !float.IsInfinity(durationSeconds)) { GameModeHud.ReceiveTakeResult(resultId, text, Mathf.Clamp(durationSeconds, 1f, 8f)); } } [CustomRPC] public void SyncGlobalSettings(CSteamID hostId, int roundId, int revision, float respawnDelaySeconds, int preRoundSeconds, int pointsToWin, bool enableMapOverrides, bool keepTeams, bool preferTwoTeamHardtat, RPCInfo info) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) if (NetworkAuthority.IsHostSender(info) && GameModeManager.TryAcceptGlobalSettingsSnapshot(hostId, roundId, revision)) { GameModeManager.ApplyGlobalSettings(respawnDelaySeconds, preRoundSeconds, pointsToWin, enableMapOverrides, keepTeams, preferTwoTeamHardtat); } } [CustomRPC] public void SyncActiveGameMode(CSteamID hostId, int mode, int roundId, int phase, int revision, string mapName, bool mapOverridesEnabled, RPCInfo info) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) if (NetworkAuthority.IsHostSender(info) && GameModeManager.TryAcceptActiveModeSnapshot(hostId, roundId, revision, "active-mode-rpc")) { GameModeManager.ApplyActiveMode(mode, roundId, phase, mapName, mapOverridesEnabled); } } [CustomRPC] public void SyncModeTimeout(CSteamID hostId, float timeRemaining, bool suddenDeath, int roundId, int revision, RPCInfo info) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) if (NetworkAuthority.IsHostSender(info)) { ModeTimeoutState.ApplyLiveState(hostId, timeRemaining, suddenDeath, roundId, revision); } } [CustomRPC] public void MyceliumSessionProbe(int probeId, RPCInfo info) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) MyceliumTransportRecovery.OnProbe(info.SenderSteamID, probeId); } [CustomRPC] public void MyceliumSessionProbeAck(int probeId, RPCInfo info) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) MyceliumTransportRecovery.OnProbeAck(info.SenderSteamID, probeId); } [CustomRPC] public void SyncPlayerDisplayNames(CSteamID hostId, int roundId, int revision, string payload, RPCInfo info) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) if (NetworkAuthority.IsHostSender(info)) { PlayerNameSync.ApplySnapshot(hostId, roundId, revision, payload, "rpc"); } } [CustomRPC] public void SyncOutlineRoleState(CSteamID hostId, int mode, int playerId, int roundId, int revision, RPCInfo info) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) if (NetworkAuthority.IsHostSender(info)) { PlayerOutline.ApplyRoleSnapshot(hostId, mode, playerId, roundId, revision); } } [CustomRPC] public void SyncRespawnProtection(int playerId, bool pending, RPCInfo info) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) if (NetworkAuthority.IsHostSender(info)) { RespawnProtection.SetPendingRespawn(playerId, pending); } } [CustomRPC] public void SyncRespawnProtectionActive(int playerId, int objectId, bool active, RPCInfo info) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) if (NetworkAuthority.IsHostSender(info)) { RespawnProtection.SetActiveRespawn(playerId, objectId, active); } } private void InitializeSndtat() { SndtatEnabled = ModeConfigMigration.BindModeEnabled(((BaseUnityPlugin)this).Config, "Game Modes Enabled", "Sndtat", "Two teams alternate between attacking and defending, with attackers planting a bomb at one of two sites and defenders defusing it or eliminating the attackers. A take win awards 40 points with no respawns, and the first team to reach the configured point limit wins."); SndtatEnabled.SettingChanged += delegate { SndtatState.PushSettingsIfHost(); GameModeManager.OnSettingsChanged(); }; MyceliumNetwork.RegisterNetworkObject((object)this, 1618033996u, 0); ModeLobbyDataSync.RegisterKeys("Eights_SnD_Settings", "Eights_SnD_Live"); MyceliumNetwork.LobbyCreated += SndtatState.OnLobbyEntered; MyceliumNetwork.LobbyEntered += SndtatState.OnLobbyEntered; MyceliumNetwork.LobbyLeft += SndtatState.OnLobbyLeft; MyceliumNetwork.LobbyDataUpdated += SndtatState.OnLobbyDataUpdated; MyceliumNetwork.PlayerEntered += SndtatState.OnPlayerEntered; MyceliumNetwork.PlayerLeft += SndtatState.OnPlayerLeft; } [CustomRPC] public void SyncSndtatSettings(CSteamID hostId, int roundId, int revision, bool enabled, bool ignoredLegacySpawnerFlag, RPCInfo info) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) if (NetworkAuthority.IsHostSender(info) && SndtatState.TryAcceptSettingsSnapshot(hostId, roundId, revision)) { SndtatState.ApplySettings(enabled); } } [CustomRPC] public void SyncSndtatLiveState(CSteamID hostId, string assignmentsData, int teamCount, string scoresData, string stateData, int takeId, int winnerId, int roundId, int revision, RPCInfo info) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) if (NetworkAuthority.IsHostSender(info)) { SndtatState.ApplyLiveState(hostId, assignmentsData, teamCount, scoresData, stateData, takeId, winnerId, roundId, revision); } } [CustomRPC] public void RequestSndtatInteraction(int playerId, int commandId, bool pressed, bool lookingAtBomb, RPCInfo info) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) SndtatState.HandleInteractionRequest(playerId, commandId, pressed, lookingAtBomb, info); } [CustomRPC] public void RequestSndtatBombDrop(int playerId, int commandId, RPCInfo info) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) SndtatState.HandleBombDropRequest(playerId, commandId, info); } private void InitializeSnipertat() { SnipertatEnabled = ModeConfigMigration.BindModeEnabled(((BaseUnityPlugin)this).Config, "Game Modes Enabled", "Snipertat", "Players respawn with only the M2000 sniper rifle, unlimited ammunition, and reduced health. Each kill awards 10 points, and the first player to reach the configured point limit wins."); SnipertatEnabled.SettingChanged += delegate { SnipertatState.PushSettingsIfHost(); GameModeManager.OnSettingsChanged(); }; MyceliumNetwork.RegisterNetworkObject((object)this, 1618033992u, 0); ModeLobbyDataSync.RegisterKeys("Eights_Snipertat_Settings", "Eights_Snipertat_Live"); MyceliumNetwork.LobbyCreated += SnipertatState.OnLobbyEntered; MyceliumNetwork.LobbyEntered += SnipertatState.OnLobbyEntered; MyceliumNetwork.LobbyDataUpdated += SnipertatState.OnLobbyDataUpdated; MyceliumNetwork.PlayerEntered += SnipertatState.OnPlayerEntered; MyceliumNetwork.PlayerLeft += SnipertatState.OnPlayerLeft; } [CustomRPC] public void SyncSnipertatSettings(CSteamID hostId, int roundId, int revision, bool enabled, RPCInfo info) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) if (NetworkAuthority.IsHostSender(info) && SnipertatState.TryAcceptSettingsSnapshot(hostId, roundId, revision, "sniper-battle-rpc")) { SnipertatState.ApplySettings(enabled); } } [CustomRPC] public void SyncSnipertatLiveState(CSteamID hostId, string pointsData, int winnerId, int roundId, int revision, RPCInfo info) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) if (NetworkAuthority.IsHostSender(info)) { SnipertatState.ApplyLiveState(hostId, pointsData, winnerId, roundId, revision, "rpc"); } } [CustomRPC] public void SnipertatAnnounce(string text, RPCInfo info) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) if (NetworkAuthority.IsHostSender(info)) { GameModeHud.ReceiveAnnouncement(text, 3f, showHud: true); } } private void InitializeStraftat() { StraftatEnabled = ModeConfigMigration.BindModeEnabled(((BaseUnityPlugin)this).Config, "Game Modes Enabled", "Straftat", "Use the map's normal weapon spawners, movement, and health. Winning a take awards 50 points, and the first player or team to reach the configured point limit wins."); StraftatEnabled.SettingChanged += delegate { GameModeManager.OnSettingsChanged(); }; MyceliumNetwork.RegisterNetworkObject((object)this, 3141592653u, 0); ModeLobbyDataSync.RegisterKeys("Eights_Default_Live"); MyceliumNetwork.LobbyCreated += StraftatState.OnLobbyEntered; MyceliumNetwork.LobbyEntered += StraftatState.OnLobbyEntered; MyceliumNetwork.LobbyDataUpdated += StraftatState.OnLobbyDataUpdated; MyceliumNetwork.PlayerEntered += StraftatState.OnPlayerEntered; MyceliumNetwork.PlayerLeft += StraftatState.OnPlayerLeft; } [CustomRPC] public void SyncStraftatLiveState(CSteamID hostId, string scoresData, string aliveData, int takeId, int winnerId, float timeRemaining, int roundId, int revision, RPCInfo info) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) if (NetworkAuthority.IsHostSender(info)) { StraftatState.ApplyLiveState(hostId, scoresData, aliveData, takeId, winnerId, timeRemaining, roundId, revision); } } [CustomRPC] public void StraftatAnnounce(string text, RPCInfo info) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) if (NetworkAuthority.IsHostSender(info)) { GameModeHud.ReceiveAnnouncement(text, 3f, showHud: true); } } private void InitializeTdmtat() { TdmtatEnabled = ModeConfigMigration.BindModeEnabled(((BaseUnityPlugin)this).Config, "Game Modes Enabled", "Tdmtat", "Teams respawn and fight for kills throughout the match. Each kill awards 10 points to the team, and the first team to reach the configured point limit wins."); TdmtatEnabled.SettingChanged += delegate { TdmtatState.PushSettingsIfHost(); GameModeManager.OnSettingsChanged(); }; MyceliumNetwork.RegisterNetworkObject((object)this, 1618033997u, 0); ModeLobbyDataSync.RegisterKeys("Eights_TDM_Settings", "Eights_TDM_Live"); MyceliumNetwork.LobbyCreated += TdmtatState.OnLobbyEntered; MyceliumNetwork.LobbyEntered += TdmtatState.OnLobbyEntered; MyceliumNetwork.LobbyLeft += TdmtatState.OnLobbyLeft; MyceliumNetwork.LobbyDataUpdated += TdmtatState.OnLobbyDataUpdated; MyceliumNetwork.PlayerEntered += TdmtatState.OnPlayerEntered; MyceliumNetwork.PlayerLeft += TdmtatState.OnPlayerLeft; } [CustomRPC] public void SyncTdmtatSettings(CSteamID hostId, int roundId, int revision, bool enabled, bool ignoredLegacySpawnerFlag, RPCInfo info) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) if (NetworkAuthority.IsHostSender(info) && TdmtatState.TryAcceptSettingsSnapshot(hostId, roundId, revision)) { TdmtatState.ApplySettings(enabled); } } [CustomRPC] public void SyncTdmtatLiveState(CSteamID hostId, string assignmentsData, int teamCount, string scoresData, int roundId, int revision, RPCInfo info) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) if (NetworkAuthority.IsHostSender(info)) { TdmtatState.ApplyLiveState(hostId, assignmentsData, teamCount, scoresData, roundId, revision); } } } [HarmonyPatch(typeof(PlayerManager), "SpawnPlayer", new Type[] { typeof(int), typeof(int), typeof(Vector3), typeof(Quaternion) })] internal static class PlayerManager_AssassintatSpawn_Patch { private static void Postfix(PlayerManager __instance) { if (GameModeManager.IsActive(GameMode.Assassintat) && !WeaponService.IsFinalGameScreen && !((Object)(object)__instance.player == (Object)null)) { ClientInstance component = ((Component)__instance).GetComponent<ClientInstance>(); if ((Object)(object)component != (Object)null) { AssassintatState.RequestLoadout(component.PlayerId); } } } } internal static class AssassintatState { internal const string SettingsLobbyDataKey = "Eights_Assassintat_Settings"; internal const string LiveLobbyDataKey = "Eights_Assassintat_Live"; internal const string AssassintatWeaponName = "Silenzzio"; internal const string KingWeaponName = "Taser"; internal const string BodyguardWeaponName = "Glock"; internal const int MinWeaponDelaySeconds = 5; internal const int MaxWeaponDelaySeconds = 30; private const int DefaultWeaponDelaySeconds = 15; internal const int PointsForAssassintatWin = 50; internal const int PointsForKingSurvival = 30; internal const int PointsForBodyguardSurvival = 10; internal const int PointsForBodyguardKill = 20; internal const float DefaultTakeTimeLimitSeconds = 90f; internal static bool Enabled; internal static readonly Dictionary<int, int> Scores = new Dictionary<int, int>(); private static readonly HashSet<int> AlivePlayers = new HashSet<int>(); private static readonly HashSet<int> BodyguardPlayerIds = new HashSet<int>(); private static readonly Dictionary<int, float> PendingLoadouts = new Dictionary<int, float>(); private static readonly ModeSyncState Sync = new ModeSyncState(); private static float _nextLoadoutCheckTime; private static float _nextClientLivePollTime; private static float _takeTimeRemaining; private static int _takeId; private static int _localRoleTakeId = -1; private static int _localRoleAnnouncedTakeId = -1; private static bool _localRoleAnnouncementPending; private static bool _startRetryPending; private static bool _takeEnding; internal static int KingPlayerId { get; private set; } = -1; internal static int WinnerId { get; private set; } = -1; internal static int PointsToWin => GameModeManager.EffectivePointsToWin; internal static bool WeaponsUnlocked { get; private set; } internal static int WeaponDelaySeconds { get; private set; } = 15; internal static float TakeTimeRemaining => Mathf.Max(0f, _takeTimeRemaining); internal static float RoleAnnouncementDuration => 90f; internal static bool LocalIsAssassintat { get; private set; } internal static bool LocalIsKing { get; private set; } private static int AssassintatPlayerId { get; set; } = -1; internal static void ApplySettings(bool enabled) { if (!GameModeManager.ShouldDeferModeDisable(GameMode.Assassintat, enabled)) { bool num = Enabled != enabled; Enabled = enabled; if (num) { ResetMatchState(); } } } private static void ApplySettingsFromHostConfig() { ApplySettings(Plugin.AssassintatEnabled.Value); } internal static void PushSettingsIfHost() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) if (MyceliumNetwork.InLobby && MyceliumNetwork.IsHost) { ApplySettingsFromHostConfig(); int num = Sync.NextSettingsRevision(); ModeLobbyDataSync.Publish("Eights_Assassintat_Settings", MyceliumNetwork.LobbyHost, GameModeManager.RoundId, num, Plugin.AssassintatEnabled.Value ? "1" : "0"); MyceliumNetwork.RPC(3141592658u, "SyncAssassintatSettings", (ReliableType)1, new object[4] { MyceliumNetwork.LobbyHost, GameModeManager.RoundId, num, Plugin.AssassintatEnabled.Value }); } } internal static void PeriodicPushSettingsIfHost() { if (Sync.IsSettingsPushDue()) { PushSettingsIfHost(); } } internal static void PeriodicPushIfHost() { if (Sync.IsLivePushDue()) { BroadcastLiveState(); SendRoleStates(announce: true); } } internal static void PollLiveStateIfClient() { if (!MyceliumNetwork.IsHost && MyceliumNetwork.InLobby && GameModeManager.IsActive(GameMode.Assassintat) && !(Time.unscaledTime < _nextClientLivePollTime)) { _nextClientLivePollTime = Time.unscaledTime + 1f; ApplyLobbyLiveSnapshot(); } } internal static void OnLobbyEntered() { Sync.ResetForLobby(); _nextClientLivePollTime = 0f; if (MyceliumNetwork.IsHost) { ApplySettingsFromHostConfig(); ResetMatchState(); PushSettingsIfHost(); BroadcastLiveState(); } else { ApplyLobbySettingsSnapshot(); ApplyLobbyLiveSnapshot(); } } internal static void OnLobbyLeft() { Sync.ResetForLobby(); _nextClientLivePollTime = 0f; ResetMatchState(); } internal static void OnLobbyDataUpdated(List<string> keys) { if (!MyceliumNetwork.IsHost && MyceliumNetwork.InLobby) { if (ModeLobbyDataSync.ContainsKey(keys, "Eights_Assassintat_Settings")) { ApplyLobbySettingsSnapshot(); } if (ModeLobbyDataSync.ContainsKey(keys, "Eights_Assassintat_Live")) { ApplyLobbyLiveSnapshot(); } } } internal static void OnPlayerEntered(CSteamID player) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_001c: 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_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0100: 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) if (!MyceliumNetwork.IsHost) { return; } MyceliumNetwork.RPCTarget(3141592658u, "SyncAssassintatSettings", player, (ReliableType)1, new object[4] { MyceliumNetwork.LobbyHost, GameModeManager.RoundId, Sync.SettingsRevision, Plugin.AssassintatEnabled.Value }); MyceliumNetwork.RPCTarget(3141592658u, "SyncAssassintatLiveState", player, (ReliableType)1, new object[10] { MyceliumNetwork.LobbyHost, KingPlayerId, SerializeScores(), WinnerId, _takeId, WeaponsUnlocked, WeaponDelaySeconds, _takeTimeRemaining, GameModeManager.RoundId, Sync.LiveRevision }); if (TakeIsActive()) { int num = FindPlayerId(player); if (num >= 0) { AlivePlayers.Add(num); BodyguardPlayerIds.Add(num); Scores.TryAdd(num, 0); SendRoleToPlayer(player, num, announce: true); } } } internal static void OnPlayerLeft(CSteamID player) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) if (!MyceliumNetwork.IsHost) { return; } int num = PlayerLookup.FindPlayerId(player); int num2; if (num >= 0) { num2 = (AlivePlayers.Contains(num) ? 1 : 0); if (num2 != 0 && GameModeManager.IsActive(GameMode.Assassintat) && WinnerId < 0 && !_takeEnding) { OnServerKill(num, -1); } } else { num2 = 0; } bool flag = num2 != 0 || (num >= 0 && Scores.Remove(num)); PendingLoadouts.Remove(num); AlivePlayers.Remove(num); BodyguardPlayerIds.Remove(num); if (num >= 0 && AssassintatPlayerId == num) { AssassintatPlayerId = -1; flag = true; } if (num >= 0 && KingPlayerId == num) { KingPlayerId = -1; flag = true; } if (flag && GameModeManager.IsActive(GameMode.Assassintat)) { BroadcastLiveState(); } } internal static bool TryAcceptSettingsSnapshot(CSteamID hostId, int roundId, int revision) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) return Sync.TryAcceptSettingsSnapshot(hostId, roundId, revision); } internal static void ResetMatchState() { Sync.ResetLiveState(); _nextLoadoutCheckTime = 0f; _takeTimeRemaining = 0f; _takeId = 0; WeaponDelaySeconds = 15; _localRoleTakeId = -1; _localRoleAnnouncedTakeId = -1; _localRoleAnnouncementPending = false; _startRetryPending = false; _takeEnding = false; AssassintatPlayerId = -1; KingPlayerId = -1; WinnerId = -1; WeaponsUnlocked = false; LocalIsAssassintat = false; LocalIsKing = false; AlivePlayers.Clear(); BodyguardPlayerIds.Clear(); PendingLoadouts.Clear(); Scores.Clear(); } internal static void ApplyLiveState(CSteamID hostId, int kingPlayerId, string scoresData, int winnerId, int takeId, bool weaponsUnlocked, int weaponDelaySeconds, float takeTimeRemaining, int roundId, int revision, string source = "rpc") { //IL_0047: Unknown result type (might be due to invalid IL or missing references) int lastLiveRoundId = Sync.LastLiveRoundId; if (kingPlayerId < -1 || winnerId < -1 || weaponDelaySeconds < 5 || weaponDelaySeconds > 30 || takeTimeRemaining < 0f || float.IsNaN(takeTimeRemaining) || float.IsInfinity(takeTimeRemaining) || takeTimeRemaining > 90f || !Sync.TryAcceptLiveSnapshot(hostId, roundId, revision, source)) { return; } KingPlayerId = kingPlayerId; _takeId = ((roundId != lastLiveRoundId) ? takeId : Math.Max(_takeId, takeId)); WinnerId = winnerId; WeaponsUnlocked = weaponsUnlocked; WeaponDelaySeconds = weaponDelaySeconds; _takeTimeRemaining = takeTimeRemaining; Scores.Clear(); foreach (KeyValuePair<int, int> item in ScoreCodec.Parse(scoresData, PointsToWin)) { Scores[item.Key] = item.Value; } } internal static void OnRoundStarted() { if (Enabled && GameModeManager.IsActive(GameMode.Assassintat) && MyceliumNetwork.IsHost) { Scores.Clear(); WinnerId = -1; StartTake(); } } internal static void ServerTick(float deltaTime) { if (Enabled && MyceliumNetwork.IsHost && GameModeManager.IsActive(GameMode.Assassintat) && GameModeManager.IsRoundGameplayActive && WinnerId < 0 && TakeIsActive()) { _takeTimeRemaining = Mathf.Max(0f, _takeTimeRemaining - Mathf.Max(0f, deltaTime)); if (_takeTimeRemaining <= 0f) { CompleteTimeoutWin(); } } } internal static void ClientTick(float deltaTime) { TryAnnounceLocalRole(); if (!MyceliumNetwork.IsHost && Enabled && GameModeManager.IsActive(GameMode.Assassintat) && GameModeManager.IsRoundGameplayActive && WinnerId < 0 && TakeIsActive()) { _takeTimeRemaining = Mathf.Max(0f, _takeTimeRemaining - Mathf.Max(0f, deltaTime)); } } internal static void OnServerKill(int deadPlayerId, int killerId) { if (!Enabled || !GameModeManager.IsActive(GameMode.Assassintat) || WinnerId >= 0 || _takeEnding) { return; } bool flag = AlivePlayers.Remove(deadPlayerId); bool flag2 = deadPlayerId == KingPlayerId; bool flag3 = deadPlayerId == AssassintatPlayerId; if (!flag2 && !flag3 && flag && !BodyguardPlayerIds.Contains(deadPlayerId)) { Plugin.Logger.LogWarning((object)($"[Assassintat] Repairing stale assassin role for dead player {deadPlayerId}; " + $"stored assassin={AssassintatPlayerId}, king={KingPlayerId}, take={_takeId}.")); AssassintatPlayerId = deadPlayerId; flag3 = true; } if (!flag && !flag2 && !flag3) { return; } if (AssassintatRules.IsTerminalDeath(flag2, flag3) && flag2) { AwardScore(AssassintatPlayerId, AssassintatRules.GetAssassintatAward(flag2)); GameModeHud.BroadcastTakeResult("<b>" + PlayerLookup.GetPlayerNameTag(AssassintatPlayerId) + " won the take</b>\n<i>The king was eliminated</i>"); AnnounceResult("The King was killed. The Assassintat was " + PlayerLookup.GetPlayerNameTag(AssassintatPlayerId) + "."); FinishTake(); } else if (fl