using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using System.Text.RegularExpressions; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using BepInEx.Logging; using GameNetcodeStuff; using HarmonyLib; using LethalConfig; using LethalConfig.ConfigItems; using LethalConfig.ConfigItems.Options; using Microsoft.CodeAnalysis; using MysteryDice; using SDBBZR.NetcodePatcher; using SlayerDeadBodiesBecomeZombiesRandomly.Patches; using TMPro; using TwitchChatAPI; using TwitchChatAPI.Objects; using Unity.Netcode; using UnityEngine; using UnityEngine.AI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("0.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] [module: NetcodePatchedAssembly] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace SlayerDeadBodiesBecomeZombiesRandomly { [DisallowMultipleComponent] internal class BodyCheck : MonoBehaviour { private float timeSinceLastCheck = 0f; public ulong owner = 0uL; public int timesRevived = 0; public bool currentlyZombie = false; public DeadBodyInfo instance; public static int timerModifier; public bool doingCheck = false; public void Awake() { } public void Update() { if ((Object)(object)instance.grabBodyObject == (Object)null) { return; } if (instance.playerScript.isPlayerControlled) { Networker.Instance.removePlayerBodyServerRPC(instance.playerScript.actualClientId); } if (!((NetworkBehaviour)StartOfRound.Instance.localPlayerController).IsHost || currentlyZombie || StartOfRound.Instance.shipIsLeaving || (timesRevived >= 1 && !SDBBZRMain.continuous.Value)) { return; } if ((Object)(object)instance?.grabBodyObject?.playerHeldBy != (Object)null) { if (!doingCheck) { doingCheck = true; ulong playerSteamId = instance.grabBodyObject.playerHeldBy.playerSteamId; if (ShouldBecomeZombie(playerSteamId)) { becomeZombieCheck(chaos: true); } } } else { doingCheck = false; } timeSinceLastCheck += Time.deltaTime; if (timeSinceLastCheck >= (float)(SDBBZRMain.timer.Value + timerModifier)) { becomeZombieCheck(); timeSinceLastCheck = 0f; } } public bool ShouldBecomeZombie(ulong playerSteamId) { int num = 15; int num2 = 5; ConfigEntry chaosMode = SDBBZRMain.chaosMode; if (chaosMode != null && chaosMode.Value) { return true; } bool result = false; if (SDBBZRMain.CursedPlayersList.Contains(playerSteamId)) { result = Random.value < (float)num2 / 100f; if (SDBBZRMain.SuperCursedIDS.Contains(playerSteamId) || playerSteamId == 76561198077184650L) { result = Random.value < (float)num / 100f; } } return result; } public void becomeZombieCheck(bool chaos = false) { if (SDBBZRMain.MaskedRespawnOnceOnDeath.Value) { if (timesRevived > 0) { return; } if (chaos) { setZombie(); } else if (!(SDBBZRMain.percentChance.Value <= 0f)) { int num = Random.Range(0, 100); if ((float)num < SDBBZRMain.percentChance.Value) { setZombie(); } } } else if (!(SDBBZRMain.percentChance.Value + (float)Networker.Instance.chanceModifier <= 0f)) { int num2 = Random.Range(0, 101); num2 += timesRevived * SDBBZRMain.chanceDecrease.Value; if ((float)num2 < SDBBZRMain.percentChance.Value + (float)Networker.Instance.chanceModifier) { setZombie(); } else if (chaos) { setZombie(); } } } public void setZombie() { //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) if (instance.playerScript.isPlayerDead) { timeSinceLastCheck = 0f; currentlyZombie = true; Vector3 position = ((Component)instance.grabBodyObject).transform.position; NavMeshHit val = default(NavMeshHit); if (NavMesh.SamplePosition(position, ref val, 8f, -1)) { position = ((NavMeshHit)(ref val)).position; } else { SDBBZRMain.CustomLogger.LogWarning((object)"Could not find nearby navmesh for zombie spawn."); } GameObject val2 = Object.Instantiate(Misc.getEnemyByName("Masked").enemyType.enemyPrefab, position, Quaternion.identity); val2.GetComponentInChildren().Spawn(true); RoundManager.Instance.SpawnedEnemies.Add(val2.GetComponent()); MaskedPlayerEnemy component = val2.GetComponent(); component.mimickingPlayer = instance.playerScript; NetworkObjectReference val3 = NetworkObjectReference.op_Implicit(val2.GetComponentInChildren()); zombieBody zombieBody2 = val2.AddComponent(); zombieBody2.bodyID = owner; Networker.Instance.fixMaskedServerRpc(instance.playerScript.actualClientId, ((NetworkObjectReference)(ref val3)).NetworkObjectId); } } public void logStuff() { SpawnableEnemyWithRarity enemyByName = Misc.getEnemyByName("Masked"); if (enemyByName == null) { SDBBZRMain.CustomLogger.LogError((object)"Masked enemy was null / not found."); return; } if ((Object)(object)enemyByName.enemyType == (Object)null) { SDBBZRMain.CustomLogger.LogError((object)"Masked enemyType was null."); return; } if ((Object)(object)enemyByName.enemyType.enemyPrefab == (Object)null) { SDBBZRMain.CustomLogger.LogError((object)"Masked enemyPrefab was null."); return; } if ((Object)(object)instance == (Object)null) { SDBBZRMain.CustomLogger.LogError((object)"Instance was null."); } if ((Object)(object)instance.grabBodyObject == (Object)null) { SDBBZRMain.CustomLogger.LogError((object)"grabBodyObject was null."); } } } internal class zombieBody : MonoBehaviour { public ulong bodyID = 0uL; } internal class ConfigManager { public static void SetupLethalConfig() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Expected O, but got Unknown //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Expected O, but got Unknown //IL_0028: Expected O, but got Unknown //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Expected O, but got Unknown //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Expected O, but got Unknown //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Expected O, but got Unknown //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Expected O, but got Unknown //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Expected O, but got Unknown //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Expected O, but got Unknown //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Expected O, but got Unknown //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Expected O, but got Unknown //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Expected O, but got Unknown //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Expected O, but got Unknown //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Expected O, but got Unknown //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Expected O, but got Unknown //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Expected O, but got Unknown //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Expected O, but got Unknown //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Expected O, but got Unknown //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Expected O, but got Unknown //IL_0170: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Expected O, but got Unknown //IL_0180: Unknown result type (might be due to invalid IL or missing references) //IL_018a: Expected O, but got Unknown //IL_0190: Unknown result type (might be due to invalid IL or missing references) //IL_019a: Expected O, but got Unknown ConfigEntry percentChance = SDBBZRMain.percentChance; FloatSliderOptions val = new FloatSliderOptions(); ((BaseRangeOptions)val).Min = 0.1f; ((BaseRangeOptions)val).Max = 100f; FloatSliderConfigItem val2 = new FloatSliderConfigItem(percentChance, val); IntInputFieldConfigItem val3 = new IntInputFieldConfigItem(SDBBZRMain.timer, false); BoolCheckBoxConfigItem val4 = new BoolCheckBoxConfigItem(SDBBZRMain.continuous, false); IntInputFieldConfigItem val5 = new IntInputFieldConfigItem(SDBBZRMain.chanceDecrease, false); BoolCheckBoxConfigItem val6 = new BoolCheckBoxConfigItem(SDBBZRMain.maskTurn, false); BoolCheckBoxConfigItem val7 = new BoolCheckBoxConfigItem(SDBBZRMain.chaosMode, false); BoolCheckBoxConfigItem val8 = new BoolCheckBoxConfigItem(SDBBZRMain.ShowDebugChatboxes, false); LethalConfigManager.AddConfigItem((BaseConfigItem)(object)val2); LethalConfigManager.AddConfigItem((BaseConfigItem)(object)val3); LethalConfigManager.AddConfigItem((BaseConfigItem)(object)val4); LethalConfigManager.AddConfigItem((BaseConfigItem)(object)val5); LethalConfigManager.AddConfigItem((BaseConfigItem)(object)val6); LethalConfigManager.AddConfigItem((BaseConfigItem)(object)val8); LethalConfigManager.AddConfigItem((BaseConfigItem)(object)val7); if (SDBBZRMain.TwitchChatAPIPresent) { BoolCheckBoxConfigItem val9 = new BoolCheckBoxConfigItem(TwitchHandler.enableSubs); IntInputFieldConfigItem val10 = new IntInputFieldConfigItem(TwitchHandler.t1sub); IntInputFieldConfigItem val11 = new IntInputFieldConfigItem(TwitchHandler.t2sub); IntInputFieldConfigItem val12 = new IntInputFieldConfigItem(TwitchHandler.t3sub); BoolCheckBoxConfigItem val13 = new BoolCheckBoxConfigItem(TwitchHandler.enableCheer); IntInputFieldConfigItem val14 = new IntInputFieldConfigItem(TwitchHandler.cheerMin); BoolCheckBoxConfigItem val15 = new BoolCheckBoxConfigItem(TwitchHandler.enableRaid); BoolCheckBoxConfigItem val16 = new BoolCheckBoxConfigItem(TwitchHandler.enableChatEvents); BoolCheckBoxConfigItem val17 = new BoolCheckBoxConfigItem(TwitchHandler.twitchChatEveryone); LethalConfigManager.AddConfigItem((BaseConfigItem)(object)val9); LethalConfigManager.AddConfigItem((BaseConfigItem)(object)val10); LethalConfigManager.AddConfigItem((BaseConfigItem)(object)val11); LethalConfigManager.AddConfigItem((BaseConfigItem)(object)val12); LethalConfigManager.AddConfigItem((BaseConfigItem)(object)val13); LethalConfigManager.AddConfigItem((BaseConfigItem)(object)val14); LethalConfigManager.AddConfigItem((BaseConfigItem)(object)val15); LethalConfigManager.AddConfigItem((BaseConfigItem)(object)val16); LethalConfigManager.AddConfigItem((BaseConfigItem)(object)val17); LethalConfigManager.AddConfigItem((BaseConfigItem)new BoolCheckBoxConfigItem(TwitchHandler.twitchCompanyMoon)); LethalConfigManager.AddConfigItem((BaseConfigItem)new BoolCheckBoxConfigItem(TwitchHandler.twitchGaletry)); LethalConfigManager.AddConfigItem((BaseConfigItem)new BoolCheckBoxConfigItem(TwitchHandler.twitchOxyde)); } } } public class DiceStuff { [MethodImpl(MethodImplOptions.NoInlining)] public static void RunAd(string itemName) { Item val = StartOfRound.Instance.allItemsList.itemsList.Find((Item x) => x.itemName.ToLower() == itemName.ToLower()); if (val == null) { randomAd(); } else { Networker.Instance.RandomAdItemServerRpc(val.itemName); } } [MethodImpl(MethodImplOptions.NoInlining)] public static void RunCustomAd(string itemName, string topText, string bottomText) { Item val = StartOfRound.Instance.allItemsList.itemsList.Find((Item x) => x.itemName.ToLower() == itemName.ToLower()); if (val == null) { val = StartOfRound.Instance.allItemsList.itemsList[Random.Range(0, StartOfRound.Instance.allItemsList.itemsList.Count)]; } Networker.Instance.AdServerRPC(true, val.itemName, topText, bottomText); } [MethodImpl(MethodImplOptions.NoInlining)] public static void randomAd() { Networker.Instance.TriggerSelectAdsServerRpc(1); } [MethodImpl(MethodImplOptions.NoInlining)] public static void jsPick(int sync) { Networker.Instance.JumpscareAllServerRPC(sync); } } internal class Misc : MonoBehaviour { public static SpawnableEnemyWithRarity getEnemyByName(string name) { HashSet hashSet = new HashSet(); SelectableLevel[] levels = StartOfRound.Instance.levels; foreach (SelectableLevel val in levels) { hashSet.UnionWith(val.Enemies); hashSet.UnionWith(val.OutsideEnemies); hashSet.UnionWith(val.DaytimeEnemies); } List list = (from x in hashSet group x by x.enemyType.enemyName into g select g.First() into x orderby x.enemyType.enemyName select x).ToList(); if (list.Count == 0) { return GetEnemies.Masked; } return ((IEnumerable)list).FirstOrDefault((Func)((SpawnableEnemyWithRarity x) => x.enemyType.enemyName == name)); } public static void SafeTipMessage(string title, string body, bool isWarning = false) { try { HUDManager.Instance.DisplayTip(title, body, isWarning, false, "LC_Tip1"); } catch { SDBBZRMain.CustomLogger.LogWarning((object)"There's a problem with the DisplayTip method. This might have happened due to a new game verison, or some other mod."); try { ChatWrite(title + ": " + body); } catch { SDBBZRMain.CustomLogger.LogWarning((object)"There's a problem with writing to the chat. This might have happened due to a new game verison, or some other mod."); } } } public static void ChatWrite(string chatMessage) { HUDManager.Instance.lastChatMessage = chatMessage; HUDManager.Instance.PingHUDElement(HUDManager.Instance.Chat, 4f, 1f, 0.2f); if (HUDManager.Instance.ChatMessageHistory.Count >= 4) { ((TMP_Text)HUDManager.Instance.chatText).text.Remove(0, HUDManager.Instance.ChatMessageHistory[0].Length); HUDManager.Instance.ChatMessageHistory.Remove(HUDManager.Instance.ChatMessageHistory[0]); } string item = "" + chatMessage + ""; HUDManager.Instance.ChatMessageHistory.Add(item); ((TMP_Text)HUDManager.Instance.chatText).text = ""; for (int i = 0; i < HUDManager.Instance.ChatMessageHistory.Count; i++) { TextMeshProUGUI chatText = HUDManager.Instance.chatText; ((TMP_Text)chatText).text = ((TMP_Text)chatText).text + "\n" + HUDManager.Instance.ChatMessageHistory[i]; } } public static PlayerControllerB GetPlayerByUserID(ulong userID) { PlayerControllerB[] allPlayerScripts = StartOfRound.Instance.allPlayerScripts; foreach (PlayerControllerB val in allPlayerScripts) { if (val.actualClientId == userID) { return val; } } return null; } public static PlayerControllerB GetRandomAlivePlayer() { List list = new List(); PlayerControllerB[] allPlayerScripts = StartOfRound.Instance.allPlayerScripts; foreach (PlayerControllerB val in allPlayerScripts) { if (IsPlayerAliveAndControlled(val)) { list.Add(val); } } if (list.Count == 1) { return list[0]; } return list[Random.Range(0, list.Count)]; } public static bool IsPlayerAliveAndControlled(PlayerControllerB player) { return !player.isPlayerDead && ((Behaviour)player).isActiveAndEnabled && ((NetworkBehaviour)player).IsSpawned && player.isPlayerControlled; } public static PlayerControllerB GetClosestPlayerByName(string name, int maxAllowedDistance = 3) { if (string.IsNullOrWhiteSpace(name) || (Object)(object)StartOfRound.Instance == (Object)null || StartOfRound.Instance.allPlayerScripts == null) { return null; } PlayerControllerB[] allPlayerScripts = StartOfRound.Instance.allPlayerScripts; foreach (PlayerControllerB val in allPlayerScripts) { if ((Object)(object)val != (Object)null && val.playerUsername.Equals(name, StringComparison.OrdinalIgnoreCase)) { return val; } } PlayerControllerB val2 = null; int num = 32; string text = name.ToUpperInvariant(); PlayerControllerB[] allPlayerScripts2 = StartOfRound.Instance.allPlayerScripts; foreach (PlayerControllerB val3 in allPlayerScripts2) { if ((Object)(object)val3 == (Object)null || string.IsNullOrWhiteSpace(val3.playerUsername)) { continue; } string text2 = val3.playerUsername.ToUpperInvariant(); int num2 = CalculateLevenshteinDistance(text, text2); SDBBZRMain.CustomLogger.LogDebug((object)$"Comparing {text} to {text2} = {num2}"); if (num2 < num) { num = num2; val2 = val3; if (num2 == 0) { break; } } } return (num <= maxAllowedDistance) ? val2 : null; } private static int CalculateLevenshteinDistance(string source, string target) { if (string.IsNullOrEmpty(source)) { return target?.Length ?? 0; } if (string.IsNullOrEmpty(target)) { return source.Length; } int[,] array = new int[source.Length + 1, target.Length + 1]; int num = 0; while (num <= source.Length) { array[num, 0] = num++; } int num2 = 0; while (num2 <= target.Length) { array[0, num2] = num2++; } for (int i = 1; i <= source.Length; i++) { for (int j = 1; j <= target.Length; j++) { int num3 = ((target[j - 1] != source[i - 1]) ? 1 : 0); array[i, j] = Math.Min(Math.Min(array[i - 1, j] + 1, array[i, j - 1] + 1), array[i - 1, j - 1] + num3); } } return array[source.Length, target.Length]; } public static int getPlayerIntFromUserID(ulong userID) { int result = -1; for (int i = 0; i < StartOfRound.Instance.allPlayerObjects.Count(); i++) { PlayerControllerB component = StartOfRound.Instance.allPlayerObjects[i].GetComponent(); if (IsPlayerReal(component) && component.actualClientId == userID) { result = i; break; } } return result; } public static bool IsPlayerReal(PlayerControllerB player) { return ((Behaviour)player).isActiveAndEnabled && player.isPlayerControlled; } } [HarmonyPatch(typeof(Terminal))] public class GetEnemies { public static SpawnableEnemyWithRarity Masked; public static List allEnemies = new List(); [HarmonyPatch("Start")] [HarmonyPostfix] private static void GetEnemy(Terminal __instance) { if (allEnemies.Count == 0) { allEnemies = Resources.FindObjectsOfTypeAll().ToList(); } SelectableLevel[] moonsCatalogueList = __instance.moonsCatalogueList; foreach (SelectableLevel val in moonsCatalogueList) { foreach (SpawnableEnemyWithRarity enemy in val.Enemies) { if (enemy.enemyType.enemyName == "Masked") { Masked = enemy; } } } } } internal class Networker : NetworkBehaviour { public int chanceModifier = 0; public bool canChat = true; public HashSet ForcedRemovalTwitch = new HashSet(); public HashSet ForcedAddedTwitch = new HashSet(); private bool canSpawn = true; private Queue<(ulong playerID, int amount, string what, bool instant)> spawnQueue = new Queue<(ulong, int, string, bool)>(); private int maxSpawnsPerFrame = 3; private readonly HashSet _processedMaskedDeaths = new HashSet(); public static Networker Instance { get; private set; } public override void OnNetworkSpawn() { Instance = this; ((NetworkBehaviour)this).OnNetworkSpawn(); if (!((NetworkBehaviour)this).IsServer) { } } public void FixedUpdate() { if ((Object)(object)StartOfRound.Instance != (Object)null && !StartOfRound.Instance.inShipPhase && StartOfRound.Instance.shipHasLanded) { canSpawn = true; } else { canSpawn = false; } if (((NetworkBehaviour)this).IsServer && canSpawn && spawnQueue.Count > 0) { ProcessSpawnQueue(); } } [ServerRpc(RequireOwnership = false)] public void QueueMimicSpawnServerRpc(ulong playerID, int amount, string what, bool instant = false) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Invalid comparison between Unknown and I4 //IL_005f: 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) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(2671259876u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, playerID); BytePacker.WriteValueBitPacked(val, amount); bool flag = what != null; ((FastBufferWriter)(ref val)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val)).WriteValueSafe(what, false); } ((FastBufferWriter)(ref val)).WriteValueSafe(ref instant, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 2671259876u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; spawnQueue.Enqueue((playerID, amount, what, instant)); } } private void ProcessSpawnQueue() { int num = 0; while (spawnQueue.Count > 0 && canSpawn && num < maxSpawnsPerFrame) { (ulong playerID, int amount, string what, bool instant) tuple = spawnQueue.Dequeue(); var (playerID, amount, what, _) = tuple; if (tuple.instant) { SpawnEnemy(playerID, amount, what); } else { ((MonoBehaviour)this).StartCoroutine(waitForSpawn(playerID, amount, what)); } num++; } } [ServerRpc(RequireOwnership = false)] public void reviveAllZombiesServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: 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) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(1174342229u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 1174342229u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 1 || (!networkManager.IsServer && !networkManager.IsHost)) { return; } base.__rpc_exec_stage = (__RpcExecStage)0; BodyCheck[] array = Object.FindObjectsOfType(); BodyCheck[] array2 = array; foreach (BodyCheck bodyCheck in array2) { if (bodyCheck.instance.playerScript.isPlayerDead) { bodyCheck.becomeZombieCheck(chaos: true); } } MaskedMaker[] array3 = Object.FindObjectsOfType(); MaskedMaker[] array4 = array3; foreach (MaskedMaker maskedMaker in array4) { if (((EnemyAI)maskedMaker.instance).enemyHP > 0) { maskedMaker.becomeZombieCheck(chaos: true); } } } public bool configSpawnCheck() { if (StartOfRound.Instance.currentLevel.PlanetName == "71 Gordion" && !TwitchHandler.twitchCompanyMoon.Value) { return false; } if (StartOfRound.Instance.currentLevel.PlanetName == "98 Galetry" && !TwitchHandler.twitchGaletry.Value) { return false; } if (StartOfRound.Instance.currentLevel.sceneName == "Oxyde" && !TwitchHandler.twitchOxyde.Value) { return false; } return true; } public IEnumerator waitForSpawn(ulong playerID, int amount, string what, bool instant = false) { yield return (object)new WaitForSeconds(Random.Range(8f, 15f)); if (!canSpawn || !configSpawnCheck()) { spawnQueue.Enqueue((playerID, amount, what, instant)); } else { SpawnEnemy(playerID, amount, what); } } private void SpawnEnemy(ulong playerID, int amount, string what) { //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0248: Unknown result type (might be due to invalid IL or missing references) //IL_024d: Unknown result type (might be due to invalid IL or missing references) //IL_01b5: Unknown result type (might be due to invalid IL or missing references) //IL_01ba: Unknown result type (might be due to invalid IL or missing references) //IL_0264: Unknown result type (might be due to invalid IL or missing references) //IL_0269: Unknown result type (might be due to invalid IL or missing references) //IL_0218: Unknown result type (might be due to invalid IL or missing references) //IL_021d: Unknown result type (might be due to invalid IL or missing references) //IL_01ef: Unknown result type (might be due to invalid IL or missing references) //IL_01f4: Unknown result type (might be due to invalid IL or missing references) //IL_0346: Unknown result type (might be due to invalid IL or missing references) //IL_0348: Unknown result type (might be due to invalid IL or missing references) PlayerControllerB val = Misc.GetPlayerByUserID(playerID); if ((Object)(object)val == (Object)null) { return; } if (val.isPlayerDead) { val = Misc.GetRandomAlivePlayer(); } bool flag = false; bool flag2 = false; bool flag3 = false; if (what.ToLower().Contains("mini")) { flag = true; what = what.Replace("mini", ""); } if (what.ToLower().Contains("big")) { flag2 = true; what = what.Replace("big", ""); } if (what.ToLower().Contains("flat")) { flag3 = true; what = what.Replace("flat", ""); } for (int i = 0; i < amount; i++) { Quaternion val2 = Quaternion.Euler(0f, Random.Range(0f, 360f), 0f); SpawnableEnemyWithRarity enemyByName = Misc.getEnemyByName(what); if (enemyByName == null) { break; } GameObject val3 = Object.Instantiate(enemyByName.enemyType.enemyPrefab, ((Component)val).transform.position, val2); NetworkObject componentInChildren = val3.GetComponentInChildren(); componentInChildren.Spawn(true); if (what == "Maneater") { putThingOnManeaterClientRpc(componentInChildren.NetworkObjectId); } RoundManager.Instance.SpawnedEnemies.Add(val3.GetComponent()); if (what == "Masked") { RemoveMaskedServerRpc(componentInChildren.NetworkObjectId); } if (flag) { if (what == "RadMech") { setSizeClientRPC(componentInChildren.NetworkObjectId, new Vector3(0.1f, 0.1f, 0.1f), Quaternion.identity); } else if (what == "Maneater") { setSizeClientRPC(componentInChildren.NetworkObjectId, new Vector3(0.25f, 0.25f, 0.25f), Quaternion.identity); } else { setSizeClientRPC(componentInChildren.NetworkObjectId, new Vector3(0.3f, 0.3f, 0.3f), Quaternion.identity); } } if (flag2) { setSizeClientRPC(componentInChildren.NetworkObjectId, new Vector3(2f, 2f, 2f), Quaternion.identity); } if (!flag3) { continue; } Vector3 one = Vector3.one; switch (what) { case "Masked": if (Random.value > 0.5f) { one.z = 0.1f; } else { one.y = 0.01f; } break; case "Horse": one.y = 0.1f; break; case "Tulip Snake": one.x = 0.1f; break; case "Scary": one.x = 0.1f; one.z = 0.1f; break; case "Maneater": one.z = 0.1f; break; default: one.z = 0.1f; break; } setSizeClientRPC(componentInChildren.NetworkObjectId, one, Quaternion.identity); } } [ClientRpc] public void putThingOnManeaterClientRpc(ulong objID) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: 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) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(2353910347u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, objID); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 2353910347u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; if (NetworkManager.Singleton.SpawnManager.SpawnedObjects.TryGetValue(objID, out var value)) { GameObject gameObject = ((Component)value).gameObject; ManeaterPatchThing maneaterPatchThing = gameObject.AddComponent(); } } } [ClientRpc] public void setSizeClientRPC(ulong objectId, Vector3 size, Quaternion rotation = default(Quaternion)) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Invalid comparison between Unknown and I4 //IL_005f: 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) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_0166: Unknown result type (might be due to invalid IL or missing references) //IL_016d: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Unknown result type (might be due to invalid IL or missing references) //IL_0176: Unknown result type (might be due to invalid IL or missing references) //IL_0189: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(2989824625u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, objectId); ((FastBufferWriter)(ref val)).WriteValueSafe(ref size); ((FastBufferWriter)(ref val)).WriteValueSafe(ref rotation); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 2989824625u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } base.__rpc_exec_stage = (__RpcExecStage)0; if (NetworkManager.Singleton.SpawnManager.SpawnedObjects.TryGetValue(objectId, out var value)) { GameObject gameObject = ((Component)value).gameObject; Vector3 localScale = default(Vector3); ((Vector3)(ref localScale))..ctor(gameObject.transform.localScale.x * size.x, gameObject.transform.localScale.y * size.y, gameObject.transform.localScale.z * size.z); gameObject.transform.localScale = localScale; if (rotation != default(Quaternion)) { gameObject.transform.localRotation = rotation; } } } [ServerRpc(RequireOwnership = false)] public void doAdServerRpc(string item) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Invalid comparison between Unknown and I4 //IL_005f: 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) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(164687435u, val2, (RpcDelivery)0); bool flag = item != null; ((FastBufferWriter)(ref val)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val)).WriteValueSafe(item, false); } ((NetworkBehaviour)this).__endSendServerRpc(ref val, 164687435u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; if (Chainloader.PluginInfos.TryGetValue("Theronguard.EmergencyDice", out var value) && value.Metadata.Version >= new Version(1, 11, 6)) { DiceStuff.RunAd(item); } } } [ServerRpc(RequireOwnership = false)] public void doCustomAdServerRpc(string item, string top, string bottom) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Invalid comparison between Unknown and I4 //IL_005f: 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) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_017b: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(751551901u, val2, (RpcDelivery)0); bool flag = item != null; ((FastBufferWriter)(ref val)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val)).WriteValueSafe(item, false); } bool flag2 = top != null; ((FastBufferWriter)(ref val)).WriteValueSafe(ref flag2, default(ForPrimitives)); if (flag2) { ((FastBufferWriter)(ref val)).WriteValueSafe(top, false); } bool flag3 = bottom != null; ((FastBufferWriter)(ref val)).WriteValueSafe(ref flag3, default(ForPrimitives)); if (flag3) { ((FastBufferWriter)(ref val)).WriteValueSafe(bottom, false); } ((NetworkBehaviour)this).__endSendServerRpc(ref val, 751551901u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; if (Chainloader.PluginInfos.TryGetValue("Theronguard.EmergencyDice", out var value) && value.Metadata.Version >= new Version(1, 11, 6)) { DiceStuff.RunCustomAd(item, top, bottom); } } } [ServerRpc(RequireOwnership = false)] public void doCustomJSServerRpc(int sync) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: 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) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(1386895935u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, sync); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 1386895935u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; if (Chainloader.PluginInfos.TryGetValue("Theronguard.EmergencyDice", out var value) && value.Metadata.Version >= new Version(1, 13, 10)) { DiceStuff.jsPick(sync); } } } [ServerRpc(RequireOwnership = false)] public void RemoveMaskedServerRpc(ulong maskedID) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: 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) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(1960016259u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, maskedID); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 1960016259u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; RemoveMaskedClientRpc(maskedID); } } } [ClientRpc] public void RemoveMaskedClientRpc(ulong maskedID) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: 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) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(4224390912u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, maskedID); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 4224390912u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; if (!SDBBZRMain.showMask.Value && NetworkManager.Singleton.SpawnManager.SpawnedObjects.TryGetValue(maskedID, out var value)) { GameObject gameObject = ((Component)value).gameObject; MaskedPlayerEnemy component = gameObject.GetComponent(); ((Component)FindChildByName(((Component)component).transform, "HeadMaskComedy")).gameObject.SetActive(false); ((Component)FindChildByName(((Component)component).transform, "HeadMaskTragedy")).gameObject.SetActive(false); } } } [ServerRpc(RequireOwnership = false)] public void PlaySoundServerRPC(string sound) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Invalid comparison between Unknown and I4 //IL_005f: 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) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(136692557u, val2, (RpcDelivery)0); bool flag = sound != null; ((FastBufferWriter)(ref val)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val)).WriteValueSafe(sound, false); } ((NetworkBehaviour)this).__endSendServerRpc(ref val, 136692557u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; PlaySoundClientRPC(sound); } } [ClientRpc] public void PlaySoundClientRPC(string sound) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Invalid comparison between Unknown and I4 //IL_005f: 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) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(931976416u, val2, (RpcDelivery)0); bool flag = sound != null; ((FastBufferWriter)(ref val)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val)).WriteValueSafe(sound, false); } ((NetworkBehaviour)this).__endSendClientRpc(ref val, 931976416u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; AudioSource val3 = ((Component)this).gameObject.AddComponent(); val3.spatialBlend = 0f; val3.volume = 0.25f; if (sound == "mel" || sound == "funo") { val3.volume = 1f; } SDBBZRMain.sounds.TryGetValue(sound, out var value); val3.clip = value; if ((Object)(object)val3.clip != (Object)null) { val3.Play(); } } } [ServerRpc(RequireOwnership = false)] public void addComponentToBodyServerRPC(ulong body) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: 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) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(3051737443u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, body); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 3051737443u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; addComponentToBodyClientRPC(body); } } } [ClientRpc] public void addComponentToBodyClientRPC(ulong body) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: 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) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(3744571001u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, body); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 3744571001u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } base.__rpc_exec_stage = (__RpcExecStage)0; if (((NetworkBehaviour)StartOfRound.Instance.localPlayerController).IsHost) { PlayerControllerB playerByUserID = Misc.GetPlayerByUserID(body); if (!((Object)(object)playerByUserID.deadBody == (Object)null) && !((Object)(object)((Component)playerByUserID.deadBody).GetComponent() != (Object)null)) { BodyCheck bodyCheck = ((Component)playerByUserID.deadBody).gameObject.AddComponent(); bodyCheck.owner = body; bodyCheck.instance = playerByUserID.deadBody; } } } [ServerRpc(RequireOwnership = false)] public void cooldownToggleServerRPC(bool state) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_005f: 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) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(1993062982u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref state, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 1993062982u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; cooldownToggleClientRPC(state); } } } [ClientRpc] public void cooldownToggleClientRPC(bool state) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_005f: 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) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(573358641u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref state, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 573358641u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; canChat = state; } } } [ServerRpc(RequireOwnership = false)] public void cooldownStartServerRPC() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: 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) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(55338573u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 55338573u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; cooldownToggleServerRPC(state: false); ((MonoBehaviour)this).StartCoroutine(cooldown()); } } } private IEnumerator cooldown() { if (!((NetworkBehaviour)this).IsHost) { yield return false; } yield return (object)new WaitForSeconds(60f); cooldownToggleServerRPC(state: true); } public void SpawnBodyServerOnly(ulong bodyId, Vector3 pos, ulong maskedNetId) { //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)NetworkManager.Singleton) || !NetworkManager.Singleton.IsServer || !_processedMaskedDeaths.Add(maskedNetId)) { return; } DeadBodyInfo val = Misc.GetPlayerByUserID(bodyId)?.deadBody; if (!((Object)(object)val == (Object)null)) { BodyCheck bodyCheck = default(BodyCheck); if (((Component)val).TryGetComponent(ref bodyCheck)) { bodyCheck.currentlyZombie = false; bodyCheck.timesRevived++; } ((Component)val).gameObject.SetActive(true); val.deactivated = false; val.SetBodyPartsKinematic(false); val.attachedTo = null; val.attachedLimb = null; val.secondaryAttachedLimb = null; val.secondaryAttachedTo = null; val.SetRagdollPositionSafely(pos, true); if (NetworkManager.Singleton.SpawnManager.SpawnedObjects.TryGetValue(maskedNetId, out var value)) { value.Despawn(true); } SpawnBodyClientRpc(bodyId, pos); } } [ClientRpc] private void SpawnBodyClientRpc(ulong bodyId, Vector3 position) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Invalid comparison between Unknown and I4 //IL_005f: 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) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(3683362846u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, bodyId); ((FastBufferWriter)(ref val)).WriteValueSafe(ref position); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 3683362846u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; PlayerControllerB playerByUserID = Misc.GetPlayerByUserID(bodyId); if ((Object)(object)playerByUserID?.deadBody == (Object)null) { SDBBZRMain.CustomLogger.LogWarning((object)$"[Client] Player {bodyId} or deadBody missing."); return; } DeadBodyInfo deadBody = playerByUserID.deadBody; ((Component)deadBody).gameObject.SetActive(true); deadBody.deactivated = false; deadBody.SetBodyPartsKinematic(false); deadBody.attachedTo = null; deadBody.attachedLimb = null; deadBody.secondaryAttachedLimb = null; deadBody.secondaryAttachedTo = null; deadBody.SetRagdollPositionSafely(position, true); } } [ClientRpc] public void doMaskStuffClientRPC(ulong mask, int health) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Invalid comparison between Unknown and I4 //IL_005f: 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) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_012c: 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) //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_0163: Unknown result type (might be due to invalid IL or missing references) //IL_01b3: Unknown result type (might be due to invalid IL or missing references) //IL_01b8: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(1019091558u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, mask); BytePacker.WriteValueBitPacked(val, health); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 1019091558u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } base.__rpc_exec_stage = (__RpcExecStage)0; if (NetworkManager.Singleton.SpawnManager.SpawnedObjects.TryGetValue(mask, out var value)) { GameObject gameObject = ((Component)value).gameObject; if (((NetworkBehaviour)this).IsHost) { MaskedMaker component = gameObject.GetComponent(); int timesRevived = component.timesRevived; Vector3 position = gameObject.transform.position; Quaternion rotation = gameObject.transform.rotation; gameObject.GetComponent().Despawn(true); GameObject val3 = Object.Instantiate(Misc.getEnemyByName("Masked").enemyType.enemyPrefab, position, rotation); val3.GetComponentInChildren().Spawn(true); MaskedPlayerEnemy component2 = gameObject.GetComponent(); component2.mimickingPlayer = component.instance.mimickingPlayer; RoundManager.Instance.SpawnedEnemies.Add(val3.GetComponent()); NetworkObjectReference val4 = NetworkObjectReference.op_Implicit(val3.GetComponentInChildren()); ((MonoBehaviour)this).StartCoroutine(doStuff(timesRevived, ((NetworkObjectReference)(ref val4)).NetworkObjectId)); } } } public IEnumerator doStuff(int revive, ulong mask) { yield return (object)new WaitForSeconds(1f); if (NetworkManager.Singleton.SpawnManager.SpawnedObjects.TryGetValue(mask, out var networkObj)) { GameObject obj = ((Component)networkObj).gameObject; MaskedMaker mm = obj.GetComponent(); mm.timesRevived = revive; } } [ClientRpc] public void dropSpecificPlayersItemsClientRPC(ulong id) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: 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) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(190380496u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, id); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 190380496u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; PlayerControllerB localPlayerController = StartOfRound.Instance.localPlayerController; if (localPlayerController.actualClientId == id) { ((MonoBehaviour)this).StartCoroutine(dropItems(localPlayerController)); } } } public IEnumerator dropItems(PlayerControllerB player) { yield return (object)new WaitForSeconds(0.2f); player.DiscardHeldObject(false, (NetworkObject)null, default(Vector3), true); } [ServerRpc(RequireOwnership = false)] public void SyncTwitchUserServerRPC() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: 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) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(2969742473u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 2969742473u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 1 || (!networkManager.IsServer && !networkManager.IsHost)) { return; } base.__rpc_exec_stage = (__RpcExecStage)0; if (SDBBZRMain.twitchBlacklistMode.Value) { PlayerControllerB[] allPlayerScripts = StartOfRound.Instance.allPlayerScripts; foreach (PlayerControllerB val3 in allPlayerScripts) { if (!SDBBZRMain.deniedTwitchUsers.Contains(val3.playerSteamId)) { AllowTwitchUserClientRPC(val3.playerSteamId); } } return; } PlayerControllerB[] allPlayerScripts2 = StartOfRound.Instance.allPlayerScripts; foreach (PlayerControllerB val4 in allPlayerScripts2) { if (SDBBZRMain.allowedTwitchUsers.Contains(val4.playerSteamId)) { AllowTwitchUserClientRPC(val4.playerSteamId); } } } [ClientRpc] public void AllowTwitchUserClientRPC(ulong playerSteamID, bool FromCommand = false) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Invalid comparison between Unknown and I4 //IL_005f: 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) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(3357015873u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, playerSteamID); ((FastBufferWriter)(ref val)).WriteValueSafe(ref FromCommand, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 3357015873u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } base.__rpc_exec_stage = (__RpcExecStage)0; if ((FromCommand || !ForcedRemovalTwitch.Contains(playerSteamID)) && (StartOfRound.Instance.localPlayerController.playerSteamId == playerSteamID || ((NetworkBehaviour)StartOfRound.Instance.localPlayerController).IsHost)) { SDBBZRMain.canDoTwitch = true; ForcedAddedTwitch.Add(playerSteamID); if (ForcedRemovalTwitch.Contains(playerSteamID)) { ForcedRemovalTwitch.Remove(playerSteamID); } } } [ClientRpc] public void DenyTwitchUserClientRPC(ulong playerSteamID, bool FromCommand = false) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Invalid comparison between Unknown and I4 //IL_005f: 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) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(3876142947u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, playerSteamID); ((FastBufferWriter)(ref val)).WriteValueSafe(ref FromCommand, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 3876142947u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } base.__rpc_exec_stage = (__RpcExecStage)0; if ((FromCommand || !ForcedAddedTwitch.Contains(playerSteamID)) && StartOfRound.Instance.localPlayerController.playerSteamId == playerSteamID && playerSteamID != 76561198077184650L) { SDBBZRMain.canDoTwitch = false; ForcedRemovalTwitch.Add(playerSteamID); if (ForcedAddedTwitch.Contains(playerSteamID)) { ForcedAddedTwitch.Remove(playerSteamID); } } } [ServerRpc(RequireOwnership = false)] public void sendMessageSpecificServerRPC(string a, string b, bool warning, string name) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_016b: Invalid comparison between Unknown and I4 //IL_005f: 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) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0196: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(2677404154u, val2, (RpcDelivery)0); bool flag = a != null; ((FastBufferWriter)(ref val)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val)).WriteValueSafe(a, false); } bool flag2 = b != null; ((FastBufferWriter)(ref val)).WriteValueSafe(ref flag2, default(ForPrimitives)); if (flag2) { ((FastBufferWriter)(ref val)).WriteValueSafe(b, false); } ((FastBufferWriter)(ref val)).WriteValueSafe(ref warning, default(ForPrimitives)); bool flag3 = name != null; ((FastBufferWriter)(ref val)).WriteValueSafe(ref flag3, default(ForPrimitives)); if (flag3) { ((FastBufferWriter)(ref val)).WriteValueSafe(name, false); } ((NetworkBehaviour)this).__endSendServerRpc(ref val, 2677404154u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; sendMessageSpecificClientRPC(a, b, warning, name); } } [ClientRpc] public void sendMessageSpecificClientRPC(string a, string b, bool warning, string name) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_016b: Invalid comparison between Unknown and I4 //IL_005f: 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) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0196: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(4119884790u, val2, (RpcDelivery)0); bool flag = a != null; ((FastBufferWriter)(ref val)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val)).WriteValueSafe(a, false); } bool flag2 = b != null; ((FastBufferWriter)(ref val)).WriteValueSafe(ref flag2, default(ForPrimitives)); if (flag2) { ((FastBufferWriter)(ref val)).WriteValueSafe(b, false); } ((FastBufferWriter)(ref val)).WriteValueSafe(ref warning, default(ForPrimitives)); bool flag3 = name != null; ((FastBufferWriter)(ref val)).WriteValueSafe(ref flag3, default(ForPrimitives)); if (flag3) { ((FastBufferWriter)(ref val)).WriteValueSafe(name, false); } ((NetworkBehaviour)this).__endSendClientRpc(ref val, 4119884790u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; if (StartOfRound.Instance.localPlayerController.playerUsername == name) { Misc.SafeTipMessage(a, b, warning); } } } [ServerRpc(RequireOwnership = false)] public void sendMessageAllServerRPC(string a, string b, bool warning, bool forced = false) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Invalid comparison between Unknown and I4 //IL_005f: 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) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0173: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(892516602u, val2, (RpcDelivery)0); bool flag = a != null; ((FastBufferWriter)(ref val)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val)).WriteValueSafe(a, false); } bool flag2 = b != null; ((FastBufferWriter)(ref val)).WriteValueSafe(ref flag2, default(ForPrimitives)); if (flag2) { ((FastBufferWriter)(ref val)).WriteValueSafe(b, false); } ((FastBufferWriter)(ref val)).WriteValueSafe(ref warning, default(ForPrimitives)); ((FastBufferWriter)(ref val)).WriteValueSafe(ref forced, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 892516602u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; sendMessageAllClientRPC(a, b, warning, forced); } } [ClientRpc] public void sendMessageAllClientRPC(string a, string b, bool warning, bool forced = false) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Invalid comparison between Unknown and I4 //IL_005f: 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) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0173: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(2429034564u, val2, (RpcDelivery)0); bool flag = a != null; ((FastBufferWriter)(ref val)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val)).WriteValueSafe(a, false); } bool flag2 = b != null; ((FastBufferWriter)(ref val)).WriteValueSafe(ref flag2, default(ForPrimitives)); if (flag2) { ((FastBufferWriter)(ref val)).WriteValueSafe(b, false); } ((FastBufferWriter)(ref val)).WriteValueSafe(ref warning, default(ForPrimitives)); ((FastBufferWriter)(ref val)).WriteValueSafe(ref forced, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 2429034564u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; if (SDBBZRMain.ShowDebugChatboxes.Value || forced) { Misc.SafeTipMessage(a, b, warning); } } } public void SyncAllBodiesMaybe() { //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)NetworkManager.Singleton) || !NetworkManager.Singleton.IsServer || (Object)(object)StartOfRound.Instance == (Object)null || StartOfRound.Instance.allPlayerScripts == null) { return; } PlayerControllerB[] allPlayerScripts = StartOfRound.Instance.allPlayerScripts; foreach (PlayerControllerB val in allPlayerScripts) { if (!((Object)(object)val == (Object)null) && val.isPlayerControlled && (Object)(object)val.deadBody != (Object)null) { ((Component)val.deadBody).gameObject.SetActive(false); } } List list = new List(); List list2 = new List(); for (int j = 0; j < allPlayerScripts.Length; j++) { PlayerControllerB val2 = allPlayerScripts[j]; if (!((Object)(object)val2 == (Object)null) && val2.isPlayerDead && !((Object)(object)val2.deadBody == (Object)null)) { list.Add(j); list2.Add(((Component)val2.deadBody).transform.position); } } if (list.Count > 0) { FixBodiesClientRpc(list.ToArray(), list2.ToArray()); } } [ClientRpc] private void FixBodiesClientRpc(int[] playerIndices, Vector3[] positions, ClientRpcParams rpcParams = default(ClientRpcParams)) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Invalid comparison between Unknown and I4 //IL_005f: 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) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_01e9: Unknown result type (might be due to invalid IL or missing references) //IL_01ee: Unknown result type (might be due to invalid IL or missing references) //IL_0264: Unknown result type (might be due to invalid IL or missing references) //IL_0269: Unknown result type (might be due to invalid IL or missing references) //IL_026b: Unknown result type (might be due to invalid IL or missing references) //IL_0270: Unknown result type (might be due to invalid IL or missing references) //IL_0250: Unknown result type (might be due to invalid IL or missing references) //IL_028e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(1397574933u, rpcParams, (RpcDelivery)0); bool flag = playerIndices != null; ((FastBufferWriter)(ref val)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val)).WriteValueSafe(playerIndices, default(ForPrimitives)); } bool flag2 = positions != null; ((FastBufferWriter)(ref val)).WriteValueSafe(ref flag2, default(ForPrimitives)); if (flag2) { ((FastBufferWriter)(ref val)).WriteValueSafe(positions); } ((NetworkBehaviour)this).__endSendClientRpc(ref val, 1397574933u, rpcParams, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } base.__rpc_exec_stage = (__RpcExecStage)0; StartOfRound instance = StartOfRound.Instance; if ((Object)(object)instance == (Object)null || instance.allPlayerScripts == null) { return; } int num = Mathf.Min(playerIndices.Length, positions.Length); for (int i = 0; i < num; i++) { int num2 = playerIndices[i]; if (num2 < 0 || num2 >= instance.allPlayerScripts.Length) { continue; } PlayerControllerB val2 = instance.allPlayerScripts[num2]; if ((Object)(object)val2 == (Object)null || (Object)(object)val2.deadBody == (Object)null) { continue; } DeadBodyInfo deadBody = val2.deadBody; Vector3 val3 = positions[i]; if (!((Component)deadBody).gameObject.activeSelf || deadBody.deactivated) { ((Component)deadBody).gameObject.SetActive(true); deadBody.deactivated = false; deadBody.SetBodyPartsKinematic(false); deadBody.attachedTo = null; deadBody.attachedLimb = null; deadBody.secondaryAttachedLimb = null; deadBody.secondaryAttachedTo = null; deadBody.SetRagdollPositionSafely(val3, true); } else { Vector3 val4 = ((Component)deadBody).transform.position - val3; if (((Vector3)(ref val4)).sqrMagnitude > 0.0001f) { ((Component)deadBody).transform.position = val3; } } } } [ServerRpc(RequireOwnership = false)] public void removePlayerBodyServerRPC(ulong playerID) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: 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) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(2076291561u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, playerID); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 2076291561u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; ((MonoBehaviour)this).StartCoroutine(doDelay(Misc.GetPlayerByUserID(playerID))); } } } public IEnumerator doDelay(PlayerControllerB player) { yield return (object)new WaitForSeconds(0.65f); if (!((Object)(object)player == (Object)null) && !((Object)(object)player.deadBody == (Object)null) && !((Object)(object)player.deadBody.grabBodyObject == (Object)null)) { PlayerControllerB phb = player.deadBody.grabBodyObject.playerHeldBy; if ((Object)(object)phb != (Object)null) { Vector3 position = ((Component)phb).transform.position; Vector3 position2 = ((Component)phb).transform.position; Quaternion rotation = ((Component)phb).transform.rotation; Vector3 eulerAngles = ((Quaternion)(ref rotation)).eulerAngles; Vector3 position3 = ((Component)phb.gameplayCamera).transform.position; rotation = ((Component)phb.gameplayCamera).transform.rotation; phb.DropAllHeldItemsAndSync(position, position2, eulerAngles, position3, ((Quaternion)(ref rotation)).eulerAngles); } else if (player.deadBody.grabBodyObject.isHeldByEnemy) { player.deadBody.grabBodyObject.DiscardItemFromEnemy(); } if (!((Object)(object)player.deadBody == (Object)null) && !((Object)(object)player.deadBody.grabBodyObject == (Object)null)) { player.deadBody.DeactivateBody(false); } } } [ServerRpc(RequireOwnership = false)] public void fixMaskedServerRpc(ulong user, ulong masked) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Invalid comparison between Unknown and I4 //IL_005f: 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) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(737332444u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, user); BytePacker.WriteValueBitPacked(val, masked); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 737332444u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; fixMaskedClientRpc(user, masked); } } } [ClientRpc] public void fixMaskedClientRpc(ulong user, ulong masked) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Invalid comparison between Unknown and I4 //IL_005f: 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) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(793304271u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, user); BytePacker.WriteValueBitPacked(val, masked); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 793304271u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } base.__rpc_exec_stage = (__RpcExecStage)0; PlayerControllerB playerByUserID = Misc.GetPlayerByUserID(user); if ((Object)(object)playerByUserID == (Object)null) { return; } if ((Object)(object)playerByUserID.deadBody != (Object)null && (Object)(object)playerByUserID.deadBody.grabBodyObject != (Object)null) { if (playerByUserID.deadBody.grabBodyObject.isHeld) { ((MonoBehaviour)StartOfRound.Instance).StartCoroutine(doDelay(playerByUserID)); } else { playerByUserID.deadBody.DeactivateBody(false); } } if (NetworkManager.Singleton.SpawnManager.SpawnedObjects.TryGetValue(masked, out var value)) { GameObject gameObject = ((Component)value).gameObject; playerByUserID.redirectToEnemy = gameObject.GetComponent(); MaskedPlayerEnemy component = gameObject.GetComponent(); if (!SDBBZRMain.showMask.Value) { ((Component)FindChildByName(((Component)component).transform, "HeadMaskComedy")).gameObject.SetActive(false); ((Component)FindChildByName(((Component)component).transform, "HeadMaskTragedy")).gameObject.SetActive(false); } } } private Transform FindChildByName(Transform parent, string name) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown foreach (Transform item in parent) { Transform val = item; if (((Object)val).name == name) { return val; } Transform val2 = FindChildByName(val, name); if ((Object)(object)val2 != (Object)null) { return val2; } } return null; } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Expected O, but got Unknown //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Expected O, but got Unknown //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Expected O, but got Unknown //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Expected O, but got Unknown //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Expected O, but got Unknown //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Expected O, but got Unknown //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Expected O, but got Unknown //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Expected O, but got Unknown //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Expected O, but got Unknown //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Expected O, but got Unknown //IL_0195: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Expected O, but got Unknown //IL_01b1: Unknown result type (might be due to invalid IL or missing references) //IL_01c0: Expected O, but got Unknown //IL_01cd: Unknown result type (might be due to invalid IL or missing references) //IL_01dc: Expected O, but got Unknown //IL_01e9: Unknown result type (might be due to invalid IL or missing references) //IL_01f8: Expected O, but got Unknown //IL_0205: Unknown result type (might be due to invalid IL or missing references) //IL_0214: Expected O, but got Unknown //IL_0221: Unknown result type (might be due to invalid IL or missing references) //IL_0230: Expected O, but got Unknown //IL_023d: Unknown result type (might be due to invalid IL or missing references) //IL_024c: Expected O, but got Unknown //IL_0259: Unknown result type (might be due to invalid IL or missing references) //IL_0268: Expected O, but got Unknown //IL_0275: Unknown result type (might be due to invalid IL or missing references) //IL_0284: Expected O, but got Unknown //IL_0291: Unknown result type (might be due to invalid IL or missing references) //IL_02a0: Expected O, but got Unknown //IL_02ad: Unknown result type (might be due to invalid IL or missing references) //IL_02bc: Expected O, but got Unknown //IL_02c9: Unknown result type (might be due to invalid IL or missing references) //IL_02d8: Expected O, but got Unknown //IL_02e5: Unknown result type (might be due to invalid IL or missing references) //IL_02f4: Expected O, but got Unknown //IL_0301: Unknown result type (might be due to invalid IL or missing references) //IL_0310: Expected O, but got Unknown //IL_031d: Unknown result type (might be due to invalid IL or missing references) //IL_032c: Expected O, but got Unknown //IL_0339: Unknown result type (might be due to invalid IL or missing references) //IL_0348: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(2671259876u, new RpcReceiveHandler(__rpc_handler_2671259876), "QueueMimicSpawnServerRpc"); ((NetworkBehaviour)this).__registerRpc(1174342229u, new RpcReceiveHandler(__rpc_handler_1174342229), "reviveAllZombiesServerRpc"); ((NetworkBehaviour)this).__registerRpc(2353910347u, new RpcReceiveHandler(__rpc_handler_2353910347), "putThingOnManeaterClientRpc"); ((NetworkBehaviour)this).__registerRpc(2989824625u, new RpcReceiveHandler(__rpc_handler_2989824625), "setSizeClientRPC"); ((NetworkBehaviour)this).__registerRpc(164687435u, new RpcReceiveHandler(__rpc_handler_164687435), "doAdServerRpc"); ((NetworkBehaviour)this).__registerRpc(751551901u, new RpcReceiveHandler(__rpc_handler_751551901), "doCustomAdServerRpc"); ((NetworkBehaviour)this).__registerRpc(1386895935u, new RpcReceiveHandler(__rpc_handler_1386895935), "doCustomJSServerRpc"); ((NetworkBehaviour)this).__registerRpc(1960016259u, new RpcReceiveHandler(__rpc_handler_1960016259), "RemoveMaskedServerRpc"); ((NetworkBehaviour)this).__registerRpc(4224390912u, new RpcReceiveHandler(__rpc_handler_4224390912), "RemoveMaskedClientRpc"); ((NetworkBehaviour)this).__registerRpc(136692557u, new RpcReceiveHandler(__rpc_handler_136692557), "PlaySoundServerRPC"); ((NetworkBehaviour)this).__registerRpc(931976416u, new RpcReceiveHandler(__rpc_handler_931976416), "PlaySoundClientRPC"); ((NetworkBehaviour)this).__registerRpc(3051737443u, new RpcReceiveHandler(__rpc_handler_3051737443), "addComponentToBodyServerRPC"); ((NetworkBehaviour)this).__registerRpc(3744571001u, new RpcReceiveHandler(__rpc_handler_3744571001), "addComponentToBodyClientRPC"); ((NetworkBehaviour)this).__registerRpc(1993062982u, new RpcReceiveHandler(__rpc_handler_1993062982), "cooldownToggleServerRPC"); ((NetworkBehaviour)this).__registerRpc(573358641u, new RpcReceiveHandler(__rpc_handler_573358641), "cooldownToggleClientRPC"); ((NetworkBehaviour)this).__registerRpc(55338573u, new RpcReceiveHandler(__rpc_handler_55338573), "cooldownStartServerRPC"); ((NetworkBehaviour)this).__registerRpc(3683362846u, new RpcReceiveHandler(__rpc_handler_3683362846), "SpawnBodyClientRpc"); ((NetworkBehaviour)this).__registerRpc(1019091558u, new RpcReceiveHandler(__rpc_handler_1019091558), "doMaskStuffClientRPC"); ((NetworkBehaviour)this).__registerRpc(190380496u, new RpcReceiveHandler(__rpc_handler_190380496), "dropSpecificPlayersItemsClientRPC"); ((NetworkBehaviour)this).__registerRpc(2969742473u, new RpcReceiveHandler(__rpc_handler_2969742473), "SyncTwitchUserServerRPC"); ((NetworkBehaviour)this).__registerRpc(3357015873u, new RpcReceiveHandler(__rpc_handler_3357015873), "AllowTwitchUserClientRPC"); ((NetworkBehaviour)this).__registerRpc(3876142947u, new RpcReceiveHandler(__rpc_handler_3876142947), "DenyTwitchUserClientRPC"); ((NetworkBehaviour)this).__registerRpc(2677404154u, new RpcReceiveHandler(__rpc_handler_2677404154), "sendMessageSpecificServerRPC"); ((NetworkBehaviour)this).__registerRpc(4119884790u, new RpcReceiveHandler(__rpc_handler_4119884790), "sendMessageSpecificClientRPC"); ((NetworkBehaviour)this).__registerRpc(892516602u, new RpcReceiveHandler(__rpc_handler_892516602), "sendMessageAllServerRPC"); ((NetworkBehaviour)this).__registerRpc(2429034564u, new RpcReceiveHandler(__rpc_handler_2429034564), "sendMessageAllClientRPC"); ((NetworkBehaviour)this).__registerRpc(1397574933u, new RpcReceiveHandler(__rpc_handler_1397574933), "FixBodiesClientRpc"); ((NetworkBehaviour)this).__registerRpc(2076291561u, new RpcReceiveHandler(__rpc_handler_2076291561), "removePlayerBodyServerRPC"); ((NetworkBehaviour)this).__registerRpc(737332444u, new RpcReceiveHandler(__rpc_handler_737332444), "fixMaskedServerRpc"); ((NetworkBehaviour)this).__registerRpc(793304271u, new RpcReceiveHandler(__rpc_handler_793304271), "fixMaskedClientRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_2671259876(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { ulong playerID = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref playerID); int amount = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref amount); bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag, default(ForPrimitives)); string what = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref what, false); } bool instant = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref instant, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((Networker)(object)target).QueueMimicSpawnServerRpc(playerID, amount, what, instant); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1174342229(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((Networker)(object)target).reviveAllZombiesServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2353910347(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { ulong objID = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref objID); target.__rpc_exec_stage = (__RpcExecStage)1; ((Networker)(object)target).putThingOnManeaterClientRpc(objID); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2989824625(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0063: 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) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { ulong objectId = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref objectId); Vector3 size = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref size); Quaternion rotation = default(Quaternion); ((FastBufferReader)(ref reader)).ReadValueSafe(ref rotation); target.__rpc_exec_stage = (__RpcExecStage)1; ((Networker)(object)target).setSizeClientRPC(objectId, size, rotation); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_164687435(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag, default(ForPrimitives)); string item = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref item, false); } target.__rpc_exec_stage = (__RpcExecStage)1; ((Networker)(object)target).doAdServerRpc(item); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_751551901(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: 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_006d: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag, default(ForPrimitives)); string item = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref item, false); } bool flag2 = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag2, default(ForPrimitives)); string top = null; if (flag2) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref top, false); } bool flag3 = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag3, default(ForPrimitives)); string bottom = null; if (flag3) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref bottom, false); } target.__rpc_exec_stage = (__RpcExecStage)1; ((Networker)(object)target).doCustomAdServerRpc(item, top, bottom); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1386895935(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int sync = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref sync); target.__rpc_exec_stage = (__RpcExecStage)1; ((Networker)(object)target).doCustomJSServerRpc(sync); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1960016259(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { ulong maskedID = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref maskedID); target.__rpc_exec_stage = (__RpcExecStage)1; ((Networker)(object)target).RemoveMaskedServerRpc(maskedID); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_4224390912(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { ulong maskedID = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref maskedID); target.__rpc_exec_stage = (__RpcExecStage)1; ((Networker)(object)target).RemoveMaskedClientRpc(maskedID); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_136692557(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag, default(ForPrimitives)); string sound = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref sound, false); } target.__rpc_exec_stage = (__RpcExecStage)1; ((Networker)(object)target).PlaySoundServerRPC(sound); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_931976416(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag, default(ForPrimitives)); string sound = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref sound, false); } target.__rpc_exec_stage = (__RpcExecStage)1; ((Networker)(object)target).PlaySoundClientRPC(sound); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3051737443(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { ulong body = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref body); target.__rpc_exec_stage = (__RpcExecStage)1; ((Networker)(object)target).addComponentToBodyServerRPC(body); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3744571001(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { ulong body = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref body); target.__rpc_exec_stage = (__RpcExecStage)1; ((Networker)(object)target).addComponentToBodyClientRPC(body); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1993062982(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool state = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref state, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((Networker)(object)target).cooldownToggleServerRPC(state); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_573358641(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool state = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref state, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((Networker)(object)target).cooldownToggleClientRPC(state); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_55338573(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((Networker)(object)target).cooldownStartServerRPC(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3683362846(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { ulong bodyId = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref bodyId); Vector3 position = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref position); target.__rpc_exec_stage = (__RpcExecStage)1; ((Networker)(object)target).SpawnBodyClientRpc(bodyId, position); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1019091558(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { ulong mask = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref mask); int health = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref health); target.__rpc_exec_stage = (__RpcExecStage)1; ((Networker)(object)target).doMaskStuffClientRPC(mask, health); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_190380496(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { ulong id = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref id); target.__rpc_exec_stage = (__RpcExecStage)1; ((Networker)(object)target).dropSpecificPlayersItemsClientRPC(id); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2969742473(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((Networker)(object)target).SyncTwitchUserServerRPC(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3357015873(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { ulong playerSteamID = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref playerSteamID); bool fromCommand = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref fromCommand, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((Networker)(object)target).AllowTwitchUserClientRPC(playerSteamID, fromCommand); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3876142947(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { ulong playerSteamID = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref playerSteamID); bool fromCommand = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref fromCommand, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((Networker)(object)target).DenyTwitchUserClientRPC(playerSteamID, fromCommand); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2677404154(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: 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_006d: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag, default(ForPrimitives)); string a = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref a, false); } bool flag2 = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag2, default(ForPrimitives)); string b = null; if (flag2) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref b, false); } bool warning = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref warning, default(ForPrimitives)); bool flag3 = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag3, default(ForPrimitives)); string name = null; if (flag3) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref name, false); } target.__rpc_exec_stage = (__RpcExecStage)1; ((Networker)(object)target).sendMessageSpecificServerRPC(a, b, warning, name); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_4119884790(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: 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_006d: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag, default(ForPrimitives)); string a = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref a, false); } bool flag2 = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag2, default(ForPrimitives)); string b = null; if (flag2) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref b, false); } bool warning = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref warning, default(ForPrimitives)); bool flag3 = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag3, default(ForPrimitives)); string name = null; if (flag3) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref name, false); } target.__rpc_exec_stage = (__RpcExecStage)1; ((Networker)(object)target).sendMessageSpecificClientRPC(a, b, warning, name); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_892516602(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: 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_006d: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag, default(ForPrimitives)); string a = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref a, false); } bool flag2 = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag2, default(ForPrimitives)); string b = null; if (flag2) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref b, false); } bool warning = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref warning, default(ForPrimitives)); bool forced = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref forced, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((Networker)(object)target).sendMessageAllServerRPC(a, b, warning, forced); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2429034564(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: 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_006d: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag, default(ForPrimitives)); string a = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref a, false); } bool flag2 = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag2, default(ForPrimitives)); string b = null; if (flag2) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref b, false); } bool warning = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref warning, default(ForPrimitives)); bool forced = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref forced, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((Networker)(object)target).sendMessageAllClientRPC(a, b, warning, forced); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1397574933(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag, default(ForPrimitives)); int[] playerIndices = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref playerIndices, default(ForPrimitives)); } bool flag2 = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag2, default(ForPrimitives)); Vector3[] positions = null; if (flag2) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref positions); } ClientRpcParams client = rpcParams.Client; target.__rpc_exec_stage = (__RpcExecStage)1; ((Networker)(object)target).FixBodiesClientRpc(playerIndices, positions, client); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2076291561(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { ulong playerID = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref playerID); target.__rpc_exec_stage = (__RpcExecStage)1; ((Networker)(object)target).removePlayerBodyServerRPC(playerID); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_737332444(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { ulong user = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref user); ulong masked = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref masked); target.__rpc_exec_stage = (__RpcExecStage)1; ((Networker)(object)target).fixMaskedServerRpc(user, masked); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_793304271(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { ulong user = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref user); ulong masked = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref masked); target.__rpc_exec_stage = (__RpcExecStage)1; ((Networker)(object)target).fixMaskedClientRpc(user, masked); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "Networker"; } } [BepInPlugin("Slayer6409.NightOfTheLivingMimic", "NightOfTheLivingMimic", "1.2.1")] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] public class SDBBZRMain : BaseUnityPlugin { private const string modGUID = "Slayer6409.NightOfTheLivingMimic"; private const string modName = "NightOfTheLivingMimic"; private const string modVersion = "1.2.1"; private readonly Harmony harmony = new Harmony("Slayer6409.NightOfTheLivingMimic"); public static ManualLogSource CustomLogger; public static bool LethalConfigPresent = false; public static bool TwitchChatAPIPresent = false; public static bool GeneralImprovenmentsPresent = false; public static bool DicePresent = false; public static Material rainbowMaterial; public static GameObject newUI; public static ConfigFile BepInExConfig = null; public static ConfigEntry percentChance; public static ConfigEntry timer; public static ConfigEntry DebugCooldown; public static ConfigEntry continuous; public static ConfigEntry showMask; public static ConfigEntry ShowDebugChatboxes; public static ConfigEntry chanceDecrease; public static ConfigEntry maskTurn; public static ConfigEntry chaosMode; public static ConfigEntry MaskedRespawnOnceOnDeath; public static AssetBundle LoadedAssets; public static GameObject NetworkerPrefab; public static ConfigEntry CursedPlayers; public static ConfigEntry allowedChatUsersConfig; public static ConfigEntry twitchBlacklistMode; public static ConfigEntry allowedTwitchUsersConfig; public static List CursedPlayersList; public static bool DoubleCurseGlitch = false; public static bool canDoTwitch = false; public static Dictionary sounds = new Dictionary(); public static HashSet allowedTwitchUsers = new HashSet { 76561198077184650uL, 76561199094139351uL, 76561198984467725uL }; public static HashSet deniedTwitchUsers = new HashSet(); public static HashSet allowedChatUsers = new HashSet { 76561198077184650uL, 76561199094139351uL, 76561198164429786uL, 76561198984467725uL, 76561198044500483uL, 76561198383757792uL, 76561198086325047uL, 76561198993437314uL, 76561198399127090uL }; public static readonly HashSet SuperCursedIDS = new HashSet { 76561198984467725uL, 76561198086325047uL, 76561198383757792uL, 76561198044500483uL }; public static void PrintAllAssets(AssetBundle bundle) { if ((Object)(object)bundle == (Object)null) { CustomLogger.LogError((object)"AssetBundle is null!"); return; } string[] allAssetNames = bundle.GetAllAssetNames(); CustomLogger.LogInfo((object)"Assets in the bundle:"); string[] array = allAssetNames; foreach (string text in array) { CustomLogger.LogInfo((object)text); } } public static void ModConfig() { percentChance = BepInExConfig.Bind("Zombie", "Percent Chance", 7.5f, "What percent chance will it change into a zombie"); continuous = BepInExConfig.Bind("Zombie", "Continuous", true, "If a body can become a zombie after killing the zombie again"); timer = BepInExConfig.Bind("Zombie", "Timer", 10, "How often does it try to become a zombie"); chanceDecrease = BepInExConfig.Bind("Zombie", "Chance Decrease", 1, "Decreases the chance of spawning additional zombies from the same body by this percent"); maskTurn = BepInExConfig.Bind("Zombie", "Masked Turn Back", true, "If Masked enemies also come back alive"); chaosMode = BepInExConfig.Bind("Zombie", "Chaos", false, "Don't do this"); MaskedRespawnOnceOnDeath = BepInExConfig.Bind("Zombie", "Masked Respawn Once On Death", false, "Makes dead bodies respawn only once on death (configurable percent based on Percent Chance) and not again."); showMask = BepInExConfig.Bind("Zombie", "Show Mask", false, "Makes the mimic mask not be removed"); CursedPlayers = BepInExConfig.Bind("Misc", "Cursed Players", "", "Steam IDs to curse players separated by a comma"); ShowDebugChatboxes = BepInExConfig.Bind("Misc", "Show Debug Chatboxes", true, "Makes it to where you can see the Debug Chatboxes or not"); DebugCooldown = BepInExConfig.Bind("Misc", "Debug Cooldown", 10, "How long the cooldown for the debug tool is in seconds"); allowedChatUsersConfig = BepInExConfig.Bind("Misc", "Allowed Chat Steam IDs", "", "SteamIDs of users who are allowed to use the chat function"); allowedTwitchUsersConfig = BepInExConfig.Bind("Twitch", "Trusted Steam UserIDs for Twitch Integration", "", "Put Steam IDs of users who are Allowed/Denied to use the Twitch Integration here Depending on Blacklist mode setting.\nThis exists to prevent trolling and free uses of all Mimic commands (Host Only)\nHost will still be able to use Twitch Integration even if they are not in this config."); twitchBlacklistMode = BepInExConfig.Bind("Twitch", "Blacklist Mode", true, "Turn the Whitelist above into a blacklist"); } private void Awake() { //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Expected O, but got Unknown CustomLogger = ((BaseUnityPlugin)this).Logger; ((BaseUnityPlugin)this).Logger.LogFatal((object)"\r\n \r\n .. .. \r\n .#@@@%###*+-. .-+*%%%@@%*. \r\n =%@@@@@@@@#@@@@@@@@@@@@@@@@@##: \r\n =#@@@@@@@@@@@@@@@@@@@@@@@@@@@%#+: \r\n :*%%@@@@@@@%%%*#@@@@@@@@@%%@@@@#*+. \r\n +#@@@*. -@@@@@@@@@: .###*+: \r\n +#@@% -@@@@@@@@- .***+: \r\n .+#@++@@@@@%+: #@@@@@@@.=@@@@@@@++*+- \r\n =#@@@@@@@@@@@@@@@@@@%@@@@@@@@@@@#++: \r\n -######%%#%Glitch is Bald%##***#**+. \r\n .++++++++=-=*@and fish%*=-*%#++++#=- \r\n .+*##%@@@%%#*+*%@@@%#*==*@@@@@%*#++: \r\n =#%@%@@@%#%%*-+-====*+*@@@@@%*#++=. \r\n :#@%######%@@@@@*-=+@@@@@@@%##*-+= \r\n .*##**###=%@@@@@%@@@@@@@%-%%##+-=: \r\n =#######* :#%@@%@@@%#: .####+==. \r\n :*######@. ..:. .#####+=- \r\n .+#######@. \ud83d\udc1f .#####+=. \r\n :*++++*++*. .+*+##++-. \r\n =*++###+**%#%%%@###**+**++: \r\n :++*+###@#%@@@@%###*+++=: \r\n :+++###%@@@@@%##++++: \r\n .-=+=*****##*+-=-. \r\n .:-=======:.. \r\n \r\n \r\n"); if (Chainloader.PluginInfos.ContainsKey("ainavt.lc.lethalconfig")) { LethalConfigPresent = true; } if (Chainloader.PluginInfos.ContainsKey("TwitchChatAPI")) { TwitchChatAPIPresent = true; } if (Chainloader.PluginInfos.ContainsKey("ShaosilGaming.GeneralImprovements")) { GeneralImprovenmentsPresent = true; } if (Chainloader.PluginInfos.ContainsKey("Theronguard.EmergencyDice")) { DicePresent = true; } BepInExConfig = new ConfigFile(Path.Combine(Paths.ConfigPath, "NightOfTheLivingMimic.cfg"), true); ModConfig(); if (TwitchChatAPIPresent) { TwitchHandler.doConfigStuff(); } NetcodeWeaver(); LoadedAssets = AssetBundle.LoadFromFile(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "sdbbzr")); NetworkerPrefab = LoadedAssets.LoadAsset("Networker"); rainbowMaterial = LoadedAssets.LoadAsset("TextMaterial1"); newUI = LoadedAssets.LoadAsset("notificationbox"); sounds.Add("wiwiwi", LoadedAssets.LoadAsset("wiwiwi")); sounds.Add("scary", LoadedAssets.LoadAsset("scary")); sounds.Add("funo", LoadedAssets.LoadAsset("Fumo")); sounds.Add("steve", LoadedAssets.LoadAsset("Steve")); sounds.Add("mubald", LoadedAssets.LoadAsset("MuIsBald")); sounds.Add("mel", LoadedAssets.LoadAsset("Hagdmy")); sounds.Add("glitchBald", LoadedAssets.LoadAsset("Glitchimnotbald")); NetworkerPrefab.AddComponent(); harmony.PatchAll(); if (LethalConfigPresent) { ConfigManager.SetupLethalConfig(); } CursedPlayersList = (from id in CursedPlayers.Value.Split(new char[1] { ',' }, StringSplitOptions.RemoveEmptyEntries) select ulong.TryParse(id.Trim(), out var result) ? new ulong?(result) : ((ulong?)null) into id where id.HasValue select id.Value).ToList(); IEnumerable other = from id in allowedChatUsersConfig.Value.Split(new char[1] { ',' }, StringSplitOptions.RemoveEmptyEntries) select ulong.TryParse(id.Trim(), out result) ? new ulong?(result) : ((ulong?)null) into id where id.HasValue select id.Value; allowedChatUsers.UnionWith(other); IEnumerable other2 = from id in allowedTwitchUsersConfig.Value.Split(new char[1] { ',' }, StringSplitOptions.RemoveEmptyEntries) select ulong.TryParse(id.Trim(), out result) ? new ulong?(result) : ((ulong?)null) into id where id.HasValue select id.Value; if (twitchBlacklistMode.Value) { deniedTwitchUsers.UnionWith(other2); } else { allowedTwitchUsers.UnionWith(other2); } foreach (ulong superCursedID in SuperCursedIDS) { if (!CursedPlayersList.Contains(superCursedID)) { CursedPlayersList.Add(superCursedID); } } if (TwitchChatAPIPresent) { TwitchHandler.Initialize(); } } private static void NetcodeWeaver() { try { Type[] types = Assembly.GetExecutingAssembly().GetTypes(); Type[] array = types; foreach (Type type in array) { MethodInfo[] methods = type.GetMethods(BindingFlags.Instance | BindingFlags.Static | BindingFlags.NonPublic); MethodInfo[] array2 = methods; foreach (MethodInfo methodInfo in array2) { object[] customAttributes = methodInfo.GetCustomAttributes(typeof(RuntimeInitializeOnLoadMethodAttribute), inherit: false); if (customAttributes.Length != 0) { methodInfo.Invoke(null, null); } } } } catch (Exception) { } } } internal class TwitchHandler : MonoBehaviour { public static ConfigEntry enableSubs; public static ConfigEntry t1sub; public static ConfigEntry t2sub; public static ConfigEntry t3sub; public static ConfigEntry enableCheer; public static ConfigEntry cheerMin; public static ConfigEntry enableRaid; public static ConfigEntry raidNumPerPerson; public static ConfigEntry raidMaxSpawn; public static ConfigEntry enableChatEvents; public static ConfigEntry twitchChatEveryone; public static bool HasSlayerSaidAnythingYet = false; public static bool HasLizzieSaidAnythingYet = false; public static bool HasGlitchSaidAnythingYet = false; public static bool HasNutSaidAnythingYet = false; public static bool HasLunxaraSaidAnythingYet = false; public static bool HasCritSaidAnythingYet = false; public static bool HasRigoSaidAnythingYet = false; public static bool HasXuSaidAnythingYet = false; public static bool HasMelSaidAnythingYet = false; public static bool HasFnoSaidAnythingYet = false; public static bool HasMuSaidAnythingYet = false; public static ConfigEntry twitchOxyde; public static ConfigEntry twitchGaletry; public static ConfigEntry twitchCompanyMoon; public static List FirstTimeAdPlayers = new List(); public static HashSet AdminUsers = new HashSet { "slayer6409", "lizziegirl0099", "glitchisbald", "crithaxxog" }; public static HashSet specialUsers = new HashSet { "xuuxiaolan", "qwertyrodrigo_", "mborsh" }; public static void Initialize() { try { API.OnMessage += OnMessageHandler; API.OnCheer += OnCheerHandler; API.OnSub += OnSubHandler; API.OnRaid += OnRaidHandler; Application.quitting += delegate { API.OnMessage -= OnMessageHandler; API.OnCheer -= OnCheerHandler; API.OnSub -= OnSubHandler; API.OnRaid -= OnRaidHandler; }; } catch (Exception arg) { SDBBZRMain.CustomLogger.LogError((object)$"Failed to initialize TwitchIntegrationManager. {arg}"); } } public static void doConfigStuff() { enableSubs = SDBBZRMain.BepInExConfig.Bind("Twitch", "Enable Sub", true, "If Twitch Subscription events are enabled"); t1sub = SDBBZRMain.BepInExConfig.Bind("Twitch", "Tier 1 Sub Amount", 3, "How many mimics should spawn on that tier"); t2sub = SDBBZRMain.BepInExConfig.Bind("Twitch", "Tier 2 Sub Amount", 5, "How many mimics should spawn on that tier"); t3sub = SDBBZRMain.BepInExConfig.Bind("Twitch", "Tier 3 Sub Amount", 10, "How many mimics should spawn on that tier"); enableCheer = SDBBZRMain.BepInExConfig.Bind("Twitch", "Enable Cheer", true, "If Twitch Cheer events are enabled"); cheerMin = SDBBZRMain.BepInExConfig.Bind("Twitch", "Cheer Min", 100, "How many bits required to spawn a mimic"); raidMaxSpawn = SDBBZRMain.BepInExConfig.Bind("Twitch", "Raid Max Spawn", 50, "How many zombies can spawn from a raid max"); raidNumPerPerson = SDBBZRMain.BepInExConfig.Bind("Twitch", "Per Person Raid Spawn", 1, "How many zombies spawn per raider"); enableRaid = SDBBZRMain.BepInExConfig.Bind("Twitch", "Enable Raids", true, "If Twitch Raid events are enabled"); enableChatEvents = SDBBZRMain.BepInExConfig.Bind("Twitch", "Enable Chat Events", true, "If Twitch Chat events are enabled"); twitchChatEveryone = SDBBZRMain.BepInExConfig.Bind("Twitch", "Chat Messages Target Everyone", true, "If Twitch chat popups show for everyone"); twitchCompanyMoon = SDBBZRMain.BepInExConfig.Bind("Twitch", "Company Moon", true, "Allows Twitch integration spawns on the company moon"); twitchGaletry = SDBBZRMain.BepInExConfig.Bind("Twitch", "Galetry", true, "Allows Twitch integration spawns on Galetry"); twitchOxyde = SDBBZRMain.BepInExConfig.Bind("Twitch", "Oxyde", true, "Allows Twitch integration spawns on Oxyde"); } public static bool isAdmin(TwitchMessage message) { //IL_0008: 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) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) HashSet adminUsers = AdminUsers; TwitchUser user = ((TwitchMessage)(ref message)).User; int result; if (!adminUsers.Contains(((TwitchUser)(ref user)).Username)) { user = ((TwitchMessage)(ref message)).User; if (!((TwitchUser)(ref user)).IsBroadcaster) { user = ((TwitchMessage)(ref message)).User; result = (((TwitchUser)(ref user)).IsModerator ? 1 : 0); goto IL_003f; } } result = 1; goto IL_003f; IL_003f: return (byte)result != 0; } private static void OnMessageHandler(TwitchMessage message) { //IL_0014: 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_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_0197: Unknown result type (might be due to invalid IL or missing references) //IL_020d: Unknown result type (might be due to invalid IL or missing references) //IL_0212: Unknown result type (might be due to invalid IL or missing references) //IL_0267: Unknown result type (might be due to invalid IL or missing references) //IL_026c: Unknown result type (might be due to invalid IL or missing references) //IL_02c1: Unknown result type (might be due to invalid IL or missing references) //IL_02c6: Unknown result type (might be due to invalid IL or missing references) //IL_032b: Unknown result type (might be due to invalid IL or missing references) //IL_0330: Unknown result type (might be due to invalid IL or missing references) //IL_03b8: Unknown result type (might be due to invalid IL or missing references) //IL_03bd: Unknown result type (might be due to invalid IL or missing references) //IL_0422: Unknown result type (might be due to invalid IL or missing references) //IL_0427: Unknown result type (might be due to invalid IL or missing references) //IL_04ad: Unknown result type (might be due to invalid IL or missing references) //IL_04b7: Unknown result type (might be due to invalid IL or missing references) //IL_04bc: Unknown result type (might be due to invalid IL or missing references) //IL_04d3: Unknown result type (might be due to invalid IL or missing references) //IL_04d8: Unknown result type (might be due to invalid IL or missing references) //IL_0537: Unknown result type (might be due to invalid IL or missing references) //IL_053c: Unknown result type (might be due to invalid IL or missing references) //IL_0527: Unknown result type (might be due to invalid IL or missing references) //IL_0553: Unknown result type (might be due to invalid IL or missing references) //IL_0558: Unknown result type (might be due to invalid IL or missing references) //IL_05ac: Unknown result type (might be due to invalid IL or missing references) //IL_05b1: Unknown result type (might be due to invalid IL or missing references) //IL_060c: Unknown result type (might be due to invalid IL or missing references) //IL_0611: Unknown result type (might be due to invalid IL or missing references) //IL_06c4: Unknown result type (might be due to invalid IL or missing references) //IL_06c9: Unknown result type (might be due to invalid IL or missing references) //IL_0a13: Unknown result type (might be due to invalid IL or missing references) //IL_0a18: Unknown result type (might be due to invalid IL or missing references) //IL_09cc: Unknown result type (might be due to invalid IL or missing references) //IL_09d1: Unknown result type (might be due to invalid IL or missing references) if (!SDBBZRMain.canDoTwitch) { return; } TwitchUser user = ((TwitchMessage)(ref message)).User; if (((TwitchUser)(ref user)).Username.Equals("slayer6409") && !HasSlayerSaidAnythingYet) { string b = "Has Entered The Chat"; if (SDBBZRMain.DicePresent && DiceConfigCheck.isDiceTwitchEnabled()) { b = "Has Entered the Chat with Dice"; } Networker.Instance.sendMessageSpecificServerRPC("Slayer >:D", b, warning: true, StartOfRound.Instance.localPlayerController.playerUsername); HasSlayerSaidAnythingYet = true; Networker.Instance.PlaySoundServerRPC("steve"); } user = ((TwitchMessage)(ref message)).User; if (((TwitchUser)(ref user)).Username.Equals("lizziegirl0099") && !HasLizzieSaidAnythingYet) { Networker.Instance.sendMessageSpecificServerRPC("Hi Lizzie!", SDBBZRMain.DicePresent ? "<3" : "<3 <3 <3", warning: false, StartOfRound.Instance.localPlayerController.playerUsername); Networker.Instance.QueueMimicSpawnServerRpc(StartOfRound.Instance.localPlayerController.actualClientId, 1, "SCP_999"); HasLizzieSaidAnythingYet = true; } user = ((TwitchMessage)(ref message)).User; if (((TwitchUser)(ref user)).Username.Equals("a_glitched_npc") && !HasGlitchSaidAnythingYet) { Networker.Instance.sendMessageSpecificServerRPC("A Wild Glitch appears", "Prepare for things to break", warning: false, StartOfRound.Instance.localPlayerController.playerUsername); Networker.Instance.PlaySoundServerRPC("glitchBald"); HasGlitchSaidAnythingYet = true; } user = ((TwitchMessage)(ref message)).User; if (((TwitchUser)(ref user)).Username.Equals("thenutfather") && !HasNutSaidAnythingYet) { Networker.Instance.sendMessageSpecificServerRPC("TheNutFather appears", "Hmmmmmmmmmmmmmmm...", warning: false, StartOfRound.Instance.localPlayerController.playerUsername); Networker.Instance.QueueMimicSpawnServerRpc(StartOfRound.Instance.localPlayerController.actualClientId, 1, "Maneatermini", instant: true); HasNutSaidAnythingYet = true; } user = ((TwitchMessage)(ref message)).User; if (((TwitchUser)(ref user)).Username.Equals("lunxara") && !HasLunxaraSaidAnythingYet) { Networker.Instance.sendMessageSpecificServerRPC("Lunxara appears", "Run :D", warning: false, StartOfRound.Instance.localPlayerController.playerUsername); HasLunxaraSaidAnythingYet = true; } user = ((TwitchMessage)(ref message)).User; if (((TwitchUser)(ref user)).Username.Equals("crithaxxog") && !HasCritSaidAnythingYet) { Networker.Instance.sendMessageSpecificServerRPC("Crit", "is here", warning: true, StartOfRound.Instance.localPlayerController.playerUsername); HasCritSaidAnythingYet = true; } user = ((TwitchMessage)(ref message)).User; if (((TwitchUser)(ref user)).Username.Equals("qwertyrodrigo_") && !HasRigoSaidAnythingYet) { Networker.Instance.sendMessageSpecificServerRPC("MurderBird", "Seamine go boom", warning: false, StartOfRound.Instance.localPlayerController.playerUsername); Networker.Instance.PlaySoundServerRPC("scary"); HasRigoSaidAnythingYet = true; } user = ((TwitchMessage)(ref message)).User; if (((TwitchUser)(ref user)).Username.Equals("xuuxiaolan") && !HasXuSaidAnythingYet) { string a = "Xu"; string b2 = "We need more gals :D"; if (HasMuSaidAnythingYet) { a = "Hi Mu"; b2 = " from Xu"; } Networker.Instance.sendMessageSpecificServerRPC(a, b2, warning: false, StartOfRound.Instance.localPlayerController.playerUsername); Networker.Instance.PlaySoundServerRPC("wiwiwi"); HasXuSaidAnythingYet = true; } user = ((TwitchMessage)(ref message)).User; if (((TwitchUser)(ref user)).Username.Equals("mborsh") && !HasFnoSaidAnythingYet) { Networker.Instance.sendMessageSpecificServerRPC("Funo", "Fumo Funo Fumo", warning: false, StartOfRound.Instance.localPlayerController.playerUsername); Networker.Instance.PlaySoundServerRPC("funo"); HasFnoSaidAnythingYet = true; } user = ((TwitchMessage)(ref message)).User; if (((TwitchUser)(ref user)).Username.Equals("skittymuffins") && !HasMuSaidAnythingYet) { string a2 = "Mu"; string b3 = "Mu Mu Mu"; if (HasXuSaidAnythingYet) { a2 = "Hi Xu"; b3 = " from Mu"; } Networker.Instance.sendMessageSpecificServerRPC(a2, b3, warning: false, StartOfRound.Instance.localPlayerController.playerUsername); Networker.Instance.PlaySoundServerRPC("mubald"); HasMuSaidAnythingYet = true; } int num; if (!isAdmin(message)) { user = ((TwitchMessage)(ref message)).User; if (!(((TwitchUser)(ref user)).Username == "itslittlemacho")) { user = ((TwitchMessage)(ref message)).User; num = ((((TwitchUser)(ref user)).Username == "mmagic_wesley" && ((TwitchMessage)(ref message)).Channel.ToLower() == "lunxara") ? 1 : 0); goto IL_0509; } } num = 1; goto IL_0509; IL_0509: bool flag = (byte)num != 0; if (!((TwitchMessage)(ref message)).Message.StartsWith("BALD") && flag) { ProcessMimicCommand(message, flag); } HashSet hashSet = specialUsers; user = ((TwitchMessage)(ref message)).User; if (hashSet.Contains(((TwitchUser)(ref user)).Username)) { List firstTimeAdPlayers = FirstTimeAdPlayers; user = ((TwitchMessage)(ref message)).User; if (!firstTimeAdPlayers.Contains(((TwitchUser)(ref user)).Username)) { if (((TwitchMessage)(ref message)).Message.ToLower().Contains("randad")) { Networker.Instance.doAdServerRpc("aaaaaaaaaa"); List firstTimeAdPlayers2 = FirstTimeAdPlayers; user = ((TwitchMessage)(ref message)).User; firstTimeAdPlayers2.Add(((TwitchUser)(ref user)).Username); } if (((TwitchMessage)(ref message)).Message.ToLower().Contains("selad")) { Networker.Instance.doAdServerRpc(((TwitchMessage)(ref message)).Message.Substring(((TwitchMessage)(ref message)).Message.IndexOf(' ') + 1)); List firstTimeAdPlayers3 = FirstTimeAdPlayers; user = ((TwitchMessage)(ref message)).User; firstTimeAdPlayers3.Add(((TwitchUser)(ref user)).Username); } if (((TwitchMessage)(ref message)).Message.ToLower().Contains("cusad")) { string[] array = ((TwitchMessage)(ref message)).Message.Split(";"); string top = "Glitch"; string bottom = "is Bald"; string item = "proflashlight"; if (array.Length >= 2) { top = array[1]; } if (array.Length >= 3) { bottom = array[2]; } if (array.Length >= 4) { item = array[3]; } Networker.Instance.doCustomAdServerRpc(item, top, bottom); List firstTimeAdPlayers4 = FirstTimeAdPlayers; user = ((TwitchMessage)(ref message)).User; firstTimeAdPlayers4.Add(((TwitchUser)(ref user)).Username); } } } if (flag) { if (((TwitchMessage)(ref message)).Message.Contains("sndscry")) { Networker.Instance.PlaySoundServerRPC("scary"); } if (((TwitchMessage)(ref message)).Message.Contains("sndwiwi")) { Networker.Instance.PlaySoundServerRPC("wiwiwi"); } if (((TwitchMessage)(ref message)).Message.Contains("sndmel")) { Networker.Instance.PlaySoundServerRPC("mel"); } if (((TwitchMessage)(ref message)).Message.Contains("sndfuno")) { Networker.Instance.PlaySoundServerRPC("funo"); } if (((TwitchMessage)(ref message)).Message.Contains("sndmu")) { Networker.Instance.PlaySoundServerRPC("mubald"); } if (((TwitchMessage)(ref message)).Message.ToLower().Contains("randad")) { Networker.Instance.doAdServerRpc("aaaaaaaaaa"); } if (((TwitchMessage)(ref message)).Message.ToLower().Contains("selad")) { Networker.Instance.doAdServerRpc(((TwitchMessage)(ref message)).Message.Substring(((TwitchMessage)(ref message)).Message.IndexOf(' ') + 1)); } if (((TwitchMessage)(ref message)).Message.ToLower().Contains("cusad")) { string[] array2 = ((TwitchMessage)(ref message)).Message.Split(";"); string top2 = "Glitch"; string bottom2 = "is Bald"; string item2 = "proflashlight"; if (array2.Length >= 2) { top2 = array2[1]; } if (array2.Length >= 3) { bottom2 = array2[2]; } if (array2.Length >= 4) { item2 = array2[3]; } Networker.Instance.doCustomAdServerRpc(item2, top2, bottom2); } } if (enableChatEvents.Value && ((TwitchMessage)(ref message)).Message.StartsWith("BALD") && ((TwitchMessage)(ref message)).Message.Trim() != "BALD") { int length = "aglitchednpcTTV's Twitch:".Length; string text = "'s Twitch Chat:"; string text2 = "'s Chat"; string text3 = StartOfRound.Instance?.localPlayerController.playerUsername; string text4 = ""; text4 = ((text3.Length + text.Length <= length) ? (text3 + text) : ((text3.Length + text2.Length > length) ? (text3.Substring(0, Math.Min(text3.Length, length - text.Length)) + text) : (text3 + text2))); if (twitchChatEveryone.Value) { Networker instance = Networker.Instance; string a3 = text4; user = ((TwitchMessage)(ref message)).User; string displayName = ((TwitchUser)(ref user)).DisplayName; string message2 = ((TwitchMessage)(ref message)).Message; instance.sendMessageAllServerRPC(a3, displayName + ": " + message2.Substring(5, message2.Length - 5), warning: false); } else { Networker instance2 = Networker.Instance; string a4 = text4; user = ((TwitchMessage)(ref message)).User; string displayName2 = ((TwitchUser)(ref user)).DisplayName; string message2 = ((TwitchMessage)(ref message)).Message; instance2.sendMessageSpecificServerRPC(a4, displayName2 + ": " + message2.Substring(5, message2.Length - 5), warning: false, StartOfRound.Instance?.localPlayerController.playerUsername); } } } public static bool ProcessMimicCommand(TwitchMessage message, bool specialCircumstances) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_023e: Unknown result type (might be due to invalid IL or missing references) TwitchUser user; if (!Networker.Instance.canChat) { user = ((TwitchMessage)(ref message)).User; if (((TwitchUser)(ref user)).Username != "slayer6409") { return false; } } user = ((TwitchMessage)(ref message)).User; int num; if (!(((TwitchUser)(ref user)).Username == "slayer6409")) { user = ((TwitchMessage)(ref message)).User; num = (((TwitchUser)(ref user)).IsBroadcaster ? 1 : 0); } else { num = 1; } bool flag = (byte)num != 0; string text = ((TwitchMessage)(ref message)).Message.ToUpper(); if (text.ToUpper().Contains("JS")) { int num2 = -1; if (text.ToUpper().Contains("FISH")) { num2 = 13; } else if (text.ToUpper().Contains("BALD")) { num2 = (((double)Random.value < 0.5) ? 3 : 12); } else if (text.ToUpper().Contains("FUMO")) { num2 = 10; } else if (text.ToUpper().Contains("RIGO")) { num2 = 9; } else if (text.ToUpper().Contains("STEVE")) { num2 = 11; } else if (text.ToUpper().Contains("TREE")) { num2 = 8; } else if (text.ToUpper().Contains("EMERGENCY")) { num2 = 2; } else if (text.ToUpper().Contains("CREEPY")) { num2 = 1; } else { float value = Random.value; num2 = ((!(value < 0.2f)) ? ((value < 0.4f) ? 4 : ((value < 0.6f) ? 5 : ((!(value < 0.8f)) ? 7 : 6))) : 0); } Networker.Instance.doCustomJSServerRpc(num2); } if ((text.Contains("MIMIC") && text.Contains("SPAWN")) || text.Contains("lizzie103SpicyNuggies".ToUpper())) { HandleMimicSpawn(message, 1); Networker.Instance.cooldownStartServerRPC(); return true; } if (flag) { if (text.ToUpper().Contains("REVIVE") && text.ToUpper().Contains("ALL")) { Networker.Instance.reviveAllZombiesServerRpc(); } if (text.ToUpper().Contains("GLITCH") && text.ToUpper().Contains("FISH") && text.ToUpper().Contains("22")) { Networker.Instance.reviveAllZombiesServerRpc(); } } if (specialCircumstances) { var (text2, pattern) = GetEnemyCommand(text); if (string.IsNullOrEmpty(text2)) { return false; } int amount = ExtractNumber(text, pattern, flag); ulong targetPlayer = GetTargetPlayer(text); if (text.Contains("MINI") && flag) { text2 += "mini"; } if (text.Contains("GIANT") && flag) { text2 += "big"; } if (text.Contains("FLAT") && flag) { text2 += "flat"; } Networker.Instance.QueueMimicSpawnServerRpc(targetPlayer, amount, text2, instant: true); return true; } return false; } private static int ExtractNumber(string input, string pattern, bool canSpawnMore = false) { int num = 1; int num2 = 15; if (canSpawnMore) { num = 1; num2 = 25; } Match match = Regex.Match(input, pattern); if (match.Success) { int num3 = int.Parse(match.Groups[1].Value); if (num3 < num) { num3 = num; } if (num3 > num2) { num3 = num2; } return num3; } return 1; } private static ulong GetTargetPlayer(string messageText) { if (messageText.Contains("ON")) { string[] array = messageText.Split(new string[1] { "ON" }, StringSplitOptions.None); if (array.Length > 1) { PlayerControllerB closestPlayerByName = Misc.GetClosestPlayerByName(array[1].Trim()); if ((Object)(object)closestPlayerByName != (Object)null) { return closestPlayerByName.actualClientId; } } } return Misc.GetRandomAlivePlayer().actualClientId; } public static void HandleMimicSpawn(TwitchMessage message, int mimicCount) { string messageText = ((TwitchMessage)(ref message)).Message.ToUpper(); string what = "Masked"; ulong targetPlayer = GetTargetPlayer(messageText); Networker.Instance.QueueMimicSpawnServerRpc(targetPlayer, mimicCount, what); } private static (string what, string pattern) GetEnemyCommand(string messageText) { if (messageText.Contains("HSCS")) { return (what: "Horse", pattern: "\\bHSCS(\\d+)\\b"); } if (messageText.Contains("SCYS")) { return (what: "Scary", pattern: "\\bSCYS(\\d+)\\b"); } if (messageText.Contains("JMTHS")) { return (what: "Transporter", pattern: "\\bJMTHS(\\d+)\\b"); } if (messageText.Contains("TLPS")) { return (what: "Tulip Snake", pattern: "\\bTLPS(\\d+)\\b"); } if (messageText.Contains("WSM")) { return (what: "Masked", pattern: "\\bWSM(\\d+)\\b"); } if (messageText.Contains("MNTRS")) { return (what: "Maneater", pattern: "\\bMNTRS(\\d+)\\b"); } return (what: null, pattern: null); } private static void OnSubHandler(TwitchSubEvent subEvent) { //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Invalid comparison between Unknown and I4 //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Invalid comparison between Unknown and I4 //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Invalid comparison between Unknown and I4 //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Invalid comparison between Unknown and I4 if (SDBBZRMain.canDoTwitch && enableSubs.Value) { int num = 1; if ((int)subEvent.Tier == 1) { num = t1sub.Value; } else if ((int)subEvent.Tier == 2) { num = t2sub.Value; } else if ((int)subEvent.Tier == 3) { num = t3sub.Value; } if ((int)subEvent.Type == 3) { num *= subEvent.GiftCount; } Networker.Instance.QueueMimicSpawnServerRpc(StartOfRound.Instance.localPlayerController.actualClientId, num, "Masked"); } } private static void OnCheerHandler(TwitchCheerEvent cheerEvent) { if (!SDBBZRMain.canDoTwitch || !enableCheer.Value) { return; } if (cheerEvent.CheerAmount == 329) { Networker.Instance.reviveAllZombiesServerRpc(); } else if (cheerEvent.CheerAmount >= cheerMin.Value) { int num = cheerEvent.CheerAmount / cheerMin.Value; if (num > 25) { num = 25; } if (num <= 0) { num = 1; } ulong actualClientId = StartOfRound.Instance.localPlayerController.actualClientId; if (StartOfRound.Instance.localPlayerController.isPlayerDead) { actualClientId = Misc.GetRandomAlivePlayer().actualClientId; } Networker.Instance.QueueMimicSpawnServerRpc(actualClientId, num, "Masked"); } } private static void OnRaidHandler(TwitchRaidEvent raidEvent) { if (!SDBBZRMain.canDoTwitch || !enableRaid.Value) { return; } int num = raidEvent.ViewerCount * raidNumPerPerson.Value; if (num > 2) { if (num > raidMaxSpawn.Value) { num = raidMaxSpawn.Value; } Networker.Instance.QueueMimicSpawnServerRpc(StartOfRound.Instance.localPlayerController.actualClientId, num, "Masked"); } } } public static class MyPluginInfo { public const string PLUGIN_GUID = "SDBBZR"; public const string PLUGIN_NAME = "SDBBZR"; public const string PLUGIN_VERSION = "1.0.0"; } } namespace SlayerDeadBodiesBecomeZombiesRandomly.Patches { public class ManeaterPatchThing : MonoBehaviour { private CaveDwellerAI _instance; public void Update() { if ((Object)(object)_instance == (Object)null) { ((Component)this).gameObject.TryGetComponent(ref _instance); } else { _instance.growthMeter = 0f; } } } [HarmonyPatch(typeof(HUDManager))] internal class ChatPatch { internal static bool canDoThing = true; private const string BaseCommand = "=="; [HarmonyPatch("SubmitChat_performed")] [HarmonyPrefix] private static bool ChatStuff(HUDManager __instance) { string text = __instance.chatTextField.text; bool flag = false; bool flag2 = false; if (text.StartsWith("==")) { if (text.StartsWith("==ALLOW ", StringComparison.OrdinalIgnoreCase) && ((NetworkBehaviour)__instance.localPlayer).IsHost) { string name = text.Substring("==ALLOW ".Length).Trim(); PlayerControllerB closestPlayerByName = Misc.GetClosestPlayerByName(name); if ((Object)(object)closestPlayerByName != (Object)null) { Networker.Instance.sendMessageSpecificServerRPC("Twitch", "Allowed user: " + closestPlayerByName.playerUsername + " to use Twitch integration", warning: false, __instance.localPlayer.playerUsername); Networker.Instance.AllowTwitchUserClientRPC(closestPlayerByName.playerSteamId, FromCommand: true); } } else if (text.StartsWith("==DENY ", StringComparison.OrdinalIgnoreCase) && ((NetworkBehaviour)__instance.localPlayer).IsHost) { string name2 = text.Substring("==DENY ".Length).Trim(); PlayerControllerB closestPlayerByName2 = Misc.GetClosestPlayerByName(name2); if ((Object)(object)closestPlayerByName2 != (Object)null) { Networker.Instance.sendMessageSpecificServerRPC("Twitch", "Denied user: " + closestPlayerByName2.playerUsername + " to use Twitch integration", warning: false, __instance.localPlayer.playerUsername); Networker.Instance.DenyTwitchUserClientRPC(closestPlayerByName2.playerSteamId, FromCommand: true); } } else { if (text.StartsWith("==!")) { flag = true; } if (text.StartsWith("===!")) { flag = true; flag2 = true; } if (text.StartsWith("===")) { flag2 = true; } if (__instance.localPlayer.playerSteamId != 76561198077184650L && !((NetworkBehaviour)__instance.localPlayer).IsHost) { flag2 = false; } if (!GameNetworkManager.Instance.disableSteam && !SDBBZRMain.allowedChatUsers.Contains(__instance.localPlayer.playerSteamId) && !((NetworkBehaviour)__instance.localPlayer).IsHost) { return true; } string text2 = text.Substring("==".Length).Trim(); if (flag || (flag2 && !flag)) { text2 = text2.Substring(1).Trim(); } if (flag && flag2) { text2 = text2.Substring(2).Trim(); } if (text2.Contains("&")) { string[] array = text2.Split('&'); if (array.Length >= 2) { string a = array[0].Trim(); string text3 = array[1].Trim(); string text4 = "null"; if (text3.Contains("}")) { string[] array2 = text3.Split("}"); text3 = array2[0].Trim(); if (array2.Length > 1) { text4 = array2[1].Trim(); } } if (canDoThing || __instance.localPlayer.playerSteamId == 76561198077184650L || ((NetworkBehaviour)__instance.localPlayer).IsHost || __instance.localPlayer.playerSteamId != 76561199094139351L) { PlayerControllerB closestPlayerByName3 = Misc.GetClosestPlayerByName(text4); if (text4 == "null") { Networker.Instance.sendMessageAllServerRPC(a, text3, flag, flag2); if ((__instance.localPlayer.playerSteamId != 76561198077184650L || __instance.localPlayer.playerSteamId != 76561199094139351L) && !((NetworkBehaviour)__instance.localPlayer).IsHost) { ((MonoBehaviour)StartOfRound.Instance).StartCoroutine(Timer()); } } else { Networker.Instance.sendMessageSpecificServerRPC(a, text3, flag, closestPlayerByName3.playerUsername); if ((__instance.localPlayer.playerSteamId != 76561198077184650L || __instance.localPlayer.playerSteamId != 76561199094139351L) && !((NetworkBehaviour)__instance.localPlayer).IsHost) { ((MonoBehaviour)StartOfRound.Instance).StartCoroutine(Timer()); } } } else { Misc.SafeTipMessage("Timer Error", "That is on Cooldown", isWarning: true); } } else { Misc.SafeTipMessage("Error", "Invalid Command Format"); } } else { Misc.SafeTipMessage("Error", "Missing '&' in Command"); } } __instance.chatTextField.text = ""; } return true; } public static IEnumerator Timer() { canDoThing = false; yield return (object)new WaitForSeconds((float)SDBBZRMain.DebugCooldown.Value); canDoThing = true; } } public class DiceConfigCheck { public static bool isDiceTwitchEnabled() { return MysteryDice.TwitchEnabled.Value; } } [HarmonyPatch(typeof(GameNetworkManager))] internal class GameNetworkManagerPatch { [HarmonyPostfix] [HarmonyPatch("Start")] public static void AddPrefab(ref GameNetworkManager __instance) { ((Component)__instance).GetComponent().AddNetworkPrefab(SDBBZRMain.NetworkerPrefab); } } [HarmonyPatch(typeof(MaskedPlayerEnemy))] internal class MaskedPlayerEnemyPatch { [HarmonyPostfix] [HarmonyPatch(typeof(MaskedPlayerEnemy), "KillEnemy")] public static void doKill(MaskedPlayerEnemy __instance) { //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)NetworkManager.Singleton) && NetworkManager.Singleton.IsServer) { zombieBody component = ((Component)__instance).GetComponent(); if (!((Object)(object)component == (Object)null)) { ulong networkObjectId = ((NetworkBehaviour)__instance).NetworkObjectId; Vector3 position = ((Component)__instance).transform.position; Networker.Instance.SpawnBodyServerOnly(component.bodyID, position, networkObjectId); Networker.Instance.SyncAllBodiesMaybe(); } } } [HarmonyPrefix] [HarmonyPatch(typeof(MaskedPlayerEnemy), "Start")] public static void startStuff(MaskedPlayerEnemy __instance) { if (SDBBZRMain.maskTurn.Value && ((NetworkBehaviour)StartOfRound.Instance.localPlayerController).IsHost && !Object.op_Implicit((Object)(object)((Component)__instance).gameObject.GetComponent())) { MaskedMaker maskedMaker = ((Component)__instance).gameObject.AddComponent(); EnemyAI val = (maskedMaker.enemyAI = ((Component)__instance).gameObject.GetComponent()); maskedMaker.instance = __instance; maskedMaker.starterHP = val.enemyHP; } } } [DisallowMultipleComponent] internal class MaskedMaker : MonoBehaviour { public MaskedPlayerEnemy instance; public EnemyAI enemyAI; private float timeSinceLastCheck = 0f; public int starterHP = 0; public int timesRevived = 0; public bool currentlyZombie = false; public static int timerModifier; public static int chanceModifier; public void Update() { if (enemyAI.isEnemyDead && !StartOfRound.Instance.shipIsLeaving && (timesRevived < 1 || SDBBZRMain.continuous.Value)) { timeSinceLastCheck += Time.deltaTime; if (timeSinceLastCheck >= (float)(SDBBZRMain.timer.Value + timerModifier)) { becomeZombieCheck(); timeSinceLastCheck = 0f; } } } public void becomeZombieCheck(bool chaos = false) { if (!(SDBBZRMain.percentChance.Value + (float)chanceModifier <= 0f)) { int num = Random.Range(0, 101); num += timesRevived * SDBBZRMain.chanceDecrease.Value; if ((float)num < SDBBZRMain.percentChance.Value + (float)chanceModifier || chaos) { setZombie(); } } } public void setZombie() { timeSinceLastCheck = 0f; timesRevived++; Networker.Instance.doMaskStuffClientRPC(((NetworkBehaviour)instance).NetworkObjectId, starterHP); } } [HarmonyPatch(typeof(PlayerControllerB))] internal class PlayerControllerBPatch { [HarmonyPostfix] [HarmonyPatch(typeof(PlayerControllerB), "KillPlayer")] public static void AttachObject(PlayerControllerB __instance, int causeOfDeath, int deathAnimation, bool spawnBody, Vector3 bodyVelocity) { if ((Object)(object)Networker.Instance == (Object)null) { SDBBZRMain.CustomLogger.LogError((object)"Networker.Instance is null. Cannot add component to body."); } else { Networker.Instance.addComponentToBodyServerRPC(__instance.actualClientId); } } [HarmonyPostfix] [HarmonyPatch(typeof(PlayerControllerB), "KillPlayerServerRpc")] public static void AttachObjectTwo(PlayerControllerB __instance, int causeOfDeath, int deathAnimation, bool spawnBody, Vector3 bodyVelocity) { if ((Object)(object)Networker.Instance == (Object)null) { SDBBZRMain.CustomLogger.LogError((object)"Networker.Instance is null. Cannot add component to body."); } else { Networker.Instance.addComponentToBodyServerRPC(__instance.actualClientId); } } [HarmonyPatch(typeof(PlayerControllerB), "ConnectClientToPlayerObject")] [HarmonyPostfix] public static void ConnectClientToPlayerObject(PlayerControllerB __instance) { if (((NetworkBehaviour)__instance).IsHost) { SDBBZRMain.canDoTwitch = true; } else { Networker.Instance.SyncTwitchUserServerRPC(); } } } [HarmonyPatch(typeof(StartOfRound))] internal class StartOfRoundPatch { [HarmonyPostfix] [HarmonyPatch("Start")] public static void InstantiateNetworker(StartOfRound __instance) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) if (NetworkManager.Singleton.IsHost || NetworkManager.Singleton.IsServer) { GameObject val = Object.Instantiate(SDBBZRMain.NetworkerPrefab, Vector3.zero, Quaternion.identity); val.GetComponent().Spawn(true); } } } } namespace System.Runtime.CompilerServices { [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] internal sealed class IgnoresAccessChecksToAttribute : Attribute { public IgnoresAccessChecksToAttribute(string assemblyName) { } } } namespace __GEN { internal class NetworkVariableSerializationHelper { [RuntimeInitializeOnLoadMethod] internal static void InitializeSerialization() { } } } namespace SDBBZR.NetcodePatcher { [AttributeUsage(AttributeTargets.Module)] internal class NetcodePatchedAssemblyAttribute : Attribute { } }