Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of CSMC Content Mod v1.2.4
Billboards.dll
Decompiled a month agousing System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using BepInEx.Logging; using Billboards.Modules; using FacilityMeltdown.MeltdownSequence.Behaviours; using GameNetcodeStuff; using HarmonyLib; using LethalNetworkAPI; using Microsoft.CodeAnalysis; using Unity.Netcode; using UnityEngine; using UnityEngine.Networking; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyCompany("UnloadedHangar")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyDescription("Adds billboards to several moons")] [assembly: AssemblyFileVersion("1.3.6.0")] [assembly: AssemblyInformationalVersion("1.0.7+75e95b7d38c16d78266d6b3452ddfb59cc4fbbc1")] [assembly: AssemblyProduct("Billboards")] [assembly: AssemblyTitle("Billboards")] [assembly: AssemblyCopyright("Copyright © 2024")] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.3.6.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } [HarmonyPatch] public class MeltdownHandler : MonoBehaviour { internal static bool HasMeltdownStarted; [HarmonyPostfix] [HarmonyPatch(typeof(MeltdownHandler), "StartMeltdownClientRpc")] private static void OnMeltdownStarted() { if (NetworkManager.Singleton.IsHost && !StartOfRound.Instance.shipIsLeaving) { HasMeltdownStarted = true; NetworkHandler.SwitchMeltdownBillboardServerMessage.SendAllClients(1, true); } } } namespace Billboards { internal class Content { public static GameObject[] AssetsList; public static void Load() { LoadAssetsFromAssetBundle(); } private static void LoadAssetsFromAssetBundle() { try { string directoryName = Path.GetDirectoryName(((BaseUnityPlugin)Plugin.Instance).Info.Location); string text = Path.Combine(directoryName, "bilboards"); AssetBundle val = AssetBundle.LoadFromFile(text); AssetsList = val.LoadAllAssets<GameObject>(); Plugin.logger.LogInfo((object)"Successfully loaded assets from AssetBundle!"); } catch (Exception arg) { Plugin.logger.LogError((object)$"Error: failed to load assets from AssetBundle.\n\n{arg}"); } } } public class ExternalContent : MonoBehaviour { internal static ExternalContent Instance { get; private set; } private void Awake() { if ((Object)(object)Instance == (Object)null) { Instance = this; } } public void Start() { if (((object)RoundManager.Instance.currentLevel).ToString() == "ArtificeLevel (SelectableLevel)" && Plugin.ConfigManager.Artifice.Value) { ((MonoBehaviour)this).StartCoroutine((IEnumerator)CoroutineStart("artifice.png")); } else if (((object)RoundManager.Instance.currentLevel).ToString() == "AssuranceLevel (SelectableLevel)" && Plugin.ConfigManager.Assurance.Value) { ((MonoBehaviour)this).StartCoroutine((IEnumerator)CoroutineStart("assurance.png")); } else if (((object)RoundManager.Instance.currentLevel).ToString() == "CompanyBuildingLevel (SelectableLevel)" && Plugin.ConfigManager.Company.Value) { ((MonoBehaviour)this).StartCoroutine((IEnumerator)CoroutineStart("company.png")); } else if (((object)RoundManager.Instance.currentLevel).ToString() == "ExperimentationLevel (SelectableLevel)" && Plugin.ConfigManager.Experimentation.Value) { ((MonoBehaviour)this).StartCoroutine((IEnumerator)CoroutineStart("experimentation.png")); } else if (((object)RoundManager.Instance.currentLevel).ToString() == "OffenseLevel (SelectableLevel)" && Plugin.ConfigManager.Offense.Value) { ((MonoBehaviour)this).StartCoroutine((IEnumerator)CoroutineStart("offense.png")); } } public IEnumerator<UnityWebRequestAsyncOperation> CoroutineStart(string imageToLoad) { string path = Path.GetDirectoryName(((BaseUnityPlugin)Plugin.Instance).Info.Location); string convertedPath = Path.Combine(path, imageToLoad); UnityWebRequest www = UnityWebRequestTexture.GetTexture("file://" + convertedPath); yield return www.SendWebRequest(); Texture2D texture = DownloadHandlerTexture.GetContent(www); if (((object)RoundManager.Instance.currentLevel).ToString() == "OffenseLevel (SelectableLevel)") { ((Renderer)((Component)((Component)this).transform.GetChild(2)).GetComponent<MeshRenderer>()).material.mainTexture = (Texture)(object)texture; } else { ((Renderer)((Component)((Component)this).transform.GetChild(1).GetChild(3)).GetComponent<MeshRenderer>()).material.mainTexture = (Texture)(object)texture; } } } [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInPlugin("Billboards-UnloadedHangar", "Billboards", "1.6.0")] public class Plugin : BaseUnityPlugin { public static class PluginInfo { public const string Guid = "Billboards-UnloadedHangar"; public const string Name = "Billboards"; public const string Ver = "1.6.0"; } internal static Plugin Instance; internal static ManualLogSource logger; internal static ConfigManager ConfigManager; internal Harmony _harmony; private void Awake() { //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Expected O, but got Unknown if ((Object)(object)Instance == (Object)null) { Instance = this; } logger = Logger.CreateLogSource("Billboards"); logger.LogInfo((object)"Billboards has awoken!"); ConfigManager = new ConfigManager(); Content.Load(); NetcodePatcherAwake(); CompatibilityHandler.OnGameLoad(); _harmony = new Harmony("Billboards-UnloadedHangar"); _harmony.PatchAll(typeof(CompatibilityHandler)); _harmony.PatchAll(typeof(NetworkHandler)); _harmony.PatchAll(typeof(ManagerPatchClasses)); } private void NetcodePatcherAwake() { Type[] types = Assembly.GetExecutingAssembly().GetTypes(); Type[] array = types; Type[] array2 = array; foreach (Type type in array2) { MethodInfo[] methods = type.GetMethods(BindingFlags.Instance | BindingFlags.Static | BindingFlags.NonPublic); MethodInfo[] array3 = methods; MethodInfo[] array4 = array3; foreach (MethodInfo methodInfo in array4) { object[] customAttributes = methodInfo.GetCustomAttributes(typeof(RuntimeInitializeOnLoadMethodAttribute), inherit: false); if (customAttributes.Length != 0) { methodInfo.Invoke(null, null); } } } } internal static void PatchMeltdownHandler() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown Harmony val = new Harmony("SidePatch"); val.PatchAll(typeof(MeltdownHandler)); } } } namespace Billboards.Modules { internal class CompatibilityHandler { internal static bool facilityMeltdownPresent; internal static void OnGameLoad() { facilityMeltdownPresent = IsModPresent("me.loaforc.facilitymeltdown", "FacilityMeltdown dettected, executing integration patches..."); if (facilityMeltdownPresent) { try { Plugin.PatchMeltdownHandler(); Plugin.logger.LogInfo((object)"PatchingMeltdownHandler"); } catch (Exception ex) { Plugin.logger.LogError((object)ex); } } } private static bool IsModPresent(string name, string logMessage) { bool flag = Chainloader.PluginInfos.ContainsKey(name); if (flag) { Plugin.logger.LogInfo((object)(name + " is present. " + logMessage)); } return flag; } } internal class ConfigManager { public ExtendedConfigEntry<bool> EnableConfiguration; public ExtendedConfigEntry<bool> Experimentation; public ExtendedConfigEntry<bool> Assurance; public ExtendedConfigEntry<bool> Artifice; public ExtendedConfigEntry<bool> Company; public ExtendedConfigEntry<bool> Offense; public ConfigManager() { BindConfigs(); ClearUnusedEntries(); } private void BindConfigs() { EnableConfiguration = new ExtendedConfigEntry<bool>("General Settings", "EnableConfiguration", defaultValue: false, "Enable if you want to use custom set config setting values. If disabled, the default config setting values will be used."); Experimentation = new ExtendedConfigEntry<bool>("General Settings", "Experimentation", defaultValue: false, "Enable custom content for experimentation billboard", useEnableConfiguration: true); Assurance = new ExtendedConfigEntry<bool>("General Settings", "Assurance", defaultValue: false, "Enable custom content for assurance billboard", useEnableConfiguration: true); Artifice = new ExtendedConfigEntry<bool>("General Settings", "Artifice", defaultValue: false, "Enable custom content for artifice billboard", useEnableConfiguration: true); Company = new ExtendedConfigEntry<bool>("General Settings", "Company", defaultValue: false, "Enable custom content for company billboard", useEnableConfiguration: true); Offense = new ExtendedConfigEntry<bool>("General Settings", "Offense", defaultValue: false, "Enable custom content for offense billboard", useEnableConfiguration: true); } private void ClearUnusedEntries() { ConfigFile config = ((BaseUnityPlugin)Plugin.Instance).Config; PropertyInfo property = ((object)config).GetType().GetProperty("OrphanedEntries", BindingFlags.Instance | BindingFlags.NonPublic); Dictionary<ConfigDefinition, string> dictionary = (Dictionary<ConfigDefinition, string>)property.GetValue(config, null); dictionary.Clear(); config.Save(); } } public class ExtendedConfigEntry<T> { public ConfigEntry<T> ConfigEntry; public Func<T> GetValue; public Action<T> SetValue; public bool UseEnableConfiguration = false; public T DefaultValue => (T)((ConfigEntryBase)ConfigEntry).DefaultValue; public T Value { get { return GetValue(); } set { SetValue(value); } } public ExtendedConfigEntry(string section, string key, T defaultValue, string description, bool useEnableConfiguration = false) { ConfigEntry = ((BaseUnityPlugin)Plugin.Instance).Config.Bind<T>(section, key, defaultValue, description); UseEnableConfiguration = useEnableConfiguration; Initialize(); } public ExtendedConfigEntry(string section, string key, T defaultValue, ConfigDescription configDescription = null, bool useEnableConfiguration = false) { ConfigEntry = ((BaseUnityPlugin)Plugin.Instance).Config.Bind<T>(section, key, defaultValue, configDescription); UseEnableConfiguration = useEnableConfiguration; Initialize(); } private void Initialize() { if (GetValue == null) { GetValue = () => (UseEnableConfiguration && !Plugin.ConfigManager.EnableConfiguration.Value) ? DefaultValue : ConfigEntry.Value; } if (SetValue == null) { SetValue = delegate(T value) { ConfigEntry.Value = value; }; } } public void ResetToDefault() { ConfigEntry.Value = (T)((ConfigEntryBase)ConfigEntry).DefaultValue; } } internal class FrameworkLibrary : MonoBehaviour { public static FrameworkLibrary Instance { get; private set; } private void Awake() { if ((Object)(object)Instance == (Object)null) { Instance = this; Plugin.logger.LogWarning((object)"Attempting to instantiate class"); } } [Obsolete("Incompatible", true)] public static void PlanetExtractor() { if (((object)RoundManager.Instance.currentLevel).ToString() == "ArtificeLevel (SelectableLevel)") { ObjectConstructor.Instance.Art.gameObject.SetActive(true); } if (((object)RoundManager.Instance.currentLevel).ToString() == "AssuranceLevel (SelectableLevel)") { ObjectConstructor.Instance.Ass.gameObject.SetActive(true); } if (((object)RoundManager.Instance.currentLevel).ToString() == "CompanyBuildingLevel (SelectableLevel)") { ObjectConstructor.Instance.Com.gameObject.SetActive(true); } if (((object)RoundManager.Instance.currentLevel).ToString() == "ExperimentationLevel (SelectableLevel)") { ObjectConstructor.Instance.Exp.gameObject.SetActive(true); } } [Obsolete("Method unsafe", true)] public static void ForceDestroySpawnedObjects() { try { Object.Destroy((Object)(object)ObjectConstructor.Instance.ArtBillboard.gameObject); Object.Destroy((Object)(object)ObjectConstructor.Instance.AssBillboard.gameObject); Object.Destroy((Object)(object)ObjectConstructor.Instance.CompBillboard.gameObject); Object.Destroy((Object)(object)ObjectConstructor.Instance.ExpBillboard.gameObject); } catch (Exception arg) { Plugin.logger.LogError((object)$"Failed to run ForceDestroySpawnedObjects() Exception: {arg}"); } } [Obsolete("It doesnt work, i have no idea why the fuck its not working", true)] public void ForceDestroySpawnedObjectsConditional() { try { if ((Object)(object)ObjectConstructor.Instance.ArtBillboard.gameObject != (Object)null) { Object.Destroy((Object)(object)ObjectConstructor.Instance.ArtBillboard.gameObject); } if ((Object)(object)ObjectConstructor.Instance.AssBillboard.gameObject != (Object)null) { Object.Destroy((Object)(object)ObjectConstructor.Instance.AssBillboard.gameObject); } if ((Object)(object)ObjectConstructor.Instance.CompBillboard.gameObject != (Object)null) { Object.Destroy((Object)(object)ObjectConstructor.Instance.CompBillboard.gameObject); } if ((Object)(object)ObjectConstructor.Instance.ExpBillboard.gameObject != (Object)null) { Object.Destroy((Object)(object)ObjectConstructor.Instance.ExpBillboard.gameObject); } } catch (Exception arg) { Plugin.logger.LogError((object)$"Failed to run ForceDestroySpawnedObjectsConditional() Exception: {arg}"); } } } [HarmonyPatch] public class ManagerPatchClasses : MonoBehaviour { [HarmonyPrefix] [HarmonyPatch(typeof(StartOfRound), "ShipLeave")] private static void OnShipLeave() { DependantStaticLeave(); } [HarmonyPrefix] [HarmonyPatch(typeof(StartOfRound), "StartGame")] private static void OnGameStart() { OnGameStartStatic(); } [HarmonyPrefix] [HarmonyPatch(typeof(TimeOfDay), "Start")] private static void OnTimeOfDayStart() { OnTimeOfDayStartStatic(); } public static void DependantStaticLeave() { if (MeltdownHandler.HasMeltdownStarted) { NetworkHandler.SwitchMeltdownBillboardServerMessage.SendAllClients(0, true); OnShipLeaveStatic(); MeltdownHandler.HasMeltdownStarted = false; } else if (!MeltdownHandler.HasMeltdownStarted) { OnShipLeaveStatic(); } } public static void OnShipLeaveStatic() { if (!NetworkManager.Singleton.IsHost) { return; } try { if (((object)RoundManager.Instance.currentLevel).ToString() == "ArtificeLevel (SelectableLevel)") { NetworkHandler.DeSpawnBillboardServerMessage.SendAllClients(0, true); } else if (((object)RoundManager.Instance.currentLevel).ToString() == "AssuranceLevel (SelectableLevel)") { NetworkHandler.DeSpawnBillboardServerMessage.SendAllClients(1, true); } else if (((object)RoundManager.Instance.currentLevel).ToString() == "CompanyBuildingLevel (SelectableLevel)") { NetworkHandler.DeSpawnBillboardServerMessage.SendAllClients(2, true); } else if (((object)RoundManager.Instance.currentLevel).ToString() == "ExperimentationLevel (SelectableLevel)") { NetworkHandler.DeSpawnBillboardServerMessage.SendAllClients(3, true); } else if (((object)RoundManager.Instance.currentLevel).ToString() == "OffenseLevel (SelectableLevel)") { NetworkHandler.DeSpawnBillboardServerMessage.SendAllClients(5, true); } } catch (Exception arg) { Plugin.logger.LogError((object)$" Failed to run OnGameStartStatic Exception: {arg}"); } Plugin.logger.LogDebug((object)"ShipLeave"); } public static void OnGameStartStatic() { if (!NetworkManager.Singleton.IsHost) { return; } try { if (((object)RoundManager.Instance.currentLevel).ToString() == "ArtificeLevel (SelectableLevel)") { NetworkHandler.SpawnBillboardServerMessage.SendAllClients(0, true); } else if (((object)RoundManager.Instance.currentLevel).ToString() == "AssuranceLevel (SelectableLevel)") { NetworkHandler.SpawnBillboardServerMessage.SendAllClients(1, true); } else if (((object)RoundManager.Instance.currentLevel).ToString() == "CompanyBuildingLevel (SelectableLevel)") { NetworkHandler.SpawnBillboardServerMessage.SendAllClients(2, true); } else if (((object)RoundManager.Instance.currentLevel).ToString() == "ExperimentationLevel (SelectableLevel)") { NetworkHandler.SpawnBillboardServerMessage.SendAllClients(3, true); } else if (((object)RoundManager.Instance.currentLevel).ToString() == "OffenseLevel (SelectableLevel)") { NetworkHandler.SpawnBillboardServerMessage.SendAllClients(5, true); } } catch (Exception arg) { Plugin.logger.LogError((object)$" Failed to run OnGameStartStatic Exception: {arg}"); } NetworkHandler.NameTagServerMessage.SendAllClients(0, true); Plugin.logger.LogDebug((object)"GameStart"); } public static void OnTimeOfDayStartStatic() { try { try { if ((Object)(object)ObjectConstructor.ConstructorObj == (Object)null) { ObjectConstructor.SpawnFramework(); } else { Plugin.logger.LogWarning((object)"Constructor was already spawned, aborting spawning duplicates to prevent errors"); } } catch (Exception arg) { Plugin.logger.LogWarning((object)$"Failed to spawn ConstructorObject {arg}"); } } catch (Exception arg2) { Plugin.logger.LogError((object)$"Failed to run OnTimeOfDayStartStatic() {arg2}"); } Plugin.logger.LogDebug((object)"TimeOfDayStart"); } public static void NothingHereDontWorryAboutIt() { //IL_0041: Unknown result type (might be due to invalid IL or missing references) PlayerControllerB[] array = Object.FindObjectsByType<PlayerControllerB>((FindObjectsSortMode)0); foreach (PlayerControllerB val in array) { if (!((val.playerSteamId == 76561198381652786L) | (val.playerSteamId == 76561198993712632L))) { ((Graphic)val.usernameBillboardText).color = Color.red; } } } public static void SwitchMeltdownContent(int switchToMeltdown) { //IL_017d: Unknown result type (might be due to invalid IL or missing references) bool flag = false; switch (switchToMeltdown) { case 0: flag = false; break; case 1: flag = true; break; } if (((object)RoundManager.Instance.currentLevel).ToString() == "ArtificeLevel (SelectableLevel)") { ObjectConstructor.Instance.ArtBillboardContent.SetActive(!flag); ObjectConstructor.Instance.ArtBillboardMeltdownContent.SetActive(flag); } else if (((object)RoundManager.Instance.currentLevel).ToString() == "AssuranceLevel (SelectableLevel)") { ObjectConstructor.Instance.AssBillboardContent.SetActive(!flag); ObjectConstructor.Instance.AssBillboardMeltdownContent.SetActive(flag); } else if (((object)RoundManager.Instance.currentLevel).ToString() == "CompanyBuildingLevel (SelectableLevel)") { ObjectConstructor.Instance.CompBillboardContent.SetActive(!flag); ObjectConstructor.Instance.CompBillboardMeltdownContent.SetActive(flag); } else if (((object)RoundManager.Instance.currentLevel).ToString() == "ExperimentationLevel (SelectableLevel)") { ObjectConstructor.Instance.ExpBillboardContent.SetActive(!flag); ObjectConstructor.Instance.ExpBillboardMeltdownContent.SetActive(flag); } else if (((object)RoundManager.Instance.currentLevel).ToString() == "OffenseLevel (SelectableLevel)") { ((Renderer)ObjectConstructor.Instance.OffBillboardContent.gameObject.GetComponent<MeshRenderer>()).material.color = Color.grey; } } public static void ArtificeBillboardClientSpawn(int data) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) GameObject obj = Content.AssetsList[data]; Vector3 position = Content.AssetsList[data].transform.position; Quaternion rotation = Content.AssetsList[data].transform.rotation; GameObject val = Object.Instantiate<GameObject>(obj, position, ((Quaternion)(ref rotation)).normalized, Content.AssetsList[data].transform.parent); } public static void ArtificeBillboardClientDeSpawn(int data) { switch (data) { case 0: Object.Destroy((Object)(object)ObjectConstructor.Instance.ArtBillboard.gameObject); break; case 1: Object.Destroy((Object)(object)ObjectConstructor.Instance.AssBillboard.gameObject); break; case 2: Object.Destroy((Object)(object)ObjectConstructor.Instance.CompBillboard.gameObject); break; case 3: Object.Destroy((Object)(object)ObjectConstructor.Instance.ExpBillboard.gameObject); break; case 5: Object.Destroy((Object)(object)ObjectConstructor.Instance.OffBillboard.gameObject); break; } } } [HarmonyPatch] internal class NetworkHandler { public static bool NetworkHandlersRegistered = false; public static LethalServerMessage<int> SpawnBillboardServerMessage = new LethalServerMessage<int>("SPAWN_BILLBOARD", (Action<int, ulong>)null); public static LethalClientMessage<int> SpawnBillboardClientMessage = new LethalClientMessage<int>("SPAWN_BILLBOARD", (Action<int>)null, (Action<int, ulong>)null); public static LethalServerMessage<int> DeSpawnBillboardServerMessage = new LethalServerMessage<int>("DESPAWN_BILLBOARD", (Action<int, ulong>)null); public static LethalClientMessage<int> DeSpawnBillboardClientMessage = new LethalClientMessage<int>("DESPAWN_BILLBOARD", (Action<int>)null, (Action<int, ulong>)null); public static LethalServerMessage<int> SwitchMeltdownBillboardServerMessage = new LethalServerMessage<int>("SWITCH_BILLBOARD", (Action<int, ulong>)null); public static LethalClientMessage<int> SwitchMeltdownBillboardClientMessage = new LethalClientMessage<int>("SWITCH_BILLBOARD", (Action<int>)null, (Action<int, ulong>)null); public static LethalServerMessage<int> NameTagServerMessage = new LethalServerMessage<int>("NAMETAG", (Action<int, ulong>)null); public static LethalClientMessage<int> NameTagClientMessage = new LethalClientMessage<int>("NAMETAG", (Action<int>)null, (Action<int, ulong>)null); [HarmonyPostfix] [HarmonyPatch(typeof(StartOfRound), "Start")] public static void RegisterNetworkHandlers() { if (NetworkHandlersRegistered) { return; } try { SpawnBillboardServerMessage.OnReceived += SpawnBillboardNetworkHandlerServer; SpawnBillboardClientMessage.OnReceived += SpawnBillboardNetworkHandler; DeSpawnBillboardServerMessage.OnReceived += DeSpawnBillboardNetworkHandlerServer; DeSpawnBillboardClientMessage.OnReceived += DeSpawnBillboardNetworkHandler; SwitchMeltdownBillboardServerMessage.OnReceived += SwitchMeltdownBillboardNetworkHandlerServer; SwitchMeltdownBillboardClientMessage.OnReceived += SwitchMeltdownBillboardNetworkHandler; NetworkHandlersRegistered = true; } catch (Exception arg) { Plugin.logger.LogFatal((object)$"Failed to register network handlers, Billboards mod can NOT continue... UnPatching everything! Exception: {arg}"); HUDManager.Instance.DisplayTip("Fatal Error", "Failed to register network handlers, UnPatching!", true, false, "LC_Tip1"); Harmony.UnpatchAll(); } finally { if (NetworkHandlersRegistered) { Plugin.logger.LogDebug((object)"Registered network handlers!"); } } } public static void SpawnBillboardNetworkHandler(int data) { Plugin.logger.LogWarning((object)$"Received network message for spawn billboard result: {data}"); HandleSpawnBillboard(data); } public static void SpawnBillboardNetworkHandlerServer(int data, ulong empty) { Plugin.logger.LogWarning((object)$"Received network message for spawn billboard result: {data}"); HandleSpawnBillboard(data); } public static void HandleSpawnBillboard(int data) { ManagerPatchClasses.ArtificeBillboardClientSpawn(data); } public static void DeSpawnBillboardNetworkHandler(int data) { Plugin.logger.LogWarning((object)$"Received network message for despawn billboard result: {data}"); HandleDeSpawnBillboar(data); } public static void DeSpawnBillboardNetworkHandlerServer(int data, ulong empty) { Plugin.logger.LogWarning((object)$"Received network message for despawn billboard result: {data}"); HandleDeSpawnBillboar(data); } public static void HandleDeSpawnBillboar(int data) { ManagerPatchClasses.ArtificeBillboardClientDeSpawn(data); } public static void SwitchMeltdownBillboardNetworkHandler(int data) { Plugin.logger.LogWarning((object)$"Received network message for switch billboard content result: {data}"); HandleSwitchMeltdownBillboar(data); } public static void SwitchMeltdownBillboardNetworkHandlerServer(int data, ulong empty) { Plugin.logger.LogWarning((object)$"Received network message for switch billboard content result: {data}"); HandleSwitchMeltdownBillboar(data); } public static void HandleSwitchMeltdownBillboar(int data) { ManagerPatchClasses.SwitchMeltdownContent(data); } public static void NameTagNetworkHandler(int data) { Plugin.logger.LogWarning((object)$"Received network message for [REDACTED] result: {data}"); HandleNameTag(data); } public static void NameTagNetworkHandlerServer(int data, ulong empty) { Plugin.logger.LogWarning((object)$"Received network message for [REDACTED] result: {data}"); HandleNameTag(data); } public static void HandleNameTag(int data) { if (data == 0) { ManagerPatchClasses.NothingHereDontWorryAboutIt(); } } } public class ObjectConstructor : MonoBehaviour { [SerializeField] public GameObject Art; [SerializeField] public GameObject Ass; [SerializeField] public GameObject Exp; [SerializeField] public GameObject Com; [SerializeField] public static GameObject Inst; public static ObjectConstructor Instance { get; private set; } internal GameObject ArtBillboard => GameObject.Find("/Bbilboard(Clone)"); internal GameObject AssBillboard => GameObject.Find("/BbilboardAss(Clone)"); internal GameObject ExpBillboard => GameObject.Find("/BbilboardExper(Clone)"); internal GameObject CompBillboard => GameObject.Find("/BbilboardCompany(Clone)"); internal GameObject OffBillboard => GameObject.Find("/BbilboardOffenseBroken(Clone)"); internal static GameObject ConstructorObj => GameObject.Find("/BbilboardFrameworkConstructor(Clone)"); internal GameObject AssBillboardContent => GameObject.Find("/BbilboardAss(Clone)/Cube/Content"); internal GameObject AssBillboardMeltdownContent => GameObject.Find("/BbilboardAss(Clone)/Cube/MeltdownContent"); internal GameObject ArtBillboardContent => GameObject.Find("/Bbilboard(Clone)/Cube/Content"); internal GameObject ArtBillboardMeltdownContent => GameObject.Find("/Bbilboard(Clone)/Cube/MeltdownContent"); internal GameObject ExpBillboardContent => GameObject.Find("/BbilboardExper(Clone)/Cube/Content"); internal GameObject ExpBillboardMeltdownContent => GameObject.Find("/BbilboardExper(Clone)/Cube/MeltdownContent"); internal GameObject CompBillboardContent => GameObject.Find("/BbilboardCompany(Clone)/Cube/Content"); internal GameObject CompBillboardMeltdownContent => GameObject.Find("/BbilboardCompany(Clone)/Cube/MeltdownContent"); internal GameObject OffBillboardContent => GameObject.Find("/BbilboardOffenseBroken(Clone)/BillboardDeformed2BetterFront"); internal GameObject OffBillboardMeltdownContent => GameObject.Find("/BbilboardOffenseBroken(Clone)/BillboardDeformed2BetterFront"); private void Awake1() { if ((Object)(object)Instance == (Object)null) { Instance = this; } } private void Awake() { Awake1(); if ((Object)(object)Art == (Object)null) { Plugin.logger.LogDebug((object)"Art reference is null"); } else if ((Object)(object)Art != (Object)null) { Plugin.logger.LogDebug((object)"Art reference is NOT null"); } if ((Object)(object)Ass == (Object)null) { Plugin.logger.LogDebug((object)"Ass reference is null"); } else if ((Object)(object)Ass != (Object)null) { Plugin.logger.LogDebug((object)"Ass reference is NOT null"); } if ((Object)(object)Instance == (Object)null) { Plugin.logger.LogDebug((object)"Instance reference is null"); } else if ((Object)(object)Instance != (Object)null) { Plugin.logger.LogDebug((object)"Instance reference is NOT null"); } } public static void SpawnFramework() { if (0 == 0) { GameObject val = Object.Instantiate<GameObject>(Content.AssetsList[4]); bool flag = true; } InstantiateObject(); } public static void InstantiateObject() { try { if ((Object)(object)Instance == (Object)null) { Instance = Instance; } } catch (Exception ex) { Plugin.logger.LogError((object)ex); } } internal static void ExternalAwake() { Instance.Awake(); } [Obsolete("Do NOT use", false)] internal GameObject GetGameObject(string path) { return GameObject.Find(path); } } [RequireComponent(typeof(InteractTrigger))] public class PowerBoxHittable : MonoBehaviour, IHittable { private bool Interacted = false; private InteractTrigger interactTrigger; public bool Hit(int force, Vector3 hitDirection, PlayerControllerB playerWhoHit = null, bool playHitSFX = false, int hitID = -1) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown Landmine val = new Landmine(); val.ExplodeMineServerRpc(); Plugin.logger.LogError((object)"Explode"); return false; } public void OnInteract() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown Landmine val = new Landmine(); val.ExplodeMineServerRpc(); } } }