Decompiled source of Ola ModPack v1.0.0
BepInEx/plugins/2018-LC_API/LC_API.dll
Decompiled a year agousing System; using System.Collections.Concurrent; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Reflection.Emit; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using System.Text; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using BepInEx.Logging; using GameNetcodeStuff; using HarmonyLib; using LC_API.BundleAPI; using LC_API.ClientAPI; using LC_API.Comp; using LC_API.Data; using LC_API.Extensions; using LC_API.GameInterfaceAPI; using LC_API.ManualPatches; using LC_API.ServerAPI; using Microsoft.CodeAnalysis; using Steamworks; using Steamworks.Data; using TMPro; using UnityEngine; using UnityEngine.EventSystems; using UnityEngine.InputSystem; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETFramework,Version=v4.6", FrameworkDisplayName = ".NET Framework 4.6")] [assembly: AssemblyCompany("LC_API")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyDescription("Utilities for plugin devs")] [assembly: AssemblyFileVersion("2.1.4.0")] [assembly: AssemblyInformationalVersion("2.1.4")] [assembly: AssemblyProduct("LC_API")] [assembly: AssemblyTitle("LC_API")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("2.1.4.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; } } } namespace LC_API { internal static class CheatDatabase { private const string DAT_CD_BROADCAST = "LC_API_CD_Broadcast"; private const string SIG_REQ_GUID = "LC_API_ReqGUID"; private const string SIG_SEND_MODS = "LC_APISendMods"; private static Dictionary<string, PluginInfo> PluginsLoaded = new Dictionary<string, PluginInfo>(); public static void RunLocalCheatDetector() { PluginsLoaded = Chainloader.PluginInfos; using Dictionary<string, PluginInfo>.ValueCollection.Enumerator enumerator = PluginsLoaded.Values.GetEnumerator(); while (enumerator.MoveNext()) { switch (enumerator.Current.Metadata.GUID) { case "mikes.lethalcompany.mikestweaks": case "mom.llama.enhancer": case "Posiedon.GameMaster": case "LethalCompanyScalingMaster": case "verity.amberalert": ModdedServer.SetServerModdedOnly(); break; } } } public static void OtherPlayerCheatDetector() { Plugin.Log.LogWarning((object)"Asking all other players for their mod list.."); GameTips.ShowTip("Mod List:", "Asking all other players for installed mods.."); GameTips.ShowTip("Mod List:", "Check the logs for more detailed results.\n<size=13>(Note that if someone doesnt show up on the list, they may not have LC_API installed)</size>"); Networking.Broadcast("LC_API_CD_Broadcast", "LC_API_ReqGUID"); } internal static void CDNetGetString(string data, string signature) { if (data == "LC_API_CD_Broadcast" && signature == "LC_API_ReqGUID") { string text = ""; foreach (PluginInfo value in PluginsLoaded.Values) { text = text + "\n" + value.Metadata.GUID; } Networking.Broadcast(GameNetworkManager.Instance.localPlayerController.playerUsername + " responded with these mods:" + text, "LC_APISendMods"); } if (signature == "LC_APISendMods") { GameTips.ShowTip("Mod List:", data); Plugin.Log.LogWarning((object)data); } } } [BepInPlugin("LC_API", "LC_API", "2.1.4")] public sealed class Plugin : BaseUnityPlugin { internal static ManualLogSource Log; private ConfigEntry<bool> configOverrideModServer; private ConfigEntry<bool> configLegacyAssetLoading; private ConfigEntry<bool> configDisableBundleLoader; public static bool Initialized { get; private set; } private void Awake() { //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_01a1: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Unknown result type (might be due to invalid IL or missing references) //IL_01b2: Expected O, but got Unknown //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) //IL_01c6: Expected O, but got Unknown //IL_01c7: Unknown result type (might be due to invalid IL or missing references) //IL_01ca: Unknown result type (might be due to invalid IL or missing references) //IL_01d8: Expected O, but got Unknown //IL_01df: Unknown result type (might be due to invalid IL or missing references) //IL_01eb: Expected O, but got Unknown configOverrideModServer = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "Force modded server browser", false, "Should the API force you into the modded server browser?"); configLegacyAssetLoading = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "Legacy asset bundle loading", false, "Should the BundleLoader use legacy asset loading? Turning this on may help with loading assets from older plugins."); configDisableBundleLoader = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "Disable BundleLoader", false, "Should the BundleLoader be turned off? Enable this if you are having problems with mods that load assets using a different method from LC_API's BundleLoader."); CommandHandler.commandPrefix = ((BaseUnityPlugin)this).Config.Bind<string>("General", "Prefix", "/", "Command prefix"); Log = ((BaseUnityPlugin)this).Logger; ((BaseUnityPlugin)this).Logger.LogWarning((object)"\n.____ _________ _____ __________ .___ \r\n| | \\_ ___ \\ / _ \\ \\______ \\| | \r\n| | / \\ \\/ / /_\\ \\ | ___/| | \r\n| |___\\ \\____ / | \\| | | | \r\n|_______ \\\\______ /______\\____|__ /|____| |___| \r\n \\/ \\//_____/ \\/ \r\n "); ((BaseUnityPlugin)this).Logger.LogInfo((object)"LC_API Starting up.."); if (configOverrideModServer.Value) { ModdedServer.SetServerModdedOnly(); } Harmony val = new Harmony("ModAPI"); MethodInfo methodInfo = AccessTools.Method(typeof(GameNetworkManager), "SteamMatchmaking_OnLobbyCreated", (Type[])null, (Type[])null); AccessTools.Method(typeof(GameNetworkManager), "LobbyDataIsJoinable", (Type[])null, (Type[])null); MethodInfo methodInfo2 = AccessTools.Method(typeof(ServerPatch), "OnLobbyCreate", (Type[])null, (Type[])null); MethodInfo methodInfo3 = AccessTools.Method(typeof(MenuManager), "Awake", (Type[])null, (Type[])null); MethodInfo methodInfo4 = AccessTools.Method(typeof(ServerPatch), "CacheMenuManager", (Type[])null, (Type[])null); MethodInfo methodInfo5 = AccessTools.Method(typeof(HUDManager), "AddChatMessage", (Type[])null, (Type[])null); MethodInfo methodInfo6 = AccessTools.Method(typeof(ServerPatch), "ChatInterpreter", (Type[])null, (Type[])null); MethodInfo methodInfo7 = AccessTools.Method(typeof(HUDManager), "SubmitChat_performed", (Type[])null, (Type[])null); MethodInfo methodInfo8 = AccessTools.Method(typeof(CommandHandler.SubmitChatPatch), "Transpiler", (Type[])null, (Type[])null); val.Patch((MethodBase)methodInfo3, new HarmonyMethod(methodInfo4), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); val.Patch((MethodBase)methodInfo5, new HarmonyMethod(methodInfo6), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); val.Patch((MethodBase)methodInfo, new HarmonyMethod(methodInfo2), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); val.Patch((MethodBase)methodInfo7, (HarmonyMethod)null, (HarmonyMethod)null, new HarmonyMethod(methodInfo8), (HarmonyMethod)null, (HarmonyMethod)null); Networking.GetString = (Action<string, string>)Delegate.Combine(Networking.GetString, new Action<string, string>(CheatDatabase.CDNetGetString)); Networking.GetListString = (Action<List<string>, string>)Delegate.Combine(Networking.GetListString, new Action<List<string>, string>(Networking.LCAPI_NET_SYNCVAR_SET)); } internal void Start() { Initialize(); } internal void OnDestroy() { Initialize(); } internal void Initialize() { //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) //IL_003a: Expected O, but got Unknown if (!Initialized) { Initialized = true; if (!configDisableBundleLoader.Value) { BundleLoader.Load(configLegacyAssetLoading.Value); } GameObject val = new GameObject("API"); Object.DontDestroyOnLoad((Object)val); val.AddComponent<LC_APIManager>(); ((BaseUnityPlugin)this).Logger.LogInfo((object)"LC_API Started!"); CheatDatabase.RunLocalCheatDetector(); } } internal static void PatchMethodManual(MethodInfo method, MethodInfo patch, Harmony harmony) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown harmony.Patch((MethodBase)method, new HarmonyMethod(patch), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); } } public static class MyPluginInfo { public const string PLUGIN_GUID = "LC_API"; public const string PLUGIN_NAME = "LC_API"; public const string PLUGIN_VERSION = "2.1.4"; } } namespace LC_API.ServerAPI { public static class ModdedServer { private static bool moddedOnly; [Obsolete("Use SetServerModdedOnly() instead. This will be removed/private in a future update.")] public static bool setModdedOnly; public static bool ModdedOnly => moddedOnly; public static void SetServerModdedOnly() { moddedOnly = true; Plugin.Log.LogMessage((object)"A plugin has set your game to only allow you to play with other people who have mods!"); } public static void OnSceneLoaded() { if (Object.op_Implicit((Object)(object)GameNetworkManager.Instance) && ModdedOnly) { GameNetworkManager instance = GameNetworkManager.Instance; instance.gameVersionNum += 16440; setModdedOnly = true; } } } public static class Networking { public static Action<string, string> GetString = delegate { }; public static Action<List<string>, string> GetListString = delegate { }; public static Action<int, string> GetInt = delegate { }; public static Action<float, string> GetFloat = delegate { }; public static Action<Vector3, string> GetVector3 = delegate { }; private static Dictionary<string, string> syncStringVars = new Dictionary<string, string>(); public static void Broadcast(string data, string signature) { if (data.Contains("/")) { Plugin.Log.LogError((object)"Invalid character in broadcasted string event! ( / )"); return; } HUDManager.Instance.AddTextToChatOnServer("<size=0>NWE/" + data + "/" + signature + "/" + NetworkBroadcastDataType.BDstring.ToString() + "/" + GameNetworkManager.Instance.localPlayerController.playerClientId + "/</size>", -1); } public static void Broadcast(List<string> data, string signature) { string text = ""; foreach (string datum in data) { if (datum.Contains("/")) { Plugin.Log.LogError((object)"Invalid character in broadcasted string event! ( / )"); return; } if (datum.Contains("\n")) { Plugin.Log.LogError((object)"Invalid character in broadcasted string event! ( NewLine )"); return; } text = text + datum + "\n"; } HUDManager.Instance.AddTextToChatOnServer("<size=0>NWE/" + data?.ToString() + "/" + signature + "/" + NetworkBroadcastDataType.BDlistString.ToString() + "/" + GameNetworkManager.Instance.localPlayerController.playerClientId + "/</size>", -1); } public static void Broadcast(int data, string signature) { HUDManager.Instance.AddTextToChatOnServer("<size=0>NWE/" + data + "/" + signature + "/" + NetworkBroadcastDataType.BDint.ToString() + "/" + GameNetworkManager.Instance.localPlayerController.playerClientId + "/</size>", -1); } public static void Broadcast(float data, string signature) { HUDManager.Instance.AddTextToChatOnServer("<size=0>NWE/" + data + "/" + signature + "/" + NetworkBroadcastDataType.BDfloat.ToString() + "/" + GameNetworkManager.Instance.localPlayerController.playerClientId + "/</size>", -1); } public static void Broadcast(Vector3 data, string signature) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) HUDManager instance = HUDManager.Instance; string[] obj = new string[9] { "<size=0>NWE/", null, null, null, null, null, null, null, null }; Vector3 val = data; obj[1] = ((object)(Vector3)(ref val)).ToString(); obj[2] = "/"; obj[3] = signature; obj[4] = "/"; obj[5] = NetworkBroadcastDataType.BDvector3.ToString(); obj[6] = "/"; obj[7] = GameNetworkManager.Instance.localPlayerController.playerClientId.ToString(); obj[8] = "/</size>"; instance.AddTextToChatOnServer(string.Concat(obj), -1); } public static void RegisterSyncVariable(string name) { if (!syncStringVars.ContainsKey(name)) { syncStringVars.Add(name, ""); } else { Plugin.Log.LogError((object)("Cannot register Sync Variable! A Sync Variable has already been registered with name " + name)); } } public static void SetSyncVariable(string name, string value) { if (syncStringVars.ContainsKey(name)) { syncStringVars[name] = value; Broadcast(new List<string> { name, value }, "LCAPI_NET_SYNCVAR_SET"); } else { Plugin.Log.LogError((object)("Cannot set the value of Sync Variable " + name + " as it is not registered!")); } } private static void SetSyncVariableB(string name, string value) { if (syncStringVars.ContainsKey(name)) { syncStringVars[name] = value; } else { Plugin.Log.LogError((object)("Cannot set the value of Sync Variable " + name + " as it is not registered!")); } } internal static void LCAPI_NET_SYNCVAR_SET(List<string> list, string arg2) { if (arg2 == "LCAPI_NET_SYNCVAR_SET") { SetSyncVariableB(list[0], list[1]); } } public static string GetSyncVariable(string name) { if (syncStringVars.ContainsKey(name)) { return syncStringVars[name]; } Plugin.Log.LogError((object)("Cannot get the value of Sync Variable " + name + " as it is not registered!")); return ""; } private static void GotString(string data, string signature) { } private static void GotInt(int data, string signature) { } private static void GotFloat(float data, string signature) { } private static void GotVector3(Vector3 data, string signature) { } } } namespace LC_API.ManualPatches { internal static class ServerPatch { internal static bool OnLobbyCreate(GameNetworkManager __instance, Result result, Lobby lobby) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Invalid comparison between Unknown and I4 //IL_0009: Unknown result type (might be due to invalid IL or missing references) if ((int)result != 1) { Debug.LogError((object)$"Lobby could not be created! {result}", (Object)(object)__instance); } __instance.lobbyHostSettings.lobbyName = "[MODDED]" + __instance.lobbyHostSettings.lobbyName.ToString(); Plugin.Log.LogMessage((object)"server pre-setup success"); return true; } internal static bool CacheMenuManager(MenuManager __instance) { LC_APIManager.MenuManager = __instance; return true; } internal static bool ChatInterpreter(HUDManager __instance, string chatMessage) { //IL_0312: 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_03a2: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Unknown result type (might be due to invalid IL or missing references) if (!chatMessage.Contains("NWE") || !chatMessage.Contains("<size=0>")) { return true; } string[] array = chatMessage.Split(new char[1] { '/' }); if (array.Length < 5) { if (array.Length >= 3) { if (!int.TryParse(array[4], out var result)) { Plugin.Log.LogWarning((object)"Failed to parse player ID!!"); return false; } if ((result == (int)GameNetworkManager.Instance.localPlayerController.playerClientId) & !LC_APIManager.netTester) { return false; } Enum.TryParse<NetworkBroadcastDataType>(array[3], out var result2); switch (result2) { case NetworkBroadcastDataType.BDstring: Networking.GetString(array[1], array[2]); break; case NetworkBroadcastDataType.BDint: Networking.GetInt(int.Parse(array[1]), array[2]); break; case NetworkBroadcastDataType.BDfloat: Networking.GetFloat(float.Parse(array[1]), array[2]); break; case NetworkBroadcastDataType.BDvector3: { string[] array2 = array[1].Replace("(", "").Replace(")", "").Split(new char[1] { ',' }); Vector3 arg = default(Vector3); if (array2.Length == 3) { if (float.TryParse(array2[0], out var result3) && float.TryParse(array2[1], out var result4) && float.TryParse(array2[2], out var result5)) { arg.x = result3; arg.y = result4; arg.z = result5; } else { Plugin.Log.LogError((object)"Vector3 Network receive fail. This is a failure of the API, and it should be reported as a bug."); } } else { Plugin.Log.LogError((object)"Vector3 Network receive fail. This is a failure of the API, and it should be reported as a bug."); } Networking.GetVector3(arg, array[2]); break; } case NetworkBroadcastDataType.BDlistString: { string[] source = array[1].Split(new char[1] { '\n' }); Networking.GetListString(source.ToList(), array[2]); break; } } _ = LC_APIManager.netTester; return false; } Plugin.Log.LogError((object)"Generic Network receive fail. This is a failure of the API, and it should be reported as a bug."); Plugin.Log.LogError((object)$"Generic Network receive fail (expected 5+ data fragments, got {array.Length}). This is a failure of the API, and it should be reported as a bug."); return true; } if (!int.TryParse(array[4], out var result6)) { Plugin.Log.LogWarning((object)("Failed to parse player ID '" + array[4] + "'!!")); return false; } if ((result6 == (int)GameNetworkManager.Instance.localPlayerController.playerClientId) & !LC_APIManager.netTester) { return false; } if (!Enum.TryParse<NetworkBroadcastDataType>(array[3], out var result7)) { Plugin.Log.LogError((object)("Unknown datatype - unable to parse '" + array[3] + "' into a known data type!")); return false; } switch (result7) { case NetworkBroadcastDataType.BDstring: Networking.GetString.InvokeActionSafe(array[1], array[2]); break; case NetworkBroadcastDataType.BDint: Networking.GetInt.InvokeActionSafe(int.Parse(array[1]), array[2]); break; case NetworkBroadcastDataType.BDfloat: Networking.GetFloat.InvokeActionSafe(float.Parse(array[1]), array[2]); break; case NetworkBroadcastDataType.BDvector3: { string text = array[1].Trim('(', ')'); string[] array3 = text.Split(new char[1] { ',' }); Vector3 param = default(Vector3); float result8; float result9; float result10; if (array3.Length != 3) { Plugin.Log.LogError((object)$"Vector3 Network receive fail (expected 3 numbers, got {array3.Length} number(?)(s) instead). This is a failure of the API, and it should be reported as a bug. (passing an empty Vector3 in its place)"); } else if (float.TryParse(array3[0], out result8) && float.TryParse(array3[1], out result9) && float.TryParse(array3[2], out result10)) { param.x = result8; param.y = result9; param.z = result10; } else { Plugin.Log.LogError((object)("Vector3 Network receive fail (failed to parse '" + text + "' as numbers). This is a failure of the API, and it should be reported as a bug.")); } Networking.GetVector3.InvokeActionSafe(param, array[2]); break; } } _ = LC_APIManager.netTester; return false; } internal static bool ChatCommands(HUDManager __instance, CallbackContext context) { if (__instance.chatTextField.text.ToLower().Contains("/modcheck")) { CheatDatabase.OtherPlayerCheatDetector(); return false; } return true; } } } namespace LC_API.GameInterfaceAPI { public static class GameState { private static readonly Action NothingAction = delegate { }; public static int AlivePlayerCount { get; private set; } public static ShipState ShipState { get; private set; } public static event Action PlayerDied; public static event Action LandOnMoon; public static event Action WentIntoOrbit; public static event Action ShipStartedLeaving; internal static void GSUpdate() { if (!((Object)(object)StartOfRound.Instance == (Object)null)) { if (StartOfRound.Instance.shipHasLanded && ShipState != ShipState.OnMoon) { ShipState = ShipState.OnMoon; GameState.LandOnMoon.InvokeActionSafe(); } if (StartOfRound.Instance.inShipPhase && ShipState != 0) { ShipState = ShipState.InOrbit; GameState.WentIntoOrbit.InvokeActionSafe(); } if (StartOfRound.Instance.shipIsLeaving && ShipState != ShipState.LeavingMoon) { ShipState = ShipState.LeavingMoon; GameState.ShipStartedLeaving.InvokeActionSafe(); } if (AlivePlayerCount < StartOfRound.Instance.livingPlayers) { GameState.PlayerDied.InvokeActionSafe(); } AlivePlayerCount = StartOfRound.Instance.livingPlayers; } } static GameState() { GameState.PlayerDied = NothingAction; GameState.LandOnMoon = NothingAction; GameState.WentIntoOrbit = NothingAction; GameState.ShipStartedLeaving = NothingAction; } } public class GameTips { private static List<string> tipHeaders = new List<string>(); private static List<string> tipBodys = new List<string>(); private static float lastMessageTime; public static void ShowTip(string header, string body) { tipHeaders.Add(header); tipBodys.Add(body); } public static void UpdateInternal() { lastMessageTime -= Time.deltaTime; if ((tipHeaders.Count > 0) & (lastMessageTime < 0f)) { lastMessageTime = 5f; if ((Object)(object)HUDManager.Instance != (Object)null) { HUDManager.Instance.DisplayTip(tipHeaders[0], tipBodys[0], false, false, "LC_Tip1"); } tipHeaders.RemoveAt(0); tipBodys.RemoveAt(0); } } } } namespace LC_API.Extensions { public static class DelegateExtensions { private static readonly PropertyInfo PluginGetLogger = AccessTools.Property(typeof(BaseUnityPlugin), "Logger"); public static void InvokeActionSafe(this Action action) { //IL_009e: Unknown result type (might be due to invalid IL or missing references) if (action == null) { return; } Delegate[] invocationList = action.GetInvocationList(); foreach (Delegate @delegate in invocationList) { try { ((Action)@delegate)(); } catch (Exception ex) { Plugin.Log.LogError((object)"Exception while invoking hook callback!"); string asmName = @delegate.GetMethodInfo().DeclaringType.Assembly.FullName; PluginInfo val = ((IEnumerable<PluginInfo>)Chainloader.PluginInfos.Values).FirstOrDefault((Func<PluginInfo, bool>)((PluginInfo pi) => ((object)pi.Instance).GetType().Assembly.FullName == asmName)); if (val == null) { Plugin.Log.LogError((object)ex.ToString()); break; } ((ManualLogSource)PluginGetLogger.GetValue(val.Instance)).LogError((object)ex.ToString()); } } } public static void InvokeActionSafe<T>(this Action<T> action, T param) { //IL_009f: Unknown result type (might be due to invalid IL or missing references) if (action == null) { return; } Delegate[] invocationList = action.GetInvocationList(); foreach (Delegate @delegate in invocationList) { try { ((Action<T>)@delegate)(param); } catch (Exception ex) { Plugin.Log.LogError((object)"Exception while invoking hook callback!"); string asmName = @delegate.GetMethodInfo().DeclaringType.Assembly.FullName; PluginInfo val = ((IEnumerable<PluginInfo>)Chainloader.PluginInfos.Values).FirstOrDefault((Func<PluginInfo, bool>)((PluginInfo pi) => ((object)pi.Instance).GetType().Assembly.FullName == asmName)); if (val == null) { Plugin.Log.LogError((object)ex.ToString()); break; } ((ManualLogSource)PluginGetLogger.GetValue(val.Instance)).LogError((object)ex.ToString()); } } } public static void InvokeActionSafe<T1, T2>(this Action<T1, T2> action, T1 param1, T2 param2) { //IL_00a0: Unknown result type (might be due to invalid IL or missing references) if (action == null) { return; } Delegate[] invocationList = action.GetInvocationList(); foreach (Delegate @delegate in invocationList) { try { ((Action<T1, T2>)@delegate)(param1, param2); } catch (Exception ex) { Plugin.Log.LogError((object)"Exception while invoking hook callback!"); string asmName = @delegate.GetMethodInfo().DeclaringType.Assembly.FullName; PluginInfo val = ((IEnumerable<PluginInfo>)Chainloader.PluginInfos.Values).FirstOrDefault((Func<PluginInfo, bool>)((PluginInfo pi) => ((object)pi.Instance).GetType().Assembly.FullName == asmName)); if (val == null) { Plugin.Log.LogError((object)ex.ToString()); break; } ((ManualLogSource)PluginGetLogger.GetValue(val.Instance)).LogError((object)ex.ToString()); } } } internal static void InvokeParameterlessDelegate<T>(this T paramlessDelegate) where T : Delegate { //IL_00b9: Unknown result type (might be due to invalid IL or missing references) if ((Delegate?)paramlessDelegate == (Delegate?)null) { return; } Delegate[] invocationList = paramlessDelegate.GetInvocationList(); foreach (Delegate @delegate in invocationList) { try { ((T)@delegate).DynamicInvoke(); } catch (Exception ex) { Plugin.Log.LogError((object)"Exception while invoking hook callback!"); string asmName = @delegate.GetMethodInfo().DeclaringType.Assembly.FullName; PluginInfo val = ((IEnumerable<PluginInfo>)Chainloader.PluginInfos.Values).FirstOrDefault((Func<PluginInfo, bool>)((PluginInfo pi) => ((object)pi.Instance).GetType().Assembly.FullName == asmName)); if (val == null) { Plugin.Log.LogError((object)ex.ToString()); break; } ((ManualLogSource)PluginGetLogger.GetValue(val.Instance)).LogError((object)ex.ToString()); } } } } } namespace LC_API.Data { internal enum NetworkBroadcastDataType { Unknown, BDint, BDfloat, BDvector3, BDstring, BDlistString } public enum ShipState { InOrbit, OnMoon, LeavingMoon } } namespace LC_API.Comp { internal class LC_APIManager : MonoBehaviour { public static MenuManager MenuManager; public static bool netTester; private static int playerCount; private static bool wanttoCheckMods; private static float lobbychecktimer; public void Update() { GameState.GSUpdate(); GameTips.UpdateInternal(); if ((((Object)(object)HUDManager.Instance != (Object)null) & netTester) && (Object)(object)GameNetworkManager.Instance.localPlayerController != (Object)null) { Networking.Broadcast("testerData", "testerSignature"); } if (!ModdedServer.setModdedOnly) { ModdedServer.OnSceneLoaded(); } else if (ModdedServer.ModdedOnly && (Object)(object)MenuManager != (Object)null && Object.op_Implicit((Object)(object)MenuManager.versionNumberText)) { ((TMP_Text)MenuManager.versionNumberText).text = $"v{GameNetworkManager.Instance.gameVersionNum - 16440}\nMOD"; } if ((Object)(object)GameNetworkManager.Instance != (Object)null) { if (playerCount < GameNetworkManager.Instance.connectedPlayers) { lobbychecktimer = -4.5f; wanttoCheckMods = true; } playerCount = GameNetworkManager.Instance.connectedPlayers; } if (lobbychecktimer < 0f) { lobbychecktimer += Time.deltaTime; } else if (wanttoCheckMods && (Object)(object)HUDManager.Instance != (Object)null) { wanttoCheckMods = false; CD(); } } private void CD() { CheatDatabase.OtherPlayerCheatDetector(); } } } namespace LC_API.ClientAPI { public static class CommandHandler { internal static class SubmitChatPatch { private static bool HandleMessage(HUDManager manager) { string text = manager.chatTextField.text; if (!Utility.IsNullOrWhiteSpace(text) && text.StartsWith(commandPrefix.Value)) { string[] array = text.Split(new char[1] { ' ' }); string text2 = array[0].Substring(commandPrefix.Value.Length); if (TryGetCommandHandler(text2, out var handler)) { string[] obj = array.Skip(1).ToArray(); try { handler(obj); } catch (Exception ex) { Plugin.Log.LogError((object)("Error handling command: " + text2)); Plugin.Log.LogError((object)ex); } } manager.localPlayer.isTypingChat = false; manager.chatTextField.text = ""; EventSystem.current.SetSelectedGameObject((GameObject)null); ((Behaviour)manager.typingIndicator).enabled = false; return true; } return false; } internal static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions, ILGenerator generator) { List<CodeInstruction> newInstructions = new List<CodeInstruction>(instructions); Label label = generator.DefineLabel(); newInstructions[newInstructions.Count - 1].labels.Add(label); int index = newInstructions.FindIndex((CodeInstruction i) => i.opcode == OpCodes.Ldfld && (FieldInfo)i.operand == AccessTools.Field(typeof(PlayerControllerB), "isPlayerDead")) - 2; newInstructions.InsertRange(index, (IEnumerable<CodeInstruction>)(object)new CodeInstruction[3] { CodeInstructionExtensions.MoveLabelsFrom(new CodeInstruction(OpCodes.Ldarg_0, (object)null), newInstructions[index]), new CodeInstruction(OpCodes.Call, (object)AccessTools.Method(typeof(SubmitChatPatch), "HandleMessage", (Type[])null, (Type[])null)), new CodeInstruction(OpCodes.Brtrue, (object)label) }); for (int z = 0; z < newInstructions.Count; z++) { yield return newInstructions[z]; } } } internal static ConfigEntry<string> commandPrefix; internal static Dictionary<string, Action<string[]>> CommandHandlers = new Dictionary<string, Action<string[]>>(); internal static Dictionary<string, List<string>> CommandAliases = new Dictionary<string, List<string>>(); public static bool RegisterCommand(string command, Action<string[]> handler) { if (command.Contains(" ") || CommandHandlers.ContainsKey(command)) { return false; } CommandHandlers.Add(command, handler); return true; } public static bool RegisterCommand(string command, List<string> aliases, Action<string[]> handler) { if (command.Contains(" ") || GetCommandHandler(command) != null) { return false; } foreach (string alias in aliases) { if (alias.Contains(" ") || GetCommandHandler(alias) != null) { return false; } } CommandHandlers.Add(command, handler); CommandAliases.Add(command, aliases); return true; } public static bool UnregisterCommand(string command) { CommandAliases.Remove(command); return CommandHandlers.Remove(command); } internal static Action<string[]> GetCommandHandler(string command) { if (CommandHandlers.TryGetValue(command, out var value)) { return value; } foreach (KeyValuePair<string, List<string>> commandAlias in CommandAliases) { if (commandAlias.Value.Contains(command)) { return CommandHandlers[commandAlias.Key]; } } return null; } internal static bool TryGetCommandHandler(string command, out Action<string[]> handler) { handler = GetCommandHandler(command); return handler != null; } } } namespace LC_API.BundleAPI { public static class BundleLoader { [Obsolete("Use OnLoadedBundles instead. This will be removed/private in a future update.")] public delegate void OnLoadedAssetsDelegate(); [Obsolete("Use GetLoadedAsset instead. This will be removed/private in a future update.")] public static ConcurrentDictionary<string, Object> assets = new ConcurrentDictionary<string, Object>(); [Obsolete("Use OnLoadedBundles instead. This will be removed/private in a future update.")] public static OnLoadedAssetsDelegate OnLoadedAssets = LoadAssetsCompleted; public static bool AssetsInLegacyDirectory { get; private set; } public static bool LegacyLoadingEnabled { get; private set; } public static event Action OnLoadedBundles; internal static void Load(bool legacyLoading) { LegacyLoadingEnabled = legacyLoading; Plugin.Log.LogMessage((object)"BundleAPI will now load all asset bundles..."); string path = Path.Combine(Paths.BepInExRootPath, "Bundles"); if (!Directory.Exists(path)) { Directory.CreateDirectory(path); Plugin.Log.LogMessage((object)"BundleAPI Created legacy bundle directory in BepInEx/Bundles"); } string[] array = (from x in Directory.GetFiles(path, "*", SearchOption.AllDirectories) where !x.EndsWith(".manifest", StringComparison.CurrentCultureIgnoreCase) select x).ToArray(); AssetsInLegacyDirectory = array.Length != 0; if (!AssetsInLegacyDirectory) { Plugin.Log.LogMessage((object)"BundleAPI got no assets to load from legacy directory"); } if (AssetsInLegacyDirectory) { Plugin.Log.LogWarning((object)"The path BepInEx > Bundles is outdated and should not be used anymore! Bundles will be loaded from BepInEx > plugins from now on"); LoadAllAssetsFromDirectory(array, legacyLoading); } string[] invalidEndings = new string[8] { ".dll", ".json", ".png", ".md", ".old", ".txt", ".exe", ".lem" }; path = Path.Combine(Paths.BepInExRootPath, "plugins"); array = (from file in Directory.GetFiles(path, "*", SearchOption.AllDirectories) where !invalidEndings.Any((string ending) => file.EndsWith(ending, StringComparison.CurrentCultureIgnoreCase)) select file).ToArray(); byte[] bytes = Encoding.ASCII.GetBytes("UnityFS"); List<string> list = new List<string>(); string[] array2 = array; foreach (string text in array2) { byte[] array3 = new byte[bytes.Length]; using (FileStream fileStream = File.Open(text, FileMode.Open)) { fileStream.Read(array3, 0, array3.Length); } if (array3.SequenceEqual(bytes)) { list.Add(text); } } array = list.ToArray(); if (array.Length == 0) { Plugin.Log.LogMessage((object)"BundleAPI got no assets to load from plugins folder"); } else { LoadAllAssetsFromDirectory(array, legacyLoading); } OnLoadedAssets.InvokeParameterlessDelegate(); BundleLoader.OnLoadedBundles.InvokeActionSafe(); } private static void LoadAllAssetsFromDirectory(string[] array, bool legacyLoading) { if (legacyLoading) { Plugin.Log.LogMessage((object)("BundleAPI got " + array.Length + " AssetBundles to load!")); for (int i = 0; i < array.Length; i++) { try { SaveAsset(array[i], legacyLoading); } catch (Exception) { Plugin.Log.LogError((object)("Failed to load an assetbundle! Path: " + array[i])); } } return; } Plugin.Log.LogMessage((object)("BundleAPI got " + array.Length + " AssetBundles to load!")); for (int j = 0; j < array.Length; j++) { try { SaveAsset(array[j], legacyLoading); } catch (Exception) { Plugin.Log.LogError((object)("Failed to load an assetbundle! Path: " + array[j])); } } } public static void SaveAsset(string path, bool legacyLoad) { AssetBundle val = AssetBundle.LoadFromFile(path); try { string[] allAssetNames = val.GetAllAssetNames(); foreach (string text in allAssetNames) { Plugin.Log.LogMessage((object)("Got asset for load: " + text)); Object val2 = val.LoadAsset(text); if (val2 == (Object)null) { Plugin.Log.LogWarning((object)$"Skipped/failed loading an asset (from bundle '{((Object)val).name}') - Asset path: {val2}"); continue; } string key = (legacyLoad ? text.ToUpper() : text.ToLower()); if (assets.ContainsKey(key)) { Plugin.Log.LogError((object)"BundleAPI got duplicate asset!"); break; } assets.TryAdd(key, val2); Plugin.Log.LogMessage((object)("Loaded asset: " + val2.name)); } } finally { if (val != null) { val.Unload(false); } } } public static TAsset GetLoadedAsset<TAsset>(string itemPath) where TAsset : Object { Object value = null; if (LegacyLoadingEnabled) { assets.TryGetValue(itemPath.ToUpper(), out value); } if (value == (Object)null) { assets.TryGetValue(itemPath.ToLower(), out value); } return (TAsset)(object)value; } private static void LoadAssetsCompleted() { Plugin.Log.LogMessage((object)"BundleAPI finished loading all assets."); } static BundleLoader() { BundleLoader.OnLoadedBundles = LoadAssetsCompleted; } } }
BepInEx/plugins/5Bit-FPSSpectate/FPSSpectate.dll
Decompiled a year agousing System; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Logging; using GameNetcodeStuff; using HarmonyLib; using Microsoft.CodeAnalysis; using UnityEngine; using UnityEngine.InputSystem; using UnityEngine.InputSystem.Controls; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("FPSSpectate")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyDescription("FPS spectate camera")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+ada41809ef3e18d1ac6f547212c170f1debd12d4")] [assembly: AssemblyProduct("FPSSpectate")] [assembly: AssemblyTitle("FPSSpectate")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.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; } } } namespace FPSSpectate { [BepInPlugin("5Bit.FPSSpectate", "FPSSpectate", "1.0.0")] public class FPSSpectate : BaseUnityPlugin { private const string modGUID = "5Bit.FPSSpectate"; private const string modName = "FPSSpectate"; private const string modVersion = "1.0.0"; private readonly Harmony harmony = new Harmony("5Bit.FPSSpectate"); private static FPSSpectate Instance; internal static ManualLogSource mls; private void Awake() { if ((Object)(object)Instance == (Object)null) { Instance = this; } mls = Logger.CreateLogSource("5Bit.FPSSpectate"); harmony.PatchAll(); } } public static class PluginInfo { public const string PLUGIN_GUID = "FPSSpectate"; public const string PLUGIN_NAME = "FPSSpectate"; public const string PLUGIN_VERSION = "1.0.0"; } } namespace FPSSpectate.Patches { [HarmonyPatch(typeof(PlayerControllerB))] internal class FPSSpectatePatch { private const float SPECTATE_OFFSET = 1.5f; private static bool firstPerson = true; private static bool debounced = false; [HarmonyPatch("LateUpdate")] [HarmonyPostfix] private static void LateUpdate(PlayerControllerB __instance) { //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: 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_00ba: Unknown result type (might be due to invalid IL or missing references) if (((ButtonControl)Keyboard.current.vKey).wasPressedThisFrame && !debounced) { firstPerson = !firstPerson; debounced = true; } if (((ButtonControl)Keyboard.current.vKey).wasReleasedThisFrame) { debounced = false; } if ((Object)(object)__instance.spectatedPlayerScript != (Object)null && firstPerson) { Transform transform = ((Component)__instance.spectateCameraPivot).transform; Transform transform2 = ((Component)__instance.spectatedPlayerScript.visorCamera).transform; Vector3 position = transform2.position; Vector3 forward = transform2.forward; transform.position = position + ((Vector3)(ref forward)).normalized * 1.5f; transform.rotation = transform2.rotation; } } } }
BepInEx/plugins/5Bit-VoiceHUD/VoiceHUD.dll
Decompiled a year agousing System; using System.Diagnostics; using System.IO; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using Dissonance; using HarmonyLib; using Microsoft.CodeAnalysis; using UnityEngine; using UnityEngine.UI; using VoiceHUD.Configuration; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("VoiceHUD")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyDescription("Displays push-to-talk icon on voice activation")] [assembly: AssemblyFileVersion("1.0.1.0")] [assembly: AssemblyInformationalVersion("1.0.1+f1e0a0cfa0a629002418c9e0aa3a753676e33192")] [assembly: AssemblyProduct("VoiceHUD")] [assembly: AssemblyTitle("VoiceHUD")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.1.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; } } } namespace VoiceHUD { [BepInPlugin("5Bit.VoiceHUD", "VoiceHUD", "1.0.4")] public class VoiceHUD : BaseUnityPlugin { private const string modGUID = "5Bit.VoiceHUD"; private const string modName = "VoiceHUD"; private const string modVersion = "1.0.4"; private readonly Harmony harmony = new Harmony("5Bit.VoiceHUD"); private static VoiceHUD Instance; internal static ManualLogSource mls; private void Awake() { if ((Object)(object)Instance == (Object)null) { Instance = this; } mls = Logger.CreateLogSource("5Bit.VoiceHUD"); Config.Init(); harmony.PatchAll(); } } public static class PluginInfo { public const string PLUGIN_GUID = "VoiceHUD"; public const string PLUGIN_NAME = "VoiceHUD"; public const string PLUGIN_VERSION = "1.0.1"; } } namespace VoiceHUD.Patches { [HarmonyPatch(typeof(HUDManager))] internal class VoiceHUDPatch { private static Color Start = new Color(0f, 255f, 0f, 255f); private static Color Center = new Color(165f, 255f, 0f, 255f); private static Color End = new Color(255f, 0f, 0f, 255f); [HarmonyPatch("Update")] [HarmonyPostfix] private static void Update() { //IL_00ab: Unknown result type (might be due to invalid IL or missing references) if (!IngamePlayerSettings.Instance.settings.micEnabled || IngamePlayerSettings.Instance.settings.pushToTalk || (Object)(object)StartOfRound.Instance.voiceChatModule == (Object)null) { return; } VoicePlayerState val = StartOfRound.Instance.voiceChatModule.FindPlayer(StartOfRound.Instance.voiceChatModule.LocalPlayerName); if (val.IsSpeaking) { float num = Mathf.Clamp(val.Amplitude * 35f, 0f, 1f); if (Config.ColorsEnabled) { ((Graphic)HUDManager.Instance.PTTIcon).color = GetColorByVolume(num * 100f); } ((Behaviour)HUDManager.Instance.PTTIcon).enabled = num > 0.01f; } } public static Color GetColorByVolume(float volume) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: 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_0028: 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) if (volume < 20f) { return Start; } if (volume > 70f) { return End; } return Center; } } } namespace VoiceHUD.Configuration { internal static class Config { private const string CONFIG_FILE_NAME = "VoiceHUD.cfg"; private static ConfigFile config; private static ConfigEntry<bool> colorsEnabled; public static bool ColorsEnabled => colorsEnabled.Value; public static void Init() { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Expected O, but got Unknown string text = Path.Combine(Paths.ConfigPath, "VoiceHUD.cfg"); config = new ConfigFile(text, true); colorsEnabled = config.Bind<bool>("Config", "Colors enabled", false, "Change icon color based on volume."); } } }
BepInEx/plugins/alexanderjoe-LC_Symphony/LCSymphony.dll
Decompiled a year agousing System.Collections; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using BepInEx.Configuration; using HarmonyLib; using LCSymphony.Patches; using Steamworks; using TMPro; using Unity.Netcode; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: AssemblyTitle("LCSymphony")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("LCSymphony")] [assembly: AssemblyCopyright("Copyright © 2023")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("047A9A10-3A21-461E-A7A5-DD6CA798B0A3")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")] [assembly: AssemblyVersion("1.0.0.0")] namespace LCSymphony { public static class ConfigSettings { public static ConfigEntry<bool> PingEnabled { get; set; } public static void Init() { PingEnabled = ((BaseUnityPlugin)Plugin.Instance).Config.Bind<bool>("Ping Management", "PingEnabled", true, "Enable or disable the ping display in the top right corner."); } } public class PingManager : MonoBehaviour { private Coroutine _coroutine; public int Ping { get; private set; } private void Start() { if (ConfigSettings.PingEnabled.Value) { _coroutine = ((MonoBehaviour)this).StartCoroutine(UpdatePingData()); } } private void OnDestroy() { ((MonoBehaviour)this).StopCoroutine(_coroutine); } private IEnumerator UpdatePingData() { while (true) { yield return (object)new WaitForSeconds(0.5f); if (GameNetworkManager.Instance.currentLobby.HasValue || !SteamNetworkingUtils.LocalPingLocation.HasValue) { if (SteamNetworkingUtils.LocalPingLocation.HasValue) { Ping = SteamNetworkingUtils.EstimatePingTo(SteamNetworkingUtils.LocalPingLocation.Value); } } else { Plugin.Log("Could not update ping data. Retrying in 5 seconds."); yield return (object)new WaitForSeconds(5f); } } } } [BepInPlugin("dev.alexanderdiaz.lcsymphony", "LC Symphony", "1.1.0")] public class Plugin : BaseUnityPlugin { private const string ModGuid = "dev.alexanderdiaz.lcsymphony"; private const string ModName = "LC Symphony"; private const string ModVersion = "1.1.0"; private readonly Harmony _harmony = new Harmony("dev.alexanderdiaz.lcsymphony"); public static Plugin Instance; public static PingManager PingManager; public void Awake() { if ((Object)(object)Instance == (Object)null) { Instance = this; } ConfigSettings.Init(); _harmony.PatchAll(typeof(SkipToStartPatch)); if (ConfigSettings.PingEnabled.Value) { _harmony.PatchAll(typeof(HudManagerPatch)); } InitPingManager(); ((BaseUnityPlugin)this).Logger.LogInfo((object)"Plugin LC Symphony-1.1.0 loaded!"); } private void InitPingManager() { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Expected O, but got Unknown //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("PingManager"); Object.DontDestroyOnLoad((Object)val); ((Object)val).hideFlags = (HideFlags)61; val.AddComponent<PingManager>(); PingManager = val.GetComponent<PingManager>(); } public static void Log(string message) { ((BaseUnityPlugin)Instance).Logger.LogInfo((object)message); } } public class PluginInfo { public const string PLUGIN_GUID = "dev.alexanderdiaz.lcsymphony"; public const string PLUGIN_NAME = "LC Symphony"; public const string PLUGIN_VERSION = "1.1.0"; } } namespace LCSymphony.Patches { [HarmonyPatch(typeof(HUDManager))] internal class HudManagerPatch { private static TextMeshProUGUI _displayText; [HarmonyPatch("Start")] [HarmonyPostfix] private static void PatchHudManagerStart(ref HUDManager __instance) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("PingManagerDisplay"); val.AddComponent<RectTransform>(); TextMeshProUGUI obj = val.AddComponent<TextMeshProUGUI>(); RectTransform rectTransform = ((TMP_Text)obj).rectTransform; ((Transform)rectTransform).SetParent(((TMP_Text)__instance.debugText).transform.parent.parent.parent, false); ((Transform)rectTransform).parent = ((Transform)((TMP_Text)__instance.debugText).rectTransform).parent.parent.parent; rectTransform.anchorMin = new Vector2(1f, 1f); rectTransform.anchorMax = new Vector2(1f, 1f); rectTransform.pivot = new Vector2(1f, 1f); rectTransform.sizeDelta = new Vector2(100f, 100f); rectTransform.anchoredPosition = new Vector2(50f, -1f); ((TMP_Text)obj).font = ((TMP_Text)__instance.controlTipLines[0]).font; ((TMP_Text)obj).fontSize = 7f; ((TMP_Text)obj).text = $"Ping: {Plugin.PingManager.Ping}ms"; ((TMP_Text)obj).overflowMode = (TextOverflowModes)0; ((Behaviour)obj).enabled = true; _displayText = obj; Plugin.Log("PingManagerDisplay component added to Canvas."); } [HarmonyPatch("Update")] [HarmonyPostfix] private static void PatchHudManagerUpdate(ref HUDManager __instance) { if (((NetworkBehaviour)__instance).NetworkManager.IsHost) { ((TMP_Text)_displayText).text = "Ping: Host"; } else { ((TMP_Text)_displayText).text = $"Ping: {Plugin.PingManager.Ping}ms"; } } } internal class SkipToStartPatch { [HarmonyPatch(typeof(PreInitSceneScript), "Start")] [HarmonyPostfix] private static void chooseOnlineDefaultPatch(ref PreInitSceneScript __instance) { Plugin.Log("Skipping online mode selection."); __instance.ChooseLaunchOption(true); } [HarmonyPatch(typeof(InitializeGame), "Awake")] [HarmonyPostfix] private static void Test(ref InitializeGame __instance) { Plugin.Log("Skipping boot-up screen."); __instance.runBootUpScreen = false; } } }
BepInEx/plugins/AllToasters-SpectateEnemies/SpectateEnemy.dll
Decompiled a year agousing System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Configuration; using GameNetcodeStuff; using HarmonyLib; using Microsoft.CodeAnalysis; using TMPro; using Unity.Netcode; using UnityEngine; using UnityEngine.InputSystem; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("SpectateEnemy")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyDescription("My first plugin")] [assembly: AssemblyFileVersion("1.5.0.0")] [assembly: AssemblyInformationalVersion("1.5.0+fedd7299567cd8f4569b5f35b2cc9b6f25f17c2f")] [assembly: AssemblyProduct("SpectateEnemy")] [assembly: AssemblyTitle("SpectateEnemy")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.5.0.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; } } } namespace SpectateEnemy { [BepInPlugin("SpectateEnemy", "SpectateEnemy", "1.5.0")] public class Plugin : BaseUnityPlugin { public static int spectatedEnemyIndex = -1; public static bool spectatingEnemies = false; public static MethodInfo raycastSpectate = null; public static MethodInfo displaySpectatorTip = null; private ConfigEntry<bool> spectateTurrets; private ConfigEntry<bool> spectateLandmines; private ConfigEntry<bool> spectatePassives; public static bool doSpectateTurrets; public static bool doSpectateLandmines; public static bool doSpectatePassives; private Harmony harmony; private void Awake() { //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Expected O, but got Unknown spectateTurrets = ((BaseUnityPlugin)this).Config.Bind<bool>("Config", "Spectate Turrets", false, "Enables spectating turrets."); doSpectateTurrets = spectateTurrets.Value; spectateLandmines = ((BaseUnityPlugin)this).Config.Bind<bool>("Config", "Spectate Landmines", false, "Enables spectating landmines."); doSpectateLandmines = spectateLandmines.Value; spectatePassives = ((BaseUnityPlugin)this).Config.Bind<bool>("Config", "Spectate Passives", false, "Enables spectating passive enemies, such as Docile Locust Bees and Manticoils."); doSpectatePassives = spectatePassives.Value; harmony = new Harmony("SpectateEnemy"); harmony.PatchAll(); raycastSpectate = AccessTools.Method(typeof(PlayerControllerB), "RaycastSpectateCameraAroundPivot", (Type[])null, (Type[])null); displaySpectatorTip = AccessTools.Method(typeof(HUDManager), "DisplaySpectatorTip", (Type[])null, (Type[])null); ((BaseUnityPlugin)this).Logger.LogInfo((object)"SpectateEnemy loaded!"); } } public class Spectatable : MonoBehaviour { public SpectatableType type = SpectatableType.Enemy; public string enemyName = "Enemy"; } public enum SpectatableType { Enemy, Turret, Landmine } public static class MyPluginInfo { public const string PLUGIN_GUID = "SpectateEnemy"; public const string PLUGIN_NAME = "SpectateEnemy"; public const string PLUGIN_VERSION = "1.5.0"; } } namespace SpectateEnemy.Patches { [HarmonyPatch(typeof(EnemyAI), "Start")] public class EnemyAI_Patches { private static void Postfix(EnemyAI __instance) { if (Plugin.doSpectatePassives || (!(__instance.enemyType.enemyName == "Docile Locust Bees") && !(__instance.enemyType.enemyName == "Manticoil"))) { Spectatable spectatable = ((Component)__instance).gameObject.AddComponent<Spectatable>(); spectatable.enemyName = __instance.enemyType.enemyName; } } } [HarmonyPatch(typeof(GameNetworkManager), "Disconnect")] public class GameNetworkManager_Patches { private static void Postfix() { Plugin.spectatedEnemyIndex = -1; Plugin.spectatingEnemies = false; } } [HarmonyPatch(typeof(HUDManager), "Update")] public class HUDManager_Patches { private static void Postfix(HUDManager __instance) { //IL_005a: 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_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_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) if (!GameNetworkManager.Instance.localPlayerController.isPlayerDead) { return; } if (StartOfRound.Instance.shipIsLeaving) { Light component = ((Component)__instance.playersManager.spectateCamera).GetComponent<Light>(); if ((Object)(object)component != (Object)null) { ((Behaviour)component).enabled = false; } return; } MovementActions movement = __instance.playerActions.Movement; InputBinding val = ((MovementActions)(ref movement)).Interact.bindings[0]; string text = InputControlPath.ToHumanReadableString(((InputBinding)(ref val)).effectivePath, (HumanReadableStringOptions)2, (InputControl)null); TextMeshProUGUI holdButtonToEndGameEarlyText = __instance.holdButtonToEndGameEarlyText; ((TMP_Text)holdButtonToEndGameEarlyText).text = ((TMP_Text)holdButtonToEndGameEarlyText).text + "\n\n\n\n\nSwitch to " + (Plugin.spectatingEnemies ? "Players" : "Enemies") + ": [" + text + "]\nToggle Flashlight : [RMB] (Click)"; movement = __instance.playerActions.Movement; if (((MovementActions)(ref movement)).PingScan.WasReleasedThisFrame()) { Light component2 = ((Component)__instance.playersManager.spectateCamera).GetComponent<Light>(); if ((Object)(object)component2 != (Object)null) { ((Behaviour)component2).enabled = !((Behaviour)component2).enabled; } } } } [HarmonyPatch(typeof(Landmine), "Start")] public class Landmine_Patches { private static void Postfix(Landmine __instance) { if (Plugin.doSpectateLandmines) { Spectatable spectatable = ((Component)__instance).gameObject.AddComponent<Spectatable>(); spectatable.type = SpectatableType.Landmine; spectatable.enemyName = "Landmine"; } } } [HarmonyPatch(typeof(MaskedPlayerEnemy), "Start")] public class MaskedPlayerEnemy_Patches { private static void Postfix(MaskedPlayerEnemy __instance) { Spectatable spectatable = ((Component)__instance).gameObject.AddComponent<Spectatable>(); if ((Object)(object)__instance.mimickingPlayer != (Object)null) { spectatable.enemyName = __instance.mimickingPlayer.playerUsername; } else { spectatable.enemyName = ((EnemyAI)__instance).enemyType.enemyName; } } } internal class Handler { public static Spectatable[] spectatorList; public static bool Spectate() { if (Plugin.spectatingEnemies) { if (spectatorList.Length == 0) { Plugin.spectatingEnemies = false; return true; } Plugin.spectatedEnemyIndex++; if (Plugin.spectatedEnemyIndex >= spectatorList.Length) { Plugin.spectatedEnemyIndex = 0; } return false; } return true; } } [HarmonyPatch(typeof(PlayerControllerB), "Interact_performed")] public class PlayerControllerB_Interact { private static bool Prefix(PlayerControllerB __instance) { //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) if (((NetworkBehaviour)__instance).IsOwner && __instance.isPlayerDead && !StartOfRound.Instance.shipIsLeaving && (!((NetworkBehaviour)__instance).IsServer || __instance.isHostPlayerObject)) { Plugin.spectatingEnemies = !Plugin.spectatingEnemies; if (Plugin.spectatingEnemies) { Handler.spectatorList = Object.FindObjectsByType<Spectatable>((FindObjectsSortMode)0); if (Handler.spectatorList.Length == 0) { Plugin.spectatingEnemies = false; Plugin.displaySpectatorTip.Invoke(HUDManager.Instance, new object[1] { "No enemies to spectate" }); return false; } if (Plugin.spectatedEnemyIndex == -1 || Plugin.spectatedEnemyIndex >= Handler.spectatorList.Length) { if ((Object)(object)__instance.spectatedPlayerScript == (Object)null) { Plugin.spectatedEnemyIndex = 0; } else { float num = 999999f; int spectatedEnemyIndex = 0; for (int i = 0; i < Handler.spectatorList.Length; i++) { Vector3 val = ((Component)Handler.spectatorList[i]).transform.position - ((Component)__instance.spectatedPlayerScript).transform.position; float sqrMagnitude = ((Vector3)(ref val)).sqrMagnitude; if (sqrMagnitude < num * num) { num = sqrMagnitude; spectatedEnemyIndex = i; } } Plugin.spectatedEnemyIndex = spectatedEnemyIndex; } } __instance.spectatedPlayerScript = null; } else { __instance.spectatedPlayerScript = ((IEnumerable<PlayerControllerB>)__instance.playersManager.allPlayerScripts).FirstOrDefault((Func<PlayerControllerB, bool>)((PlayerControllerB x) => !x.isPlayerDead)); } } return true; } } [HarmonyPatch(typeof(PlayerControllerB), "ActivateItem_performed")] public class PlayerControllerB_Use { private static bool Prefix(PlayerControllerB __instance) { if (((NetworkBehaviour)__instance).IsOwner && __instance.isPlayerDead && !StartOfRound.Instance.shipIsLeaving && (!((NetworkBehaviour)__instance).IsServer || __instance.isHostPlayerObject)) { return Handler.Spectate(); } return true; } } [HarmonyPatch(typeof(PlayerControllerB), "LateUpdate")] public class PlayerControllerB_LateUpdate { private static void Postfix(PlayerControllerB __instance) { //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) if (!Plugin.spectatingEnemies) { return; } if (Handler.spectatorList.Length == 0) { Plugin.spectatingEnemies = false; return; } if (Plugin.spectatedEnemyIndex >= Handler.spectatorList.Length) { Plugin.spectatedEnemyIndex = 0; } Spectatable obj = Handler.spectatorList[Plugin.spectatedEnemyIndex]; if ((Object)(object)obj == (Object)null) { Plugin.spectatedEnemyIndex++; if (Plugin.spectatedEnemyIndex >= Handler.spectatorList.Length) { Plugin.spectatedEnemyIndex = 0; } return; } Vector3? spectatePosition = GetSpectatePosition(obj); if (!spectatePosition.HasValue) { Plugin.spectatedEnemyIndex++; if (Plugin.spectatedEnemyIndex >= Handler.spectatorList.Length) { Plugin.spectatedEnemyIndex = 0; } return; } if (obj.enemyName == "Enemy") { TryFixName(ref obj); } __instance.spectateCameraPivot.position = spectatePosition.Value + GetZoomDistance(obj); ((TMP_Text)HUDManager.Instance.spectatingPlayerText).text = "(Spectating: " + obj.enemyName + ")"; Plugin.raycastSpectate.Invoke(__instance, Array.Empty<object>()); } private static void TryFixName(ref Spectatable obj) { EnemyAI val = default(EnemyAI); Turret val2 = default(Turret); Landmine val3 = default(Landmine); if (((Component)obj).gameObject.TryGetComponent<EnemyAI>(ref val)) { obj.enemyName = val.enemyType.enemyName; } else if (((Component)obj).gameObject.TryGetComponent<Turret>(ref val2)) { obj.enemyName = "Turret"; } else if (((Component)obj).gameObject.TryGetComponent<Landmine>(ref val3)) { obj.enemyName = "Landmine"; } } private static Vector3 GetZoomDistance(Spectatable obj) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0062: 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_0050: Unknown result type (might be due to invalid IL or missing references) //IL_005a: 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) if (obj.enemyName == "ForestGiant") { return Vector3.up * 3f; } if (obj.enemyName == "MouthDog" || obj.enemyName == "Jester") { return Vector3.up * 2f; } return Vector3.up; } private static Vector3? GetSpectatePosition(Spectatable obj) { //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_008c: 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_0036: Unknown result type (might be due to invalid IL or missing references) if (obj.type == SpectatableType.Enemy) { EnemyAI component = ((Component)obj).GetComponent<EnemyAI>(); if ((Object)(object)component != (Object)null) { return ((Object)(object)component.eye == (Object)null) ? ((Component)component).transform.position : component.eye.position; } } else if (obj.type == SpectatableType.Turret) { Turret component2 = ((Component)obj).GetComponent<Turret>(); if ((Object)(object)component2 != (Object)null) { return ((Component)component2.centerPoint).transform.position; } } else { if (obj.type == SpectatableType.Landmine) { return ((Component)obj).transform.position; } Debug.LogError((object)("[SpectateEnemy]: Error when spectating: no handler for SpectatableType " + obj.type)); } return null; } } [HarmonyPatch(typeof(PlayerControllerB), "SpectateNextPlayer")] public class PlayerControllerB_SpectateNext { private static bool Prefix() { return !Plugin.spectatingEnemies; } } [HarmonyPatch(typeof(StartOfRound), "ShipLeave")] public class StartOfRound_Patches { private static void Postfix() { Plugin.spectatedEnemyIndex = -1; Plugin.spectatingEnemies = false; } } [HarmonyPatch(typeof(Turret), "Start")] public class Turret_Patches { private static void Postfix(Turret __instance) { if (Plugin.doSpectateTurrets) { Spectatable spectatable = ((Component)__instance).gameObject.AddComponent<Spectatable>(); spectatable.type = SpectatableType.Turret; spectatable.enemyName = "Turret"; } } } }
BepInEx/plugins/anormaltwig-LateCompany/LateCompanyV1.0.6.dll
Decompiled a year agousing System; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using GameNetcodeStuff; using HarmonyLib; using Microsoft.CodeAnalysis; using Unity.Netcode; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETFramework,Version=v4.6", FrameworkDisplayName = ".NET Framework 4.6")] [assembly: AssemblyCompany("LateCompany")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+31dbb98cfa5670c23f3ffb21c05582c54159b82d")] [assembly: AssemblyProduct("LateCompany")] [assembly: AssemblyTitle("LateCompany")] [assembly: AssemblyVersion("1.0.0.0")] [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; } } } namespace LateCompany { public static class PluginInfo { public const string GUID = "twig.latecompany"; public const string PrintName = "Late Company"; public const string Version = "1.0.6"; } [BepInPlugin("twig.latecompany", "Late Company", "1.0.6")] internal class Plugin : BaseUnityPlugin { private ConfigEntry<bool> configLateJoinOrbitOnly; public static bool OnlyLateJoinInOrbit = false; public static bool LobbyJoinable = true; public void Awake() { //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Expected O, but got Unknown configLateJoinOrbitOnly = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "Late join orbit only", true, "Don't allow joining while the ship is not in orbit."); OnlyLateJoinInOrbit = configLateJoinOrbitOnly.Value; Harmony val = new Harmony("twig.latecompany"); val.PatchAll(typeof(Plugin).Assembly); ((BaseUnityPlugin)this).Logger.Log((LogLevel)16, (object)"Late Company loaded!"); } public static void SetLobbyJoinable(bool joinable) { LobbyJoinable = joinable; GameNetworkManager.Instance.SetLobbyJoinable(joinable); QuickMenuManager val = Object.FindObjectOfType<QuickMenuManager>(); if (Object.op_Implicit((Object)(object)val)) { val.inviteFriendsTextAlpha.alpha = (joinable ? 1f : 0.2f); } } } } namespace LateCompany.Patches { [HarmonyPatch(typeof(GameNetworkManager), "LeaveLobbyAtGameStart")] [HarmonyWrapSafe] internal static class LeaveLobbyAtGameStart_Patch { [HarmonyPrefix] private static bool Prefix() { return false; } } [HarmonyPatch(typeof(GameNetworkManager), "ConnectionApproval")] [HarmonyWrapSafe] internal static class ConnectionApproval_Patch { [HarmonyPostfix] private static void Postfix(ConnectionApprovalRequest request, ConnectionApprovalResponse response) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) if (request.ClientNetworkId != NetworkManager.Singleton.LocalClientId && response.Reason.Contains("Game has already started") && Plugin.LobbyJoinable) { response.Reason = ""; response.CreatePlayerObject = false; response.Approved = true; response.Pending = false; } } } [HarmonyPatch(typeof(QuickMenuManager), "DisableInviteFriendsButton")] [HarmonyWrapSafe] internal static class DisableInviteFriendsButton_Patch { [HarmonyPrefix] private static bool Prefix() { return false; } } [HarmonyPatch(typeof(QuickMenuManager), "InviteFriendsButton")] [HarmonyWrapSafe] internal static class InviteFriendsButton_Patch { [HarmonyPrefix] private static bool Prefix() { if (Plugin.LobbyJoinable) { GameNetworkManager.Instance.InviteFriendsUI(); } return false; } } internal class RpcEnum : NetworkBehaviour { public static int None => 0; public static int Client => 2; public static int Server => 1; } internal static class WeatherSync { public static bool DoOverride = false; public static LevelWeatherType CurrentWeather = (LevelWeatherType)(-1); } [HarmonyPatch(typeof(RoundManager), "__rpc_handler_1193916134")] [HarmonyWrapSafe] internal static class __rpc_handler_1193916134_Patch { public static FieldInfo RPCExecStage = typeof(NetworkBehaviour).GetField("__rpc_exec_stage", BindingFlags.Instance | BindingFlags.NonPublic); [HarmonyPrefix] private static bool Prefix(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; try { int num = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref num); int num2 = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref num2); int num3 = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref num3); WeatherSync.DoOverride = true; WeatherSync.CurrentWeather = (LevelWeatherType)num3; RPCExecStage.SetValue(target, RpcEnum.Client); ((RoundManager)((target is RoundManager) ? target : null)).GenerateNewLevelClientRpc(num, num2); RPCExecStage.SetValue(target, RpcEnum.None); } catch { ((FastBufferReader)(ref reader)).Seek(0); return true; } return false; } } [HarmonyPatch(typeof(RoundManager), "SetToCurrentLevelWeather")] [HarmonyWrapSafe] internal static class SetToCurrentLevelWeather_Patch { [HarmonyPrefix] private static bool Prefix() { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) if (!WeatherSync.DoOverride) { return true; } WeatherSync.DoOverride = false; TimeOfDay.Instance.currentLevelWeather = WeatherSync.CurrentWeather; return false; } } [HarmonyPatch(typeof(StartOfRound), "OnPlayerConnectedClientRpc")] [HarmonyWrapSafe] internal class OnPlayerConnectedClientRpc_Patch { public static MethodInfo BeginSendClientRpc = typeof(RoundManager).GetMethod("__beginSendClientRpc", BindingFlags.Instance | BindingFlags.NonPublic); public static MethodInfo EndSendClientRpc = typeof(RoundManager).GetMethod("__endSendClientRpc", BindingFlags.Instance | BindingFlags.NonPublic); [HarmonyPostfix] private static void Postfix(ulong clientId, int connectedPlayers, ulong[] connectedPlayerIdsOrdered, int assignedPlayerObjectId, int serverMoneyAmount, int levelID, int profitQuota, int timeUntilDeadline, int quotaFulfilled, int randomSeed) { //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0070: 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_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0093: 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_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: 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_00e1: 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) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0117: 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) //IL_0163: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_017e: Unknown result type (might be due to invalid IL or missing references) //IL_018f: Unknown result type (might be due to invalid IL or missing references) //IL_01a6: Unknown result type (might be due to invalid IL or missing references) StartOfRound instance = StartOfRound.Instance; PlayerControllerB val = instance.allPlayerScripts[assignedPlayerObjectId]; if (instance.connectedPlayersAmount + 1 >= instance.allPlayerScripts.Length) { Plugin.SetLobbyJoinable(joinable: false); } val.DisablePlayerModel(instance.allPlayerObjects[assignedPlayerObjectId], true, true); if (((NetworkBehaviour)instance).IsServer && !instance.inShipPhase) { RoundManager instance2 = RoundManager.Instance; ClientRpcParams val2 = default(ClientRpcParams); val2.Send = new ClientRpcSendParams { TargetClientIds = new List<ulong> { clientId } }; ClientRpcParams val3 = val2; FastBufferWriter val4 = (FastBufferWriter)BeginSendClientRpc.Invoke(instance2, new object[3] { 1193916134u, val3, 0 }); BytePacker.WriteValueBitPacked(val4, StartOfRound.Instance.randomMapSeed); BytePacker.WriteValueBitPacked(val4, StartOfRound.Instance.currentLevelID); BytePacker.WriteValueBitPacked(val4, (short)instance2.currentLevel.currentWeather); EndSendClientRpc.Invoke(instance2, new object[4] { val4, 1193916134u, val3, 0 }); FastBufferWriter val5 = (FastBufferWriter)BeginSendClientRpc.Invoke(instance2, new object[3] { 2729232387u, val3, 0 }); EndSendClientRpc.Invoke(instance2, new object[4] { val5, 2729232387u, val3, 0 }); } instance.livingPlayers = instance.connectedPlayersAmount + 1; for (int i = 0; i < instance.allPlayerScripts.Length; i++) { PlayerControllerB val6 = instance.allPlayerScripts[i]; if (val6.isPlayerControlled && val6.isPlayerDead) { instance.livingPlayers--; } } } } [HarmonyPatch(typeof(StartOfRound), "OnPlayerDC")] [HarmonyWrapSafe] internal class OnPlayerDC_Patch { [HarmonyPostfix] public static void Postfix() { if (StartOfRound.Instance.inShipPhase || !Plugin.OnlyLateJoinInOrbit) { Plugin.SetLobbyJoinable(joinable: true); } } } [HarmonyPatch(typeof(StartOfRound), "StartGame")] [HarmonyWrapSafe] internal class StartGame_Patch { [HarmonyPrefix] public static void Prefix() { if (Plugin.OnlyLateJoinInOrbit) { Plugin.SetLobbyJoinable(joinable: false); } } } [HarmonyPatch(typeof(StartOfRound), "SetShipReadyToLand")] [HarmonyWrapSafe] internal class SetShipReadyToLand_Patch { [HarmonyPrefix] public static void Postfix() { if (Plugin.OnlyLateJoinInOrbit && StartOfRound.Instance.connectedPlayersAmount + 1 < StartOfRound.Instance.allPlayerScripts.Length) { Plugin.SetLobbyJoinable(joinable: true); } } } }
BepInEx/plugins/Asylud-Glowstick/Glowsticks.dll
Decompiled a year agousing System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using GameNetcodeStuff; using Glowsticks.Patches; using HarmonyLib; using LC_API.BundleAPI; using TerminalApi; using Unity.Netcode; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("Glowsticks")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("Glowsticks")] [assembly: AssemblyCopyright("Copyright © 2023")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("69f89880-00f8-4394-b403-a594cfeb3a04")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")] [assembly: AssemblyVersion("1.0.0.0")] public class GlowstickItem : GrabbableObject { private PlayerControllerB previousPlayerHeldBy; private Light glowstickLight; public override void Start() { glowstickLight = ((Component)this).GetComponent<Light>(); ((GrabbableObject)this).Start(); } public override void ItemActivate(bool used, bool buttonDown = true) { ((GrabbableObject)this).ItemActivate(used, buttonDown); } public override void PocketItem() { ((Behaviour)glowstickLight).enabled = false; ((GrabbableObject)this).PocketItem(); } public override void DiscardItem() { ((GrabbableObject)this).DiscardItem(); } public override void EquipItem() { ((Behaviour)glowstickLight).enabled = true; ((GrabbableObject)this).EquipItem(); } public override void Update() { ((GrabbableObject)this).Update(); } } namespace Glowsticks { [BepInPlugin("Asylud.Glowsticks", "Glowsticks", "1.0.0.0")] public class GlowsticksBase : BaseUnityPlugin { private const string modGUID = "Asylud.Glowsticks"; private const string modName = "Glowsticks"; private const string modVersion = "1.0.0.0"; private readonly Harmony harmony = new Harmony("Asylud.Glowsticks"); private static GlowsticksBase Instance; private void Awake() { if ((Object)(object)Instance == (Object)null) { Instance = this; } harmony.PatchAll(typeof(GlowsticksBase)); harmony.PatchAll(typeof(GlowsticksTerminalPatch)); harmony.PatchAll(typeof(GlowsticksMenuManagerPatch)); } } } namespace Glowsticks.Patches { public static class PrefabPrep { public static void Init() { Item loadedAsset = BundleLoader.GetLoadedAsset<Item>("Assets/Glowstick/GlowstickItem.asset"); GameObject loadedAsset2 = BundleLoader.GetLoadedAsset<GameObject>("Assets/Glowstick/Glowstick.prefab"); Material loadedAsset3 = BundleLoader.GetLoadedAsset<Material>("Assets/Glowstick/Glow.mat"); Material loadedAsset4 = BundleLoader.GetLoadedAsset<Material>("Assets/Glowstick/GlowEnds.mat"); Shader shader = (loadedAsset3.shader = Shader.Find("HDRP/Lit")); loadedAsset4.shader = shader; GlowstickItem glowstickItem = loadedAsset2.AddComponent<GlowstickItem>(); ((GrabbableObject)glowstickItem).grabbable = true; ((GrabbableObject)glowstickItem).grabbableToEnemies = true; ((GrabbableObject)glowstickItem).itemProperties = loadedAsset; loadedAsset.spawnPrefab = loadedAsset2; } } [HarmonyPatch(typeof(Terminal))] public class GlowsticksTerminalPatch { [HarmonyPatch("Start")] [HarmonyPrefix] public static void TerminalGlowstickPatch(Terminal __instance) { //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_014f: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_016d: Expected O, but got Unknown //IL_016f: Expected O, but got Unknown //IL_017b: Unknown result type (might be due to invalid IL or missing references) //IL_0180: Unknown result type (might be due to invalid IL or missing references) //IL_0188: 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) //IL_018e: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Expected O, but got Unknown //IL_01a0: Expected O, but got Unknown Item loadedAsset = BundleLoader.GetLoadedAsset<Item>("Assets/Glowstick/GlowstickItem.asset"); List<Item> list = __instance.buyableItemsList.ToList(); Array.Resize(ref __instance.buyableItemsList, list.Count()); list.Add(loadedAsset); int buyItemIndex = list.IndexOf(loadedAsset); __instance.buyableItemsList = list.ToArray(); TerminalKeyword val = TerminalApi.CreateTerminalKeyword("glowstick", true, (TerminalNode)null); TerminalKeyword val2 = (val.defaultVerb = TerminalApi.GetKeyword("buy")); val.isVerb = false; TerminalExtenstionMethods.AddCompatibleNoun(val2, val, "You have requested to order glowsticks. Amount: [variableAmount]. \r\nTotal cost of items: [totalCost].\r\n\r\nPlease CONFIRM or DENY.\r\n\r\n", false); ((Object)val2.compatibleNouns.Last().noun).name = "Glowstick"; ((Object)val2.compatibleNouns.Last().result).name = "buyGlowstick"; val2.compatibleNouns.Last().result.buyItemIndex = buyItemIndex; val2.compatibleNouns.Last().result.isConfirmationNode = true; val2.compatibleNouns.Last().result.overrideOptions = true; val2.compatibleNouns.Last().result.clearPreviousText = true; TerminalKeyword keyword = TerminalApi.GetKeyword("confirm"); CompatibleNoun val3 = new CompatibleNoun { noun = keyword, result = new TerminalNode { buyItemIndex = buyItemIndex, itemCost = loadedAsset.creditsWorth, name = "buyGlowstick2", clearPreviousText = true, playSyncedClip = 0, displayText = "Ordered [variableAmount] glowsticks. Your new balance is [playerCredits].\r\n\r\nOur contractors enjoy fast, free shipping while on the job! Any purchased items will arrive hourly at your approximate location.\r\n\r\n" } }; TerminalKeyword keyword2 = TerminalApi.GetKeyword("deny"); CompatibleNoun val4 = new CompatibleNoun { noun = keyword2, result = new TerminalNode { displayText = "Cancelled order.\r\n" } }; val2.compatibleNouns.Last().result.terminalOptions = (CompatibleNoun[])(object)new CompatibleNoun[2] { val3, val4 }; TerminalApi.AddTerminalKeyword(val); } } [HarmonyPatch(typeof(MenuManager))] public class GlowsticksMenuManagerPatch { [HarmonyPatch("Start")] [HarmonyPostfix] public static void NetworkManagerGlowstickPrefabPatch(MenuManager __instance) { if (!NetworkManager.Singleton.NetworkConfig.Prefabs.Prefabs.Select((NetworkPrefab pref) => ((Object)pref.Prefab).name).Contains("Glowstick")) { PrefabPrep.Init(); GameObject loadedAsset = BundleLoader.GetLoadedAsset<GameObject>("Assets/Glowstick/Glowstick.prefab"); NetworkManager.Singleton.AddNetworkPrefab(loadedAsset); } } } }
BepInEx/plugins/egeadam-MoreScreams/MoreScreams.dll
Decompiled a year agousing 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.InteropServices; using System.Runtime.Versioning; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using Dissonance.Audio.Playback; using GameNetcodeStuff; using HarmonyLib; using MoreScreams.Configuration; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: AssemblyTitle("MoreScreams")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("MoreScreams")] [assembly: AssemblyCopyright("Copyright © 2023")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("ba7e5619-9c03-4b8d-9888-381fda81ea0f")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyVersion("1.0.0.0")] namespace MoreScreams { [BepInPlugin("egeadam.MoreScreams", "MoreScreams", "1.0.3")] public class MoreScreams : BaseUnityPlugin { private const string modGUID = "egeadam.MoreScreams"; private const string modName = "MoreScreams"; private const string modVersion = "1.0.3"; private readonly Harmony harmony = new Harmony("egeadam.MoreScreams"); private static MoreScreams Instance; internal static ManualLogSource mls; private void Awake() { if ((Object)(object)Instance == (Object)null) { Instance = this; } mls = Logger.CreateLogSource("egeadam.MoreScreams"); Config.Init(); harmony.PatchAll(); } } } namespace MoreScreams.Patches { public class AudioConfig { private PlayerControllerB playerControllerB; private float shutUpAt; private bool lowPassFilter; private bool highPassFilter; private float panStereo; private float playerVoicePitchTargets; private float playerPitch; private float spatialBlend; private bool set2D; private float volume; public bool IsAliveOrShuttedUp { get { if (!(shutUpAt < Time.time)) { return !playerControllerB.isPlayerDead; } return true; } } public float ShutUpAt => shutUpAt; public bool LowPassFilter => lowPassFilter; public bool HighPassFilter => highPassFilter; public float PanStereo => panStereo; public float PlayerVoicePitchTargets => playerVoicePitchTargets; public float PlayerPitch => playerPitch; public float SpatialBlend => spatialBlend; public bool Set2D => set2D; public float Volume => volume; public Transform DeadBodyT => ((Component)playerControllerB.deadBody).transform; public Transform AudioSourceT => ((Component)playerControllerB.currentVoiceChatAudioSource).transform; public AudioConfig(PlayerControllerB playerControllerB, float shutUpAt, bool lowPassFilter, bool highPassFilter, float panStereo, float playerVoicePitchTargets, float playerPitch, float spatialBlend, bool set2D, float volume) { this.playerControllerB = playerControllerB; this.shutUpAt = shutUpAt; this.lowPassFilter = lowPassFilter; this.highPassFilter = highPassFilter; this.panStereo = panStereo; this.playerVoicePitchTargets = playerVoicePitchTargets; this.playerPitch = playerPitch; this.spatialBlend = spatialBlend; this.set2D = set2D; this.volume = volume; } } [HarmonyPatch(typeof(StartOfRound), "UpdatePlayerVoiceEffects")] internal class UpdatePlayerVoiceEffectsPatch { private static bool updateStarted = false; private static Dictionary<PlayerControllerB, AudioConfig> configs = new Dictionary<PlayerControllerB, AudioConfig>(); public static Dictionary<PlayerControllerB, AudioConfig> Configs => configs; [HarmonyBefore(new string[] { "BiggerLobby" })] private static void Prefix() { if (configs == null) { configs = new Dictionary<PlayerControllerB, AudioConfig>(); } if (!updateStarted) { ((MonoBehaviour)HUDManager.Instance).StartCoroutine(UpdateNumerator()); updateStarted = true; } if ((Object)(object)GameNetworkManager.Instance == (Object)null || (Object)(object)GameNetworkManager.Instance.localPlayerController == (Object)null || (Object)(object)StartOfRound.Instance == (Object)null || StartOfRound.Instance.allPlayerScripts == null) { return; } for (int i = 0; i < StartOfRound.Instance.allPlayerScripts.Length; i++) { PlayerControllerB val = StartOfRound.Instance.allPlayerScripts[i]; if (!((Object)(object)val == (Object)null) && (val.isPlayerControlled || val.isPlayerDead) && (Object)(object)val != (Object)(object)GameNetworkManager.Instance.localPlayerController) { AudioSource currentVoiceChatAudioSource = val.currentVoiceChatAudioSource; if (!((Object)(object)currentVoiceChatAudioSource == (Object)null) && val.isPlayerDead && !configs.ContainsKey(val)) { Dictionary<PlayerControllerB, AudioConfig> dictionary = configs; float shutUpAt = Time.time + Config.ShutUpAfter; bool enabled = ((Behaviour)((Component)currentVoiceChatAudioSource).GetComponent<AudioLowPassFilter>()).enabled; bool enabled2 = ((Behaviour)((Component)currentVoiceChatAudioSource).GetComponent<AudioHighPassFilter>()).enabled; float panStereo = (currentVoiceChatAudioSource.panStereo = 0f); dictionary.Add(val, new AudioConfig(val, shutUpAt, enabled, enabled2, panStereo, SoundManager.Instance.playerVoicePitchTargets[(int)(IntPtr)(long)val.playerClientId], GetPitch(val), currentVoiceChatAudioSource.spatialBlend, val.currentVoiceChatIngameSettings.set2D, val.voicePlayerState.Volume)); } } } } private static void Postfix() { //IL_00d6: Unknown result type (might be due to invalid IL or missing references) if (configs == null) { configs = new Dictionary<PlayerControllerB, AudioConfig>(); } if ((Object)(object)GameNetworkManager.Instance == (Object)null || (Object)(object)GameNetworkManager.Instance.localPlayerController == (Object)null) { return; } PlayerControllerB[] array = configs.Keys.ToArray(); foreach (PlayerControllerB val in array) { if ((Object)(object)val == (Object)null) { continue; } AudioConfig audioConfig = configs[val]; if (audioConfig == null) { continue; } if ((val.isPlayerControlled || val.isPlayerDead) && !((Object)(object)val == (Object)(object)GameNetworkManager.Instance.localPlayerController)) { if ((Object)(object)val.currentVoiceChatAudioSource == (Object)null) { continue; } AudioSource currentVoiceChatAudioSource = val.currentVoiceChatAudioSource; if (!audioConfig.IsAliveOrShuttedUp) { if ((Object)(object)val.deadBody != (Object)null) { ((Component)currentVoiceChatAudioSource).transform.position = ((Component)val.deadBody).transform.position; } currentVoiceChatAudioSource.panStereo = audioConfig.PanStereo; currentVoiceChatAudioSource.spatialBlend = audioConfig.SpatialBlend; AudioLowPassFilter component = ((Component)currentVoiceChatAudioSource).GetComponent<AudioLowPassFilter>(); AudioHighPassFilter component2 = ((Component)currentVoiceChatAudioSource).GetComponent<AudioHighPassFilter>(); if ((Object)(object)component != (Object)null) { ((Behaviour)component).enabled = audioConfig.LowPassFilter; } if ((Object)(object)component2 != (Object)null) { ((Behaviour)component2).enabled = audioConfig.HighPassFilter; } if ((Object)(object)SoundManager.Instance != (Object)null) { SoundManager.Instance.playerVoicePitchTargets[(int)(IntPtr)(long)val.playerClientId] = audioConfig.PlayerVoicePitchTargets; SoundManager.Instance.SetPlayerPitch(audioConfig.PlayerPitch, (int)val.playerClientId); } val.currentVoiceChatIngameSettings.set2D = audioConfig.Set2D; val.voicePlayerState.Volume = audioConfig.Volume; val.currentVoiceChatAudioSource.volume = audioConfig.Volume; } } else if (!val.isPlayerDead) { configs.Remove(val); } } } private static IEnumerator UpdateNumerator() { yield return 0; while (true) { UpdatePlayersStatus(); yield return (object)new WaitForFixedUpdate(); } } private static void UpdatePlayersStatus() { //IL_0097: Unknown result type (might be due to invalid IL or missing references) if (configs == null) { return; } bool flag = false; KeyValuePair<PlayerControllerB, AudioConfig>[] array = configs.ToArray(); for (int i = 0; i < array.Length; i++) { KeyValuePair<PlayerControllerB, AudioConfig> keyValuePair = array[i]; if (!((Object)(object)keyValuePair.Key == (Object)null)) { if (!keyValuePair.Key.isPlayerDead) { configs.Remove(keyValuePair.Key); flag = true; } else if ((Object)(object)keyValuePair.Value.DeadBodyT != (Object)null && (Object)(object)keyValuePair.Value.AudioSourceT != (Object)null) { keyValuePair.Value.AudioSourceT.position = keyValuePair.Value.DeadBodyT.position; } } } if (flag) { StartOfRound.Instance.UpdatePlayerVoiceEffects(); } } private static float GetPitch(PlayerControllerB playerControllerB) { int num = (int)playerControllerB.playerClientId; float result = default(float); SoundManager.Instance.diageticMixer.GetFloat($"PlayerPitch{num}", ref result); return result; } } [HarmonyPatch] internal class DissonancePatch { public static MethodBase TargetMethod() { return AccessTools.FirstMethod(typeof(VoicePlayback), (Func<MethodInfo, bool>)((MethodInfo method) => method.Name.Contains("SetTransform"))); } private static bool Prefix(object __instance) { foreach (AudioConfig value in UpdatePlayerVoiceEffectsPatch.Configs.Values) { if (!value.IsAliveOrShuttedUp && ((object)((Component)((__instance is VoicePlayback) ? __instance : null)).transform).Equals((object?)value.AudioSourceT)) { return false; } } return true; } } } namespace MoreScreams.Configuration { internal static class Config { private const string CONFIG_FILE_NAME = "MoreScreams.cfg"; private static ConfigFile config; private static ConfigEntry<float> shutUpAfter; public static float ShutUpAfter => shutUpAfter.Value; public static void Init() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Expected O, but got Unknown config = new ConfigFile(Path.Combine(Paths.ConfigPath, "MoreScreams.cfg"), true); shutUpAfter = config.Bind<float>("Config", "Shut up after", 2f, "Mutes death player after given seconds."); } } }
BepInEx/plugins/EladNLG-EladsHUD/EladsHUD.dll
Decompiled a year agousing System; 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 BepInEx; using BepInEx.Bootstrap; using CustomHUD; using GameNetcodeStuff; using HarmonyLib; using Jotunn.Utils; using Microsoft.CodeAnalysis; using TMPro; using Unity.Netcode; using UnityEngine; 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: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("EladsHUD")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyDescription("Custom HUD for lethal company :]")] [assembly: AssemblyFileVersion("1.1.0.0")] [assembly: AssemblyInformationalVersion("1.1.0")] [assembly: AssemblyProduct("EladsHUD")] [assembly: AssemblyTitle("EladsHUD")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.1.0.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; } } } internal class CustomHUD_Mono : MonoBehaviour { public static CustomHUD_Mono instance; [Header("Health")] public CanvasGroup healthGroup; public Image healthBar; public TextMeshProUGUI healthText; [Header("Stamina")] public CanvasGroup staminaGroup; public Image staminaBar; public Image staminaBarChangeFG; public TextMeshProUGUI staminaText; public TextMeshProUGUI carryText; [Header("Battery")] public CanvasGroup batteryGroup; public Image batteryBar; public TextMeshProUGUI batteryText; [Header("Flashlight")] public CanvasGroup flashlightGroup; public Image flashlightBar; public TextMeshProUGUI flashlightText; private Color staminaColor; private Color staminaWarnColor = new Color(255f, 0f, 0f); private float colorLerp; private int lastHealth = 100; private float lastHealthChange = 0f; private void Awake() { if ((Object)(object)instance != (Object)null) { throw new Exception("2 instances of CustomHUD_Mono!"); } instance = this; } private void Start() { //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) staminaColor = ((Graphic)staminaBar).color; } public void UpdateFromPlayer(PlayerControllerB player) { //IL_017d: Unknown result type (might be due to invalid IL or missing references) //IL_0183: Unknown result type (might be due to invalid IL or missing references) //IL_018e: Unknown result type (might be due to invalid IL or missing references) //IL_01f3: Unknown result type (might be due to invalid IL or missing references) //IL_01f9: Unknown result type (might be due to invalid IL or missing references) //IL_0204: Unknown result type (might be due to invalid IL or missing references) //IL_024f: Unknown result type (might be due to invalid IL or missing references) lastHealthChange += Time.deltaTime; if (lastHealth != player.health) { lastHealth = player.health; lastHealthChange = 0f; } bool privateField = player.GetPrivateField<bool>("isWalking"); int health = player.health; float sprintMeter = player.sprintMeter; float sprintTime = player.sprintTime; float num = 1f; if ((double)player.drunkness > 0.019999999552965164) { num *= Mathf.Abs(StartOfRound.Instance.drunknessSpeedEffect.Evaluate(player.drunkness) - 1.25f); } float num2 = (player.isSprinting ? (-1f / sprintTime * player.carryWeight * num) : ((player.isMovementHindered > 0 && privateField) ? (-1f / sprintTime * num * 0.5f) : ((!privateField) ? (1f / (sprintTime + 4f) * num) : (1f / (sprintTime + 9f) * num)))); float num3 = num2 * 100f; if ((double)sprintMeter < 0.3) { colorLerp = Mathf.Clamp01(colorLerp + Time.deltaTime * 8f); } else { colorLerp = Mathf.Clamp01(colorLerp - Time.deltaTime * 8f); } ((Graphic)staminaBar).color = Color.Lerp(staminaColor, staminaWarnColor, colorLerp); int num4 = Mathf.RoundToInt(sprintMeter * 100f); float num5 = Mathf.Sign(num2); float num6 = num5; if (num6 != -1f) { if (num6 != 0f) { if (num6 != 1f) { } staminaBar.fillAmount = sprintMeter; staminaBarChangeFG.fillAmount = 0f; ((TMP_Text)staminaText).text = string.Format("{0}<size=75%><voffset=1>%</voffset></size> | +{1}<size=75%>/sec</size>", num4, num3.ToString("0.0")); } else { staminaBar.fillAmount = sprintMeter; staminaBarChangeFG.fillAmount = 0f; ((TMP_Text)staminaText).text = $"{num4}<size=75%><voffset=1>%</voffset></size> | +0.0<size=75%>/sec</size>"; } } else { staminaBar.fillAmount = sprintMeter - Mathf.Abs(num2); ((Graphic)staminaBarChangeFG).color = Color.Lerp(Color.white, staminaWarnColor, colorLerp); staminaBarChangeFG.fillAmount = Mathf.Min(sprintMeter, Mathf.Abs(num2)); ((Transform)((Graphic)staminaBarChangeFG).rectTransform).localPosition = new Vector3(270f * Mathf.Max(0f, sprintMeter - Mathf.Abs(num2)), 0f); ((TMP_Text)staminaText).text = string.Format("{0}<size=75%><voffset=1>%</voffset></size> | {1}<size=75%>/sec</size>", num4, num3.ToString("0.0")); } float num7 = Mathf.RoundToInt(Mathf.Clamp(player.carryWeight - 1f, 0f, 100f) * 105f); if (Plugin.shouldDoKGConversion) { num7 *= 0.453592f; ((TMP_Text)carryText).text = $"{num7}<size=60%>kg</size>"; } else { ((TMP_Text)carryText).text = $"{num7}<size=60%>lb</size>"; } healthBar.fillAmount = (float)health / 100f; ((TMP_Text)healthText).text = health.ToString(); healthGroup.alpha = Mathf.InverseLerp(5f, 4f, lastHealthChange); ((Component)flashlightGroup).gameObject.SetActive(UpdateFlashlight(player)); ((Component)batteryGroup).gameObject.SetActive(UpdateBattery(player)); } private bool UpdateFlashlight(PlayerControllerB player) { if (!((Behaviour)player.helmetLight).enabled) { return false; } GrabbableObject pocketedFlashlight = player.pocketedFlashlight; if ((Object)(object)pocketedFlashlight == (Object)null) { return false; } if (!pocketedFlashlight.itemProperties.requiresBattery) { return false; } flashlightBar.fillAmount = pocketedFlashlight.insertedBattery.charge; int num = Mathf.CeilToInt(pocketedFlashlight.insertedBattery.charge * pocketedFlashlight.itemProperties.batteryUsage); ((TMP_Text)flashlightText).text = string.Format("{0}% <size=60%>{1}:{2}", Mathf.CeilToInt(pocketedFlashlight.insertedBattery.charge * 100f), num / 60, (num % 60).ToString("D2")); return true; } private bool UpdateBattery(PlayerControllerB player) { GrabbableObject currentlyHeldObjectServer = player.currentlyHeldObjectServer; if ((Object)(object)currentlyHeldObjectServer == (Object)null) { return false; } if (!currentlyHeldObjectServer.itemProperties.requiresBattery) { return false; } batteryBar.fillAmount = currentlyHeldObjectServer.insertedBattery.charge; int num = (int)(currentlyHeldObjectServer.insertedBattery.charge / currentlyHeldObjectServer.itemProperties.batteryUsage); int num2 = Mathf.CeilToInt(currentlyHeldObjectServer.insertedBattery.charge * currentlyHeldObjectServer.itemProperties.batteryUsage); if (currentlyHeldObjectServer.itemProperties.itemIsTrigger) { ((TMP_Text)batteryText).text = $"{Mathf.CeilToInt(currentlyHeldObjectServer.insertedBattery.charge * 100f)}% ({num} uses remaining)"; } else { ((TMP_Text)batteryText).text = string.Format("{0}% ({1}:{2} remaining)", Mathf.CeilToInt(currentlyHeldObjectServer.insertedBattery.charge * 100f), num2 / 60, (num2 % 60).ToString("D2")); } return true; } } namespace EladsHUD { public static class PluginInfo { public const string PLUGIN_GUID = "EladsHUD"; public const string PLUGIN_NAME = "EladsHUD"; public const string PLUGIN_VERSION = "1.1.0"; } } namespace CustomHUD { [BepInPlugin("me.eladnlg.customhud", "Elads HUD", "1.1.0")] [BepInDependency(/*Could not decode attribute arguments.*/)] public class Plugin : BaseUnityPlugin { public static Plugin instance; public AssetBundle assets; public GameObject HUD; public static bool shouldDoKGConversion; private void Awake() { //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Expected O, but got Unknown if ((Object)(object)instance != (Object)null) { throw new Exception("what the cuck??? more than 1 plugin instance."); } instance = this; ((BaseUnityPlugin)this).Logger.LogInfo((object)"Plugin Elad's HUD is loaded!"); assets = AssetUtils.LoadAssetBundleFromResources("customhud", typeof(PlayerPatches).Assembly); HUD = assets.LoadAsset<GameObject>("PlayerInfo"); Harmony val = new Harmony("me.eladnlg.customhud"); val.PatchAll(Assembly.GetExecutingAssembly()); } private void Start() { shouldDoKGConversion = Chainloader.PluginInfos.Any((KeyValuePair<string, PluginInfo> pair) => pair.Value.Metadata.GUID == "com.zduniusz.lethalcompany.lbtokg"); } } [HarmonyPatch(typeof(HUDManager))] public class HUDPatches { [HarmonyPostfix] [HarmonyPatch("Awake")] private static void Awake_Postfix(HUDManager __instance) { //IL_0057: Unknown result type (might be due to invalid IL or missing references) HUDElement[] privateField = __instance.GetPrivateField<HUDElement[]>("HUDElements"); privateField[2].canvasGroup.alpha = 0f; GameObject val = Object.Instantiate<GameObject>(Plugin.instance.HUD, ((Component)privateField[2].canvasGroup).transform.parent); val.transform.localScale = new Vector3(0.75f, 0.75f, 0.75f); privateField[2].canvasGroup = val.GetComponent<CanvasGroup>(); } } [HarmonyPatch(typeof(PlayerControllerB))] public static class PlayerPatches { [HarmonyPrefix] [HarmonyPatch("LateUpdate")] private static void LateUpdate_Prefix(PlayerControllerB __instance) { if (((NetworkBehaviour)__instance).IsOwner && (!((NetworkBehaviour)__instance).IsServer || __instance.isHostPlayerObject) && !((Object)(object)CustomHUD_Mono.instance == (Object)null)) { CustomHUD_Mono.instance.UpdateFromPlayer(__instance); } } } internal static class ReflectionUtils { public static T GetPrivateField<T>(this object obj, string field) { return (T)obj.GetType().GetField(field, BindingFlags.Instance | BindingFlags.NonPublic).GetValue(obj); } } } namespace Jotunn.Utils { public static class AssetUtils { public const char AssetBundlePathSeparator = '$'; public static Texture2D LoadTexture(string texturePath, bool relativePath = true) { //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Expected O, but got Unknown string text = texturePath; if (relativePath) { text = Path.Combine(Paths.PluginPath, texturePath); } if (!File.Exists(text)) { return null; } if (!text.EndsWith(".png") && !text.EndsWith(".jpg")) { throw new Exception("LoadTexture can only load png or jpg textures"); } byte[] array = File.ReadAllBytes(text); Texture2D val = new Texture2D(2, 2); val.LoadRawTextureData(array); return val; } public static Sprite LoadSpriteFromFile(string spritePath) { //IL_002e: 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_003b: Unknown result type (might be due to invalid IL or missing references) Texture2D val = LoadTexture(spritePath); if ((Object)(object)val != (Object)null) { return Sprite.Create(val, new Rect(0f, 0f, (float)((Texture)val).width, (float)((Texture)val).height), default(Vector2), 100f); } return null; } public static AssetBundle LoadAssetBundle(string bundlePath) { string text = Path.Combine(Paths.PluginPath, bundlePath); if (!File.Exists(text)) { return null; } return AssetBundle.LoadFromFile(text); } public static AssetBundle LoadAssetBundleFromResources(string bundleName, Assembly resourceAssembly) { if (resourceAssembly == null) { throw new ArgumentNullException("Parameter resourceAssembly can not be null."); } string text = null; try { text = resourceAssembly.GetManifestResourceNames().Single((string str) => str.EndsWith(bundleName)); } catch (Exception) { } if (text == null) { Debug.LogError((object)("AssetBundle " + bundleName + " not found in assembly manifest")); return null; } AssetBundle result; using (Stream stream = resourceAssembly.GetManifestResourceStream(text)) { result = AssetBundle.LoadFromStream(stream); } return result; } public static string LoadText(string path) { string text = Path.Combine(Paths.PluginPath, path); if (!File.Exists(text)) { Debug.LogError((object)("Error, failed to load contents from non-existant path: $" + text)); return null; } return File.ReadAllText(text); } public static Sprite LoadSprite(string assetPath) { //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) string text = Path.Combine(Paths.PluginPath, assetPath); if (!File.Exists(text)) { return null; } if (text.Contains('$'.ToString())) { string[] array = text.Split('$'); string text2 = array[0]; string text3 = array[1]; AssetBundle val = AssetBundle.LoadFromFile(text2); Sprite result = val.LoadAsset<Sprite>(text3); val.Unload(false); return result; } Texture2D val2 = LoadTexture(text, relativePath: false); if (!Object.op_Implicit((Object)(object)val2)) { return null; } return Sprite.Create(val2, new Rect(0f, 0f, (float)((Texture)val2).width, (float)((Texture)val2).height), Vector2.zero); } } }
BepInEx/plugins/EliteMasterEric-WackyCosmetics/WackyCosmetics.dll
Decompiled a year agousing System; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using HarmonyLib; using Microsoft.CodeAnalysis; using MoreCompany.Cosmetics; using MoreCompany.Utils; using UnityEngine; using WackyCosmetics.Cosmetics; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("EliteMasterEric")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyDescription("New interesting cosmetics for Lethal Company")] [assembly: AssemblyFileVersion("1.1.0.0")] [assembly: AssemblyInformationalVersion("1.1.0")] [assembly: AssemblyProduct("WackyCosmetics")] [assembly: AssemblyTitle("WackyCosmetics")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.1.0.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; } } } namespace WackyCosmetics { public static class PluginInfo { public const string PLUGIN_ID = "WackyCosmetics"; public const string PLUGIN_NAME = "EliteMasterEric's Wacky Cosmetics"; public const string PLUGIN_VERSION = "1.0.0"; public const string PLUGIN_GUID = "com.elitemastereric.wackycosmetics"; } [BepInPlugin("com.elitemastereric.wackycosmetics", "EliteMasterEric's Wacky Cosmetics", "1.0.0")] [BepInDependency(/*Could not decode attribute arguments.*/)] public class Plugin : BaseUnityPlugin { public ManualLogSource PluginLogger; public PluginConfig PluginConfig; public static Plugin Instance { get; private set; } private void Awake() { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Expected O, but got Unknown Instance = this; PluginLogger = ((BaseUnityPlugin)this).Logger; Harmony val = new Harmony("com.elitemastereric.wackycosmetics"); val.PatchAll(); PluginLogger.LogInfo((object)"Plugin EliteMasterEric's Wacky Cosmetics (com.elitemastereric.wackycosmetics) is loaded!"); LoadConfig(); LoadCosmetics(); } private void LoadConfig() { PluginConfig = new PluginConfig(); PluginConfig.BindConfig(((BaseUnityPlugin)this).Config); } private void LoadCosmetics() { WackyCosmeticGeneric.LoadCosmeticsFromThisAssembly(); } } internal class PluginAssets { public static AssetBundle LoadBundleFromThisAssembly(string filename) { Assembly executingAssembly = Assembly.GetExecutingAssembly(); if (executingAssembly == null) { Plugin.Instance.PluginLogger.LogError((object)("Failed to get assembly reference while loading bundle: " + filename)); return null; } return BundleUtilities.LoadBundleFromInternalAssembly(filename, executingAssembly); } public static string[] ListEmbeddedResourcesInThisAssembly() { Assembly executingAssembly = Assembly.GetExecutingAssembly(); if (executingAssembly == null) { Plugin.Instance.PluginLogger.LogError((object)"Failed to get assembly reference while listing embedded resources."); return null; } return executingAssembly.GetManifestResourceNames(); } } public class PluginConfig { public Dictionary<string, ConfigEntry<bool>> CosmeticConfigEntries; public PluginConfig() { CosmeticConfigEntries = new Dictionary<string, ConfigEntry<bool>>(); } public void BindConfig(ConfigFile config) { WackyCosmeticGeneric.GenerateCosmeticConfigEntries(config); } internal void GenerateCosmeticConfigEntry(ConfigFile config, WackyCosmeticGeneric cosmetic) { ConfigEntry<bool> value = config.Bind<bool>("Cosmetics", "EnableCosmetic_" + ((CosmeticGeneric)cosmetic).cosmeticId, true, "Enable the " + cosmetic.cosmeticName + " cosmetic."); CosmeticConfigEntries.Add(((CosmeticGeneric)cosmetic).cosmeticId, value); } public bool IsCosmeticEnabled(WackyCosmeticGeneric cosmetic) { return CosmeticConfigEntries[((CosmeticGeneric)cosmetic).cosmeticId].Value; } } } namespace WackyCosmetics.Cosmetics { public class BurningFlamesTeamCaptain : WackyCosmeticGeneric { public override string gameObjectPath => "assets/WackyCosmetics/BurningFlamesTeamCaptain/BurningFlamesTeamCaptain.prefab"; public override string cosmeticId => "wackycosmetics.burningflamesteamcaptain"; public override string textureIconPath => "assets/WackyCosmetics/BurningFlamesTeamCaptain/BurningFlamesTeamCaptain_Icon.png"; public override string cosmeticName => "Burning Flames Team Captain"; public override string assetBundlePath => "WackyCosmetics.cosmetic_burningflamesteamcaptain"; public override CosmeticType cosmeticType => (CosmeticType)0; } public class Maxwell : WackyCosmeticGeneric { public override string gameObjectPath => "assets/WackyCosmetics/Maxwell/Maxwell.prefab"; public override string cosmeticId => "wackycosmetics.maxwell"; public override string textureIconPath => "assets/WackyCosmetics/Maxwell/Maxwell_Icon.png"; public override string cosmeticName => "Maxwell"; public override string assetBundlePath => "WackyCosmetics.cosmetic_maxwell"; public override CosmeticType cosmeticType => (CosmeticType)0; } public class OSCAR : WackyCosmeticGeneric { public override string gameObjectPath => "assets/WackyCosmetics/OSCAR/OSCAR.prefab"; public override string cosmeticId => "wackycosmetics.oscar"; public override string textureIconPath => "assets/WackyCosmetics/OSCAR/OSCAR_Icon.png"; public override string cosmeticName => "OSCAR"; public override string assetBundlePath => "WackyCosmetics.cosmetic_oscar"; public override CosmeticType cosmeticType => (CosmeticType)0; } public class TBHCreature : WackyCosmeticGeneric { public override string gameObjectPath => "assets/WackyCosmetics/TBHCreature/TBHCreature.prefab"; public override string cosmeticId => "wackycosmetics.tbhcreature"; public override string textureIconPath => "assets/WackyCosmetics/TBHCreature/TBHCreature_Icon.png"; public override string cosmeticName => "TBHCreature"; public override string assetBundlePath => "WackyCosmetics.cosmetic_tbhcreature"; public override CosmeticType cosmeticType => (CosmeticType)0; } public class ToweringPillarOfHats : WackyCosmeticGeneric { public override string gameObjectPath => "assets/WackyCosmetics/ToweringPillarOfHats/ToweringPillarOfHats.prefab"; public override string cosmeticId => "wackycosmetics.toweringpillarofhats"; public override string textureIconPath => "assets/WackyCosmetics/ToweringPillarOfHats/ToweringPillarOfHats_Icon.png"; public override string cosmeticName => "Towering Pillar of Hats"; public override string assetBundlePath => "WackyCosmetics.cosmetic_toweringpillarofhats"; public override CosmeticType cosmeticType => (CosmeticType)0; } public class ValkyrieHelm : WackyCosmeticGeneric { public override string gameObjectPath => "assets/WackyCosmetics/ValkyrieHelm/ValkyrieHelm.prefab"; public override string cosmeticId => "wackycosmetics.valkyriehelm"; public override string textureIconPath => "assets/WackyCosmetics/ValkyrieHelm/ValkyrieHelm_Icon.png"; public override string cosmeticName => "ValkyrieHelm"; public override string assetBundlePath => "WackyCosmetics.cosmetic_valkyriehelm"; public override CosmeticType cosmeticType => (CosmeticType)0; } public class WackyCosmeticGeneric : CosmeticGeneric { public virtual string cosmeticName { get; } public virtual string assetBundlePath { get; } public AssetBundle assetBundle { get; private set; } public void LoadFromAssetBundle() { //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) if (!Plugin.Instance.PluginConfig.IsCosmeticEnabled(this)) { Plugin.Instance.PluginLogger.LogInfo((object)("Skipped Wacky cosmetic: " + ((CosmeticGeneric)this).cosmeticId)); return; } assetBundle = PluginAssets.LoadBundleFromThisAssembly(assetBundlePath); if ((Object)(object)assetBundle == (Object)null) { Plugin.Instance.PluginLogger.LogError((object)("Failed to load cosmetic asset bundle: " + assetBundlePath)); return; } GameObject val = AssetBundleExtension.LoadPersistentAsset<GameObject>(assetBundle, ((CosmeticGeneric)this).gameObjectPath); if ((Object)(object)val == (Object)null) { Plugin.Instance.PluginLogger.LogError((object)("Failed to load cosmetic prefab: " + ((CosmeticGeneric)this).gameObjectPath)); return; } Texture2D val2 = AssetBundleExtension.LoadPersistentAsset<Texture2D>(assetBundle, ((CosmeticGeneric)this).textureIconPath); if ((Object)(object)val2 == (Object)null) { Plugin.Instance.PluginLogger.LogError((object)("Failed to load cosmetic icon: " + ((CosmeticGeneric)this).textureIconPath)); return; } CosmeticInstance val3 = val.AddComponent<CosmeticInstance>(); val3.cosmeticId = ((CosmeticGeneric)this).cosmeticId; val3.icon = val2; val3.cosmeticType = ((CosmeticGeneric)this).cosmeticType; CosmeticRegistry.cosmeticInstances.Add(((CosmeticGeneric)this).cosmeticId, val3); Plugin.Instance.PluginLogger.LogInfo((object)("Loaded Wacky cosmetic: " + ((CosmeticGeneric)this).cosmeticId)); } public static void GenerateCosmeticConfigEntries(ConfigFile config) { Assembly executingAssembly = Assembly.GetExecutingAssembly(); if (executingAssembly == null) { Plugin.Instance.PluginLogger.LogError((object)"Failed to get assembly reference while generating config entries."); return; } Plugin.Instance.PluginLogger.LogInfo((object)"Generating config entries for Wacky cosmetics."); Type[] types = executingAssembly.GetTypes(); foreach (Type type in types) { if (!(type == null) && type.IsSubclassOf(typeof(WackyCosmeticGeneric))) { WackyCosmeticGeneric cosmetic = (WackyCosmeticGeneric)Activator.CreateInstance(type); Plugin.Instance.PluginConfig.GenerateCosmeticConfigEntry(config, cosmetic); } } } public static void LoadCosmeticsFromThisAssembly() { Assembly executingAssembly = Assembly.GetExecutingAssembly(); if (executingAssembly == null) { Plugin.Instance.PluginLogger.LogError((object)"Failed to get assembly reference while loading cosmetics."); return; } Plugin.Instance.PluginLogger.LogInfo((object)"Loading Wacky cosmetics."); Type[] types = executingAssembly.GetTypes(); foreach (Type type in types) { if (!(type == null) && type.IsSubclassOf(typeof(WackyCosmeticGeneric))) { WackyCosmeticGeneric wackyCosmeticGeneric = (WackyCosmeticGeneric)Activator.CreateInstance(type); wackyCosmeticGeneric.LoadFromAssetBundle(); } } } } }
BepInEx/plugins/Evaisa-LethalLib/LethalLib/LethalLib.dll
Decompiled a year agousing System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Logging; using DunGen; using DunGen.Graph; using LethalLib.Extras; using LethalLib.Modules; using Microsoft.CodeAnalysis; using Mono.Cecil.Cil; using MonoMod.Cil; using MonoMod.RuntimeDetour; using On; using Unity.Netcode; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("LethalLib")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyDescription("Mod for Lethal Company")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+a7bb0da5babd2808c30ccbaf9654dbbf38015de8")] [assembly: AssemblyProduct("LethalLib")] [assembly: AssemblyTitle("LethalLib")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.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; } } } namespace LethalLib { [BepInPlugin("evaisa.lethallib", "LethalLib", "0.6.2")] public class Plugin : BaseUnityPlugin { public const string ModGUID = "evaisa.lethallib"; public const string ModName = "LethalLib"; public const string ModVersion = "0.6.2"; public static AssetBundle MainAssets; public static ManualLogSource logger; private void Awake() { //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Expected O, but got Unknown //IL_003f: Unknown result type (might be due to invalid IL or missing references) logger = ((BaseUnityPlugin)this).Logger; ((BaseUnityPlugin)this).Logger.LogInfo((object)"LethalLib loaded!!"); new ILHook((MethodBase)typeof(StackTrace).GetMethod("AddFrames", BindingFlags.Instance | BindingFlags.NonPublic), new Manipulator(IlHook)); Enemies.Init(); Items.Init(); Unlockables.Init(); MapObjects.Init(); Dungeon.Init(); NetworkPrefabs.Init(); } private void IlHook(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown ILCursor val = new ILCursor(il); val.GotoNext(new Func<Instruction, bool>[1] { (Instruction x) => ILPatternMatchingExt.MatchCallvirt(x, (MethodBase)typeof(StackFrame).GetMethod("GetFileLineNumber", BindingFlags.Instance | BindingFlags.Public)) }); val.RemoveRange(2); val.EmitDelegate<Func<StackFrame, string>>((Func<StackFrame, string>)GetLineOrIL); } private static string GetLineOrIL(StackFrame instance) { int fileLineNumber = instance.GetFileLineNumber(); if (fileLineNumber == -1 || fileLineNumber == 0) { return "IL_" + instance.GetILOffset().ToString("X4"); } return fileLineNumber.ToString(); } } } namespace LethalLib.Modules { public class Dungeon { public class CustomDungeonArchetype { public DungeonArchetype archeType; public Levels.LevelTypes LevelTypes; public int lineIndex = -1; } public class CustomGraphLine { public GraphLine graphLine; public Levels.LevelTypes LevelTypes; } public class CustomDungeon { public int rarity; public DungeonFlow dungeonFlow; public Levels.LevelTypes LevelTypes; public int dungeonIndex = -1; public AudioClip firstTimeDungeonAudio; } [CompilerGenerated] private static class <>O { public static hook_GenerateNewFloor <0>__RoundManager_GenerateNewFloor; public static hook_Start <1>__RoundManager_Start; public static hook_Start <2>__StartOfRound_Start; } public static List<CustomDungeonArchetype> customDungeonArchetypes = new List<CustomDungeonArchetype>(); public static List<CustomGraphLine> customGraphLines = new List<CustomGraphLine>(); public static Dictionary<string, TileSet> extraTileSets = new Dictionary<string, TileSet>(); public static Dictionary<string, GameObjectChance> extraRooms = new Dictionary<string, GameObjectChance>(); public static List<CustomDungeon> customDungeons = new List<CustomDungeon>(); public static void Init() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0032: 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_003d: Expected O, but got Unknown //IL_0053: 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: Expected O, but got Unknown object obj = <>O.<0>__RoundManager_GenerateNewFloor; if (obj == null) { hook_GenerateNewFloor val = RoundManager_GenerateNewFloor; <>O.<0>__RoundManager_GenerateNewFloor = val; obj = (object)val; } RoundManager.GenerateNewFloor += (hook_GenerateNewFloor)obj; object obj2 = <>O.<1>__RoundManager_Start; if (obj2 == null) { hook_Start val2 = RoundManager_Start; <>O.<1>__RoundManager_Start = val2; obj2 = (object)val2; } RoundManager.Start += (hook_Start)obj2; object obj3 = <>O.<2>__StartOfRound_Start; if (obj3 == null) { hook_Start val3 = StartOfRound_Start; <>O.<2>__StartOfRound_Start = val3; obj3 = (object)val3; } StartOfRound.Start += (hook_Start)obj3; } private static void StartOfRound_Start(orig_Start orig, StartOfRound self) { //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: 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) //IL_010b: Expected O, but got Unknown foreach (CustomDungeon dungeon in customDungeons) { SelectableLevel[] levels = self.levels; foreach (SelectableLevel val in levels) { string name = ((Object)val).name; if (Enum.IsDefined(typeof(Levels.LevelTypes), name)) { Levels.LevelTypes levelTypes = (Levels.LevelTypes)Enum.Parse(typeof(Levels.LevelTypes), name); if (dungeon.LevelTypes.HasFlag(levelTypes) && !val.dungeonFlowTypes.Any((IntWithRarity rarityInt) => rarityInt.id == dungeon.dungeonIndex)) { List<IntWithRarity> list = val.dungeonFlowTypes.ToList(); list.Add(new IntWithRarity { id = dungeon.dungeonIndex, rarity = dungeon.rarity }); val.dungeonFlowTypes = list.ToArray(); } } } } Plugin.logger.LogInfo((object)"Added custom dungeons to levels"); orig.Invoke(self); } private static void RoundManager_Start(orig_Start orig, RoundManager self) { foreach (CustomDungeon customDungeon in customDungeons) { if (self.dungeonFlowTypes.Contains(customDungeon.dungeonFlow)) { continue; } List<DungeonFlow> list = self.dungeonFlowTypes.ToList(); list.Add(customDungeon.dungeonFlow); self.dungeonFlowTypes = list.ToArray(); int dungeonIndex = self.dungeonFlowTypes.Length - 1; customDungeon.dungeonIndex = dungeonIndex; List<AudioClip> list2 = self.firstTimeDungeonAudios.ToList(); if (list2.Count != self.dungeonFlowTypes.Length - 1) { while (list2.Count < self.dungeonFlowTypes.Length - 1) { list2.Add(null); } } list2.Add(customDungeon.firstTimeDungeonAudio); self.firstTimeDungeonAudios = list2.ToArray(); } orig.Invoke(self); } private static void RoundManager_GenerateNewFloor(orig_GenerateNewFloor orig, RoundManager self) { string name = ((Object)self.currentLevel).name; if (Enum.IsDefined(typeof(Levels.LevelTypes), name)) { Levels.LevelTypes levelEnum = (Levels.LevelTypes)Enum.Parse(typeof(Levels.LevelTypes), name); int index = 0; self.dungeonGenerator.Generator.DungeonFlow.Lines.ForEach(delegate(GraphLine line) { foreach (CustomDungeonArchetype customDungeonArchetype in customDungeonArchetypes) { if (customDungeonArchetype.LevelTypes.HasFlag(levelEnum) && !line.DungeonArchetypes.Contains(customDungeonArchetype.archeType) && (customDungeonArchetype.lineIndex == -1 || customDungeonArchetype.lineIndex == index)) { line.DungeonArchetypes.Add(customDungeonArchetype.archeType); Plugin.logger.LogInfo((object)("Added " + ((Object)customDungeonArchetype.archeType).name + " to " + name)); } } foreach (DungeonArchetype dungeonArchetype in line.DungeonArchetypes) { string name2 = ((Object)dungeonArchetype).name; if (extraTileSets.ContainsKey(name2)) { TileSet val4 = extraTileSets[name2]; if (!dungeonArchetype.TileSets.Contains(val4)) { dungeonArchetype.TileSets.Add(val4); Plugin.logger.LogInfo((object)("Added " + ((Object)val4).name + " to " + name)); } } foreach (TileSet tileSet in dungeonArchetype.TileSets) { string name3 = ((Object)tileSet).name; if (extraRooms.ContainsKey(name3)) { GameObjectChance item = extraRooms[name3]; if (!tileSet.TileWeights.Weights.Contains(item)) { tileSet.TileWeights.Weights.Add(item); } } } } index++; }); foreach (CustomGraphLine customGraphLine in customGraphLines) { if (customGraphLine.LevelTypes.HasFlag(levelEnum) && !self.dungeonGenerator.Generator.DungeonFlow.Lines.Contains(customGraphLine.graphLine)) { self.dungeonGenerator.Generator.DungeonFlow.Lines.Add(customGraphLine.graphLine); } } } orig.Invoke(self); NetworkManager val = Object.FindObjectOfType<NetworkManager>(); RandomMapObject[] array = Object.FindObjectsOfType<RandomMapObject>(); RandomMapObject[] array2 = array; foreach (RandomMapObject val2 in array2) { for (int j = 0; j < val2.spawnablePrefabs.Count; j++) { string prefabName = ((Object)val2.spawnablePrefabs[j]).name; NetworkPrefab val3 = val.NetworkConfig.Prefabs.m_Prefabs.First((NetworkPrefab x) => ((Object)x.Prefab).name == prefabName); if (val3 != null && (Object)(object)val3.Prefab != (Object)(object)val2.spawnablePrefabs[j]) { val2.spawnablePrefabs[j] = val3.Prefab; } } } } public static void AddArchetype(DungeonArchetype archetype, Levels.LevelTypes levelFlags, int lineIndex = -1) { CustomDungeonArchetype customDungeonArchetype = new CustomDungeonArchetype(); customDungeonArchetype.archeType = archetype; customDungeonArchetype.LevelTypes = levelFlags; customDungeonArchetype.lineIndex = lineIndex; customDungeonArchetypes.Add(customDungeonArchetype); } public static void AddLine(GraphLine line, Levels.LevelTypes levelFlags) { CustomGraphLine customGraphLine = new CustomGraphLine(); customGraphLine.graphLine = line; customGraphLine.LevelTypes = levelFlags; customGraphLines.Add(customGraphLine); } public static void AddLine(DungeonGraphLineDef line, Levels.LevelTypes levelFlags) { AddLine(line.graphLine, levelFlags); } public static void AddTileSet(TileSet set, string archetypeName) { extraTileSets.Add(archetypeName, set); } public static void AddRoom(GameObjectChance room, string tileSetName) { extraRooms.Add(tileSetName, room); } public static void AddRoom(GameObjectChanceDef room, string tileSetName) { AddRoom(room.gameObjectChance, tileSetName); } public static void AddDungeon(DungeonDef dungeon, Levels.LevelTypes levelFlags) { AddDungeon(dungeon.dungeonFlow, dungeon.rarity, levelFlags, dungeon.firstTimeDungeonAudio); } public static void AddDungeon(DungeonFlow dungeon, int rarity, Levels.LevelTypes levelFlags, AudioClip firstTimeDungeonAudio = null) { customDungeons.Add(new CustomDungeon { dungeonFlow = dungeon, rarity = rarity, LevelTypes = levelFlags, firstTimeDungeonAudio = firstTimeDungeonAudio }); } } public class Enemies { public enum SpawnType { Default, Daytime, Outside } public class SpawnableEnemy { public EnemyType enemy; public int rarity; public Levels.LevelTypes spawnLevels; public SpawnType spawnType; public TerminalNode terminalNode; public TerminalKeyword infoKeyword; public string modName; public SpawnableEnemy(EnemyType enemy, int rarity, Levels.LevelTypes spawnLevels, SpawnType spawnType) { this.enemy = enemy; this.rarity = rarity; this.spawnLevels = spawnLevels; this.spawnType = spawnType; } } [CompilerGenerated] private static class <>O { public static hook_Awake <0>__RegisterLevelEnemies; public static hook_Start <1>__Terminal_Start; } public static List<SpawnableEnemy> spawnableEnemies = new List<SpawnableEnemy>(); public static void Init() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0032: 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_003d: Expected O, but got Unknown object obj = <>O.<0>__RegisterLevelEnemies; if (obj == null) { hook_Awake val = RegisterLevelEnemies; <>O.<0>__RegisterLevelEnemies = val; obj = (object)val; } StartOfRound.Awake += (hook_Awake)obj; object obj2 = <>O.<1>__Terminal_Start; if (obj2 == null) { hook_Start val2 = Terminal_Start; <>O.<1>__Terminal_Start = val2; obj2 = (object)val2; } Terminal.Start += (hook_Start)obj2; } private static void Terminal_Start(orig_Start orig, Terminal self) { //IL_0187: Unknown result type (might be due to invalid IL or missing references) //IL_018c: Unknown result type (might be due to invalid IL or missing references) //IL_0194: Unknown result type (might be due to invalid IL or missing references) //IL_01a5: Expected O, but got Unknown TerminalKeyword val = self.terminalNodes.allKeywords.First((TerminalKeyword keyword) => keyword.word == "info"); List<string> list = new List<string>(); foreach (SpawnableEnemy spawnableEnemy in spawnableEnemies) { if (list.Contains(spawnableEnemy.enemy.enemyName)) { Plugin.logger.LogInfo((object)("Skipping " + spawnableEnemy.enemy.enemyName + " because it was already added")); continue; } if ((Object)(object)spawnableEnemy.terminalNode == (Object)null) { spawnableEnemy.terminalNode = ScriptableObject.CreateInstance<TerminalNode>(); spawnableEnemy.terminalNode.displayText = spawnableEnemy.enemy.enemyName + "\n\nDanger level: Unknown\n\n[No information about this creature was found.]\n\n"; spawnableEnemy.terminalNode.clearPreviousText = true; spawnableEnemy.terminalNode.maxCharactersToType = 35; spawnableEnemy.terminalNode.creatureName = spawnableEnemy.enemy.enemyName; } TerminalKeyword val2 = (((Object)(object)spawnableEnemy.infoKeyword != (Object)null) ? spawnableEnemy.infoKeyword : TerminalUtils.CreateTerminalKeyword(spawnableEnemy.terminalNode.creatureName.ToLowerInvariant().Replace(" ", "-"), isVerb: false, null, null, val)); val2.defaultVerb = val; List<TerminalKeyword> list2 = self.terminalNodes.allKeywords.ToList(); list2.Add(val2); self.terminalNodes.allKeywords = list2.ToArray(); List<CompatibleNoun> list3 = val.compatibleNouns.ToList(); list3.Add(new CompatibleNoun { noun = val2, result = spawnableEnemy.terminalNode }); val.compatibleNouns = list3.ToArray(); spawnableEnemy.terminalNode.creatureFileID = self.enemyFiles.Count; self.enemyFiles.Add(spawnableEnemy.terminalNode); spawnableEnemy.enemy.enemyPrefab.GetComponentInChildren<ScanNodeProperties>().creatureScanID = spawnableEnemy.terminalNode.creatureFileID; } orig.Invoke(self); } private static void RegisterLevelEnemies(orig_Awake orig, StartOfRound self) { //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Expected O, but got Unknown orig.Invoke(self); SelectableLevel[] levels = self.levels; foreach (SelectableLevel val in levels) { string name = ((Object)val).name; if (!Enum.IsDefined(typeof(Levels.LevelTypes), name)) { continue; } Levels.LevelTypes levelTypes = (Levels.LevelTypes)Enum.Parse(typeof(Levels.LevelTypes), name); foreach (SpawnableEnemy spawnableEnemy in spawnableEnemies) { if (!spawnableEnemy.spawnLevels.HasFlag(levelTypes)) { continue; } SpawnableEnemyWithRarity item = new SpawnableEnemyWithRarity { enemyType = spawnableEnemy.enemy, rarity = spawnableEnemy.rarity }; switch (spawnableEnemy.spawnType) { case SpawnType.Default: if (!val.Enemies.Any((SpawnableEnemyWithRarity x) => (Object)(object)x.enemyType == (Object)(object)spawnableEnemy.enemy)) { val.Enemies.Add(item); Plugin.logger.LogInfo((object)("Added " + ((Object)spawnableEnemy.enemy).name + " to " + name + " with SpawnType [Default]")); } break; case SpawnType.Daytime: if (!val.DaytimeEnemies.Any((SpawnableEnemyWithRarity x) => (Object)(object)x.enemyType == (Object)(object)spawnableEnemy.enemy)) { val.DaytimeEnemies.Add(item); Plugin.logger.LogInfo((object)("Added " + ((Object)spawnableEnemy.enemy).name + " to " + name + " with SpawnType [Daytime]")); } break; case SpawnType.Outside: if (!val.OutsideEnemies.Any((SpawnableEnemyWithRarity x) => (Object)(object)x.enemyType == (Object)(object)spawnableEnemy.enemy)) { val.OutsideEnemies.Add(item); Plugin.logger.LogInfo((object)("Added " + ((Object)spawnableEnemy.enemy).name + " to " + name + " with SpawnType [Outside]")); } break; } } } } public static void RegisterEnemy(EnemyType enemy, int rarity, Levels.LevelTypes levelFlags, SpawnType spawnType, TerminalNode infoNode = null, TerminalKeyword infoKeyword = null) { SpawnableEnemy spawnableEnemy = new SpawnableEnemy(enemy, rarity, levelFlags, spawnType); spawnableEnemy.terminalNode = infoNode; spawnableEnemy.infoKeyword = infoKeyword; Assembly callingAssembly = Assembly.GetCallingAssembly(); string name = callingAssembly.GetName().Name; spawnableEnemy.modName = name; spawnableEnemies.Add(spawnableEnemy); } public static void RegisterEnemy(EnemyType enemy, int rarity, Levels.LevelTypes levelFlags, TerminalNode infoNode = null, TerminalKeyword infoKeyword = null) { SpawnableEnemy spawnableEnemy = new SpawnableEnemy(enemy, rarity, levelFlags, enemy.isDaytimeEnemy ? SpawnType.Daytime : (enemy.isOutsideEnemy ? SpawnType.Outside : SpawnType.Default)); spawnableEnemy.terminalNode = infoNode; spawnableEnemy.infoKeyword = infoKeyword; Assembly callingAssembly = Assembly.GetCallingAssembly(); string name = callingAssembly.GetName().Name; spawnableEnemy.modName = name; spawnableEnemies.Add(spawnableEnemy); } } public class Items { public class ScrapItem { public Item item; public int rarity; public Levels.LevelTypes spawnLevels; public string modName; public ScrapItem(Item item, int rarity, Levels.LevelTypes spawnLevels) { this.item = item; this.rarity = rarity; this.spawnLevels = spawnLevels; } } public class ShopItem { public Item item; public TerminalNode buyNode1; public TerminalNode buyNode2; public TerminalNode itemInfo; public int price; public string modName; public ShopItem(Item item, TerminalNode buyNode1 = null, TerminalNode buyNode2 = null, TerminalNode itemInfo = null, int price = 0) { this.item = item; this.price = price; if ((Object)(object)buyNode1 != (Object)null) { this.buyNode1 = buyNode1; } if ((Object)(object)buyNode2 != (Object)null) { this.buyNode2 = buyNode2; } if ((Object)(object)itemInfo != (Object)null) { this.itemInfo = itemInfo; } } } [CompilerGenerated] private static class <>O { public static hook_Awake <0>__StartOfRound_Awake; public static hook_Awake <1>__Terminal_Awake; } public static List<ScrapItem> scrapItems = new List<ScrapItem>(); public static List<ShopItem> shopItems = new List<ShopItem>(); public static void Init() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0032: 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_003d: Expected O, but got Unknown object obj = <>O.<0>__StartOfRound_Awake; if (obj == null) { hook_Awake val = StartOfRound_Awake; <>O.<0>__StartOfRound_Awake = val; obj = (object)val; } StartOfRound.Awake += (hook_Awake)obj; object obj2 = <>O.<1>__Terminal_Awake; if (obj2 == null) { hook_Awake val2 = Terminal_Awake; <>O.<1>__Terminal_Awake = val2; obj2 = (object)val2; } Terminal.Awake += (hook_Awake)obj2; } private static void Terminal_Awake(orig_Awake orig, Terminal self) { //IL_02fe: Unknown result type (might be due to invalid IL or missing references) //IL_0303: Unknown result type (might be due to invalid IL or missing references) //IL_0338: Unknown result type (might be due to invalid IL or missing references) //IL_0341: Expected O, but got Unknown //IL_0343: 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) //IL_037d: Unknown result type (might be due to invalid IL or missing references) //IL_0385: Expected O, but got Unknown //IL_03e9: Unknown result type (might be due to invalid IL or missing references) //IL_03ee: Unknown result type (might be due to invalid IL or missing references) //IL_03f6: Unknown result type (might be due to invalid IL or missing references) //IL_0403: Expected O, but got Unknown //IL_0497: Unknown result type (might be due to invalid IL or missing references) //IL_049c: Unknown result type (might be due to invalid IL or missing references) //IL_04a4: Unknown result type (might be due to invalid IL or missing references) //IL_04b1: Expected O, but got Unknown List<Item> list = self.buyableItemsList.ToList(); TerminalKeyword val = self.terminalNodes.allKeywords.First((TerminalKeyword keyword) => keyword.word == "buy"); TerminalNode result = val.compatibleNouns[0].result.terminalOptions[1].result; TerminalKeyword val2 = self.terminalNodes.allKeywords.First((TerminalKeyword keyword) => keyword.word == "info"); Plugin.logger.LogInfo((object)$"Adding {shopItems.Count} items to terminal"); foreach (ShopItem item in shopItems) { if (list.Any((Item x) => x.itemName == item.item.itemName)) { Plugin.logger.LogInfo((object)("Item " + item.item.itemName + " already exists in terminal, skipping")); continue; } if (item.price == -1) { item.price = item.item.creditsWorth; } else { item.item.creditsWorth = item.price; } list.Add(item.item); string itemName = item.item.itemName; char c = itemName[itemName.Length - 1]; string text = itemName; TerminalNode val3 = item.buyNode2; if ((Object)(object)val3 == (Object)null) { val3 = ScriptableObject.CreateInstance<TerminalNode>(); ((Object)val3).name = itemName.Replace(" ", "-") + "BuyNode2"; val3.displayText = "Ordered [variableAmount] " + text + ". Your new balance is [playerCredits].\n\nOur contractors enjoy fast, free shipping while on the job! Any purchased items will arrive hourly at your approximate location.\r\n\r\n"; val3.clearPreviousText = true; val3.maxCharactersToType = 15; } val3.buyItemIndex = list.Count - 1; val3.isConfirmationNode = false; val3.itemCost = item.price; val3.playSyncedClip = 0; TerminalNode val4 = item.buyNode1; if ((Object)(object)val4 == (Object)null) { val4 = ScriptableObject.CreateInstance<TerminalNode>(); ((Object)val4).name = itemName.Replace(" ", "-") + "BuyNode1"; val4.displayText = "You have requested to order " + text + ". Amount: [variableAmount].\nTotal cost of items: [totalCost].\n\nPlease CONFIRM or DENY.\r\n\r\n"; val4.clearPreviousText = true; val4.maxCharactersToType = 35; } val4.buyItemIndex = list.Count - 1; val4.isConfirmationNode = true; val4.overrideOptions = true; val4.itemCost = item.price; val4.terminalOptions = (CompatibleNoun[])(object)new CompatibleNoun[2] { new CompatibleNoun { noun = self.terminalNodes.allKeywords.First((TerminalKeyword keyword2) => keyword2.word == "confirm"), result = val3 }, new CompatibleNoun { noun = self.terminalNodes.allKeywords.First((TerminalKeyword keyword2) => keyword2.word == "deny"), result = result } }; TerminalKeyword val5 = TerminalUtils.CreateTerminalKeyword(itemName.ToLowerInvariant().Replace(" ", "-"), isVerb: false, null, null, val); List<TerminalKeyword> list2 = self.terminalNodes.allKeywords.ToList(); list2.Add(val5); self.terminalNodes.allKeywords = list2.ToArray(); List<CompatibleNoun> list3 = val.compatibleNouns.ToList(); list3.Add(new CompatibleNoun { noun = val5, result = val4 }); val.compatibleNouns = list3.ToArray(); TerminalNode val6 = item.itemInfo; if ((Object)(object)val6 == (Object)null) { val6 = ScriptableObject.CreateInstance<TerminalNode>(); ((Object)val6).name = itemName.Replace(" ", "-") + "InfoNode"; val6.displayText = "[No information about this object was found.]\n\n"; val6.clearPreviousText = true; val6.maxCharactersToType = 25; } self.terminalNodes.allKeywords = list2.ToArray(); List<CompatibleNoun> list4 = val2.compatibleNouns.ToList(); list4.Add(new CompatibleNoun { noun = val5, result = val6 }); val2.compatibleNouns = list4.ToArray(); Plugin.logger.LogInfo((object)(item.modName + " registered item: " + item.item.itemName)); } self.buyableItemsList = list.ToArray(); orig.Invoke(self); } private static void StartOfRound_Awake(orig_Awake orig, StartOfRound self) { //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Expected O, but got Unknown orig.Invoke(self); SelectableLevel[] levels = self.levels; foreach (SelectableLevel val in levels) { string name = ((Object)val).name; if (!Enum.IsDefined(typeof(Levels.LevelTypes), name)) { continue; } Levels.LevelTypes levelTypes = (Levels.LevelTypes)Enum.Parse(typeof(Levels.LevelTypes), name); foreach (ScrapItem scrapItem in scrapItems) { if (scrapItem.spawnLevels.HasFlag(levelTypes)) { SpawnableItemWithRarity item = new SpawnableItemWithRarity { spawnableItem = scrapItem.item, rarity = scrapItem.rarity }; if (!val.spawnableScrap.Any((SpawnableItemWithRarity x) => (Object)(object)x.spawnableItem == (Object)(object)scrapItem.item)) { val.spawnableScrap.Add(item); } } } } foreach (ScrapItem scrapItem2 in scrapItems) { if (!self.allItemsList.itemsList.Contains(scrapItem2.item)) { Plugin.logger.LogInfo((object)(scrapItem2.modName + " registered item: " + scrapItem2.item.itemName)); self.allItemsList.itemsList.Add(scrapItem2.item); } } foreach (ShopItem shopItem in shopItems) { if (!self.allItemsList.itemsList.Contains(shopItem.item)) { Plugin.logger.LogInfo((object)(shopItem.modName + " registered item: " + shopItem.item.itemName)); self.allItemsList.itemsList.Add(shopItem.item); } } } public static void RegisterScrap(Item spawnableItem, int rarity, Levels.LevelTypes levelFlags) { ScrapItem scrapItem = new ScrapItem(spawnableItem, rarity, levelFlags); Assembly callingAssembly = Assembly.GetCallingAssembly(); string name = callingAssembly.GetName().Name; scrapItem.modName = name; scrapItems.Add(scrapItem); } public static void RegisterShopItem(Item shopItem, TerminalNode buyNode1 = null, TerminalNode buyNode2 = null, TerminalNode itemInfo = null, int price = -1) { ShopItem shopItem2 = new ShopItem(shopItem, buyNode1, buyNode2, itemInfo, price); Assembly callingAssembly = Assembly.GetCallingAssembly(); string name = callingAssembly.GetName().Name; shopItem2.modName = name; shopItems.Add(shopItem2); } public static void RegisterShopItem(Item shopItem, int price = -1) { ShopItem shopItem2 = new ShopItem(shopItem, null, null, null, price); Assembly callingAssembly = Assembly.GetCallingAssembly(); string name = callingAssembly.GetName().Name; shopItem2.modName = name; shopItems.Add(shopItem2); } } public class Levels { [Flags] public enum LevelTypes { None = 1, ExperimentationLevel = 2, AssuranceLevel = 4, VowLevel = 8, OffenseLevel = 0x10, MarchLevel = 0x20, RendLevel = 0x40, DineLevel = 0x80, TitanLevel = 0x100, All = 0x1FE } } public class MapObjects { public class RegisteredMapObject { public SpawnableMapObject mapObject; public SpawnableOutsideObjectWithRarity outsideObject; public Levels.LevelTypes levels; public Func<SelectableLevel, AnimationCurve> spawnRateFunction; } [CompilerGenerated] private static class <>O { public static hook_Awake <0>__StartOfRound_Awake; public static hook_SpawnMapObjects <1>__RoundManager_SpawnMapObjects; } public static List<RegisteredMapObject> mapObjects = new List<RegisteredMapObject>(); public static void Init() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0032: 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_003d: Expected O, but got Unknown object obj = <>O.<0>__StartOfRound_Awake; if (obj == null) { hook_Awake val = StartOfRound_Awake; <>O.<0>__StartOfRound_Awake = val; obj = (object)val; } StartOfRound.Awake += (hook_Awake)obj; object obj2 = <>O.<1>__RoundManager_SpawnMapObjects; if (obj2 == null) { hook_SpawnMapObjects val2 = RoundManager_SpawnMapObjects; <>O.<1>__RoundManager_SpawnMapObjects = val2; obj2 = (object)val2; } RoundManager.SpawnMapObjects += (hook_SpawnMapObjects)obj2; } private static void RoundManager_SpawnMapObjects(orig_SpawnMapObjects orig, RoundManager self) { RandomMapObject[] array = Object.FindObjectsOfType<RandomMapObject>(); RandomMapObject[] array2 = array; foreach (RandomMapObject val in array2) { foreach (RegisteredMapObject mapObject in mapObjects) { if (mapObject.mapObject != null && !val.spawnablePrefabs.Any((GameObject prefab) => (Object)(object)prefab == (Object)(object)mapObject.mapObject.prefabToSpawn)) { val.spawnablePrefabs.Add(mapObject.mapObject.prefabToSpawn); } } } orig.Invoke(self); } private static void StartOfRound_Awake(orig_Awake orig, StartOfRound self) { orig.Invoke(self); SelectableLevel[] levels = self.levels; foreach (SelectableLevel val in levels) { string name = ((Object)val).name; if (!Enum.IsDefined(typeof(Levels.LevelTypes), name)) { continue; } Levels.LevelTypes levelTypes = (Levels.LevelTypes)Enum.Parse(typeof(Levels.LevelTypes), name); foreach (RegisteredMapObject mapObject in mapObjects) { if (!mapObject.levels.HasFlag(levelTypes)) { continue; } if (mapObject.mapObject != null) { if (!val.spawnableMapObjects.Any((SpawnableMapObject x) => (Object)(object)x.prefabToSpawn == (Object)(object)mapObject.mapObject.prefabToSpawn)) { List<SpawnableMapObject> list = val.spawnableMapObjects.ToList(); list.RemoveAll((SpawnableMapObject x) => (Object)(object)x.prefabToSpawn == (Object)(object)mapObject.mapObject.prefabToSpawn); val.spawnableMapObjects = list.ToArray(); } SpawnableMapObject mapObject2 = mapObject.mapObject; if (mapObject.spawnRateFunction != null) { mapObject2.numberToSpawn = mapObject.spawnRateFunction(val); } List<SpawnableMapObject> list2 = val.spawnableMapObjects.ToList(); list2.Add(mapObject2); val.spawnableMapObjects = list2.ToArray(); Plugin.logger.LogInfo((object)("Added " + ((Object)mapObject2.prefabToSpawn).name + " to " + name)); } else { if (mapObject.outsideObject == null) { continue; } if (!val.spawnableOutsideObjects.Any((SpawnableOutsideObjectWithRarity x) => (Object)(object)x.spawnableObject.prefabToSpawn == (Object)(object)mapObject.outsideObject.spawnableObject.prefabToSpawn)) { List<SpawnableOutsideObjectWithRarity> list3 = val.spawnableOutsideObjects.ToList(); list3.RemoveAll((SpawnableOutsideObjectWithRarity x) => (Object)(object)x.spawnableObject.prefabToSpawn == (Object)(object)mapObject.outsideObject.spawnableObject.prefabToSpawn); val.spawnableOutsideObjects = list3.ToArray(); } SpawnableOutsideObjectWithRarity outsideObject = mapObject.outsideObject; if (mapObject.spawnRateFunction != null) { outsideObject.randomAmount = mapObject.spawnRateFunction(val); } List<SpawnableOutsideObjectWithRarity> list4 = val.spawnableOutsideObjects.ToList(); list4.Add(outsideObject); val.spawnableOutsideObjects = list4.ToArray(); Plugin.logger.LogInfo((object)("Added " + ((Object)outsideObject.spawnableObject.prefabToSpawn).name + " to " + name)); } } } } public static void RegisterMapObject(SpawnableMapObjectDef mapObject, Levels.LevelTypes levels, Func<SelectableLevel, AnimationCurve> spawnRateFunction = null) { RegisterMapObject(mapObject.spawnableMapObject, levels, spawnRateFunction); } public static void RegisterMapObject(SpawnableMapObject mapObject, Levels.LevelTypes levels, Func<SelectableLevel, AnimationCurve> spawnRateFunction = null) { mapObjects.Add(new RegisteredMapObject { mapObject = mapObject, levels = levels, spawnRateFunction = spawnRateFunction }); } public static void RegisterOutsideObject(SpawnableOutsideObjectDef mapObject, Levels.LevelTypes levels, Func<SelectableLevel, AnimationCurve> spawnRateFunction = null) { RegisterOutsideObject(mapObject.spawnableMapObject, levels, spawnRateFunction); } public static void RegisterOutsideObject(SpawnableOutsideObjectWithRarity mapObject, Levels.LevelTypes levels, Func<SelectableLevel, AnimationCurve> spawnRateFunction = null) { mapObjects.Add(new RegisteredMapObject { outsideObject = mapObject, levels = levels, spawnRateFunction = spawnRateFunction }); } } public class NetworkPrefabs { [CompilerGenerated] private static class <>O { public static hook_Start <0>__GameNetworkManager_Start; } private static List<GameObject> _networkPrefabs = new List<GameObject>(); internal static void Init() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown object obj = <>O.<0>__GameNetworkManager_Start; if (obj == null) { hook_Start val = GameNetworkManager_Start; <>O.<0>__GameNetworkManager_Start = val; obj = (object)val; } GameNetworkManager.Start += (hook_Start)obj; } public static void RegisterNetworkPrefab(GameObject prefab) { _networkPrefabs.Add(prefab); } private static void GameNetworkManager_Start(orig_Start orig, GameNetworkManager self) { orig.Invoke(self); foreach (GameObject networkPrefab in _networkPrefabs) { ((Component)self).GetComponent<NetworkManager>().AddNetworkPrefab(networkPrefab); } } } public class Shaders { public static void FixShaders(GameObject gameObject) { Renderer[] componentsInChildren = gameObject.GetComponentsInChildren<Renderer>(); foreach (Renderer val in componentsInChildren) { Material[] materials = val.materials; foreach (Material val2 in materials) { if (((Object)val2.shader).name.Contains("Standard")) { val2.shader = Shader.Find("HDRP/Lit"); } } } } } public class TerminalUtils { public static TerminalKeyword CreateTerminalKeyword(string word, bool isVerb = false, CompatibleNoun[] compatibleNouns = null, TerminalNode specialKeywordResult = null, TerminalKeyword defaultVerb = null, bool accessTerminalObjects = false) { TerminalKeyword val = ScriptableObject.CreateInstance<TerminalKeyword>(); ((Object)val).name = word; val.word = word; val.isVerb = isVerb; val.compatibleNouns = compatibleNouns; val.specialKeywordResult = specialKeywordResult; val.defaultVerb = defaultVerb; val.accessTerminalObjects = accessTerminalObjects; return val; } } public enum StoreType { None, ShipUpgrade, Decor } public class Unlockables { public class RegisteredUnlockable { public UnlockableItem unlockable; public StoreType StoreType; public TerminalNode buyNode1; public TerminalNode buyNode2; public TerminalNode itemInfo; public int price; public string modName; public RegisteredUnlockable(UnlockableItem unlockable, TerminalNode buyNode1 = null, TerminalNode buyNode2 = null, TerminalNode itemInfo = null, int price = -1) { this.unlockable = unlockable; this.buyNode1 = buyNode1; this.buyNode2 = buyNode2; this.itemInfo = itemInfo; this.price = price; } } [CompilerGenerated] private static class <>O { public static hook_Awake <0>__StartOfRound_Awake; public static hook_Start <1>__Terminal_Start; public static hook_TextPostProcess <2>__Terminal_TextPostProcess; } public static List<RegisteredUnlockable> registeredUnlockables = new List<RegisteredUnlockable>(); public static void Init() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0032: 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_003d: Expected O, but got Unknown //IL_0053: 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: Expected O, but got Unknown object obj = <>O.<0>__StartOfRound_Awake; if (obj == null) { hook_Awake val = StartOfRound_Awake; <>O.<0>__StartOfRound_Awake = val; obj = (object)val; } StartOfRound.Awake += (hook_Awake)obj; object obj2 = <>O.<1>__Terminal_Start; if (obj2 == null) { hook_Start val2 = Terminal_Start; <>O.<1>__Terminal_Start = val2; obj2 = (object)val2; } Terminal.Start += (hook_Start)obj2; object obj3 = <>O.<2>__Terminal_TextPostProcess; if (obj3 == null) { hook_TextPostProcess val3 = Terminal_TextPostProcess; <>O.<2>__Terminal_TextPostProcess = val3; obj3 = (object)val3; } Terminal.TextPostProcess += (hook_TextPostProcess)obj3; } private static string Terminal_TextPostProcess(orig_TextPostProcess orig, Terminal self, string modifiedDisplayText, TerminalNode node) { if (modifiedDisplayText.Contains("[buyableItemsList]") && modifiedDisplayText.Contains("[unlockablesSelectionList]")) { int num = modifiedDisplayText.IndexOf(":"); foreach (RegisteredUnlockable registeredUnlockable in registeredUnlockables) { if (registeredUnlockable.StoreType == StoreType.ShipUpgrade) { string unlockableName = registeredUnlockable.unlockable.unlockableName; int price = registeredUnlockable.price; string value = $"\n* {unlockableName} // Price: ${price}"; modifiedDisplayText = modifiedDisplayText.Insert(num + 1, value); } } } return orig.Invoke(self, modifiedDisplayText, node); } private static void Terminal_Start(orig_Start orig, Terminal self) { //IL_0390: Unknown result type (might be due to invalid IL or missing references) //IL_0395: Unknown result type (might be due to invalid IL or missing references) //IL_03ca: Unknown result type (might be due to invalid IL or missing references) //IL_03d3: Expected O, but got Unknown //IL_03d5: Unknown result type (might be due to invalid IL or missing references) //IL_03da: Unknown result type (might be due to invalid IL or missing references) //IL_040f: Unknown result type (might be due to invalid IL or missing references) //IL_0417: Expected O, but got Unknown //IL_049e: Unknown result type (might be due to invalid IL or missing references) //IL_04a3: Unknown result type (might be due to invalid IL or missing references) //IL_04b0: Unknown result type (might be due to invalid IL or missing references) //IL_04bd: Expected O, but got Unknown //IL_0551: Unknown result type (might be due to invalid IL or missing references) //IL_0556: Unknown result type (might be due to invalid IL or missing references) //IL_0563: Unknown result type (might be due to invalid IL or missing references) //IL_0570: Expected O, but got Unknown TerminalKeyword val = self.terminalNodes.allKeywords.First((TerminalKeyword keyword) => keyword.word == "buy"); TerminalNode result = val.compatibleNouns[0].result.terminalOptions[1].result; TerminalKeyword val2 = self.terminalNodes.allKeywords.First((TerminalKeyword keyword) => keyword.word == "info"); List<RegisteredUnlockable> list = registeredUnlockables.FindAll((RegisteredUnlockable unlockable) => unlockable.price != -1).ToList(); Plugin.logger.LogInfo((object)$"Adding {list.Count} items to terminal"); foreach (RegisteredUnlockable item in list) { string unlockableName = item.unlockable.unlockableName; TerminalKeyword keyword3 = TerminalUtils.CreateTerminalKeyword(unlockableName.ToLowerInvariant().Replace(" ", "-"), isVerb: false, null, null, val); if (self.terminalNodes.allKeywords.Any((TerminalKeyword kw) => kw.word == keyword3.word)) { Plugin.logger.LogInfo((object)("Keyword " + keyword3.word + " already registed, skipping.")); continue; } int shipUnlockableID = StartOfRound.Instance.unlockablesList.unlockables.FindIndex((UnlockableItem unlockable) => unlockable.unlockableName == item.unlockable.unlockableName); StartOfRound instance = StartOfRound.Instance; if ((Object)(object)instance == (Object)null) { Debug.Log((object)"STARTOFROUND INSTANCE NOT FOUND"); } if (item.price == -1 && (Object)(object)item.buyNode1 != (Object)null) { item.price = item.buyNode1.itemCost; } char c = unlockableName[unlockableName.Length - 1]; string text = unlockableName; TerminalNode val3 = item.buyNode2; if ((Object)(object)val3 == (Object)null) { val3 = ScriptableObject.CreateInstance<TerminalNode>(); ((Object)val3).name = unlockableName.Replace(" ", "-") + "BuyNode2"; val3.displayText = "Ordered [variableAmount] " + text + ". Your new balance is [playerCredits].\n\nOur contractors enjoy fast, free shipping while on the job! Any purchased items will arrive hourly at your approximate location.\r\n\r\n"; val3.clearPreviousText = true; val3.maxCharactersToType = 15; } val3.buyItemIndex = -1; val3.shipUnlockableID = shipUnlockableID; val3.buyUnlockable = true; val3.creatureName = unlockableName; val3.isConfirmationNode = false; val3.itemCost = item.price; val3.playSyncedClip = 0; TerminalNode val4 = item.buyNode1; if ((Object)(object)val4 == (Object)null) { val4 = ScriptableObject.CreateInstance<TerminalNode>(); ((Object)val4).name = unlockableName.Replace(" ", "-") + "BuyNode1"; val4.displayText = "You have requested to order " + text + ". Amount: [variableAmount].\nTotal cost of items: [totalCost].\n\nPlease CONFIRM or DENY.\r\n\r\n"; val4.clearPreviousText = true; val4.maxCharactersToType = 35; } val4.buyItemIndex = -1; val4.shipUnlockableID = shipUnlockableID; val4.creatureName = unlockableName; val4.isConfirmationNode = true; val4.overrideOptions = true; val4.itemCost = item.price; val4.terminalOptions = (CompatibleNoun[])(object)new CompatibleNoun[2] { new CompatibleNoun { noun = self.terminalNodes.allKeywords.First((TerminalKeyword keyword2) => keyword2.word == "confirm"), result = val3 }, new CompatibleNoun { noun = self.terminalNodes.allKeywords.First((TerminalKeyword keyword2) => keyword2.word == "deny"), result = result } }; if (item.StoreType == StoreType.Decor) { item.unlockable.shopSelectionNode = val4; } else { item.unlockable.shopSelectionNode = null; } List<TerminalKeyword> list2 = self.terminalNodes.allKeywords.ToList(); list2.Add(keyword3); self.terminalNodes.allKeywords = list2.ToArray(); List<CompatibleNoun> list3 = val.compatibleNouns.ToList(); list3.Add(new CompatibleNoun { noun = keyword3, result = val4 }); val.compatibleNouns = list3.ToArray(); TerminalNode val5 = item.itemInfo; if ((Object)(object)val5 == (Object)null) { val5 = ScriptableObject.CreateInstance<TerminalNode>(); ((Object)val5).name = unlockableName.Replace(" ", "-") + "InfoNode"; val5.displayText = "[No information about this object was found.]\n\n"; val5.clearPreviousText = true; val5.maxCharactersToType = 25; } self.terminalNodes.allKeywords = list2.ToArray(); List<CompatibleNoun> list4 = val2.compatibleNouns.ToList(); list4.Add(new CompatibleNoun { noun = keyword3, result = val5 }); val2.compatibleNouns = list4.ToArray(); Plugin.logger.LogInfo((object)(item.modName + " registered item: " + item.unlockable.unlockableName)); } orig.Invoke(self); } private static void StartOfRound_Awake(orig_Awake orig, StartOfRound self) { orig.Invoke(self); Plugin.logger.LogInfo((object)$"Adding {registeredUnlockables.Count} unlockables to unlockables list"); foreach (RegisteredUnlockable unlockable in registeredUnlockables) { if (self.unlockablesList.unlockables.Any((UnlockableItem x) => x.unlockableName == unlockable.unlockable.unlockableName)) { Plugin.logger.LogInfo((object)("Unlockable " + unlockable.unlockable.unlockableName + " already exists in unlockables list, skipping")); continue; } if ((Object)(object)unlockable.unlockable.prefabObject != (Object)null) { PlaceableShipObject componentInChildren = unlockable.unlockable.prefabObject.GetComponentInChildren<PlaceableShipObject>(); if ((Object)(object)componentInChildren != (Object)null) { componentInChildren.unlockableID = self.unlockablesList.unlockables.Count; } } self.unlockablesList.unlockables.Add(unlockable.unlockable); } } public static void RegisterUnlockable(UnlockableItemDef unlockable, int price = -1, StoreType storeType = StoreType.None) { RegisterUnlockable(unlockable.unlockable, storeType, null, null, null, price); } public static void RegisterUnlockable(UnlockableItem unlockable, int price = -1, StoreType storeType = StoreType.None) { RegisterUnlockable(unlockable, storeType, null, null, null, price); } public static void RegisterUnlockable(UnlockableItemDef unlockable, StoreType storeType = StoreType.None, TerminalNode buyNode1 = null, TerminalNode buyNode2 = null, TerminalNode itemInfo = null, int price = -1) { RegisterUnlockable(unlockable.unlockable, storeType, buyNode1, buyNode2, itemInfo, price); } public static void RegisterUnlockable(UnlockableItem unlockable, StoreType storeType = StoreType.None, TerminalNode buyNode1 = null, TerminalNode buyNode2 = null, TerminalNode itemInfo = null, int price = -1) { RegisteredUnlockable registeredUnlockable = new RegisteredUnlockable(unlockable, buyNode1, buyNode2, itemInfo, price); Assembly callingAssembly = Assembly.GetCallingAssembly(); string name = callingAssembly.GetName().Name; registeredUnlockable.modName = name; registeredUnlockable.StoreType = storeType; registeredUnlockables.Add(registeredUnlockable); } } } namespace LethalLib.Extras { [CreateAssetMenu(menuName = "ScriptableObjects/DungeonDef")] public class DungeonDef : ScriptableObject { public DungeonFlow dungeonFlow; [Range(0f, 300f)] public int rarity; public AudioClip firstTimeDungeonAudio; } [CreateAssetMenu(menuName = "ScriptableObjects/DungeonGraphLine")] public class DungeonGraphLineDef : ScriptableObject { public GraphLine graphLine; } [CreateAssetMenu(menuName = "ScriptableObjects/GameObjectChance")] public class GameObjectChanceDef : ScriptableObject { public GameObjectChance gameObjectChance; } [CreateAssetMenu(menuName = "ScriptableObjects/SpawnableMapObject")] public class SpawnableMapObjectDef : ScriptableObject { public SpawnableMapObject spawnableMapObject; } [CreateAssetMenu(menuName = "ScriptableObjects/SpawnableOutsideObject")] public class SpawnableOutsideObjectDef : ScriptableObject { public SpawnableOutsideObjectWithRarity spawnableMapObject; } [CreateAssetMenu(menuName = "ScriptableObjects/UnlockableItem")] public class UnlockableItemDef : ScriptableObject { public StoreType storeType = StoreType.None; public UnlockableItem unlockable; } }
BepInEx/plugins/Evaisa-LethalThings/LethalThings/LethalThings.dll
Decompiled a year ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using System.Threading; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using GameNetcodeStuff; using LethalLib.Extras; using LethalLib.Modules; using LethalThings.Extensions; using LethalThings.MonoBehaviours; using LethalThings.Patches; using Microsoft.CodeAnalysis; using On; using On.GameNetcodeStuff; using TMPro; using Unity.Netcode; using Unity.Netcode.Components; using UnityEngine; using UnityEngine.AI; using UnityEngine.InputSystem; using UnityEngine.InputSystem.Controls; using UnityEngine.SceneManagement; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("LethalThings")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyDescription("Mod for Lethal Company")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+2f1b398a39dfb0aa0eef0fd49c7d27b56f080c41")] [assembly: AssemblyProduct("LethalThings")] [assembly: AssemblyTitle("LethalThings")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] internal class <Module> { static <Module>() { NetworkVariableSerializationTypes.InitializeSerializer_UnmanagedByMemcpy<bool>(); NetworkVariableSerializationTypes.InitializeEqualityChecker_UnmanagedIEquatable<bool>(); NetworkVariableSerializationTypes.InitializeSerializer_UnmanagedByMemcpy<HackingTool.HackState>(); NetworkVariableSerializationTypes.InitializeEqualityChecker_UnmanagedValueEquals<HackingTool.HackState>(); NetworkVariableSerializationTypes.InitializeSerializer_UnmanagedByMemcpy<float>(); NetworkVariableSerializationTypes.InitializeEqualityChecker_UnmanagedIEquatable<float>(); } } 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; } } } namespace LethalThings { public class Config { public static ConfigEntry<int> arsonSpawnWeight; public static ConfigEntry<int> dirtyArsonSpawnWeight; public static ConfigEntry<int> toimariSpawnWeight; public static ConfigEntry<int> hamisSpawnWeight; public static ConfigEntry<int> cookieSpawnWeight; public static ConfigEntry<int> maxwellSpawnWeight; public static ConfigEntry<float> evilMaxwellChance; public static ConfigEntry<bool> maxwellPlayMusicDefault; public static ConfigEntry<int> glizzySpawnChance; public static ConfigEntry<bool> toyHammerEnabled; public static ConfigEntry<int> toyHammerPrice; public static ConfigEntry<bool> pouchyBeltEnabled; public static ConfigEntry<int> pouchyBeltPrice; public static ConfigEntry<bool> remoteRadarEnabled; public static ConfigEntry<int> remoteRadarPrice; public static ConfigEntry<bool> rocketLauncherEnabled; public static ConfigEntry<int> rocketLauncherPrice; public static ConfigEntry<bool> hackingToolEnabled; public static ConfigEntry<int> hackingToolPrice; public static ConfigEntry<int> boombaSpawnWeight; public static ConfigEntry<bool> rugsEnabled; public static ConfigEntry<int> smallRugPrice; public static ConfigEntry<int> largeRugPrice; public static ConfigEntry<bool> fatalitiesSignEnabled; public static ConfigEntry<int> fatalitiesSignPrice; public static ConfigEntry<bool> teleporterTrapsEnabled; public static ConfigEntry<bool> enableItemChargerElectrocution; public static ConfigEntry<int> itemChargerElectrocutionDamage; public static ConfigEntry<bool> disableOverlappingModContent; public static ConfigFile VolumeConfig; public static void Load() { //IL_03b2: Unknown result type (might be due to invalid IL or missing references) //IL_03bc: Expected O, but got Unknown arsonSpawnWeight = Plugin.config.Bind<int>("Scrap", "Arson", 10, "How much does Arson spawn, higher = more common"); dirtyArsonSpawnWeight = Plugin.config.Bind<int>("Scrap", "DirtyArson", 10, "How much does Arson (Dirty) spawn, higher = more common"); toimariSpawnWeight = Plugin.config.Bind<int>("Scrap", "Toimari", 20, "How much does Toimari spawn, higher = more common"); hamisSpawnWeight = Plugin.config.Bind<int>("Scrap", "Hamis", 20, "How much does Hamis spawn, higher = more common"); cookieSpawnWeight = Plugin.config.Bind<int>("Scrap", "Cookie", 20, "How much does Cookie spawn, higher = more common"); maxwellSpawnWeight = Plugin.config.Bind<int>("Scrap", "Maxwell", 3, "How much does Maxwell spawn, higher = more common"); evilMaxwellChance = Plugin.config.Bind<float>("Scrap", "MaxwellEvilChance", 10f, "Chance for maxwell to be evil, percentage."); maxwellPlayMusicDefault = Plugin.config.Bind<bool>("Scrap", "MaxwellPlayMusicDefault", true, "Does Maxwell play music by default?"); glizzySpawnChance = Plugin.config.Bind<int>("Scrap", "GlizzySpawnChance", 5, "How much do glizzies spawn, higher = more common"); toyHammerEnabled = Plugin.config.Bind<bool>("Items", "ToyHammer", true, "Is Toy Hammer enabled?"); toyHammerPrice = Plugin.config.Bind<int>("Items", "ToyHammerPrice", 80, "How much does Toy Hammer cost?"); pouchyBeltEnabled = Plugin.config.Bind<bool>("Items", "PouchyBelt", true, "Is Pouchy Belt enabled?"); pouchyBeltPrice = Plugin.config.Bind<int>("Items", "PouchyBeltPrice", 290, "How much does Pouchy Belt cost?"); remoteRadarEnabled = Plugin.config.Bind<bool>("Items", "RemoteRadar", true, "Is Remote Radar enabled?"); remoteRadarPrice = Plugin.config.Bind<int>("Items", "RemoteRadarPrice", 240, "How much does Remote Radar cost?"); rocketLauncherEnabled = Plugin.config.Bind<bool>("Items", "RocketLauncher", true, "Is Rocket Launcher enabled?"); rocketLauncherPrice = Plugin.config.Bind<int>("Items", "RocketLauncherPrice", 260, "How much does Rocket Launcher cost?"); hackingToolEnabled = Plugin.config.Bind<bool>("Items", "HackingTool", true, "Is Hacking Tool enabled?"); hackingToolPrice = Plugin.config.Bind<int>("Items", "HackingToolPrice", 190, "How much does Hacking Tool cost?"); boombaSpawnWeight = Plugin.config.Bind<int>("Enemies", "Boomba", 20, "How much does Boomba spawn, higher = more common"); rugsEnabled = Plugin.config.Bind<bool>("Decor", "Rugs", true, "Are rugs enabled?"); smallRugPrice = Plugin.config.Bind<int>("Decor", "SmallRugPrice", 80, "How much does a small rug cost?"); largeRugPrice = Plugin.config.Bind<int>("Decor", "LargeRugPrice", 110, "How much does a large rug cost?"); fatalitiesSignEnabled = Plugin.config.Bind<bool>("Decor", "FatalitiesSign", true, "Is Fatalities Sign enabled?"); fatalitiesSignPrice = Plugin.config.Bind<int>("Decor", "FatalitiesSignPrice", 100, "How much does Fatalities Sign cost?"); teleporterTrapsEnabled = Plugin.config.Bind<bool>("Traps", "TeleporterTraps", true, "Are teleporter traps enabled?"); enableItemChargerElectrocution = Plugin.config.Bind<bool>("Misc", "EnableItemChargerElectrocution", true, "Do players get electrocuted when stuffing conductive objects in the item charger."); itemChargerElectrocutionDamage = Plugin.config.Bind<int>("Misc", "ItemChargerElectrocutionDamage", 20, "How much damage does the item charger electrocution do."); disableOverlappingModContent = Plugin.config.Bind<bool>("Misc", "DisableOverlappingModContent", true, "Disable content from other mods which exists in this one (e.g. maxwell)."); VolumeConfig = new ConfigFile(Paths.ConfigPath + "\\LethalThings.AudioVolume.cfg", true); } } public class Content { public class CustomItem { public string name = ""; public string itemPath = ""; public string infoPath = ""; public Action<Item> itemAction = delegate { }; public bool enabled = true; public CustomItem(string name, string itemPath, string infoPath, Action<Item> action = null) { this.name = name; this.itemPath = itemPath; this.infoPath = infoPath; if (action != null) { itemAction = action; } } public static CustomItem Add(string name, string itemPath, string infoPath = null, Action<Item> action = null) { return new CustomItem(name, itemPath, infoPath, action); } } public class CustomUnlockable { public string name = ""; public string unlockablePath = ""; public string infoPath = ""; public Action<UnlockableItem> unlockableAction = delegate { }; public bool enabled = true; public int unlockCost = -1; public CustomUnlockable(string name, string unlockablePath, string infoPath, Action<UnlockableItem> action = null, int unlockCost = -1) { this.name = name; this.unlockablePath = unlockablePath; this.infoPath = infoPath; if (action != null) { unlockableAction = action; } this.unlockCost = unlockCost; } public static CustomUnlockable Add(string name, string unlockablePath, string infoPath = null, Action<UnlockableItem> action = null, int unlockCost = -1, bool enabled = true) { return new CustomUnlockable(name, unlockablePath, infoPath, action, unlockCost) { enabled = enabled }; } } public class CustomShopItem : CustomItem { public int itemPrice; public CustomShopItem(string name, string itemPath, string infoPath = null, int itemPrice = 0, Action<Item> action = null) : base(name, itemPath, infoPath, action) { this.itemPrice = itemPrice; } public static CustomShopItem Add(string name, string itemPath, string infoPath = null, int itemPrice = 0, Action<Item> action = null, bool enabled = true) { return new CustomShopItem(name, itemPath, infoPath, itemPrice, action) { enabled = enabled }; } } public class CustomScrap : CustomItem { public LevelTypes levelType = (LevelTypes)510; public int rarity; public CustomScrap(string name, string itemPath, LevelTypes levelType, int rarity, Action<Item> action = null) : base(name, itemPath, null, action) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) this.levelType = levelType; this.rarity = rarity; } public static CustomScrap Add(string name, string itemPath, LevelTypes levelType, int rarity, Action<Item> action = null) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) return new CustomScrap(name, itemPath, levelType, rarity, action); } } public class CustomEnemy { public string name; public string enemyPath; public int rarity; public LevelTypes levelFlags; public SpawnType spawnType; public string infoKeyword; public string infoNode; public bool enabled = true; public CustomEnemy(string name, string enemyPath, int rarity, LevelTypes levelFlags, SpawnType spawnType, string infoKeyword, string infoNode) { //IL_0023: 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_002b: 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) this.name = name; this.enemyPath = enemyPath; this.rarity = rarity; this.levelFlags = levelFlags; this.spawnType = spawnType; this.infoKeyword = infoKeyword; this.infoNode = infoNode; } public static CustomEnemy Add(string name, string enemyPath, int rarity, LevelTypes levelFlags, SpawnType spawnType, string infoKeyword, string infoNode, bool enabled = true) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0004: Unknown result type (might be due to invalid IL or missing references) return new CustomEnemy(name, enemyPath, rarity, levelFlags, spawnType, infoKeyword, infoNode) { enabled = enabled }; } } public class CustomMapObject { public string name; public string objectPath; public LevelTypes levelFlags; public Func<SelectableLevel, AnimationCurve> spawnRateFunction; public bool enabled = true; public CustomMapObject(string name, string objectPath, LevelTypes levelFlags, Func<SelectableLevel, AnimationCurve> spawnRateFunction = null, bool enabled = false) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) this.name = name; this.objectPath = objectPath; this.levelFlags = levelFlags; this.spawnRateFunction = spawnRateFunction; this.enabled = enabled; } public static CustomMapObject Add(string name, string objectPath, LevelTypes levelFlags, Func<SelectableLevel, AnimationCurve> spawnRateFunction = null, bool enabled = false) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) return new CustomMapObject(name, objectPath, levelFlags, spawnRateFunction, enabled); } } public static AssetBundle MainAssets; public static Dictionary<string, GameObject> Prefabs = new Dictionary<string, GameObject>(); public static List<CustomUnlockable> customUnlockables; public static List<CustomItem> customItems; public static List<CustomEnemy> customEnemies; public static List<CustomMapObject> customMapObjects; public static GameObject ConfigManagerPrefab; public static void TryLoadAssets() { if ((Object)(object)MainAssets == (Object)null) { MainAssets = AssetBundle.LoadFromFile(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "lethalthings")); Plugin.logger.LogInfo((object)"Loaded asset bundle"); } } public static void Load() { //IL_0428: Unknown result type (might be due to invalid IL or missing references) //IL_05a4: Unknown result type (might be due to invalid IL or missing references) //IL_05ab: Unknown result type (might be due to invalid IL or missing references) //IL_063a: Unknown result type (might be due to invalid IL or missing references) TryLoadAssets(); customItems = new List<CustomItem> { CustomScrap.Add("Arson", "Assets/Custom/LethalThings/Scrap/Arson/ArsonPlush.asset", (LevelTypes)510, Config.arsonSpawnWeight.Value), CustomScrap.Add("Cookie", "Assets/Custom/LethalThings/Scrap/Cookie/CookieFumo.asset", (LevelTypes)510, Config.cookieSpawnWeight.Value), CustomScrap.Add("Bilka", "Assets/Custom/LethalThings/Scrap/Toimari/ToimariPlush.asset", (LevelTypes)510, Config.toimariSpawnWeight.Value), CustomScrap.Add("Hamis", "Assets/Custom/LethalThings/Scrap/Hamis/HamisPlush.asset", (LevelTypes)510, Config.hamisSpawnWeight.Value), CustomScrap.Add("ArsonDirty", "Assets/Custom/LethalThings/Scrap/Arson/ArsonPlushDirty.asset", (LevelTypes)510, Config.dirtyArsonSpawnWeight.Value), CustomScrap.Add("Maxwell", "Assets/Custom/LethalThings/Scrap/Maxwell/Dingus.asset", (LevelTypes)510, Config.maxwellSpawnWeight.Value), CustomScrap.Add("Glizzy", "Assets/Custom/LethalThings/Scrap/glizzy/glizzy.asset", (LevelTypes)510, Config.glizzySpawnChance.Value), CustomShopItem.Add("RocketLauncher", "Assets/Custom/LethalThings/Items/RocketLauncher/RocketLauncher.asset", "Assets/Custom/LethalThings/Items/RocketLauncher/RocketLauncherInfo.asset", Config.rocketLauncherPrice.Value, delegate(Item item) { NetworkPrefabs.RegisterNetworkPrefab(item.spawnPrefab.GetComponent<RocketLauncher>().missilePrefab); }, Config.rocketLauncherEnabled.Value), CustomShopItem.Add("ToyHammer", "Assets/Custom/LethalThings/Items/ToyHammer/ToyHammer.asset", "Assets/Custom/LethalThings/Items/ToyHammer/ToyHammerInfo.asset", Config.toyHammerPrice.Value, null, Config.toyHammerEnabled.Value), CustomShopItem.Add("RemoteRadar", "Assets/Custom/LethalThings/Items/Radar/HandheldRadar.asset", "Assets/Custom/LethalThings/Items/Radar/HandheldRadarInfo.asset", Config.remoteRadarPrice.Value, null, Config.remoteRadarEnabled.Value), CustomShopItem.Add("PouchyBelt", "Assets/Custom/LethalThings/Items/Pouch/Pouch.asset", "Assets/Custom/LethalThings/Items/Pouch/PouchInfo.asset", Config.pouchyBeltPrice.Value, null, Config.pouchyBeltEnabled.Value), CustomShopItem.Add("HackingTool", "Assets/Custom/LethalThings/Items/HackingTool/HackingTool.asset", "Assets/Custom/LethalThings/Items/HackingTool/HackingToolInfo.asset", Config.hackingToolPrice.Value, null, Config.hackingToolEnabled.Value) }; customEnemies = new List<CustomEnemy> { CustomEnemy.Add("Boomba", "Assets/Custom/LethalThings/Enemies/Roomba/Boomba.asset", Config.boombaSpawnWeight.Value, (LevelTypes)510, (SpawnType)0, null, "Assets/Custom/LethalThings/Enemies/Roomba/BoombaFile.asset") }; customUnlockables = new List<CustomUnlockable> { CustomUnlockable.Add("SmallRug", "Assets/Custom/LethalThings/Unlockables/Rug/SmallRug.asset", "Assets/Custom/LethalThings/Unlockables/Rug/RugInfo.asset", null, Config.smallRugPrice.Value, Config.rugsEnabled.Value), CustomUnlockable.Add("LargeRug", "Assets/Custom/LethalThings/Unlockables/Rug/LargeRug.asset", "Assets/Custom/LethalThings/Unlockables/Rug/RugInfo.asset", null, Config.largeRugPrice.Value, Config.rugsEnabled.Value), CustomUnlockable.Add("FatalitiesSign", "Assets/Custom/LethalThings/Unlockables/Sign/Sign.asset", "Assets/Custom/LethalThings/Unlockables/Sign/SignInfo.asset", null, Config.fatalitiesSignPrice.Value, Config.fatalitiesSignEnabled.Value) }; customMapObjects = new List<CustomMapObject> { CustomMapObject.Add("TeleporterTrap", "Assets/Custom/LethalThings/hazards/TeleporterTrap/TeleporterTrap.asset", (LevelTypes)510, (SelectableLevel level) => new AnimationCurve((Keyframe[])(object)new Keyframe[2] { new Keyframe(0f, 0f), new Keyframe(1f, 4f) }), Config.teleporterTrapsEnabled.Value) }; foreach (CustomItem customItem in customItems) { if (customItem.enabled) { Item val = MainAssets.LoadAsset<Item>(customItem.itemPath); if ((Object)(object)val.spawnPrefab.GetComponent<NetworkTransform>() == (Object)null) { val.spawnPrefab.AddComponent<NetworkTransform>(); } Prefabs.Add(customItem.name, val.spawnPrefab); NetworkPrefabs.RegisterNetworkPrefab(val.spawnPrefab); customItem.itemAction(val); if (customItem is CustomShopItem) { TerminalNode val2 = MainAssets.LoadAsset<TerminalNode>(customItem.infoPath); Plugin.logger.LogInfo((object)$"Registering shop item {customItem.name} with price {((CustomShopItem)customItem).itemPrice}"); Items.RegisterShopItem(val, (TerminalNode)null, (TerminalNode)null, val2, ((CustomShopItem)customItem).itemPrice); } else if (customItem is CustomScrap) { Items.RegisterScrap(val, ((CustomScrap)customItem).rarity, ((CustomScrap)customItem).levelType); } } } foreach (CustomUnlockable customUnlockable in customUnlockables) { if (customUnlockable.enabled) { UnlockableItem unlockable = MainAssets.LoadAsset<UnlockableItemDef>(customUnlockable.unlockablePath).unlockable; if ((Object)(object)unlockable.prefabObject != (Object)null) { NetworkPrefabs.RegisterNetworkPrefab(unlockable.prefabObject); } Prefabs.Add(customUnlockable.name, unlockable.prefabObject); TerminalNode val3 = null; if (customUnlockable.infoPath != null) { val3 = MainAssets.LoadAsset<TerminalNode>(customUnlockable.infoPath); } Unlockables.RegisterUnlockable(unlockable, (StoreType)2, (TerminalNode)null, (TerminalNode)null, val3, customUnlockable.unlockCost); } } foreach (CustomEnemy customEnemy in customEnemies) { if (customEnemy.enabled) { EnemyType val4 = MainAssets.LoadAsset<EnemyType>(customEnemy.enemyPath); TerminalNode val5 = MainAssets.LoadAsset<TerminalNode>(customEnemy.infoNode); TerminalKeyword val6 = null; if (customEnemy.infoKeyword != null) { val6 = MainAssets.LoadAsset<TerminalKeyword>(customEnemy.infoKeyword); } NetworkPrefabs.RegisterNetworkPrefab(val4.enemyPrefab); Prefabs.Add(customEnemy.name, val4.enemyPrefab); Enemies.RegisterEnemy(val4, customEnemy.rarity, customEnemy.levelFlags, customEnemy.spawnType, val5, val6); } } foreach (CustomMapObject customMapObject in customMapObjects) { if (customMapObject.enabled) { SpawnableMapObjectDef val7 = MainAssets.LoadAsset<SpawnableMapObjectDef>(customMapObject.objectPath); NetworkPrefabs.RegisterNetworkPrefab(val7.spawnableMapObject.prefabToSpawn); Prefabs.Add(customMapObject.name, val7.spawnableMapObject.prefabToSpawn); MapObjects.RegisterMapObject(val7, customMapObject.levelFlags, customMapObject.spawnRateFunction); } } foreach (KeyValuePair<string, GameObject> prefab in Prefabs) { GameObject value = prefab.Value; string key = prefab.Key; AudioSource[] componentsInChildren = value.GetComponentsInChildren<AudioSource>(); if (componentsInChildren.Length != 0) { ConfigEntry<float> val8 = Config.VolumeConfig.Bind<float>("Volume", key ?? "", 100f, "Audio volume for " + key + " (0 - 100)"); AudioSource[] array = componentsInChildren; foreach (AudioSource obj in array) { obj.volume *= val8.Value / 100f; } } } Type[] types = Assembly.GetExecutingAssembly().GetTypes(); for (int i = 0; i < types.Length; i++) { MethodInfo[] methods = types[i].GetMethods(BindingFlags.Instance | BindingFlags.Static | BindingFlags.NonPublic); foreach (MethodInfo methodInfo in methods) { if (methodInfo.GetCustomAttributes(typeof(RuntimeInitializeOnLoadMethodAttribute), inherit: false).Length != 0) { methodInfo.Invoke(null, null); } } } Plugin.logger.LogInfo((object)"Custom content loaded!"); } } public class Dingus : GrabbableObject { public AudioSource noiseAudio; public AudioSource noiseAudioFar; public AudioSource musicAudio; public AudioSource musicAudioFar; [Space(3f)] public AudioClip[] noiseSFX; public AudioClip[] noiseSFXFar; public AudioClip evilNoise; [Space(3f)] public float noiseRange; public float maxLoudness; public float minLoudness; public float minPitch; public float maxPitch; private Random noisemakerRandom; public Animator triggerAnimator; private int timesPlayedWithoutTurningOff; private RoundManager roundManager; private float noiseInterval = 1f; public Animator danceAnimator; private NetworkVariable<bool> isEvil = new NetworkVariable<bool>(false, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); public GameObject evilObject; public NetworkVariable<bool> isPlayingMusic = new NetworkVariable<bool>(Config.maxwellPlayMusicDefault.Value, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)1); public override void Start() { ((GrabbableObject)this).Start(); roundManager = Object.FindObjectOfType<RoundManager>(); noisemakerRandom = new Random(StartOfRound.Instance.randomMapSeed + 85); if (((NetworkBehaviour)this).IsOwner) { isPlayingMusic.Value = Config.maxwellPlayMusicDefault.Value; } if (((NetworkBehaviour)this).IsHost) { isEvil.Value = Random.Range(0f, 100f) <= Config.evilMaxwellChance.Value; } Debug.Log((object)"Making the dingus dance"); } public override void ItemActivate(bool used, bool buttonDown = true) { //IL_0117: Unknown result type (might be due to invalid IL or missing references) ((GrabbableObject)this).ItemActivate(used, buttonDown); if (!((Object)(object)GameNetworkManager.Instance.localPlayerController == (Object)null)) { int num = noisemakerRandom.Next(0, noiseSFX.Length); float num2 = (float)noisemakerRandom.Next((int)(minLoudness * 100f), (int)(maxLoudness * 100f)) / 100f; float pitch = (float)noisemakerRandom.Next((int)(minPitch * 100f), (int)(maxPitch * 100f)) / 100f; noiseAudio.pitch = pitch; noiseAudio.PlayOneShot(noiseSFX[num], num2); if ((Object)(object)noiseAudioFar != (Object)null) { noiseAudioFar.pitch = pitch; noiseAudioFar.PlayOneShot(noiseSFXFar[num], num2); } if ((Object)(object)triggerAnimator != (Object)null) { triggerAnimator.SetTrigger("playAnim"); } WalkieTalkie.TransmitOneShotAudio(noiseAudio, noiseSFX[num], num2); RoundManager.Instance.PlayAudibleNoise(((Component)this).transform.position, noiseRange, num2, 0, base.isInElevator && StartOfRound.Instance.hangarDoorsClosed, 0); } } public override void DiscardItem() { if ((Object)(object)base.playerHeldBy != (Object)null) { base.playerHeldBy.equippedUsableItemQE = false; } base.isBeingUsed = false; ((GrabbableObject)this).DiscardItem(); } public override void EquipItem() { ((GrabbableObject)this).EquipItem(); base.playerHeldBy.equippedUsableItemQE = true; danceAnimator.Play("dingusIdle"); Debug.Log((object)"Making the dingus idle"); if (((NetworkBehaviour)this).IsOwner) { HUDManager.Instance.DisplayTip("Maxwell acquired", "Press Q to toggle music.", false, true, "LCTip_UseManual"); } } public override void ItemInteractLeftRight(bool right) { ((GrabbableObject)this).ItemInteractLeftRight(right); if (!right && ((NetworkBehaviour)this).IsOwner) { isPlayingMusic.Value = !isPlayingMusic.Value; } } public override void InteractItem() { ((GrabbableObject)this).InteractItem(); if (isEvil.Value) { if (((NetworkBehaviour)this).IsOwner) { isPlayingMusic.Value = false; } danceAnimator.Play("dingusIdle"); if (musicAudio.isPlaying) { musicAudio.Pause(); musicAudioFar.Pause(); } ((MonoBehaviour)this).StartCoroutine(evilMaxwellMoment()); } } public IEnumerator evilMaxwellMoment() { yield return (object)new WaitForSeconds(1f); noiseAudio.PlayOneShot(evilNoise, 1f); evilObject.SetActive(true); ((Renderer)base.mainObjectRenderer).enabled = false; if ((Object)(object)noiseAudioFar != (Object)null) { noiseAudioFar.PlayOneShot(evilNoise, 1f); } if ((Object)(object)triggerAnimator != (Object)null) { triggerAnimator.SetTrigger("playAnim"); } WalkieTalkie.TransmitOneShotAudio(noiseAudio, evilNoise, 1f); RoundManager.Instance.PlayAudibleNoise(((Component)this).transform.position, noiseRange, 1f, 0, base.isInElevator && StartOfRound.Instance.hangarDoorsClosed, 0); yield return (object)new WaitForSeconds(1.5f); Utilities.CreateExplosion(((Component)this).transform.position, spawnExplosionEffect: true, 100, 0f, 6.4f, 6, (CauseOfDeath)3); Rigidbody[] componentsInChildren = evilObject.GetComponentsInChildren<Rigidbody>(); foreach (Rigidbody obj in componentsInChildren) { obj.isKinematic = false; obj.AddExplosionForce(1000f, evilObject.transform.position, 100f); } yield return (object)new WaitForSeconds(2f); Object.Destroy((Object)(object)((Component)this).gameObject); } public override void Update() { //IL_00b0: Unknown result type (might be due to invalid IL or missing references) ((GrabbableObject)this).Update(); if (isEvil.Value) { base.grabbable = false; base.grabbableToEnemies = false; } if (isPlayingMusic.Value) { if (!musicAudio.isPlaying) { musicAudio.Play(); musicAudioFar.Play(); } if (!base.isHeld) { danceAnimator.Play("dingusDance"); } else { danceAnimator.Play("dingusIdle"); } if (noiseInterval <= 0f) { noiseInterval = 1f; timesPlayedWithoutTurningOff++; roundManager.PlayAudibleNoise(((Component)this).transform.position, 16f, 0.9f, timesPlayedWithoutTurningOff, false, 5); } else { noiseInterval -= Time.deltaTime; } } else { timesPlayedWithoutTurningOff = 0; danceAnimator.Play("dingusIdle"); if (musicAudio.isPlaying) { musicAudio.Pause(); musicAudioFar.Pause(); } } } protected override void __initializeVariables() { if (isEvil == null) { throw new Exception("Dingus.isEvil cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)isEvil).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)isEvil, "isEvil"); ((NetworkBehaviour)this).NetworkVariableFields.Add((NetworkVariableBase)(object)isEvil); if (isPlayingMusic == null) { throw new Exception("Dingus.isPlayingMusic cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)isPlayingMusic).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)isPlayingMusic, "isPlayingMusic"); ((NetworkBehaviour)this).NetworkVariableFields.Add((NetworkVariableBase)(object)isPlayingMusic); ((GrabbableObject)this).__initializeVariables(); } protected internal override string __getTypeName() { return "Dingus"; } } public class Missile : NetworkBehaviour { public int damage = 50; public float maxDistance = 10f; public float minDistance; public float gravity = 2.4f; public float flightDelay = 0.5f; public float flightForce = 150f; public float flightTime = 2f; public float autoDestroyTime = 3f; private float timeAlive; public float LobForce = 100f; public ParticleSystem particleSystem; private void OnCollisionEnter(Collision collision) { if (((NetworkBehaviour)this).IsHost) { Boom(); BoomClientRpc(); } else { BoomServerRpc(); } } private void Start() { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) ((Component)this).GetComponent<Rigidbody>().useGravity = false; if (((NetworkBehaviour)this).IsHost) { ((Component)this).GetComponent<Rigidbody>().AddForce(((Component)this).transform.forward * LobForce, (ForceMode)1); } } [ClientRpc] public void BoomClientRpc() { //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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3331368301u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3331368301u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost)) { Boom(); } } } [ServerRpc] public void BoomServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Invalid comparison between Unknown and I4 //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: 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_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(452316787u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 452316787u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { Boom(); BoomClientRpc(); } } public void CreateExplosion() { //IL_0022: Unknown result type (might be due to invalid IL or missing references) PlayerControllerB attacker = ((IEnumerable<PlayerControllerB>)StartOfRound.Instance.allPlayerScripts).FirstOrDefault((Func<PlayerControllerB, bool>)((PlayerControllerB x) => ((NetworkBehaviour)x).OwnerClientId == ((NetworkBehaviour)this).OwnerClientId)); Utilities.CreateExplosion(((Component)this).transform.position, spawnExplosionEffect: true, damage, minDistance, maxDistance, 10, (CauseOfDeath)3, attacker); } public void Boom() { //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0076: 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) //IL_0089: 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_0091: 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) if ((Object)(object)particleSystem == (Object)null) { Debug.LogError((object)"No particle system set on missile, destruction time!!"); CreateExplosion(); if (((NetworkBehaviour)this).IsHost) { Object.Destroy((Object)(object)((Component)this).gameObject); } return; } particleSystem.Stop(true, (ParticleSystemStopBehavior)1); ((Component)particleSystem).transform.SetParent((Transform)null); ((Component)particleSystem).transform.localScale = Vector3.one; GameObject gameObject = ((Component)particleSystem).gameObject; MainModule main = particleSystem.main; float duration = ((MainModule)(ref main)).duration; main = particleSystem.main; MinMaxCurve startLifetime = ((MainModule)(ref main)).startLifetime; Object.Destroy((Object)(object)gameObject, duration + ((MinMaxCurve)(ref startLifetime)).constant); CreateExplosion(); if (((NetworkBehaviour)this).IsHost) { Object.Destroy((Object)(object)((Component)this).gameObject); } } private void FixedUpdate() { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) if (!((NetworkBehaviour)this).IsHost) { return; } ((Component)this).GetComponent<Rigidbody>().useGravity = false; ((Component)this).GetComponent<Rigidbody>().AddForce(Vector3.down * gravity); if (timeAlive <= flightTime && timeAlive >= flightDelay) { ((Component)this).GetComponent<Rigidbody>().AddForce(((Component)this).transform.forward * flightForce); } timeAlive += Time.fixedDeltaTime; if (timeAlive > autoDestroyTime) { if (((NetworkBehaviour)this).IsHost) { Boom(); BoomClientRpc(); } else { BoomServerRpc(); } } else { Debug.Log((object)("Time alive: " + timeAlive + " / " + autoDestroyTime)); } } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } [RuntimeInitializeOnLoadMethod] internal static void InitializeRPCS_Missile() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown NetworkManager.__rpc_func_table.Add(3331368301u, new RpcReceiveHandler(__rpc_handler_3331368301)); NetworkManager.__rpc_func_table.Add(452316787u, new RpcReceiveHandler(__rpc_handler_452316787)); } private static void __rpc_handler_3331368301(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)2; ((Missile)(object)target).BoomClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_452316787(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //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) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_008c: 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_0055: Invalid comparison between Unknown and I4 NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } } else { target.__rpc_exec_stage = (__RpcExecStage)1; ((Missile)(object)target).BoomServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "Missile"; } } public class PouchyBelt : GrabbableObject { [CompilerGenerated] private static class <>O { public static hook_SetHoverTipAndCurrentInteractTrigger <0>__PlayerControllerB_SetHoverTipAndCurrentInteractTrigger; public static hook_BeginGrabObject <1>__PlayerControllerB_BeginGrabObject; } public Transform beltCosmetic; public Vector3 beltCosmeticPositionOffset = new Vector3(0f, 0f, 0f); public Vector3 beltCosmeticRotationOffset = new Vector3(0f, 0f, 0f); public int beltCapacity = 3; private PlayerControllerB previousPlayerHeldBy; public static void Initialize() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown //IL_0030: 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_003b: Expected O, but got Unknown object obj = <>O.<0>__PlayerControllerB_SetHoverTipAndCurrentInteractTrigger; if (obj == null) { hook_SetHoverTipAndCurrentInteractTrigger val = PlayerControllerB_SetHoverTipAndCurrentInteractTrigger; <>O.<0>__PlayerControllerB_SetHoverTipAndCurrentInteractTrigger = val; obj = (object)val; } PlayerControllerB.SetHoverTipAndCurrentInteractTrigger += (hook_SetHoverTipAndCurrentInteractTrigger)obj; object obj2 = <>O.<1>__PlayerControllerB_BeginGrabObject; if (obj2 == null) { hook_BeginGrabObject val2 = PlayerControllerB_BeginGrabObject; <>O.<1>__PlayerControllerB_BeginGrabObject = val2; obj2 = (object)val2; } PlayerControllerB.BeginGrabObject += (hook_BeginGrabObject)obj2; } private static void PlayerControllerB_BeginGrabObject(orig_BeginGrabObject orig, PlayerControllerB self) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) self.interactRay = new Ray(((Component)self.gameplayCamera).transform.position, ((Component)self.gameplayCamera).transform.forward); if (!Physics.Raycast(self.interactRay, ref self.hit, self.grabDistance, self.interactableObjectsMask) || ((Component)((RaycastHit)(ref self.hit)).collider).gameObject.layer == 8 || !(((Component)((RaycastHit)(ref self.hit)).collider).tag == "PhysicsProp") || self.twoHanded || self.sinkingValue > 0.73f) { return; } self.currentlyGrabbingObject = ((Component)((Component)((RaycastHit)(ref self.hit)).collider).transform).gameObject.GetComponent<GrabbableObject>(); if ((!GameNetworkManager.Instance.gameHasStarted && !self.currentlyGrabbingObject.itemProperties.canBeGrabbedBeforeGameStart && !StartOfRound.Instance.testRoom.activeSelf) || (Object)(object)self.currentlyGrabbingObject == (Object)null || self.inSpecialInteractAnimation || self.currentlyGrabbingObject.isHeld || self.currentlyGrabbingObject.isPocketed) { return; } NetworkObject networkObject = ((NetworkBehaviour)self.currentlyGrabbingObject).NetworkObject; if (!((Object)(object)networkObject == (Object)null) && networkObject.IsSpawned) { if (self.currentlyGrabbingObject is PouchyBelt && self.ItemSlots.Any((GrabbableObject x) => (Object)(object)x != (Object)null && x is PouchyBelt)) { self.currentlyGrabbingObject.grabbable = false; } orig.Invoke(self); if (self.currentlyGrabbingObject is PouchyBelt) { self.currentlyGrabbingObject.grabbable = true; } } } private static void PlayerControllerB_SetHoverTipAndCurrentInteractTrigger(orig_SetHoverTipAndCurrentInteractTrigger orig, PlayerControllerB self) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self); if (!Physics.Raycast(self.interactRay, ref self.hit, self.grabDistance, self.interactableObjectsMask) || ((Component)((RaycastHit)(ref self.hit)).collider).gameObject.layer == 8 || !(((Component)((RaycastHit)(ref self.hit)).collider).tag == "PhysicsProp")) { return; } if (self.FirstEmptyItemSlot() == -1) { ((TMP_Text)self.cursorTip).text = "Inventory full!"; } else if (((Component)((RaycastHit)(ref self.hit)).collider).gameObject.GetComponent<GrabbableObject>() is PouchyBelt) { if (self.ItemSlots.Any((GrabbableObject x) => (Object)(object)x != (Object)null && x is PouchyBelt)) { ((TMP_Text)self.cursorTip).text = "(Cannot hold more than 1 belt)"; } else { ((TMP_Text)self.cursorTip).text = "Pick up belt"; } } } public override void LateUpdate() { //IL_005d: 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_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0078: 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) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008b: 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_0097: Unknown result type (might be due to invalid IL or missing references) ((GrabbableObject)this).LateUpdate(); if ((Object)(object)previousPlayerHeldBy != (Object)null) { ((Component)beltCosmetic).gameObject.SetActive(true); beltCosmetic.SetParent((Transform)null); ((Renderer)((Component)beltCosmetic).GetComponent<MeshRenderer>()).enabled = true; Transform parent = previousPlayerHeldBy.lowerSpine.parent; beltCosmetic.position = parent.position + beltCosmeticPositionOffset; Quaternion rotation = parent.rotation; Quaternion rotation2 = Quaternion.Euler(((Quaternion)(ref rotation)).eulerAngles + beltCosmeticRotationOffset); beltCosmetic.rotation = rotation2; ((Renderer)base.mainObjectRenderer).enabled = false; ((Component)this).gameObject.SetActive(true); } else { ((Component)beltCosmetic).gameObject.SetActive(false); ((Renderer)base.mainObjectRenderer).enabled = true; beltCosmetic.SetParent(((Component)this).transform); } } public void UpdateHUD(bool add) { //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0084: 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_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: 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) //IL_00c6: 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_0162: 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_01a9: Unknown result type (might be due to invalid IL or missing references) //IL_01c6: Unknown result type (might be due to invalid IL or missing references) HUDManager instance = HUDManager.Instance; if (add) { int num = 0; GrabbableObject[] itemSlots = GameNetworkManager.Instance.localPlayerController.ItemSlots; for (int i = 0; i < itemSlots.Length; i++) { if (itemSlots[i] is PouchyBelt) { num++; } } Image val = instance.itemSlotIconFrames[0]; Image val2 = instance.itemSlotIcons[0]; int num2 = instance.itemSlotIconFrames.Length; ((Component)val).GetComponentInParent<CanvasScaler>(); ((Component)val).GetComponentInParent<AspectRatioFitter>(); float x = ((Graphic)val).rectTransform.sizeDelta.x; float y = ((Graphic)val).rectTransform.sizeDelta.y; float num3 = ((Graphic)val).rectTransform.anchoredPosition.y + 1.125f * y * (float)num; Vector3 localEulerAngles = ((Transform)((Graphic)val).rectTransform).localEulerAngles; Vector3 localEulerAngles2 = ((Transform)((Graphic)val2).rectTransform).localEulerAngles; List<Image> list = instance.itemSlotIconFrames.ToList(); List<Image> list2 = instance.itemSlotIcons.ToList(); Debug.Log((object)$"Adding {beltCapacity} item slots! Surely this will go well.."); for (int j = 0; j < beltCapacity; j++) { float num4 = ((Graphic)val).rectTransform.anchoredPosition.x + (float)(j + 1) * x; Image val3 = Object.Instantiate<Image>(list[num2 - 1], ((Component)val).transform.parent); ((Object)val3).name = $"Slot{num2 + j}[LethalThingsBelt]"; ((Graphic)val3).rectTransform.anchoredPosition = new Vector2(num4, num3); ((Transform)((Graphic)val3).rectTransform).eulerAngles = localEulerAngles; Image component = ((Component)((Component)val3).transform.GetChild(0)).GetComponent<Image>(); ((Object)component).name = "icon"; ((Behaviour)component).enabled = false; ((Transform)((Graphic)component).rectTransform).eulerAngles = localEulerAngles2; ((Transform)((Graphic)component).rectTransform).Rotate(new Vector3(0f, 0f, -90f)); list.Add(val3); list2.Add(component); } instance.itemSlotIconFrames = list.ToArray(); instance.itemSlotIcons = list2.ToArray(); Debug.Log((object)$"Added {beltCapacity} item slots!"); return; } List<Image> list3 = instance.itemSlotIconFrames.ToList(); List<Image> list4 = instance.itemSlotIcons.ToList(); int count = list3.Count; int num5 = 0; for (int num6 = count - 1; num6 >= 0; num6--) { if (((Object)list3[num6]).name.Contains("[LethalThingsBelt]")) { num5++; Image obj = list3[num6]; list3.RemoveAt(num6); list4.RemoveAt(num6); Object.Destroy((Object)(object)((Component)obj).gameObject); if (num5 >= beltCapacity) { break; } } } instance.itemSlotIconFrames = list3.ToArray(); instance.itemSlotIcons = list4.ToArray(); Debug.Log((object)$"Removed {beltCapacity} item slots!"); } public void AddItemSlots() { if ((Object)(object)base.playerHeldBy != (Object)null) { List<GrabbableObject> list = base.playerHeldBy.ItemSlots.ToList(); base.playerHeldBy.ItemSlots = (GrabbableObject[])(object)new GrabbableObject[list.Count + beltCapacity]; for (int i = 0; i < list.Count; i++) { base.playerHeldBy.ItemSlots[i] = list[i]; } if ((Object)(object)base.playerHeldBy == (Object)(object)GameNetworkManager.Instance.localPlayerController) { UpdateHUD(add: true); } } } public void RemoveItemSlots() { if (!((Object)(object)base.playerHeldBy != (Object)null)) { return; } int num = base.playerHeldBy.ItemSlots.Length - beltCapacity; int currentItemSlot = base.playerHeldBy.currentItemSlot; for (int i = 0; i < beltCapacity; i++) { GrabbableObject val = base.playerHeldBy.ItemSlots[num + i]; if ((Object)(object)val != (Object)null) { base.playerHeldBy.DropItem(val, num + i); } } int currentItemSlot2 = base.playerHeldBy.currentItemSlot; currentItemSlot2 = ((currentItemSlot < base.playerHeldBy.ItemSlots.Length) ? currentItemSlot : 0); List<GrabbableObject> list = base.playerHeldBy.ItemSlots.ToList(); base.playerHeldBy.ItemSlots = (GrabbableObject[])(object)new GrabbableObject[list.Count - beltCapacity]; for (int j = 0; j < base.playerHeldBy.ItemSlots.Length; j++) { base.playerHeldBy.ItemSlots[j] = list[j]; } if ((Object)(object)base.playerHeldBy == (Object)(object)GameNetworkManager.Instance.localPlayerController) { UpdateHUD(add: false); } base.playerHeldBy.SwitchItemSlots(currentItemSlot2); } public override void DiscardItem() { RemoveItemSlots(); previousPlayerHeldBy = null; ((GrabbableObject)this).DiscardItem(); } public void GrabItemOnClient() { ((GrabbableObject)this).GrabItemOnClient(); } public override void EquipItem() { ((GrabbableObject)this).EquipItem(); if ((Object)(object)base.playerHeldBy != (Object)null) { if ((Object)(object)base.playerHeldBy != (Object)(object)previousPlayerHeldBy) { AddItemSlots(); } previousPlayerHeldBy = base.playerHeldBy; } } protected override void __initializeVariables() { ((GrabbableObject)this).__initializeVariables(); } protected internal override string __getTypeName() { return "PouchyBelt"; } } public class PowerOutletStun : NetworkBehaviour { private Coroutine electrocutionCoroutine; public AudioSource strikeAudio; public ParticleSystem strikeParticle; private NetworkVariable<int> damage = new NetworkVariable<int>(20, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); public void Electrocute(ItemCharger socket) { Debug.Log((object)"Attempting electrocution"); if (electrocutionCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(electrocutionCoroutine); } electrocutionCoroutine = ((MonoBehaviour)this).StartCoroutine(electrocutionDelayed(socket)); } public void Awake() { //IL_0035: 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) StormyWeather val = Object.FindObjectOfType<StormyWeather>(true); GameObject gameObject = ((Component)val.targetedStrikeAudio).gameObject; strikeAudio = Object.Instantiate<GameObject>(gameObject, ((Component)this).transform).GetComponent<AudioSource>(); ((Component)strikeAudio).transform.localPosition = Vector3.zero; ((Component)strikeAudio).gameObject.SetActive(true); strikeParticle = Object.Instantiate<GameObject>(((Component)val.explosionEffectParticle).gameObject, ((Component)this).transform).GetComponent<ParticleSystem>(); ((Component)strikeParticle).transform.localPosition = Vector3.zero; ((Component)strikeParticle).gameObject.SetActive(true); if (((NetworkBehaviour)this).IsHost) { damage.Value = Config.itemChargerElectrocutionDamage.Value; } } private IEnumerator electrocutionDelayed(ItemCharger socket) { Debug.Log((object)"Electrocution started"); socket.zapAudio.Play(); yield return (object)new WaitForSeconds(0.75f); socket.chargeStationAnimator.SetTrigger("zap"); Debug.Log((object)"Electrocution finished"); if (((NetworkBehaviour)this).NetworkObject.IsOwner && !((NetworkBehaviour)this).NetworkObject.IsOwnedByServer) { Debug.Log((object)"Sending stun to server!!"); ElectrocutedServerRpc(((Component)this).transform.position); } else if (((NetworkBehaviour)this).NetworkObject.IsOwner && ((NetworkBehaviour)this).NetworkObject.IsOwnedByServer) { Debug.Log((object)"Sending stun to clients!!"); ElectrocutedClientRpc(((Component)this).transform.position); Electrocuted(((Component)this).transform.position); } } [ClientRpc] private void ElectrocutedClientRpc(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_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_0089: 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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(328188188u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref position); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 328188188u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost)) { Debug.Log((object)"Stun received!!"); Electrocuted(position); } } } private void Electrocuted(Vector3 position) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) StormyWeather obj = Object.FindObjectOfType<StormyWeather>(true); Utilities.CreateExplosion(position, spawnExplosionEffect: false, 20, 0f, 5f, 3, (CauseOfDeath)11); strikeParticle.Play(); obj.PlayThunderEffects(position, strikeAudio); } [ServerRpc] private void ElectrocutedServerRpc(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_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Invalid comparison between Unknown and I4 //IL_010f: 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_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: 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_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2844681185u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref position); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2844681185u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ElectrocutedClientRpc(position); } } protected override void __initializeVariables() { if (damage == null) { throw new Exception("PowerOutletStun.damage cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)damage).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)damage, "damage"); base.NetworkVariableFields.Add((NetworkVariableBase)(object)damage); ((NetworkBehaviour)this).__initializeVariables(); } [RuntimeInitializeOnLoadMethod] internal static void InitializeRPCS_PowerOutletStun() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown NetworkManager.__rpc_func_table.Add(328188188u, new RpcReceiveHandler(__rpc_handler_328188188)); NetworkManager.__rpc_func_table.Add(2844681185u, new RpcReceiveHandler(__rpc_handler_2844681185)); } private static void __rpc_handler_328188188(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0041: 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) { Vector3 position = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref position); target.__rpc_exec_stage = (__RpcExecStage)2; ((PowerOutletStun)(object)target).ElectrocutedClientRpc(position); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2844681185(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //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) //IL_0083: 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_009d: 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_0055: Invalid comparison between Unknown and I4 NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } } else { Vector3 position = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref position); target.__rpc_exec_stage = (__RpcExecStage)1; ((PowerOutletStun)(object)target).ElectrocutedServerRpc(position); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "PowerOutletStun"; } } public class RocketLauncher : GrabbableObject { public Light laserPointer; public Transform lightSource; public AudioSource mainAudio; public AudioClip[] activateClips; public AudioClip[] noAmmoSounds; public Transform aimDirection; public int maxAmmo = 4; private int currentAmmo; public GameObject missilePrefab; private float timeSinceLastShot; private PlayerControllerB previousPlayerHeldBy; public Material[] ammoLampMaterials; public Animator Animator; public ParticleSystem particleSystem; public override void Start() { //IL_0056: 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_0026: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) currentAmmo = maxAmmo; for (int i = 0; i < ammoLampMaterials.Length; i++) { if (i >= currentAmmo) { ammoLampMaterials[i].SetColor("_BaseColor", Color.red); ammoLampMaterials[i].SetColor("_EmissiveColorMap", Color.red); } else { ammoLampMaterials[i].SetColor("_BaseColor", Color.green); ammoLampMaterials[i].SetColor("_EmissiveColorMap", Color.green); } } ((GrabbableObject)this).Start(); } public override void OnDestroy() { ((NetworkBehaviour)this).OnDestroy(); } public override void ItemActivate(bool used, bool buttonDown = true) { //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) ((GrabbableObject)this).ItemActivate(used, buttonDown); if (currentAmmo > 0) { currentAmmo--; PlayRandomAudio(mainAudio, activateClips); Animator.Play("fire"); particleSystem.Play(); for (int i = 0; i < ammoLampMaterials.Length; i++) { if (i >= currentAmmo) { ammoLampMaterials[i].SetColor("_BaseColor", Color.red); } else { ammoLampMaterials[i].SetColor("_BaseColor", Color.green); } } if (((NetworkBehaviour)this).IsOwner) { if (((NetworkBehaviour)this).IsHost) { MissileSpawner(); } else { SpawnMissileServerRpc(); } } } else { PlayRandomAudio(mainAudio, noAmmoSounds); } } [ServerRpc] private void SpawnMissileServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Invalid comparison between Unknown and I4 //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: 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_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(336477477u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 336477477u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { MissileSpawner(); } } private void MissileSpawner() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) Object.Instantiate<GameObject>(missilePrefab, aimDirection.position, aimDirection.rotation).GetComponent<NetworkObject>().SpawnWithOwnership(((NetworkBehaviour)this).OwnerClientId, false); } private void PlayRandomAudio(AudioSource audioSource, AudioClip[] audioClips) { if (audioClips.Length != 0) { audioSource.PlayOneShot(audioClips[Random.Range(0, audioClips.Length)]); } } public override void LateUpdate() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) ((GrabbableObject)this).LateUpdate(); RaycastHit val = default(RaycastHit); if (Physics.Raycast(lightSource.position, lightSource.forward, ref val, 100f, 8)) { ((Component)laserPointer).transform.position = ((RaycastHit)(ref val)).point; ((Behaviour)laserPointer).enabled = true; } else { ((Behaviour)laserPointer).enabled = false; } } private void OnEnable() { } private void OnDisable() { } public override void EquipItem() { ((GrabbableObject)this).EquipItem(); if ((Object)(object)base.playerHeldBy != (Object)null) { previousPlayerHeldBy = base.playerHeldBy; } } protected override void __initializeVariables() { ((GrabbableObject)this).__initializeVariables(); } [RuntimeInitializeOnLoadMethod] internal static void InitializeRPCS_RocketLauncher() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown NetworkManager.__rpc_func_table.Add(336477477u, new RpcReceiveHandler(__rpc_handler_336477477)); } private static void __rpc_handler_336477477(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //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) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_008c: 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_0055: Invalid comparison between Unknown and I4 NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } } else { target.__rpc_exec_stage = (__RpcExecStage)1; ((RocketLauncher)(object)target).SpawnMissileServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "RocketLauncher"; } } public class RoombaAI : EnemyAI { private float angeredTimer; [Header("Behaviors")] public AISearchRoutine searchForPlayers; public bool investigating; public bool hasBegunInvestigating; public Vector3 investigatePosition; [Header("Landmine")] private bool mineActivated = true; public bool hasExploded; public AudioSource mineAudio; public AudioSource mineFarAudio; public AudioSource idleSound; public AudioClip mineDetonate; public AudioClip mineTrigger; public AudioClip mineDetonateFar; public AudioClip beepNoise; public AudioClip minePress; private bool sendingExplosionRPC; private RaycastHit hit; private RoundManager roundManager; private bool localPlayerOnMine; private MeshRenderer meshRenderer; public Rigidbody Rigidbody; private List<Light> lights = new List<Light>(); public float lightInterval = 1f; public float lightTimer; public float lightOnDuration = 0.1f; public override void Start() { ((EnemyAI)this).Start(); Transform val = ((Component)this).transform.Find("BoombaModel/Roomba/Cube"); meshRenderer = ((Component)val).GetComponent<MeshRenderer>(); lights = ((Component)val.parent).GetComponentsInChildren<Light>().ToList(); } public override void DoAIInterval() { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: 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_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: 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) ((EnemyAI)this).DoAIInterval(); if (base.isEnemyDead || StartOfRound.Instance.allPlayersDead) { return; } Vector3 velocity = Rigidbody.velocity; float magnitude = ((Vector3)(ref velocity)).magnitude; idleSound.pitch = Mathf.Lerp(0.8f, 1.2f, magnitude / 2f); if (((EnemyAI)this).TargetClosestPlayer(4f, true, 70f)) { ((EnemyAI)this).StopSearch(searchForPlayers, true); base.movingTowardsTargetPlayer = true; hasBegunInvestigating = false; investigating = false; } else if (investigating) { if (!hasBegunInvestigating) { hasBegunInvestigating = true; ((EnemyAI)this).StopSearch(base.currentSearch, false); ((EnemyAI)this).SetDestinationToPosition(investigatePosition, false); } if (Vector3.Distance(((Component)this).transform.position, investigatePosition) < 5f) { investigating = false; hasBegunInvestigating = false; } } else if (!searchForPlayers.inProgress) { base.movingTowardsTargetPlayer = false; ((EnemyAI)this).StartSearch(((Component)this).transform.position, searchForPlayers); } } private void FixedUpdate() { _ = base.ventAnimationFinished; } public IEnumerator disableLights(float timer) { yield return (object)new WaitForSeconds(timer); foreach (Light light in lights) { ((Behaviour)light).enabled = false; } } public override void Update() { //IL_00ea: Unknown result type (might be due to invalid IL or missing references) ((EnemyAI)this).Update(); if (lightTimer > 0f) { lightTimer -= Time.deltaTime; if (lightTimer <= 0f) { foreach (Light light in lights) { ((Behaviour)light).enabled = true; } ((MonoBehaviour)this).StartCoroutine(disableLights(lightOnDuration)); mineAudio.PlayOneShot(beepNoise); WalkieTalkie.TransmitOneShotAudio(mineAudio, beepNoise, 1f); } } else { lightTimer = lightInterval; } if (!base.ventAnimationFinished || !((Object)(object)base.creatureAnimator != (Object)null)) { return; } ((Behaviour)base.creatureAnimator).enabled = false; if (base.isEnemyDead || StartOfRound.Instance.allPlayersDead) { return; } _ = base.serverPosition; if (base.stunNormalizedTimer > 0f) { base.agent.speed = 0f; angeredTimer = 7f; } else if (angeredTimer > 0f) { angeredTimer -= Time.deltaTime; if (((NetworkBehaviour)this).IsOwner) { base.agent.stoppingDistance = 0.1f; base.agent.speed = 1f; } } else if (((NetworkBehaviour)this).IsOwner) { base.agent.stoppingDistance = 5f; base.agent.speed = 0.8f; } } private IEnumerator StartIdleAnimation() { roundManager = Object.FindObjectOfType<RoundManager>(); if (!((Object)(object)roundManager == (Object)null)) { if (roundManager.BreakerBoxRandom != null) { yield return (object)new WaitForSeconds((float)roundManager.BreakerBoxRandom.NextDouble() + 0.5f); } mineAudio.pitch = Random.Range(0.9f, 1.1f); } } private void OnTriggerEnter(Collider other) { if (hasExploded) { return; } Plugin.logger.LogInfo((object)("[Boomba] Trigger enter, tag: " + ((Component)other).tag + ", name: " + ((Object)other).name)); if (((Component)other).CompareTag("Player") || ((Component)((Component)other).transform.parent).CompareTag("Player")) { PlayerControllerB component = ((Component)other).gameObject.GetComponent<PlayerControllerB>(); if (!((Component)other).CompareTag("Player")) { component = ((Component)((Component)other).transform.parent).GetComponent<PlayerControllerB>(); } if (!((Object)(object)component != (Object)(object)GameNetworkManager.Instance.localPlayerController) && (Object)(object)component != (Object)null && !component.isPlayerDead) { localPlayerOnMine = true; PressMineServerRpc(); ((MonoBehaviour)this).StartCoroutine(TriggerMine(other)); } } else { if (!((Component)other).CompareTag("PlayerRagdoll")) { return; } if (Object.op_Implicit((Object)(object)((Component)other).GetComponent<DeadBodyInfo>())) { if ((Object)(object)((Component)other).GetComponent<DeadBodyInfo>().playerScript != (Object)(object)GameNetworkManager.Instance.localPlayerController) { return; } } else if (Object.op_Implicit((Object)(object)((Component)other).GetComponent<GrabbableObject>()) && !((NetworkBehaviour)((Component)other).GetComponent<GrabbableObject>()).NetworkObject.IsOwner) { return; } PressMineServerRpc(); ((MonoBehaviour)this).StartCoroutine(TriggerMine(other)); } } [ServerRpc(RequireOwnership = false)] public void PressMineServerRpc() { //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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3418551494u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3418551494u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { PressMineClientRpc(); } } } [ClientRpc] public void PressMineClientRpc() { //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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2561781742u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2561781742u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost)) { mineAudio.PlayOneShot(minePress); WalkieTalkie.TransmitOneShotAudio(mineAudio, minePress, 1f); } } } public IEnumerator TriggerMine(Collider other) { Debug.Log((object)("Object entering mine trigger, gameobject name: " + ((Object)((Component)other).gameObject).name)); yield return (object)new WaitForSeconds(0.5f); MineGoesBoom(other); } public void MineGoesBoom(Collider other) { if (hasExploded) { return; } Debug.Log((object)("Object leaving mine trigger, gameobject name: " + ((Object)((Component)other).gameObject).name)); if (((Component)other).CompareTag("Player") || ((Component)((Component)other).transform.parent).CompareTag("Player")) { PlayerControllerB component = ((Component)other).gameObject.GetComponent<PlayerControllerB>(); if (!((Component)other).CompareTag("Player")) { component = ((Component)((Component)other).transform.parent).GetComponent<PlayerControllerB>(); } if ((Object)(object)component != (Object)null && !component.isPlayerDead && !((Object)(object)component != (Object)(object)GameNetworkManager.Instance.localPlayerController)) { localPlayerOnMine = false; TriggerMineOnLocalClientByExiting(); } } else { if (!((Component)other).CompareTag("PlayerRagdoll")) { return; } if (Object.op_Implicit((Object)(object)((Component)other).GetComponent<DeadBodyInfo>())) { if ((Object)(object)((Component)other).GetComponent<DeadBodyInfo>().playerScript != (Object)(object)GameNetworkManager.Instance.localPlayerController) { return; } } else if (Object.op_Implicit((Object)(object)((Component)other).GetComponent<GrabbableObject>()) && !((NetworkBehaviour)((Component)other).GetComponent<GrabbableObject>()).NetworkObject.IsOwner) { return; } TriggerMineOnLocalClientByExiting(); } } private void TriggerMineOnLocalClientByExiting() { if (!hasExploded) { hasExploded = true; SetOffMineAnimation(); sendingExplosionRPC = true; ExplodeMineServerRpc(); } } [ServerRpc(RequireOwnership = false)] public void ExplodeMineServerRpc() { //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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2745793768u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2745793768u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { hasExploded = true; ExplodeMineClientRpc(); } } } [ClientRpc] public void ExplodeMineClientRpc() { //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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2242285281u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2242285281u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost)) { if (sendingExplosionRPC) { sendingExplosionRPC = false; } else { SetOffMineAnimation(); } } } public void SetOffMineAnimation() { hasExploded = true; mineAudio.PlayOneShot(mineTrigger, 1f); ((MonoBehaviour)this).StartCoroutine(detonateMineDelayed()); } private IEnumerator detonateMineDelayed() { yield return (object)new WaitForSeconds(0.5f); Detonate(); Object.Destroy((Object)(object)((Component)this).gameObject); } public void Detonate() { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) mineAudio.pitch = Random.Range(0.93f, 1.07f); mineAudio.PlayOneShot(mineDetonate, 1f); Utilities.CreateExplosion(((Component)this).transform.position + Vector3.up, spawnExplosionEffect: true, 100, 5.7f, 6.4f, 6, (CauseOfDeath)3); } public bool MineHasLineOfSight(Vector3 pos) { //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) return !Physics.Linecast(((Component)this).transform.position, pos, ref hit, 256); } public override void HitEnemy(int force = 1, PlayerControllerB playerWhoHit = null, bool playHitSFX = false) { ((EnemyAI)this).HitEnemy(force, playerWhoHit, false); angeredTimer = 18f; SetOffMineAnimation(); sendingExplosionRPC = true; ExplodeMineServerRpc(); } public override void DetectNoise(Vector3 noisePosition, float noiseLoudness, int timesPlayedInOneSpot = 0, int noiseID = 0) { //IL_0001: 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_0012: Unknown result type (might be due to invalid IL or missing references) //IL_002c: 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) ((EnemyAI)this).DetectNoise(noisePosition, noiseLoudness, timesPlayedInOneSpot, noiseID); if (!(Vector3.Distance(noisePosition, ((Component)this).transform.position) > 15f) && !base.movingTowardsTargetPlayer) { investigatePosition = noisePosition; } } public void InvestigatePosition(Vector3 position) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) if (!hasBegunInvestigating) { investigatePosition = position; investigating = true; } } protected override void __initializeVariables() { ((EnemyAI)this).__initializeVariables(); } [RuntimeInitializeOnLoadMethod] internal static void InitializeRPCS_RoombaAI() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Expected O, but got Unknown //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Expected O, but got Unknown NetworkManager.__rpc_func_table.Add(3418551494u, new RpcReceiveHandler(__rpc_handler_3418551494)); NetworkManager.__rpc_func_table.Add(2561781742u, new RpcReceiveHandler(__rpc_handler_2561781742)); NetworkManager.__rpc_func_table.Add(2745793768u, new RpcReceiveHandler(__rpc_handler_2745793768)); NetworkManager.__rpc_func_table.Add(2242285281u, new RpcReceiveHandler(__rpc_handler_2242285281)); } private static void __rpc_handler_3418551494(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; ((RoombaAI)(object)target).PressMineServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2561781742(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)2; ((RoombaAI)(object)target).PressMineClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2745793768(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; ((RoombaAI)(object)target).ExplodeMineServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2242285281(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)2; ((RoombaAI)(object)target).ExplodeMineClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "RoombaAI"; } } internal class ToyHammer : GrabbableObject { public int hammerHitForce = 1; public float hammerHitPercentage = 1f; public bool reelingUp; public bool isHoldingButton; private RaycastHit rayHit; private Coroutine reelingUpCoroutine; private RaycastHit[] objectsHitByHammer; private List<RaycastHit> objectsHitByHammerList = new List<RaycastHit>(); public AudioClip reelUp; public AudioClip swing; public AudioClip[] hitSFX; public AudioSource hammerAudio; private PlayerControllerB previousPlayerHeldBy; private int hammerMask = 11012424; public override void ItemActivate(bool used, bool buttonDown = true) { if ((Object)(object)base.playerHeldBy == (Object)null) { return; } isHoldingButton = buttonDown; if (!reelingUp && buttonDown) { reelingUp = true; previousPlayerHeldBy = base.playerHeldBy; if (reelingUpCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(reelingUpCoroutine); } reelingUpCoroutine = ((MonoBehaviour)this).StartCoroutine(reelUpHammer()); } } private IEnumerator reelUpHammer() { base.playerHeldBy.activatingItem = true; base.playerHeldBy.twoHanded = true; base.playerHeldBy.playerBodyAnimator.ResetTrigger("hammerHit"); base.playerHeldBy.playerBodyAnimator.SetBool("reelingUp", true); hammerAudio.PlayOneShot(reelUp); ReelUpSFXServerRpc(); yield return (object)new WaitForSeconds(0.35f); yield return (object)new WaitUntil((Func<bool>)(() => !isHoldingButton || !base.isHeld)); SwingHammer(!base.isHeld); yield return (object)new WaitForSeconds(0.13f); HitHammer(!base.isHeld); yield return (object)new WaitForSeconds(0.3f); reelingUp = false; reelingUpCoroutine = null; } [ServerRpc] public void ReelUpSFXServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Invalid comparison between Unknown and I4 //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: 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_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3129286724u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3129286724u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ReelUpSFXClientRpc(); } } [ClientRpc] public void ReelUpSFXClientRpc() { //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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(4160876605u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 4160876605u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost)) { hammerAudio.PlayOneShot(reelUp); } } } public override void DiscardItem() { base.playerHeldBy.activatingItem = false; ((GrabbableObject)this).DiscardItem(); } public void SwingHammer(bool cancel = false) { //IL_003c: Unknown result type (might be due to invalid IL or missing references) previousPlayerHeldBy.playerBodyAnimator.SetBool("reelingUp", false); if (!cancel) { hammerAudio.PlayOneShot(swing); previousPlayerHeldBy.UpdateSpecialAnimationValue(true, (short)((Component)previousPlayerHeldBy).transform.localEulerAngles.y, 0.4f, false); } } public void HitHammer(bool cancel = false) { //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: 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_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0082: 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_00a7: 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) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_038d: Unknown result type (might be due to invalid IL or missing references) //IL_0145: 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_0159: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) //IL_01a1: Unknown result type (might be due to invalid IL or missing references) //IL_01a6: Unknown result type (might be due to invalid IL or missing references) //IL_01aa: Unknown result type (might be due to invalid IL or missing references) //IL_01b6: Unknown result type (might be due to invalid IL or missing references) //IL_01bb: Unknown result type (might be due to invalid IL or missing references) //IL_01bf: Unknown result type (might be due to invalid IL or missing references) //IL_01c9: Unknown result type (might be due to invalid IL or missing references) //IL_01ce: Unknown result type (might be due to invalid IL or missing references) //IL_01d3: Unknown result type (might be due to invalid IL or missing references) //IL_01dd: Unknown result type (might be due to invalid IL or missing references) //IL_01e2: 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_0180: Unknown result type (might be due to invalid IL or missing references) //IL_027d: Unknown result type (might be due to invalid IL or missing references) //IL_0282: Unknown result type (might be due to invalid IL or missing references) //IL_029e: Unknown result type (might be due to invalid IL or missing references) //IL_02a3: Unknown result type (might be due to invalid IL or missing references) //IL_02c8: Unknown result type (might be due to invalid IL or missing references) //IL_02cd: Unknown result type (might be due to invalid IL or missing references) //IL_02d1: Unknown result type (might be due to invalid IL or missing references) //IL_02d6: Unknown result type (might be due to invalid IL or missing references) //IL_031d: Unknown result type (might be due to invalid IL or missing references) //IL_0322: Unknown result type (might be due to invalid IL or missing references) //IL_02e2: Unknown result type (might be due to invalid IL or missing references) //IL_02ea: Unknown result type (might be due to invalid IL or missing references) //IL_02ef: Unknown result type (might be due to invalid IL or missing references) //IL_02f3: Unknown result type (might be due to invalid IL or missing references) //IL_0342: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)previousPlayerHeldBy == (Object)null) { return; } previousPlayerHeldBy.activatingItem = false; bool flag = false; if (!cancel) { previousPlayerHeldBy.twoHanded = false; Debug.DrawRay(((Component)previousPlayerHeldBy.gameplayCamera).transform.position + ((Component)previousPlayerHeldBy.gameplayCamera).transform.right * -0.35f, ((Component)previousPlayerHeldBy.gameplayCamera).transform.forward * 1.85f, Color.blue, 5f); objectsHitByHammer = Physics.SphereCastAll(((Component)previousPlayerHeldBy.gameplayCamera).transform.position + ((Component)previousPlayerHeldBy.gameplayCamera).transform.right * -0.35f, 0.75f, ((Component)previousPlayerHeldBy.gameplayCamera).transform.forward, 1.85f, hammerMask, (QueryTriggerInteraction)2); objectsHitByHammerList = objectsHitByHammer.OrderBy((RaycastHit x) => ((RaycastHit)(ref x)).distance).ToList(); Vector3 val = ((Component)previousPlayerHeldBy.gameplayCamera).transform.position; IHittable val3 = default(IHittable); RaycastHit val5 = default(RaycastHit); for (int i = 0; i < objectsHitByHammerList.Count; i++) { RaycastHit val2 = objectsHitByHammerList[i]; if (((Component)((RaycastHit)(ref val2)).transform).gameObject.layer != 8) { val2 = objectsHitByHammerList[i]; if (((Component)((RaycastHit)(ref val2)).transform).gameObject.layer != 11) { val2 = objectsHitByHammerList[i]; if (!((Component)((RaycastHit)(ref val2)).transform).TryGetComponent<IHittable>(ref val3)) { continue; } val2 = objectsHitByHammerList[i]; if ((Object)(object)((RaycastHit)(ref val2)).transform == (Object)(object)((Component)previousPlayerHeldBy).transform) { continue; } val2 = objectsHitByHammerList[i]; if (!(((RaycastHit)(ref val2)).point == Vector3.zero)) { Vector3 val4 = val; val2 = objectsHitByHammerList[i]; if (Physics.Linecast(val4, ((RaycastHit)(ref val2)).point, ref val5, StartOfRou
BepInEx/plugins/FlipMods-FasterItemDropship/FasterItemDropship.dll
Decompiled a year agousing System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Reflection; using System.Reflection.Emit; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using BepInEx.Configuration; using HarmonyLib; using Unity.Netcode; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("FasterItemDropship")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("Mod made by flipf17")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("FasterItemDropship")] [assembly: AssemblyCopyright("Copyright © 2023")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("a5a250fd-b706-48b9-9be9-da360fd939dc")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyVersion("1.0.0.0")] namespace FasterItemDropship { public static class ConfigSettings { public static ConfigEntry<int> dropshipDeliveryTime; public static ConfigEntry<int> dropshipMaxStayDuration; public static ConfigEntry<int> dropshipLeaveAfterSecondsOpenDoors; public static void BindConfigSettings() { Plugin.Log("BindingConfigs"); dropshipDeliveryTime = ((BaseUnityPlugin)Plugin.instance).Config.Bind<int>("FasterItemDropship", "DeliveryTime", 10, "How long it takes (in seconds) for the item dropship to arrive."); dropshipMaxStayDuration = ((BaseUnityPlugin)Plugin.instance).Config.Bind<int>("FasterItemDropship", "MaxLandDuration", 40, "The max duration (in seconds) the item dropship will stay."); dropshipLeaveAfterSecondsOpenDoors = ((BaseUnityPlugin)Plugin.instance).Config.Bind<int>("FasterItemDropship", "LeaveAfterSecondsOpenDoors", 3, "How long (in seconds) the item dropship will stay for after opening its doors."); } } [BepInPlugin("FlipMods.FasterItemDropship", "FasterItemDropship", "1.2.0")] public class Plugin : BaseUnityPlugin { private Harmony _harmony; public static Plugin instance; private void Awake() { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Expected O, but got Unknown instance = this; ConfigSettings.BindConfigSettings(); _harmony = new Harmony("FasterItemDropship"); _harmony.PatchAll(); ((BaseUnityPlugin)this).Logger.LogInfo((object)"FasterItemDropship loaded"); } public static void Log(string message) { ((BaseUnityPlugin)instance).Logger.LogInfo((object)message); } } public static class PluginInfo { public const string PLUGIN_GUID = "FlipMods.FasterItemDropship"; public const string PLUGIN_NAME = "FasterItemDropship"; public const string PLUGIN_VERSION = "1.2.0"; } } namespace FasterItemDropship.Patches { [HarmonyPatch] internal class FasterItemDropshipPatcher { private static Terminal terminalScript; private static StartOfRound playersManager; private static List<int> itemsToDeliver; private static List<int> orderedItemsFromTerminal; [HarmonyPatch(typeof(ItemDropship), "Start")] [HarmonyPrefix] public static void InitializeDropship(ItemDropship __instance) { playersManager = Object.FindObjectOfType<StartOfRound>(); terminalScript = Object.FindObjectOfType<Terminal>(); itemsToDeliver = (List<int>)Traverse.Create((object)__instance).Field("itemsToDeliver").GetValue(); } [HarmonyPatch(typeof(Terminal), "Start")] [HarmonyPrefix] public static void InitializeTerminal(Terminal __instance) { orderedItemsFromTerminal = __instance.orderedItemsFromTerminal; } [HarmonyPatch(typeof(ItemDropship), "Update")] [HarmonyPrefix] public static void DropshipUpdate(ItemDropship __instance) { if (((NetworkBehaviour)__instance).IsServer && !__instance.deliveringOrder && terminalScript.orderedItemsFromTerminal.Count > 0 && !playersManager.shipHasLanded) { __instance.shipTimer += Time.deltaTime; } } [HarmonyPatch(typeof(ItemDropship), "Update")] private static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions) { List<CodeInstruction> list = new List<CodeInstruction>(instructions); for (int i = 0; i < list.Count; i++) { if (list[i].opcode == OpCodes.Ldc_R4) { if ((float)list[i].operand == 20f) { list[i].operand = (float)ConfigSettings.dropshipMaxStayDuration.Value; } else if ((float)list[i].operand == 40f) { list[i].operand = (float)(ConfigSettings.dropshipMaxStayDuration.Value + ConfigSettings.dropshipDeliveryTime.Value); } else if ((float)list[i].operand == 30f) { list[i].operand = (float)ConfigSettings.dropshipMaxStayDuration.Value; break; } } } return list.AsEnumerable(); } [HarmonyPatch(typeof(ItemDropship), "OpenShipDoorsOnServer")] [HarmonyPostfix] public static void OnOpenShipDoors(ItemDropship __instance) { if (((NetworkBehaviour)__instance).IsServer) { __instance.shipTimer = Mathf.Max(__instance.shipTimer, (float)(ConfigSettings.dropshipMaxStayDuration.Value - ConfigSettings.dropshipLeaveAfterSecondsOpenDoors.Value)); } } [HarmonyPatch(typeof(ItemDropship), "ShipLandedAnimationEvent")] [HarmonyPrefix] public static void AddLateItemsServer(ItemDropship __instance) { if (((NetworkBehaviour)__instance).IsServer && __instance.shipLanded && !__instance.shipDoorsOpened) { while (orderedItemsFromTerminal.Count > 0 && itemsToDeliver.Count < 12) { itemsToDeliver.Add(orderedItemsFromTerminal[0]); orderedItemsFromTerminal.RemoveAt(0); } } } } }
BepInEx/plugins/FlipMods-LetMeLookDown/LetMeLookDown.dll
Decompiled a year agousing System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Reflection; using System.Reflection.Emit; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using GameNetcodeStuff; using HarmonyLib; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("LetMeLookDown")] [assembly: AssemblyDescription("Mod made by flipf17")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("LetMeLookDown")] [assembly: AssemblyCopyright("Copyright © 2023")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("a9c88d54-8f01-44a7-be0d-bd61d38aadcb")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyVersion("1.0.0.0")] namespace LetMeLookDown { [BepInPlugin("FlipMods.LetMeLookDown", "LetMeLookDown", "1.0.1")] public class Plugin : BaseUnityPlugin { private Harmony _harmony; private static Plugin instance; public static float maxAngle = 80f; private void Awake() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown _harmony = new Harmony("LetMeLookDown"); _harmony.PatchAll(); ((BaseUnityPlugin)this).Logger.LogInfo((object)"LetMeLookDown mod loaded"); instance = this; } public static void Log(string message) { ((BaseUnityPlugin)instance).Logger.LogInfo((object)message); } } public static class PluginInfo { public const string PLUGIN_GUID = "FlipMods.LetMeLookDown"; public const string PLUGIN_NAME = "LetMeLookDown"; public const string PLUGIN_VERSION = "1.0.1"; } } namespace LetMeLookDown.Patches { [HarmonyPatch] internal class AdjustSmoothLookingPatcher { [HarmonyPatch(typeof(PlayerControllerB), "CalculateSmoothLookingInput")] private static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions) { List<CodeInstruction> list = new List<CodeInstruction>(instructions); for (int i = 0; i < list.Count; i++) { if (list[i].opcode == OpCodes.Ldc_R4 && (float)list[i].operand == 60f) { list[i].operand = Plugin.maxAngle; break; } } return list.AsEnumerable(); } } [HarmonyPatch] internal class AdjustNormalLookingPatcher { [HarmonyPatch(typeof(PlayerControllerB), "CalculateNormalLookingInput")] private static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions) { List<CodeInstruction> list = new List<CodeInstruction>(instructions); for (int i = 0; i < list.Count; i++) { if (list[i].opcode == OpCodes.Ldc_R4 && (float)list[i].operand == 60f) { list[i].operand = Plugin.maxAngle; break; } } return list.AsEnumerable(); } } }
BepInEx/plugins/FlipMods-MoreBlood/MoreBlood.dll
Decompiled a year agousing System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using BepInEx.Configuration; using GameNetcodeStuff; using HarmonyLib; using MoreBlood.Config; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("MoreBlood")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("MoreBlood")] [assembly: AssemblyCopyright("Copyright © 2023")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("d1f1321d-30a3-4600-9bf8-1e69fe1abf8c")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyVersion("1.0.0.0")] namespace MoreBlood { [BepInPlugin("FlipMods.MoreBlood", "MoreBlood", "1.0.2")] public class Plugin : BaseUnityPlugin { public static Plugin instance; private Harmony _harmony; private void Awake() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown instance = this; _harmony = new Harmony("MoreBlood"); ConfigSettings.BindConfigSettings(); _harmony.PatchAll(); ((BaseUnityPlugin)this).Logger.LogInfo((object)"MoreBlood loaded"); } public static void Log(string message) { ((BaseUnityPlugin)instance).Logger.LogInfo((object)message); } } public static class PluginInfo { public const string PLUGIN_GUID = "FlipMods.MoreBlood"; public const string PLUGIN_NAME = "MoreBlood"; public const string PLUGIN_VERSION = "1.0.2"; } } namespace MoreBlood.Patches { [HarmonyPatch(typeof(PlayerControllerB))] internal class MoreBloodPatcher { private static int bloodCount; [HarmonyPatch("DropBlood")] [HarmonyPostfix] public static void MoreBlood(PlayerControllerB __instance, Vector3 direction = default(Vector3), bool leaveBlood = true, bool leaveFootprint = false) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) bloodCount++; if (bloodCount < ConfigSettings.numBloodPools.Value) { __instance.DropBlood(direction, leaveBlood, leaveFootprint); } else { bloodCount = 0; } } [HarmonyPatch("RandomizeBloodRotationAndScale")] [HarmonyPostfix] public static void RandomizeBloodScale(ref Transform blood, PlayerControllerB __instance) { //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0022: 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) Transform obj = blood; obj.localScale *= ConfigSettings.bloodScale.Value; blood.position += new Vector3((float)Random.Range(-1, 1) * ConfigSettings.bloodScale.Value, 0.55f, (float)Random.Range(-1, 1) * ConfigSettings.bloodScale.Value); } } } namespace MoreBlood.Config { public static class ConfigSettings { public static ConfigEntry<float> bloodScale; public static ConfigEntry<int> numBloodPools; public static void BindConfigSettings() { Plugin.Log("BindingConfigs"); bloodScale = ((BaseUnityPlugin)Plugin.instance).Config.Bind<float>("MoreBlood", "BloodScale", 4f, "The size of the blood pools"); numBloodPools = ((BaseUnityPlugin)Plugin.instance).Config.Bind<int>("MoreBlood", "NumberOfBloodPools", 4, "Max number of blood pools spread around the blood source."); } } }
BepInEx/plugins/FlipMods-ObjectVolumeController/ObjectVolumeController.dll
Decompiled a year agousing System; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using GameNetcodeStuff; using HarmonyLib; using TMPro; using Unity.Netcode; using UnityEngine; using UnityEngine.InputSystem; using UnityEngine.InputSystem.Controls; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("ObjectVolumeController")] [assembly: AssemblyDescription("Mod made by flipf17")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("ObjectVolumeController")] [assembly: AssemblyCopyright("Copyright © 2023")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("49ff2710-6c88-48c4-989a-32b79f0ddd6a")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyVersion("1.0.0.0")] namespace ObjectVolumeController { [BepInPlugin("FlipMods.ObjectVolumeController", "ObjectVolumeController", "1.0.3")] public class Plugin : BaseUnityPlugin { public static Plugin instance; private Harmony _harmony; public static Key volumeUpKey = (Key)14; public static Key volumeDownKey = (Key)13; public static string volumeHoverTip = "Volume up: [+]\nVolume down: [-]"; public static float volumeIncrement = 0.1f; public static float maxDisplayedVolume = 1.5f; public static float defaultVolume = 1f; private void Awake() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown _harmony = new Harmony("ObjectVolumeController"); _harmony.PatchAll(); ((BaseUnityPlugin)this).Logger.LogInfo((object)"ObjectVolumeController loaded"); instance = this; } public static void Log(string message) { ((BaseUnityPlugin)instance).Logger.LogInfo((object)message); } } public static class PluginInfo { public const string PLUGIN_GUID = "FlipMods.ObjectVolumeController"; public const string PLUGIN_NAME = "ObjectVolumeController"; public const string PLUGIN_VERSION = "1.0.3"; } } namespace ObjectVolumeController.Patcher { [HarmonyPatch] internal class ChangeVolumePatcher { private static AudioPlayerItemType boomboxItems = new AudioPlayerItemType("Boomboxes", "Grab boombox: [E]"); private static AudioPlayerPlaceableType recordPlayers = new AudioPlayerPlaceableType("Record players", "Record player: [E]"); private static AudioPlayerPlaceableType televisions = new AudioPlayerPlaceableType("Televisions", "Television: [E]"); [HarmonyPatch(typeof(PlayerControllerB), "Update")] [HarmonyPrefix] public static void GetObjectLookingAt(PlayerControllerB __instance) { boomboxItems.lookingAtDeviceType = false; recordPlayers.lookingAtDeviceType = false; televisions.lookingAtDeviceType = false; if (!((NetworkBehaviour)__instance).IsOwner || !__instance.isPlayerControlled || __instance.inTerminalMenu || __instance.isTypingChat || __instance.isPlayerDead) { return; } InteractTrigger hoveringOverTrigger = __instance.hoveringOverTrigger; object obj; if (hoveringOverTrigger == null) { obj = null; } else { Transform parent = ((Component)hoveringOverTrigger).transform.parent; obj = ((parent != null) ? ((Component)parent).gameObject : null); } GameObject val = (GameObject)obj; if ((Object)(object)val != (Object)null) { if (((Object)val).name.Contains("RecordPlayer")) { recordPlayers.lookingAtDeviceType = true; } else if (((Object)val).name.Contains("Television")) { televisions.lookingAtDeviceType = true; } } if (!recordPlayers.lookingAtDeviceType && !televisions.lookingAtDeviceType) { if ((Object)(object)__instance.cursorTip != (Object)null && ((TMP_Text)__instance.cursorTip).text.Contains(boomboxItems.originalHoverTip)) { boomboxItems.lookingAtDeviceType = true; } else if ((Object)(object)__instance.currentlyHeldObjectServer != (Object)null && __instance.currentlyHeldObjectServer is BoomboxItem) { boomboxItems.lookingAtDeviceType = true; } } } [HarmonyPatch(typeof(PlayerControllerB), "Update")] [HarmonyPostfix] public static void GetVolumeInput(PlayerControllerB __instance) { if (!((NetworkBehaviour)__instance).IsOwner || !__instance.isPlayerControlled || __instance.inTerminalMenu || __instance.isTypingChat || __instance.isPlayerDead || (!boomboxItems.lookingAtDeviceType && !recordPlayers.lookingAtDeviceType && !televisions.lookingAtDeviceType)) { return; } float num = 0f; if (((ButtonControl)Keyboard.current.minusKey).wasPressedThisFrame) { num = 0f - Plugin.volumeIncrement; } if (((ButtonControl)Keyboard.current.equalsKey).wasPressedThisFrame) { num = Plugin.volumeIncrement; } if (num != 0f) { Plugin.Log("AdjustVolume: " + num); AudioPlayerTypeBase audioPlayerTypeBase = null; if (boomboxItems.lookingAtDeviceType) { audioPlayerTypeBase = boomboxItems; } else if (recordPlayers.lookingAtDeviceType) { audioPlayerTypeBase = recordPlayers; } else if (televisions.lookingAtDeviceType) { audioPlayerTypeBase = televisions; } if (audioPlayerTypeBase != null) { audioPlayerTypeBase.currentVolume = Mathf.Clamp(audioPlayerTypeBase.currentVolume + num, 0f, Plugin.maxDisplayedVolume); audioPlayerTypeBase.UpdateVolumes(); audioPlayerTypeBase.UpdateTooltips(); Plugin.Log($"[{audioPlayerTypeBase.name}] Updating volume to: {audioPlayerTypeBase.currentVolume}%"); } } } [HarmonyPatch(typeof(BoomboxItem), "Start")] [HarmonyPostfix] public static void SetBoomboxHoverTip(BoomboxItem __instance) { boomboxItems.audioSources.Add(__instance.boomboxAudio); boomboxItems.items.Add((GrabbableObject)(object)__instance); ((GrabbableObject)__instance).itemProperties.canBeGrabbedBeforeGameStart = true; if (boomboxItems.defaultVolume == 0f) { boomboxItems.defaultVolume = __instance.boomboxAudio.volume; Plugin.Log("Boombox volume: " + boomboxItems.defaultVolume); } if (boomboxItems.controlTooltips == null) { boomboxItems.controlTooltips = new List<string>(((GrabbableObject)__instance).itemProperties.toolTips); boomboxItems.controlTooltips.Add(""); } boomboxItems.UpdateTooltips(); boomboxItems.UpdateVolumes(); } [HarmonyPatch(typeof(AutoParentToShip), "Awake")] [HarmonyPostfix] public static void SetRecordPlayerHoverTip(AutoParentToShip __instance) { if (((Object)__instance).name.Contains("RecordPlayerContainer")) { AudioSource val = ((Component)__instance).GetComponentInChildren<AnimatedObjectTrigger>()?.thisAudioSource; if ((Object)(object)val != (Object)null) { recordPlayers.audioSources.Add(val); } InteractTrigger componentInChildren = ((Component)__instance).GetComponentInChildren<InteractTrigger>(); if (recordPlayers.defaultVolume == 0f) { recordPlayers.defaultVolume = val.volume; Plugin.Log("RecordPlayer Volume: " + recordPlayers.defaultVolume); } if ((Object)(object)componentInChildren == (Object)null) { Plugin.Log("Record player trigger missing!"); return; } recordPlayers.triggers.Add(componentInChildren); recordPlayers.UpdateTooltips(); recordPlayers.UpdateVolumes(); } } [HarmonyPatch(typeof(TVScript), "__initializeVariables")] [HarmonyPostfix] public static void SetTelevisionHoverTip(TVScript __instance) { televisions.audioSources.Add(__instance.tvSFX); Transform parent = ((Component)__instance).transform.parent; InteractTrigger val = ((parent != null) ? ((Component)parent).GetComponentInChildren<InteractTrigger>() : null); if (televisions.defaultVolume == 0f) { televisions.defaultVolume = __instance.tvSFX.volume; Plugin.Log("Television volume: " + televisions.defaultVolume); } if ((Object)(object)val == (Object)null) { Plugin.Log("Television trigger missing!"); return; } televisions.triggers.Add(val); televisions.UpdateTooltips(); televisions.UpdateVolumes(); } } internal abstract class AudioPlayerTypeBase { public string name; public List<AudioSource> audioSources; public string originalHoverTip; public float defaultVolume; public float currentVolume; public bool lookingAtDeviceType; public Type objectType; public AudioPlayerTypeBase(string name, string originalHoverTip = "", float defaultVolume = 0f) { this.name = name; audioSources = new List<AudioSource>(); this.originalHoverTip = originalHoverTip; this.defaultVolume = defaultVolume; currentVolume = Plugin.defaultVolume; lookingAtDeviceType = false; } public void UpdateVolumes() { for (int i = 0; i < audioSources.Count; i++) { if ((Object)(object)audioSources[i] != (Object)null) { audioSources[i].volume = currentVolume / Plugin.maxDisplayedVolume; } } } public abstract void UpdateTooltips(); } internal class AudioPlayerItemType : AudioPlayerTypeBase { public List<GrabbableObject> items; public List<string> controlTooltips; public AudioPlayerItemType(string name, string originalHoverTip = "", float defaultVolume = 0f) : base(name, originalHoverTip, defaultVolume) { items = new List<GrabbableObject>(); } public override void UpdateTooltips() { for (int i = 0; i < items.Count; i++) { if ((Object)(object)items[i] != (Object)null) { items[i].customGrabTooltip = $"{originalHoverTip}\n{Mathf.RoundToInt(currentVolume * 10f) * 10}% volume\n{Plugin.volumeHoverTip}"; controlTooltips[controlTooltips.Count - 1] = items[i].customGrabTooltip.Replace(originalHoverTip + "\n", ""); items[i].itemProperties.toolTips = controlTooltips.ToArray(); } } PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController; if ((Object)(object)localPlayerController != (Object)null && (Object)(object)localPlayerController.currentlyHeldObjectServer != (Object)null && items.Contains(localPlayerController.currentlyHeldObjectServer)) { localPlayerController.currentlyHeldObjectServer.EquipItem(); } } } internal class AudioPlayerPlaceableType : AudioPlayerTypeBase { public List<InteractTrigger> triggers; public AudioPlayerPlaceableType(string name, string originalHoverTip = "", float defaultVolume = 0f) : base(name, originalHoverTip, defaultVolume) { triggers = new List<InteractTrigger>(); } public override void UpdateTooltips() { for (int i = 0; i < triggers.Count; i++) { if ((Object)(object)triggers[i] != (Object)null) { triggers[i].hoverTip = $"{originalHoverTip}\n{Mathf.RoundToInt(currentVolume * 10f) * 10}% volume\n{Plugin.volumeHoverTip}"; } } } } }
BepInEx/plugins/FlipMods-ReservedFlashlightSlot/ReservedFlashlightSlot.dll
Decompiled a year agousing System.Collections; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using BepInEx.Configuration; using GameNetcodeStuff; using HarmonyLib; using ReservedFlashlightSlot.Patches; using ReservedItemSlotCore; using ReservedItemSlotCore.Networking; using ReservedItemSlotCore.Patches; using Unity.Netcode; using UnityEngine; using UnityEngine.InputSystem; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("ReservedFlashlightSlot")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("ReservedFlashlightSlot")] [assembly: AssemblyCopyright("Copyright © 2023")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("5b7d6563-4e51-4a69-bcf9-fa1dea6eff75")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyVersion("1.0.0.0")] namespace ReservedFlashlightSlot { public static class ConfigSettings { public static ConfigEntry<string> activateFlashlightKey; public static ConfigEntry<bool> hideFlashlightMeshShoulder; public static string activateFlashlightDisplayName; public static void BindConfigSettings() { Plugin.Log("BindingConfigs"); activateFlashlightKey = ((BaseUnityPlugin)Plugin.instance).Config.Bind<string>("ReservedItemSlotCore", "ActivateFlashlightKey", "<Keyboard>/f", "Activate flashlight keybind."); hideFlashlightMeshShoulder = ((BaseUnityPlugin)Plugin.instance).Config.Bind<bool>("ReservedItemSlotCore", "HideFlashlightOnShoulder", false, "Hides the flashlight mesh while on your shoulder."); activateFlashlightDisplayName = GetDisplayName(activateFlashlightKey.Value); } public static string GetDisplayName(string key) { key = key.Replace("<Keyboard>/", ""); key = key.Replace("<Mouse>/", ""); string text = key; text = text.Replace("leftAlt", "Alt"); text = text.Replace("rightAlt", "Alt"); text = text.Replace("leftCtrl", "Ctrl"); text = text.Replace("rightCtrl", "Ctrl"); text = text.Replace("leftShift", "Shift"); text = text.Replace("rightShift", "Shift"); text = text.Replace("leftButton", "LMB"); text = text.Replace("rightButton", "RMB"); return text.Replace("middleButton", "MMB"); } } [HarmonyPatch] internal static class Keybinds { public static PlayerControllerB localPlayerController; private static InputAction activateFlashlightAction; [HarmonyPatch(typeof(PlayerControllerB), "ConnectClientToPlayerObject")] [HarmonyPostfix] public static void OnLocalPlayerConnect(PlayerControllerB __instance) { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown localPlayerController = __instance; activateFlashlightAction = new InputAction((string)null, (InputActionType)0, ConfigSettings.activateFlashlightKey.Value, "Press", (string)null, (string)null); if (((Component)localPlayerController).gameObject.activeSelf) { SubscribeToEvents(); } } private static void SubscribeToEvents() { if (activateFlashlightAction != null) { activateFlashlightAction.Enable(); activateFlashlightAction.performed += OnActivateFlashlightPerformed; } } [HarmonyPatch(typeof(PlayerControllerB), "OnEnable")] [HarmonyPostfix] public static void OnEnable(PlayerControllerB __instance) { if ((Object)(object)__instance == (Object)(object)localPlayerController) { SubscribeToEvents(); } } [HarmonyPatch(typeof(PlayerControllerB), "OnDisable")] [HarmonyPostfix] public static void OnDisable(PlayerControllerB __instance) { if (activateFlashlightAction != null && !((Object)(object)__instance != (Object)(object)localPlayerController)) { activateFlashlightAction.performed -= OnActivateFlashlightPerformed; activateFlashlightAction.Disable(); } } private static void OnActivateFlashlightPerformed(CallbackContext context) { if ((Object)(object)localPlayerController == (Object)null || !localPlayerController.isPlayerControlled || localPlayerController.inTerminalMenu || (((NetworkBehaviour)localPlayerController).IsServer && !localPlayerController.isHostPlayerObject)) { return; } FlashlightItem mainFlashlight = ReservedFlashlightSlotPatcher.GetMainFlashlight(localPlayerController); if (((CallbackContext)(ref context)).performed && !((Object)(object)mainFlashlight == (Object)null)) { float num = (float)Traverse.Create((object)localPlayerController).Field("timeSinceSwitchingSlots").GetValue(); if (!(num < 0.075f)) { ((GrabbableObject)mainFlashlight).UseItemOnClient(!((GrabbableObject)mainFlashlight).isBeingUsed); Traverse.Create((object)localPlayerController).Field("timeSinceSwitchingSlots").SetValue((object)0); } } } } [BepInPlugin("FlipMods.ReservedFlashlightSlot", "ReservedFlashlightSlot", "1.4.5")] [BepInDependency(/*Could not decode attribute arguments.*/)] public class Plugin : BaseUnityPlugin { public static Plugin instance; private Harmony _harmony; public static ReservedItemInfo proFlashlightInfo = new ReservedItemInfo("Pro-flashlight", 120, true, true, true, true); public static ReservedItemInfo flashlightInfo = new ReservedItemInfo("Flashlight", 120, true, true, true, true); private void Awake() { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Expected O, but got Unknown instance = this; ConfigSettings.BindConfigSettings(); _harmony = new Harmony("ReservedFlashlightSlot"); _harmony.PatchAll(); ((BaseUnityPlugin)this).Logger.LogInfo((object)"ReservedFlashlightSlot loaded"); } public static void Log(string message) { ((BaseUnityPlugin)instance).Logger.LogInfo((object)message); } } public static class PluginInfo { public const string PLUGIN_GUID = "FlipMods.ReservedFlashlightSlot"; public const string PLUGIN_NAME = "ReservedFlashlightSlot"; public const string PLUGIN_VERSION = "1.4.5"; } } namespace ReservedFlashlightSlot.Patches { [HarmonyPatch] internal static class ReservedFlashlightSlotPatcher { private static Vector3 playerShoulderPositionOffset = new Vector3(0.2f, 0f, 0f); private static Vector3 playerShoulderRotationOffset = new Vector3(90f, 0f, 0f); private static string originalControlTooltip = ""; public static PlayerControllerB localPlayerController => PlayerPatcher.localPlayerController; public static PlayerControllerB GetPreviousPlayerHeldBy(FlashlightItem flashlightItem) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown return (PlayerControllerB)Traverse.Create((object)flashlightItem).Field("previousPlayerHeldBy").GetValue(); } public static FlashlightItem GetMainFlashlight(PlayerControllerB playerController) { return GetCurrentlySelectedFlashlight(playerController) ?? GetReservedFlashlight(playerController); } public static FlashlightItem GetReservedFlashlight(PlayerControllerB playerController) { GrabbableObject obj = ((playerController != null) ? playerController.ItemSlots[Plugin.flashlightInfo.indexInInventory] : null); return (FlashlightItem)(object)((obj is FlashlightItem) ? obj : null); } public static FlashlightItem GetCurrentlySelectedFlashlight(PlayerControllerB playerController) { GrabbableObject obj = ((playerController != null) ? playerController.ItemSlots[playerController.currentItemSlot] : null); return (FlashlightItem)(object)((obj is FlashlightItem) ? obj : null); } public static bool IsFlashlightOn(PlayerControllerB playerController) { return ((GrabbableObject)(GetMainFlashlight(playerController)?)).isBeingUsed ?? false; } [HarmonyPatch(typeof(FlashlightItem), "__initializeVariables")] [HarmonyPostfix] public static void EditTooltips(FlashlightItem __instance) { if (originalControlTooltip == "") { originalControlTooltip = ((GrabbableObject)__instance).itemProperties.toolTips[((GrabbableObject)__instance).itemProperties.toolTips.Length - 1]; } ((GrabbableObject)__instance).itemProperties.toolTips[((GrabbableObject)__instance).itemProperties.toolTips.Length - 1] = $"{originalControlTooltip}[{ConfigSettings.activateFlashlightDisplayName.ToUpper()}]"; } [HarmonyPatch(typeof(MenuManager), "OnEnable")] [HarmonyPostfix] public static void ResetVariables() { Keybinds.localPlayerController = null; } [HarmonyPatch(typeof(PlayerControllerB), "ActivateItem_performed")] [HarmonyPrefix] public static bool PreventActivatingDuplicateItem(CallbackContext context, PlayerControllerB __instance) { FlashlightItem currentlySelectedFlashlight = GetCurrentlySelectedFlashlight(__instance); if ((Object)(object)__instance != (Object)(object)localPlayerController || (Object)(object)currentlySelectedFlashlight == (Object)null) { return true; } if (!((CallbackContext)(ref context)).performed) { return false; } FlashlightItem reservedFlashlight = GetReservedFlashlight(__instance); if ((Object)(object)currentlySelectedFlashlight != (Object)(object)reservedFlashlight && (!((GrabbableObject)reservedFlashlight).itemProperties.requiresBattery || !((GrabbableObject)reservedFlashlight).insertedBattery.empty)) { return false; } return true; } [HarmonyPatch(typeof(FlashlightItem), "SwitchFlashlight")] [HarmonyPostfix] public static void OnSwitchOnOffFlashlight(bool on, FlashlightItem __instance) { if (!((Object)(object)((GrabbableObject)__instance).playerHeldBy == (Object)null)) { UpdateAllFlashlightStates(((GrabbableObject)__instance).playerHeldBy, on); } } [HarmonyPatch(typeof(FlashlightItem), "PocketItem")] [HarmonyPostfix] public static void OnPocketFlashlightLocal(FlashlightItem __instance) { OnPocketFlashlight(__instance, ((GrabbableObject)__instance).isBeingUsed); } [HarmonyPatch(typeof(FlashlightItem), "PocketFlashlightClientRpc")] [HarmonyPrefix] public static bool OnPocketFlashlightClientRpc(bool stillUsingFlashlight, FlashlightItem __instance) { if (!NetworkHelper.IsValidClientRpcExecStage((NetworkBehaviour)(object)__instance) || ((NetworkBehaviour)__instance).IsOwner || (Object)(object)((GrabbableObject)__instance).playerHeldBy == (Object)null || (Object)(object)((GrabbableObject)__instance).playerHeldBy == (Object)(object)localPlayerController || !NetworkHelper.IsClientExecStage((NetworkBehaviour)(object)__instance)) { return false; } ((MonoBehaviour)__instance).StartCoroutine(OnPocketFlashlightEndOfFrame(__instance, stillUsingFlashlight)); return true; } private static IEnumerator OnPocketFlashlightEndOfFrame(FlashlightItem flashlightItem, bool stillUsingFlashlight) { yield return (object)new WaitForEndOfFrame(); OnPocketFlashlight(flashlightItem, stillUsingFlashlight); } private static void OnPocketFlashlight(FlashlightItem flashlightItem, bool stillUsingFlashlight = false) { if (!((Object)(object)((GrabbableObject)flashlightItem).playerHeldBy == (Object)null)) { ((GrabbableObject)flashlightItem).playerHeldBy.pocketedFlashlight = (GrabbableObject)(object)flashlightItem; ((GrabbableObject)flashlightItem).parentObject = ((GrabbableObject)flashlightItem).playerHeldBy.playerGlobalHead; bool flag = (Object)(object)((GrabbableObject)flashlightItem).playerHeldBy == (Object)(object)localPlayerController; } } [HarmonyPatch(typeof(FlashlightItem), "EquipItem")] [HarmonyPostfix] public static void OnEquipFlashlight(FlashlightItem __instance) { if (!((Object)(object)((GrabbableObject)__instance).playerHeldBy == (Object)null)) { if ((Object)(object)__instance == (Object)(object)((GrabbableObject)__instance).playerHeldBy.pocketedFlashlight) { ((GrabbableObject)__instance).playerHeldBy.pocketedFlashlight = null; } ((GrabbableObject)__instance).parentObject = (((Object)(object)((GrabbableObject)__instance).playerHeldBy == (Object)(object)localPlayerController) ? ((GrabbableObject)__instance).playerHeldBy.localItemHolder : ((GrabbableObject)__instance).playerHeldBy.serverItemHolder); } } [HarmonyPatch(typeof(GrabbableObject), "LateUpdate")] [HarmonyPostfix] public static void SetPositionOffset(GrabbableObject __instance) { //IL_006c: 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_0076: 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) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009d: 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) if (__instance is FlashlightItem && (Object)(object)__instance.playerHeldBy != (Object)null && __instance.isPocketed && (Object)(object)__instance.parentObject != (Object)null && (Object)(object)__instance != (Object)(object)GetCurrentlySelectedFlashlight(__instance.playerHeldBy)) { Transform transform = ((Component)__instance.parentObject).transform; ((Component)__instance).transform.rotation = ((Component)__instance.parentObject).transform.rotation * Quaternion.Euler(playerShoulderRotationOffset); ((Component)__instance).transform.position = transform.position + transform.rotation * playerShoulderPositionOffset; } } [HarmonyPatch(typeof(GrabbableObject), "EnableItemMeshes")] [HarmonyPrefix] public static void OnEnableItemMeshes(ref bool enable, GrabbableObject __instance) { if (__instance is FlashlightItem && (Object)(object)__instance.playerHeldBy != (Object)null && ((Object)(object)__instance == (Object)(object)GetCurrentlySelectedFlashlight(__instance.playerHeldBy) || ((Object)(object)__instance == (Object)(object)GetReservedFlashlight(__instance.playerHeldBy) && (Object)(object)__instance.playerHeldBy != (Object)(object)localPlayerController))) { enable = true; } } private static void UpdateAllFlashlightStates(PlayerControllerB playerController, bool mainFlashlightActive = true) { FlashlightItem mainFlashlight = GetMainFlashlight(playerController); if ((Object)(object)mainFlashlight == (Object)null) { ((Behaviour)playerController.helmetLight).enabled = false; mainFlashlightActive = false; } else { playerController.ChangeHelmetLight(mainFlashlight.flashlightTypeID, mainFlashlightActive && (Object)(object)playerController == (Object)(object)localPlayerController && (Object)(object)playerController.ItemSlots[playerController.currentItemSlot] != (Object)(object)mainFlashlight); } for (int i = 0; i < PlayerPatcher.combinedHotbarSize; i++) { GrabbableObject obj = playerController.ItemSlots[i]; FlashlightItem val = (FlashlightItem)(object)((obj is FlashlightItem) ? obj : null); if ((Object)(object)val != (Object)null) { UpdateFlashlightState(val, (Object)(object)val == (Object)(object)mainFlashlight && mainFlashlightActive); } } } private static void UpdateFlashlightState(FlashlightItem flashlightItem, bool active) { if (!((Object)(object)((GrabbableObject)flashlightItem).playerHeldBy == (Object)null)) { PlayerControllerB playerHeldBy = ((GrabbableObject)flashlightItem).playerHeldBy; ((GrabbableObject)flashlightItem).isBeingUsed = active; bool flag = (Object)(object)playerHeldBy != (Object)(object)localPlayerController || (Object)(object)playerHeldBy.ItemSlots[playerHeldBy.currentItemSlot] == (Object)(object)flashlightItem; ((Behaviour)flashlightItem.flashlightBulb).enabled = active && flag; ((Behaviour)flashlightItem.flashlightBulbGlow).enabled = active && flag; flashlightItem.usingPlayerHelmetLight = active && !flag; } } } }
BepInEx/plugins/FlipMods-ReservedItemSlotCore/ReservedItemSlotCore.dll
Decompiled a year agousing System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using BepInEx.Configuration; using GameNetcodeStuff; using HarmonyLib; using ReservedItemSlotCore.Networking; using ReservedItemSlotCore.Patches; using TMPro; using Unity.Collections; using Unity.Netcode; using UnityEngine; using UnityEngine.InputSystem; 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: AssemblyTitle("ReservedItemSlotCore")] [assembly: AssemblyDescription("Mod made by flipf17")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("ReservedItemSlotCore")] [assembly: AssemblyCopyright("Copyright © 2023")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("238ce080-e339-46b6-9b08-992a950453a1")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyVersion("1.0.0.0")] namespace ReservedItemSlotCore { public static class ConfigSettings { public static ConfigEntry<string> focusReservedHotbarHotkey; public static ConfigEntry<string> specialReservedItemUseHotkey; public static string focusReservedHotbarHotkeyDisplayName; public static void BindConfigSettings() { Plugin.Log("BindingConfigs"); focusReservedHotbarHotkey = ((BaseUnityPlugin)Plugin.instance).Config.Bind<string>("ReservedItemSlotCore", "FocusReservedItemSlotsHotkey", "<Keyboard>/leftAlt", "Which key will focus your reserved item slots hotbar to allow selcting, dropping, charging, etc."); specialReservedItemUseHotkey = ((BaseUnityPlugin)Plugin.instance).Config.Bind<string>("ReservedItemSlotCore", "SpecialReservedItemUseHotkey", "<Mouse>/middleButton", "[REMOVED] Which key will focus your reserved item slots hotbar to allow selcting, dropping, charging, etc."); focusReservedHotbarHotkeyDisplayName = GetDisplayName(focusReservedHotbarHotkey.Value); } public static string GetDisplayName(string key) { key = key.Replace("<Keyboard>/", ""); key = key.Replace("<Mouse>/", ""); string text = key; text = text.Replace("leftAlt", "Alt"); text = text.Replace("rightAlt", "Alt"); text = text.Replace("leftCtrl", "Ctrl"); text = text.Replace("rightCtrl", "Ctrl"); text = text.Replace("leftShift", "Shift"); text = text.Replace("rightShift", "Shift"); text = text.Replace("leftButton", "LMB"); text = text.Replace("rightButton", "RMB"); return text.Replace("middleButton", "MMB"); } } [HarmonyPatch] internal static class HotbarSlotSync { public static PlayerControllerB localPlayerController; [HarmonyPatch(typeof(PlayerControllerB), "ConnectClientToPlayerObject")] [HarmonyPostfix] public static void Init(PlayerControllerB __instance) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Expected O, but got Unknown //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Expected O, but got Unknown localPlayerController = __instance; NetworkManager.Singleton.CustomMessagingManager.RegisterNamedMessageHandler("OnSwapHotbarClientRpc", new HandleNamedMessageDelegate(OnSwapHotbarClientRpc)); if (NetworkManager.Singleton.IsServer) { NetworkManager.Singleton.CustomMessagingManager.RegisterNamedMessageHandler("OnSwapHotbarServerRpc", new HandleNamedMessageDelegate(OnSwapHotbarServerRpc)); } } private static void SendSwapHotbarUpdate(int hotbarSlot) { //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) if (NetworkManager.Singleton.IsClient) { FastBufferWriter val = default(FastBufferWriter); ((FastBufferWriter)(ref val))..ctor(4, (Allocator)2, -1); try { Plugin.Log("Sending hotbar swap slot: " + hotbarSlot); ((FastBufferWriter)(ref val)).WriteValue<int>(ref hotbarSlot, default(ForPrimitives)); NetworkManager.Singleton.CustomMessagingManager.SendNamedMessage("OnSwapHotbarServerRpc", 0uL, val, (NetworkDelivery)3); return; } finally { ((IDisposable)(FastBufferWriter)(ref val)).Dispose(); } } Plugin.Log("Failed to send hotbar swap index."); } private static void OnSwapHotbarServerRpc(ulong clientId, FastBufferReader reader) { //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0033: 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) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_0082: 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_009e: Unknown result type (might be due to invalid IL or missing references) if (!NetworkManager.Singleton.IsServer) { return; } if (((FastBufferReader)(ref reader)).TryBeginRead(4)) { int num = default(int); ((FastBufferReader)(ref reader)).ReadValue<int>(ref num, default(ForPrimitives)); Plugin.Log("Receiving request for hotbar swap. Slot: " + num + " ClientId: " + clientId); FastBufferWriter val = default(FastBufferWriter); ((FastBufferWriter)(ref val))..ctor(12, (Allocator)2, -1); try { ((FastBufferWriter)(ref val)).WriteValueSafe<int>(ref num, default(ForPrimitives)); ((FastBufferWriter)(ref val)).WriteValueSafe<ulong>(ref clientId, default(ForPrimitives)); NetworkManager.Singleton.CustomMessagingManager.SendNamedMessageToAll("OnSwapHotbarClientRpc", val, (NetworkDelivery)3); return; } finally { ((IDisposable)(FastBufferWriter)(ref val)).Dispose(); } } Plugin.Log("Failed to receive hotbar swap index from Client: " + clientId); } private static void OnSwapHotbarClientRpc(ulong clientId, FastBufferReader reader) { //IL_002e: 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) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) if (!NetworkManager.Singleton.IsClient) { return; } if (((FastBufferReader)(ref reader)).TryBeginRead(12)) { int hotbarSlot = default(int); ((FastBufferReader)(ref reader)).ReadValue<int>(ref hotbarSlot, default(ForPrimitives)); ulong num = default(ulong); ((FastBufferReader)(ref reader)).ReadValue<ulong>(ref num, default(ForPrimitives)); Plugin.Log("Receiving update for hotbar swap. Slot: " + hotbarSlot + " ClientId: " + num); if (num == localPlayerController.actualClientId || UpdateClientHotbarSlot(num, hotbarSlot)) { return; } Plugin.Log("Failed to receive hotbar swap index from Client: " + num); } Plugin.Log("Failed to receive hotbar swap index from Client"); } private static bool UpdateClientHotbarSlot(ulong clientId, int hotbarSlot) { Plugin.Log("Updating hotbar slot: " + hotbarSlot + " ClientId: " + clientId); for (int i = 0; i < StartOfRound.Instance.allPlayerScripts.Length; i++) { if (StartOfRound.Instance.allPlayerScripts[i].actualClientId == clientId) { CallSwitchToItemSlotMethod(StartOfRound.Instance.allPlayerScripts[i], hotbarSlot); return true; } } return false; } public static void SwapHotbarSlot(int hotbarIndex) { SendSwapHotbarUpdate(hotbarIndex); CallSwitchToItemSlotMethod(localPlayerController, hotbarIndex); Traverse.Create((object)localPlayerController).Field("timeSinceSwitchingSlots").SetValue((object)0); } private static void CallSwitchToItemSlotMethod(PlayerControllerB playerController, int hotbarIndex) { ShipBuildModeManager.Instance.CancelBuildMode(true); MethodInfo method = ((object)playerController).GetType().GetMethod("SwitchToItemSlot", BindingFlags.Instance | BindingFlags.NonPublic); method.Invoke(playerController, new object[2] { hotbarIndex, null }); if ((Object)(object)playerController.currentlyHeldObjectServer != (Object)null) { ((Component)playerController.currentlyHeldObjectServer).gameObject.GetComponent<AudioSource>().PlayOneShot(playerController.currentlyHeldObjectServer.itemProperties.grabSFX, 0.6f); } } } [HarmonyPatch] internal static class Keybinds { public static PlayerControllerB localPlayerController; public static InputAction focusReservedHotbarAction; public static bool holdingModifierKey; [HarmonyPatch(typeof(PlayerControllerB), "ConnectClientToPlayerObject")] [HarmonyPostfix] public static void OnLocalPlayerConnect(PlayerControllerB __instance) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Expected O, but got Unknown localPlayerController = __instance; focusReservedHotbarAction = new InputAction((string)null, (InputActionType)0, ConfigSettings.focusReservedHotbarHotkey.Value, (string)null, (string)null, (string)null); if (((Component)localPlayerController).gameObject.activeSelf) { SubscribeToEvents(); } } private static void SubscribeToEvents() { if (focusReservedHotbarAction != null && Plugin.numReservedItemSlots > 0) { focusReservedHotbarAction.performed += FocusReservedHotbarSlotsAction; focusReservedHotbarAction.canceled += UnfocusReservedHotbarSlotsPerformed; focusReservedHotbarAction.Enable(); } } [HarmonyPatch(typeof(PlayerControllerB), "OnEnable")] [HarmonyPostfix] public static void OnEnable(PlayerControllerB __instance) { if ((Object)(object)__instance == (Object)(object)localPlayerController) { SubscribeToEvents(); } } [HarmonyPatch(typeof(PlayerControllerB), "OnDisable")] [HarmonyPostfix] public static void OnDisable(PlayerControllerB __instance) { if (focusReservedHotbarAction != null && Plugin.numReservedItemSlots > 0 && !((Object)(object)__instance != (Object)(object)localPlayerController)) { focusReservedHotbarAction.performed -= FocusReservedHotbarSlotsAction; focusReservedHotbarAction.canceled -= UnfocusReservedHotbarSlotsPerformed; focusReservedHotbarAction.Disable(); } } private static void FocusReservedHotbarSlotsAction(CallbackContext context) { if (!((Object)(object)localPlayerController == (Object)null) && !((Object)(object)localPlayerController == (Object)null) && ((NetworkBehaviour)localPlayerController).IsOwner && localPlayerController.isPlayerControlled && (!((NetworkBehaviour)localPlayerController).IsServer || localPlayerController.isHostPlayerObject)) { holdingModifierKey = true; bool flag = (bool)Traverse.Create((object)localPlayerController).Field("throwingObject").GetValue(); if (!(localPlayerController.inTerminalMenu || localPlayerController.isPlayerDead || localPlayerController.isGrabbingObjectAnimation || localPlayerController.inSpecialInteractAnimation || flag) && !localPlayerController.isTypingChat && !localPlayerController.twoHanded && !localPlayerController.activatingItem && ((CallbackContext)(ref context)).performed) { ReservedItemPatcher.SetFocusReservedHotbarSlots(active: true); } } } private static void UnfocusReservedHotbarSlotsPerformed(CallbackContext context) { if (!((Object)(object)localPlayerController == (Object)null) && ((NetworkBehaviour)localPlayerController).IsOwner && (!((NetworkBehaviour)localPlayerController).IsServer || localPlayerController.isHostPlayerObject)) { holdingModifierKey = false; if (ReservedItemPatcher.CanSwapToReservedHotbarSlot() && ((CallbackContext)(ref context)).canceled) { ReservedItemPatcher.SetFocusReservedHotbarSlots(active: false); } } } } [BepInPlugin("FlipMods.ReservedItemSlotCore", "ReservedItemSlotCore", "1.4.4")] public class Plugin : BaseUnityPlugin { private Harmony _harmony; public static Plugin instance; public static Dictionary<string, ReservedItemInfo> reservedItemsDict => ReservedItemInfo.reservedItemsDict; public static List<ReservedItemInfo> reservedItemsList => ReservedItemInfo.reservedItemsList; public static List<ReservedItemInfo> reservedItemSlotReps => ReservedItemInfo.reservedItemSlotReps; public static int numReservedItemSlots => ReservedItemInfo.numReservedItemSlots; private void Awake() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown instance = this; _harmony = new Harmony("ReservedItemSlotCore"); ConfigSettings.BindConfigSettings(); _harmony.PatchAll(); ((BaseUnityPlugin)this).Logger.LogInfo((object)"ReservedItemSlotCore loaded"); } public static void Log(string message) { ((BaseUnityPlugin)instance).Logger.LogInfo((object)message); } public static bool IsReservedItem(string itemName) { return reservedItemsDict.ContainsKey(itemName); } public static ReservedItemInfo GetReservedItemInfo(string itemName) { return IsReservedItem(itemName) ? reservedItemsDict[itemName] : null; } public static ReservedItemInfo GetReservedItemInfo(GrabbableObject item) { return ((Object)(object)item != (Object)null) ? GetReservedItemInfo(item.itemProperties.itemName) : null; } public static int GetReservedItemHotbarIndex(string itemName) { return IsReservedItem(itemName) ? reservedItemsDict[itemName].indexInInventory : (-1); } } public class ReservedItemInfo { public static Dictionary<string, ReservedItemInfo> reservedItemsDict = new Dictionary<string, ReservedItemInfo>(); public static List<ReservedItemInfo> reservedItemsList = new List<ReservedItemInfo>(); public static List<ReservedItemInfo> reservedItemSlotReps = new List<ReservedItemInfo>(); public static int defaultHotbarSlotPriority = 10; public static int currentUndefinedHotbarSlotPriority = 0; public string itemName; public int hotbarSlotPriority; private int undefinedHotbarSlotPriority = -1; public int reservedItemIndex; public bool forceUpdateCanBeGrabbedBeforeGameStart = false; public bool canBeGrabbedBeforeGameStart = false; public bool forceUpdateRequiresBattery = false; public bool requiresBattery = false; public static int numReservedItemSlots => reservedItemSlotReps.Count; public int indexInInventory => ((Object)(object)PlayerPatcher.localPlayerController != (Object)null) ? (PlayerPatcher.localPlayerController.ItemSlots.Length - (numReservedItemSlots - reservedItemIndex)) : (-1); public ReservedItemInfo(string itemName, int hotbarSlotPriority = -1, bool forceUpdateCanBeGrabbedBeforeGameStart = false, bool canBeGrabbedBeforeGameStart = false, bool forceUpdateRequiresBattery = false, bool requiresBattery = false) { this.itemName = itemName; this.forceUpdateCanBeGrabbedBeforeGameStart = forceUpdateCanBeGrabbedBeforeGameStart; this.canBeGrabbedBeforeGameStart = canBeGrabbedBeforeGameStart; this.forceUpdateRequiresBattery = forceUpdateRequiresBattery; this.requiresBattery = requiresBattery; if (hotbarSlotPriority != -1) { this.hotbarSlotPriority = hotbarSlotPriority; } else { this.hotbarSlotPriority = defaultHotbarSlotPriority; undefinedHotbarSlotPriority = ++currentUndefinedHotbarSlotPriority; } if (!reservedItemsDict.ContainsKey(this.itemName)) { reservedItemsDict.Add(this.itemName, this); reservedItemsList.Add(this); int i; for (i = 0; i < reservedItemSlotReps.Count; i++) { ReservedItemInfo reservedItemInfo = reservedItemSlotReps[i]; if (this.hotbarSlotPriority == reservedItemInfo.hotbarSlotPriority) { if (undefinedHotbarSlotPriority == reservedItemInfo.undefinedHotbarSlotPriority) { i = -1; } break; } if (this.hotbarSlotPriority > reservedItemInfo.hotbarSlotPriority) { break; } } if (i >= 0) { reservedItemIndex = i; reservedItemSlotReps.Insert(i, this); for (int j = i + 1; j < reservedItemSlotReps.Count; j++) { reservedItemSlotReps[j].reservedItemIndex = j; } } } else { Plugin.Log($"Tried to add duplicate item name to the ReservedItems list: {this.itemName}"); } } } public static class PluginInfo { public const string PLUGIN_GUID = "FlipMods.ReservedItemSlotCore"; public const string PLUGIN_NAME = "ReservedItemSlotCore"; public const string PLUGIN_VERSION = "1.4.4"; } } namespace ReservedItemSlotCore.Networking { public static class NetworkHelper { private static int NONE_EXEC_STAGE = 0; private static int SERVER_EXEC_STAGE = 1; private static int CLIENT_EXEC_STAGE = 2; public static int GetExecStage(NetworkBehaviour __instance) { return (int)Traverse.Create((object)__instance).Field("__rpc_exec_stage").GetValue(); } public static bool IsClientExecStage(NetworkBehaviour __instance) { return GetExecStage(__instance) == CLIENT_EXEC_STAGE; } public static bool IsServerExecStage(NetworkBehaviour __instance) { return GetExecStage(__instance) == SERVER_EXEC_STAGE; } public static bool IsValidClientRpcExecStage(NetworkBehaviour __instance) { NetworkManager singleton = NetworkManager.Singleton; if ((Object)(object)singleton == (Object)null || !singleton.IsListening) { return false; } int num = (int)Traverse.Create((object)__instance).Field("__rpc_exec_stage").GetValue(); if ((singleton.IsServer || singleton.IsHost) && num != 2) { return false; } return true; } } } namespace ReservedItemSlotCore.Patches { [HarmonyPatch] public static class HUDPatcher { private static CanvasScaler canvasScaler; private static AspectRatioFitter aspectRatioFitter; private static float iconWidth; private static float xPos; [HarmonyPatch(typeof(HUDManager), "Awake")] [HarmonyPrefix] public static void Initialize(HUDManager __instance) { //IL_0032: 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) canvasScaler = ((Component)__instance.itemSlotIconFrames[0]).GetComponentInParent<CanvasScaler>(); aspectRatioFitter = ((Component)__instance.itemSlotIconFrames[0]).GetComponentInParent<AspectRatioFitter>(); iconWidth = ((Component)__instance.itemSlotIconFrames[0]).GetComponent<RectTransform>().sizeDelta.x; xPos = canvasScaler.referenceResolution.x / 2f / aspectRatioFitter.aspectRatio - iconWidth / 4f; } [HarmonyPatch(typeof(HUDManager), "Start")] [HarmonyPostfix] public static void AddNewHotbarSlotsHud(HUDManager __instance) { //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_005c: 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_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Unknown result type (might be due to invalid IL or missing references) //IL_0174: Unknown result type (might be due to invalid IL or missing references) //IL_01c7: Unknown result type (might be due to invalid IL or missing references) //IL_0236: Unknown result type (might be due to invalid IL or missing references) //IL_026a: Unknown result type (might be due to invalid IL or missing references) //IL_0283: Unknown result type (might be due to invalid IL or missing references) //IL_0298: Unknown result type (might be due to invalid IL or missing references) //IL_02a5: Unknown result type (might be due to invalid IL or missing references) //IL_02af: Unknown result type (might be due to invalid IL or missing references) //IL_02c3: Unknown result type (might be due to invalid IL or missing references) //IL_02df: Unknown result type (might be due to invalid IL or missing references) if (PlayerPatcher.reservedHotbarSize > 0) { List<Image> list = new List<Image>(__instance.itemSlotIconFrames); List<Image> list2 = new List<Image>(__instance.itemSlotIcons); float y = ((Component)HUDManager.Instance.itemSlotIconFrames[0]).GetComponent<RectTransform>().sizeDelta.y; Vector3 eulerAngles = ((Transform)((Component)HUDManager.Instance.itemSlotIconFrames[0]).GetComponent<RectTransform>()).eulerAngles; Vector3 eulerAngles2 = ((Transform)((Component)HUDManager.Instance.itemSlotIcons[0]).GetComponent<RectTransform>()).eulerAngles; Plugin.Log($"Adding {ReservedItemInfo.reservedItemsList.Count} Reserved Item slots to the inventory HUD. Previous inventory HUD size: {PlayerPatcher.unreservedHotbarSize}"); for (int i = 0; i < Plugin.reservedItemSlotReps.Count; i++) { ReservedItemInfo reservedItemInfo = Plugin.reservedItemSlotReps[i]; Plugin.Log($"Adding Reserved Item slot for item types [{reservedItemInfo.itemName}]. Inventory index: {list.Count}"); float num = ((Graphic)HUDManager.Instance.itemSlotIconFrames[0]).rectTransform.anchoredPosition.y + 1.125f * y * (float)i; Image val = Object.Instantiate<Image>(HUDManager.Instance.itemSlotIconFrames[PlayerPatcher.unreservedHotbarSize - 1], ((Component)HUDManager.Instance.itemSlotIconFrames[0]).transform.parent); ((Object)val).name = $"ReservedItemSlot{i} [{reservedItemInfo.itemName}]"; ((Graphic)val).rectTransform.anchoredPosition = new Vector2(xPos, num); ((Transform)((Graphic)val).rectTransform).eulerAngles = eulerAngles; CanvasGroup val2 = ((Component)val).gameObject.AddComponent<CanvasGroup>(); val2.ignoreParentGroups = true; val2.alpha = 1f; Image component = ((Component)((Component)val).transform.GetChild(0)).GetComponent<Image>(); ((Object)component).name = "Icon"; ((Transform)((Graphic)component).rectTransform).eulerAngles = eulerAngles2; list.Add(val); list2.Add(component); } if (Plugin.numReservedItemSlots > 0) { TextMeshProUGUI component2 = new GameObject("ReservedItemSlotTooltip", new Type[2] { typeof(RectTransform), typeof(TextMeshProUGUI) }).GetComponent<TextMeshProUGUI>(); RectTransform rectTransform = ((TMP_Text)component2).rectTransform; ((Component)rectTransform).transform.parent = ((Component)list[PlayerPatcher.unreservedHotbarSize]).transform; ((Transform)rectTransform).localScale = Vector3.one; rectTransform.sizeDelta = new Vector2(((Graphic)list[0]).rectTransform.sizeDelta.x * 2f, 10f); rectTransform.pivot = Vector2.one / 2f; rectTransform.anchoredPosition3D = new Vector3(0f, (0f - rectTransform.sizeDelta.x / 2f) * 1.2f, 0f); ((TMP_Text)component2).font = ((TMP_Text)__instance.controlTipLines[0]).font; ((TMP_Text)component2).fontSize = 7f; ((TMP_Text)component2).alignment = (TextAlignmentOptions)514; ((TMP_Text)component2).text = string.Format($"Hold: [{ConfigSettings.GetDisplayName(ConfigSettings.focusReservedHotbarHotkey.Value)}]"); } __instance.itemSlotIconFrames = list.ToArray(); __instance.itemSlotIcons = list2.ToArray(); Plugin.Log($"Finished adding {PlayerPatcher.reservedHotbarSize} Reserved Item slots in the inventory HUD."); } } } [HarmonyPatch] public static class ReservedItemPatcher { public static bool isReservedHotbarFocused; public static int indexUnfocusedReservedHotbar; public static int indexFocusedReservedHotbar; public static Dictionary<PlayerControllerB, ReservedItemInfo> grabbingReservedItemInfoDict; private static GrabbableObject previouslyHeldObjectServer; public static PlayerControllerB localPlayerController => PlayerPatcher.localPlayerController; public static int unreservedHotbarSize => PlayerPatcher.unreservedHotbarSize; public static int reservedHotbarSize => Plugin.numReservedItemSlots; public static int combinedHotbarSize => PlayerPatcher.combinedHotbarSize; public static ReservedItemInfo grabbingReservedItemInfoLocal { get { return ((Object)(object)localPlayerController != (Object)null) ? grabbingReservedItemInfoDict[localPlayerController] : null; } set { if (!((Object)(object)localPlayerController == (Object)null)) { grabbingReservedItemInfoDict[localPlayerController] = value; } } } [HarmonyPatch(typeof(MenuManager), "OnEnable")] [HarmonyPrefix] public static void ResetVariables(MenuManager __instance) { if (grabbingReservedItemInfoDict == null) { grabbingReservedItemInfoDict = new Dictionary<PlayerControllerB, ReservedItemInfo>(); } if (grabbingReservedItemInfoDict.Count > 0) { grabbingReservedItemInfoDict.Clear(); } } [HarmonyPatch(typeof(PlayerControllerB), "ConnectClientToPlayerObject")] [HarmonyPrefix] public static void OnLocalPlayerConnect(PlayerControllerB __instance) { grabbingReservedItemInfoDict[__instance] = null; } private static GrabbableObject GetCurrentlyGrabbingObject(PlayerControllerB playerController) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown return (GrabbableObject)Traverse.Create((object)playerController).Field("currentlyGrabbingObject").GetValue(); } private static void SetCurrentlyGrabbingObject(PlayerControllerB playerController, GrabbableObject grabbable) { Traverse.Create((object)playerController).Field("currentlyGrabbingObject").SetValue((object)grabbable); } [HarmonyPatch(typeof(PlayerControllerB), "BeginGrabObject")] [HarmonyPrefix] public static bool GrabReservedItemPrefix(PlayerControllerB __instance) { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0241: 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_026e: Expected O, but got Unknown if (isReservedHotbarFocused) { return false; } Ray val = default(Ray); ((Ray)(ref val))..ctor(((Component)__instance.gameplayCamera).transform.position, ((Component)__instance.gameplayCamera).transform.forward); RaycastHit val2 = default(RaycastHit); if (!Physics.Raycast(val, ref val2, __instance.grabDistance, PlayerPatcher.INTERACTABLE_OBJECT_MASK) || ((Component)((RaycastHit)(ref val2)).collider).gameObject.layer == 8 || !(((Component)((RaycastHit)(ref val2)).collider).tag == "PhysicsProp") || __instance.twoHanded || __instance.sinkingValue > 0.73f) { grabbingReservedItemInfoLocal = null; return true; } GrabbableObject component = ((Component)((Component)((RaycastHit)(ref val2)).collider).transform).gameObject.GetComponent<GrabbableObject>(); grabbingReservedItemInfoLocal = Plugin.GetReservedItemInfo(component); if (grabbingReservedItemInfoLocal == null) { return true; } if (!GameNetworkManager.Instance.gameHasStarted && !component.itemProperties.canBeGrabbedBeforeGameStart && !StartOfRound.Instance.testRoom.activeSelf) { return false; } Traverse.Create((object)__instance).Field("grabInvalidated").SetValue((object)false); SetCurrentlyGrabbingObject(__instance, component); if (__instance.inSpecialInteractAnimation || component.isHeld || component.isPocketed) { return false; } NetworkObject networkObject = ((NetworkBehaviour)component).NetworkObject; if ((Object)(object)networkObject == (Object)null || !networkObject.IsSpawned) { return false; } if (grabbingReservedItemInfoLocal == null || !IsItemSlotEmpty(grabbingReservedItemInfoLocal)) { return true; } ((Behaviour)__instance.cursorIcon).enabled = false; ((TMP_Text)__instance.cursorTip).text = ""; __instance.twoHanded = component.itemProperties.twoHanded; __instance.carryWeight += Mathf.Clamp(component.itemProperties.weight - 1f, 0f, 10f); __instance.grabObjectAnimationTime = 0f; MethodInfo method = ((object)__instance).GetType().GetMethod("GrabObjectServerRpc", BindingFlags.Instance | BindingFlags.NonPublic); method.Invoke(__instance, new object[1] { NetworkObjectReference.op_Implicit(networkObject) }); Coroutine val3 = (Coroutine)Traverse.Create((object)__instance).Field("grabObjectCoroutine").GetValue(); if (val3 != null) { ((MonoBehaviour)__instance).StopCoroutine(val3); } MethodInfo method2 = ((object)__instance).GetType().GetMethod("GrabObject", BindingFlags.Instance | BindingFlags.NonPublic); val3 = ((MonoBehaviour)__instance).StartCoroutine((IEnumerator)method2.Invoke(__instance, new object[0])); Traverse.Create((object)__instance).Field("grabObjectCoroutine").SetValue((object)val3); return false; } [HarmonyPatch(typeof(PlayerControllerB), "GrabObjectClientRpc")] [HarmonyPrefix] public static bool GrabReservedItemClientRpcPrefix(bool grabValidated, NetworkObjectReference grabbedObject, PlayerControllerB __instance) { if (!NetworkHelper.IsClientExecStage((NetworkBehaviour)(object)__instance)) { return true; } if ((Object)(object)NetworkManager.Singleton != (Object)null && NetworkManager.Singleton.IsListening) { if (grabValidated) { NetworkObject val = default(NetworkObject); if (((NetworkObjectReference)(ref grabbedObject)).TryGet(ref val, (NetworkManager)null)) { GrabbableObject component = ((Component)val).GetComponent<GrabbableObject>(); ReservedItemInfo reservedItemInfo = Plugin.GetReservedItemInfo(component); if (reservedItemInfo != null && IsItemSlotEmpty(reservedItemInfo, __instance)) { __instance.ItemSlots[reservedItemInfo.indexInInventory] = component; component.playerHeldBy = __instance; component.isHeld = true; component.EnablePhysics(false); component.hasHitGround = false; component.isInFactory = __instance.isInsideFactory; component.EnableItemMeshes(false); Traverse.Create((object)component).Field("previousPlayerHeldBy").SetValue((object)__instance); component.PocketItem(); if ((Object)(object)__instance != (Object)(object)localPlayerController) { Plugin.Log("Grab object completed on player: " + ((Object)__instance).name); if ((Object)(object)component.itemProperties.grabSFX != (Object)null) { __instance.itemAudio.PlayOneShot(component.itemProperties.grabSFX, 1f); } grabbingReservedItemInfoDict[__instance] = null; } else { HUDManager.Instance.itemSlotIcons[reservedItemInfo.indexInInventory].sprite = component.itemProperties.itemIcon; ((Behaviour)HUDManager.Instance.itemSlotIcons[reservedItemInfo.indexInInventory]).enabled = true; HUDManager.Instance.PingHUDElement(HUDManager.Instance.Inventory, 1.5f, 1f, 0.13f); previouslyHeldObjectServer = localPlayerController.currentlyHeldObjectServer; localPlayerController.currentlyHeldObjectServer = component; } return false; } } } else if ((Object)(object)__instance == (Object)(object)localPlayerController) { Plugin.Log("Failed to validate ReservedItemGrab by the local player. Object id: " + ((NetworkObjectReference)(ref grabbedObject)).NetworkObjectId + "."); Traverse.Create((object)localPlayerController).Field("grabInvalidated").SetValue((object)true); } else { Plugin.Log("Failed to validate ReservedItemGrab by player with id: " + ((Object)__instance).name + ". Object id: " + ((NetworkObjectReference)(ref grabbedObject)).NetworkObjectId + "."); } } grabbingReservedItemInfoDict[__instance] = null; return true; } [HarmonyPatch(typeof(GrabbableObject), "GrabItemOnClient")] [HarmonyPrefix] public static void OnReservedItemGrabbed(GrabbableObject __instance) { if (grabbingReservedItemInfoLocal != null && !((Object)(object)__instance != (Object)(object)GetCurrentlyGrabbingObject(localPlayerController))) { OnLocalPlayerGrabbedReservedItem(); __instance.PocketItem(); } } private static void OnLocalPlayerGrabbedReservedItem() { localPlayerController.currentlyHeldObjectServer = previouslyHeldObjectServer; previouslyHeldObjectServer = null; grabbingReservedItemInfoLocal = null; } [HarmonyPatch(typeof(PlayerControllerB), "FirstEmptyItemSlot")] [HarmonyPostfix] public static void GetReservedItemSlotPlacementIndex(ref int __result, PlayerControllerB __instance) { ReservedItemInfo reservedItemInfo = grabbingReservedItemInfoDict[__instance]; if (reservedItemInfo != null) { if (__result == reservedItemInfo.indexInInventory && IsItemSlotEmpty(reservedItemInfo, __instance)) { return; } grabbingReservedItemInfoDict[__instance] = null; } if (__result < unreservedHotbarSize) { return; } __result = -1; for (int i = 0; i < unreservedHotbarSize; i++) { if ((Object)(object)__instance.ItemSlots[i] == (Object)null) { __result = i; break; } } } [HarmonyPatch(typeof(PlayerControllerB), "NextItemSlot")] [HarmonyPrefix] public static bool PreventScrollingOtherHotbar(ref int __result, bool forward, PlayerControllerB __instance) { __result = __instance.currentItemSlot; bool flag = __instance.currentItemSlot >= unreservedHotbarSize; int num = (forward ? 1 : (-1)); if (!flag) { __result = Mathf.Clamp(__result, 0, unreservedHotbarSize - 1) + num; if (__result < 0) { __result = unreservedHotbarSize - 1; } else if (__result >= unreservedHotbarSize) { __result = 0; } } else { __result = Mathf.Clamp(__result, unreservedHotbarSize, combinedHotbarSize - 1) + num; if (__result < unreservedHotbarSize) { __result = combinedHotbarSize - 1; } else if (__result >= combinedHotbarSize) { __result = unreservedHotbarSize; } } return false; } [HarmonyPatch(typeof(PlayerControllerB), "LateUpdate")] [HarmonyPrefix] public static void RefocusReservedHotbarAfterAnimation(PlayerControllerB __instance) { if (!((Object)(object)__instance != (Object)(object)localPlayerController) && Keybinds.holdingModifierKey != isReservedHotbarFocused && CanSwapToReservedHotbarSlot()) { SetFocusReservedHotbarSlots(Keybinds.holdingModifierKey); } } public static bool CanSwapToReservedHotbarSlot() { bool flag = (bool)Traverse.Create((object)localPlayerController).Field("throwingObject").GetValue(); return !(localPlayerController.inTerminalMenu || localPlayerController.isPlayerDead || localPlayerController.isGrabbingObjectAnimation || localPlayerController.inSpecialInteractAnimation || flag) && !localPlayerController.isTypingChat && !localPlayerController.twoHanded && !localPlayerController.activatingItem; } [HarmonyPatch(typeof(PlayerControllerB), "UpdateSpecialAnimationValue")] [HarmonyPostfix] public static void OnSpecialAnimationUpdate(bool specialAnimation, PlayerControllerB __instance, short yVal = 0, float timed = 0f, bool climbingLadder = false) { if (!((Object)(object)__instance != (Object)(object)localPlayerController)) { if (specialAnimation && isReservedHotbarFocused) { SetFocusReservedHotbarSlots(active: false); } if (!specialAnimation && isReservedHotbarFocused != Keybinds.holdingModifierKey) { SetFocusReservedHotbarSlots(Keybinds.holdingModifierKey); } } } public static void SetFocusReservedHotbarSlots(bool active) { if (reservedHotbarSize <= 0 || isReservedHotbarFocused == active) { return; } Plugin.Log("SettingFocusReservedHotbar to: " + active); isReservedHotbarFocused = active; int num = localPlayerController.currentItemSlot; if (isReservedHotbarFocused && num < unreservedHotbarSize) { if (indexFocusedReservedHotbar == -1) { indexFocusedReservedHotbar = unreservedHotbarSize; } indexUnfocusedReservedHotbar = num; num = Mathf.Max(indexFocusedReservedHotbar, unreservedHotbarSize); if ((Object)(object)localPlayerController.ItemSlots[num] == (Object)null) { for (int i = 0; i < reservedHotbarSize; i++) { int num2 = unreservedHotbarSize + i; if ((Object)(object)localPlayerController.ItemSlots[num2] != (Object)null) { num = num2; break; } } } } else if (!isReservedHotbarFocused && num >= unreservedHotbarSize) { indexFocusedReservedHotbar = num; num = Mathf.Min(indexUnfocusedReservedHotbar, unreservedHotbarSize - 1); } HotbarSlotSync.SwapHotbarSlot(num); } public static bool IsItemSlotEmpty(string itemName, PlayerControllerB player = null) { return IsItemSlotEmpty(Plugin.GetReservedItemInfo(itemName), player); } public static bool IsItemSlotEmpty(ReservedItemInfo itemInfo, PlayerControllerB player = null) { if ((Object)(object)player == (Object)null) { player = localPlayerController; } if ((Object)(object)player == (Object)null) { return false; } return itemInfo != null && itemInfo.indexInInventory < player.ItemSlots.Length && (Object)(object)player.ItemSlots[itemInfo.indexInInventory] == (Object)null; } public static GrabbableObject GetHeldReservedObject(string itemName, PlayerControllerB player = null) { if ((Object)(object)player == (Object)null) { player = localPlayerController; } if ((Object)(object)player == (Object)null) { return null; } int reservedItemHotbarIndex = Plugin.GetReservedItemHotbarIndex(itemName); return (reservedItemHotbarIndex >= 0 && reservedItemHotbarIndex < player.ItemSlots.Length && (Object)(object)player.ItemSlots[reservedItemHotbarIndex] != (Object)null) ? player.ItemSlots[reservedItemHotbarIndex] : null; } [HarmonyPatch(typeof(GrabbableObject), "Start")] [HarmonyPostfix] public static void InitializeReservedItemProperties(GrabbableObject __instance) { ReservedItemInfo reservedItemInfo = Plugin.GetReservedItemInfo(__instance.itemProperties.itemName); if (reservedItemInfo != null) { if (reservedItemInfo.forceUpdateCanBeGrabbedBeforeGameStart) { __instance.itemProperties.canBeGrabbedBeforeGameStart = reservedItemInfo.canBeGrabbedBeforeGameStart; } if (reservedItemInfo.forceUpdateRequiresBattery) { __instance.itemProperties.requiresBattery = reservedItemInfo.requiresBattery; } } } } [HarmonyPatch] public static class PlayerPatcher { public static PlayerControllerB localPlayerController; public static int vanillaHotbarSize = -1; public static int INTERACTABLE_OBJECT_MASK { get; private set; } public static int unreservedHotbarSize => ((Object)(object)localPlayerController != (Object)null) ? (localPlayerController.ItemSlots.Length - reservedHotbarSize) : vanillaHotbarSize; public static int reservedHotbarSize => Plugin.numReservedItemSlots; public static int combinedHotbarSize => unreservedHotbarSize + reservedHotbarSize; [HarmonyPatch(typeof(MenuManager), "OnEnable")] [HarmonyPrefix] public static void ResetVariables(MenuManager __instance) { localPlayerController = null; vanillaHotbarSize = -1; ReservedItemPatcher.isReservedHotbarFocused = false; ReservedItemPatcher.indexUnfocusedReservedHotbar = 0; ReservedItemPatcher.indexFocusedReservedHotbar = -1; Keybinds.localPlayerController = null; Keybinds.focusReservedHotbarAction = null; Keybinds.holdingModifierKey = false; HotbarSlotSync.localPlayerController = null; } [HarmonyPatch(typeof(PlayerControllerB), "Awake")] [HarmonyPostfix] public static void InitializePlayerController(PlayerControllerB __instance) { if (vanillaHotbarSize == -1) { vanillaHotbarSize = __instance.ItemSlots.Length; } } [HarmonyPatch(typeof(PlayerControllerB), "Start")] [HarmonyPostfix] public static void InitializePlayerControllerLate(PlayerControllerB __instance) { __instance.ItemSlots = (GrabbableObject[])(object)new GrabbableObject[__instance.ItemSlots.Length + reservedHotbarSize]; } [HarmonyPatch(typeof(PlayerControllerB), "ConnectClientToPlayerObject")] [HarmonyPrefix] public static void OnLocalPlayerConnect(PlayerControllerB __instance) { localPlayerController = __instance; INTERACTABLE_OBJECT_MASK = (int)Traverse.Create((object)__instance).Field("interactableObjectsMask").GetValue(); } } }
BepInEx/plugins/FlipMods-ReservedWalkieSlot/ReservedWalkieSlot.dll
Decompiled a year agousing System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using BepInEx.Configuration; using GameNetcodeStuff; using HarmonyLib; using ReservedItemSlotCore; using ReservedItemSlotCore.Patches; using ReservedWalkieSlot.Patches; using Unity.Netcode; using UnityEngine; using UnityEngine.InputSystem; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("ReservedWalkieSlot")] [assembly: AssemblyDescription("Mod made by flipf17")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("ReservedWalkieSlot")] [assembly: AssemblyCopyright("Copyright © 2023")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("c15c320f-d8fc-4f1c-be3c-f2d2ffc41edd")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyVersion("1.0.0.0")] namespace ReservedWalkieSlot { public static class ConfigSettings { public static ConfigEntry<string> activateWalkieKey; public static string activateWalkieDisplayName; public static void BindConfigSettings() { Plugin.Log("BindingConfigs"); activateWalkieKey = ((BaseUnityPlugin)Plugin.instance).Config.Bind<string>("ReservedWalkieSlot", "ActivateWalkieKey", "<Keyboard>/x", "Activate walkie keybind."); activateWalkieDisplayName = GetDisplayName(activateWalkieKey.Value); } public static string GetDisplayName(string key) { key = key.Replace("<Keyboard>/", ""); key = key.Replace("<Mouse>/", ""); string text = key; text = text.Replace("leftAlt", "Alt"); text = text.Replace("rightAlt", "Alt"); text = text.Replace("leftCtrl", "Ctrl"); text = text.Replace("rightCtrl", "Ctrl"); text = text.Replace("leftShift", "Shift"); text = text.Replace("rightShift", "Shift"); text = text.Replace("leftButton", "LMB"); text = text.Replace("rightButton", "RMB"); return text.Replace("middleButton", "MMB"); } } [HarmonyPatch] internal static class Keybinds { public static PlayerControllerB localPlayerController; private static InputAction activateWalkieAction; [HarmonyPatch(typeof(PlayerControllerB), "ConnectClientToPlayerObject")] [HarmonyPostfix] public static void OnLocalPlayerConnect(PlayerControllerB __instance) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Expected O, but got Unknown localPlayerController = __instance; activateWalkieAction = new InputAction((string)null, (InputActionType)0, ConfigSettings.activateWalkieKey.Value, (string)null, (string)null, (string)null); if (((Component)localPlayerController).gameObject.activeSelf) { SubscribeToEvents(); } } private static void SubscribeToEvents() { if (activateWalkieAction != null) { activateWalkieAction.performed += OnPressWalkieButtonPerformed; activateWalkieAction.canceled += OnReleaseWalkieButtonPerformed; activateWalkieAction.Enable(); } } [HarmonyPatch(typeof(PlayerControllerB), "OnEnable")] [HarmonyPostfix] public static void OnEnable(PlayerControllerB __instance) { if ((Object)(object)__instance == (Object)(object)localPlayerController) { SubscribeToEvents(); } } [HarmonyPatch(typeof(PlayerControllerB), "OnDisable")] [HarmonyPostfix] public static void OnDisable(PlayerControllerB __instance) { if (activateWalkieAction != null && !((Object)(object)__instance != (Object)(object)localPlayerController)) { activateWalkieAction.performed -= OnPressWalkieButtonPerformed; activateWalkieAction.canceled -= OnReleaseWalkieButtonPerformed; activateWalkieAction.Disable(); } } private static void OnPressWalkieButtonPerformed(CallbackContext context) { if ((Object)(object)localPlayerController == (Object)null || !localPlayerController.isPlayerControlled || (((NetworkBehaviour)localPlayerController).IsServer && !localPlayerController.isHostPlayerObject)) { return; } WalkieTalkie mainWalkie = ReservedWalkieSlotPatcher.GetMainWalkie(localPlayerController); if (((CallbackContext)(ref context)).performed && !((Object)(object)mainWalkie == (Object)null) && ((GrabbableObject)mainWalkie).isBeingUsed) { float num = (float)Traverse.Create((object)localPlayerController).Field("timeSinceSwitchingSlots").GetValue(); if (!(num < 0.075f)) { Plugin.Log("Talking into walkie"); ShipBuildModeManager.Instance.CancelBuildMode(true); ((GrabbableObject)mainWalkie).UseItemOnClient(true); Traverse.Create((object)localPlayerController).Field("timeSinceSwitchingSlots").SetValue((object)0); } } } private static void OnReleaseWalkieButtonPerformed(CallbackContext context) { if (!((Object)(object)localPlayerController == (Object)null) && localPlayerController.isPlayerControlled && (!((NetworkBehaviour)localPlayerController).IsServer || localPlayerController.isHostPlayerObject)) { WalkieTalkie mainWalkie = ReservedWalkieSlotPatcher.GetMainWalkie(localPlayerController); if (((CallbackContext)(ref context)).canceled && !((Object)(object)mainWalkie == (Object)null)) { Plugin.Log("Not talking into walkie"); ShipBuildModeManager.Instance.CancelBuildMode(true); ((GrabbableObject)mainWalkie).UseItemOnClient(false); } } } } [BepInPlugin("FlipMods.ReservedWalkieSlot", "ReservedWalkieSlot", "1.4.6")] [BepInDependency(/*Could not decode attribute arguments.*/)] public class Plugin : BaseUnityPlugin { public static Plugin instance; private Harmony _harmony; public static ReservedItemInfo walkieInfo = new ReservedItemInfo("Walkie-talkie", 100, true, true, true, true); private void Awake() { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Expected O, but got Unknown instance = this; ConfigSettings.BindConfigSettings(); _harmony = new Harmony("ReservedWalkieSlot"); _harmony.PatchAll(); ((BaseUnityPlugin)this).Logger.LogInfo((object)"ReservedWalkieSlot loaded"); } public static void Log(string message) { ((BaseUnityPlugin)instance).Logger.LogInfo((object)message); } } public static class PluginInfo { public const string PLUGIN_GUID = "FlipMods.ReservedWalkieSlot"; public const string PLUGIN_NAME = "ReservedWalkieSlot"; public const string PLUGIN_VERSION = "1.4.6"; } } namespace ReservedWalkieSlot.Patches { [HarmonyPatch] internal static class ReservedWalkieSlotPatcher { private static Vector3 localPlayerShoulderPositionOffset = new Vector3(0.125f, 0.4f, 0.125f); private static Vector3 playerShoulderPositionOffset = new Vector3(0.15f, -0.05f, 0.25f); private static Vector3 playerShoulderRotationOffset = new Vector3(0f, 270f, 100f); private static string originalControlTooltip = ""; public static PlayerControllerB localPlayerController => PlayerPatcher.localPlayerController; public static WalkieTalkie GetMainWalkie(PlayerControllerB playerController) { return GetCurrentlySelectedWalkie(playerController) ?? GetReservedWalkie(playerController); } public static WalkieTalkie GetReservedWalkie(PlayerControllerB playerController) { GrabbableObject obj = ((playerController != null) ? playerController.ItemSlots[Plugin.walkieInfo.indexInInventory] : null); return (WalkieTalkie)(object)((obj is WalkieTalkie) ? obj : null); } public static WalkieTalkie GetCurrentlySelectedWalkie(PlayerControllerB playerController) { GrabbableObject obj = ((playerController != null) ? playerController.ItemSlots[playerController.currentItemSlot] : null); return (WalkieTalkie)(object)((obj is WalkieTalkie) ? obj : null); } [HarmonyPatch(typeof(WalkieTalkie), "__initializeVariables")] [HarmonyPostfix] public static void EditTooltips(WalkieTalkie __instance) { if (originalControlTooltip == "") { originalControlTooltip = ((GrabbableObject)__instance).itemProperties.toolTips[((GrabbableObject)__instance).itemProperties.toolTips.Length - 1]; } ((GrabbableObject)__instance).itemProperties.toolTips[((GrabbableObject)__instance).itemProperties.toolTips.Length - 1] = $"{originalControlTooltip}[{ConfigSettings.activateWalkieDisplayName.ToUpper()}]"; } [HarmonyPatch(typeof(MenuManager), "OnEnable")] [HarmonyPostfix] public static void ResetVariables() { Keybinds.localPlayerController = null; } [HarmonyPatch(typeof(PlayerControllerB), "ActivateItem_performed")] [HarmonyPrefix] public static bool PreventActivatingDuplicateItem(CallbackContext context, PlayerControllerB __instance) { WalkieTalkie currentlySelectedWalkie = GetCurrentlySelectedWalkie(__instance); if ((Object)(object)__instance != (Object)(object)localPlayerController || (Object)(object)currentlySelectedWalkie == (Object)null) { return true; } if (!((CallbackContext)(ref context)).performed) { return false; } WalkieTalkie reservedWalkie = GetReservedWalkie(__instance); if ((Object)(object)currentlySelectedWalkie != (Object)(object)reservedWalkie && (!((GrabbableObject)reservedWalkie).itemProperties.requiresBattery || !((GrabbableObject)reservedWalkie).insertedBattery.empty)) { return false; } return true; } [HarmonyPatch(typeof(WalkieTalkie), "PocketItem")] [HarmonyPostfix] public static void OnPocketWalkie(WalkieTalkie __instance) { if (!((Object)(object)((GrabbableObject)__instance).playerHeldBy == (Object)null)) { ((GrabbableObject)__instance).parentObject = ((Component)((GrabbableObject)__instance).playerHeldBy.playerBadgeMesh).transform.parent; } } [HarmonyPatch(typeof(WalkieTalkie), "EquipItem")] [HarmonyPostfix] public static void OnEquipWalkie(WalkieTalkie __instance) { if (!((Object)(object)((GrabbableObject)__instance).playerHeldBy == (Object)null)) { ((GrabbableObject)__instance).parentObject = (((Object)(object)((GrabbableObject)__instance).playerHeldBy == (Object)(object)localPlayerController) ? ((GrabbableObject)__instance).playerHeldBy.localItemHolder : ((GrabbableObject)__instance).playerHeldBy.serverItemHolder); } } [HarmonyPatch(typeof(GrabbableObject), "LateUpdate")] [HarmonyPostfix] public static void SetPositionOffset(GrabbableObject __instance) { //IL_006c: 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_0076: 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) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009d: 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) if (__instance is WalkieTalkie && (Object)(object)__instance.playerHeldBy != (Object)null && __instance.isPocketed && (Object)(object)__instance.parentObject != (Object)null && (Object)(object)__instance != (Object)(object)GetCurrentlySelectedWalkie(__instance.playerHeldBy)) { Transform transform = ((Component)__instance.parentObject).transform; ((Component)__instance).transform.rotation = ((Component)__instance.parentObject).transform.rotation * Quaternion.Euler(playerShoulderRotationOffset); ((Component)__instance).transform.position = transform.position + transform.rotation * playerShoulderPositionOffset; } } [HarmonyPatch(typeof(GrabbableObject), "EnableItemMeshes")] [HarmonyPrefix] public static void OnEnableItemMeshes(ref bool enable, GrabbableObject __instance) { if (__instance is WalkieTalkie && (Object)(object)__instance.playerHeldBy != (Object)null && ((Object)(object)__instance == (Object)(object)GetCurrentlySelectedWalkie(__instance.playerHeldBy) || ((Object)(object)__instance == (Object)(object)GetReservedWalkie(__instance.playerHeldBy) && (Object)(object)__instance.playerHeldBy != (Object)(object)localPlayerController))) { enable = true; } } } }
BepInEx/plugins/Hexnet111-SuitSaver/Suit Saver.dll
Decompiled a year agousing System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using GameNetcodeStuff; using HarmonyLib; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("Suit Saver")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("Suit Saver")] [assembly: AssemblyCopyright("Copyright © 2023")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("cb7cfb30-b06e-4e41-9de7-03640e1662ea")] [assembly: AssemblyFileVersion("1.1.1.0")] [assembly: TargetFramework(".NETFramework,Version=v4.8.1", FrameworkDisplayName = ".NET Framework 4.8.1")] [assembly: AssemblyVersion("1.0.0.0")] namespace SuitSaver { [BepInPlugin("Hexnet.lethalcompany.suitsaver", "Suit Saver", "1.1.1")] public class SuitSaver : BaseUnityPlugin { private const string modGUID = "Hexnet.lethalcompany.suitsaver"; private const string modName = "Suit Saver"; private const string modVersion = "1.1.1"; private readonly Harmony harmony = new Harmony("Hexnet.lethalcompany.suitsaver"); private void Awake() { harmony.PatchAll(); Debug.Log((object)"[SS]: Suit Saver loaded successfully!"); } } } namespace SuitSaver.Patches { [HarmonyPatch] internal class Patches { [HarmonyPatch(typeof(StartOfRound))] internal class StartPatch { [HarmonyPatch("ResetShip")] [HarmonyPostfix] private static void ResetShipPatch() { Debug.Log((object)"[SS]: Ship has been reset!"); Debug.Log((object)"[SS]: Reloading suit..."); LoadSuitFromFile(); } } [HarmonyPatch(typeof(UnlockableSuit))] internal class SuitPatch { [HarmonyPatch("SwitchSuitClientRpc")] [HarmonyPostfix] private static void SyncSuit(ref UnlockableSuit __instance, int playerID) { PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController; int num = (int)localPlayerController.playerClientId; if (playerID != num) { UnlockableSuit.SwitchSuitForPlayer(StartOfRound.Instance.allPlayerScripts[playerID], __instance.syncedSuitID.Value, true); } } [HarmonyPatch("SwitchSuitToThis")] [HarmonyPostfix] private static void EquipSuitPatch() { PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController; string unlockableName = StartOfRound.Instance.unlockablesList.unlockables[localPlayerController.currentSuitID].unlockableName; SaveToFile(unlockableName); Debug.Log((object)("[SS]: Successfully saved current suit. (" + unlockableName + ")")); } } [HarmonyPatch(typeof(PlayerControllerB))] internal class LoadEquipPatch { [HarmonyPatch("ConnectClientToPlayerObject")] [HarmonyPostfix] private static void LoadSuitPatch(ref PlayerControllerB __instance) { ((Component)GameNetworkManager.Instance.localPlayerController).gameObject.AddComponent<EquipPatch>(); } } internal class EquipPatch : MonoBehaviour { private void Start() { ((MonoBehaviour)this).StartCoroutine(LoadSuit()); } private IEnumerator LoadSuit() { Debug.Log((object)"[SS]: Waiting for suits to sync..."); yield return (object)new WaitForSeconds(1f); LoadSuitFromFile(); } } public static string SavePath = Application.persistentDataPath + "\\suitsaver.txt"; private static void SaveToFile(string suitName) { File.WriteAllText(SavePath, suitName); } private static string LoadFromFile() { if (File.Exists(SavePath)) { return File.ReadAllText(SavePath); } return "-1"; } private static UnlockableSuit GetSuitByName(string Name) { List<UnlockableItem> unlockables = StartOfRound.Instance.unlockablesList.unlockables; UnlockableSuit[] array = Resources.FindObjectsOfTypeAll<UnlockableSuit>(); foreach (UnlockableSuit val in array) { if (val.syncedSuitID.Value >= 0) { string unlockableName = unlockables[val.syncedSuitID.Value].unlockableName; if (unlockableName == Name) { return val; } } } return null; } private static void LoadSuitFromFile() { string text = LoadFromFile(); PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController; if (!(text == "-1")) { UnlockableSuit suitByName = GetSuitByName(text); if ((Object)(object)suitByName != (Object)null) { UnlockableSuit.SwitchSuitForPlayer(localPlayerController, suitByName.syncedSuitID.Value, false); suitByName.SwitchSuitServerRpc((int)localPlayerController.playerClientId); Debug.Log((object)("[SS]: Successfully loaded saved suit. (" + text + " | " + suitByName.syncedSuitID.Value + ")")); } else { Debug.Log((object)("[SS]: Failed to load saved suit. Perhaps it's locked? (" + text + ")")); } } } } }
BepInEx/plugins/malco-Lategame_Upgrades/MoreShipUpgrades/MoreShipUpgrades.dll
Decompiled a year ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using BepInEx.Logging; using GameNetcodeStuff; using HarmonyLib; using LethalLib.Modules; using MoreShipUpgrades.Managers; using MoreShipUpgrades.Misc; using MoreShipUpgrades.UpgradeComponents; using Newtonsoft.Json; using TMPro; using Unity.Netcode; using UnityEngine; using UnityEngine.Events; using UnityEngine.InputSystem; using UnityEngine.InputSystem.Controls; 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: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyVersion("0.0.0.0")] internal class <Module> { static <Module>() { } } namespace MoreShipUpgrades { [BepInPlugin("com.malco.lethalcompany.moreshipupgrades", "More Ship Upgrades", "2.5.0")] public class Plugin : BaseUnityPlugin { private readonly Harmony harmony = new Harmony("com.malco.lethalcompany.moreshipupgrades"); public static Plugin instance; public static ManualLogSource mls; public static PluginConfig cfg { get; private set; } private void Awake() { //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Expected O, but got Unknown //IL_01f3: Unknown result type (might be due to invalid IL or missing references) //IL_01fa: Expected O, but got Unknown //IL_0310: Unknown result type (might be due to invalid IL or missing references) //IL_02b0: Unknown result type (might be due to invalid IL or missing references) //IL_02b7: Expected O, but got Unknown //IL_036c: Unknown result type (might be due to invalid IL or missing references) //IL_0373: Expected O, but got Unknown cfg = new PluginConfig(((BaseUnityPlugin)this).Config); cfg.InitBindings(); mls = Logger.CreateLogSource("More Ship Upgrades"); instance = this; 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); } } } string text = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "shipupgrades"); AssetBundle val = AssetBundle.LoadFromFile(text); GameObject val2 = new GameObject("UpgradeBus"); val2.AddComponent<UpgradeBus>(); GameObject val3 = val.LoadAsset<GameObject>("Assets/ShipUpgrades/LGUStore.prefab"); val3.AddComponent<LGUStore>(); NetworkPrefabs.RegisterNetworkPrefab(val3); UpgradeBus.instance.modStorePrefab = val3; AudioClip itemBreak = val.LoadAsset<AudioClip>("Assets/ShipUpgrades/break.mp3"); AudioClip error = val.LoadAsset<AudioClip>("Assets/ShipUpgrades/error.mp3"); AudioClip buttonPress = val.LoadAsset<AudioClip>("Assets/ShipUpgrades/ButtonPress2.ogg"); UpgradeBus.instance.introScreen = val.LoadAsset<GameObject>("Assets/ShipUpgrades/IntroScreen.prefab"); UpgradeBus.instance.introScreen.AddComponent<IntroScreenScript>(); Item val4 = val.LoadAsset<Item>("Assets/ShipUpgrades/TpButton.asset"); val4.itemName = "Portable Tele"; TPButtonScript tPButtonScript = val4.spawnPrefab.AddComponent<TPButtonScript>(); ((GrabbableObject)tPButtonScript).itemProperties = val4; ((GrabbableObject)tPButtonScript).grabbable = true; ((GrabbableObject)tPButtonScript).grabbableToEnemies = true; tPButtonScript.ItemBreak = itemBreak; ((GrabbableObject)tPButtonScript).useCooldown = 2f; tPButtonScript.error = error; tPButtonScript.buttonPress = buttonPress; val4.creditsWorth = cfg.WEAK_TELE_PRICE; NetworkPrefabs.RegisterNetworkPrefab(val4.spawnPrefab); if (cfg.WEAK_TELE_ENABLED) { TerminalNode val5 = new TerminalNode(); val5.displayText = "A button that when pressed teleports you and your loot back to the ship. Must have Ship Teleporter unlocked!!!\n\nHas a 90% chance to self destruct on use."; Items.RegisterShopItem(val4, (TerminalNode)null, (TerminalNode)null, val5, val4.creditsWorth); } Item val6 = val.LoadAsset<Item>("Assets/ShipUpgrades/TpButtonAdv.asset"); val6.creditsWorth = cfg.ADVANCED_TELE_PRICE; val6.itemName = "Advanced Portable Tele"; AdvTPButtonScript advTPButtonScript = val6.spawnPrefab.AddComponent<AdvTPButtonScript>(); ((GrabbableObject)advTPButtonScript).itemProperties = val6; ((GrabbableObject)advTPButtonScript).grabbable = true; ((GrabbableObject)advTPButtonScript).useCooldown = 2f; ((GrabbableObject)advTPButtonScript).grabbableToEnemies = true; advTPButtonScript.ItemBreak = itemBreak; advTPButtonScript.error = error; advTPButtonScript.buttonPress = buttonPress; NetworkPrefabs.RegisterNetworkPrefab(val6.spawnPrefab); if (cfg.ADVANCED_TELE_ENABLED) { TerminalNode val7 = new TerminalNode(); val7.displayText = "A button that when pressed teleports you and your loot back to the ship. Must have Ship Teleporter unlocked!!!"; Items.RegisterShopItem(val6, (TerminalNode)null, (TerminalNode)null, val7, val6.creditsWorth); } Item val8 = val.LoadAsset<Item>("Assets/ShipUPgrades/NightVisionItem.asset"); val8.creditsWorth = cfg.NIGHT_VISION_PRICE; val8.spawnPrefab.transform.localScale = new Vector3(0.3f, 0.3f, 0.3f); NightVisionItemScript nightVisionItemScript = val8.spawnPrefab.AddComponent<NightVisionItemScript>(); ((GrabbableObject)nightVisionItemScript).itemProperties = val8; ((GrabbableObject)nightVisionItemScript).grabbable = true; ((GrabbableObject)nightVisionItemScript).useCooldown = 2f; ((GrabbableObject)nightVisionItemScript).grabbableToEnemies = true; NetworkPrefabs.RegisterNetworkPrefab(val8.spawnPrefab); if (cfg.NIGHT_VISION_ENABLED) { TerminalNode val9 = new TerminalNode(); val9.displayText = "Night vision headset, pick up and click to equip."; Items.RegisterShopItem(val8, (TerminalNode)null, (TerminalNode)null, val9, val8.creditsWorth); } GameObject val10 = val.LoadAsset<GameObject>("Assets/ShipUpgrades/beekeeper.prefab"); val10.AddComponent<beekeeperScript>(); NetworkPrefabs.RegisterNetworkPrefab(val10); UpgradeBus.instance.IndividualUpgrades.Add("Beekeeper", cfg.BEEKEEPER_INDIVIDUAL); if (cfg.BEEKEEPER_ENABLED) { string[] array3 = cfg.BEEKEEPER_UPGRADE_PRICES.Split(',').ToArray(); int[] array4 = new int[array3.Length]; for (int k = 0; k < array3.Length; k++) { if (int.TryParse(array3[k], out var result)) { array4[k] = result; continue; } Debug.LogWarning((object)$"[LGU] Invalid upgrade price submitted: {array4[k]}"); array4[k] = -1; } if (array4.Length == 1 && array4[0] == -1) { array4 = new int[0]; } CustomTerminalNode item = new CustomTerminalNode("Beekeeper", cfg.BEEKEEPER_PRICE, $"Circuit bees do %{Mathf.Round(100f * cfg.BEEKEEPER_DAMAGE_MULTIPLIER)} of their base damage.", val10, array4, array4.Length); UpgradeBus.instance.terminalNodes.Add(item); } GameObject val11 = val.LoadAsset<GameObject>("Assets/ShipUpgrades/BiggerLungs.prefab"); val11.AddComponent<biggerLungScript>(); NetworkPrefabs.RegisterNetworkPrefab(val11); UpgradeBus.instance.IndividualUpgrades.Add("Bigger Lungs", cfg.BIGGER_LUNGS_INDIVIDUAL); if (cfg.BIGGER_LUNGS_ENABLED) { string[] array5 = cfg.BIGGER_LUNGS_UPGRADE_PRICES.Split(',').ToArray(); int[] array6 = new int[array5.Length]; for (int l = 0; l < array5.Length; l++) { if (int.TryParse(array5[l], out var result2)) { array6[l] = result2; continue; } Debug.LogWarning((object)$"[LGU] Invalid upgrade price submitted: {array6[l]}"); array6[l] = -1; } if (array6.Length == 1 && array6[0] == -1) { array6 = new int[0]; } CustomTerminalNode item2 = new CustomTerminalNode("Bigger Lungs", cfg.BIGGER_LUNGS_PRICE, $"Stamina Time is {UpgradeBus.instance.cfg.SPRINT_TIME_INCREASE - 11f} units longer", val11, array6, array6.Length); UpgradeBus.instance.terminalNodes.Add(item2); } GameObject val12 = val.LoadAsset<GameObject>("Assets/ShipUpgrades/runningShoes.prefab"); val12.AddComponent<runningShoeScript>(); NetworkPrefabs.RegisterNetworkPrefab(val12); UpgradeBus.instance.IndividualUpgrades.Add("Running Shoes", cfg.RUNNING_SHOES_INDIVIDUAL); if (cfg.RUNNING_SHOES_ENABLED) { string[] array7 = cfg.RUNNING_SHOES_UPGRADE_PRICES.Split(',').ToArray(); int[] array8 = new int[array7.Length]; for (int m = 0; m < array7.Length; m++) { if (int.TryParse(array7[m], out var result3)) { array8[m] = result3; continue; } Debug.LogWarning((object)$"[LGU] Invalid upgrade price submitted: {array8[m]}"); array8[m] = -1; } if (array8.Length == 1 && array8[0] == -1) { array8 = new int[0]; } CustomTerminalNode item3 = new CustomTerminalNode("Running Shoes", cfg.RUNNING_SHOES_PRICE, $"You can run {UpgradeBus.instance.cfg.MOVEMENT_SPEED - 4.6f} units faster", val12, array8, array8.Length); UpgradeBus.instance.terminalNodes.Add(item3); } GameObject val13 = val.LoadAsset<GameObject>("Assets/ShipUpgrades/strongLegs.prefab"); val13.AddComponent<strongLegsScript>(); NetworkPrefabs.RegisterNetworkPrefab(val13); UpgradeBus.instance.IndividualUpgrades.Add("Strong Legs", cfg.STRONG_LEGS_INDIVIDUAL); if (cfg.STRONG_LEGS_ENABLED) { string[] array9 = cfg.STRONG_LEGS_UPGRADE_PRICES.Split(',').ToArray(); int[] array10 = new int[array9.Length]; for (int n = 0; n < array9.Length; n++) { if (int.TryParse(array9[n], out var result4)) { array10[n] = result4; continue; } Debug.LogWarning((object)$"[LGU] Invalid upgrade price submitted: {array10[n]}"); array10[n] = -1; } if (array10.Length == 1 && array10[0] == -1) { array10 = new int[0]; } CustomTerminalNode item4 = new CustomTerminalNode("Strong Legs", cfg.STRONG_LEGS_PRICE, $"Jump {cfg.JUMP_FORCE - 13f} units higher.", val13, array10, array10.Length); UpgradeBus.instance.terminalNodes.Add(item4); } GameObject val14 = val.LoadAsset<GameObject>("Assets/ShipUpgrades/destructiveCodes.prefab"); val14.AddComponent<trapDestroyerScript>(); string text2 = ""; text2 = ((!cfg.DESTROY_TRAP) ? $"Broadcasted codes now disable map hazards for {cfg.DISARM_TIME} seconds." : ((!cfg.EXPLODE_TRAP) ? "Broadcasted codes now destroy map hazards." : "Broadcasted codes now explode map hazards.")); NetworkPrefabs.RegisterNetworkPrefab(val14); UpgradeBus.instance.IndividualUpgrades.Add("Malware Broadcaster", cfg.MALWARE_BROADCASTER_INDIVIDUAL); if (cfg.MALWARE_BROADCASTER_ENABLED) { CustomTerminalNode item5 = new CustomTerminalNode("Malware Broadcaster", cfg.MALWARE_BROADCASTER_PRICE, text2, val14); UpgradeBus.instance.terminalNodes.Add(item5); } GameObject val15 = val.LoadAsset<GameObject>("Assets/ShipUpgrades/lightFooted.prefab"); val15.AddComponent<lightFootedScript>(); NetworkPrefabs.RegisterNetworkPrefab(val15); UpgradeBus.instance.IndividualUpgrades.Add("Light Footed", cfg.LIGHT_FOOTED_INDIVIDUAL); if (cfg.LIGHT_FOOTED_ENABLED) { string[] array11 = cfg.LIGHT_FOOTED_UPGRADE_PRICES.Split(',').ToArray(); int[] array12 = new int[array11.Length]; for (int num = 0; num < array11.Length; num++) { if (int.TryParse(array11[num], out var result5)) { array12[num] = result5; continue; } Debug.LogWarning((object)$"[LGU] Invalid upgrade price submitted: {array12[num]}"); array12[num] = -1; } if (array12.Length == 1 && array12[0] == -1) { array12 = new int[0]; } CustomTerminalNode item6 = new CustomTerminalNode("Light Footed", cfg.LIGHT_FOOTED_PRICE, $"Audible Noise Distance is reduced by {UpgradeBus.instance.cfg.NOISE_REDUCTION} units. \nApplies to both sprinting and walking.", val15, array12, array12.Length); UpgradeBus.instance.terminalNodes.Add(item6); } GameObject val16 = val.LoadAsset<GameObject>("Assets/ShipUpgrades/nightVision.prefab"); val16.AddComponent<nightVisionScript>(); NetworkPrefabs.RegisterNetworkPrefab(val16); UpgradeBus.instance.IndividualUpgrades.Add("NV Headset Batteries", cfg.NIGHT_VISION_INDIVIDUAL); if (cfg.NIGHT_VISION_ENABLED) { string[] array13 = cfg.NIGHT_VISION_UPGRADE_PRICES.Split(',').ToArray(); int[] array14 = new int[array13.Length]; for (int num2 = 0; num2 < array13.Length; num2++) { if (int.TryParse(array13[num2], out var result6)) { array14[num2] = result6; continue; } Debug.LogWarning((object)$"[LGU] Invalid upgrade price submitted: {array14[num2]}"); array14[num2] = -1; } if (array14.Length == 1 && array14[0] == -1) { array14 = new int[0]; } CustomTerminalNode customTerminalNode = new CustomTerminalNode("NV Headset Batteries", cfg.NIGHT_VISION_PRICE, $"Upgrades the Night Vision Headset in the vanilla `store`. \nDrain speed is {cfg.NIGHT_VIS_DRAIN_SPEED} \nRegen speed is {cfg.NIGHT_VIS_REGEN_SPEED}", val16, array14, array14.Length); customTerminalNode.Unlocked = true; UpgradeBus.instance.terminalNodes.Add(customTerminalNode); } GameObject val17 = val.LoadAsset<GameObject>("Assets/ShipUpgrades/terminalFlash.prefab"); AudioClip flashNoise = val.LoadAsset<AudioClip>("Assets/ShipUpgrades/flashbangsfx.ogg"); UpgradeBus.instance.flashNoise = flashNoise; val17.AddComponent<terminalFlashScript>(); NetworkPrefabs.RegisterNetworkPrefab(val17); UpgradeBus.instance.IndividualUpgrades.Add("Discombobulator", cfg.DISCOMBOBULATOR_INDIVIDUAL); if (cfg.DISCOMBOBULATOR_ENABLED) { string[] array15 = cfg.DISCO_UPGRADE_PRICES.Split(',').ToArray(); int[] array16 = new int[array15.Length]; for (int num3 = 0; num3 < array15.Length; num3++) { if (int.TryParse(array15[num3], out var result7)) { array16[num3] = result7; continue; } Debug.LogWarning((object)$"[LGU] Invalid upgrade price submitted: {array16[num3]}"); array16[num3] = -1; } if (array16.Length == 1 && array16[0] == -1) { array16 = new int[0]; } CustomTerminalNode item7 = new CustomTerminalNode("Discombobulator", cfg.DISCOMBOBULATOR_PRICE, $"Stun enemies around your ship in a {cfg.DISCOMBOBULATOR_RADIUS} unit radius.", val17, array16, array16.Length); UpgradeBus.instance.terminalNodes.Add(item7); } GameObject val18 = val.LoadAsset<GameObject>("Assets/ShipUpgrades/strongScanner.prefab"); val18.AddComponent<strongerScannerScript>(); NetworkPrefabs.RegisterNetworkPrefab(val18); UpgradeBus.instance.IndividualUpgrades.Add("Better Scanner", cfg.BETTER_SCANNER_INDIVIDUAL); if (cfg.BETTER_SCANNER_ENABLED) { string text3 = (cfg.REQUIRE_LINE_OF_SIGHT ? "Does not remove" : "Removes"); string text4 = $"Increase distance nodes can be scanned by {cfg.NODE_DISTANCE_INCREASE} units. \nIncrease distance Ship and Entrance can be scanned by {cfg.SHIP_AND_ENTRANCE_DISTANCE_INCREASE} units. \n"; text4 = text4 + text3 + " LOS requirement"; CustomTerminalNode item8 = new CustomTerminalNode("Better Scanner", cfg.BETTER_SCANNER_PRICE, text4, val18); UpgradeBus.instance.terminalNodes.Add(item8); } GameObject val19 = val.LoadAsset<GameObject>("Assets/ShipUpgrades/exoskeleton.prefab"); val19.AddComponent<exoskeletonScript>(); NetworkPrefabs.RegisterNetworkPrefab(val19); UpgradeBus.instance.IndividualUpgrades.Add("Back Muscles", cfg.BACK_MUSCLES_INDIVIDUAL); if (cfg.BACK_MUSCLES_ENABLED) { string[] array17 = cfg.BACK_MUSCLES_UPGRADE_PRICES.Split(',').ToArray(); int[] array18 = new int[array17.Length]; for (int num4 = 0; num4 < array17.Length; num4++) { if (int.TryParse(array17[num4], out var result8)) { array18[num4] = result8; continue; } Debug.LogWarning((object)$"[LGU] Invalid upgrade price submitted: {array18[num4]}"); array18[num4] = -1; } if (array18.Length == 1 && array18[0] == -1) { array18 = new int[0]; } CustomTerminalNode item9 = new CustomTerminalNode("Back Muscles", cfg.BACK_MUSCLES_PRICE, $"Carry weight becomes %{Mathf.Round(cfg.CARRY_WEIGHT_REDUCTION * 100f)} of original", val19, array18, array18.Length); UpgradeBus.instance.terminalNodes.Add(item9); } GameObject val20 = val.LoadAsset<GameObject>("Assets/ShipUpgrades/Pager.prefab"); val20.AddComponent<pagerScript>(); NetworkPrefabs.RegisterNetworkPrefab(val20); UpgradeBus.instance.IndividualUpgrades.Add("Pager", cfg.PAGER_INDIVIDUAL); if (cfg.PAGER_ENABLED) { CustomTerminalNode item10 = new CustomTerminalNode("Pager", cfg.PAGER_PRICE, "Type `page <message>` to send a message to each team members chat", val20); UpgradeBus.instance.terminalNodes.Add(item10); } GameObject val21 = val.LoadAsset<GameObject>("Assets/ShipUpgrades/LockSmith.prefab"); val21.AddComponent<lockSmithScript>(); NetworkPrefabs.RegisterNetworkPrefab(val21); UpgradeBus.instance.IndividualUpgrades.Add("Locksmith", cfg.LOCKSMITH_INDIVIDUAL); if (cfg.LOCKSMITH_ENABLED) { CustomTerminalNode item11 = new CustomTerminalNode("Locksmith", cfg.LOCKSMITH_PRICE, "Allows you to pick door locks by completing a minigame.", val21); UpgradeBus.instance.terminalNodes.Add(item11); } harmony.PatchAll(); mls.LogInfo((object)"More Ship Upgrades has been patched"); } public void sendModInfo() { foreach (KeyValuePair<string, PluginInfo> pluginInfo in Chainloader.PluginInfos) { if (pluginInfo.Value.Metadata.GUID.Contains("ModSync")) { try { List<string> list = new List<string> { "malco", "LateGameUpgrades" }; ((Component)pluginInfo.Value.Instance).BroadcastMessage("getModInfo", (object)list, (SendMessageOptions)1); break; } catch (Exception) { mls.LogInfo((object)"Failed to send info to ModSync, go yell at Minx"); break; } } } } } } namespace MoreShipUpgrades.UpgradeComponents { internal class AdvTPButtonScript : GrabbableObject { public AudioClip ItemBreak; public AudioClip error; public AudioClip buttonPress; private AudioSource audio; public override void Start() { ((GrabbableObject)this).Start(); audio = ((Component)this).GetComponent<AudioSource>(); ((Component)this).gameObject.GetComponent<NetworkObject>().Spawn(false); } public override void DiscardItem() { base.playerHeldBy.activatingItem = false; ((GrabbableObject)this).DiscardItem(); } public override void ItemActivate(bool used, bool buttonDown = true) { ((GrabbableObject)this).ItemActivate(used, buttonDown); if (!Mouse.current.leftButton.isPressed) { return; } audio.PlayOneShot(buttonPress); if (!base.itemUsedUp) { ShipTeleporter[] array = Object.FindObjectsOfType<ShipTeleporter>(); ShipTeleporter val = null; ShipTeleporter[] array2 = array; foreach (ShipTeleporter val2 in array2) { if (!val2.isInverseTeleporter) { val = val2; break; } } if ((Object)(object)val == (Object)null) { audio.PlayOneShot(error); return; } int num = -1; for (int j = 0; j < StartOfRound.Instance.mapScreen.radarTargets.Count(); j++) { if ((Object)(object)((Component)StartOfRound.Instance.mapScreen.radarTargets[j].transform).gameObject.GetComponent<PlayerControllerB>() == (Object)(object)base.playerHeldBy) { num = j; } } if (num == -1) { StartOfRound.Instance.mapScreen.targetedPlayer = base.playerHeldBy; UpgradeBus.instance.TPButtonPressed = true; val.PressTeleportButtonOnLocalClient(); } else { StartOfRound.Instance.mapScreen.SwitchRadarTargetAndSync(num); ((MonoBehaviour)this).StartCoroutine(WaitToTP(val)); } } else { audio.PlayOneShot(error); } } private IEnumerator WaitToTP(ShipTeleporter tele) { yield return (object)new WaitForSeconds(0.15f); ReqUpdateTpDropStatusServerRpc(); tele.PressTeleportButtonOnLocalClient(); if (Random.Range(0f, 1f) < UpgradeBus.instance.cfg.ADV_CHANCE_TO_BREAK) { audio.PlayOneShot(ItemBreak); base.itemUsedUp = true; TextMeshProUGUI chatText = HUDManager.Instance.chatText; ((TMP_Text)chatText).text = ((TMP_Text)chatText).text + "\n<color=#FF0000>The teleporter button has suffered irreparable damage and destroyed itself!</color>"; base.playerHeldBy.DespawnHeldObject(); } } [ServerRpc(RequireOwnership = false)] public void ReqUpdateTpDropStatusServerRpc() { //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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3988692149u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3988692149u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ChangeTPButtonPressedClientRpc(); } } } [ClientRpc] private void ChangeTPButtonPressedClientRpc() { //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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2793166939u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2793166939u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost)) { UpgradeBus.instance.TPButtonPressed = true; } } } protected override void __initializeVariables() { ((GrabbableObject)this).__initializeVariables(); } [RuntimeInitializeOnLoadMethod] internal static void InitializeRPCS_AdvTPButtonScript() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown NetworkManager.__rpc_func_table.Add(3988692149u, new RpcReceiveHandler(__rpc_handler_3988692149)); NetworkManager.__rpc_func_table.Add(2793166939u, new RpcReceiveHandler(__rpc_handler_2793166939)); } private static void __rpc_handler_3988692149(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; ((AdvTPButtonScript)(object)target).ReqUpdateTpDropStatusServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2793166939(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)2; ((AdvTPButtonScript)(object)target).ChangeTPButtonPressedClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "AdvTPButtonScript"; } } internal class beekeeperScript : BaseUpgrade { private void Start() { Object.DontDestroyOnLoad((Object)(object)((Component)this).gameObject); UpgradeBus.instance.UpgradeObjects.Add("Beekeeper", ((Component)this).gameObject); } public override void Increment() { UpgradeBus.instance.beeLevel++; foreach (CustomTerminalNode terminalNode in UpgradeBus.instance.terminalNodes) { if (terminalNode.Name.ToLower() == "beekeeper") { terminalNode.Description = $"Circuit bees do %{Mathf.Round(100f * (UpgradeBus.instance.cfg.BEEKEEPER_DAMAGE_MULTIPLIER - (float)UpgradeBus.instance.beeLevel * UpgradeBus.instance.cfg.BEEKEEPER_DAMAGE_MULTIPLIER_INCREMENT))} of their base damage."; } } LGUStore.instance.UpdateBeePercsServerRpc(GameNetworkManager.Instance.localPlayerController.playerSteamId, UpgradeBus.instance.beeLevel); } public override void load() { UpgradeBus.instance.beekeeper = true; TextMeshProUGUI chatText = HUDManager.Instance.chatText; ((TMP_Text)chatText).text = ((TMP_Text)chatText).text + "\n<color=#FF0000>Beekeeper is active!</color>"; LGUStore.instance.UpdateBeePercsServerRpc(GameNetworkManager.Instance.localPlayerController.playerSteamId, 0); } public override void Register() { if (!UpgradeBus.instance.UpgradeObjects.ContainsKey("Beekeeper")) { UpgradeBus.instance.UpgradeObjects.Add("Beekeeper", ((Component)this).gameObject); } } protected override void __initializeVariables() { base.__initializeVariables(); } protected internal override string __getTypeName() { return "beekeeperScript"; } } internal class biggerLungScript : BaseUpgrade { private PlayerControllerB[] players; private void Start() { Object.DontDestroyOnLoad((Object)(object)((Component)this).gameObject); UpgradeBus.instance.UpgradeObjects.Add("Bigger Lungs", ((Component)this).gameObject); } public override void Increment() { UpgradeBus.instance.lungLevel++; players = Object.FindObjectsOfType<PlayerControllerB>(); PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController; localPlayerController.sprintTime += UpgradeBus.instance.cfg.SPRINT_TIME_INCREMENT; foreach (CustomTerminalNode terminalNode in UpgradeBus.instance.terminalNodes) { if (terminalNode.Name.ToLower() == "bigger lungs") { terminalNode.Description = $"Stamina Time is {UpgradeBus.instance.cfg.SPRINT_TIME_INCREASE - 11f + (float)UpgradeBus.instance.lungLevel * UpgradeBus.instance.cfg.SPRINT_TIME_INCREMENT} units longer"; } } } public override void load() { players = Object.FindObjectsOfType<PlayerControllerB>(); GameNetworkManager.Instance.localPlayerController.sprintTime = UpgradeBus.instance.cfg.SPRINT_TIME_INCREASE; UpgradeBus.instance.biggerLungs = true; TextMeshProUGUI chatText = HUDManager.Instance.chatText; ((TMP_Text)chatText).text = ((TMP_Text)chatText).text + "\n<color=#FF0000>Bigger Lungs is active!</color>"; float num = 0f; for (int i = 0; i < UpgradeBus.instance.lungLevel; i++) { num += UpgradeBus.instance.cfg.SPRINT_TIME_INCREMENT; } PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController; localPlayerController.sprintTime += num; } public override void Register() { if (!UpgradeBus.instance.UpgradeObjects.ContainsKey("Bigger Lungs")) { UpgradeBus.instance.UpgradeObjects.Add("Bigger Lungs", ((Component)this).gameObject); } } protected override void __initializeVariables() { base.__initializeVariables(); } protected internal override string __getTypeName() { return "biggerLungScript"; } } internal class exoskeletonScript : BaseUpgrade { private void Start() { Object.DontDestroyOnLoad((Object)(object)((Component)this).gameObject); UpgradeBus.instance.UpgradeObjects.Add("Back Muscles", ((Component)this).gameObject); } public override void Increment() { UpgradeBus.instance.backLevel++; foreach (CustomTerminalNode terminalNode in UpgradeBus.instance.terminalNodes) { if (terminalNode.Name.ToLower() == "back muscles") { terminalNode.Description = $"Carry weight becomes %{Mathf.Round((UpgradeBus.instance.cfg.CARRY_WEIGHT_REDUCTION - UpgradeBus.instance.cfg.CARRY_WEIGHT_INCREMENT * (float)UpgradeBus.instance.backLevel) * 100f)} of original"; } } } public override void load() { UpgradeBus.instance.exoskeleton = true; TextMeshProUGUI chatText = HUDManager.Instance.chatText; ((TMP_Text)chatText).text = ((TMP_Text)chatText).text + "\n<color=#FF0000>Back Muscles is active!</color>"; } public override void Register() { if (!UpgradeBus.instance.UpgradeObjects.ContainsKey("Back Muscles")) { UpgradeBus.instance.UpgradeObjects.Add("Back Muscles", ((Component)this).gameObject); } } protected override void __initializeVariables() { base.__initializeVariables(); } protected internal override string __getTypeName() { return "exoskeletonScript"; } } internal class lightFootedScript : BaseUpgrade { private void Start() { Object.DontDestroyOnLoad((Object)(object)((Component)this).gameObject); UpgradeBus.instance.UpgradeObjects.Add("Light Footed", ((Component)this).gameObject); } public override void Increment() { UpgradeBus.instance.lightLevel++; foreach (CustomTerminalNode terminalNode in UpgradeBus.instance.terminalNodes) { if (terminalNode.Name.ToLower() == "light footed") { terminalNode.Description = $"Audible Noise Distance is reduced by {UpgradeBus.instance.cfg.NOISE_REDUCTION + UpgradeBus.instance.cfg.NOISE_REDUCTION_INCREMENT * (float)UpgradeBus.instance.lightLevel} units. \nApplies to both sprinting and walking."; } } } public override void load() { UpgradeBus.instance.softSteps = true; TextMeshProUGUI chatText = HUDManager.Instance.chatText; ((TMP_Text)chatText).text = ((TMP_Text)chatText).text + "\n<color=#FF0000>Light Footed is active!</color>"; } public override void Register() { if (!UpgradeBus.instance.UpgradeObjects.ContainsKey("Light Footed")) { UpgradeBus.instance.UpgradeObjects.Add("Light Footed", ((Component)this).gameObject); } } protected override void __initializeVariables() { base.__initializeVariables(); } protected internal override string __getTypeName() { return "lightFootedScript"; } } public class lockSmithScript : BaseUpgrade { private GameObject pin1; private GameObject pin2; private GameObject pin3; private GameObject pin4; private GameObject pin5; private List<GameObject> pins; private List<int> order = new List<int> { 0, 1, 2, 3, 4 }; private int currentPin = 0; public DoorLock currentDoor = null; private bool canPick = false; public int timesStruck; private void Start() { //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Expected O, but got Unknown //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Expected O, but got Unknown //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Expected O, but got Unknown //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Expected O, but got Unknown //IL_0171: Unknown result type (might be due to invalid IL or missing references) //IL_017b: Expected O, but got Unknown Object.DontDestroyOnLoad((Object)(object)((Component)this).gameObject); UpgradeBus.instance.UpgradeObjects.Add("Locksmith", ((Component)this).gameObject); Transform child = ((Component)this).transform.GetChild(0).GetChild(0).GetChild(0); pin1 = ((Component)child.GetChild(0)).gameObject; pin2 = ((Component)child.GetChild(1)).gameObject; pin3 = ((Component)child.GetChild(2)).gameObject; pin4 = ((Component)child.GetChild(3)).gameObject; pin5 = ((Component)child.GetChild(4)).gameObject; ((UnityEvent)((Component)pin1.transform.GetChild(0)).GetComponent<Button>().onClick).AddListener((UnityAction)delegate { StrikePin(0); }); ((UnityEvent)((Component)pin2.transform.GetChild(0)).GetComponent<Button>().onClick).AddListener((UnityAction)delegate { StrikePin(1); }); ((UnityEvent)((Component)pin3.transform.GetChild(0)).GetComponent<Button>().onClick).AddListener((UnityAction)delegate { StrikePin(2); }); ((UnityEvent)((Component)pin4.transform.GetChild(0)).GetComponent<Button>().onClick).AddListener((UnityAction)delegate { StrikePin(3); }); ((UnityEvent)((Component)pin5.transform.GetChild(0)).GetComponent<Button>().onClick).AddListener((UnityAction)delegate { StrikePin(4); }); pins = new List<GameObject> { pin1, pin2, pin3, pin4, pin5 }; } public override void load() { UpgradeBus.instance.lockSmith = true; UpgradeBus.instance.lockScript = this; TextMeshProUGUI chatText = HUDManager.Instance.chatText; ((TMP_Text)chatText).text = ((TMP_Text)chatText).text + "\n<color=#FF0000>Locksmith is active!</color>"; } public override void Register() { if (!UpgradeBus.instance.UpgradeObjects.ContainsKey("Locksmith")) { UpgradeBus.instance.UpgradeObjects.Add("Locksmith", ((Component)this).gameObject); } } private void Update() { if (((ButtonControl)Keyboard.current[(Key)60]).wasPressedThisFrame && ((Component)((Component)this).transform.GetChild(0)).gameObject.activeInHierarchy) { ((Component)((Component)this).transform.GetChild(0)).gameObject.SetActive(false); Cursor.visible = false; Cursor.lockState = (CursorLockMode)1; } } public void BeginLockPick() { //IL_006c: 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_0092: Unknown result type (might be due to invalid IL or missing references) ((Component)((Component)this).transform.GetChild(0)).gameObject.SetActive(true); Cursor.visible = true; Cursor.lockState = (CursorLockMode)0; canPick = false; currentPin = 0; for (int i = 0; i < pins.Count; i++) { float num = Random.Range(40f, 90f); pins[i].transform.localPosition = new Vector3(pins[i].transform.localPosition.x, num, pins[i].transform.localPosition.z); } RandomizeListOrder(order); ((MonoBehaviour)this).StartCoroutine(CommunicateOrder(order)); } public void StrikePin(int i) { //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_006e: 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_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) if (!canPick) { return; } timesStruck++; if (i == order[currentPin]) { currentPin++; pins[i].transform.localPosition = new Vector3(pins[i].transform.localPosition.x, 35f, pins[i].transform.localPosition.z); if (currentPin == 5) { Cursor.visible = false; Cursor.lockState = (CursorLockMode)1; ((Component)((Component)this).transform.GetChild(0)).gameObject.SetActive(false); currentDoor.UnlockDoorSyncWithServer(); } RoundManager.Instance.PlayAudibleNoise(((Component)currentDoor).transform.position, 10f, 0.65f, timesStruck, false, 0); } else { BeginLockPick(); RoundManager.Instance.PlayAudibleNoise(((Component)currentDoor).transform.position, 30f, 0.65f, timesStruck, false, 0); } } private void RandomizeListOrder<T>(List<T> list) { int num = list.Count; Random random = new Random(); while (num > 1) { num--; int index = random.Next(num + 1); T value = list[index]; list[index] = list[num]; list[num] = value; } } private IEnumerator CommunicateOrder(List<int> lst) { yield return (object)new WaitForSeconds(0.75f); for (int i = 0; i < lst.Count; i++) { ((Graphic)pins[lst[i]].GetComponent<Image>()).color = Color.green; yield return (object)new WaitForSeconds(0.25f); ((Graphic)pins[lst[i]].GetComponent<Image>()).color = Color.white; } canPick = true; } protected override void __initializeVariables() { base.__initializeVariables(); } protected internal override string __getTypeName() { return "lockSmithScript"; } } internal class NightVisionItemScript : GrabbableObject { public override void DiscardItem() { base.playerHeldBy.activatingItem = false; ((GrabbableObject)this).DiscardItem(); } public override void ItemActivate(bool used, bool buttonDown = true) { ((GrabbableObject)this).ItemActivate(used, buttonDown); if (!Mouse.current.leftButton.isPressed) { return; } if (UpgradeBus.instance.nightVision) { TextMeshProUGUI chatText = HUDManager.Instance.chatText; ((TMP_Text)chatText).text = ((TMP_Text)chatText).text + "<color=#FF0000>Night vision is already active!</color>"; return; } if (!UpgradeBus.instance.IndividualUpgrades["NV Headset Batteries"]) { LGUStore.instance.EnableNightVisionServerRpc(); } else { UpgradeBus.instance.UpgradeObjects["NV Headset Batteries"].GetComponent<nightVisionScript>().EnableOnClient(); } base.playerHeldBy.DespawnHeldObject(); } protected override void __initializeVariables() { ((GrabbableObject)this).__initializeVariables(); } protected internal override string __getTypeName() { return "NightVisionItemScript"; } } internal class nightVisionScript : BaseUpgrade { private float nightBattery; private Transform batteryBar; private PlayerControllerB client; private bool batteryExhaustion; private Key toggleKey; private void Start() { //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_0079: 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) Object.DontDestroyOnLoad((Object)(object)((Component)this).gameObject); UpgradeBus.instance.UpgradeObjects.Add("NV Headset Batteries", ((Component)this).gameObject); batteryBar = ((Component)((Component)this).transform.GetChild(0).GetChild(0)).transform; ((Component)((Component)this).transform.GetChild(0)).gameObject.SetActive(false); if (Enum.TryParse<Key>(UpgradeBus.instance.cfg.TOGGLE_NIGHT_VISION_KEY, out Key result)) { toggleKey = result; } else { toggleKey = (Key)53; } } public override void Register() { if (!UpgradeBus.instance.UpgradeObjects.ContainsKey("NV Headset Batteries")) { UpgradeBus.instance.UpgradeObjects.Add("NV Headset Batteries", ((Component)this).gameObject); } } private void LateUpdate() { //IL_001d: 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_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0080: 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) //IL_0224: Unknown result type (might be due to invalid IL or missing references) //IL_037b: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)client == (Object)null) { return; } if (((ButtonControl)Keyboard.current[toggleKey]).wasPressedThisFrame && !batteryExhaustion) { UpgradeBus.instance.nightVisionActive = !UpgradeBus.instance.nightVisionActive; if (UpgradeBus.instance.nightVisionActive) { UpgradeBus.instance.nightVisColor = client.nightVision.color; UpgradeBus.instance.nightVisRange = client.nightVision.range; UpgradeBus.instance.nightVisIntensity = client.nightVision.intensity; client.nightVision.color = UpgradeBus.instance.cfg.NIGHT_VIS_COLOR; client.nightVision.range = UpgradeBus.instance.cfg.NIGHT_VIS_RANGE; client.nightVision.intensity = UpgradeBus.instance.cfg.NIGHT_VIS_INTENSITY; nightBattery -= UpgradeBus.instance.cfg.NIGHT_VIS_STARTUP; } else { client.nightVision.color = UpgradeBus.instance.nightVisColor; client.nightVision.range = UpgradeBus.instance.nightVisRange; client.nightVision.intensity = UpgradeBus.instance.nightVisIntensity; } } if (UpgradeBus.instance.nightVisionActive) { nightBattery -= Time.deltaTime * UpgradeBus.instance.cfg.NIGHT_VIS_DRAIN_SPEED; nightBattery = Mathf.Clamp(nightBattery, 0f, 1f); ((Component)batteryBar.parent).gameObject.SetActive(true); if (nightBattery <= 0f) { UpgradeBus.instance.nightVisionActive = false; client.nightVision.color = UpgradeBus.instance.nightVisColor; client.nightVision.range = UpgradeBus.instance.nightVisRange; client.nightVision.intensity = UpgradeBus.instance.nightVisIntensity; batteryExhaustion = true; ((MonoBehaviour)this).StartCoroutine(BatteryRecovery()); } } else if (!batteryExhaustion) { nightBattery += Time.deltaTime * UpgradeBus.instance.cfg.NIGHT_VIS_REGEN_SPEED; nightBattery = Mathf.Clamp(nightBattery, 0f, 1f); if (nightBattery >= 1f) { ((Component)batteryBar.parent).gameObject.SetActive(false); } else { ((Component)batteryBar.parent).gameObject.SetActive(true); } } if (client.isInsideFactory || UpgradeBus.instance.nightVisionActive) { ((Behaviour)client.nightVision).enabled = true; } else { ((Behaviour)client.nightVision).enabled = false; } batteryBar.localScale = new Vector3(nightBattery, 1f, 1f); } private IEnumerator BatteryRecovery() { yield return (object)new WaitForSeconds(UpgradeBus.instance.cfg.NIGHT_VIS_EXHAUST); batteryExhaustion = false; } public override void Increment() { UpgradeBus.instance.nightVisionLevel++; LGUStore.instance.UpdateLGUSaveServerRpc(GameNetworkManager.Instance.localPlayerController.playerSteamId, JsonConvert.SerializeObject((object)new SaveInfo())); AdjustNightVisionProperties(); } public override void load() { AdjustNightVisionProperties(); EnableOnClient(save: false); } public void EnableOnClient(bool save = true) { if ((Object)(object)client == (Object)null) { client = GameNetworkManager.Instance.localPlayerController; } ((Component)((Component)this).transform.GetChild(0)).gameObject.SetActive(true); UpgradeBus.instance.nightVision = true; if (save) { LGUStore.instance.UpdateLGUSaveServerRpc(client.playerSteamId, JsonConvert.SerializeObject((object)new SaveInfo())); } TextMeshProUGUI chatText = HUDManager.Instance.chatText; ((TMP_Text)chatText).text = ((TMP_Text)chatText).text + "\n<color=#FF0000>Press " + UpgradeBus.instance.cfg.TOGGLE_NIGHT_VISION_KEY + " to toggle Night Vision!!!</color>"; } public void DisableOnClient() { ((Component)((Component)this).transform.GetChild(0)).gameObject.SetActive(false); UpgradeBus.instance.nightVision = false; LGUStore.instance.UpdateLGUSaveServerRpc(client.playerSteamId, JsonConvert.SerializeObject((object)new SaveInfo())); client = null; } private void AdjustNightVisionProperties() { float num = Mathf.Pow(1f + UpgradeBus.instance.cfg.NIGHT_VIS_REGEN_INCREASE_PERCENT / 100f, (float)UpgradeBus.instance.nightVisionLevel) * 0.01f; float num2 = Mathf.Pow(1f - UpgradeBus.instance.cfg.NIGHT_VIS_DRAIN_DECREASE_PERCENT / 100f, (float)UpgradeBus.instance.nightVisionLevel) * 0.01f; UpgradeBus.instance.cfg.NIGHT_VIS_REGEN_SPEED += num; UpgradeBus.instance.cfg.NIGHT_VIS_DRAIN_SPEED -= num2; } protected override void __initializeVariables() { base.__initializeVariables(); } protected internal override string __getTypeName() { return "nightVisionScript"; } } public class pagerScript : BaseUpgrade { public bool isOnCooldown = false; public float remainingCooldownTime; public float cooldownDuration; private void Start() { Object.DontDestroyOnLoad((Object)(object)((Component)this).gameObject); UpgradeBus.instance.UpgradeObjects.Add("Pager", ((Component)this).gameObject); cooldownDuration = UpgradeBus.instance.cfg.PAGER_COOLDOWN_DURATION; } public override void load() { UpgradeBus.instance.pager = true; UpgradeBus.instance.pageScript = this; TextMeshProUGUI chatText = HUDManager.Instance.chatText; ((TMP_Text)chatText).text = ((TMP_Text)chatText).text + "\n<color=#FF0000>Pager is active!</color>"; } public override void Register() { if (!UpgradeBus.instance.UpgradeObjects.ContainsKey("Pager")) { UpgradeBus.instance.UpgradeObjects.Add("Pager", ((Component)this).gameObject); } } [ServerRpc(RequireOwnership = false)] public void ReqBroadcastChatServerRpc(string msg) { //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_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)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(797180313u, val, (RpcDelivery)0); bool flag = msg != null; ((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val2)).WriteValueSafe(msg, false); } ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 797180313u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost) && !isOnCooldown) { isOnCooldown = true; remainingCooldownTime = cooldownDuration; ((MonoBehaviour)this).StartCoroutine(CooldownTimer()); ReceiveChatClientRpc(msg); } } [ClientRpc] public void ReceiveChatClientRpc(string msg) { //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_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)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(58640511u, val, (RpcDelivery)0); bool flag = msg != null; ((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val2)).WriteValueSafe(msg, false); } ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 58640511u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost)) { TextMeshProUGUI chatText = HUDManager.Instance.chatText; ((TMP_Text)chatText).text = ((TMP_Text)chatText).text + "\n<color=#FF0000>Terminal</color><color=#0000FF>:</color> <color=#FF00FF>" + msg + "</color>"; HUDManager.Instance.PingHUDElement(HUDManager.Instance.Chat, 4f, 1f, 0.2f); isOnCooldown = true; } } [ServerRpc(RequireOwnership = false)] private void ReqUpdateCooldownServerRpc() { //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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3773390034u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3773390034u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { UpdateCooldownClientRpc(); } } } [ClientRpc] private void UpdateCooldownClientRpc() { //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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2406406125u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2406406125u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost)) { isOnCooldown = false; } } } private IEnumerator CooldownTimer() { while (remainingCooldownTime > 0f) { yield return (object)new WaitForSeconds(1f); remainingCooldownTime -= 1f; } isOnCooldown = false; TextMeshProUGUI chatText = HUDManager.Instance.chatText; ((TMP_Text)chatText).text = ((TMP_Text)chatText).text + "\n<color=#FF0000>Pager cooldown finished. Ready to use!</color>"; } protected override void __initializeVariables() { base.__initializeVariables(); } [RuntimeInitializeOnLoadMethod] internal static void InitializeRPCS_pagerScript() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Expected O, but got Unknown //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Expected O, but got Unknown NetworkManager.__rpc_func_table.Add(797180313u, new RpcReceiveHandler(__rpc_handler_797180313)); NetworkManager.__rpc_func_table.Add(58640511u, new RpcReceiveHandler(__rpc_handler_58640511)); NetworkManager.__rpc_func_table.Add(3773390034u, new RpcReceiveHandler(__rpc_handler_3773390034)); NetworkManager.__rpc_func_table.Add(2406406125u, new RpcReceiveHandler(__rpc_handler_2406406125)); } private static void __rpc_handler_797180313(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<bool>(ref flag, default(ForPrimitives)); string msg = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref msg, false); } target.__rpc_exec_stage = (__RpcExecStage)1; ((pagerScript)(object)target).ReqBroadcastChatServerRpc(msg); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_58640511(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<bool>(ref flag, default(ForPrimitives)); string msg = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref msg, false); } target.__rpc_exec_stage = (__RpcExecStage)2; ((pagerScript)(object)target).ReceiveChatClientRpc(msg); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3773390034(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; ((pagerScript)(object)target).ReqUpdateCooldownServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2406406125(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)2; ((pagerScript)(object)target).UpdateCooldownClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "pagerScript"; } } internal class runningShoeScript : BaseUpgrade { private void Start() { Object.DontDestroyOnLoad((Object)(object)((Component)this).gameObject); UpgradeBus.instance.UpgradeObjects.Add("Running Shoes", ((Component)this).gameObject); } public override void Increment() { PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController; localPlayerController.movementSpeed += UpgradeBus.instance.cfg.MOVEMENT_INCREMENT; UpgradeBus.instance.runningLevel++; foreach (CustomTerminalNode terminalNode in UpgradeBus.instance.terminalNodes) { if (terminalNode.Name.ToLower() == "running shoes") { terminalNode.Description = $"You can run {UpgradeBus.instance.cfg.MOVEMENT_SPEED - 4.6f + UpgradeBus.instance.cfg.MOVEMENT_INCREMENT * (float)UpgradeBus.instance.runningLevel} units faster"; } } } public override void Register() { if (!UpgradeBus.instance.UpgradeObjects.ContainsKey("Running Shoes")) { UpgradeBus.instance.UpgradeObjects.Add("Running Shoes", ((Component)this).gameObject); } } public override void load() { UpgradeBus.instance.runningShoes = true; GameNetworkManager.Instance.localPlayerController.movementSpeed = UpgradeBus.instance.cfg.MOVEMENT_SPEED; TextMeshProUGUI chatText = HUDManager.Instance.chatText; ((TMP_Text)chatText).text = ((TMP_Text)chatText).text + "\n<color=#FF0000>Running Shoes is active!</color>"; float num = 0f; for (int i = 0; i < UpgradeBus.instance.runningLevel; i++) { num += UpgradeBus.instance.cfg.MOVEMENT_INCREMENT; } PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController; localPlayerController.movementSpeed += num; } protected override void __initializeVariables() { base.__initializeVariables(); } protected internal override string __getTypeName() { return "runningShoeScript"; } } internal class strongerScannerScript : BaseUpgrade { private void Start() { Object.DontDestroyOnLoad((Object)(object)((Component)this).gameObject); UpgradeBus.instance.UpgradeObjects.Add("Better Scanner", ((Component)this).gameObject); } public override void load() { UpgradeBus.instance.scannerUpgrade = true; TextMeshProUGUI chatText = HUDManager.Instance.chatText; ((TMP_Text)chatText).text = ((TMP_Text)chatText).text + "\n<color=#FF0000>Better Scanner is active!</color>"; } public override void Register() { if (!UpgradeBus.instance.UpgradeObjects.ContainsKey("Better Scanner")) { UpgradeBus.instance.UpgradeObjects.Add("Better Scanner", ((Component)this).gameObject); } } protected override void __initializeVariables() { base.__initializeVariables(); } protected internal override string __getTypeName() { return "strongerScannerScript"; } } internal class strongLegsScript : BaseUpgrade { private void Start() { Object.DontDestroyOnLoad((Object)(object)((Component)this).gameObject); UpgradeBus.instance.UpgradeObjects.Add("Strong Legs", ((Component)this).gameObject); } public override void Increment() { UpgradeBus.instance.legLevel++; foreach (CustomTerminalNode terminalNode in UpgradeBus.instance.terminalNodes) { if (terminalNode.Name.ToLower() == "strong legs") { terminalNode.Description = $"Can jump an additional {UpgradeBus.instance.cfg.JUMP_FORCE - 13f + (float)UpgradeBus.instance.legLevel * UpgradeBus.instance.cfg.JUMP_FORCE_INCREMENT} units high."; PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController; localPlayerController.jumpForce += UpgradeBus.instance.cfg.JUMP_FORCE_INCREMENT; } } } public override void Register() { if (!UpgradeBus.instance.UpgradeObjects.ContainsKey("Strong Legs")) { UpgradeBus.instance.UpgradeObjects.Add("Strong Legs", ((Component)this).gameObject); } } public override void load() { UpgradeBus.instance.strongLegs = true; GameNetworkManager.Instance.localPlayerController.jumpForce = UpgradeBus.instance.cfg.JUMP_FORCE; TextMeshProUGUI chatText = HUDManager.Instance.chatText; ((TMP_Text)chatText).text = ((TMP_Text)chatText).text + "\n<color=#FF0000>Strong Legs is active!</color>"; float num = 0f; for (int i = 0; i < UpgradeBus.instance.legLevel; i++) { num += UpgradeBus.instance.cfg.JUMP_FORCE_INCREMENT; } PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController; localPlayerController.jumpForce += num; } protected override void __initializeVariables() { base.__initializeVariables(); } protected internal override string __getTypeName() { return "strongLegsScript"; } } public class terminalFlashScript : BaseUpgrade { private void Start() { Object.DontDestroyOnLoad((Object)(object)((Component)this).gameObject); UpgradeBus.instance.UpgradeObjects.Add("Discombobulator", ((Component)this).gameObject); } public override void load() { UpgradeBus.instance.terminalFlash = true; UpgradeBus.instance.flashScript = this; TextMeshProUGUI chatText = HUDManager.Instance.chatText; ((TMP_Text)chatText).text = ((TMP_Text)chatText).text + "\n<color=#FF0000>Discombobulator is active!\nType 'cooldown' into the terminal for info!!!</color>"; } public override void Register() { if (!UpgradeBus.instance.UpgradeObjects.ContainsKey("Discombobulator")) { UpgradeBus.instance.UpgradeObjects.Add("Discombobulator", ((Component)this).gameObject); } } public override void Increment() { UpgradeBus.instance.discoLevel++; foreach (CustomTerminalNode terminalNode in UpgradeBus.instance.terminalNodes) { if (terminalNode.Name.ToLower() == "discombobulator") { terminalNode.Description = $"Enemies are stunned for {UpgradeBus.instance.cfg.DISCOMBOBULATOR_STUN_DURATION + (float)UpgradeBus.instance.discoLevel * UpgradeBus.instance.cfg.DISCOMBOBULATOR_INCREMENT} seconds."; } } } [ServerRpc(RequireOwnership = false)] public void PlayAudioAndUpdateCooldownServerRpc() { //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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(1135781697u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1135781697u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { PlayAudioAndUpdateCooldownClientRpc(); } } } [ClientRpc] private void PlayAudioAndUpdateCooldownClientRpc() { //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_0120: 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)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1412806528u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1412806528u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } Terminal component = GameObject.Find("TerminalScript").GetComponent<Terminal>(); component.terminalAudio.maxDistance = 100f; component.terminalAudio.PlayOneShot(UpgradeBus.instance.flashNoise); ((MonoBehaviour)this).StartCoroutine(ResetRange(component)); UpgradeBus.instance.flashCooldown = UpgradeBus.instance.cfg.DISCOMBOBULATOR_COOLDOWN; Collider[] array = Physics.OverlapSphere(((Component)component).transform.position, UpgradeBus.instance.cfg.DISCOMBOBULATOR_RADIUS, 524288); if (array.Length == 0) { return; } for (int i = 0; i < array.Length; i++) { EnemyAICollisionDetect component2 = ((Component)array[i]).GetComponent<EnemyAICollisionDetect>(); if ((Object)(object)component2 != (Object)null) { component2.mainScript.SetEnemyStunned(true, UpgradeBus.instance.cfg.DISCOMBOBULATOR_STUN_DURATION + UpgradeBus.instance.cfg.DISCOMBOBULATOR_INCREMENT * (float)UpgradeBus.instance.discoLevel, (PlayerControllerB)null); } } } private IEnumerator ResetRange(Terminal terminal) { yield return (object)new WaitForSeconds(2f); terminal.terminalAudio.maxDistance = 17f; } protected override void __initializeVariables() { base.__initializeVariables(); } [RuntimeInitializeOnLoadMethod] internal static void InitializeRPCS_terminalFlashScript() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown NetworkManager.__rpc_func_table.Add(1135781697u, new RpcReceiveHandler(__rpc_handler_1135781697)); NetworkManager.__rpc_func_table.Add(1412806528u, new RpcReceiveHandler(__rpc_handler_1412806528)); } private static void __rpc_handler_1135781697(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; ((terminalFlashScript)(object)target).PlayAudioAndUpdateCooldownServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1412806528(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)2; ((terminalFlashScript)(object)target).PlayAudioAndUpdateCooldownClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "terminalFlashScript"; } } internal class TPButtonScript : GrabbableObject { public AudioClip ItemBreak; public AudioClip error; public AudioClip buttonPress; private AudioSource audio; public override void Start() { ((GrabbableObject)this).Start(); audio = ((Component)this).GetComponent<AudioSource>(); ((Component)this).gameObject.GetComponent<NetworkObject>().Spawn(false); } public override void DiscardItem() { base.playerHeldBy.activatingItem = false; ((GrabbableObject)this).DiscardItem(); } public override void ItemActivate(bool used, bool buttonDown = true) { ((GrabbableObject)this).ItemActivate(used, buttonDown); if (!Mouse.current.leftButton.isPressed) { return; } audio.PlayOneShot(buttonPress); if (!base.itemUsedUp) { ShipTeleporter[] array = Object.FindObjectsOfType<ShipTeleporter>(); ShipTeleporter val = null; ShipTeleporter[] array2 = array; foreach (ShipTeleporter val2 in array2) { if (!val2.isInverseTeleporter) { val = val2; break; } } if ((Object)(object)val == (Object)null) { audio.PlayOneShot(error); return; } int num = -1; for (int j = 0; j < StartOfRound.Instance.mapScreen.radarTargets.Count(); j++) { if ((Object)(object)((Component)StartOfRound.Instance.mapScreen.radarTargets[j].transform).gameObject.GetComponent<PlayerControllerB>() == (Object)(object)base.playerHeldBy) { num = j; } } if (num == -1) { StartOfRound.Instance.mapScreen.targetedPlayer = base.playerHeldBy; UpgradeBus.instance.TPButtonPressed = true; val.PressTeleportButtonOnLocalClient(); if (Random.Range(0f, 1f) > UpgradeBus.instance.cfg.CHANCE_TO_BREAK) { audio.PlayOneShot(ItemBreak); base.itemUsedUp = true; base.playerHeldBy.DespawnHeldObject(); } } else { StartOfRound.Instance.mapScreen.SwitchRadarTargetAndSync(num); ((MonoBehaviour)this).StartCoroutine(WaitToTP(val)); } } else { audio.PlayOneShot(error); } } private IEnumerator WaitToTP(ShipTeleporter tele) { yield return (object)new WaitForSeconds(0.15f); ReqUpdateTpDropStatusServerRpc(); tele.PressTeleportButtonOnLocalClient(); if (Random.Range(0f, 1f) < UpgradeBus.instance.cfg.CHANCE_TO_BREAK) { audio.PlayOneShot(ItemBreak); base.itemUsedUp = true; TextMeshProUGUI chatText = HUDManager.Instance.chatText; ((TMP_Text)chatText).text = ((TMP_Text)chatText).text + "\n<color=#FF0000>The teleporter button has suffered irreparable damage and destroyed itself!</color>"; base.playerHeldBy.DespawnHeldObject(); } } [ServerRpc(RequireOwnership = false)] public void ReqUpdateTpDropStatusServerRpc() { //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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3777354640u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3777354640u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ChangeTPButtonPressedClientRpc(); } } } [ClientRpc] private void ChangeTPButtonPressedClientRpc() { //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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3413730949u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3413730949u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost)) { UpgradeBus.instance.TPButtonPressed = true; } } } protected override void __initializeVariables() { ((GrabbableObject)this).__initializeVariables(); } [RuntimeInitializeOnLoadMethod] internal static void InitializeRPCS_TPButtonScript() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown NetworkManager.__rpc_func_table.Add(3777354640u, new RpcReceiveHandler(__rpc_handler_3777354640)); NetworkManager.__rpc_func_table.Add(3413730949u, new RpcReceiveHandler(__rpc_handler_3413730949)); } private static void __rpc_handler_3777354640(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; ((TPButtonScript)(object)target).ReqUpdateTpDropStatusServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3413730949(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)2; ((TPButtonScript)(object)target).ChangeTPButtonPressedClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "TPButtonScript"; } } public class trapDestroyerScript : BaseUpgrade { private void Start() { Object.DontDestroyOnLoad((Object)(object)((Component)this).gameObject); UpgradeBus.instance.UpgradeObjects.Add("Malware Broadcaster", ((Component)this).gameObject); } public override void load() { UpgradeBus.instance.DestroyTraps = true; UpgradeBus.instance.trapHandler = this; TextMeshProUGUI chatText = HUDManager.Instance.chatText; ((TMP_Text)chatText).text = ((TMP_Text)chatText).text + "\n<color=#FF0000>Malware Broadcaster is active!</color>"; } public override void Register() { if (!UpgradeBus.instance.UpgradeObjects.ContainsKey("Malware Broadcaster")) { UpgradeBus.instance.UpgradeObjects.Add("Malware Broadcaster", ((Component)this).gameObject); } } [ServerRpc(RequireOwnership = false)] public void ReqDestroyObjectServerRpc(NetworkObjectReference go) { //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_0155: 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)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(1254388238u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe<NetworkObjectReference>(ref go, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1254388238u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsServer && !networkManager.IsHost)) { return; } NetworkObject val3 = default(NetworkObject); ((NetworkObjectReference)(ref go)).TryGet(ref val3, (NetworkManager)null); if ((Object)(object)val3 == (Object)null) { HUDManager.Instance.AddTextToChatOnServer("Can't retrieve obj", 0); } else if (((Object)((Component)val3).gameObject).name == "Landmine(Clone)" || ((Object)((Component)val3).gameObject).name == "TurretContainer(Clone)") { if (UpgradeBus.instance.cfg.EXPLODE_TRAP) { SpawnExplosionClientRpc(((Component)val3).gameObject.transform.position); } Object.Destroy((Object)(object)((Component)val3).gameObject); } } [ClientRpc] private void SpawnExplosionClientRpc(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_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_0089: 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_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3507995715u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref position); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3507995715u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost) && UpgradeBus.instance.cfg.EXPLODE_TRAP) { Landmine.SpawnExplosion(position + Vector3.up, true, 5.7f, 6.4f); } } } protected override void __initializeVariables() { base.__initializeVariables(); } [RuntimeInitializeOnLoadMethod] internal static void InitializeRPCS_trapDestroyerScript() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown NetworkManager.__rpc_func_table.Add(1254388238u, new RpcReceiveHandler(__rpc_handler_1254388238)); NetworkManager.__rpc_func_table.Add(3507995715u, new RpcReceiveHandler(__rpc_handler_3507995715)); } private static void __rpc_handler_1254388238(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_004f: 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) { NetworkObjectReference go = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe<NetworkObjectReference>(ref go, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)1; ((trapDestroyerScript)(object)target).ReqDestroyObjectServerRpc(go); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3507995715(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0041: 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) { Vector3 position = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref position); target.__rpc_exec_stage = (__RpcExecStage)2; ((trapDestroyerScript)(object)target).SpawnExplosionClientRpc(position); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "trapDestroyerScript"; } } } namespace MoreShipUpgrades.Patches { [HarmonyPatch(typeof(DeleteFileButton))] internal class DeleteButtonPatcher { [HarmonyPostfix] [HarmonyPatch("DeleteFile")] private static void deleteLGUFile(DeleteFileButton __instance) { string path = Path.Combine(Application.persistentDataPath, $"LGU_{__instance.fileToDelete}.json"); if (File.Exists(path)) { File.Delete(path); } } } [HarmonyPatch(typeof(GameNetworkManager))] internal class GameNetworkManagerPatcher { [HarmonyPostfix] [HarmonyPatch("Disconnect")] private static void ResetUpgradeBus() { BaseUpgrade[] array = Object.FindObjectsOfType<BaseUpgrade>(); BaseUpgrade[] array2 = array; foreach (BaseUpgrade baseUpgrade in array2) { Object.Destroy((Object)(object)((Component)baseUpgrade).gameObject); } UpgradeBus.instance.ResetAllValues(); } [HarmonyPrefix] [HarmonyPatch("SaveGame")] private static void saveLGU(GameNetworkManager __instance) { if (__instance.isHostingGame) { LGUStore.instance.ServerSaveFileServerRpc(); } } } [HarmonyPatch(typeof(HUDManager))] internal class HUDManagerPatcher { [HarmonyPostfix] [HarmonyPatch("MeetsScanNodeRequirements")] private static void alterReqs(ScanNodeProperties node, ref bool __result, PlayerControllerB playerScript) { //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) if (UpgradeBus.instance.scannerUpgrade) { if ((Object)(object)node == (Object)null) { __result = false; } float num = ((node.headerText == "Main entrance" || node.headerText == "Ship") ? UpgradeBus.instance.cfg.SHIP_AND_ENTRANCE_DISTANCE_INCREASE : UpgradeBus.instance.cfg.NODE_DISTANCE_INCREASE); if (UpgradeBus.instance.cfg.REQUIRE_LINE_OF_SIGHT && Physics.Linecast(((Component)playerScript.gameplayCamera).transform.position, ((Component)node).transform.position, 256, (QueryTriggerInteraction)1)) { __result = false; return; } float num2 = Vector3.Distance(((Component)playerScript).transform.position, ((Component)node).transform.position); __result = num2 < (float)node.maxRange + num && num2 > (float)node.minRange; } } } [HarmonyPatch(typeof(InteractTrigger))] internal class InteractTriggerPatcher { [HarmonyPrefix] [HarmonyPatch("OnTriggerEnter")] private static bool pickDoor(InteractTrigger __instance, Collider other) { if (!UpgradeBus.instance.lockSmith) { return true; } PlayerControllerB component = ((Component)other).gameObject.GetComponent<PlayerControllerB>(); if ((Object)(object)component == (Object)null) { return true; } if (!((NetworkBehaviour)component).IsOwner) { return true; } DoorLock component2 = ((Component)__instance).gameObject.GetComponent<DoorLock>(); if ((Object)(object)component2 == (Object)null) { return true; } if (!component2.isLocked) { return true; } if (((Component)((Component)UpgradeBus.instance.lockScript).gameObject.transform.GetChild(0)).gameObject.activeInHierarchy) { return true; } UpgradeBus.instance.lockScript.currentDoor = component2; UpgradeBus.instance.lockScript.BeginLockPick(); UpgradeBus.instance.lockScript.timesStruck = 0; return false; } } [HarmonyPatch(typeof(PlayerControllerB))] internal class PlayerControllerBPatcher { [HarmonyPrefix] [HarmonyPatch("KillPlayer")] private static void DisableUpgradesOnDeath(PlayerControllerB __instance) { if (UpgradeBus.instance.cfg.LOSE_NIGHT_VIS_ON_DEATH && ((NetworkBehaviour)__instance).IsOwner && !__instance.isPlayerDead && __instance.AllowPlayerDeath() && UpgradeBus.instance.nightVision) { UpgradeBus.instance.UpgradeObjects["NV Headset Batteries"].GetComponent<nightVisionScript>().DisableOnClient(); } } [HarmonyPrefix] [HarmonyPatch("DamagePlayer")] private static void beekeeperReduceDamage(ref int damageNumber, CauseOfDeath causeOfDeath, PlayerControllerB __instance) { if (UpgradeBus.instance.beePercs.ContainsKey(__instance.playerSteamId) && damageNumber == 10) { damageNumber = Mathf.Clamp((int)((float)damageNumber * (UpgradeBus.instance.cfg.BEEKEEPER_DAMAGE_MULTIPLIER - UpgradeBus.instance.beePercs[__instance.playerSteamId] * UpgradeBus.instance.cfg.BEEKEEPER_DAMAGE_MULTIPLIER_INCREMENT)), 0, 100); } } [HarmonyPrefix] [HarmonyPatch("DamagePlayerServerRpc")] private static void beekeeperReduceDamageServer(ref int damageNumber, PlayerControllerB __instance) { if (UpgradeBus.instance.beePercs.ContainsKey(__instance.playerSteamId) && damageNumber == 10) { damageNumber = Mathf.Clamp((int)((float)damageNumber * (UpgradeBus.instance.cfg.BEEKEEPER_DAMAGE_MULTIPLIER - UpgradeBus.instance.beePercs[__instance.playerSteamId] * UpgradeBus.instance.cfg.BEEKEEPER_DAMAGE_MULTIPLIER_INCREMENT)), 0, 100); } } [HarmonyPrefix] [HarmonyPatch("DamagePlayerClientRpc")] private static void beekeeperReduceDamageClient(ref int damageNumber, PlayerControllerB __instance) { if (UpgradeBus.instance.beePercs.ContainsKey(__instance.playerSteamId) && damageNumber == 10) { damageNumber = Mathf.Clamp((int)((float)damageNumber * (UpgradeBus.instance.cfg.BEEKEEPER_DAMAGE_MULTIPLIER - UpgradeBus.instance.beePercs[__instance.playerSteamId] * UpgradeBus.instance.cfg.BEEKEEPER_DAMAGE_MULTIPLIER_INCREMENT)), 0, 100); } } [HarmonyPrefix] [HarmonyPatch("DamageOnOtherClients")] private static void beekeeperReduceDamageOther(ref int damageNumber, PlayerControllerB __instance) { if (UpgradeBus.instance.beePercs.ContainsKey(__instance.playerSteamId) && damageNumber == 10) { damageNumber = Mathf.Clamp((int)((float)damageNumber * (UpgradeBus.instance.cfg.BEEKEEPER_DAMAGE_MULTIPLIER - UpgradeBus.instance.beePercs[__instance.playerSteamId] * UpgradeBus.instance.cfg.BEEKEEPER_DAMAGE_MULTIPLIER_INCREMENT)), 0, 100); } } [HarmonyPrefix] [HarmonyPatch("DropAllHeldItems")] private static bool DontDropItems() { if (UpgradeBus.instance.TPButtonPressed) { UpgradeBus.instance.TPButtonPressed = false; return false; } return true; } [HarmonyPrefix] [HarmonyPatch("Update")] private static void noCarryWeight(ref PlayerControllerB __instance) { if (!UpgradeBus.instance.exoskeleton || __instance.ItemSlots.Length == 0 || !((Object)(object)GameNetworkManager.Instance.localPlayerController == (Object)(object)__instance)) { return; } UpgradeBus.instance.alteredWeight = 1f; for (int i = 0; i < __instance.ItemSlots.Length; i++) { GrabbableObject val = __instance.ItemSlots[i]; if ((Object)(object)val != (Object)null) { UpgradeBus.instance.alteredWeight += Mathf.Clamp(val.itemProperties.weight - 1f, 0f, 10f) * (UpgradeBus.instance.cfg.CARRY_WEIGHT_REDUCTION - (float)UpgradeBus.instance.backLevel * UpgradeBus.instance.cfg.CARRY_WEIGHT_INCREMENT); } } __instance.carryWeight = UpgradeBus.instance.alteredWeight; if (__instance.carryWeight < 1f) { __instance.carryWeight = 1f; } } } [HarmonyPatch(typeof(RoundManager))] internal class RoundManagerPatcher { [HarmonyPrefix] [HarmonyPatch("PlayAudibleNoise")] private static void MakeFootstepsQuiet(ref float noiseRange) { if (UpgradeBus.instance.softSteps) { noiseRange -= UpgradeBus.instance.cfg.NOISE_REDUCTION; } } } [HarmonyPatch(typeof(StartOfRound))] internal class StartOfRoundPatcher { [HarmonyPrefix] [HarmonyPatch("Start")] private static void InitLGUStore(PlayerControllerB __instance) { if (((NetworkBehaviour)__instance).NetworkManager.IsHost || ((NetworkBehaviour)__instance).NetworkManager.IsServer) { GameObject val = Object.Instantiate<GameObject>(UpgradeBus.instance.modStorePrefab); val.GetComponent<NetworkObject>().Spawn(false); } } [HarmonyPrefix] [HarmonyPatch("playersFiredGameOver")] private static void GameOverResetUpgradeManager(StartOfRound __instance) { if (((NetworkBehaviour)__instance).NetworkManager.IsHost || ((NetworkBehaviour)__instance).NetworkManager.IsServer) { LGUStore.instance.PlayersFiredServerRpc(); } } } [HarmonyPatch(typeof(TerminalAccessibleObject))] internal class TerminalAccessibleObjectPatcher { [HarmonyPrefix] [HarmonyPatch("CallFunctionFromTerminal")] private static bool DestroyObject(ref TerminalAccessibleObject __instance, ref float ___currentCooldownTimer, ref bool ___inCooldown) { //IL_006d: Unknown result type (might be due to invalid IL or missing references) if (!UpgradeBus.instance.DestroyTraps || ((Component)__instance).gameObject.layer != LayerMask.NameToLayer("MapHazards")) { return true; } if (UpgradeBus.instance.cfg.DESTROY_TRAP) { UpgradeBus.instance.trapHandler.ReqDestroyObjectServerRpc(new NetworkObjectReference(((Component)((Component)__instance).gameObject.transform.parent).gameObject.GetComponent<NetworkObject>())); return false; } if (!___inCooldown) { ___currentCooldownTimer = UpgradeBus.instance.cfg.DISARM_TIME; } return true; } } [HarmonyPatch(typeof(Terminal))] internal class TerminalPatcher { [HarmonyPostfix] [HarmonyPatch("Update")] private static void Counter() { if (UpgradeBus.instance.flashCooldown > 0f) { UpgradeBus.instance.flashCooldown -= Time.deltaTime; } } [HarmonyPostfix] [HarmonyPatch("ParsePlayerSentence")] private static void CustomParser(ref Terminal __instance, ref TerminalNode __result) { //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Expected O, but got Unknown //IL_00ee: 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_0121: Expected O, but got Unknown //IL_0128: 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_00aa: Expected O, but got Unknown //IL_0231: Unknown result type (might be due to invalid IL or missing references) //IL_0238: Expected O, but got Unknown //IL_042f: Unknown result type (might be due to invalid IL or missing references) //IL_0436: Expected O, but got Unknown //IL_03ef: Unknown result type (might be due to invalid IL or missing references) //IL_03f6: Expected O, but got Unknown //IL_02a9: Unknown result type (might be due to invalid IL or missing references) //IL_02b0: Expected O, but got Unknown //IL_026d: Unknown result type (might be due to invalid IL or missing references) //IL_0274: Expected O, but got Unknown //IL_035e: Unknown result type (might be due to invalid IL or missing references) //IL_0365: Expected O, but got Unknown //IL_0324: Unknown result type (might be due to invalid IL or missing references) //IL_032b: Expected O, but got Unknown //IL_051f: Unknown result type (might be due to invalid IL or missing references) //IL_0526: Expected O, but got Unknown //IL_05d5: Unknown result type (might be due to invalid IL or missing references) //IL_05dc: Expected O, but got Unknown //IL_061d: Unknown result type (might be due to invalid IL or missing references) //IL_0624: Expected O, but got Unknown //IL_06bd: Unknown result type (might be due to invalid IL or missing references) //IL_06c4: Expected O, but got Unknown //IL_0748: Unknown result type (might be due to invalid IL or missing references) //IL_074f: Expected O, but got Unknown //IL_0951: Unknown result type (might be due to invalid IL or missing references) //IL_0958: Expected O, but got Unknown string text = __instance.screenText.text.Substring(__instance.screenText.text.Length - __instance.textAdded); if (text.ToLower() == "initattack" || text.ToLower() == "atk") { if (!UpgradeBus.instance.terminalFlash) { TerminalNode val = new TerminalNode(); val.displayText = "You don't have access to this command yet. Purchase the 'Discombobulator'."; val.clearPreviousText = true; __result = val; return; } if (UpgradeBus.instance.flashCooldown > 0f) { TerminalNode val2 = new TerminalNode(); val2.displayText = $"You can discombobulate again in {Mathf.Round(UpgradeBus.instance.flashCooldown)} seconds.\nType 'cooldown' or 'cd' to check discombobulation cooldown."; val2.clearPreviousText = true; __result = val2; return; } RoundManager.Instance.PlayAudibleNoise(((Component)__instance).transform.position, 60f, 0.8f, 0, false, 14155); UpgradeBus.instance.flashScript.PlayAudioAndUpdateCooldownServerRpc(); TerminalNode val3 = new TerminalNode(); Collider[] array = Physics.OverlapSphere(((Component)__instance).transform.position, UpgradeBus.instance.cfg.DISCOMBOBULATOR_RADIUS, 524288); if (array.Length != 0) { val3.displayText = $"Stun grenade hit {array.Length} enemies."; val3.clearPreviousText = true; __result = val3; if (UpgradeBus.instance.cfg.DISCOMBOBULATOR_NOTIFY_CHAT) { ((MonoBehaviour)__instance).StartCoroutine(CountDownChat(UpgradeBus.instance.cfg.DISCOMBOBULATOR_STUN_DURATION + UpgradeBus.instance.cfg.DISCOMBOBULATOR_INCREMENT * (float)UpgradeBus.instance.discoLevel)); } } else { val3.displayText = "No stunned enemies detected."; val3.clearPreviousText = true; __result = val3; } return; } if (text.ToLower() == "cooldown" || text.ToLower() == "cd") { if (!UpgradeBus.instance.terminalFlash) { TerminalNode val4 = new TerminalNode(); val4.displayText = "You don't have access to this command yet. Purchase 'Discombobulator'."; val4.clearPreviousText = true; __result = val4; } else if (UpgradeBus.instance.flashCooldown > 0f) { TerminalNode val5 = new TerminalNode(); val5.displayText = $"You can discombobulate again in {Mathf.Round(UpgradeBus.instance.flashCooldown)} seconds."; val5.clearPreviousText = true; __result = val5; } else { TerminalNode val6 = new TerminalNode(); val6.displayText = "Discombobulate is ready, Type 'initattack' or 'atk' to execute."; val6.clearPreviousText = true; __result = val6; } return; } if (text.Split()[0].ToLower() == "page") { string[] array2 = text.Split(); if (UpgradeBus.instance.pager) { if (array2.Length == 1) { TerminalNode val7 = new TerminalNode(); val7.displayText = "You have to enter a message to broadcast\nEX: `page get back to the ship!`"; val7.clearPreviousText = true; __result = val7; return; } string text2 = string.Join(" ", array2.Skip(1)); TerminalNode val8 = new TerminalNode(); val8.clearPreviousText = true; if (UpgradeBus.instance.pageScript.isOnCooldown) { val8.displayText = $"Pager is on cooldown for {UpgradeBus.instance.pageScript.remainingCooldownTime} seconds!"; } else { UpgradeBus.instance.pageScript.ReqBroadcastChatServerRpc(text2); val8.displayText = $"Broadcasted message: '{text2}'\n\nPager is now on cooldown for {UpgradeBus.instance.pageScript.cooldownDuration}"; } __result = val8; } else { TerminalNode val9 = new TerminalNode(); val9.displayText = "You don't have access to this command.\nPurchase the pager from lategame store."; val9.clearPreviousText = true; __result = val9; } return; } if (text.ToLower() == "lategame") { TerminalNode val10 = new TerminalNode(); val10.clearPreviousText = true; val10.displayText = "Late Game Upgrades\n\nType `lategame store` or `lgu` to view upgrades.\n\nMost of the mod is configurable via the config file in `BepInEx/config/`."; val10.displayText += "\n\nUse the info command to get info about an item. EX: `info beekeeper`."; val10.displayText += "\n\nYou must type the exact name of the upgrade (case insensitve)."; val10.displayText += "\n\nTo force wipe an lgu save file type `reset lgu`. (will only wipe the clients save)."; val10.displayText += "\n\nTo reapply any upgrades that failed to app
BepInEx/plugins/MassiveNewCoilers-FixCentipedeLag/LC_Optim.dll
Decompiled a year agousing System; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using HarmonyLib; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = "")] [assembly: AssemblyCompany("LC_Optim")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyDescription("Source moment")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("LC_Optim")] [assembly: AssemblyTitle("LC_Optim")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] namespace LC_Optim; [BepInPlugin("mnc.fixcentipedelag", "FixCentipedeLag", "2023.12.7")] public class Plugin : BaseUnityPlugin { private Harmony thisHarmony; private static Dictionary<int, ulong> instanceMap = new Dictionary<int, ulong>(); private static ulong deadtimer = 100uL; private static ManualLogSource Log; private static ConfigEntry<bool> configShowDebug; private static void Debug(object data, LogLevel logLevel = 16) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) if (configShowDebug.Value) { Log.Log(logLevel, data); } } private void Awake() { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Expected O, but got Unknown //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Expected O, but got Unknown configShowDebug = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "Enable debug printing", true, "Enabling this will show debug info in console, e.g. when a new centipede gets tracked or removed."); thisHarmony = new Harmony("mnc.fixcentipedelag"); thisHarmony.Patch((MethodBase)typeof(CentipedeAI).GetMethod("DoAIInterval"), new HarmonyMethod(typeof(Plugin), "RemoveLagCentipede", (Type[])null), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); Debug("Registered the patch method", (LogLevel)4); Log = ((BaseUnityPlugin)this).Logger; } public static void RemoveLagCentipede(CentipedeAI __instance) { if (((EnemyAI)__instance).TargetClosestPlayer(1.5f, false, 70f)) { return; } int instanceID = ((Object)__instance).GetInstanceID(); ulong num = (ulong)Time.frameCount; if (!instanceMap.ContainsKey(instanceID)) { instanceMap.Add(instanceID, num); Debug($"Tracked {instanceID}", (LogLevel)16); return; } ulong num2 = instanceMap[instanceID]; if (num - num2 <= deadtimer) { ((EnemyAI)__instance).KillEnemy(true); instanceMap.Remove(instanceID); Debug($"Removed centipede at {instanceID}", (LogLevel)16); } else { instanceMap[instanceID] = num; } } public void OnDestroy() { thisHarmony.UnpatchSelf(); } } internal class PluginMetadata { public const string PLUGIN_GUID = "mnc.fixcentipedelag"; public const string PLUGIN_NAME = "FixCentipedeLag"; public const string PLUGIN_VERSION = "2023.12.7"; } public static class MyPluginInfo { public const string PLUGIN_GUID = "LC_Optim"; public const string PLUGIN_NAME = "LC_Optim"; public const string PLUGIN_VERSION = "1.0.0"; }
BepInEx/plugins/Midge-PushCompany/PushCompany/PushCompany.dll
Decompiled a year agousing System; using System.CodeDom.Compiler; using System.Collections; using System.Collections.Generic; using System.ComponentModel; using System.Diagnostics; using System.Globalization; using System.Reflection; using System.Resources; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using GameNetcodeStuff; using HarmonyLib; using Microsoft.CodeAnalysis; using PushCompany.Assets.Scripts; using PushCompany.Properties; using Unity.Netcode; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("PushCompany")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyDescription("Push your fellow crewmates with the interaction key! (E by default)")] [assembly: AssemblyFileVersion("1.2.0.0")] [assembly: AssemblyInformationalVersion("1.2.0")] [assembly: AssemblyProduct("PushCompany")] [assembly: AssemblyTitle("PushCompany")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.2.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] internal class <Module> { static <Module>() { NetworkVariableSerializationTypes.InitializeSerializer_UnmanagedByMemcpy<float>(); NetworkVariableSerializationTypes.InitializeEqualityChecker_UnmanagedIEquatable<float>(); } } 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; } } } namespace PushCompany { [BepInPlugin("PushCompany", "PushCompany", "1.2.0")] public class PushCompanyBase : BaseUnityPlugin { public static readonly Lazy<PushCompanyBase> Instance = new Lazy<PushCompanyBase>(() => new PushCompanyBase()); public static GameObject pushPrefab; public ManualLogSource mls; private readonly Harmony harmony = new Harmony("PushCompany"); public static ConfigEntry<float> config_PushCooldown; public static ConfigEntry<float> config_PushForce; public static ConfigEntry<float> config_PushRange; public static ConfigEntry<float> config_PushCost; private void Awake() { mls = Logger.CreateLogSource("PushCompany"); ConfigSetup(); LoadBundle(); harmony.PatchAll(typeof(PushCompanyBase)); harmony.PatchAll(typeof(PlayerControllerB_Patches)); harmony.PatchAll(typeof(NetworkHandler)); 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); } } } mls.LogInfo((object)"PushCompany has initialized!"); } private void ConfigSetup() { config_PushCooldown = ((BaseUnityPlugin)this).Config.Bind<float>("Push Cooldown", "Value", 0.025f, "How long until the player can push again"); config_PushForce = ((BaseUnityPlugin)this).Config.Bind<float>("Push Force", "Value", 12.5f, "How strong the player pushes."); config_PushRange = ((BaseUnityPlugin)this).Config.Bind<float>("Push Range", "Value", 3f, "The distance the player is able to push."); config_PushCost = ((BaseUnityPlugin)this).Config.Bind<float>("Push Cost", "Value", 0.08f, "The energy cost of each push."); } private void LoadBundle() { AssetBundle val = AssetBundle.LoadFromMemory(Resources.pushcompany); if ((Object)(object)val == (Object)null) { throw new Exception("Failed to load Push Bundle!"); } pushPrefab = val.LoadAsset<GameObject>("Assets/Push.prefab"); if ((Object)(object)pushPrefab == (Object)null) { throw new Exception("Failed to load Push Prefab!"); } pushPrefab.AddComponent<PushComponent>(); } } public static class PluginInfo { public const string PLUGIN_GUID = "PushCompany"; public const string PLUGIN_NAME = "PushCompany"; public const string PLUGIN_VERSION = "1.2.0"; } } namespace PushCompany.Properties { [GeneratedCode("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] [DebuggerNonUserCode] [CompilerGenerated] internal class Resources { private static ResourceManager resourceMan; private static CultureInfo resourceCulture; [EditorBrowsable(EditorBrowsableState.Advanced)] internal static ResourceManager ResourceManager { get { if (resourceMan == null) { ResourceManager resourceManager = new ResourceManager("PushCompany.Properties.Resources", typeof(Resources).Assembly); resourceMan = resourceManager; } return resourceMan; } } [EditorBrowsable(EditorBrowsableState.Advanced)] internal static CultureInfo Culture { get { return resourceCulture; } set { resourceCulture = value; } } internal static byte[] AssetBundles { get { object @object = ResourceManager.GetObject("AssetBundles", resourceCulture); return (byte[])@object; } } internal static byte[] AssetBundles_manifest { get { object @object = ResourceManager.GetObject("AssetBundles.manifest", resourceCulture); return (byte[])@object; } } internal static byte[] AssetBundles1 { get { object @object = ResourceManager.GetObject("AssetBundles1", resourceCulture); return (byte[])@object; } } internal static byte[] AssetBundles2 { get { object @object = ResourceManager.GetObject("AssetBundles2", resourceCulture); return (byte[])@object; } } internal static byte[] pushcompany { get { object @object = ResourceManager.GetObject("pushcompany", resourceCulture); return (byte[])@object; } } internal static byte[] pushcompany_push { get { object @object = ResourceManager.GetObject("pushcompany.push", resourceCulture); return (byte[])@object; } } internal static byte[] pushcompany_push_manifest { get { object @object = ResourceManager.GetObject("pushcompany.push.manifest", resourceCulture); return (byte[])@object; } } internal static byte[] pushcompany_push1 { get { object @object = ResourceManager.GetObject("pushcompany.push1", resourceCulture); return (byte[])@object; } } internal Resources() { } } } namespace PushCompany.Assets.Scripts { [HarmonyPatch] public class NetworkHandler { private static GameObject pushObject; [HarmonyPrefix] [HarmonyPatch(typeof(GameNetworkManager), "Start")] private static void Init() { NetworkManager.Singleton.AddNetworkPrefab(PushCompanyBase.pushPrefab); } [HarmonyPostfix] [HarmonyPatch(typeof(StartOfRound), "Awake")] private static void SpawnNetworkPrefab() { try { if (NetworkManager.Singleton.IsServer) { pushObject = Object.Instantiate<GameObject>(PushCompanyBase.pushPrefab); pushObject.GetComponent<NetworkObject>().Spawn(true); } } catch { PushCompanyBase.Instance.Value.mls.LogError((object)"Failed to instantiate network prefab!"); } } } [HarmonyPatch(typeof(PlayerControllerB))] public static class PlayerControllerB_Patches { private static PushComponent pushComponent; [HarmonyPostfix] [HarmonyPatch(typeof(PlayerControllerB), "Update")] private static void Update(PlayerControllerB __instance) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) if (!((NetworkBehaviour)__instance).IsOwner) { return; } MovementActions movement = __instance.playerActions.Movement; if (((MovementActions)(ref movement)).Interact.WasPressedThisFrame()) { if ((Object)(object)pushComponent == (Object)null) { pushComponent = Object.FindObjectOfType<PushComponent>(); } if ((Object)(object)pushComponent != (Object)null) { pushComponent.PushServerRpc(((NetworkBehaviour)__instance).NetworkObjectId); } } } } public class PushComponent : NetworkBehaviour { private Dictionary<ulong, float> lastPushTimes = new Dictionary<ulong, float>(); private NetworkVariable<float> PushCooldown = new NetworkVariable<float>(0f, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); private NetworkVariable<float> PushRange = new NetworkVariable<float>(0f, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); private NetworkVariable<float> PushForce = new NetworkVariable<float>(0f, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); private NetworkVariable<float> PushCost = new NetworkVariable<float>(0f, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); public override void OnNetworkSpawn() { if (((NetworkBehaviour)this).IsServer) { PushCooldown.Value = PushCompanyBase.config_PushCooldown.Value; PushRange.Value = PushCompanyBase.config_PushRange.Value; PushForce.Value = PushCompanyBase.config_PushForce.Value; PushCost.Value = PushCompanyBase.config_PushCost.Value; } } [ServerRpc(RequireOwnership = false)] public void PushServerRpc(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_0151: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_0167: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Unknown result type (might be due to invalid IL or missing references) //IL_0193: Unknown result type (might be due to invalid IL or missing references) //IL_0198: Unknown result type (might be due to invalid IL or missing references) //IL_01df: Unknown result type (might be due to invalid IL or missing references) //IL_01ec: Unknown result type (might be due to invalid IL or missing references) //IL_01f6: 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 val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2433198804u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, playerId); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2433198804u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 1 || (!networkManager.IsServer && !networkManager.IsHost)) { return; } if (lastPushTimes.TryGetValue(playerId, out var value)) { if (Time.time - value < PushCooldown.Value) { return; } } else { lastPushTimes.Add(playerId, 0f); } GameObject playerById = GetPlayerById(playerId); PlayerControllerB component = playerById.GetComponent<PlayerControllerB>(); Camera gameplayCamera = component.gameplayCamera; if (!CanPushPlayer(component)) { return; } int num = 1 << playerById.layer; Vector3 forward = ((Component)gameplayCamera).transform.forward; Vector3 normalized = ((Vector3)(ref forward)).normalized; RaycastHit[] array = Physics.RaycastAll(((Component)gameplayCamera).transform.position, normalized, PushRange.Value, num); RaycastHit[] array2 = array; for (int i = 0; i < array2.Length; i++) { RaycastHit val3 = array2[i]; if ((Object)(object)((Component)((RaycastHit)(ref val3)).transform).gameObject != (Object)(object)playerById) { PlayerControllerB component2 = ((Component)((RaycastHit)(ref val3)).transform).GetComponent<PlayerControllerB>(); if (!component2.inSpecialInteractAnimation) { PushClientRpc(((NetworkBehaviour)component).NetworkObjectId, ((NetworkBehaviour)component2).NetworkObjectId, normalized * PushForce.Value * Time.fixedDeltaTime); lastPushTimes[playerId] = Time.time; } break; } } } [ClientRpc] private void PushClientRpc(ulong pusherId, ulong playerId, Vector3 push) { //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_007e: 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_00f9: 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 != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3498116674u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, pusherId); BytePacker.WriteValueBitPacked(val2, playerId); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref push); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3498116674u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost)) { GameObject playerById = GetPlayerById(playerId); PlayerControllerB component = playerById.GetComponent<PlayerControllerB>(); ((MonoBehaviour)this).StartCoroutine(SmoothMove(component.thisController, push)); component.movementAudio.PlayOneShot(StartOfRound.Instance.playerJumpSFX); GameObject playerById2 = GetPlayerById(pusherId); PlayerControllerB component2 = playerById2.GetComponent<PlayerControllerB>(); component2.sprintMeter = Mathf.Clamp(component2.sprintMeter - PushCost.Value, 0f, 1f); } } } public IEnumerator SmoothMove(CharacterController controller, Vector3 push) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) float force = PushForce.Value / 12.5f; float smoothTime = ((Vector3)(ref push)).magnitude / force; Vector3 targetPosition = ((Component)controller).transform.position + push; Vector3 val = targetPosition - ((Component)controller).transform.position; Vector3 direction = ((Vector3)(ref val)).normalized; float distance = Vector3.Distance(((Component)controller).transform.position, targetPosition); for (float currentTime = 0f; currentTime < smoothTime; currentTime += Time.fixedDeltaTime) { float currentDistance = distance * Mathf.Min(currentTime, smoothTime) / smoothTime; controller.Move(direction * currentDistance); yield return null; } } private bool CanPushPlayer(PlayerControllerB player) { return !player.quickMenuManager.isMenuOpen && !player.inSpecialInteractAnimation && !player.isTypingChat && !player.isExhausted; } private static GameObject GetPlayerById(ulong playerId) { if (NetworkManager.Singleton.SpawnManager.SpawnedObjects.TryGetValue(playerId, out var value)) { return ((Component)value).gameObject; } return null; } protected override void __initializeVariables() { if (PushCooldown == null) { throw new Exception("PushComponent.PushCooldown cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)PushCooldown).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)PushCooldown, "PushCooldown"); base.NetworkVariableFields.Add((NetworkVariableBase)(object)PushCooldown); if (PushRange == null) { throw new Exception("PushComponent.PushRange cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)PushRange).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)PushRange, "PushRange"); base.NetworkVariableFields.Add((NetworkVariableBase)(object)PushRange); if (PushForce == null) { throw new Exception("PushComponent.PushForce cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)PushForce).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)PushForce, "PushForce"); base.NetworkVariableFields.Add((NetworkVariableBase)(object)PushForce); if (PushCost == null) { throw new Exception("PushComponent.PushCost cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)PushCost).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)PushCost, "PushCost"); base.NetworkVariableFields.Add((NetworkVariableBase)(object)PushCost); ((NetworkBehaviour)this).__initializeVariables(); } [RuntimeInitializeOnLoadMethod] internal static void InitializeRPCS_PushComponent() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown NetworkManager.__rpc_func_table.Add(2433198804u, new RpcReceiveHandler(__rpc_handler_2433198804)); NetworkManager.__rpc_func_table.Add(3498116674u, new RpcReceiveHandler(__rpc_handler_3498116674)); } private static void __rpc_handler_2433198804(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; ((PushComponent)(object)target).PushServerRpc(playerId); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3498116674(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_0050: 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 pusherId = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref pusherId); ulong playerId = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref playerId); Vector3 push = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref push); target.__rpc_exec_stage = (__RpcExecStage)2; ((PushComponent)(object)target).PushClientRpc(pusherId, playerId, push); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "PushComponent"; } } }
BepInEx/plugins/Mischief-UnlimitedPaint/UnlimitedPaint.dll
Decompiled a year agousing System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using HarmonyLib; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("UnlimitedPaint")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("UnlimitedPaint")] [assembly: AssemblyCopyright("Copyright © 2023")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("825109f0-f89a-4b7f-9eb7-db193fe68fa8")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyVersion("1.0.0.0")] namespace UnlimitedPaint; [BepInPlugin("Maran.UnlimitedPaintMod", "Unlimited Paint", "1.0.0.0")] public class UnlimitedPaintMain : BaseUnityPlugin { private const string guid = "Maran.UnlimitedPaintMod"; private const string name = "Unlimited Paint"; private const string version = "1.0.0.0"; private readonly Harmony harmony = new Harmony("Maran.UnlimitedPaintMod"); private static UnlimitedPaintMain instance; public static ManualLogSource logger; public static ConfigFile config; private void Awake() { instance = this; logger = Logger.CreateLogSource("Maran.UnlimitedPaintMod"); config = ((BaseUnityPlugin)this).Config; PluginConfig.Load(); logger.LogInfo((object)"Paint cans are ready!"); harmony.PatchAll(); } } internal class PluginConfig { public static ConfigEntry<bool> requireShaking; public static void Load() { requireShaking = UnlimitedPaintMain.config.Bind<bool>("Main", "Require Shaking", false, "Is shaking the Paint Can still required to refill it?"); } } [HarmonyPatch(typeof(SprayPaintItem))] internal class SprayPaintUpdatePatch { [HarmonyPatch("LateUpdate")] [HarmonyPostfix] private static void sprayPaintUpdatePatch(ref float ___sprayCanTank, ref float ___sprayCanShakeMeter) { ___sprayCanTank = 1f; if (!PluginConfig.requireShaking.Value) { ___sprayCanShakeMeter = 1f; } } }
BepInEx/plugins/MoreLethal-Pinger/Pinger.dll
Decompiled a year agousing System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using System.Threading.Tasks; using BepInEx; using GameNetcodeStuff; using HarmonyLib; using LC_API.ServerAPI; using Microsoft.CodeAnalysis; using Newtonsoft.Json; using Pinger.Overrider; using Unity.Netcode; using UnityEngine; using UnityEngine.InputSystem; using UnityEngine.InputSystem.Controls; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("Pinger")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyDescription("Pings Player")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("Pinger")] [assembly: AssemblyTitle("Pinger")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.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; } } } namespace Pinger { internal struct CustomScanNode { public long created { get; set; } public ScanNodeProperties scanNode { get; set; } public string owner { get; set; } } [JsonObject(/*Could not decode attribute arguments.*/)] internal class PingData { [JsonProperty] public float x { get; set; } [JsonProperty] public float y { get; set; } [JsonProperty] public float z { get; set; } [JsonProperty] public long created { get; set; } [JsonProperty] public string owner { get; set; } [JsonProperty] public bool isDanger { get; set; } } [BepInPlugin("Pinger", "Pinger", "1.0.0")] public class Plugin : BaseUnityPlugin { private const string SIGNATURE = "player_ping"; private const int LIFESPAN = 10000; private Harmony _harmony; private ScanNodeProperties _scanNodeMaster; private LinkedList<CustomScanNode> _scanNodes = new LinkedList<CustomScanNode>(); private static bool _isPatched; private static bool _isPatching; private static PlayerControllerB _mainPlayer; private static HUDManager _hudManager; public static Plugin Instance { get; private set; } private void Awake() { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Expected O, but got Unknown Instance = this; ((BaseUnityPlugin)this).Logger.LogInfo((object)"Plugin Pinger is loaded!"); _harmony = new Harmony("Pinger"); _harmony.PatchAll(typeof(StartOfRound_Awake)); _harmony.PatchAll(typeof(KeyboardPing)); StartLogicLoop(); } private async void StartLogicLoop() { while ((Object)(object)StartOfRound.Instance == (Object)null) { await Task.Delay(1000); } ((BaseUnityPlugin)this).Logger.LogInfo((object)"StartOfRound.Instance found..."); _mainPlayer = StartOfRound.Instance.localPlayerController; while ((Object)(object)_mainPlayer == (Object)null) { await Task.Delay(250); _mainPlayer = StartOfRound.Instance.localPlayerController; } while ((Object)(object)_hudManager == (Object)null) { await Task.Delay(250); _hudManager = HUDManager.Instance; } _isPatched = true; handleIncomingPings(); } private void handleIncomingPings() { Networking.GetString = (Action<string, string>)Delegate.Combine(Networking.GetString, (Action<string, string>)delegate(string message, string signature) { //IL_009e: Unknown result type (might be due to invalid IL or missing references) if (signature.Equals("player_ping")) { PingData pingData = JsonConvert.DeserializeObject<PingData>(message); if (pingData == null) { ((BaseUnityPlugin)this).Logger.LogWarning((object)"Failed to parse ping data"); } else { ((BaseUnityPlugin)this).Logger.LogMessage((object)$"Received ping from {pingData.owner} at {pingData.x} {pingData.y} {pingData.z}"); float x = pingData.x; float y = pingData.y; float z = pingData.z; RaycastHit hit = default(RaycastHit); createPing(x, y, z, in hit, pingData.isDanger, pingData.owner); } } }); } private void DeletePings(string owner) { //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) ScanNodeProperties[] array = Object.FindObjectsByType<ScanNodeProperties>((FindObjectsSortMode)0); for (LinkedListNode<CustomScanNode> linkedListNode = _scanNodes.First; linkedListNode != null; linkedListNode = linkedListNode.Next) { if (!((Object)(object)linkedListNode.Value.scanNode == (Object)null)) { if (linkedListNode.Value.owner != owner) { Debug.Log((object)$"Skipping ping at {((Component)linkedListNode.Value.scanNode).transform.position} (Predicate failed: {linkedListNode.Value.owner} != {owner})"); } else { Debug.Log((object)$"Deleting ping at {((Component)linkedListNode.Value.scanNode).transform.position}"); Object.Destroy((Object)(object)linkedListNode.Value.scanNode); for (int i = 0; i < array.Length; i++) { if (((Component)array[i]).transform.position == ((Component)linkedListNode.Value.scanNode).transform.position) { Object.Destroy((Object)(object)array[i]); break; } } } } } } private async void checkAndDeleteOldPings() { int lifespan = 10000; while (true) { await Task.Delay(1000); long now = DateTimeOffset.Now.ToUnixTimeMilliseconds(); for (LinkedListNode<CustomScanNode> node = _scanNodes.First; node != null; node = node.Next) { if (!((Object)(object)node.Value.scanNode == (Object)null) && now - node.Value.created > lifespan) { ((BaseUnityPlugin)this).Logger.LogMessage((object)$"Deleting ping at {((Component)node.Value.scanNode).transform.position}"); Object.Destroy((Object)(object)node.Value.scanNode); _scanNodes.Remove(node); } } } } private void OnDestroy() { //IL_0038: 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) ScanNodeProperties[] array = Object.FindObjectsByType<ScanNodeProperties>((FindObjectsSortMode)0); for (LinkedListNode<CustomScanNode> linkedListNode = _scanNodes.First; linkedListNode != null; linkedListNode = linkedListNode.Next) { Object.Destroy((Object)(object)linkedListNode.Value.scanNode); for (int i = 0; i < array.Length; i++) { if (((Component)array[i]).transform.position == ((Component)linkedListNode.Value.scanNode).transform.position) { Object.Destroy((Object)(object)array[i]); break; } } } } public bool createPingWherePlayerIsLooking(bool is_danger = false) { //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_009e: 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_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: 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) if ((Object)(object)_mainPlayer == (Object)null || (Object)(object)_hudManager == (Object)null) { if (_isPatching) { return false; } StartLogicLoop(); _isPatching = true; return false; } float x = ((Component)_mainPlayer.gameplayCamera).transform.position.x; float y = ((Component)_mainPlayer.gameplayCamera).transform.position.y; float z = ((Component)_mainPlayer.gameplayCamera).transform.position.z; RaycastHit hit = shootRay(x, y, z); float x2 = ((RaycastHit)(ref hit)).point.x; float y2 = ((RaycastHit)(ref hit)).point.y; float z2 = ((RaycastHit)(ref hit)).point.z; ((BaseUnityPlugin)this).Logger.LogMessage((object)("Creating Ping on the surface of " + ((Object)((RaycastHit)(ref hit)).transform).name)); CustomScanNode customScanNode = createPing(x2, y2, z2, in hit, is_danger); if ((Object)(object)customScanNode.scanNode == (Object)null) { return false; } string text = JsonConvert.SerializeObject((object)new PingData { x = x2, y = y2, z = z2, created = customScanNode.created, owner = _mainPlayer.playerUsername, isDanger = is_danger }); Networking.Broadcast(text, "player_ping"); return true; } private CustomScanNode createPing(float x, float y, float z, in RaycastHit hit) { return createPing(x, y, z, in hit, isDanger: false, _mainPlayer.playerUsername); } private CustomScanNode createPing(float x, float y, float z, in RaycastHit hit, bool isDanger) { return createPing(x, y, z, in hit, isDanger, _mainPlayer.playerUsername); } private CustomScanNode createPing(float x, float y, float z, in RaycastHit hit, string playerName) { return createPing(x, y, z, in hit, isDanger: false, playerName); } private CustomScanNode createPing(float x, float y, float z, in RaycastHit hit, bool isDanger, string playerName) { //IL_00df: Unknown result type (might be due to invalid IL or missing references) if (hasPlayerPinged(playerName)) { DeletePings(playerName); } string headerText = playerName + "'s ping"; string subText = "Player Ping <!>"; ((BaseUnityPlugin)this).Logger.LogMessage((object)$"Creating Ping at : {x} {y} {z}"); ScanNodeProperties[] array = Object.FindObjectsByType<ScanNodeProperties>((FindObjectsSortMode)0); if ((Object)(object)_scanNodeMaster == (Object)null) { if (array.Length == 0) { ((BaseUnityPlugin)this).Logger.LogWarning((object)"No scan node master found"); return default(CustomScanNode); } _scanNodeMaster = array[0]; checkAndDeleteOldPings(); } ScanNodeProperties val = Object.Instantiate<ScanNodeProperties>(_scanNodeMaster); ((Object)val).name = "PlayerPing"; val.headerText = headerText; val.subText = subText; ((Component)val).transform.position = new Vector3(x, y, z); val.maxRange = 200; val.minRange = 0; val.requiresLineOfSight = true; if (isDanger) { val.nodeType = 1; val.subText = "DANGER <!>"; } else { val.nodeType = 2; } CustomScanNode customScanNode = default(CustomScanNode); long created = DateTimeOffset.Now.ToUnixTimeMilliseconds(); customScanNode.created = created; customScanNode.scanNode = val; customScanNode.owner = playerName; _scanNodes.AddLast(customScanNode); if ((Object)(object)_hudManager == (Object)null) { ((BaseUnityPlugin)this).Logger.LogWarning((object)"HUDManager is null"); } else if (customScanNode.owner == _mainPlayer.playerUsername) { _hudManager.UIAudio.PlayOneShot(_hudManager.scanSFX); } return customScanNode; } private bool hasPlayerPinged(string name) { for (LinkedListNode<CustomScanNode> linkedListNode = _scanNodes.First; linkedListNode != null; linkedListNode = linkedListNode.Next) { if (linkedListNode.Value.owner == name) { return true; } } return false; } private RaycastHit shootRay(float x, float y, float z) { //IL_0018: 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_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) //IL_002e: 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_0031: 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_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) float num = 2.5f; Transform transform = ((Component)_mainPlayer.gameplayCamera).transform; Vector3 val = transform.position + transform.forward * num; RaycastHit result = default(RaycastHit); Physics.Raycast(val, transform.forward, ref result, 1000f); return result; } } public static class PluginInfo { public const string PLUGIN_GUID = "Pinger"; public const string PLUGIN_NAME = "Pinger"; public const string PLUGIN_VERSION = "1.0.0"; } } namespace Pinger.Overrider { [HarmonyPatch(typeof(StartOfRound), "Awake")] internal class StartOfRound_Awake { [HarmonyPatch(typeof(StartOfRound), "Awake")] [HarmonyPrefix] private static bool Prefix() { Debug.Log((object)"StartOfRound.Awake() is called"); return true; } } [HarmonyPatch] internal class KeyboardPing { private static float lastQPress; private const float PING_RESET = 0.3f; private static bool isWaiting; private static bool pingPressed; private static IEnumerator WaitForNextQ() { if (!isWaiting) { isWaiting = true; yield return (object)new WaitForSeconds(0.3f); if (!pingPressed) { Plugin.Instance.createPingWherePlayerIsLooking(); } isWaiting = false; } } [HarmonyPatch(typeof(PlayerControllerB), "Update")] [HarmonyPostfix] private static void PingCommand(PlayerControllerB __instance) { long num = DateTimeOffset.Now.ToUnixTimeMilliseconds(); bool flag = false; if (!((NetworkBehaviour)__instance).IsOwner || !__instance.isPlayerControlled || __instance.inTerminalMenu || __instance.isTypingChat || __instance.isPlayerDead) { flag = true; } if (flag) { return; } if (((ButtonControl)Keyboard.current.qKey).wasPressedThisFrame) { if (!pingPressed) { pingPressed = true; ((MonoBehaviour)__instance).StartCoroutine(WaitForNextQ()); } else { bool flag2 = Plugin.Instance.createPingWherePlayerIsLooking(is_danger: true); } } else if (pingPressed) { lastQPress += Time.deltaTime; if (lastQPress >= 0.3f) { pingPressed = false; isWaiting = false; lastQPress = 0f; } } } } } namespace Pinger.CircleHelper { public static class Helper { private const string TAG = "[Pinger::CircleHelper]"; public static void debug_DisplayEntireComponentTree(Transform obj) { if ((Object)(object)obj == (Object)null) { return; } int childCount = obj.childCount; if (childCount > 0) { for (int i = 0; i < childCount; i++) { Transform child = obj.GetChild(i); Debug.Log((object)("[Pinger::CircleHelper]: " + ((Object)obj).name + "/" + ((Object)child).name)); debug_DisplayComponent(obj); debug_DisplayEntireComponentTree(child); } Debug.Log((object)("EOF - " + ((Object)obj).name)); } } private static void debug_DisplayComponent(Transform obj) { Debug.Log((object)string.Format("{0}: {1} :: typeof {2}", "[Pinger::CircleHelper]", ((Object)obj).name, ((object)obj).GetType())); } public static Transform debug_GrabInnerCircle(Transform obj) { if ((Object)(object)obj == (Object)null) { return null; } int childCount = obj.childCount; if (childCount <= 0) { return null; } Transform result = null; for (int i = 0; i < childCount; i++) { Transform child = obj.GetChild(i); if (((Object)child).name == "Inner") { result = child; break; } } return result; } } } namespace Pinger.Adder { internal static class Adder { public static void AddToClass<T>(this T obj, Action action) { obj.GetType().GetMethod("AddToClass").Invoke(obj, new object[1] { action }); } } }
BepInEx/plugins/NiceHairs-Symbiosis/Symbiosis.dll
Decompiled a year agousing System; using System.Collections; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using BepInEx.Logging; using HarmonyLib; using Symbiosis.Extensions; using Symbiosis.Patches; using Symbiosis.Utils; using Unity.Netcode; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: AssemblyTitle("Symbiosis")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("Symbiosis")] [assembly: AssemblyCopyright("Copyright © 2023")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("97f95e36-1154-479c-be65-4ef35b78018f")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")] [assembly: AssemblyVersion("1.0.0.0")] namespace Symbiosis { [BepInPlugin("niceh.Symbiosis", "Symbiosis", "1.0.2")] public class Plugin : BaseUnityPlugin { public const string GUID = "niceh.Symbiosis"; public const string Name = "Symbiosis"; public static Plugin Instance { get; private set; } public static ManualLogSource Log { get; private set; } private void Awake() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) Instance = this; Log = ((BaseUnityPlugin)this).Logger; Harmony val = new Harmony("niceh.Symbiosis"); val.PatchAll(typeof(Patch_HoarderBugAI)); val.PatchAll(typeof(Patch_ExtensionLadderItem)); val.PatchAll(typeof(Patch_StunGrenadeItem)); } } } namespace Symbiosis.Utils { public static class Util_GrabbableObject { public static HoarderBugAI FindHoarderBug(this GrabbableObject item) { if ((Object)(object)item.playerHeldBy != (Object)null) { return null; } HoarderBugAI[] array = Object.FindObjectsByType<HoarderBugAI>((FindObjectsSortMode)0); foreach (HoarderBugAI val in array) { if (val != null && val.heldItem != null && !((Object)(object)val.heldItem.itemGrabbableObject != (Object)(object)item)) { return val; } } return null; } } } namespace Symbiosis.Extensions { public static class Extension_HoarderBugAI { private static readonly MethodInfo info_DropItem = typeof(HoarderBugAI).GetMethod("DropItem", BindingFlags.Instance | BindingFlags.NonPublic); public static void DropItem(this HoarderBugAI bug, NetworkObject item, Vector3 targetFloorPosition, bool droppingInNest = true) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) info_DropItem?.Invoke(bug, new object[3] { item, targetFloorPosition, droppingInNest }); } } public static class Extension_StunGrenadeItem { public static readonly FieldInfo info_pullPinCoroutine = typeof(StunGrenadeItem).GetField("pullPinCoroutine", BindingFlags.Instance | BindingFlags.NonPublic); public static void SetPullPinCoroutine(this StunGrenadeItem item, Coroutine coroutine) { info_pullPinCoroutine?.SetValue(item, coroutine); } public static Coroutine GetPullPinCoroutine(this StunGrenadeItem item) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Expected O, but got Unknown return (Coroutine)(info_pullPinCoroutine?.GetValue(item)); } public static IEnumerator NoPlayerPullPinAnimation(this StunGrenadeItem item) { item.inPullingPinAnimation = true; item.itemAnimator.SetTrigger("pullPin"); item.itemAudio.PlayOneShot(item.pullPinSFX); WalkieTalkie.TransmitOneShotAudio(item.itemAudio, item.pullPinSFX, 0.8f); yield return (object)new WaitForSeconds(1f); item.inPullingPinAnimation = false; item.pinPulled = true; ((GrabbableObject)item).itemUsedUp = true; } } } namespace Symbiosis.Patches { internal static class Patch_ExtensionLadderItem { [HarmonyPatch(typeof(ExtensionLadderItem), "ItemActivate")] [HarmonyPrefix] private static bool ItemActivate(ExtensionLadderItem __instance) { //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)((GrabbableObject)__instance).playerHeldBy != (Object)null) { return true; } Plugin.Log.LogInfo((object)"ITEM IS NOT HELD BY PLAYER"); if (!((NetworkBehaviour)__instance).IsOwner) { return true; } Plugin.Log.LogInfo((object)"ITEM IS OWNER"); HoarderBugAI val = ((GrabbableObject)(object)__instance).FindHoarderBug(); if (val == null) { Plugin.Log.LogInfo((object)"NO BUG FOUND"); return false; } Plugin.Log.LogInfo((object)"DROPPING LADDER"); val.DropItem(((Component)__instance).GetComponent<NetworkObject>(), ((GrabbableObject)__instance).GetItemFloorPosition(default(Vector3)), droppingInNest: false); return false; } } internal static class Patch_HoarderBugAI { private static readonly Random _rand = new Random(); [HarmonyPatch(typeof(HoarderBugAI), "Start")] [HarmonyPrefix] private static void Start(HoarderBugAI __instance) { ((MonoBehaviour)__instance).StartCoroutine(HoarderBugUseItem(__instance)); } private static IEnumerator HoarderBugUseItem(HoarderBugAI bug) { while (((Behaviour)bug).isActiveAndEnabled) { try { if (!((EnemyAI)bug).inSpecialAnimation && !((EnemyAI)bug).isEnemyDead && !StartOfRound.Instance.allPlayersDead && bug.heldItem != null && (Object)(object)bug.heldItem.itemGrabbableObject != (Object)null) { ManualLogSource log = Plugin.Log; HoarderBugItem heldItem = bug.heldItem; log.LogInfo((object)("USING " + ((heldItem != null) ? ((Object)heldItem.itemGrabbableObject.itemProperties).name : null))); bug.heldItem.itemGrabbableObject.UseItemOnClient(_rand.Next(3) != 0); } } catch (Exception ex) { Plugin.Log.LogError((object)ex); } yield return (object)new WaitForSeconds((float)_rand.Next(20)); } } } internal static class Patch_StunGrenadeItem { [HarmonyPatch(typeof(StunGrenadeItem), "ItemActivate")] [HarmonyPrefix] private static bool ItemActivate(StunGrenadeItem __instance) { if ((Object)(object)((GrabbableObject)__instance).playerHeldBy != (Object)null) { return true; } Plugin.Log.LogInfo((object)"ITEM IS NOT HELD BY PLAYER"); if (__instance.inPullingPinAnimation) { return true; } Plugin.Log.LogInfo((object)"ITEM IS IN PULLING ANIMATION"); if (__instance.GetPullPinCoroutine() != null) { return true; } Plugin.Log.LogInfo((object)"ITEM HAS NO COROUTINE: STARTING NO PLAYER PULLING PIN ANIMATION"); __instance.SetPullPinCoroutine(((MonoBehaviour)__instance).StartCoroutine(__instance.NoPlayerPullPinAnimation())); return false; } } }
BepInEx/plugins/NotAtomicBomb-TerminalApi/TerminalApi.dll
Decompiled a year agousing System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Logging; using HarmonyLib; using Microsoft.CodeAnalysis; using TMPro; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETFramework,Version=v4.6", FrameworkDisplayName = ".NET Framework 4.6")] [assembly: AssemblyCompany("NotAtomicBomb")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyDescription("Terminal Api for the terminal in Lethal Company")] [assembly: AssemblyFileVersion("1.4.0.0")] [assembly: AssemblyInformationalVersion("1.4.0+b87452af897d2b57619d1b55b8887fd436be901a")] [assembly: AssemblyProduct("TerminalApi")] [assembly: AssemblyTitle("TerminalApi")] [assembly: AssemblyMetadata("RepositoryUrl", "https://github.com/NotAtomicBomb/TerminalApi")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.4.0.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; } } } namespace TerminalApi { internal class DelayedAction { internal Action<TerminalKeyword> Action { get; set; } internal TerminalKeyword Keyword { get; set; } internal void Run() { Action(Keyword); } } [BepInPlugin("atomic.terminalapi", "Terminal Api", "1.3.0")] public class Plugin : BaseUnityPlugin { public ManualLogSource Log = new ManualLogSource("Terminal Api"); private void Awake() { ((BaseUnityPlugin)this).Logger.LogInfo((object)"Plugin TerminalApi is loaded!"); Logger.Sources.Add((ILogSource)(object)Log); TerminalApi.plugin = this; Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly(), (string)null); } } public static class TerminalApi { public static Plugin plugin; internal static List<DelayedAction> QueuedActions = new List<DelayedAction>(); public static Terminal Terminal { get; internal set; } public static string CurrentText => Terminal.currentText; public static TMP_InputField ScreenText => Terminal.screenText; public static bool IsInGame() { try { return Terminal != null; } catch (NullReferenceException) { return false; } } public static void AddCommand(string commandWord, string displayText, string verbWord = null, bool clearPreviousText = true) { commandWord = commandWord.ToLower(); TerminalKeyword val = CreateTerminalKeyword(commandWord); TerminalNode val2 = CreateTerminalNode(displayText, clearPreviousText); if (verbWord != null) { verbWord = verbWord.ToLower(); TerminalKeyword terminalKeyword = CreateTerminalKeyword(verbWord, isVerb: true); AddTerminalKeyword(val.defaultVerb = terminalKeyword.AddCompatibleNoun(val, val2)); AddTerminalKeyword(val); } else { val.specialKeywordResult = val2; AddTerminalKeyword(val); } } public static TerminalKeyword CreateTerminalKeyword(string word, bool isVerb = false, TerminalNode triggeringNode = null) { TerminalKeyword obj = ScriptableObject.CreateInstance<TerminalKeyword>(); obj.word = word.ToLower(); obj.isVerb = isVerb; obj.specialKeywordResult = triggeringNode; return obj; } public static TerminalKeyword CreateTerminalKeyword(string word, string displayText, bool clearPreviousText = false, string terminalEvent = "") { TerminalKeyword obj = ScriptableObject.CreateInstance<TerminalKeyword>(); obj.word = word.ToLower(); obj.isVerb = false; obj.specialKeywordResult = CreateTerminalNode(displayText, clearPreviousText, terminalEvent); return obj; } public static TerminalNode CreateTerminalNode(string displayText, bool clearPreviousText = false, string terminalEvent = "") { TerminalNode obj = ScriptableObject.CreateInstance<TerminalNode>(); obj.displayText = displayText; obj.clearPreviousText = clearPreviousText; obj.terminalEvent = terminalEvent; return obj; } public static void AddTerminalKeyword(TerminalKeyword terminalKeyword) { if (IsInGame()) { if (GetKeyword(terminalKeyword.word) == null) { Terminal.terminalNodes.allKeywords = Terminal.terminalNodes.allKeywords.Add(terminalKeyword); plugin.Log.LogMessage((object)("Added " + terminalKeyword.word + " keyword to terminal keywords.")); } else { plugin.Log.LogWarning((object)("Failed to add " + terminalKeyword.word + " keyword. Already exists.")); } } else { plugin.Log.LogMessage((object)("Not in game, waiting to be in game to add " + terminalKeyword.word + " keyword.")); Action<TerminalKeyword> action = AddTerminalKeyword; DelayedAction item = new DelayedAction { Action = action, Keyword = terminalKeyword }; QueuedActions.Add(item); } } public static TerminalKeyword GetKeyword(string keyword) { if (IsInGame()) { return ((IEnumerable<TerminalKeyword>)Terminal.terminalNodes.allKeywords).FirstOrDefault((Func<TerminalKeyword, bool>)((TerminalKeyword Kw) => Kw.word == keyword)); } return null; } public static void UpdateKeyword(TerminalKeyword keyword) { if (!IsInGame()) { return; } for (int i = 0; i < Terminal.terminalNodes.allKeywords.Length; i++) { if (Terminal.terminalNodes.allKeywords[i].word == keyword.word) { Terminal.terminalNodes.allKeywords[i] = keyword; return; } } plugin.Log.LogWarning((object)("Failed to update " + keyword.word + ". Was not found in keywords.")); } public static void DeleteKeyword(string word) { if (!IsInGame()) { return; } for (int i = 0; i < Terminal.terminalNodes.allKeywords.Length; i++) { if (Terminal.terminalNodes.allKeywords[i].word == word.ToLower()) { int newSize = Terminal.terminalNodes.allKeywords.Length - 1; for (int j = i + 1; j < Terminal.terminalNodes.allKeywords.Length; j++) { Terminal.terminalNodes.allKeywords[j - 1] = Terminal.terminalNodes.allKeywords[j]; } Array.Resize(ref Terminal.terminalNodes.allKeywords, newSize); plugin.Log.LogMessage((object)(word + " was deleted successfully.")); return; } } plugin.Log.LogWarning((object)("Failed to delete " + word + ". Was not found in keywords.")); } public static void UpdateKeywordCompatibleNoun(TerminalKeyword verbKeyword, string noun, TerminalNode newTriggerNode) { if (!IsInGame() || !verbKeyword.isVerb) { return; } for (int i = 0; i < verbKeyword.compatibleNouns.Length; i++) { CompatibleNoun val = verbKeyword.compatibleNouns[i]; if (val.noun.word == noun) { val.result = newTriggerNode; UpdateKeyword(verbKeyword); return; } } plugin.Log.LogWarning((object)$"WARNING: No noun found for {verbKeyword}"); } public static void UpdateKeywordCompatibleNoun(string verbWord, string noun, TerminalNode newTriggerNode) { if (!IsInGame()) { return; } TerminalKeyword keyword = GetKeyword(verbWord); if (!keyword.isVerb || verbWord == null) { return; } for (int i = 0; i < keyword.compatibleNouns.Length; i++) { CompatibleNoun val = keyword.compatibleNouns[i]; if (val.noun.word == noun) { val.result = newTriggerNode; UpdateKeyword(keyword); return; } } plugin.Log.LogWarning((object)$"WARNING: No noun found for {keyword}"); } public static void UpdateKeywordCompatibleNoun(TerminalKeyword verbKeyword, string noun, string newDisplayText) { if (!IsInGame() || !verbKeyword.isVerb) { return; } for (int i = 0; i < verbKeyword.compatibleNouns.Length; i++) { CompatibleNoun val = verbKeyword.compatibleNouns[i]; if (val.noun.word == noun) { val.result.displayText = newDisplayText; UpdateKeyword(verbKeyword); return; } } plugin.Log.LogWarning((object)$"WARNING: No noun found for {verbKeyword}"); } public static void UpdateKeywordCompatibleNoun(string verbWord, string noun, string newDisplayText) { if (!IsInGame()) { return; } TerminalKeyword keyword = GetKeyword(verbWord); if (!keyword.isVerb) { return; } for (int i = 0; i < keyword.compatibleNouns.Length; i++) { CompatibleNoun val = keyword.compatibleNouns[i]; if (val.noun.word == noun) { val.result.displayText = newDisplayText; UpdateKeyword(keyword); return; } } plugin.Log.LogWarning((object)$"WARNING: No noun found for {keyword}"); } public static void AddCompatibleNoun(TerminalKeyword verbKeyword, string noun, string displayText, bool clearPreviousText = false) { if (IsInGame()) { TerminalKeyword keyword = GetKeyword(noun); verbKeyword = verbKeyword.AddCompatibleNoun(keyword, displayText, clearPreviousText); UpdateKeyword(verbKeyword); } } public static void AddCompatibleNoun(TerminalKeyword verbKeyword, string noun, TerminalNode triggerNode) { if (IsInGame()) { TerminalKeyword keyword = GetKeyword(noun); verbKeyword = verbKeyword.AddCompatibleNoun(keyword, triggerNode); UpdateKeyword(verbKeyword); } } public static void AddCompatibleNoun(string verbWord, string noun, TerminalNode triggerNode) { if (IsInGame()) { TerminalKeyword keyword = GetKeyword(verbWord); TerminalKeyword keyword2 = GetKeyword(noun); if ((Object)(object)keyword == (Object)null) { plugin.Log.LogWarning((object)"The verb given does not exist."); return; } keyword = keyword.AddCompatibleNoun(keyword2, triggerNode); UpdateKeyword(keyword); } } public static void AddCompatibleNoun(string verbWord, string noun, string displayText, bool clearPreviousText = false) { if (IsInGame()) { TerminalKeyword keyword = GetKeyword(verbWord); TerminalKeyword keyword2 = GetKeyword(noun); if ((Object)(object)keyword == (Object)null) { plugin.Log.LogWarning((object)"The verb given does not exist."); return; } keyword = keyword.AddCompatibleNoun(keyword2, displayText, clearPreviousText); UpdateKeyword(keyword); } } public static string GetTerminalInput() { if (IsInGame()) { return CurrentText.Substring(CurrentText.Length - Terminal.textAdded); } return ""; } public static void SetTerminalInput(string terminalInput) { Terminal.TextChanged(CurrentText.Substring(0, CurrentText.Length - Terminal.textAdded) + terminalInput); ScreenText.text = CurrentText; Terminal.textAdded = terminalInput.Length; } } public static class TerminalExtenstionMethods { public static TerminalKeyword AddCompatibleNoun(this TerminalKeyword terminalKeyword, TerminalKeyword noun, TerminalNode result) { //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_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown if (terminalKeyword.isVerb) { CompatibleNoun val = new CompatibleNoun { noun = noun, result = result }; if (terminalKeyword.compatibleNouns == null) { terminalKeyword.compatibleNouns = (CompatibleNoun[])(object)new CompatibleNoun[1] { val }; } else { terminalKeyword.compatibleNouns = terminalKeyword.compatibleNouns.Add(val); } return terminalKeyword; } return null; } public static TerminalKeyword AddCompatibleNoun(this TerminalKeyword terminalKeyword, string noun, TerminalNode result) { //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_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Expected O, but got Unknown if (terminalKeyword.isVerb) { CompatibleNoun val = new CompatibleNoun { noun = TerminalApi.CreateTerminalKeyword(noun), result = result }; if (terminalKeyword.compatibleNouns == null) { terminalKeyword.compatibleNouns = (CompatibleNoun[])(object)new CompatibleNoun[1] { val }; } else { terminalKeyword.compatibleNouns = terminalKeyword.compatibleNouns.Add(val); } return terminalKeyword; } return null; } public static TerminalKeyword AddCompatibleNoun(this TerminalKeyword terminalKeyword, string noun, string displayText) { //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_001b: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Expected O, but got Unknown if (terminalKeyword.isVerb) { CompatibleNoun val = new CompatibleNoun { noun = TerminalApi.CreateTerminalKeyword(noun), result = TerminalApi.CreateTerminalNode(displayText) }; if (terminalKeyword.compatibleNouns == null) { terminalKeyword.compatibleNouns = (CompatibleNoun[])(object)new CompatibleNoun[1] { val }; } else { terminalKeyword.compatibleNouns = terminalKeyword.compatibleNouns.Add(val); } return terminalKeyword; } return null; } public static TerminalKeyword AddCompatibleNoun(this TerminalKeyword terminalKeyword, TerminalKeyword noun, string displayText, bool clearPreviousText = false) { //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_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Expected O, but got Unknown if (terminalKeyword.isVerb) { CompatibleNoun val = new CompatibleNoun { noun = noun, result = TerminalApi.CreateTerminalNode(displayText, clearPreviousText) }; if (terminalKeyword.compatibleNouns == null) { terminalKeyword.compatibleNouns = (CompatibleNoun[])(object)new CompatibleNoun[1] { val }; } else { terminalKeyword.compatibleNouns = terminalKeyword.compatibleNouns.Add(val); } return terminalKeyword; } return null; } internal static T[] Add<T>(this T[] array, T newItem) { int num = array.Length + 1; Array.Resize(ref array, num); array[num - 1] = newItem; return array; } } public static class MyPluginInfo { public const string PLUGIN_GUID = "TerminalApi"; public const string PLUGIN_NAME = "TerminalApi"; public const string PLUGIN_VERSION = "1.4.0"; } } namespace TerminalApi.Events { [HarmonyPatch(typeof(Terminal))] [HarmonyPatch(typeof(Terminal))] [HarmonyPatch(typeof(Terminal))] [HarmonyPatch(typeof(Terminal))] [HarmonyPatch(typeof(Terminal))] [HarmonyPatch(typeof(Terminal))] [HarmonyPatch(typeof(Terminal))] [HarmonyPatch(typeof(Terminal))] [HarmonyPatch(typeof(Terminal))] public static class Events { public class TerminalEventArgs : EventArgs { public Terminal Terminal { get; set; } } public delegate void TerminalEventHandler(object sender, TerminalEventArgs e); public class TerminalParseSentenceEventArgs : TerminalEventArgs { public TerminalNode ReturnedNode { get; set; } public string SubmittedText { get; set; } } public delegate void TerminalParseSentenceEventHandler(object sender, TerminalParseSentenceEventArgs e); public class TerminalTextChangedEventArgs : TerminalEventArgs { public string NewText; public string CurrentInputText; } public delegate void TerminalTextChangedEventHandler(object sender, TerminalTextChangedEventArgs e); public static event TerminalEventHandler TerminalAwake; public static event TerminalEventHandler TerminalWaking; public static event TerminalEventHandler TerminalStarted; public static event TerminalEventHandler TerminalStarting; public static event TerminalEventHandler TerminalBeginUsing; public static event TerminalEventHandler TerminalBeganUsing; public static event TerminalEventHandler TerminalExited; public static event TerminalParseSentenceEventHandler TerminalParsedSentence; public static event TerminalTextChangedEventHandler TerminalTextChanged; [HarmonyPatch("Awake")] [HarmonyPostfix] public static void Awake(ref Terminal __instance) { TerminalApi.Terminal = __instance; if (TerminalApi.QueuedActions.Count > 0) { TerminalApi.plugin.Log.LogMessage((object)"In game, now adding words."); foreach (DelayedAction queuedAction in TerminalApi.QueuedActions) { queuedAction.Run(); } TerminalApi.QueuedActions.Clear(); } Events.TerminalAwake?.Invoke(__instance, new TerminalEventArgs { Terminal = __instance }); } [HarmonyPatch("BeginUsingTerminal")] [HarmonyPostfix] public static void BeganUsing(ref Terminal __instance) { Events.TerminalBeganUsing?.Invoke(__instance, new TerminalEventArgs { Terminal = __instance }); } [HarmonyPatch("QuitTerminal")] [HarmonyPostfix] public static void OnQuitTerminal(ref Terminal __instance) { Events.TerminalExited?.Invoke(__instance, new TerminalEventArgs { Terminal = __instance }); } [HarmonyPatch("BeginUsingTerminal")] [HarmonyPrefix] public static void OnBeginUsing(ref Terminal __instance) { Events.TerminalBeginUsing?.Invoke(__instance, new TerminalEventArgs { Terminal = __instance }); } [HarmonyPatch("ParsePlayerSentence")] [HarmonyPostfix] public static void ParsePlayerSentence(ref Terminal __instance, TerminalNode __result) { string submittedText = __instance.screenText.text.Substring(__instance.screenText.text.Length - __instance.textAdded); Events.TerminalParsedSentence?.Invoke(__instance, new TerminalParseSentenceEventArgs { Terminal = __instance, SubmittedText = submittedText, ReturnedNode = __result }); } [HarmonyPatch("Start")] [HarmonyPostfix] public static void Started(ref Terminal __instance) { Events.TerminalStarted?.Invoke(__instance, new TerminalEventArgs { Terminal = __instance }); } [HarmonyPatch("Start")] [HarmonyPrefix] public static void Starting(ref Terminal __instance) { Events.TerminalStarting?.Invoke(__instance, new TerminalEventArgs { Terminal = __instance }); } [HarmonyPatch("TextChanged")] [HarmonyPostfix] public static void OnTextChanged(ref Terminal __instance, string newText) { string currentInputText = ""; if (newText.Trim().Length >= __instance.textAdded) { currentInputText = newText.Substring(newText.Length - __instance.textAdded); } Events.TerminalTextChanged?.Invoke(__instance, new TerminalTextChangedEventArgs { Terminal = __instance, NewText = newText, CurrentInputText = currentInputText }); } [HarmonyPatch("Awake")] [HarmonyPrefix] public static void Waking(ref Terminal __instance) { Events.TerminalWaking?.Invoke(__instance, new TerminalEventArgs { Terminal = __instance }); } } }
BepInEx/plugins/notnotnotswipez-MoreCompany/MoreCompany.dll
Decompiled a year agousing 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.InteropServices; using System.Runtime.Versioning; using System.Text; using BepInEx; using BepInEx.Logging; using GameNetcodeStuff; using HarmonyLib; using MoreCompany.Cosmetics; using MoreCompany.Utils; using Steamworks; using Steamworks.Data; using TMPro; using Unity.Netcode; using UnityEngine; using UnityEngine.Audio; using UnityEngine.EventSystems; using UnityEngine.Events; using UnityEngine.InputSystem; using UnityEngine.SceneManagement; 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: AssemblyTitle("MoreCompany")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("MoreCompany")] [assembly: AssemblyCopyright("Copyright © 2023")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("511a1e5e-0611-49f1-b60f-cec69c668fd8")] [assembly: AssemblyFileVersion("1.7.2")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyVersion("1.7.2.0")] namespace MoreCompany { [HarmonyPatch(typeof(AudioMixer), "SetFloat")] public static class AudioMixerSetFloatPatch { public static bool Prefix(string name, float value) { if (name.StartsWith("PlayerVolume") || name.StartsWith("PlayerPitch")) { string s = name.Replace("PlayerVolume", "").Replace("PlayerPitch", ""); int num = int.Parse(s); PlayerControllerB val = StartOfRound.Instance.allPlayerScripts[num]; AudioSource currentVoiceChatAudioSource = val.currentVoiceChatAudioSource; if ((Object)(object)val != (Object)null && Object.op_Implicit((Object)(object)currentVoiceChatAudioSource)) { if (name.StartsWith("PlayerVolume")) { currentVoiceChatAudioSource.volume = value / 16f; } else if (name.StartsWith("PlayerPitch")) { currentVoiceChatAudioSource.pitch = value; } } return false; } return true; } } [HarmonyPatch(typeof(HUDManager), "AddTextToChatOnServer")] public static class SendChatToServerPatch { public static bool Prefix(HUDManager __instance, string chatMessage, int playerId = -1) { if (((NetworkBehaviour)StartOfRound.Instance).IsHost && chatMessage.StartsWith("/mc") && DebugCommandRegistry.commandEnabled) { string text = chatMessage.Replace("/mc ", ""); DebugCommandRegistry.HandleCommand(text.Split(new char[1] { ' ' })); return false; } if (chatMessage.StartsWith("[morecompanycosmetics]")) { ReflectionUtils.InvokeMethod(__instance, "AddPlayerChatMessageServerRpc", new object[2] { chatMessage, 99 }); return false; } return true; } } [HarmonyPatch(typeof(HUDManager), "AddPlayerChatMessageServerRpc")] public static class ServerReceiveMessagePatch { public static string previousDataMessage = ""; public static bool Prefix(HUDManager __instance, ref string chatMessage, int playerId) { NetworkManager networkManager = ((NetworkBehaviour)__instance).NetworkManager; if ((Object)(object)networkManager == (Object)null || !networkManager.IsListening) { return false; } if (chatMessage.StartsWith("[morecompanycosmetics]") && networkManager.IsServer) { previousDataMessage = chatMessage; chatMessage = "[replacewithdata]"; } return true; } } [HarmonyPatch(typeof(PlayerControllerB), "ConnectClientToPlayerObject")] public static class ConnectClientToPlayerObjectPatch { public static void Postfix(PlayerControllerB __instance) { string text = "[morecompanycosmetics]"; text = text + ";" + __instance.playerClientId; foreach (string locallySelectedCosmetic in CosmeticRegistry.locallySelectedCosmetics) { text = text + ";" + locallySelectedCosmetic; } HUDManager.Instance.AddTextToChatOnServer(text, -1); } } [HarmonyPatch(typeof(HUDManager), "AddChatMessage")] public static class AddChatMessagePatch { public static bool Prefix(HUDManager __instance, string chatMessage, string nameOfUserWhoTyped = "") { if (chatMessage.StartsWith("[replacewithdata]") || chatMessage.StartsWith("[morecompanycosmetics]")) { return false; } return true; } } [HarmonyPatch(typeof(HUDManager), "AddPlayerChatMessageClientRpc")] public static class ClientReceiveMessagePatch { public static bool ignoreSample; public static bool Prefix(HUDManager __instance, ref string chatMessage, int playerId) { NetworkManager networkManager = ((NetworkBehaviour)__instance).NetworkManager; if ((Object)(object)networkManager == (Object)null || !networkManager.IsListening) { return false; } if (networkManager.IsServer) { if (chatMessage.StartsWith("[replacewithdata]")) { chatMessage = ServerReceiveMessagePatch.previousDataMessage; HandleDataMessage(chatMessage); } else if (chatMessage.StartsWith("[morecompanycosmetics]")) { return false; } } else if (chatMessage.StartsWith("[morecompanycosmetics]")) { HandleDataMessage(chatMessage); } return true; } private static void HandleDataMessage(string chatMessage) { //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_016a: Unknown result type (might be due to invalid IL or missing references) if (ignoreSample) { return; } chatMessage = chatMessage.Replace("[morecompanycosmetics]", ""); string[] array = chatMessage.Split(new char[1] { ';' }); string text = array[1]; int num = int.Parse(text); CosmeticApplication component = ((Component)((Component)StartOfRound.Instance.allPlayerScripts[num]).transform.Find("ScavengerModel").Find("metarig")).gameObject.GetComponent<CosmeticApplication>(); if (Object.op_Implicit((Object)(object)component)) { component.ClearCosmetics(); Object.Destroy((Object)(object)component); } CosmeticApplication cosmeticApplication = ((Component)((Component)StartOfRound.Instance.allPlayerScripts[num]).transform.Find("ScavengerModel").Find("metarig")).gameObject.AddComponent<CosmeticApplication>(); cosmeticApplication.ClearCosmetics(); List<string> list = new List<string>(); string[] array2 = array; foreach (string text2 in array2) { if (!(text2 == text)) { list.Add(text2); if (MainClass.showCosmetics) { cosmeticApplication.ApplyCosmetic(text2, startEnabled: true); } } } if (num == StartOfRound.Instance.thisClientPlayerId) { cosmeticApplication.ClearCosmetics(); } foreach (CosmeticInstance spawnedCosmetic in cosmeticApplication.spawnedCosmetics) { Transform transform = ((Component)spawnedCosmetic).transform; transform.localScale *= 0.38f; } MainClass.playerIdsAndCosmetics.Remove(num); MainClass.playerIdsAndCosmetics.Add(num, list); if (!GameNetworkManager.Instance.isHostingGame || num == 0) { return; } ignoreSample = true; foreach (KeyValuePair<int, List<string>> playerIdsAndCosmetic in MainClass.playerIdsAndCosmetics) { string text3 = "[morecompanycosmetics]"; text3 = text3 + ";" + playerIdsAndCosmetic.Key; foreach (string item in playerIdsAndCosmetic.Value) { text3 = text3 + ";" + item; } HUDManager.Instance.AddTextToChatOnServer(text3, -1); } ignoreSample = false; } } public class DebugCommandRegistry { public static bool commandEnabled; public static void HandleCommand(string[] args) { //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_0164: 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_018a: Unknown result type (might be due to invalid IL or missing references) //IL_018f: Unknown result type (might be due to invalid IL or missing references) //IL_026f: Unknown result type (might be due to invalid IL or missing references) //IL_027a: Unknown result type (might be due to invalid IL or missing references) //IL_0284: Unknown result type (might be due to invalid IL or missing references) //IL_0289: Unknown result type (might be due to invalid IL or missing references) //IL_029b: Unknown result type (might be due to invalid IL or missing references) if (!commandEnabled) { return; } PlayerControllerB localPlayerController = StartOfRound.Instance.localPlayerController; switch (args[0]) { case "money": { int groupCredits = int.Parse(args[1]); Terminal val5 = Resources.FindObjectsOfTypeAll<Terminal>().First(); val5.groupCredits = groupCredits; break; } case "spawnscrap": { string text = ""; for (int i = 1; i < args.Length; i++) { text = text + args[i] + " "; } text = text.Trim(); Vector3 val = ((Component)localPlayerController).transform.position + ((Component)localPlayerController).transform.forward * 2f; SpawnableItemWithRarity val2 = null; foreach (SpawnableItemWithRarity item in StartOfRound.Instance.currentLevel.spawnableScrap) { if (item.spawnableItem.itemName.ToLower() == text.ToLower()) { val2 = item; break; } } GameObject val3 = Object.Instantiate<GameObject>(val2.spawnableItem.spawnPrefab, val, Quaternion.identity, (Transform)null); GrabbableObject component = val3.GetComponent<GrabbableObject>(); ((Component)component).transform.rotation = Quaternion.Euler(component.itemProperties.restingRotation); component.fallTime = 0f; NetworkObject component2 = val3.GetComponent<NetworkObject>(); component2.Spawn(false); break; } case "spawnenemy": { string text2 = ""; for (int j = 1; j < args.Length; j++) { text2 = text2 + args[j] + " "; } text2 = text2.Trim(); SpawnableEnemyWithRarity val4 = null; foreach (SpawnableEnemyWithRarity enemy in StartOfRound.Instance.currentLevel.Enemies) { if (enemy.enemyType.enemyName.ToLower() == text2.ToLower()) { val4 = enemy; break; } } RoundManager.Instance.SpawnEnemyGameObject(((Component)localPlayerController).transform.position + ((Component)localPlayerController).transform.forward * 2f, 0f, -1, val4.enemyType); break; } case "listall": MainClass.StaticLogger.LogInfo((object)"Spawnable scrap:"); foreach (SpawnableItemWithRarity item2 in StartOfRound.Instance.currentLevel.spawnableScrap) { MainClass.StaticLogger.LogInfo((object)item2.spawnableItem.itemName); } MainClass.StaticLogger.LogInfo((object)"Spawnable enemies:"); { foreach (SpawnableEnemyWithRarity enemy2 in StartOfRound.Instance.currentLevel.Enemies) { MainClass.StaticLogger.LogInfo((object)enemy2.enemyType.enemyName); } break; } } } } [HarmonyPatch(typeof(ForestGiantAI), "LookForPlayers")] public static class LookForPlayersForestGiantPatch { public static void Prefix(ForestGiantAI __instance) { if (__instance.playerStealthMeters.Length != MainClass.newPlayerCount) { __instance.playerStealthMeters = new float[MainClass.newPlayerCount]; for (int i = 0; i < MainClass.newPlayerCount; i++) { __instance.playerStealthMeters[i] = 0f; } } } } [HarmonyPatch(typeof(SpringManAI), "Update")] public static class SpringManAIUpdatePatch { public static bool Prefix(SpringManAI __instance, ref float ___timeSinceHittingPlayer, ref float ___stopAndGoMinimumInterval, ref bool ___wasOwnerLastFrame, ref bool ___stoppingMovement, ref float ___currentChaseSpeed, ref bool ___hasStopped, ref float ___currentAnimSpeed, ref float ___updateDestinationInterval, ref Vector3 ___tempVelocity, ref float ___targetYRotation, ref float ___setDestinationToPlayerInterval, ref float ___previousYRotation) { //IL_0241: 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_0278: 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_0118: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_014c: 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) UpdateBase((EnemyAI)(object)__instance, ref ___updateDestinationInterval, ref ___tempVelocity, ref ___targetYRotation, ref ___setDestinationToPlayerInterval, ref ___previousYRotation); if (((EnemyAI)__instance).isEnemyDead) { return false; } int currentBehaviourStateIndex = ((EnemyAI)__instance).currentBehaviourStateIndex; if (currentBehaviourStateIndex != 0 && currentBehaviourStateIndex == 1) { if (___timeSinceHittingPlayer >= 0f) { ___timeSinceHittingPlayer -= Time.deltaTime; } if (((NetworkBehaviour)__instance).IsOwner) { if (___stopAndGoMinimumInterval > 0f) { ___stopAndGoMinimumInterval -= Time.deltaTime; } if (!___wasOwnerLastFrame) { ___wasOwnerLastFrame = true; if (!___stoppingMovement && ___timeSinceHittingPlayer < 0.12f) { ((EnemyAI)__instance).agent.speed = ___currentChaseSpeed; } else { ((EnemyAI)__instance).agent.speed = 0f; } } bool flag = false; for (int i = 0; i < MainClass.newPlayerCount; i++) { if (((EnemyAI)__instance).PlayerIsTargetable(StartOfRound.Instance.allPlayerScripts[i], false, false) && StartOfRound.Instance.allPlayerScripts[i].HasLineOfSightToPosition(((Component)__instance).transform.position + Vector3.up * 1.6f, 68f, 60, -1f) && Vector3.Distance(((Component)StartOfRound.Instance.allPlayerScripts[i].gameplayCamera).transform.position, ((EnemyAI)__instance).eye.position) > 0.3f) { flag = true; } } if (((EnemyAI)__instance).stunNormalizedTimer > 0f) { flag = true; } if (flag != ___stoppingMovement && ___stopAndGoMinimumInterval <= 0f) { ___stopAndGoMinimumInterval = 0.15f; if (flag) { __instance.SetAnimationStopServerRpc(); } else { __instance.SetAnimationGoServerRpc(); } ___stoppingMovement = flag; } } if (___stoppingMovement) { if (__instance.animStopPoints.canAnimationStop) { if (!___hasStopped) { ___hasStopped = true; __instance.mainCollider.isTrigger = false; if (GameNetworkManager.Instance.localPlayerController.HasLineOfSightToPosition(((Component)__instance).transform.position, 70f, 25, -1f)) { float num = Vector3.Distance(((Component)__instance).transform.position, ((Component)GameNetworkManager.Instance.localPlayerController).transform.position); if (num < 4f) { GameNetworkManager.Instance.localPlayerController.JumpToFearLevel(0.9f, true); } else if (num < 9f) { GameNetworkManager.Instance.localPlayerController.JumpToFearLevel(0.4f, true); } } if (___currentAnimSpeed > 2f) { RoundManager.PlayRandomClip(((EnemyAI)__instance).creatureVoice, __instance.springNoises, false, 1f, 0); if (__instance.animStopPoints.animationPosition == 1) { ((EnemyAI)__instance).creatureAnimator.SetTrigger("springBoing"); } else { ((EnemyAI)__instance).creatureAnimator.SetTrigger("springBoingPosition2"); } } } ((EnemyAI)__instance).creatureAnimator.SetFloat("walkSpeed", 0f); ___currentAnimSpeed = 0f; if (((NetworkBehaviour)__instance).IsOwner) { ((EnemyAI)__instance).agent.speed = 0f; return false; } } } else { if (___hasStopped) { ___hasStopped = false; __instance.mainCollider.isTrigger = true; } ___currentAnimSpeed = Mathf.Lerp(___currentAnimSpeed, 6f, 5f * Time.deltaTime); ((EnemyAI)__instance).creatureAnimator.SetFloat("walkSpeed", ___currentAnimSpeed); if (((NetworkBehaviour)__instance).IsOwner) { ((EnemyAI)__instance).agent.speed = Mathf.Lerp(((EnemyAI)__instance).agent.speed, ___currentChaseSpeed, 4.5f * Time.deltaTime); } } } return false; } private static void UpdateBase(EnemyAI __instance, ref float updateDestinationInterval, ref Vector3 tempVelocity, ref float targetYRotation, ref float setDestinationToPlayerInterval, ref float previousYRotation) { //IL_011a: 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_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_016f: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_0255: Unknown result type (might be due to invalid IL or missing references) //IL_025b: 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_027e: 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) //IL_02b0: Unknown result type (might be due to invalid IL or missing references) //IL_02ba: Unknown result type (might be due to invalid IL or missing references) //IL_0393: Unknown result type (might be due to invalid IL or missing references) //IL_03b3: 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_03c2: Unknown result type (might be due to invalid IL or missing references) //IL_0364: Unknown result type (might be due to invalid IL or missing references) //IL_036e: Unknown result type (might be due to invalid IL or missing references) //IL_0379: Unknown result type (might be due to invalid IL or missing references) //IL_037e: Unknown result type (might be due to invalid IL or missing references) //IL_0425: Unknown result type (might be due to invalid IL or missing references) //IL_0454: Unknown result type (might be due to invalid IL or missing references) if (__instance.enemyType.isDaytimeEnemy && !__instance.daytimeEnemyLeaving) { ReflectionUtils.InvokeMethod(__instance, typeof(EnemyAI), "CheckTimeOfDayToLeave", null); } if (__instance.stunnedIndefinitely <= 0) { if ((double)__instance.stunNormalizedTimer >= 0.0) { __instance.stunNormalizedTimer -= Time.deltaTime / __instance.enemyType.stunTimeMultiplier; } else { __instance.stunnedByPlayer = null; if ((double)__instance.postStunInvincibilityTimer >= 0.0) { __instance.postStunInvincibilityTimer -= Time.deltaTime * 5f; } } } if (!__instance.ventAnimationFinished && (double)__instance.timeSinceSpawn < (double)__instance.exitVentAnimationTime + 0.004999999888241291 * (double)RoundManager.Instance.numberOfEnemiesInScene) { __instance.timeSinceSpawn += Time.deltaTime; if (!((NetworkBehaviour)__instance).IsOwner) { Vector3 serverPosition = __instance.serverPosition; if (__instance.serverPosition != Vector3.zero) { ((Component)__instance).transform.position = __instance.serverPosition; ((Component)__instance).transform.eulerAngles = new Vector3(((Component)__instance).transform.eulerAngles.x, targetYRotation, ((Component)__instance).transform.eulerAngles.z); } } else if ((double)updateDestinationInterval >= 0.0) { updateDestinationInterval -= Time.deltaTime; } else { __instance.SyncPositionToClients(); updateDestinationInterval = 0.1f; } return; } if (!__instance.ventAnimationFinished) { __instance.ventAnimationFinished = true; if ((Object)(object)__instance.creatureAnimator != (Object)null) { __instance.creatureAnimator.SetBool("inSpawningAnimation", false); } } if (!((NetworkBehaviour)__instance).IsOwner) { if (__instance.currentSearch.inProgress) { __instance.StopSearch(__instance.currentSearch, true); } __instance.SetClientCalculatingAI(false); if (!__instance.inSpecialAnimation) { ((Component)__instance).transform.position = Vector3.SmoothDamp(((Component)__instance).transform.position, __instance.serverPosition, ref tempVelocity, __instance.syncMovementSpeed); ((Component)__instance).transform.eulerAngles = new Vector3(((Component)__instance).transform.eulerAngles.x, Mathf.LerpAngle(((Component)__instance).transform.eulerAngles.y, targetYRotation, 15f * Time.deltaTime), ((Component)__instance).transform.eulerAngles.z); } __instance.timeSinceSpawn += Time.deltaTime; return; } if (__instance.isEnemyDead) { __instance.SetClientCalculatingAI(false); return; } if (!__instance.inSpecialAnimation) { __instance.SetClientCalculatingAI(true); } if (__instance.movingTowardsTargetPlayer && (Object)(object)__instance.targetPlayer != (Object)null) { if ((double)setDestinationToPlayerInterval <= 0.0) { setDestinationToPlayerInterval = 0.25f; __instance.destination = RoundManager.Instance.GetNavMeshPosition(((Component)__instance.targetPlayer).transform.position, RoundManager.Instance.navHit, 2.7f, -1); } else { __instance.destination = new Vector3(((Component)__instance.targetPlayer).transform.position.x, __instance.destination.y, ((Component)__instance.targetPlayer).transform.position.z); setDestinationToPlayerInterval -= Time.deltaTime; } } if (__instance.inSpecialAnimation) { return; } if ((double)updateDestinationInterval >= 0.0) { updateDestinationInterval -= Time.deltaTime; } else { __instance.DoAIInterval(); updateDestinationInterval = __instance.AIIntervalTime; } if (!((double)Mathf.Abs(previousYRotation - ((Component)__instance).transform.eulerAngles.y) <= 6.0)) { previousYRotation = ((Component)__instance).transform.eulerAngles.y; targetYRotation = previousYRotation; if (((NetworkBehaviour)__instance).IsServer) { ReflectionUtils.InvokeMethod(__instance, typeof(EnemyAI), "UpdateEnemyRotationClientRpc", new object[1] { (short)previousYRotation }); } else { ReflectionUtils.InvokeMethod(__instance, typeof(EnemyAI), "UpdateEnemyRotationServerRpc", new object[1] { (short)previousYRotation }); } } } } [HarmonyPatch(typeof(SpringManAI), "DoAIInterval")] public static class SpringManAIIntervalPatch { public static bool Prefix(SpringManAI __instance) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0183: Unknown result type (might be due to invalid IL or missing references) //IL_0188: 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_01b3: 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_01cf: Unknown result type (might be due to invalid IL or missing references) //IL_01e6: Unknown result type (might be due to invalid IL or missing references) if (((EnemyAI)__instance).moveTowardsDestination) { ((EnemyAI)__instance).agent.SetDestination(((EnemyAI)__instance).destination); } ((EnemyAI)__instance).SyncPositionToClients(); if (StartOfRound.Instance.allPlayersDead) { return false; } if (((EnemyAI)__instance).isEnemyDead) { return false; } switch (((EnemyAI)__instance).currentBehaviourStateIndex) { default: return false; case 1: if (__instance.searchForPlayers.inProgress) { ((EnemyAI)__instance).StopSearch(__instance.searchForPlayers, true); } if (((EnemyAI)__instance).TargetClosestPlayer(1.5f, false, 70f)) { PlayerControllerB fieldValue = ReflectionUtils.GetFieldValue<PlayerControllerB>(__instance, "previousTarget"); if ((Object)(object)fieldValue != (Object)(object)((EnemyAI)__instance).targetPlayer) { ReflectionUtils.SetFieldValue(__instance, "previousTarget", ((EnemyAI)__instance).targetPlayer); ((EnemyAI)__instance).ChangeOwnershipOfEnemy(((EnemyAI)__instance).targetPlayer.actualClientId); } ((EnemyAI)__instance).movingTowardsTargetPlayer = true; return false; } ((EnemyAI)__instance).SwitchToBehaviourState(0); ((EnemyAI)__instance).ChangeOwnershipOfEnemy(StartOfRound.Instance.allPlayerScripts[0].actualClientId); break; case 0: { if (!((NetworkBehaviour)__instance).IsServer) { ((EnemyAI)__instance).ChangeOwnershipOfEnemy(StartOfRound.Instance.allPlayerScripts[0].actualClientId); return false; } for (int i = 0; i < StartOfRound.Instance.allPlayerScripts.Length; i++) { if (((EnemyAI)__instance).PlayerIsTargetable(StartOfRound.Instance.allPlayerScripts[i], false, false) && !Physics.Linecast(((Component)__instance).transform.position + Vector3.up * 0.5f, ((Component)StartOfRound.Instance.allPlayerScripts[i].gameplayCamera).transform.position, StartOfRound.Instance.collidersAndRoomMaskAndDefault) && Vector3.Distance(((Component)__instance).transform.position, ((Component)StartOfRound.Instance.allPlayerScripts[i]).transform.position) < 30f) { ((EnemyAI)__instance).SwitchToBehaviourState(1); return false; } } if (!__instance.searchForPlayers.inProgress) { ((EnemyAI)__instance).movingTowardsTargetPlayer = false; ((EnemyAI)__instance).StartSearch(((Component)__instance).transform.position, __instance.searchForPlayers); return false; } break; } } return false; } } [HarmonyPatch(typeof(EnemyAI), "GetClosestPlayer")] public static class GetClosestPlayerPatch { public static bool Prefix(EnemyAI __instance, ref PlayerControllerB __result, bool requireLineOfSight = false, bool cannotBeInShip = false, bool cannotBeNearShip = false) { //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_012b: 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_008a: Unknown result type (might be due to invalid IL or missing references) PlayerControllerB val = null; __instance.mostOptimalDistance = 2000f; for (int i = 0; i < StartOfRound.Instance.allPlayerScripts.Length; i++) { if (!__instance.PlayerIsTargetable(StartOfRound.Instance.allPlayerScripts[i], cannotBeInShip, false)) { continue; } if (cannotBeNearShip) { if (StartOfRound.Instance.allPlayerScripts[i].isInElevator) { continue; } bool flag = false; for (int j = 0; j < RoundManager.Instance.spawnDenialPoints.Length; j++) { if (Vector3.Distance(RoundManager.Instance.spawnDenialPoints[j].transform.position, ((Component)StartOfRound.Instance.allPlayerScripts[i]).transform.position) < 10f) { flag = true; break; } } if (flag) { continue; } } if (!requireLineOfSight || !Physics.Linecast(((Component)__instance).transform.position, ((Component)StartOfRound.Instance.allPlayerScripts[i]).transform.position, 256)) { __instance.tempDist = Vector3.Distance(((Component)__instance).transform.position, ((Component)StartOfRound.Instance.allPlayerScripts[i]).transform.position); if (__instance.tempDist < __instance.mostOptimalDistance) { __instance.mostOptimalDistance = __instance.tempDist; val = StartOfRound.Instance.allPlayerScripts[i]; } } } __result = val; return false; } } [HarmonyPatch(typeof(EnemyAI), "GetAllPlayersInLineOfSight")] public static class GetAllPlayersInLineOfSightPatch { public static bool Prefix(EnemyAI __instance, ref PlayerControllerB[] __result, float width = 45f, int range = 60, Transform eyeObject = null, float proximityCheck = -1f, int layerMask = -1) { //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Invalid comparison between Unknown and I4 //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: 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_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: 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_0104: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_011d: 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) if (layerMask == -1) { layerMask = StartOfRound.Instance.collidersAndRoomMaskAndDefault; } if ((Object)(object)eyeObject == (Object)null) { eyeObject = __instance.eye; } if (__instance.enemyType.isOutsideEnemy && !__instance.enemyType.canSeeThroughFog && (int)TimeOfDay.Instance.currentLevelWeather == 3) { range = Mathf.Clamp(range, 0, 30); } List<PlayerControllerB> list = new List<PlayerControllerB>(MainClass.newPlayerCount); for (int i = 0; i < StartOfRound.Instance.allPlayerScripts.Length; i++) { if (!__instance.PlayerIsTargetable(StartOfRound.Instance.allPlayerScripts[i], false, false)) { continue; } Vector3 position = ((Component)StartOfRound.Instance.allPlayerScripts[i].gameplayCamera).transform.position; if (Vector3.Distance(__instance.eye.position, position) < (float)range && !Physics.Linecast(eyeObject.position, position, StartOfRound.Instance.collidersAndRoomMaskAndDefault, (QueryTriggerInteraction)1)) { Vector3 val = position - eyeObject.position; if (Vector3.Angle(eyeObject.forward, val) < width || Vector3.Distance(((Component)__instance).transform.position, ((Component)StartOfRound.Instance.allPlayerScripts[i]).transform.position) < proximityCheck) { list.Add(StartOfRound.Instance.allPlayerScripts[i]); } } } if (list.Count == MainClass.newPlayerCount) { __result = StartOfRound.Instance.allPlayerScripts; return false; } if (list.Count > 0) { __result = list.ToArray(); return false; } __result = null; return false; } } [HarmonyPatch(typeof(DressGirlAI), "ChoosePlayerToHaunt")] public static class DressGirlHauntPatch { public static bool Prefix(DressGirlAI __instance) { ReflectionUtils.SetFieldValue(__instance, "timesChoosingAPlayer", ReflectionUtils.GetFieldValue<int>(__instance, "timesChoosingAPlayer") + 1); if (ReflectionUtils.GetFieldValue<int>(__instance, "timesChoosingAPlayer") > 1) { __instance.timer = __instance.hauntInterval - 1f; } __instance.SFXVolumeLerpTo = 0f; ((EnemyAI)__instance).creatureVoice.Stop(); __instance.heartbeatMusic.volume = 0f; if (!ReflectionUtils.GetFieldValue<bool>(__instance, "initializedRandomSeed")) { ReflectionUtils.SetFieldValue(__instance, "ghostGirlRandom", new Random(StartOfRound.Instance.randomMapSeed + 158)); } float num = 0f; float num2 = 0f; int num3 = 0; int num4 = 0; for (int i = 0; i < MainClass.newPlayerCount; i++) { if (StartOfRound.Instance.gameStats.allPlayerStats[i].turnAmount > num3) { num3 = StartOfRound.Instance.gameStats.allPlayerStats[i].turnAmount; num4 = i; } if (StartOfRound.Instance.allPlayerScripts[i].insanityLevel > num) { num = StartOfRound.Instance.allPlayerScripts[i].insanityLevel; num2 = i; } } int[] array = new int[MainClass.newPlayerCount]; for (int j = 0; j < MainClass.newPlayerCount; j++) { if (!StartOfRound.Instance.allPlayerScripts[j].isPlayerControlled) { array[j] = 0; continue; } array[j] += 80; if (num2 == (float)j && num > 1f) { array[j] += 50; } if (num4 == j) { array[j] += 30; } if (!StartOfRound.Instance.allPlayerScripts[j].hasBeenCriticallyInjured) { array[j] += 10; } if ((Object)(object)StartOfRound.Instance.allPlayerScripts[j].currentlyHeldObjectServer != (Object)null && StartOfRound.Instance.allPlayerScripts[j].currentlyHeldObjectServer.scrapValue > 150) { array[j] += 30; } } __instance.hauntingPlayer = StartOfRound.Instance.allPlayerScripts[RoundManager.Instance.GetRandomWeightedIndex(array, ReflectionUtils.GetFieldValue<Random>(__instance, "ghostGirlRandom"))]; if (__instance.hauntingPlayer.isPlayerDead) { for (int k = 0; k < StartOfRound.Instance.allPlayerScripts.Length; k++) { if (!StartOfRound.Instance.allPlayerScripts[k].isPlayerDead) { __instance.hauntingPlayer = StartOfRound.Instance.allPlayerScripts[k]; break; } } } Debug.Log((object)$"Little girl: Haunting player with playerClientId: {__instance.hauntingPlayer.playerClientId}; actualClientId: {__instance.hauntingPlayer.actualClientId}"); ((EnemyAI)__instance).ChangeOwnershipOfEnemy(__instance.hauntingPlayer.actualClientId); __instance.hauntingLocalPlayer = (Object)(object)GameNetworkManager.Instance.localPlayerController == (Object)(object)__instance.hauntingPlayer; if (ReflectionUtils.GetFieldValue<Coroutine>(__instance, "switchHauntedPlayerCoroutine") != null) { ((MonoBehaviour)__instance).StopCoroutine(ReflectionUtils.GetFieldValue<Coroutine>(__instance, "switchHauntedPlayerCoroutine")); } ReflectionUtils.SetFieldValue(__instance, "switchHauntedPlayerCoroutine", ((MonoBehaviour)__instance).StartCoroutine(ReflectionUtils.InvokeMethod<IEnumerator>(__instance, "setSwitchingHauntingPlayer", null))); return false; } } [HarmonyPatch(typeof(HUDManager), "AddChatMessage")] public static class HudChatPatch { public static void Prefix(HUDManager __instance, ref string chatMessage, string nameOfUserWhoTyped = "") { if (!(__instance.lastChatMessage == chatMessage)) { StringBuilder stringBuilder = new StringBuilder(chatMessage); for (int i = 0; i < MainClass.newPlayerCount; i++) { string oldValue = $"[playerNum{i}]"; string playerUsername = StartOfRound.Instance.allPlayerScripts[i].playerUsername; stringBuilder.Replace(oldValue, playerUsername); } chatMessage = stringBuilder.ToString(); } } } [HarmonyPatch(typeof(MenuManager), "Awake")] public static class MenuManagerLogoOverridePatch { public static void Postfix(MenuManager __instance) { //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) try { GameObject gameObject = ((Component)((Component)__instance).transform.parent).gameObject; GameObject gameObject2 = ((Component)gameObject.transform.Find("MenuContainer").Find("MainButtons").Find("HeaderImage")).gameObject; Image component = gameObject2.GetComponent<Image>(); MainClass.ReadSettingsFromFile(); component.sprite = Sprite.Create(MainClass.mainLogo, new Rect(0f, 0f, (float)((Texture)MainClass.mainLogo).width, (float)((Texture)MainClass.mainLogo).height), new Vector2(0.5f, 0.5f)); CosmeticRegistry.SpawnCosmeticGUI(); Transform val = gameObject.transform.Find("MenuContainer").Find("LobbyHostSettings").Find("Panel") .Find("LobbyHostOptions") .Find("OptionsNormal"); GameObject val2 = Object.Instantiate<GameObject>(MainClass.crewCountUI, val); RectTransform component2 = val2.GetComponent<RectTransform>(); ((Transform)component2).localPosition = new Vector3(96.9f, -70f, -6.7f); TMP_InputField inputField = ((Component)val2.transform.Find("InputField (TMP)")).GetComponent<TMP_InputField>(); inputField.characterLimit = 3; inputField.text = MainClass.newPlayerCount.ToString(); ((UnityEvent<string>)(object)inputField.onValueChanged).AddListener((UnityAction<string>)delegate(string s) { if (int.TryParse(s, out var result)) { MainClass.newPlayerCount = result; MainClass.newPlayerCount = Mathf.Clamp(MainClass.newPlayerCount, 1, MainClass.maxPlayerCount); inputField.text = MainClass.newPlayerCount.ToString(); MainClass.SaveSettingsToFile(); } else if (s.Length != 0) { inputField.text = MainClass.newPlayerCount.ToString(); inputField.caretPosition = 1; } }); } catch (Exception) { } } } [HarmonyPatch(typeof(QuickMenuManager), "AddUserToPlayerList")] public static class AddUserPlayerListPatch { public static bool Prefix(QuickMenuManager __instance, ulong steamId, string playerName, int playerObjectId) { QuickmenuVisualInjectPatch.PopulateQuickMenu(__instance); MainClass.EnablePlayerObjectsBasedOnConnected(); return false; } } [HarmonyPatch(typeof(QuickMenuManager), "RemoveUserFromPlayerList")] public static class RemoveUserPlayerListPatch { public static bool Prefix(QuickMenuManager __instance) { QuickmenuVisualInjectPatch.PopulateQuickMenu(__instance); return false; } } [HarmonyPatch(typeof(QuickMenuManager), "Update")] public static class QuickMenuUpdatePatch { public static bool Prefix(QuickMenuManager __instance) { return false; } } [HarmonyPatch(typeof(QuickMenuManager), "NonHostPlayerSlotsEnabled")] public static class QuickMenuDisplayPatch { public static bool Prefix(QuickMenuManager __instance, ref bool __result) { __result = true; return false; } } [HarmonyPatch(typeof(QuickMenuManager), "Start")] public static class QuickmenuVisualInjectPatch { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static UnityAction <>9__2_2; internal void <PopulateQuickMenu>b__2_2() { if (!GameNetworkManager.Instance.disableSteam) { } } } public static GameObject quickMenuScrollInstance; public static void Postfix(QuickMenuManager __instance) { //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) GameObject gameObject = ((Component)__instance.playerListPanel.transform.Find("Image")).gameObject; GameObject val = Object.Instantiate<GameObject>(MainClass.quickMenuScrollParent); val.transform.SetParent(gameObject.transform); RectTransform component = val.GetComponent<RectTransform>(); ((Transform)component).localPosition = new Vector3(0f, -31.2f, 0f); ((Transform)component).localScale = Vector3.one; quickMenuScrollInstance = val; } public static void PopulateQuickMenu(QuickMenuManager __instance) { //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_015b: Unknown result type (might be due to invalid IL or missing references) //IL_016b: Unknown result type (might be due to invalid IL or missing references) //IL_0277: Unknown result type (might be due to invalid IL or missing references) //IL_0281: Expected O, but got Unknown //IL_02d8: Unknown result type (might be due to invalid IL or missing references) //IL_02dd: Unknown result type (might be due to invalid IL or missing references) //IL_02e3: Expected O, but got Unknown int childCount = quickMenuScrollInstance.transform.Find("Holder").childCount; List<GameObject> list = new List<GameObject>(); for (int i = 0; i < childCount; i++) { list.Add(((Component)quickMenuScrollInstance.transform.Find("Holder").GetChild(i)).gameObject); } foreach (GameObject item in list) { Object.Destroy((Object)(object)item); } if (!Object.op_Implicit((Object)(object)StartOfRound.Instance)) { return; } for (int j = 0; j < StartOfRound.Instance.allPlayerScripts.Length; j++) { PlayerControllerB playerScript = StartOfRound.Instance.allPlayerScripts[j]; if (!playerScript.isPlayerControlled && !playerScript.isPlayerDead) { continue; } GameObject val = Object.Instantiate<GameObject>(MainClass.playerEntry, quickMenuScrollInstance.transform.Find("Holder")); RectTransform component = val.GetComponent<RectTransform>(); ((Transform)component).localScale = Vector3.one; ((Transform)component).localPosition = new Vector3(0f, 0f - ((Transform)component).localPosition.y, 0f); TextMeshProUGUI component2 = ((Component)val.transform.Find("PlayerNameButton").Find("PName")).GetComponent<TextMeshProUGUI>(); ((TMP_Text)component2).text = playerScript.playerUsername; Slider playerVolume = ((Component)val.transform.Find("PlayerVolumeSlider")).GetComponent<Slider>(); int finalIndex = j; ((UnityEvent<float>)(object)playerVolume.onValueChanged).AddListener((UnityAction<float>)delegate(float f) { if (playerScript.isPlayerControlled || playerScript.isPlayerDead) { float num = f / playerVolume.maxValue + 1f; if (num <= -1f) { SoundManager.Instance.playerVoiceVolumes[finalIndex] = -70f; } else { SoundManager.Instance.playerVoiceVolumes[finalIndex] = num; } } }); if (StartOfRound.Instance.localPlayerController.playerClientId == playerScript.playerClientId) { ((Component)playerVolume).gameObject.SetActive(false); ((Component)val.transform.Find("Text (1)")).gameObject.SetActive(false); } Button component3 = ((Component)val.transform.Find("KickButton")).GetComponent<Button>(); ((UnityEvent)component3.onClick).AddListener((UnityAction)delegate { __instance.KickUserFromServer(finalIndex); }); if (!GameNetworkManager.Instance.isHostingGame) { ((Component)component3).gameObject.SetActive(false); } Button component4 = ((Component)val.transform.Find("ProfileIcon")).GetComponent<Button>(); ButtonClickedEvent onClick = component4.onClick; object obj = <>c.<>9__2_2; if (obj == null) { UnityAction val2 = delegate { if (!GameNetworkManager.Instance.disableSteam) { } }; <>c.<>9__2_2 = val2; obj = (object)val2; } ((UnityEvent)onClick).AddListener((UnityAction)obj); } } } [HarmonyPatch(typeof(HUDManager), "UpdateBoxesSpectateUI")] public static class SpectatorBoxUpdatePatch { public static void Postfix(HUDManager __instance) { //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) Dictionary<Animator, PlayerControllerB> fieldValue = ReflectionUtils.GetFieldValue<Dictionary<Animator, PlayerControllerB>>(__instance, "spectatingPlayerBoxes"); int num = -64; int num2 = 0; int num3 = 0; int num4 = -70; int num5 = 230; int num6 = 4; foreach (KeyValuePair<Animator, PlayerControllerB> item in fieldValue) { if (((Component)item.Key).gameObject.activeInHierarchy) { GameObject gameObject = ((Component)item.Key).gameObject; RectTransform component = gameObject.GetComponent<RectTransform>(); int num7 = (int)Math.Floor((double)num3 / (double)num6); int num8 = num3 % num6; int num9 = num8 * num4; int num10 = num7 * num5; component.anchoredPosition = Vector2.op_Implicit(new Vector3((float)(num + num10), (float)(num2 + num9), 0f)); num3++; } } } } [HarmonyPatch(typeof(HUDManager), "FillEndGameStats")] public static class HudFillEndGameFix { public static bool Prefix(HUDManager __instance, EndOfGameStats stats) { //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Invalid comparison between Unknown and I4 int num = 0; int num2 = 0; for (int i = 0; i < __instance.statsUIElements.playerNamesText.Length; i++) { PlayerControllerB val = __instance.playersManager.allPlayerScripts[i]; ((TMP_Text)__instance.statsUIElements.playerNamesText[i]).text = ""; ((Behaviour)__instance.statsUIElements.playerStates[i]).enabled = false; ((TMP_Text)__instance.statsUIElements.playerNotesText[i]).text = "Notes: \n"; if (val.disconnectedMidGame || val.isPlayerDead || val.isPlayerControlled) { if (val.isPlayerDead) { num++; } else if (val.isPlayerControlled) { num2++; } ((TMP_Text)__instance.statsUIElements.playerNamesText[i]).text = __instance.playersManager.allPlayerScripts[i].playerUsername; ((Behaviour)__instance.statsUIElements.playerStates[i]).enabled = true; if (__instance.playersManager.allPlayerScripts[i].isPlayerDead) { if ((int)__instance.playersManager.allPlayerScripts[i].causeOfDeath == 10) { __instance.statsUIElements.playerStates[i].sprite = __instance.statsUIElements.missingIcon; } else { __instance.statsUIElements.playerStates[i].sprite = __instance.statsUIElements.deceasedIcon; } } else { __instance.statsUIElements.playerStates[i].sprite = __instance.statsUIElements.aliveIcon; } for (int j = 0; j < 3 && j < stats.allPlayerStats[i].playerNotes.Count; j++) { TextMeshProUGUI val2 = __instance.statsUIElements.playerNotesText[i]; ((TMP_Text)val2).text = ((TMP_Text)val2).text + "* " + stats.allPlayerStats[i].playerNotes[j] + "\n"; } } else { ((TMP_Text)__instance.statsUIElements.playerNotesText[i]).text = ""; } } ((TMP_Text)__instance.statsUIElements.quotaNumerator).text = RoundManager.Instance.scrapCollectedInLevel.ToString(); ((TMP_Text)__instance.statsUIElements.quotaDenominator).text = RoundManager.Instance.totalScrapValueInLevel.ToString(); if (StartOfRound.Instance.allPlayersDead) { ((Behaviour)__instance.statsUIElements.allPlayersDeadOverlay).enabled = true; ((TMP_Text)__instance.statsUIElements.gradeLetter).text = "F"; return false; } ((Behaviour)__instance.statsUIElements.allPlayersDeadOverlay).enabled = false; int num3 = 0; float num4 = (float)RoundManager.Instance.scrapCollectedInLevel / RoundManager.Instance.totalScrapValueInLevel; if (num2 == StartOfRound.Instance.connectedPlayersAmount + 1) { num3++; } else if (num > 1) { num3--; } if (num4 >= 0.99f) { num3 += 2; } else if (num4 >= 0.6f) { num3++; } else if (num4 <= 0.25f) { num3--; } switch (num3) { case -1: ((TMP_Text)__instance.statsUIElements.gradeLetter).text = "D"; return false; case 0: ((TMP_Text)__instance.statsUIElements.gradeLetter).text = "C"; return false; case 1: ((TMP_Text)__instance.statsUIElements.gradeLetter).text = "B"; return false; case 2: ((TMP_Text)__instance.statsUIElements.gradeLetter).text = "A"; return false; case 3: ((TMP_Text)__instance.statsUIElements.gradeLetter).text = "S"; return false; default: return false; } } } [HarmonyPatch(typeof(HUDManager), "Start")] public static class HudStartPatch { public static void Postfix(HUDManager __instance) { //IL_0082: 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_00bc: 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_00f6: 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) EndOfGameStatUIElements statsUIElements = __instance.statsUIElements; GameObject gameObject = ((Component)((Component)statsUIElements.playerNamesText[0]).gameObject.transform.parent).gameObject; GameObject gameObject2 = ((Component)gameObject.transform.parent.parent).gameObject; GameObject gameObject3 = ((Component)gameObject2.transform.Find("BGBoxes")).gameObject; gameObject2.transform.parent.Find("DeathScreen").SetSiblingIndex(3); gameObject3.transform.localScale = new Vector3(2.5f, 1f, 1f); MakePlayerHolder(4, gameObject, statsUIElements, new Vector3(426.9556f, -0.7932f, 0f)); MakePlayerHolder(5, gameObject, statsUIElements, new Vector3(426.9556f, -115.4483f, 0f)); MakePlayerHolder(6, gameObject, statsUIElements, new Vector3(-253.6783f, -115.4483f, 0f)); MakePlayerHolder(7, gameObject, statsUIElements, new Vector3(-253.6783f, -0.7932f, 0f)); for (int i = 8; i < MainClass.newPlayerCount; i++) { MakePlayerHolder(i, gameObject, statsUIElements, new Vector3(10000f, 10000f, 0f)); } } public static void MakePlayerHolder(int index, GameObject original, EndOfGameStatUIElements uiElements, Vector3 localPosition) { //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0055: 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) if (index + 1 <= MainClass.newPlayerCount) { GameObject val = Object.Instantiate<GameObject>(original); RectTransform component = val.GetComponent<RectTransform>(); RectTransform component2 = original.GetComponent<RectTransform>(); ((Transform)component).SetParent(((Transform)component2).parent); ((Transform)component).localScale = new Vector3(1f, 1f, 1f); ((Transform)component).localPosition = localPosition; GameObject gameObject = ((Component)val.transform.Find("PlayerName1")).gameObject; GameObject gameObject2 = ((Component)val.transform.Find("Notes")).gameObject; ((Transform)gameObject2.GetComponent<RectTransform>()).localPosition = new Vector3(-95.7222f, 43.3303f, 0f); GameObject gameObject3 = ((Component)val.transform.Find("Symbol")).gameObject; if (index >= uiElements.playerNamesText.Length) { Array.Resize(ref uiElements.playerNamesText, index + 1); Array.Resize(ref uiElements.playerStates, index + 1); Array.Resize(ref uiElements.playerNotesText, index + 1); } uiElements.playerNamesText[index] = gameObject.GetComponent<TextMeshProUGUI>(); uiElements.playerNotesText[index] = gameObject2.GetComponent<TextMeshProUGUI>(); uiElements.playerStates[index] = gameObject3.GetComponent<Image>(); } } } public static class PluginInformation { public const string PLUGIN_NAME = "MoreCompany"; public const string PLUGIN_VERSION = "1.7.2"; public const string PLUGIN_GUID = "me.swipez.melonloader.morecompany"; } [BepInPlugin("me.swipez.melonloader.morecompany", "MoreCompany", "1.7.2")] public class MainClass : BaseUnityPlugin { public static int newPlayerCount = 32; public static int maxPlayerCount = 50; public static bool showCosmetics = true; public static List<PlayerControllerB> notSupposedToExistPlayers = new List<PlayerControllerB>(); public static Texture2D mainLogo; public static GameObject quickMenuScrollParent; public static GameObject playerEntry; public static GameObject crewCountUI; public static GameObject cosmeticGUIInstance; public static GameObject cosmeticButton; public static ManualLogSource StaticLogger; public static Dictionary<int, List<string>> playerIdsAndCosmetics = new Dictionary<int, List<string>>(); public static string cosmeticSavePath = Application.persistentDataPath + "/morecompanycosmetics.txt"; public static string moreCompanySave = Application.persistentDataPath + "/morecompanysave.txt"; public static string dynamicCosmeticsPath = Paths.PluginPath + "/MoreCompanyCosmetics"; private void Awake() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown StaticLogger = ((BaseUnityPlugin)this).Logger; Harmony val = new Harmony("me.swipez.melonloader.morecompany"); try { val.PatchAll(); } catch (Exception ex) { StaticLogger.LogError((object)("Failed to patch: " + ex)); } ManualHarmonyPatches.ManualPatch(val); StaticLogger.LogInfo((object)"Loading MoreCompany..."); StaticLogger.LogInfo((object)("Checking: " + dynamicCosmeticsPath)); if (!Directory.Exists(dynamicCosmeticsPath)) { StaticLogger.LogInfo((object)"Creating cosmetics directory"); Directory.CreateDirectory(dynamicCosmeticsPath); } ReadSettingsFromFile(); ReadCosmeticsFromFile(); StaticLogger.LogInfo((object)"Read settings and cosmetics"); AssetBundle bundle = BundleUtilities.LoadBundleFromInternalAssembly("morecompany.assets", Assembly.GetExecutingAssembly()); AssetBundle val2 = BundleUtilities.LoadBundleFromInternalAssembly("morecompany.cosmetics", Assembly.GetExecutingAssembly()); CosmeticRegistry.LoadCosmeticsFromBundle(val2); val2.Unload(false); SteamFriends.OnGameLobbyJoinRequested += delegate(Lobby lobby, SteamId steamId) { newPlayerCount = ((Lobby)(ref lobby)).MaxMembers; }; SteamMatchmaking.OnLobbyEntered += delegate(Lobby lobby) { newPlayerCount = ((Lobby)(ref lobby)).MaxMembers; }; StaticLogger.LogInfo((object)"Loading USER COSMETICS..."); RecursiveCosmeticLoad(Paths.PluginPath); LoadAssets(bundle); StaticLogger.LogInfo((object)"Loaded MoreCompany FULLY"); } private void RecursiveCosmeticLoad(string directory) { string[] directories = Directory.GetDirectories(directory); foreach (string directory2 in directories) { RecursiveCosmeticLoad(directory2); } string[] files = Directory.GetFiles(directory); foreach (string text in files) { if (text.EndsWith(".cosmetics")) { AssetBundle val = AssetBundle.LoadFromFile(text); CosmeticRegistry.LoadCosmeticsFromBundle(val); val.Unload(false); } } } private void ReadCosmeticsFromFile() { if (File.Exists(cosmeticSavePath)) { string[] array = File.ReadAllLines(cosmeticSavePath); string[] array2 = array; foreach (string item in array2) { CosmeticRegistry.locallySelectedCosmetics.Add(item); } } } public static void WriteCosmeticsToFile() { string text = ""; foreach (string locallySelectedCosmetic in CosmeticRegistry.locallySelectedCosmetics) { text = text + locallySelectedCosmetic + "\n"; } File.WriteAllText(cosmeticSavePath, text); } public static void SaveSettingsToFile() { string text = ""; text = text + newPlayerCount + "\n"; text = text + showCosmetics + "\n"; File.WriteAllText(moreCompanySave, text); } public static void ReadSettingsFromFile() { if (File.Exists(moreCompanySave)) { string[] array = File.ReadAllLines(moreCompanySave); try { newPlayerCount = int.Parse(array[0]); showCosmetics = bool.Parse(array[1]); } catch (Exception) { StaticLogger.LogError((object)"Failed to read settings from file, resetting to default"); newPlayerCount = 32; showCosmetics = true; } } } private static void LoadAssets(AssetBundle bundle) { if (Object.op_Implicit((Object)(object)bundle)) { mainLogo = bundle.LoadPersistentAsset<Texture2D>("assets/morecompanyassets/morecompanytransparentred.png"); quickMenuScrollParent = bundle.LoadPersistentAsset<GameObject>("assets/morecompanyassets/quickmenuoverride.prefab"); playerEntry = bundle.LoadPersistentAsset<GameObject>("assets/morecompanyassets/playerlistslot.prefab"); cosmeticGUIInstance = bundle.LoadPersistentAsset<GameObject>("assets/morecompanyassets/testoverlay.prefab"); cosmeticButton = bundle.LoadPersistentAsset<GameObject>("assets/morecompanyassets/cosmeticinstance.prefab"); crewCountUI = bundle.LoadPersistentAsset<GameObject>("assets/morecompanyassets/crewcountfield.prefab"); bundle.Unload(false); } } public static void ResizePlayerCache(Dictionary<uint, Dictionary<int, NetworkObject>> ScenePlacedObjects) { //IL_0091: 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_01be: Unknown result type (might be due to invalid IL or missing references) //IL_025b: Unknown result type (might be due to invalid IL or missing references) //IL_0261: Expected O, but got Unknown StartOfRound instance = StartOfRound.Instance; if (instance.allPlayerObjects.Length == newPlayerCount) { return; } playerIdsAndCosmetics.Clear(); uint num = 10000u; int num2 = newPlayerCount - instance.allPlayerObjects.Length; int num3 = instance.allPlayerObjects.Length; GameObject val = instance.allPlayerObjects[3]; for (int i = 0; i < num2; i++) { uint num4 = num + (uint)i; GameObject val2 = Object.Instantiate<GameObject>(val); NetworkObject component = val2.GetComponent<NetworkObject>(); ReflectionUtils.SetFieldValue(component, "GlobalObjectIdHash", num4); Scene scene = ((Component)component).gameObject.scene; int handle = ((Scene)(ref scene)).handle; uint num5 = num4; if (!ScenePlacedObjects.ContainsKey(num5)) { ScenePlacedObjects.Add(num5, new Dictionary<int, NetworkObject>()); } if (ScenePlacedObjects[num5].ContainsKey(handle)) { string arg = (((Object)(object)ScenePlacedObjects[num5][handle] != (Object)null) ? ((Object)ScenePlacedObjects[num5][handle]).name : "Null Entry"); throw new Exception(((Object)component).name + " tried to registered with ScenePlacedObjects which already contains " + string.Format("the same {0} value {1} for {2}!", "GlobalObjectIdHash", num5, arg)); } ScenePlacedObjects[num5].Add(handle, component); ((Object)val2).name = $"Player ({4 + i})"; val2.transform.parent = null; PlayerControllerB componentInChildren = val2.GetComponentInChildren<PlayerControllerB>(); notSupposedToExistPlayers.Add(componentInChildren); componentInChildren.playerClientId = (ulong)(4 + i); componentInChildren.isPlayerControlled = false; componentInChildren.isPlayerDead = false; componentInChildren.DropAllHeldItems(false, false); componentInChildren.TeleportPlayer(instance.notSpawnedPosition.position, false, 0f, false, true); UnlockableSuit.SwitchSuitForPlayer(componentInChildren, 0, false); Array.Resize(ref instance.allPlayerObjects, instance.allPlayerObjects.Length + 1); Array.Resize(ref instance.allPlayerScripts, instance.allPlayerScripts.Length + 1); Array.Resize(ref instance.gameStats.allPlayerStats, instance.gameStats.allPlayerStats.Length + 1); Array.Resize(ref instance.playerSpawnPositions, instance.playerSpawnPositions.Length + 1); instance.allPlayerObjects[num3 + i] = val2; instance.gameStats.allPlayerStats[num3 + i] = new PlayerStats(); instance.allPlayerScripts[num3 + i] = componentInChildren; instance.playerSpawnPositions[num3 + i] = instance.playerSpawnPositions[3]; } } public static void EnablePlayerObjectsBasedOnConnected() { int connectedPlayersAmount = StartOfRound.Instance.connectedPlayersAmount; PlayerControllerB[] allPlayerScripts = StartOfRound.Instance.allPlayerScripts; foreach (PlayerControllerB val in allPlayerScripts) { for (int j = 0; j < connectedPlayersAmount + 1; j++) { if (!val.isPlayerControlled) { ((Component)val).gameObject.SetActive(false); } else { ((Component)val).gameObject.SetActive(true); } } } } } [HarmonyPatch(typeof(PlayerControllerB), "SendNewPlayerValuesServerRpc")] public static class SendNewPlayerValuesServerRpcPatch { public static ulong lastId; public static void Prefix(PlayerControllerB __instance, ulong newPlayerSteamId) { NetworkManager networkManager = ((NetworkBehaviour)__instance).NetworkManager; if (!((Object)(object)networkManager == (Object)null) && networkManager.IsListening && networkManager.IsServer) { lastId = newPlayerSteamId; } } } [HarmonyPatch(typeof(PlayerControllerB), "SendNewPlayerValuesClientRpc")] public static class SendNewPlayerValuesClientRpcPatch { public static void Prefix(PlayerControllerB __instance, ref ulong[] playerSteamIds) { //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Expected O, but got Unknown NetworkManager networkManager = ((NetworkBehaviour)__instance).NetworkManager; if ((Object)(object)networkManager == (Object)null || !networkManager.IsListening) { return; } if (StartOfRound.Instance.mapScreen.radarTargets.Count != MainClass.newPlayerCount) { List<PlayerControllerB> useless = new List<PlayerControllerB>(); foreach (PlayerControllerB notSupposedToExistPlayer in MainClass.notSupposedToExistPlayers) { if (Object.op_Implicit((Object)(object)notSupposedToExistPlayer)) { StartOfRound.Instance.mapScreen.radarTargets.Add(new TransformAndName(((Component)notSupposedToExistPlayer).transform, notSupposedToExistPlayer.playerUsername, false)); } else { useless.Add(notSupposedToExistPlayer); } } MainClass.notSupposedToExistPlayers.RemoveAll((PlayerControllerB x) => useless.Contains(x)); } if (!networkManager.IsServer) { return; } List<ulong> list = new List<ulong>(); for (int i = 0; i < MainClass.newPlayerCount; i++) { if (i == (int)__instance.playerClientId) { list.Add(SendNewPlayerValuesServerRpcPatch.lastId); } else { list.Add(__instance.playersManager.allPlayerScripts[i].playerSteamId); } } playerSteamIds = list.ToArray(); } } public static class HUDManagerBullshitPatch { public static bool ManualPrefix(HUDManager __instance) { return false; } } [HarmonyPatch(typeof(StartOfRound), "SyncShipUnlockablesClientRpc")] public static class SyncShipUnlockablePatch { public static void Prefix(StartOfRound __instance, ref int[] playerSuitIDs, bool shipLightsOn, Vector3[] placeableObjectPositions, Vector3[] placeableObjectRotations, int[] placeableObjects, int[] storedItems, int[] scrapValues, int[] itemSaveData) { NetworkManager networkManager = ((NetworkBehaviour)__instance).NetworkManager; if (!((Object)(object)networkManager == (Object)null) && networkManager.IsListening && networkManager.IsServer) { int[] array = new int[MainClass.newPlayerCount]; for (int i = 0; i < MainClass.newPlayerCount; i++) { array[i] = __instance.allPlayerScripts[i].currentSuitID; } playerSuitIDs = array; } } } [HarmonyPatch(typeof(NetworkSceneManager), "PopulateScenePlacedObjects")] public static class ScenePlacedObjectsInitPatch { public static void Postfix(ref Dictionary<uint, Dictionary<int, NetworkObject>> ___ScenePlacedObjects) { MainClass.ResizePlayerCache(___ScenePlacedObjects); } } [HarmonyPatch(typeof(GameNetworkManager), "LobbyDataIsJoinable")] public static class LobbyDataJoinablePatch { public static bool Prefix(ref bool __result) { __result = true; return false; } } [HarmonyPatch(typeof(NetworkConnectionManager), "HandleConnectionApproval")] public static class ConnectionApprovalTest { public static void Prefix(ulong ownerClientId, ConnectionApprovalResponse response) { if (Object.op_Implicit((Object)(object)StartOfRound.Instance)) { if (StartOfRound.Instance.connectedPlayersAmount >= MainClass.newPlayerCount) { response.Approved = false; response.Reason = "Server is full"; } else { response.Approved = true; } } } } [HarmonyPatch(typeof(SteamMatchmaking), "CreateLobbyAsync")] public static class LobbyThingPatch { public static void Prefix(ref int maxMembers) { MainClass.ReadSettingsFromFile(); maxMembers = MainClass.newPlayerCount; } } public class ManualHarmonyPatches { public static void ManualPatch(Harmony HarmonyInstance) { //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Expected O, but got Unknown HarmonyInstance.Patch((MethodBase)AccessTools.Method(typeof(HUDManager), "SyncAllPlayerLevelsServerRpc", new Type[0], (Type[])null), new HarmonyMethod(typeof(HUDManagerBullshitPatch).GetMethod("ManualPrefix")), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); } } public class MimicPatches { [HarmonyPatch(typeof(MaskedPlayerEnemy), "SetEnemyOutside")] public class MaskedPlayerEnemyOnEnablePatch { public static void Postfix(MaskedPlayerEnemy __instance) { //IL_00d2: 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) if (!((Object)(object)__instance.mimickingPlayer != (Object)null)) { return; } List<string> list = MainClass.playerIdsAndCosmetics[(int)__instance.mimickingPlayer.playerClientId]; Transform val = ((Component)__instance).transform.Find("ScavengerModel").Find("metarig"); CosmeticApplication component = ((Component)val).GetComponent<CosmeticApplication>(); if (Object.op_Implicit((Object)(object)component)) { component.ClearCosmetics(); Object.Destroy((Object)(object)component); } component = ((Component)val).gameObject.AddComponent<CosmeticApplication>(); foreach (string item in list) { component.ApplyCosmetic(item, startEnabled: true); } foreach (CosmeticInstance spawnedCosmetic in component.spawnedCosmetics) { Transform transform = ((Component)spawnedCosmetic).transform; transform.localScale *= 0.38f; } } } } public class ReflectionUtils { public static void InvokeMethod(object obj, string methodName, object[] parameters) { Type type = obj.GetType(); MethodInfo method = type.GetMethod(methodName, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); method.Invoke(obj, parameters); } public static void InvokeMethod(object obj, Type forceType, string methodName, object[] parameters) { MethodInfo method = forceType.GetMethod(methodName, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); method.Invoke(obj, parameters); } public static void SetPropertyValue(object obj, string propertyName, object value) { Type type = obj.GetType(); PropertyInfo property = type.GetProperty(propertyName, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); property.SetValue(obj, value); } public static T InvokeMethod<T>(object obj, string methodName, object[] parameters) { Type type = obj.GetType(); MethodInfo method = type.GetMethod(methodName, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); return (T)method.Invoke(obj, parameters); } public static T GetFieldValue<T>(object obj, string fieldName) { Type type = obj.GetType(); FieldInfo field = type.GetField(fieldName, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); return (T)field.GetValue(obj); } public static void SetFieldValue(object obj, string fieldName, object value) { Type type = obj.GetType(); FieldInfo field = type.GetField(fieldName, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); field.SetValue(obj, value); } } [HarmonyPatch(typeof(ShipTeleporter), "Awake")] public static class ShipTeleporterAwakePatch { public static void Postfix(ShipTeleporter __instance) { int[] array = new int[MainClass.newPlayerCount]; for (int i = 0; i < MainClass.newPlayerCount; i++) { array[i] = -1; } ReflectionUtils.SetFieldValue(__instance, "playersBeingTeleported", array); } } [HarmonyPatch(typeof(PlayerControllerB), "SpectateNextPlayer")] public static class SpectatePatches { public static bool Prefix(PlayerControllerB __instance) { //IL_00e5: Unknown result type (might be due to invalid IL or missing references) int num = 0; if ((Object)(object)__instance.spectatedPlayerScript != (Object)null) { num = (int)__instance.spectatedPlayerScript.playerClientId; } for (int i = 0; i < MainClass.newPlayerCount; i++) { num = (num + 1) % MainClass.newPlayerCount; if (!__instance.playersManager.allPlayerScripts[num].isPlayerDead && __instance.playersManager.allPlayerScripts[num].isPlayerControlled && (Object)(object)__instance.playersManager.allPlayerScripts[num] != (Object)(object)__instance) { __instance.spectatedPlayerScript = __instance.playersManager.allPlayerScripts[num]; __instance.SetSpectatedPlayerEffects(false); return false; } } if ((Object)(object)__instance.deadBody != (Object)null && ((Component)__instance.deadBody).gameObject.activeSelf) { __instance.spectateCameraPivot.position = __instance.deadBody.bodyParts[0].position; ReflectionUtils.InvokeMethod(__instance, "RaycastSpectateCameraAroundPivot", null); } StartOfRound.Instance.SetPlayerSafeInShip(); return false; } } [HarmonyPatch(typeof(SoundManager), "Start")] public static class SoundManagerStartPatch { public static void Postfix() { int num = MainClass.newPlayerCount - 4; int num2 = 4; for (int i = 0; i < num; i++) { Array.Resize(ref SoundManager.Instance.playerVoicePitches, SoundManager.Instance.playerVoicePitches.Length + 1); Array.Resize(ref SoundManager.Instance.playerVoicePitchTargets, SoundManager.Instance.playerVoicePitchTargets.Length + 1); Array.Resize(ref SoundManager.Instance.playerVoiceVolumes, SoundManager.Instance.playerVoiceVolumes.Length + 1); Array.Resize(ref SoundManager.Instance.playerVoicePitchLerpSpeed, SoundManager.Instance.playerVoicePitchLerpSpeed.Length + 1); Array.Resize(ref SoundManager.Instance.playerVoiceMixers, SoundManager.Instance.playerVoiceMixers.Length + 1); AudioMixerGroup val = ((IEnumerable<AudioMixerGroup>)Resources.FindObjectsOfTypeAll<AudioMixerGroup>()).FirstOrDefault((Func<AudioMixerGroup, bool>)((AudioMixerGroup x) => ((Object)x).name.Contains("Voice"))); SoundManager.Instance.playerVoicePitches[num2 + i] = 1f; SoundManager.Instance.playerVoicePitchTargets[num2 + i] = 1f; SoundManager.Instance.playerVoiceVolumes[num2 + i] = 0.5f; SoundManager.Instance.playerVoicePitchLerpSpeed[num2 + i] = 3f; SoundManager.Instance.playerVoiceMixers[num2 + i] = val; } } } [HarmonyPatch(typeof(StartOfRound), "GetPlayerSpawnPosition")] public static class SpawnPositionClampPatch { public static void Prefix(ref int playerNum, bool simpleTeleport = false) { if (playerNum > 3) { playerNum = 3; } } } [HarmonyPatch(typeof(StartOfRound), "OnClientConnect")] public static class OnClientConnectedPatch { public static bool Prefix(StartOfRound __instance, ulong clientId) { if (!((NetworkBehaviour)__instance).IsServer) { return false; } Debug.Log((object)"player connected"); Debug.Log((object)$"connected players #: {__instance.connectedPlayersAmount}"); try { List<int> list = __instance.ClientPlayerList.Values.ToList(); Debug.Log((object)$"Connecting new player on host; clientId: {clientId}"); int num = 0; for (int i = 1; i < MainClass.newPlayerCount; i++) { if (!list.Contains(i)) { num = i; break; } } __instance.allPlayerScripts[num].actualClientId = clientId; __instance.allPlayerObjects[num].GetComponent<NetworkObject>().ChangeOwnership(clientId); Debug.Log((object)$"New player assigned object id: {__instance.allPlayerObjects[num]}"); List<ulong> list2 = new List<ulong>(); for (int j = 0; j < __instance.allPlayerObjects.Length; j++) { NetworkObject component = __instance.allPlayerObjects[j].GetComponent<NetworkObject>(); if (!component.IsOwnedByServer) { list2.Add(component.OwnerClientId); } else if (j == 0) { list2.Add(NetworkManager.Singleton.LocalClientId); } else { list2.Add(999uL); } } int groupCredits = Object.FindObjectOfType<Terminal>().groupCredits; int profitQuota = TimeOfDay.Instance.profitQuota; int quotaFulfilled = TimeOfDay.Instance.quotaFulfilled; int num2 = (int)TimeOfDay.Instance.timeUntilDeadline; ReflectionUtils.InvokeMethod(__instance, "OnPlayerConnectedClientRpc", new object[10] { clientId, __instance.connectedPlayersAmount, list2.ToArray(), num, groupCredits, __instance.currentLevelID, profitQuota, num2, quotaFulfilled, __instance.randomMapSeed }); __instance.ClientPlayerList.Add(clientId, num); Debug.Log((object)$"client id connecting: {clientId} ; their corresponding player object id: {num}"); } catch (Exception arg) { Debug.LogError((object)$"Error occured in OnClientConnected! Shutting server down. clientId: {clientId}. Error: {arg}"); GameNetworkManager.Instance.disconnectionReasonMessage = "Error occured when a player attempted to join the server! Restart the application and please report the glitch!"; GameNetworkManager.Instance.Disconnect(); } return false; } } [HarmonyPatch(typeof(SteamLobbyManager), "LoadServerList")] public static class LoadServerListPatch { public static bool Prefix(SteamLobbyManager __instance) { OverrideMethod(__instance); return false; } private static async void OverrideMethod(SteamLobbyManager __instance) { if (GameNetworkManager.Instance.waitingForLobbyDataRefresh) { return; } ReflectionUtils.SetFieldValue(__instance, "refreshServerListTimer", 0f); ((TMP_Text)__instance.serverListBlankText).text = "Loading server list..."; ReflectionUtils.GetFieldValue<Lobby[]>(__instance, "currentLobbyList"); LobbySlot[] array = Object.FindObjectsOfType<LobbySlot>(); for (int i = 0; i < array.Length; i++) { Object.Destroy((Object)(object)((Component)array[i]).gameObject); } LobbyQuery val; switch (__instance.sortByDistanceSetting) { case 0: val = SteamMatchmaking.LobbyList; ((LobbyQuery)(ref val)).FilterDistanceClose(); break; case 1: val = SteamMatchmaking.LobbyList; ((LobbyQuery)(ref val)).FilterDistanceFar(); break; case 2: val = SteamMatchmaking.LobbyList; ((LobbyQuery)(ref val)).FilterDistanceWorldwide(); break; } Debug.Log((object)"Requested server list"); GameNetworkManager.Instance.waitingForLobbyDataRefresh = true; Lobby[] currentLobbyList; switch (__instance.sortByDistanceSetting) { case 0: val = SteamMatchmaking.LobbyList; val = ((LobbyQuery)(ref val)).FilterDistanceClose(); val = ((LobbyQuery)(ref val)).WithSlotsAvailable(1); val = ((LobbyQuery)(ref val)).WithKeyValue("vers", GameNetworkManager.Instance.gameVersionNum.ToString()); currentLobbyList = await ((LobbyQuery)(ref val)).RequestAsync(); break; case 1: val = SteamMatchmaking.LobbyList; val = ((LobbyQuery)(ref val)).FilterDistanceFar(); val = ((LobbyQuery)(ref val)).WithSlotsAvailable(1); val = ((LobbyQuery)(ref val)).WithKeyValue("vers", GameNetworkManager.Instance.gameVersionNum.ToString()); currentLobbyList = await ((LobbyQuery)(ref val)).RequestAsync(); break; default: val = SteamMatchmaking.LobbyList; val = ((LobbyQuery)(ref val)).FilterDistanceWorldwide(); val = ((LobbyQuery)(ref val)).WithSlotsAvailable(1); val = ((LobbyQuery)(ref val)).WithKeyValue("vers", GameNetworkManager.Instance.gameVersionNum.ToString()); currentLobbyList = await ((LobbyQuery)(ref val)).RequestAsync(); break; } GameNetworkManager.Instance.waitingForLobbyDataRefresh = false; if (currentLobbyList != null) { Debug.Log((object)"Got lobby list!"); ReflectionUtils.InvokeMethod(__instance, "DebugLogServerList", null); if (currentLobbyList.Length == 0) { ((TMP_Text)__instance.serverListBlankText).text = "No available servers to join."; } else { ((TMP_Text)__instance.serverListBlankText).text = ""; } ReflectionUtils.SetFieldValue(__instance, "lobbySlotPositionOffset", 0f); for (int j = 0; j < currentLobbyList.Length; j++) { Friend[] array2 = SteamFriends.GetBlocked().ToArray(); if (array2 != null) { for (int k = 0; k < array2.Length; k++) { Debug.Log((object)$"blocked user: {((Friend)(ref array2[k])).Name}; id: {array2[k].Id}"); if (((Lobby)(ref currentLobbyList[j])).IsOwnedBy(array2[k].Id)) { Debug.Log((object)("Hiding lobby by blocked user: " + ((Friend)(ref array2[k])).Name)); } } } else { Debug.Log((object)"Blocked users list is null"); } GameObject gameObject = Object.Instantiate<GameObject>(__instance.LobbySlotPrefab, __instance.levelListContainer); gameObject.GetComponent<RectTransform>().anchoredPosition = new Vector2(0f, 0f + ReflectionUtils.GetFieldValue<float>(__instance, "lobbySlotPositionOffset")); ReflectionUtils.SetFieldValue(__instance, "lobbySlotPositionOffset", ReflectionUtils.GetFieldValue<float>(__instance, "lobbySlotPositionOffset") - 42f); LobbySlot componentInChildren = gameObject.GetComponentInChildren<LobbySlot>(); ((TMP_Text)componentInChildren.LobbyName).text = ((Lobby)(ref currentLobbyList[j])).GetData("name"); ((TMP_Text)componentInChildren.playerCount).text = $"{((Lobby)(ref currentLobbyList[j])).MemberCount} / {((Lobby)(ref currentLobbyList[j])).MaxMembers}"; componentInChildren.lobbyId = ((Lobby)(ref currentLobbyList[j])).Id; componentInChildren.thisLobby = currentLobbyList[j]; ReflectionUtils.SetFieldValue(__instance, "currentLobbyList", currentLobbyList); } } else { Debug.Log((object)"Lobby list is null after request."); ((TMP_Text)__instance.serverListBlankText).text = "No available servers to join."; } } } [HarmonyPatch(typeof(GameNetworkManager), "Awake")] public static class GameNetworkAwakePatch { public static int originalVersion; public static void Postfix(GameNetworkManager __instance) { originalVersion = __instance.gameVersionNum; if (!AssemblyChecker.HasAssemblyLoaded("lc_api")) { __instance.gameVersionNum = 9999; } } } [HarmonyPatch(typeof(MenuManager), "Awake")] public static class MenuManagerVersionDisplayPatch { public static void Postfix(MenuManager __instance) { if ((Object)(object)GameNetworkManager.Instance != (Object)null && (Object)(object)__instance.versionNumberText != (Object)null) { ((TMP_Text)__instance.versionNumberText).text = $"v{GameNetworkAwakePatch.originalVersion} (MC)"; } } } } namespace MoreCompany.Utils { public class AssemblyChecker { public static bool HasAssemblyLoaded(string name) { Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies(); Assembly[] array = assemblies; foreach (Assembly assembly in array) { if (assembly.GetName().Name.ToLower().Equals(name)) { return true; } } return false; } } public class BundleUtilities { public static byte[] GetResourceBytes(string filename, Assembly assembly) { string[] manifestResourceNames = assembly.GetManifestResourceNames(); foreach (string text in manifestResourceNames) { if (!text.Contains(filename)) { continue; } using Stream stream = assembly.GetManifestResourceStream(text); if (stream == null) { return null; } byte[] array = new byte[stream.Length]; stream.Read(array, 0, array.Length); return array; } return null; } public static AssetBundle LoadBundleFromInternalAssembly(string filename, Assembly assembly) { return AssetBundle.LoadFromMemory(GetResourceBytes(filename, assembly)); } } public static class AssetBundleExtension { public static T LoadPersistentAsset<T>(this AssetBundle bundle, string name) where T : Object { Object val = bundle.LoadAsset(name); if (val != (Object)null) { val.hideFlags = (HideFlags)32; return (T)(object)val; } return default(T); } } } namespace MoreCompany.Cosmetics { public class CosmeticApplication : MonoBehaviour { public Transform head; public Transform hip; public Transform lowerArmRight; public Transform shinLeft; public Transform shinRight; public Transform chest; public List<CosmeticInstance> spawnedCosmetics = new List<CosmeticInstance>(); public void Awake() { head = ((Component)this).transform.Find("spine").Find("spine.001").Find("spine.002") .Find("spine.003") .Find("spine.004"); chest = ((Component)this).transform.Find("spine").Find("spine.001").Find("spine.002") .Find("spine.003"); lowerArmRight = ((Component)this).transform.Find("spine").Find("spine.001").Find("spine.002") .Find("spine.003") .Find("shoulder.R") .Find("arm.R_upper") .Find("arm.R_lower"); hip = ((Component)this).transform.Find("spine"); shinLeft = ((Component)this).transform.Find("spine").Find("thigh.L").Find("shin.L"); shinRight = ((Component)this).transform.Find("spine").Find("thigh.R").Find("shin.R"); RefreshAllCosmeticPositions(); } private void OnDisable() { foreach (CosmeticInstance spawnedCosmetic in spawnedCosmetics) { ((Component)spawnedCosmetic).gameObject.SetActive(false); } } private void OnEnable() { foreach (CosmeticInstance spawnedCosmetic in spawnedCosmetics) { ((Component)spawnedCosmetic).gameObject.SetActive(true); } } public void ClearCosmetics() { foreach (CosmeticInstance spawnedCosmetic in spawnedCosmetics) { Object.Destroy((Object)(object)((Component)spawnedCosmetic).gameObject); } spawnedCosmetics.Clear(); } public void ApplyCosmetic(string cosmeticId, bool startEnabled) { if (CosmeticRegistry.cosmeticInstances.ContainsKey(cosmeticId)) { CosmeticInstance cosmeticInstance = CosmeticRegistry.cosmeticInstances[cosmeticId]; GameObject val = Object.Instantiate<GameObject>(((Component)cosmeticInstance).gameObject); val.SetActive(startEnabled); CosmeticInstance component = val.GetComponent<CosmeticInstance>(); spawnedCosmetics.Add(component); if (startEnabled) { ParentCosmetic(component); } } } public void RefreshAllCosmeticPositions() { foreach (CosmeticInstance spawnedCosmetic in spawnedCosmetics) { ParentCosmetic(spawnedCosmetic); } } private void ParentCosmetic(CosmeticInstance cosmeticInstance) { //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) Transform val = null; switch (cosmeticInstance.cosmeticType) { case CosmeticType.HAT: val = head; break; case CosmeticType.R_LOWER_ARM: val = lowerArmRight; break; case CosmeticType.HIP: val = hip; break; case CosmeticType.L_SHIN: val = shinLeft; break; case CosmeticType.R_SHIN: val = shinRight; break; case CosmeticType.CHEST: val = chest; break; } ((Component)cosmeticInstance).transform.position = val.position; ((Component)cosmeticInstance).transform.rotation = val.rotation; ((Component)cosmeticInstance).transform.parent = val; } } public class CosmeticInstance : MonoBehaviour { public CosmeticType cosmeticType; public string cosmeticId; public Texture2D icon; } public class CosmeticGeneric { public virtual string gameObjectPath { get; } public virtual string cosmeticId { get; } public virtual string textureIconPath { get; } public CosmeticType cosmeticType { get; } public void LoadFromBundle(AssetBundle bundle) { GameObject val = bundle.LoadPersistentAsset<GameObject>(gameObjectPath); Texture2D icon = bundle.LoadPersistentAsset<Texture2D>(textureIconPath); CosmeticInstance cosmeticInstance = val.AddComponent<CosmeticInstance>(); cosmeticInstance.cosmeticId = cosmeticId; cosmeticInstance.icon = icon; cosmeticInstance.cosmeticType = cosmeticType; MainClass.StaticLogger.LogInfo((object)("Loaded cosmetic: " + cosmeticId + " from bundle: " + ((Object)bundle).name)); CosmeticRegistry.cosmeticInstances.Add(cosmeticId, cosmeticInstance); } } public enum CosmeticType { HAT, WRIST, CHEST, R_LOWER_ARM, HIP, L_SHIN, R_SHIN } public class CosmeticRegistry { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static UnityAction <>9__8_0; public static UnityAction <>9__8_1; internal void <SpawnCosmeticGUI>b__8_0() { MainClass.showCosmetics = true; MainClass.SaveSettingsToFile(); } internal void <SpawnCosmeticGUI>b__8_1() { MainClass.showCosmetics = false; MainClass.SaveSettingsToFile(); } } public static Dictionary<string, CosmeticInstance> cosmeticInstances = new Dictionary<string, CosmeticInstance>(); public static GameObject cosmeticGUI; private static GameObject displayGuy; private static CosmeticApplication cosmeticApplication; public static List<string> locallySelectedCosmetics = new List<string>(); public const float COSMETIC_PLAYER_SCALE_MULT = 0.38f; public static void LoadCosmeticsFromBundle(AssetBundle bundle) { string[] allAssetNames = bundle.GetAllAssetNames(); foreach (string text in allAssetNames) { if (text.EndsWith(".prefab")) { GameObject val = bundle.LoadPersistentAsset<GameObject>(text); CosmeticInstance component = val.GetComponent<CosmeticInstance>(); if (!((Object)(object)component == (Object)null)) { MainClass.StaticLogger.LogInfo((object)("Loaded cosmetic: " + component.cosmeticId + " from bundle")); cosmeticInstances.Add(component.cosmeticId, component); } } } } public static void LoadCosmeticsFromAssembly(Assembly assembly, AssetBundle bundle) { Type[] types = assembly.GetTypes(); foreach (Type type in types) { if (type.IsSubclassOf(typeof(CosmeticGeneric))) { CosmeticGeneric cosmeticGeneric = (CosmeticGeneric)type.GetConstructor(new Type[0]).Invoke(new object[0]); cosmeticGeneric.LoadFromBundle(bundle); } } } public static void SpawnCosmeticGUI() { //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Expected O, but got Unknown //IL_016b: 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: Expected O, but got Unknown cosmeticGUI = Object.Instantiate<GameObject>(MainClass.cosmeticGUIInstance); ((Component)cosmeticGUI.transform.Find("Canvas").Find("GlobalScale")).transform.localScale = new Vector3(2f, 2f, 2f); displayGuy = ((Component)cosmeticGUI.transform.Find("Canvas").Find("GlobalScale").Find("CosmeticsScreen") .Find("ObjectHolder") .Find("ScavengerModel") .Find("metarig")).gameObject; cosmeticApplication = displayGuy.AddComponent<CosmeticApplication>(); GameObject gameObject = ((Component)cosmeticGUI.transform.Find("Canvas").Find("GlobalScale").Find("CosmeticsScreen") .Find("EnableButton")).gameObject; ButtonClickedEvent onClick = gameObject.GetComponent<Button>().onClick; object obj = <>c.<>9__8_0; if (obj == null) { UnityAction val = delegate { MainClass.showCosmetics = true; MainClass.SaveSettingsToFile(); }; <>c.<>9__8_0 = val; obj = (object)val; } ((UnityEvent)onClick).AddListener((UnityAction)obj); GameObject gameObject2 = ((Component)cosmeticGUI.transform.Find("Canvas").Find("GlobalScale").Find("CosmeticsScreen") .Find("DisableButton")).gameObject; ButtonClickedEvent onClick2 = gameObject2.GetComponent<Button>().onClick; object obj2 = <>c.<>9__8_1; if (obj2 == null) { UnityAction val2 = delegate { MainClass.showCosmetics = false; MainClass.SaveSettingsToFile(); }; <>c.<>9__8_1 = val2; obj2 = (object)val2; } ((UnityEvent)onClick2).AddListener((UnityAction)obj2); if (MainClass.showCosmetics) { gameObject.SetActive(false); gameObject2.SetActive(true); } else { gameObject.SetActive(true); gameObject2.SetActive(false); } PopulateCosmetics(); UpdateCosmeticsOnDisplayGuy(startEnabled: false); } public static void PopulateCosmetics() { //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_0214: Unknown result type (might be due to invalid IL or missing references) //IL_021e: Expected O, but got Unknown GameObject gameObject = ((Component)cosmeticGUI.transform.Find("Canvas").Find("GlobalScale").Find("CosmeticsScreen") .Find("CosmeticsHolder") .Find("Content")).gameObject; List<Transform> list = new List<Transform>(); for (int i = 0; i < gameObject.transform.childCount; i++) { list.Add(gameObject.transform.GetChild(i)); } foreach (Transform item in list) { Object.Destroy((Object)(object)((Component)item).gameObject); } foreach (KeyValuePair<string, CosmeticInstance> cosmeticInstance in cosmeticInstances) { GameObject val = Object.Instantiate<GameObject>(MainClass.cosmeticButton, gameObject.transform); val.transform.localScale = Vector3.one; GameObject disabledOverlay = ((Component)val.transform.Find("Deselected")).gameObject; disabledOverlay.SetActive(true); GameObject enabledOverlay = ((Component)val.transform.Find("Selected")).gameObject; enabledOverlay.SetActive(true); if (IsEquipped(cosmeticInstance.Value.cosmeticId)) { enabledOverlay.SetActive(true); disabledOverlay.SetActive(false); } else { enabledOverlay.SetActive(false); disabledOverlay.SetActive(true); } RawImage component = ((Component)val.transform.Find("Icon")).GetComponent<RawImage>(); component.texture = (Texture)(object)cosmeticInstance.Value.icon; Button component2 = val.GetComponent<Button>(); ((UnityEvent)component2.onClick).AddListener((UnityAction)delegate { ToggleCosmetic(cosmeticInstance.Value.cosmeticId); if (IsEquipped(cosmeticInstance.Value.cosmeticId)) { enabledOverlay.SetActive(true); disabledOverlay.SetActive(false); } else { enabledOverlay.SetActive(false); disabledOverlay.SetActive(true); } MainClass.WriteCosmeticsToFile(); UpdateCosmeticsOnDisplayGuy(startEnabled: true); }); } } private static Color HexToColor(string hex) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) Color result = default(Color); ColorUtility.TryParseHtmlString(hex, ref result); return result; } public static void UpdateCosmeticsOnDisplayGuy(bool startEnabled) { cosmeticApplication.ClearCosmetics(); foreach (string locallySelectedCosmetic in locallySelectedCosmetics) { cosmeticApplication.ApplyCosmetic(locallySelectedCosmetic, startEnabled); } foreach (CosmeticInstance spawnedCosmetic in cosmeticApplication.spawnedCosmetics) { RecursiveLayerChange(((Component)spawnedCosmetic).transform, 5); } } private static void RecursiveLayerChange(Transform transform, int layer) { ((Component)transform).gameObject.layer = layer; for (int i = 0; i < transform.childCount; i++) { RecursiveLayerChange(transform.GetChild(i), layer); } } public static bool IsEquipped(string cosmeticId) { return locallySelectedCosmetics.Contains(cosmeticId); } public static void ToggleCosmetic(string cosmeticId) { if (locallySelectedCosmetics.Contains(cosmeticId)) { locallySelectedCosmetics.Remove(cosmeticId); } else { locallySelectedCosmetics.Add(cosmeticId); } } } } namespace MoreCompany.Behaviors { public class SpinDragger : MonoBehaviour, IPointerDownHandler, IEventSystemHandler, IPointerUpHandler { public float speed = 1f; private Vector2 lastMousePosition; private bool dragging = false; private Vector3 rotationalVelocity = Vector3.zero; public float dragSpeed = 1f; public float airDrag = 0.99f; public GameObject target; private void Update() { //IL_0076: 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_0086: 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_00a1: 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_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0038: 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_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) if (dragging) { Vector3 val = Vector2.op_Implicit(((InputControl<Vector2>)(object)((Pointer)Mouse.current).position).ReadValue() - lastMousePosition); rotationalVelocity += new Vector3(0f, 0f - val.x, 0f) * dragSpeed; lastMousePosition = ((InputControl<Vector2>)(object)((Pointer)Mouse.current).position).ReadValue(); } rotationalVelocity *= airDrag; target.transform.Rotate(rotationalVelocity * Time.deltaTime * speed, (Space)0); } public void OnPointerDown(PointerEventData eventData) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) lastMousePosition = ((InputControl<Vector2>)(object)((Pointer)Mouse.current).position).ReadValue(); dragging = true; } public void OnPointerUp(PointerEventData eventData) { dragging = false; } } }
BepInEx/plugins/Ozone-BepInUtils/NicholaScott.BepInEx.Utils.dll
Decompiled a year agousing System; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using HarmonyLib; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("NicholaScott.BepInEx.Utils")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("NicholaScott.BepInEx.Utils")] [assembly: AssemblyCopyright("Copyright © 2023")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("40BD9160-E0A3-402F-AE4F-059B39509F43")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")] [assembly: AssemblyVersion("1.0.0.0")] namespace NicholaScott.BepInEx.Utils { [BepInPlugin("NicholaScott.BepInEx.Utils", "BepInUtils", "1.2.0")] public class BepInUtils : BaseUnityPlugin { public void Awake() { ((BaseUnityPlugin)this).Logger.LogInfo((object)"System loaded."); } } } namespace NicholaScott.BepInEx.Utils.Resources { public static class Extensions { public static byte[] ReadAllBytes(this Stream inStream) { if (inStream is MemoryStream memoryStream) { return memoryStream.ToArray(); } using MemoryStream memoryStream2 = new MemoryStream(); inStream.CopyTo(memoryStream2); return memoryStream2.ToArray(); } } } namespace NicholaScott.BepInEx.Utils.Patching { [AttributeUsage(AttributeTargets.Class)] public class Production : Attribute { } public static class Extensions { public static Harmony PatchAttribute<TAttr>(this Assembly sourceAssembly, string guid, Action<object> logMethod = null) where TAttr : Attribute { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Expected O, but got Unknown Harmony val = new Harmony(string.Join(".", guid, typeof(TAttr).Name)); foreach (Type item in from t in sourceAssembly.GetTypes() where t.IsClass && t.GetCustomAttributes(typeof(TAttr)).Any() select t) { int num = val.GetPatchedMethods().Count(); val.PatchAll(item); int num2 = val.GetPatchedMethods().Count(); int num3 = num2 - num; logMethod?.Invoke(string.Format("[{0}] Patched class {1}, containing {2} method{3}", typeof(TAttr).Name, item.Name, num3, (num3 > 1) ? "s." : ".")); } return val; } } } namespace NicholaScott.BepInEx.Utils.Instancing { public class AutoSingleton<TPrepare> where TPrepare : Object { private static TPrepare _instance; public static TPrepare Instance { get { if (!Object.op_Implicit((Object)(object)_instance)) { _instance = Object.FindObjectOfType<TPrepare>(); } return _instance; } } } public class Singleton<TPrepare> { public static TPrepare Instance; public static ManualLogSource Logger { get { object? obj = typeof(BaseUnityPlugin).GetProperty("Logger", BindingFlags.Instance | BindingFlags.NonPublic)?.GetGetMethod(nonPublic: true)?.Invoke(Instance, Array.Empty<object>()); return (ManualLogSource)((obj is ManualLogSource) ? obj : null); } } } public class Singleton<TPrepare, TConfig> : Singleton<TPrepare> { public static TConfig Configuration; } } namespace NicholaScott.BepInEx.Utils.Configuration { [AttributeUsage(AttributeTargets.Field)] public class ConfigEntryDefinition : Attribute { public string Category; public string Name; public string Description; } public static class Extensions { public static TStruct BindStruct<TStruct>(this ConfigFile config, TStruct defaults) where TStruct : struct { //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Expected O, but got Unknown //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Expected O, but got Unknown object obj = new TStruct(); FieldInfo[] fields = typeof(TStruct).GetFields(); foreach (FieldInfo fieldInfo in fields) { ConfigEntryDefinition configEntryDefinition = fieldInfo.GetCustomAttribute<ConfigEntryDefinition>() ?? new ConfigEntryDefinition(); configEntryDefinition.Category = configEntryDefinition.Category ?? "General"; configEntryDefinition.Name = configEntryDefinition.Name ?? fieldInfo.Name; configEntryDefinition.Description = configEntryDefinition.Description ?? ""; object obj2 = ((typeof(ConfigFile).GetMethods()?.Where((MethodInfo m) => m.IsGenericMethod && m.Name.Contains("Bind") && m.GetParameters()[0].ParameterType == typeof(ConfigDefinition)).First())?.MakeGenericMethod(fieldInfo.FieldType))?.Invoke(config, new object[3] { (object)new ConfigDefinition(configEntryDefinition.Category, configEntryDefinition.Name), fieldInfo.GetValue(defaults), (object)new ConfigDescription(configEntryDefinition.Description, (AcceptableValueBase)null, Array.Empty<object>()) }); object obj3 = (obj2?.GetType().GetProperty("Value"))?.GetGetMethod().Invoke(obj2, null); fieldInfo.SetValue(obj, obj3 ?? fieldInfo.GetValue(defaults)); } return (TStruct)obj; } } }
BepInEx/plugins/Ozone-Glow_Steps/NicholaScott.LethalCompany.GlowSteps.dll
Decompiled a year agousing System; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using GameNetcodeStuff; using HarmonyLib; using NicholaScott.BepInEx.Utils.Configuration; using NicholaScott.BepInEx.Utils.Instancing; using NicholaScott.BepInEx.Utils.Patching; using NicholaScott.BepInEx.Utils.Resources; using NicholaScott.LethalCompany.GlowSteps.UnityScripts; using Unity.Netcode; using UnityEngine; using UnityEngine.Pool; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("NicholaScott.LethalCompany.GlowSteps")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("NicholaScott.LethalCompany.GlowSteps")] [assembly: AssemblyCopyright("Copyright © 2023")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("F0F641E1-26A9-4BAE-8411-9D3681207A6F")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")] [assembly: AssemblyVersion("1.0.0.0")] namespace NicholaScott.LethalCompany.GlowSteps { public class FootstepManager : MonoBehaviour { public readonly List<GlowingFootstep.Data> FootstepData = new List<GlowingFootstep.Data>(); public readonly FootstepPool PooledObjects = new FootstepPool(); private static Material _catwalkMaterial; public static Material CatwalkMaterial { get { if ((Object)(object)_catwalkMaterial == (Object)null) { GameObject obj = GameObject.Find("Environment/HangarShip/CatwalkShip"); object catwalkMaterial; if (obj == null) { catwalkMaterial = null; } else { Renderer component = obj.GetComponent<Renderer>(); catwalkMaterial = ((component != null) ? component.material : null); } _catwalkMaterial = (Material)catwalkMaterial; } return _catwalkMaterial; } } public void Start() { ((MonoBehaviour)this).InvokeRepeating("UpdateAllFootstepData", 1f, Singleton<GlowSteps, GlowSteps.Configuration>.Configuration.UpdateRate); } public void AddNewFootstep(GlowingFootstep.Data footstepData) { FootstepData.Add(footstepData); } public void UpdateAllFootstepData() { if ((Object)(object)CatwalkMaterial == (Object)null) { return; } for (int i = 0; i < FootstepData.Count; i++) { GlowingFootstep.Data data = FootstepData[i]; data.UpdateFootstepData(Singleton<GlowSteps, GlowSteps.Configuration>.Configuration.UpdateRate); if (data.IsEnabled && data.ShouldDraw) { data.Linked.SyncColorIntensity(data); } if (!data.IsEnabled && data.ShouldDraw) { GlowingFootstep glowingFootstep = ((ObjectPool<GlowingFootstep>)PooledObjects).Get(); data.IsEnabled = true; data.Linked = glowingFootstep; glowingFootstep.SyncAll(data); } if (data.IsEnabled && !data.ShouldDraw) { ((ObjectPool<GlowingFootstep>)PooledObjects).Release(data.Linked); data.IsEnabled = false; } FootstepData[i] = data; } FootstepData.RemoveAll((GlowingFootstep.Data d) => !d.IsEnabled && !d.ShouldDraw && d.TimeLeftAlive <= 0f); } } [Production] public static class FootstepPatcher { private static Dictionary<ulong, float> _leftFoots = new Dictionary<ulong, float>(); [HarmonyPatch(typeof(Terminal), "Start")] [HarmonyPostfix] public static void CreateFootstepManager(Terminal __instance) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Expected O, but got Unknown if (!((Object)(object)Singleton<GlowSteps>.Instance.footyManager != (Object)null)) { GameObject val = new GameObject("Footstep Manager", new Type[1] { typeof(FootstepManager) }); Singleton<GlowSteps>.Instance.footyManager = val.GetComponent<FootstepManager>(); Object.DontDestroyOnLoad((Object)(object)((Component)Singleton<GlowSteps>.Instance.footyManager).gameObject); } } [HarmonyPatch(typeof(PlayerControllerB), "PlayFootstepSound")] [HarmonyPrefix] public static void AddPositionToTracking(PlayerControllerB __instance) { //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: 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_00d5: 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) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Unknown result type (might be due to invalid IL or missing references) //IL_0164: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Unknown result type (might be due to invalid IL or missing references) //IL_017e: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_0183: Unknown result type (might be due to invalid IL or missing references) //IL_01af: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: Unknown result type (might be due to invalid IL or missing references) //IL_01c8: Unknown result type (might be due to invalid IL or missing references) //IL_01cd: Unknown result type (might be due to invalid IL or missing references) //IL_01d9: Unknown result type (might be due to invalid IL or missing references) //IL_01e3: Unknown result type (might be due to invalid IL or missing references) //IL_01ea: 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) GlowSteps.Configuration configuration = Singleton<GlowSteps, GlowSteps.Configuration>.Configuration; int strength = ((!((NetworkBehaviour)__instance).IsOwner) ? 2 : (__instance.isSprinting ? 3 : ((__instance.isCrouching || __instance.isExhausted || __instance.isMovementHindered != 0) ? 1 : 2))); if ((!((NetworkBehaviour)__instance).IsOwner || __instance.isSprinting) && (__instance.isInsideFactory || !configuration.InFactory)) { if (!_leftFoots.ContainsKey(__instance.playerSteamId)) { _leftFoots.Add(__instance.playerSteamId, -1f); } float num = _leftFoots[__instance.playerSteamId]; Transform transform = ((Component)__instance).transform; Ray val = default(Ray); ((Ray)(ref val))..ctor(transform.position + transform.right * 0.2f * num, Vector3.down); RaycastHit val2 = default(RaycastHit); if (Physics.Raycast(val, ref val2, 10f, LayerMask.GetMask(new string[3] { "Room", "Railing", "Default" }))) { Vector3 val3 = new Vector3((float)((__instance.playerSteamId & 0xFF0000) >> 16), (float)((__instance.playerSteamId & 0xFF00) >> 8), (float)(__instance.playerSteamId & 0xFF)) / 255f; GlowingFootstep.Data footstepData = new GlowingFootstep.Data { Color = (((NetworkBehaviour)__instance).IsOwner ? configuration.Color : val3), LeftFoot = (num <= 0f), Strength = strength, TimeLeftAlive = configuration.SecondsUntilFade, Position = ((RaycastHit)(ref val2)).point + new Vector3(0f, 0.001f, 0f), Rotation = Quaternion.LookRotation(((Component)__instance).transform.forward * -1f, ((RaycastHit)(ref val2)).normal) }; Singleton<GlowSteps>.Instance.footyManager.AddNewFootstep(footstepData); _leftFoots[__instance.playerSteamId] *= -1f; } } } } public class FootstepPool : ObjectPool<GlowingFootstep> { public FootstepPool() : base((Func<GlowingFootstep>)CreateNewFootstep, (Action<GlowingFootstep>)delegate(GlowingFootstep fs) { ((Component)fs).gameObject.SetActive(true); }, (Action<GlowingFootstep>)delegate(GlowingFootstep fs) { ((Component)fs).gameObject.SetActive(false); }, (Action<GlowingFootstep>)DestroyFootstep, true, 10, 10000) { } private static GlowingFootstep CreateNewFootstep() { //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Expected O, but got Unknown Singleton<GlowSteps>.Logger.LogInfo((object)($"Creating new footstep object in pool. Object count {((ObjectPool<GlowingFootstep>)Singleton<GlowSteps>.Instance.footyManager.PooledObjects).CountAll} " + $"& active {((ObjectPool<GlowingFootstep>)Singleton<GlowSteps>.Instance.footyManager.PooledObjects).CountActive}")); GameObject val = new GameObject("Glow Step", new Type[1] { typeof(GlowingFootstep) }); val.transform.SetParent(((Component)Singleton<GlowSteps>.Instance.footyManager).transform); return val.GetComponent<GlowingFootstep>(); } private static void DestroyFootstep(GlowingFootstep footstep) { Singleton<GlowSteps>.Logger.LogInfo((object)($"Destroying footstep object in pool. Object count {((ObjectPool<GlowingFootstep>)Singleton<GlowSteps>.Instance.footyManager.PooledObjects).CountAll} " + $"& active {((ObjectPool<GlowingFootstep>)Singleton<GlowSteps>.Instance.footyManager.PooledObjects).CountActive}")); Object.Destroy((Object)(object)((Component)footstep).gameObject); } } [BepInDependency("NicholaScott.BepInEx.Utils", "1.2.0")] [BepInPlugin("NicholaScott.LethalCompany.GlowSteps", "Glow Steps", "1.1.2")] public class GlowSteps : BaseUnityPlugin { public struct Configuration { [ConfigEntryDefinition(Description = "The distance until footsteps are no longer visible.")] public float DistanceFalloff; public float SecondsUntilFade; [ConfigEntryDefinition(Description = "The rate to update footsteps. This should be kept <= 0.1")] public float UpdateRate; [ConfigEntryDefinition(Description = "Whether the footsteps show up only in the factory or outside as well.")] public bool InFactory; [ConfigEntryDefinition(Description = "Three normalized(0-1) numbers representing an RGB value.")] public Vector3 Color; } public readonly Dictionary<string, Texture2D> FootstepTexts = new Dictionary<string, Texture2D>(); public FootstepManager footyManager; public void Awake() { //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_007e: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0098: 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_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) Singleton<GlowSteps>.Instance = this; Singleton<GlowSteps, Configuration>.Configuration = Extensions.BindStruct<Configuration>(((BaseUnityPlugin)this).Config, new Configuration { DistanceFalloff = 20f, SecondsUntilFade = 60f, InFactory = true, Color = new Vector3(0.1f, 1f, 0.1f), UpdateRate = 0.1f }); Vector2Int dimensions = default(Vector2Int); ((Vector2Int)(ref dimensions))..ctor(512, 512); LoadResource("LHeavy", dimensions); LoadResource("LMedium", dimensions); LoadResource("LLight", dimensions); LoadResource("RHeavy", dimensions); LoadResource("RMedium", dimensions); LoadResource("RLight", dimensions); Extensions.PatchAttribute<Production>(Assembly.GetExecutingAssembly(), ((BaseUnityPlugin)this).Info.Metadata.GUID, (Action<object>)((BaseUnityPlugin)this).Logger.LogInfo); } private void LoadResource(string resourceName, Vector2Int dimensions) { //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Expected O, but got Unknown Assembly executingAssembly = Assembly.GetExecutingAssembly(); string name = executingAssembly.GetName().Name + ".Images." + resourceName + ".png"; Texture2D val = new Texture2D(((Vector2Int)(ref dimensions)).x, ((Vector2Int)(ref dimensions)).y); ImageConversion.LoadImage(val, Extensions.ReadAllBytes(executingAssembly.GetManifestResourceStream(name))); FootstepTexts[resourceName] = val; } } } namespace NicholaScott.LethalCompany.GlowSteps.UnityScripts { public class GlowingFootstep : MonoBehaviour { public class Data : INetworkSerializable { public Vector3 Position; public Quaternion Rotation; public float TimeLeftAlive; public int Strength; public bool LeftFoot; public Vector3 Color; public bool ShouldDraw; public bool IsEnabled; public GlowingFootstep Linked; public float LastDistance; public void UpdateFootstepData(float delta) { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)GameNetworkManager.Instance.localPlayerController != (Object)null) { LastDistance = Vector3.Distance(Position, GameNetworkManager.Instance.localPlayerController.playerEye.position); float distanceFalloff = Singleton<GlowSteps, GlowSteps.Configuration>.Configuration.DistanceFalloff; if (LastDistance <= distanceFalloff) { ShouldDraw = true; } if (LastDistance > distanceFalloff || TimeLeftAlive <= 0f) { ShouldDraw = false; } } else { ShouldDraw = false; } TimeLeftAlive -= delta; } public unsafe void NetworkSerialize<T>(BufferSerializer<T> serializer) where T : IReaderWriter { //IL_0027: 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) //IL_003e: 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_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) serializer.SerializeValue(ref Position); serializer.SerializeValue(ref Rotation); ((BufferSerializer<float>*)(&serializer))->SerializeValue<float>(ref TimeLeftAlive, default(ForPrimitives)); ((BufferSerializer<int>*)(&serializer))->SerializeValue<int>(ref Strength, default(ForPrimitives)); ((BufferSerializer<bool>*)(&serializer))->SerializeValue<bool>(ref LeftFoot, default(ForPrimitives)); serializer.SerializeValue(ref Color); } public static int SizeOf() { return 45; } } private Material _materialReference; private GameObject _subPlane; private static readonly int EmissiveExposureWeight = Shader.PropertyToID("_EmissiveExposureWeight"); private static readonly int EmissiveColorMode = Shader.PropertyToID("_EmissiveColorMode"); private static readonly int EmissiveColor = Shader.PropertyToID("_EmissiveColor"); private static readonly int BaseColorMap = Shader.PropertyToID("_BaseColorMap"); private static readonly int NormalMap = Shader.PropertyToID("_NormalMap"); private static readonly int MainTex = Shader.PropertyToID("_MainTex"); public void Awake() { //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) _materialReference = CreateNewMaterial(); _subPlane = GameObject.CreatePrimitive((PrimitiveType)4); _subPlane.GetComponent<Renderer>().material = _materialReference; _subPlane.GetComponent<Collider>().enabled = false; _subPlane.transform.SetParent(((Component)this).transform, false); _subPlane.transform.localScale = Vector3.one / 15f; } public void SyncAll(Data footstepData) { SyncTransform(footstepData); SyncMaterial(footstepData); SyncColorIntensity(footstepData); } private void SyncTransform(Data footstepData) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) Transform transform = ((Component)this).transform; transform.position = footstepData.Position; transform.rotation = footstepData.Rotation; } private void SyncMaterial(Data footstepData) { string key = (footstepData.LeftFoot ? "L" : "R") + ((footstepData.Strength >= 3) ? "Heavy" : ((footstepData.Strength >= 2) ? "Medium" : "Light")); Texture2D val = Singleton<GlowSteps>.Instance.FootstepTexts[key]; _materialReference.SetTexture(MainTex, (Texture)(object)val); _materialReference.SetTexture(BaseColorMap, (Texture)(object)val); } public void SyncColorIntensity(Data footstepData) { //IL_0091: 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) float num = Mathf.Clamp(footstepData.TimeLeftAlive, 0f, 30f) / 30f; GlowSteps.Configuration configuration = Singleton<GlowSteps, GlowSteps.Configuration>.Configuration; num = Mathf.Min(num, Mathf.Pow(Mathf.Clamp(2f - footstepData.LastDistance / configuration.DistanceFalloff, 0f, 1f), 4f)); _subPlane.GetComponent<Renderer>().material.SetVector(EmissiveColor, new Vector4(footstepData.Color.x, footstepData.Color.y, footstepData.Color.z, 1f) * num); } private static Material CreateNewMaterial() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) Material val = new Material(FootstepManager.CatwalkMaterial); val.SetTexture(NormalMap, (Texture)null); val.SetFloat(EmissiveColorMode, 1f); val.SetFloat(EmissiveExposureWeight, 1f); val.mainTextureScale = Vector2.one; val.color = Color.white; return val; } } }
BepInEx/plugins/quackandcheese-MirrorDecor/MirrorDecor.dll.old
Decompiled a year agousing System; 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 BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using BepInEx.Logging; using GameNetcodeStuff; using HarmonyLib; using LethalLib.Extras; using LethalLib.Modules; using Microsoft.CodeAnalysis; using MoreCompany.Cosmetics; using UnityEngine; using UnityEngine.Rendering; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyCompany("MirrorDecor")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyDescription("A mod for Lethal Company that adds a working mirror decoration that you can buy for your ship!")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("MirrorDecor")] [assembly: AssemblyTitle("MirrorDecor")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.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; } } } namespace MirrorDecor { public class Config { public static ConfigEntry<bool> mirrorEnabled; public static ConfigEntry<int> mirrorPrice; public static ConfigEntry<bool> alwaysAvailable; public static ConfigEntry<int> resolution; public static void Load() { mirrorEnabled = Plugin.config.Bind<bool>("Mirror", "MirrorEnabled", true, "Will you be able to purchase the mirror?"); mirrorPrice = Plugin.config.Bind<int>("Mirror", "MirrorPrice", 100, "What will be the price of the mirror?"); alwaysAvailable = Plugin.config.Bind<bool>("Mirror", "AlwaysAvailable", true, "Is the mirror always available to purchase from the store?"); resolution = Plugin.config.Bind<int>("Mirror", "MirrorResolution", 2000, "What is the resolution/quality of the mirror image? (ex. 2000 = 2000x2000 pixels)"); } } [HarmonyPatch(typeof(HUDManager), "AddPlayerChatMessageClientRpc")] internal class CosmeticPatch { private static void Postfix() { //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) if (!Chainloader.PluginInfos.ContainsKey("me.swipez.melonloader.morecompany")) { return; } CosmeticApplication val = Object.FindObjectOfType<CosmeticApplication>(); if (CosmeticRegistry.locallySelectedCosmetics.Count <= 0 || val.spawnedCosmetics.Count > 0) { return; } foreach (string locallySelectedCosmetic in CosmeticRegistry.locallySelectedCosmetics) { val.ApplyCosmetic(locallySelectedCosmetic, true); } foreach (CosmeticInstance spawnedCosmetic in val.spawnedCosmetics) { Transform transform = ((Component)spawnedCosmetic).transform; transform.localScale *= 0.38f; SetAllChildrenLayer(((Component)spawnedCosmetic).transform, 29); } } private static void SetAllChildrenLayer(Transform transform, string layerName) { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Expected O, but got Unknown int layer = LayerMask.NameToLayer(layerName); ((Component)transform).gameObject.layer = layer; foreach (Transform item in transform) { Transform transform2 = item; SetAllChildrenLayer(transform2, layerName); } } private static void SetAllChildrenLayer(Transform transform, int layer) { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown ((Component)transform).gameObject.layer = layer; foreach (Transform item in transform) { Transform transform2 = item; SetAllChildrenLayer(transform2, layer); } } } public class CustomUnlockable { public string name = ""; public string unlockablePath = ""; public string infoPath = ""; public Action<UnlockableItem> unlockableAction = delegate { }; public bool enabled = true; public int unlockCost = -1; public CustomUnlockable(string name, string unlockablePath, string infoPath, Action<UnlockableItem> action = null, int unlockCost = -1) { this.name = name; this.unlockablePath = unlockablePath; this.infoPath = infoPath; if (action != null) { unlockableAction = action; } this.unlockCost = unlockCost; } public static CustomUnlockable Add(string name, string unlockablePath, string infoPath = null, Action<UnlockableItem> action = null, int unlockCost = -1, bool enabled = true) { return new CustomUnlockable(name, unlockablePath, infoPath, action, unlockCost) { enabled = enabled }; } } public class MirrorScript : MonoBehaviour { private void Update() { } } [HarmonyPatch(typeof(PlayerControllerB), "SpawnPlayerAnimation")] internal class PlayerPatch { private static void Postfix(ref PlayerControllerB __instance) { if ((Object)(object)__instance == (Object)(object)GameNetworkManager.Instance.localPlayerController) { PlayerControllerB val = __instance; ((Renderer)val.thisPlayerModel).shadowCastingMode = (ShadowCastingMode)1; ((Component)val.thisPlayerModel).gameObject.layer = 29; ((Component)val.thisPlayerModelArms).gameObject.layer = 3; } } } [BepInPlugin("quackandcheese.mirrordecor", "MirrorDecor", "1.1.4")] [BepInDependency("evaisa.lethallib", "0.3.1")] [BepInProcess("Lethal Company.exe")] public class Plugin : BaseUnityPlugin { public const string ModGUID = "quackandcheese.mirrordecor"; public const string ModName = "MirrorDecor"; public const string ModVersion = "1.1.4"; public static AssetBundle Bundle; public static ConfigFile config; public static ManualLogSource logger; public static List<CustomUnlockable> customUnlockables; private void Awake() { //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Expected O, but got Unknown 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); } } } Bundle = QuickLoadAssetBundle("mirror.assets"); logger = ((BaseUnityPlugin)this).Logger; config = ((BaseUnityPlugin)this).Config; Harmony val = new Harmony("quackandcheese.mirrordecor"); val.PatchAll(); Config.Load(); RegisterItems(); ((BaseUnityPlugin)this).Logger.LogInfo((object)"Plugin MirrorDecor is loaded!"); } private void RegisterItems() { customUnlockables = new List<CustomUnlockable> { CustomUnlockable.Add("Mirror", "Assets/Mirror/Unlockables/Mirror/Mirror.asset", "Assets/Mirror/Unlockables/Mirror/MirrorInfo.asset", null, Config.mirrorPrice.Value, Config.mirrorEnabled.Value) }; UnlockableItem unlockable = Bundle.LoadAsset<UnlockableItemDef>("Assets/Mirror/Unlockables/Mirror/Mirror.asset").unlockable; unlockable.alwaysInStock = Config.alwaysAvailable.Value; RenderTexture renderTexture = Bundle.LoadAsset<RenderTexture>("Assets/Mirror/Materials/Mirror.renderTexture"); int value = Config.resolution.Value; Resize(renderTexture, value, value); foreach (CustomUnlockable customUnlockable in customUnlockables) { if (customUnlockable.enabled) { UnlockableItem unlockable2 = Bundle.LoadAsset<UnlockableItemDef>(customUnlockable.unlockablePath).unlockable; if ((Object)(object)unlockable2.prefabObject != (Object)null) { NetworkPrefabs.RegisterNetworkPrefab(unlockable2.prefabObject); } TerminalNode val = null; if (customUnlockable.infoPath != null) { val = Bundle.LoadAsset<TerminalNode>(customUnlockable.infoPath); } Unlockables.RegisterUnlockable(unlockable2, (StoreType)2, (TerminalNode)null, (TerminalNode)null, val, customUnlockable.unlockCost); } } } public static T FindAsset<T>(string name) where T : Object { return Resources.FindObjectsOfTypeAll<T>().ToList().Find((T x) => ((Object)x).name == name); } public static AssetBundle QuickLoadAssetBundle(string assetBundleName) { string text = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), assetBundleName); return AssetBundle.LoadFromFile(text); } private void Resize(RenderTexture renderTexture, int width, int height) { if (Object.op_Implicit((Object)(object)renderTexture)) { renderTexture.Release(); ((Texture)renderTexture).width = width; ((Texture)renderTexture).height = height; } } public void sendModInfo() { foreach (KeyValuePair<string, PluginInfo> pluginInfo in Chainloader.PluginInfos) { if (pluginInfo.Value.Metadata.GUID.Contains("ModSync")) { try { List<string> list = new List<string> { "quackandcheese", "MirrorDecor" }; ((Component)pluginInfo.Value.Instance).BroadcastMessage("getModInfo", (object)list, (SendMessageOptions)1); break; } catch (Exception) { logger.LogInfo((object)"Failed to send info to ModSync, go yell at Minx"); break; } } } } } public static class PluginInfo { public const string PLUGIN_GUID = "MirrorDecor"; public const string PLUGIN_NAME = "MirrorDecor"; public const string PLUGIN_VERSION = "1.0.0"; } }
BepInEx/plugins/RickArg-Helmet_Cameras/HelmetCamera.dll
Decompiled a year agousing System; using System.Collections; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using BepInEx.Configuration; using HarmonyLib; using UnityEngine; using UnityEngine.SceneManagement; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("HelmetCamera")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("HelmetCamera")] [assembly: AssemblyCopyright("Copyright © 2023")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("b99c4d46-5f13-47b3-a5af-5e3f37772e77")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")] [assembly: AssemblyVersion("1.0.0.0")] namespace HelmetCamera { [BepInPlugin("RickArg.lethalcompany.helmetcameras", "Helmet_Cameras", "2.1.5")] public class PluginInit : BaseUnityPlugin { public static Harmony _harmony; public static ConfigEntry<int> config_isHighQuality; public static ConfigEntry<int> config_renderDistance; public static ConfigEntry<int> config_cameraFps; private void Awake() { //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Expected O, but got Unknown config_isHighQuality = ((BaseUnityPlugin)this).Config.Bind<int>("MONITOR QUALITY", "monitorResolution", 0, "Low FPS affection. High Quality mode. 0 - vanilla (48x48), 1 - vanilla+ (128x128), 2 - mid quality (256x256), 3 - high quality (512x512), 4 - Very High Quality (1024x1024)"); config_renderDistance = ((BaseUnityPlugin)this).Config.Bind<int>("MONITOR QUALITY", "renderDistance", 20, "Low FPS affection. Render distance for helmet camera."); config_cameraFps = ((BaseUnityPlugin)this).Config.Bind<int>("MONITOR QUALITY", "cameraFps", 30, "Very high FPS affection. FPS for helmet camera. To increase YOUR fps, you should low cameraFps value."); _harmony = new Harmony("HelmetCamera"); _harmony.PatchAll(); ((BaseUnityPlugin)this).Logger.LogInfo((object)"Plugin Helmet_Cameras is loaded with version 2.1.5!"); ((BaseUnityPlugin)this).Logger.LogInfo((object)"--------Helmet camera patch done.---------"); } } public static class PluginInfo { public const string PLUGIN_GUID = "RickArg.lethalcompany.helmetcameras"; public const string PLUGIN_NAME = "Helmet_Cameras"; public const string PLUGIN_VERSION = "2.1.5"; } public class Plugin : MonoBehaviour { private RenderTexture renderTexture; private bool isMonitorChanged = false; private GameObject helmetCameraNew; private bool isSceneLoaded = false; private bool isCoroutineStarted = false; private int currentTransformIndex; private int resolution = 0; private int renderDistance = 50; private float cameraFps = 30f; private float elapsed; private void Awake() { //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Expected O, but got Unknown //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Expected O, but got Unknown //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Expected O, but got Unknown //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Expected O, but got Unknown //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Expected O, but got Unknown resolution = PluginInit.config_isHighQuality.Value; renderDistance = PluginInit.config_renderDistance.Value; cameraFps = PluginInit.config_cameraFps.Value; switch (resolution) { case 0: renderTexture = new RenderTexture(48, 48, 24); break; case 1: renderTexture = new RenderTexture(128, 128, 24); break; case 2: renderTexture = new RenderTexture(256, 256, 24); break; case 3: renderTexture = new RenderTexture(512, 512, 24); break; case 4: renderTexture = new RenderTexture(1024, 1024, 24); break; } } public void Start() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: 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) isCoroutineStarted = false; while ((Object)(object)helmetCameraNew == (Object)null) { helmetCameraNew = new GameObject("HelmetCamera"); } Scene activeScene = SceneManager.GetActiveScene(); if (((Scene)(ref activeScene)).name != "MainMenu") { activeScene = SceneManager.GetActiveScene(); if (((Scene)(ref activeScene)).name != "InitScene") { activeScene = SceneManager.GetActiveScene(); if (((Scene)(ref activeScene)).name != "InitSceneLaunchOptions") { isSceneLoaded = true; Debug.Log((object)"[HELMET_CAMERAS] Starting coroutine..."); ((MonoBehaviour)this).StartCoroutine(LoadSceneEnter()); return; } } } isSceneLoaded = false; isMonitorChanged = false; } private IEnumerator LoadSceneEnter() { Debug.Log((object)"[HELMET_CAMERAS] 5 seconds for init mode... Please wait..."); yield return (object)new WaitForSeconds(5f); isCoroutineStarted = true; if ((Object)(object)GameObject.Find("Environment/HangarShip/Cameras/ShipCamera") != (Object)null) { Debug.Log((object)"[HELMET_CAMERAS] Ship camera founded..."); if (!isMonitorChanged) { ((Renderer)GameObject.Find("Environment/HangarShip/ShipModels2b/MonitorWall/Cube").GetComponent<MeshRenderer>()).materials[2].mainTexture = ((Renderer)GameObject.Find("Environment/HangarShip/ShipModels2b/MonitorWall/Cube.001").GetComponent<MeshRenderer>()).materials[2].mainTexture; ((Renderer)GameObject.Find("Environment/HangarShip/ShipModels2b/MonitorWall/Cube.001").GetComponent<MeshRenderer>()).materials[2].mainTexture = (Texture)(object)renderTexture; helmetCameraNew.AddComponent<Camera>(); ((Behaviour)helmetCameraNew.GetComponent<Camera>()).enabled = false; helmetCameraNew.GetComponent<Camera>().targetTexture = renderTexture; helmetCameraNew.GetComponent<Camera>().cullingMask = 20649983; helmetCameraNew.GetComponent<Camera>().farClipPlane = renderDistance; helmetCameraNew.GetComponent<Camera>().nearClipPlane = 0.55f; isMonitorChanged = true; Debug.Log((object)"[HELMET_CAMERAS] Monitors were changed..."); Debug.Log((object)"[HELMET_CAMERAS] Turning off vanilla internal ship camera"); ((Behaviour)GameObject.Find("Environment/HangarShip/Cameras/ShipCamera").GetComponent<Camera>()).enabled = false; } } } public void Update() { //IL_022b: Unknown result type (might be due to invalid IL or missing references) //IL_023f: Unknown result type (might be due to invalid IL or missing references) //IL_0244: Unknown result type (might be due to invalid IL or missing references) //IL_024f: Unknown result type (might be due to invalid IL or missing references) //IL_0263: Unknown result type (might be due to invalid IL or missing references) //IL_0268: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_0119: 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) //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_01a7: Unknown result type (might be due to invalid IL or missing references) //IL_01c5: Unknown result type (might be due to invalid IL or missing references) //IL_01d9: Unknown result type (might be due to invalid IL or missing references) //IL_01de: Unknown result type (might be due to invalid IL or missing references) bool flag = isSceneLoaded && isCoroutineStarted; if (flag && StartOfRound.Instance.localPlayerController.isInHangarShipRoom) { helmetCameraNew.SetActive(true); elapsed += Time.deltaTime; if (elapsed > 1f / cameraFps) { elapsed = 0f; ((Behaviour)helmetCameraNew.GetComponent<Camera>()).enabled = true; } else { ((Behaviour)helmetCameraNew.GetComponent<Camera>()).enabled = false; } GameObject val = GameObject.Find("Environment/HangarShip/ShipModels2b/MonitorWall/Cube.001/CameraMonitorScript"); currentTransformIndex = val.GetComponent<ManualCameraRenderer>().targetTransformIndex; TransformAndName val2 = val.GetComponent<ManualCameraRenderer>().radarTargets[currentTransformIndex]; if (!val2.isNonPlayer) { try { helmetCameraNew.transform.SetPositionAndRotation(val2.transform.Find("ScavengerModel/metarig/CameraContainer/MainCamera/HelmetLights").position + new Vector3(0f, 0f, 0f), val2.transform.Find("ScavengerModel/metarig/CameraContainer/MainCamera/HelmetLights").rotation * Quaternion.Euler(0f, 0f, 0f)); DeadBodyInfo[] array = Object.FindObjectsOfType<DeadBodyInfo>(); for (int i = 0; i < array.Length; i++) { if (array[i].playerScript.playerUsername == val2.name) { helmetCameraNew.transform.SetPositionAndRotation(((Component)array[i]).gameObject.transform.Find("spine.001/spine.002/spine.003").position, ((Component)array[i]).gameObject.transform.Find("spine.001/spine.002/spine.003").rotation * Quaternion.Euler(0f, 0f, 0f)); } } return; } catch (NullReferenceException) { Debug.Log((object)"[HELMET_CAMERAS] ERROR NULL REFERENCE"); return; } } helmetCameraNew.transform.SetPositionAndRotation(val2.transform.position + new Vector3(0f, 1.6f, 0f), val2.transform.rotation * Quaternion.Euler(0f, -90f, 0f)); } else if (flag && !StartOfRound.Instance.localPlayerController.isInHangarShipRoom) { helmetCameraNew.SetActive(false); } } } } namespace HelmetCamera.Patches { [HarmonyPatch] internal class HelmetCamera { public static void InitCameras() { GameObject val = GameObject.Find("Environment/HangarShip/Cameras/ShipCamera"); val.AddComponent<Plugin>(); } [HarmonyPatch(typeof(StartOfRound), "Start")] [HarmonyPostfix] public static void InitCamera(ref ManualCameraRenderer __instance) { InitCameras(); } } }
BepInEx/plugins/RugbugRedfern-Skinwalkers/SkinwalkerMod.dll
Decompiled a year 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.InteropServices; using System.Runtime.Versioning; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using Dissonance.Config; using HarmonyLib; using Unity.Netcode; using UnityEngine; using UnityEngine.Networking; using UnityEngine.SceneManagement; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("SkinwalkerMod")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("SkinwalkerMod")] [assembly: AssemblyCopyright("Copyright © 2023")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("fd4979a2-cef0-46af-8bf8-97e630b11475")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")] [assembly: AssemblyVersion("1.0.0.0")] internal class <Module> { static <Module>() { NetworkVariableSerializationTypes.InitializeSerializer_UnmanagedByMemcpy<bool>(); NetworkVariableSerializationTypes.InitializeEqualityChecker_UnmanagedIEquatable<bool>(); NetworkVariableSerializationTypes.InitializeSerializer_UnmanagedByMemcpy<float>(); NetworkVariableSerializationTypes.InitializeEqualityChecker_UnmanagedIEquatable<float>(); } } namespace SkinwalkerMod; [BepInPlugin("RugbugRedfern.SkinwalkerMod", "Skinwalker Mod", "1.0.8")] internal class PluginLoader : BaseUnityPlugin { private readonly Harmony harmony = new Harmony("RugbugRedfern.SkinwalkerMod"); private const string modGUID = "RugbugRedfern.SkinwalkerMod"; private const string modVersion = "1.0.8"; private static bool initialized; public static PluginLoader Instance { get; private set; } private void Awake() { //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Expected O, but got Unknown if (initialized) { return; } initialized = true; Instance = this; harmony.PatchAll(Assembly.GetExecutingAssembly()); 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); } } } SkinwalkerLogger.Initialize("RugbugRedfern.SkinwalkerMod"); SkinwalkerLogger.Log("SKINWALKER MOD STARTING UP 1.0.8"); SkinwalkerConfig.InitConfig(); SceneManager.sceneLoaded += SkinwalkerNetworkManagerHandler.ClientConnectInitializer; GameObject val = new GameObject("Skinwalker Mod"); val.AddComponent<SkinwalkerModPersistent>(); ((Object)val).hideFlags = (HideFlags)61; Object.DontDestroyOnLoad((Object)(object)val); } public void BindConfig<T>(ref ConfigEntry<T> config, string section, string key, T defaultValue, string description = "") { config = ((BaseUnityPlugin)this).Config.Bind<T>(section, key, defaultValue, description); } } internal class SkinwalkerBehaviour : MonoBehaviour { private AudioSource audioSource; public const float PLAY_INTERVAL_MIN = 15f; public const float PLAY_INTERVAL_MAX = 40f; private const float MAX_DIST = 100f; private float nextTimeToPlayAudio; private EnemyAI ai; public void Initialize(EnemyAI ai) { this.ai = ai; audioSource = ai.creatureVoice; SetNextTime(); } private void Update() { //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) if (!(Time.time > nextTimeToPlayAudio)) { return; } SetNextTime(); float num = -1f; if (Object.op_Implicit((Object)(object)ai) && !ai.isEnemyDead) { if ((Object)(object)GameNetworkManager.Instance == (Object)null || (Object)(object)GameNetworkManager.Instance.localPlayerController == (Object)null || (num = Vector3.Distance(((Component)GameNetworkManager.Instance.localPlayerController).transform.position, ((Component)this).transform.position)) < 100f) { AudioClip sample = SkinwalkerModPersistent.Instance.GetSample(); if (Object.op_Implicit((Object)(object)sample)) { SkinwalkerLogger.Log(((Object)this).name + " played voice line 1"); audioSource.PlayOneShot(sample); } else { SkinwalkerLogger.Log(((Object)this).name + " played voice line 0"); } } else { SkinwalkerLogger.Log(((Object)this).name + " played voice line no (too far away) " + num); } } else { SkinwalkerLogger.Log(((Object)this).name + " played voice line no (dead) EnemyAI: " + (object)ai); } } private void SetNextTime() { if (SkinwalkerNetworkManager.Instance.VoiceLineFrequency.Value <= 0f) { nextTimeToPlayAudio = Time.time + 100000000f; } else { nextTimeToPlayAudio = Time.time + Random.Range(15f, 40f) / SkinwalkerNetworkManager.Instance.VoiceLineFrequency.Value; } } private T CopyComponent<T>(T original, GameObject destination) where T : Component { Type type = ((object)original).GetType(); Component val = destination.AddComponent(type); FieldInfo[] fields = type.GetFields(); FieldInfo[] array = fields; foreach (FieldInfo fieldInfo in array) { fieldInfo.SetValue(val, fieldInfo.GetValue(original)); } return (T)(object)((val is T) ? val : null); } } internal class SkinwalkerConfig { public static ConfigEntry<bool> VoiceEnabled_BaboonHawk; public static ConfigEntry<bool> VoiceEnabled_Bracken; public static ConfigEntry<bool> VoiceEnabled_BunkerSpider; public static ConfigEntry<bool> VoiceEnabled_Centipede; public static ConfigEntry<bool> VoiceEnabled_CoilHead; public static ConfigEntry<bool> VoiceEnabled_EyelessDog; public static ConfigEntry<bool> VoiceEnabled_ForestGiant; public static ConfigEntry<bool> VoiceEnabled_GhostGirl; public static ConfigEntry<bool> VoiceEnabled_GiantWorm; public static ConfigEntry<bool> VoiceEnabled_HoardingBug; public static ConfigEntry<bool> VoiceEnabled_Hygrodere; public static ConfigEntry<bool> VoiceEnabled_Jester; public static ConfigEntry<bool> VoiceEnabled_Masked; public static ConfigEntry<bool> VoiceEnabled_Nutcracker; public static ConfigEntry<bool> VoiceEnabled_SporeLizard; public static ConfigEntry<bool> VoiceEnabled_Thumper; public static ConfigEntry<float> VoiceLineFrequency; public static void InitConfig() { PluginLoader.Instance.BindConfig(ref VoiceLineFrequency, "Voice Settings", "VoiceLineFrequency", 1f, "1 is the default, and voice lines will occur every " + 15f.ToString("0") + " to " + 40f.ToString("0") + " seconds per enemy. Setting this to 2 means they will occur twice as often, 0.5 means half as often, etc."); PluginLoader.Instance.BindConfig(ref VoiceEnabled_BaboonHawk, "Monster Voices", "Baboon Hawk", defaultValue: true); PluginLoader.Instance.BindConfig(ref VoiceEnabled_Bracken, "Monster Voices", "Bracken", defaultValue: true); PluginLoader.Instance.BindConfig(ref VoiceEnabled_BunkerSpider, "Monster Voices", "Bunker Spider", defaultValue: true); PluginLoader.Instance.BindConfig(ref VoiceEnabled_Centipede, "Monster Voices", "Centipede", defaultValue: true); PluginLoader.Instance.BindConfig(ref VoiceEnabled_CoilHead, "Monster Voices", "Coil Head", defaultValue: true); PluginLoader.Instance.BindConfig(ref VoiceEnabled_EyelessDog, "Monster Voices", "Eyeless Dog", defaultValue: true); PluginLoader.Instance.BindConfig(ref VoiceEnabled_ForestGiant, "Monster Voices", "Forest Giant", defaultValue: false); PluginLoader.Instance.BindConfig(ref VoiceEnabled_GhostGirl, "Monster Voices", "Ghost Girl", defaultValue: true); PluginLoader.Instance.BindConfig(ref VoiceEnabled_GiantWorm, "Monster Voices", "Giant Worm", defaultValue: false); PluginLoader.Instance.BindConfig(ref VoiceEnabled_HoardingBug, "Monster Voices", "Hoarding Bug", defaultValue: true); PluginLoader.Instance.BindConfig(ref VoiceEnabled_Hygrodere, "Monster Voices", "Hygrodere", defaultValue: false); PluginLoader.Instance.BindConfig(ref VoiceEnabled_Jester, "Monster Voices", "Jester", defaultValue: true); PluginLoader.Instance.BindConfig(ref VoiceEnabled_Masked, "Monster Voices", "Masked", defaultValue: true); PluginLoader.Instance.BindConfig(ref VoiceEnabled_Nutcracker, "Monster Voices", "Nutcracker", defaultValue: true); PluginLoader.Instance.BindConfig(ref VoiceEnabled_SporeLizard, "Monster Voices", "Spore Lizard", defaultValue: true); PluginLoader.Instance.BindConfig(ref VoiceEnabled_Thumper, "Monster Voices", "Thumper", defaultValue: true); SkinwalkerLogger.Log("VoiceEnabled_BaboonHawk" + $" VALUE LOADED FROM CONFIG: [{VoiceEnabled_BaboonHawk.Value}]"); SkinwalkerLogger.Log("VoiceEnabled_Bracken" + $" VALUE LOADED FROM CONFIG: [{VoiceEnabled_Bracken.Value}]"); SkinwalkerLogger.Log("VoiceEnabled_BunkerSpider" + $" VALUE LOADED FROM CONFIG: [{VoiceEnabled_BunkerSpider.Value}]"); SkinwalkerLogger.Log("VoiceEnabled_Centipede" + $" VALUE LOADED FROM CONFIG: [{VoiceEnabled_Centipede.Value}]"); SkinwalkerLogger.Log("VoiceEnabled_CoilHead" + $" VALUE LOADED FROM CONFIG: [{VoiceEnabled_CoilHead.Value}]"); SkinwalkerLogger.Log("VoiceEnabled_EyelessDog" + $" VALUE LOADED FROM CONFIG: [{VoiceEnabled_EyelessDog.Value}]"); SkinwalkerLogger.Log("VoiceEnabled_ForestGiant" + $" VALUE LOADED FROM CONFIG: [{VoiceEnabled_ForestGiant.Value}]"); SkinwalkerLogger.Log("VoiceEnabled_GhostGirl" + $" VALUE LOADED FROM CONFIG: [{VoiceEnabled_GhostGirl.Value}]"); SkinwalkerLogger.Log("VoiceEnabled_GiantWorm" + $" VALUE LOADED FROM CONFIG: [{VoiceEnabled_GiantWorm.Value}]"); SkinwalkerLogger.Log("VoiceEnabled_HoardingBug" + $" VALUE LOADED FROM CONFIG: [{VoiceEnabled_HoardingBug.Value}]"); SkinwalkerLogger.Log("VoiceEnabled_Hygrodere" + $" VALUE LOADED FROM CONFIG: [{VoiceEnabled_Hygrodere.Value}]"); SkinwalkerLogger.Log("VoiceEnabled_Jester" + $" VALUE LOADED FROM CONFIG: [{VoiceEnabled_Jester.Value}]"); SkinwalkerLogger.Log("VoiceEnabled_Masked" + $" VALUE LOADED FROM CONFIG: [{VoiceEnabled_Masked.Value}]"); SkinwalkerLogger.Log("VoiceEnabled_Nutcracker" + $" VALUE LOADED FROM CONFIG: [{VoiceEnabled_Nutcracker.Value}]"); SkinwalkerLogger.Log("VoiceEnabled_SporeLizard" + $" VALUE LOADED FROM CONFIG: [{VoiceEnabled_SporeLizard.Value}]"); SkinwalkerLogger.Log("VoiceEnabled_Thumper" + $" VALUE LOADED FROM CONFIG: [{VoiceEnabled_Thumper.Value}]"); SkinwalkerLogger.Log("VoiceLineFrequency" + $" VALUE LOADED FROM CONFIG: [{VoiceLineFrequency.Value}]"); } } internal static class SkinwalkerLogger { internal static ManualLogSource logSource; public static void Initialize(string modGUID) { logSource = Logger.CreateLogSource(modGUID); } public static void Log(object message) { logSource.LogInfo(message); } public static void LogError(object message) { logSource.LogError(message); } public static void LogWarning(object message) { logSource.LogWarning(message); } } public class SkinwalkerModPersistent : MonoBehaviour { private string audioFolder; private List<AudioClip> cachedAudio = new List<AudioClip>(); private float nextTimeToCheckFolder = 30f; private float nextTimeToCheckEnemies = 30f; private const float folderScanInterval = 8f; private const float enemyScanInterval = 5f; public static SkinwalkerModPersistent Instance { get; private set; } private void Awake() { //IL_000e: Unknown result type (might be due to invalid IL or missing references) Instance = this; ((Component)this).transform.position = Vector3.zero; SkinwalkerLogger.Log("Skinwalker Mod Object Initialized"); audioFolder = Path.Combine(Application.dataPath, "..", "Dissonance_Diagnostics"); EnableRecording(); if (!Directory.Exists(audioFolder)) { Directory.CreateDirectory(audioFolder); } } private void Start() { try { if (Directory.Exists(audioFolder)) { Directory.Delete(audioFolder, recursive: true); } } catch (Exception message) { SkinwalkerLogger.Log(message); } } private void OnApplicationQuit() { DisableRecording(); } private void EnableRecording() { DebugSettings.Instance.EnablePlaybackDiagnostics = true; DebugSettings.Instance.RecordFinalAudio = true; } private void Update() { if (Time.realtimeSinceStartup > nextTimeToCheckFolder) { nextTimeToCheckFolder = Time.realtimeSinceStartup + 8f; if (!Directory.Exists(audioFolder)) { SkinwalkerLogger.Log("Audio folder not present. Don't worry about it, it will be created automatically when you play with friends. (" + audioFolder + ")"); return; } string[] files = Directory.GetFiles(audioFolder); SkinwalkerLogger.Log($"Got audio file paths ({files.Length})"); string[] array = files; foreach (string path in array) { ((MonoBehaviour)this).StartCoroutine(LoadWavFile(path, delegate(AudioClip audioClip) { cachedAudio.Add(audioClip); })); } } if (!(Time.realtimeSinceStartup > nextTimeToCheckEnemies)) { return; } nextTimeToCheckEnemies = Time.realtimeSinceStartup + 5f; EnemyAI[] array2 = Object.FindObjectsOfType<EnemyAI>(true); EnemyAI[] array3 = array2; SkinwalkerBehaviour skinwalkerBehaviour = default(SkinwalkerBehaviour); foreach (EnemyAI val in array3) { SkinwalkerLogger.Log("IsEnemyEnabled " + ((Object)val).name + " " + IsEnemyEnabled(val)); if (IsEnemyEnabled(val) && !((Component)val).TryGetComponent<SkinwalkerBehaviour>(ref skinwalkerBehaviour)) { ((Component)val).gameObject.AddComponent<SkinwalkerBehaviour>().Initialize(val); } } } private bool IsEnemyEnabled(EnemyAI enemy) { if ((Object)(object)enemy == (Object)null) { return false; } return ((Object)((Component)enemy).gameObject).name switch { "MaskedPlayerEnemy(Clone)" => SkinwalkerNetworkManager.Instance.VoiceEnabled_Masked.Value, "NutcrackerEnemy(Clone)" => SkinwalkerNetworkManager.Instance.VoiceEnabled_Nutcracker.Value, "BaboonHawkEnemy(Clone)" => SkinwalkerNetworkManager.Instance.VoiceEnabled_BaboonHawk.Value, "Flowerman(Clone)" => SkinwalkerNetworkManager.Instance.VoiceEnabled_Bracken.Value, "SandSpider(Clone)" => SkinwalkerNetworkManager.Instance.VoiceEnabled_BunkerSpider.Value, "RedLocustBees(Clone)" => false, "Centipede(Clone)" => SkinwalkerNetworkManager.Instance.VoiceEnabled_Centipede.Value, "SpringMan(Clone)" => SkinwalkerNetworkManager.Instance.VoiceEnabled_CoilHead.Value, "MouthDog(Clone)" => SkinwalkerNetworkManager.Instance.VoiceEnabled_EyelessDog.Value, "ForestGiant(Clone)" => SkinwalkerNetworkManager.Instance.VoiceEnabled_ForestGiant.Value, "DressGirl(Clone)" => SkinwalkerNetworkManager.Instance.VoiceEnabled_GhostGirl.Value, "SandWorm(Clone)" => SkinwalkerNetworkManager.Instance.VoiceEnabled_GiantWorm.Value, "HoarderBug(Clone)" => SkinwalkerNetworkManager.Instance.VoiceEnabled_HoardingBug.Value, "Blob(Clone)" => SkinwalkerNetworkManager.Instance.VoiceEnabled_Hygrodere.Value, "JesterEnemy(Clone)" => SkinwalkerNetworkManager.Instance.VoiceEnabled_Jester.Value, "PufferEnemy(Clone)" => SkinwalkerNetworkManager.Instance.VoiceEnabled_SporeLizard.Value, "Crawler(Clone)" => SkinwalkerNetworkManager.Instance.VoiceEnabled_Thumper.Value, "DocileLocustBees(Clone)" => false, "DoublewingedBird(Clone)" => false, _ => true, }; } internal IEnumerator LoadWavFile(string path, Action<AudioClip> callback) { UnityWebRequest www = UnityWebRequestMultimedia.GetAudioClip(path, (AudioType)20); try { yield return www.SendWebRequest(); if ((int)www.result == 1) { SkinwalkerLogger.Log("Loaded clip from path " + path); AudioClip audioClip = DownloadHandlerAudioClip.GetContent(www); if (audioClip.length > 0.9f) { callback(audioClip); } try { File.Delete(path); } catch (Exception e) { SkinwalkerLogger.LogWarning(e); } } } finally { ((IDisposable)www)?.Dispose(); } } private void DisableRecording() { DebugSettings.Instance.EnablePlaybackDiagnostics = false; DebugSettings.Instance.RecordFinalAudio = false; if (Directory.Exists(audioFolder)) { Directory.Delete(audioFolder, recursive: true); } } public AudioClip GetSample() { if (cachedAudio.Count > 0) { int index = Random.Range(0, cachedAudio.Count - 1); AudioClip result = cachedAudio[index]; cachedAudio.RemoveAt(index); return result; } while (cachedAudio.Count > 200) { cachedAudio.RemoveAt(0); } return null; } public void ClearCache() { cachedAudio.Clear(); } } internal static class SkinwalkerNetworkManagerHandler { internal static void ClientConnectInitializer(Scene sceneName, LoadSceneMode sceneEnum) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Expected O, but got Unknown if (((Scene)(ref sceneName)).name == "SampleSceneRelay") { GameObject val = new GameObject("SkinwalkerNetworkManager"); val.AddComponent<NetworkObject>(); val.AddComponent<SkinwalkerNetworkManager>(); Debug.Log((object)"Initialized SkinwalkerNetworkManager"); } } } internal class SkinwalkerNetworkManager : NetworkBehaviour { public NetworkVariable<bool> VoiceEnabled_BaboonHawk = new NetworkVariable<bool>(true, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); public NetworkVariable<bool> VoiceEnabled_Bracken = new NetworkVariable<bool>(true, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); public NetworkVariable<bool> VoiceEnabled_BunkerSpider = new NetworkVariable<bool>(true, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); public NetworkVariable<bool> VoiceEnabled_Centipede = new NetworkVariable<bool>(true, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); public NetworkVariable<bool> VoiceEnabled_CoilHead = new NetworkVariable<bool>(true, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); public NetworkVariable<bool> VoiceEnabled_EyelessDog = new NetworkVariable<bool>(true, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); public NetworkVariable<bool> VoiceEnabled_ForestGiant = new NetworkVariable<bool>(true, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); public NetworkVariable<bool> VoiceEnabled_GhostGirl = new NetworkVariable<bool>(true, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); public NetworkVariable<bool> VoiceEnabled_GiantWorm = new NetworkVariable<bool>(true, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); public NetworkVariable<bool> VoiceEnabled_HoardingBug = new NetworkVariable<bool>(true, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); public NetworkVariable<bool> VoiceEnabled_Hygrodere = new NetworkVariable<bool>(true, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); public NetworkVariable<bool> VoiceEnabled_Jester = new NetworkVariable<bool>(true, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); public NetworkVariable<bool> VoiceEnabled_Masked = new NetworkVariable<bool>(true, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); public NetworkVariable<bool> VoiceEnabled_Nutcracker = new NetworkVariable<bool>(true, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); public NetworkVariable<bool> VoiceEnabled_SporeLizard = new NetworkVariable<bool>(true, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); public NetworkVariable<bool> VoiceEnabled_Thumper = new NetworkVariable<bool>(true, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); public NetworkVariable<float> VoiceLineFrequency = new NetworkVariable<float>(1f, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); public static SkinwalkerNetworkManager Instance { get; private set; } private void Awake() { Instance = this; if (GameNetworkManager.Instance.isHostingGame) { VoiceEnabled_BaboonHawk.Value = SkinwalkerConfig.VoiceEnabled_BaboonHawk.Value; VoiceEnabled_Bracken.Value = SkinwalkerConfig.VoiceEnabled_Bracken.Value; VoiceEnabled_BunkerSpider.Value = SkinwalkerConfig.VoiceEnabled_BunkerSpider.Value; VoiceEnabled_Centipede.Value = SkinwalkerConfig.VoiceEnabled_Centipede.Value; VoiceEnabled_CoilHead.Value = SkinwalkerConfig.VoiceEnabled_CoilHead.Value; VoiceEnabled_EyelessDog.Value = SkinwalkerConfig.VoiceEnabled_EyelessDog.Value; VoiceEnabled_ForestGiant.Value = SkinwalkerConfig.VoiceEnabled_ForestGiant.Value; VoiceEnabled_GhostGirl.Value = SkinwalkerConfig.VoiceEnabled_GhostGirl.Value; VoiceEnabled_GiantWorm.Value = SkinwalkerConfig.VoiceEnabled_GiantWorm.Value; VoiceEnabled_HoardingBug.Value = SkinwalkerConfig.VoiceEnabled_HoardingBug.Value; VoiceEnabled_Hygrodere.Value = SkinwalkerConfig.VoiceEnabled_Hygrodere.Value; VoiceEnabled_Jester.Value = SkinwalkerConfig.VoiceEnabled_Jester.Value; VoiceEnabled_Masked.Value = SkinwalkerConfig.VoiceEnabled_Masked.Value; VoiceEnabled_Nutcracker.Value = SkinwalkerConfig.VoiceEnabled_Nutcracker.Value; VoiceEnabled_SporeLizard.Value = SkinwalkerConfig.VoiceEnabled_SporeLizard.Value; VoiceEnabled_Thumper.Value = SkinwalkerConfig.VoiceEnabled_Thumper.Value; VoiceLineFrequency.Value = SkinwalkerConfig.VoiceLineFrequency.Value; SkinwalkerLogger.Log("HOST SENDING CONFIG TO CLIENTS"); } SkinwalkerLogger.Log("SkinwalkerNetworkManager Awake"); } public override void OnDestroy() { ((NetworkBehaviour)this).OnDestroy(); SkinwalkerLogger.Log("SkinwalkerNetworkManager OnDestroy"); SkinwalkerModPersistent.Instance?.ClearCache(); } protected override void __initializeVariables() { if (VoiceEnabled_BaboonHawk == null) { throw new Exception("SkinwalkerNetworkManager.VoiceEnabled_BaboonHawk cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)VoiceEnabled_BaboonHawk).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)VoiceEnabled_BaboonHawk, "VoiceEnabled_BaboonHawk"); base.NetworkVariableFields.Add((NetworkVariableBase)(object)VoiceEnabled_BaboonHawk); if (VoiceEnabled_Bracken == null) { throw new Exception("SkinwalkerNetworkManager.VoiceEnabled_Bracken cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)VoiceEnabled_Bracken).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)VoiceEnabled_Bracken, "VoiceEnabled_Bracken"); base.NetworkVariableFields.Add((NetworkVariableBase)(object)VoiceEnabled_Bracken); if (VoiceEnabled_BunkerSpider == null) { throw new Exception("SkinwalkerNetworkManager.VoiceEnabled_BunkerSpider cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)VoiceEnabled_BunkerSpider).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)VoiceEnabled_BunkerSpider, "VoiceEnabled_BunkerSpider"); base.NetworkVariableFields.Add((NetworkVariableBase)(object)VoiceEnabled_BunkerSpider); if (VoiceEnabled_Centipede == null) { throw new Exception("SkinwalkerNetworkManager.VoiceEnabled_Centipede cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)VoiceEnabled_Centipede).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)VoiceEnabled_Centipede, "VoiceEnabled_Centipede"); base.NetworkVariableFields.Add((NetworkVariableBase)(object)VoiceEnabled_Centipede); if (VoiceEnabled_CoilHead == null) { throw new Exception("SkinwalkerNetworkManager.VoiceEnabled_CoilHead cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)VoiceEnabled_CoilHead).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)VoiceEnabled_CoilHead, "VoiceEnabled_CoilHead"); base.NetworkVariableFields.Add((NetworkVariableBase)(object)VoiceEnabled_CoilHead); if (VoiceEnabled_EyelessDog == null) { throw new Exception("SkinwalkerNetworkManager.VoiceEnabled_EyelessDog cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)VoiceEnabled_EyelessDog).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)VoiceEnabled_EyelessDog, "VoiceEnabled_EyelessDog"); base.NetworkVariableFields.Add((NetworkVariableBase)(object)VoiceEnabled_EyelessDog); if (VoiceEnabled_ForestGiant == null) { throw new Exception("SkinwalkerNetworkManager.VoiceEnabled_ForestGiant cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)VoiceEnabled_ForestGiant).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)VoiceEnabled_ForestGiant, "VoiceEnabled_ForestGiant"); base.NetworkVariableFields.Add((NetworkVariableBase)(object)VoiceEnabled_ForestGiant); if (VoiceEnabled_GhostGirl == null) { throw new Exception("SkinwalkerNetworkManager.VoiceEnabled_GhostGirl cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)VoiceEnabled_GhostGirl).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)VoiceEnabled_GhostGirl, "VoiceEnabled_GhostGirl"); base.NetworkVariableFields.Add((NetworkVariableBase)(object)VoiceEnabled_GhostGirl); if (VoiceEnabled_GiantWorm == null) { throw new Exception("SkinwalkerNetworkManager.VoiceEnabled_GiantWorm cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)VoiceEnabled_GiantWorm).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)VoiceEnabled_GiantWorm, "VoiceEnabled_GiantWorm"); base.NetworkVariableFields.Add((NetworkVariableBase)(object)VoiceEnabled_GiantWorm); if (VoiceEnabled_HoardingBug == null) { throw new Exception("SkinwalkerNetworkManager.VoiceEnabled_HoardingBug cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)VoiceEnabled_HoardingBug).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)VoiceEnabled_HoardingBug, "VoiceEnabled_HoardingBug"); base.NetworkVariableFields.Add((NetworkVariableBase)(object)VoiceEnabled_HoardingBug); if (VoiceEnabled_Hygrodere == null) { throw new Exception("SkinwalkerNetworkManager.VoiceEnabled_Hygrodere cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)VoiceEnabled_Hygrodere).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)VoiceEnabled_Hygrodere, "VoiceEnabled_Hygrodere"); base.NetworkVariableFields.Add((NetworkVariableBase)(object)VoiceEnabled_Hygrodere); if (VoiceEnabled_Jester == null) { throw new Exception("SkinwalkerNetworkManager.VoiceEnabled_Jester cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)VoiceEnabled_Jester).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)VoiceEnabled_Jester, "VoiceEnabled_Jester"); base.NetworkVariableFields.Add((NetworkVariableBase)(object)VoiceEnabled_Jester); if (VoiceEnabled_Masked == null) { throw new Exception("SkinwalkerNetworkManager.VoiceEnabled_Masked cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)VoiceEnabled_Masked).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)VoiceEnabled_Masked, "VoiceEnabled_Masked"); base.NetworkVariableFields.Add((NetworkVariableBase)(object)VoiceEnabled_Masked); if (VoiceEnabled_Nutcracker == null) { throw new Exception("SkinwalkerNetworkManager.VoiceEnabled_Nutcracker cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)VoiceEnabled_Nutcracker).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)VoiceEnabled_Nutcracker, "VoiceEnabled_Nutcracker"); base.NetworkVariableFields.Add((NetworkVariableBase)(object)VoiceEnabled_Nutcracker); if (VoiceEnabled_SporeLizard == null) { throw new Exception("SkinwalkerNetworkManager.VoiceEnabled_SporeLizard cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)VoiceEnabled_SporeLizard).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)VoiceEnabled_SporeLizard, "VoiceEnabled_SporeLizard"); base.NetworkVariableFields.Add((NetworkVariableBase)(object)VoiceEnabled_SporeLizard); if (VoiceEnabled_Thumper == null) { throw new Exception("SkinwalkerNetworkManager.VoiceEnabled_Thumper cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)VoiceEnabled_Thumper).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)VoiceEnabled_Thumper, "VoiceEnabled_Thumper"); base.NetworkVariableFields.Add((NetworkVariableBase)(object)VoiceEnabled_Thumper); if (VoiceLineFrequency == null) { throw new Exception("SkinwalkerNetworkManager.VoiceLineFrequency cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)VoiceLineFrequency).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)VoiceLineFrequency, "VoiceLineFrequency"); base.NetworkVariableFields.Add((NetworkVariableBase)(object)VoiceLineFrequency); ((NetworkBehaviour)this).__initializeVariables(); } protected internal override string __getTypeName() { return "SkinwalkerNetworkManager"; } }
BepInEx/plugins/Shiz-GustavoMine/Gustavo Mine/GustavoMine.dll
Decompiled a year agousing System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using BepInEx.Logging; using Gustavo_Mine.Patches; using HarmonyLib; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("Gustavo Mine")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("Gustavo Mine")] [assembly: AssemblyCopyright("Copyright © 2023")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("da5b63ee-652d-4f20-9541-627cb9d531a2")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")] [assembly: AssemblyVersion("1.0.0.0")] namespace Gustavo_Mine { [BepInPlugin("shiz.gustavolandmine", "Gustavo Land Mine", "1.0.0")] public class GustavoMineBase : BaseUnityPlugin { private const string modGUID = "shiz.gustavolandmine"; private const string modName = "Gustavo Land Mine"; private const string modVersion = "1.0.0"; private readonly Harmony harmony = new Harmony("shiz.gustavolandmine"); private static GustavoMineBase Instance; internal ManualLogSource mls; internal static AudioClip[] newMineDetonate; internal static AudioClip[] newMineDetonateFar; private void Awake() { if ((Object)(object)Instance == (Object)null) { Instance = this; } mls = Logger.CreateLogSource("shiz.gustavolandmine"); mls.LogInfo((object)"Gustavo mine mod is loading"); string location = ((BaseUnityPlugin)Instance).Info.Location; string text = "GustavoLandMine.dll"; string text2 = location.TrimEnd(text.ToCharArray()); string text3 = text2 + "gustavomine"; mls.LogInfo((object)text3); AssetBundle val = AssetBundle.LoadFromFile(text3); if ((Object)(object)val == (Object)null) { mls.LogError((object)"Failed to load audio assets!"); return; } newMineDetonate = val.LoadAssetWithSubAssets<AudioClip>("Assets/AssetBundlesWanted/gustavomine.mp3"); newMineDetonateFar = val.LoadAssetWithSubAssets<AudioClip>("Assets/AssetBundlesWanted/gustavomine.mp3"); harmony.PatchAll(typeof(LandminePatch)); mls.LogInfo((object)"LandMineGustavo is loaded."); } } } namespace Gustavo_Mine.Patches { [HarmonyPatch(typeof(Landmine))] internal class LandminePatch { [HarmonyPatch("Start")] [HarmonyPostfix] public static void GustavoMineAudioPatch(ref AudioClip ___mineDetonate, ref AudioClip ___mineDetonateFar) { AudioClip val = GustavoMineBase.newMineDetonate[0]; ___mineDetonate = val; AudioClip val2 = GustavoMineBase.newMineDetonateFar[0]; ___mineDetonateFar = val2; } } }
BepInEx/plugins/Sligili-More_Emotes/MoreEmotes1.2.0.dll
Decompiled a year agousing System; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using GameNetcodeStuff; using HarmonyLib; using MoreEmotes.Patch; using Tools; using Unity.Netcode; using UnityEngine; using UnityEngine.InputSystem; using UnityEngine.InputSystem.Controls; 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: AssemblyTitle("FuckYouMod")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("FuckYouMod")] [assembly: AssemblyCopyright("Copyright © 2023")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("5ecc2bf2-af12-4e83-a6f1-cf2eacbf3060")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyVersion("1.0.0.0")] namespace Tools { public class Reflection { public static object GetInstanceField(Type type, object instance, string fieldName) { BindingFlags bindingAttr = BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic; FieldInfo field = type.GetField(fieldName, bindingAttr); return field.GetValue(instance); } public static object CallMethod(object instance, string methodName, params object[] args) { MethodInfo method = instance.GetType().GetMethod(methodName, BindingFlags.Instance | BindingFlags.NonPublic); if (method != null) { return method.Invoke(instance, args); } return null; } } } namespace MoreEmotes { [BepInPlugin("MoreEmotes", "MoreEmotes-Sligili", "1.2.0")] public class FuckYouModInitialization : BaseUnityPlugin { private Harmony _harmony; private ConfigEntry<string> config_KeyWheel; private ConfigEntry<bool> config_InventoryCheck; private ConfigEntry<string> config_KeyEmote3; private ConfigEntry<string> config_KeyEmote4; private ConfigEntry<string> config_KeyEmote5; private ConfigEntry<string> config_KeyEmote6; private ConfigEntry<string> config_KeyEmote7; private ConfigEntry<string> config_KeyEmote8; private ConfigEntry<bool> config_toggleEmote3; private ConfigEntry<bool> config_toggleEmote4; private ConfigEntry<bool> config_toggleEmote5; private ConfigEntry<bool> config_toggleEmote6; private ConfigEntry<bool> config_toggleEmote7; private ConfigEntry<bool> config_toggleEmote8; private void Awake() { //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Expected O, but got Unknown ((BaseUnityPlugin)this).Logger.LogInfo((object)"MoreEmotes loaded"); EmotePatch.animationsBundle = AssetBundle.LoadFromFile(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "MoreEmotes/animationsbundle")); EmotePatch.animatorBundle = AssetBundle.LoadFromFile(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "MoreEmotes/animatorbundle")); EmotePatch.local = EmotePatch.animatorBundle.LoadAsset<RuntimeAnimatorController>("Assets/MoreEmotes/NEWmetarig.controller"); EmotePatch.others = EmotePatch.animatorBundle.LoadAsset<RuntimeAnimatorController>("Assets/MoreEmotes/NEWmetarigOtherPlayers.controller"); CustomAudioAnimationEvent.claps[0] = EmotePatch.animationsBundle.LoadAsset<AudioClip>("Assets/MoreEmotes/SingleClapEmote1.wav"); CustomAudioAnimationEvent.claps[1] = EmotePatch.animationsBundle.LoadAsset<AudioClip>("Assets/MoreEmotes/SingleClapEmote2.wav"); ConfigFile(); IncompatibilityAids(); _harmony = new Harmony("MoreEmotes"); _harmony.PatchAll(typeof(EmotePatch)); } private void IncompatibilityAids() { foreach (KeyValuePair<string, PluginInfo> pluginInfo in Chainloader.PluginInfos) { BepInPlugin metadata = pluginInfo.Value.Metadata; if (metadata.GUID.Equals("com.malco.lethalcompany.moreshipupgrades") || metadata.GUID.Equals("Stoneman.LethalProgression")) { EmotePatch.IncompatibleStuff = true; break; } } } private void ConfigFile() { EmotePatch.keybinds = new string[8]; config_KeyWheel = ((BaseUnityPlugin)this).Config.Bind<string>("EMOTE WHEEL", "Key", "v", "SUPPORTED KEYS A-Z | 0-9 | F1-F12 "); EmotePatch.wheelKeybind = config_KeyWheel.Value; config_InventoryCheck = ((BaseUnityPlugin)this).Config.Bind<bool>("OTHERS", "InventoryCheck", true, "Prevents some emotes from performing while holding any item/scrap"); EmotePatch.InvCheck = config_InventoryCheck.Value; config_KeyEmote3 = ((BaseUnityPlugin)this).Config.Bind<string>("QUICK EMOTES", "Middle Finger", "3", "MIDDLEFINGER: SUPPORTED KEYS A-Z | 0-9 | F1-F12 "); config_toggleEmote3 = ((BaseUnityPlugin)this).Config.Bind<bool>("QUICK EMOTES", "Enable Middle Finger", true, "ENABLE QUICK MIDDLEFINGER"); EmotePatch.keybinds[2] = (config_toggleEmote3.Value ? config_KeyEmote3.Value : "/"); EmotePatch.enable3 = config_toggleEmote3.Value; config_KeyEmote4 = ((BaseUnityPlugin)this).Config.Bind<string>("QUICK EMOTES", "The Griddy", "6", "THE GRIDDY: SUPPORTED KEYS A-Z | 0-9 | F1-F12 "); config_toggleEmote4 = ((BaseUnityPlugin)this).Config.Bind<bool>("QUICK EMOTES", "Enable The Griddy", true, "ENABLE QUICK THE GRIDDY"); EmotePatch.keybinds[5] = (config_toggleEmote4.Value ? config_KeyEmote4.Value : "/"); EmotePatch.enable4 = config_toggleEmote4.Value; config_KeyEmote5 = ((BaseUnityPlugin)this).Config.Bind<string>("QUICK EMOTES", "Shy", "5", "SHY: SUPPORTED KEYS A-Z | 0-9 | F1-F12 "); config_toggleEmote5 = ((BaseUnityPlugin)this).Config.Bind<bool>("QUICK EMOTES", "Enable Shy", true, "ENABLE QUICK SHY"); EmotePatch.keybinds[4] = (config_toggleEmote5.Value ? config_KeyEmote5.Value : "/"); EmotePatch.enable5 = config_toggleEmote5.Value; config_KeyEmote6 = ((BaseUnityPlugin)this).Config.Bind<string>("QUICK EMOTES", "Clap", "4", "CLAP: SUPPORTED KEYS A-Z | 0-9 | F1-F12 "); config_toggleEmote6 = ((BaseUnityPlugin)this).Config.Bind<bool>("QUICK EMOTES", "Enable Clap", true, "ENABLE QUICK CLAP"); EmotePatch.keybinds[3] = (config_toggleEmote6.Value ? config_KeyEmote6.Value : "/"); EmotePatch.enable6 = config_toggleEmote6.Value; config_KeyEmote7 = ((BaseUnityPlugin)this).Config.Bind<string>("QUICK EMOTES", "Twerk", "7", "TWERK: SUPPORTED KEYS A-Z | 0-9 | F1-F12 "); config_toggleEmote7 = ((BaseUnityPlugin)this).Config.Bind<bool>("QUICK EMOTES", "Enable Twerk", true, "ENABLE QUICK TWERK"); EmotePatch.keybinds[6] = (config_toggleEmote7.Value ? config_KeyEmote7.Value : "/"); EmotePatch.enable7 = config_toggleEmote7.Value; config_KeyEmote8 = ((BaseUnityPlugin)this).Config.Bind<string>("QUICK EMOTES", "Salute", "8", "SALUTE: SUPPORTED KEYS A-Z | 0-9 | F1-F12 "); config_toggleEmote8 = ((BaseUnityPlugin)this).Config.Bind<bool>("QUICK EMOTES", "Enable Salute", true, "ENABLE QUICK SALUTE"); EmotePatch.keybinds[7] = (config_toggleEmote8.Value ? config_KeyEmote8.Value : "/"); EmotePatch.enable8 = config_toggleEmote8.Value; } } public static class PluginInfo { public const string Guid = "MoreEmotes"; public const string Name = "MoreEmotes-Sligili"; public const string Ver = "1.2.0"; } } namespace MoreEmotes.Patch { internal class EmotePatch { public static AssetBundle animationsBundle; public static AssetBundle animatorBundle; public static bool enable3; public static bool enable4; public static bool enable5; public static bool enable6; public static bool enable7; public static bool enable8; public static string[] keybinds; public static string wheelKeybind; private static CallbackContext context; public static RuntimeAnimatorController local; public static RuntimeAnimatorController others; private static int currentEmoteID; private static float svMovSpeed; public static bool IncompatibleStuff; public static bool InvCheck; public static bool emoteWheelIsOpened; public static GameObject wheel; private static SelectionWheel selectionWheel; [HarmonyPatch(typeof(PlayerControllerB), "Start")] [HarmonyPostfix] private static void StartPostfix(PlayerControllerB __instance) { GameObject gameObject = ((Component)((Component)((Component)__instance).gameObject.transform.Find("ScavengerModel")).transform.Find("metarig")).gameObject; CustomAudioAnimationEvent customAudioAnimationEvent = gameObject.AddComponent<CustomAudioAnimationEvent>(); svMovSpeed = __instance.movementSpeed; customAudioAnimationEvent.player = __instance; if (Object.FindObjectsOfType(typeof(SelectionWheel)).Length == 0) { GameObject val = animationsBundle.LoadAsset<GameObject>("Assets/MoreEmotes/Resources/MoreEmotesMenu.prefab"); GameObject gameObject2 = ((Component)((Component)GameObject.Find("Systems").gameObject.transform.Find("UI")).gameObject.transform.Find("Canvas")).gameObject; if ((Object)(object)wheel != (Object)null) { Object.Destroy((Object)(object)wheel.gameObject); } wheel = Object.Instantiate<GameObject>(val, gameObject2.transform); selectionWheel = wheel.AddComponent<SelectionWheel>(); SelectionWheel.emotes_Keybinds = new string[keybinds.Length + 1]; SelectionWheel.emotes_Keybinds = keybinds; } } [HarmonyPatch(typeof(PlayerControllerB), "Update")] [HarmonyPostfix] private static void UpdatePostfix(PlayerControllerB __instance) { //IL_01c3: Unknown result type (might be due to invalid IL or missing references) //IL_01e4: Unknown result type (might be due to invalid IL or missing references) if (!__instance.isPlayerControlled || !((NetworkBehaviour)__instance).IsOwner) { __instance.playerBodyAnimator.runtimeAnimatorController = others; return; } if ((Object)(object)__instance.playerBodyAnimator != (Object)(object)local) { __instance.playerBodyAnimator.runtimeAnimatorController = local; } if (__instance.performingEmote) { currentEmoteID = __instance.playerBodyAnimator.GetInteger("emoteNumber"); } if (!IncompatibleStuff) { bool flag = (bool)Reflection.CallMethod(__instance, "CheckConditionsForEmote") && currentEmoteID == 6 && __instance.performingEmote; __instance.movementSpeed = (flag ? (svMovSpeed / 2f) : svMovSpeed); } if (InputControlExtensions.IsPressed(((InputControl)Keyboard.current)[wheelKeybind], 0f) && !emoteWheelIsOpened && !__instance.isPlayerDead && !__instance.inTerminalMenu && !__instance.quickMenuManager.isMenuOpen) { emoteWheelIsOpened = true; Cursor.visible = true; Cursor.lockState = (CursorLockMode)2; wheel.SetActive(emoteWheelIsOpened); __instance.disableLookInput = true; } else if ((!InputControlExtensions.IsPressed(((InputControl)Keyboard.current)[wheelKeybind], 0f) && emoteWheelIsOpened) || __instance.quickMenuManager.isMenuOpen) { if (!__instance.quickMenuManager.isMenuOpen || __instance.isPlayerDead) { int selectedEmoteID = selectionWheel.selectedEmoteID; if (selectedEmoteID <= 3 || selectedEmoteID == 6 || !InvCheck) { __instance.PerformEmote(context, selectedEmoteID); } else if (!__instance.isHoldingObject) { __instance.PerformEmote(context, selectedEmoteID); } Cursor.visible = false; Cursor.lockState = (CursorLockMode)1; } if (__instance.isPlayerDead && !__instance.quickMenuManager.isMenuOpen) { Cursor.visible = false; Cursor.lockState = (CursorLockMode)1; } __instance.disableLookInput = false; emoteWheelIsOpened = false; wheel.SetActive(emoteWheelIsOpened); } if (!__instance.performingEmote || currentEmoteID == 7) { } if (!emoteWheelIsOpened) { EmoteInput(keybinds[2], enable3, needsEmptyHands: false, 3, __instance); EmoteInput(keybinds[3], enable6, needsEmptyHands: true, 4, __instance); EmoteInput(keybinds[4], enable5, needsEmptyHands: true, 5, __instance); EmoteInput(keybinds[5], enable4, needsEmptyHands: false, 6, __instance); EmoteInput(keybinds[6], enable7, needsEmptyHands: true, 7, __instance); EmoteInput(keybinds[7], enable8, needsEmptyHands: true, 8, __instance); } } private static void EmoteInput(string keyBind, bool enabled, bool needsEmptyHands, int emoteID, PlayerControllerB player) { //IL_0054: Unknown result type (might be due to invalid IL or missing references) if (InputControlExtensions.IsPressed(((InputControl)Keyboard.current)[keyBind], 0f) && enabled && (!player.isHoldingObject || !needsEmptyHands || !InvCheck) && (!player.performingEmote || currentEmoteID != emoteID)) { player.PerformEmote(context, emoteID); } } [HarmonyPatch(typeof(PlayerControllerB), "CheckConditionsForEmote")] [HarmonyPrefix] private static bool prefixCheckConditions(ref bool __result, PlayerControllerB __instance) { bool flag = (bool)Reflection.GetInstanceField(typeof(PlayerControllerB), __instance, "isJumping"); if (currentEmoteID == 6) { __result = !__instance.inSpecialInteractAnimation && !__instance.isPlayerDead && !flag && __instance.moveInputVector.x == 0f && !__instance.isSprinting && !__instance.isCrouching && !__instance.isClimbingLadder && !__instance.isGrabbingObjectAnimation && !__instance.inTerminalMenu && !__instance.isTypingChat; return false; } return true; } [HarmonyPatch(typeof(PlayerControllerB), "PerformEmote")] [HarmonyPrefix] private static void PerformEmotePrefix(CallbackContext context, int emoteID, PlayerControllerB __instance) { if ((emoteID >= 3 || emoteWheelIsOpened || ((CallbackContext)(ref context)).performed) && ((((NetworkBehaviour)__instance).IsOwner && __instance.isPlayerControlled && (!((NetworkBehaviour)__instance).IsServer || __instance.isHostPlayerObject)) || __instance.isTestingPlayer) && (bool)Reflection.CallMethod(__instance, "CheckConditionsForEmote") && !(__instance.timeSinceStartingEmote < 0.5f)) { __instance.timeSinceStartingEmote = 0f; __instance.performingEmote = true; __instance.playerBodyAnimator.SetInteger("emoteNumber", emoteID); __instance.StartPerformingEmoteServerRpc(); } } } public class CustomAudioAnimationEvent : MonoBehaviour { private Animator animator; private AudioSource SoundsSource; public static AudioClip[] claps = (AudioClip[])(object)new AudioClip[2]; public PlayerControllerB player; private void Start() { animator = ((Component)this).GetComponent<Animator>(); SoundsSource = player.movementAudio; } public void PlayClapSound() { //IL_0087: Unknown result type (might be due to invalid IL or missing references) if (player.performingEmote && (!((NetworkBehaviour)player).IsOwner || !player.isPlayerControlled || animator.GetInteger("emoteNumber") == 4)) { bool flag = player.isInHangarShipRoom && player.playersManager.hangarDoorsClosed; RoundManager.Instance.PlayAudibleNoise(((Component)player).transform.position, 22f, 0.6f, 0, flag, 6); SoundsSource.pitch = Random.Range(0.59f, 0.79f); SoundsSource.PlayOneShot(claps[Random.Range(0, claps.Length)]); } } public void PlayFootstepSound() { if (player.performingEmote && (!((NetworkBehaviour)player).IsOwner || !player.isPlayerControlled || animator.GetInteger("emoteNumber") == 6 || animator.GetInteger("emoteNumber") == 8) && ((Vector2)(ref player.moveInputVector)).sqrMagnitude == 0f) { player.PlayFootstepLocal(); player.PlayFootstepServer(); } } } public enum Emotes { Dance_1 = 1, Point, Middle_Finger, Clap, Shy, The_Griddy, Twerk, Salute } public class SelectionWheel : MonoBehaviour { public RectTransform selectionBlock; public Text emoteInformation; public Text pageInformation; private int blocksNumber = 8; private int currentBlock = 1; public int pageNumber; public int selectedEmoteID; private float angle; private float pageCooldown = 0.1f; public GameObject[] Pages; private int cuadrante = 0; public string selectedEmoteName; public float wheelMovementOffset = 3.3f; public static string[] emotes_Keybinds; private Vector2 center; private void OnEnable() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_01a7: Unknown result type (might be due to invalid IL or missing references) center = new Vector2((float)(Screen.width / 2), (float)(Screen.height / 2)); PlayerInput component = GameObject.Find("PlayerSettingsObject").GetComponent<PlayerInput>(); emotes_Keybinds[0] = InputActionRebindingExtensions.GetBindingDisplayString(component.currentActionMap.FindAction("Emote1", false), 0, (DisplayStringOptions)0); emotes_Keybinds[1] = InputActionRebindingExtensions.GetBindingDisplayString(component.currentActionMap.FindAction("Emote2", false), 0, (DisplayStringOptions)0); Cursor.visible = true; selectionBlock = ((Component)((Component)this).gameObject.transform.Find("SelectedEmote")).gameObject.GetComponent<RectTransform>(); GameObject gameObject = ((Component)((Component)this).gameObject.transform.Find("FunctionalContent")).gameObject; emoteInformation = ((Component)((Component)((Component)this).gameObject.transform.Find("Graphics")).gameObject.transform.Find("EmoteInfo")).GetComponent<Text>(); Pages = (GameObject[])(object)new GameObject[gameObject.transform.childCount]; pageInformation = ((Component)((Component)((Component)this).gameObject.transform.Find("Graphics")).gameObject.transform.Find("PageNumber")).GetComponent<Text>(); pageInformation.text = "Page " + Pages.Length + "/" + (pageNumber + 1); for (int i = 0; i < gameObject.transform.childCount; i++) { Pages[i] = ((Component)gameObject.transform.GetChild(i)).gameObject; } Mouse.current.WarpCursorPosition(center); } private void Update() { wheelSelection(); pageSelection(); selectedEmoteID = currentBlock + Mathf.RoundToInt((float)(blocksNumber / 4)) + blocksNumber * pageNumber; displayEmoteInfo(); } private void wheelSelection() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0011: 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_0183: 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) if (!(Vector2.Distance(center, ((InputControl<Vector2>)(object)((Pointer)Mouse.current).position).ReadValue()) < wheelMovementOffset)) { bool flag = ((InputControl<float>)(object)((Pointer)Mouse.current).position.x).ReadValue() > center.x; bool flag2 = ((InputControl<float>)(object)((Pointer)Mouse.current).position.y).ReadValue() > center.y; cuadrante = ((!flag) ? (flag2 ? 2 : 3) : (flag2 ? 1 : 4)); float num = (((InputControl<float>)(object)((Pointer)Mouse.current).position.y).ReadValue() - center.y) / (((InputControl<float>)(object)((Pointer)Mouse.current).position.x).ReadValue() - center.x); float num2 = 180 * (cuadrante - ((cuadrante <= 2) ? 1 : 2)); angle = Mathf.Atan(num) * (180f / (float)Math.PI) + num2; if (angle == 90f) { angle = 270f; } else if (angle == 270f) { angle = 90f; } float num3 = 360 / blocksNumber; currentBlock = Mathf.RoundToInt((angle - num3 * 1.5f) / num3); ((Transform)selectionBlock).localRotation = Quaternion.Euler(((Component)this).transform.rotation.z, ((Component)this).transform.rotation.y, num3 * (float)currentBlock); } } private void pageSelection() { pageInformation.text = "Page " + Pages.Length + "/" + (pageNumber + 1); if (pageCooldown > 0f) { pageCooldown -= Time.deltaTime; } else if (((InputControl<float>)(object)((Vector2Control)Mouse.current.scroll).y).ReadValue() != 0f) { GameObject[] pages = Pages; foreach (GameObject val in pages) { val.SetActive(false); } int num = ((((InputControl<float>)(object)((Vector2Control)Mouse.current.scroll).y).ReadValue() > 0f) ? 1 : (-1)); if (pageNumber + 1 > Pages.Length - 1 && num > 0) { pageNumber = 0; } else if (pageNumber - 1 < 0 && num < 0) { pageNumber = Pages.Length - 1; } else { pageNumber += num; } Pages[pageNumber].SetActive(true); pageCooldown = 0.1f; } } private void displayEmoteInfo() { string text = ((selectedEmoteID > emotes_Keybinds.Length) ? "" : emotes_Keybinds[selectedEmoteID - 1]); object obj; if (selectedEmoteID <= Enum.GetValues(typeof(Emotes)).Length) { Emotes emotes = (Emotes)selectedEmoteID; obj = emotes.ToString().Replace("_", " "); } else { obj = "EMPTY"; } string text2 = (string)obj; emoteInformation.text = text2 + "\n[" + text.ToUpper() + "]"; } } }
BepInEx/plugins/steven4547466-CommandHandler/CommandHandler.dll
Decompiled a year agousing System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Reflection; using System.Reflection.Emit; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Configuration; using GameNetcodeStuff; using HarmonyLib; using UnityEngine; using UnityEngine.EventSystems; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: AssemblyTitle("CommandHandler")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("CommandHandler")] [assembly: AssemblyCopyright("Copyright © 2023")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("5c941518-e9b2-4b62-8e48-214a42ca67db")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] namespace CommandHandler; [BepInPlugin("steven4547466.CommandHandler", "Command Handler", "1.0.0")] public class CommandHandler : BaseUnityPlugin { [HarmonyPatch(typeof(HUDManager), "SubmitChat_performed")] private static class SubmitChatPatch { private static bool HandleMessage(HUDManager manager) { string text = manager.chatTextField.text; if (!Utility.IsNullOrWhiteSpace(text) && text.StartsWith(CommandPrefix.Value)) { string[] array = text.Split(new char[1] { ' ' }); string text2 = array[0].Substring(CommandPrefix.Value.Length); if (TryGetCommandHandler(text2, out var handler)) { string[] obj = array.Skip(1).ToArray(); try { handler(obj); } catch (Exception ex) { ((BaseUnityPlugin)Singleton).Logger.LogError((object)("Error handling command: " + text2)); ((BaseUnityPlugin)Singleton).Logger.LogError((object)ex); } } manager.localPlayer.isTypingChat = false; manager.chatTextField.text = ""; EventSystem.current.SetSelectedGameObject((GameObject)null); ((Behaviour)manager.typingIndicator).enabled = false; return true; } return false; } private static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions, ILGenerator generator) { List<CodeInstruction> newInstructions = new List<CodeInstruction>(instructions); Label label = generator.DefineLabel(); newInstructions[newInstructions.Count - 1].labels.Add(label); int index = newInstructions.FindIndex((CodeInstruction i) => i.opcode == OpCodes.Ldfld && (FieldInfo)i.operand == AccessTools.Field(typeof(PlayerControllerB), "isPlayerDead")) - 2; newInstructions.InsertRange(index, (IEnumerable<CodeInstruction>)(object)new CodeInstruction[3] { CodeInstructionExtensions.MoveLabelsFrom(new CodeInstruction(OpCodes.Ldarg_0, (object)null), newInstructions[index]), new CodeInstruction(OpCodes.Call, (object)AccessTools.Method(typeof(SubmitChatPatch), "HandleMessage", (Type[])null, (Type[])null)), new CodeInstruction(OpCodes.Brtrue, (object)label) }); for (int z = 0; z < newInstructions.Count; z++) { yield return newInstructions[z]; } } } internal static ConfigEntry<string> CommandPrefix; internal static Dictionary<string, Action<string[]>> CommandHandlers = new Dictionary<string, Action<string[]>>(); internal static Dictionary<string, List<string>> CommandAliases = new Dictionary<string, List<string>>(); private static Harmony Harmony { get; set; } internal static CommandHandler Singleton { get; private set; } private void Awake() { //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Expected O, but got Unknown Singleton = this; CommandPrefix = ((BaseUnityPlugin)this).Config.Bind<string>("General", "Prefix", "/", "Command prefix"); Harmony = new Harmony($"steven4547466.CommandHandler-{DateTime.Now.Ticks}"); Harmony.PatchAll(); } public static bool RegisterCommand(string command, Action<string[]> handler) { if (CommandHandlers.ContainsKey(command)) { return false; } CommandHandlers.Add(command, handler); return true; } public static bool RegisterCommand(string command, List<string> aliases, Action<string[]> handler) { if (GetCommandHandler(command) != null) { return false; } foreach (string alias in aliases) { if (GetCommandHandler(alias) != null) { return false; } } CommandHandlers.Add(command, handler); CommandAliases.Add(command, aliases); return true; } public static bool UnregisterCommand(string command) { CommandAliases.Remove(command); return CommandHandlers.Remove(command); } public static Action<string[]> GetCommandHandler(string command) { if (CommandHandlers.TryGetValue(command, out var value)) { return value; } foreach (KeyValuePair<string, List<string>> commandAlias in CommandAliases) { if (commandAlias.Value.Contains(command)) { return CommandHandlers[commandAlias.Key]; } } return null; } public static bool TryGetCommandHandler(string command, out Action<string[]> handler) { handler = GetCommandHandler(command); return handler != null; } }
BepInEx/plugins/steven4547466-YoutubeBoombox/YoutubeBoombox.dll
Decompiled a year ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Generic; using System.ComponentModel; using System.Diagnostics; using System.Globalization; using System.IO; using System.IO.Compression; using System.Linq; using System.Net.Http; using System.Reflection; using System.Reflection.Emit; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Serialization; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using System.Text; using System.Text.RegularExpressions; using System.Threading; using System.Threading.Tasks; using BepInEx; using BepInEx.Configuration; using CommandHandler; using GameNetcodeStuff; using HarmonyLib; using Newtonsoft.Json; using Newtonsoft.Json.Converters; using Unity.Netcode; using UnityEngine; using UnityEngine.InputSystem; using UnityEngine.InputSystem.Controls; using YoutubeDLSharp; using YoutubeDLSharp.Converters; using YoutubeDLSharp.Helpers; using YoutubeDLSharp.Metadata; using YoutubeDLSharp.Options; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: AssemblyTitle("YoutubeBoombox")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("YoutubeBoombox")] [assembly: AssemblyCopyright("Copyright © 2023")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("50a0e49b-1441-46da-9fbf-11bd9a8df0fd")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] internal class <Module> { static <Module>() { } } namespace System.Runtime.CompilerServices { [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] internal sealed class IgnoresAccessChecksToAttribute : Attribute { public IgnoresAccessChecksToAttribute(string assemblyName) { } } } namespace YoutubeDLSharp { public enum DownloadState { None, PreProcessing, Downloading, PostProcessing, Error, Success } public class DownloadProgress { public DownloadState State { get; } public float Progress { get; } public string TotalDownloadSize { get; } public string DownloadSpeed { get; } public string ETA { get; } public int VideoIndex { get; } public string Data { get; } public DownloadProgress(DownloadState status, float progress = 0f, string totalDownloadSize = null, string downloadSpeed = null, string eta = null, int index = 1, string data = null) { State = status; Progress = progress; TotalDownloadSize = totalDownloadSize; DownloadSpeed = downloadSpeed; ETA = eta; VideoIndex = index; Data = data; } } public class RunResult<T> { public bool Success { get; } public string[] ErrorOutput { get; } public T Data { get; } public RunResult(bool success, string[] error, T result) { Success = success; ErrorOutput = error; Data = result; } } public static class Utils { internal class FFmpegApi { public class Root { [JsonProperty("version")] public string Version { get; set; } [JsonProperty("permalink")] public string Permalink { get; set; } [JsonProperty("bin")] public Bin Bin { get; set; } } public class Bin { [JsonProperty("windows-64")] public OsBinVersion Windows64 { get; set; } [JsonProperty("linux-64")] public OsBinVersion Linux64 { get; set; } [JsonProperty("osx-64")] public OsBinVersion Osx64 { get; set; } } public class OsBinVersion { [JsonProperty("ffmpeg")] public string Ffmpeg { get; set; } [JsonProperty("ffprobe")] public string Ffprobe { get; set; } } public enum BinaryType { [EnumMember(Value = "ffmpeg")] FFmpeg, [EnumMember(Value = "ffprobe")] FFprobe } } private static readonly HttpClient _client = new HttpClient(); private static readonly Regex rgxTimestamp = new Regex("[0-9]+(?::[0-9]+)+", RegexOptions.Compiled); private static readonly Dictionary<char, string> accentChars = "ÂÃÄÀÁÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖŐØŒÙÚÛÜŰÝÞßàáâãäåæçèéêëìíîïðñòóôõöőøœùúûüűýþÿ".Zip(new string[68] { "A", "A", "A", "A", "A", "A", "AE", "C", "E", "E", "E", "E", "I", "I", "I", "I", "D", "N", "O", "O", "O", "O", "O", "O", "O", "OE", "U", "U", "U", "U", "U", "Y", "P", "ss", "a", "a", "a", "a", "a", "a", "ae", "c", "e", "e", "e", "e", "i", "i", "i", "i", "o", "n", "o", "o", "o", "o", "o", "o", "o", "oe", "u", "u", "u", "u", "u", "y", "p", "y" }, (char c, string s) => new { Key = c, Val = s }).ToDictionary(o => o.Key, o => o.Val); public static string YtDlpBinaryName => GetYtDlpBinaryName(); public static string FfmpegBinaryName => GetFfmpegBinaryName(); public static string FfprobeBinaryName => GetFfprobeBinaryName(); public static string Sanitize(string s, bool restricted = false) { rgxTimestamp.Replace(s, (Match m) => m.Groups[0].Value.Replace(':', '_')); string text = string.Join("", s.Select((char c) => sanitizeChar(c, restricted))); text = text.Replace("__", "_").Trim(new char[1] { '_' }); if (restricted && text.StartsWith("-_")) { text = text.Substring(2); } if (text.StartsWith("-")) { text = "_" + text.Substring(1); } text = text.TrimStart(new char[1] { '.' }); if (string.IsNullOrWhiteSpace(text)) { text = "_"; } return text; } private static string sanitizeChar(char c, bool restricted) { if (restricted && accentChars.ContainsKey(c)) { return accentChars[c]; } if (c != '?' && c >= ' ') { switch (c) { case '\u007f': break; case '"': if (!restricted) { return "'"; } return ""; case ':': if (!restricted) { return " -"; } return "_-"; default: if (Enumerable.Contains("\\/|*<>", c)) { return "_"; } if (restricted && Enumerable.Contains("!&'()[]{}$;`^,# ", c)) { return "_"; } if (restricted && c > '\u007f') { return "_"; } return c.ToString(); } } return ""; } public static string GetFullPath(string fileName) { if (File.Exists(fileName)) { return Path.GetFullPath(fileName); } string environmentVariable = Environment.GetEnvironmentVariable("PATH"); string[] array = environmentVariable.Split(new char[1] { Path.PathSeparator }); foreach (string path in array) { string text = Path.Combine(path, fileName); if (File.Exists(text)) { return text; } } return null; } public static async Task DownloadBinaries(bool skipExisting = true, string directoryPath = "") { if (skipExisting) { if (!File.Exists(Path.Combine(directoryPath, GetYtDlpBinaryName()))) { await DownloadYtDlp(directoryPath); } if (!File.Exists(Path.Combine(directoryPath, GetFfmpegBinaryName()))) { await DownloadFFmpeg(directoryPath); } if (!File.Exists(Path.Combine(directoryPath, GetFfprobeBinaryName()))) { await DownloadFFprobe(directoryPath); } } else { await DownloadYtDlp(directoryPath); await DownloadFFmpeg(directoryPath); await DownloadFFprobe(directoryPath); } } private static string GetYtDlpDownloadUrl() { return OSHelper.GetOSVersion() switch { OSVersion.Windows => "https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp.exe", OSVersion.OSX => "https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp_macos", OSVersion.Linux => "https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp", _ => throw new Exception("Your OS isn't supported"), }; } private static string GetYtDlpBinaryName() { string ytDlpDownloadUrl = GetYtDlpDownloadUrl(); return Path.GetFileName(ytDlpDownloadUrl); } private static string GetFfmpegBinaryName() { switch (OSHelper.GetOSVersion()) { case OSVersion.Windows: return "ffmpeg.exe"; case OSVersion.OSX: case OSVersion.Linux: return "ffmpeg"; default: throw new Exception("Your OS isn't supported"); } } private static string GetFfprobeBinaryName() { switch (OSHelper.GetOSVersion()) { case OSVersion.Windows: return "ffprobe.exe"; case OSVersion.OSX: case OSVersion.Linux: return "ffprobe"; default: throw new Exception("Your OS isn't supported"); } } public static async Task DownloadYtDlp(string directoryPath = "") { string ytDlpDownloadUrl = GetYtDlpDownloadUrl(); if (string.IsNullOrEmpty(directoryPath)) { directoryPath = Directory.GetCurrentDirectory(); } string downloadLocation = Path.Combine(directoryPath, Path.GetFileName(ytDlpDownloadUrl)); File.WriteAllBytes(downloadLocation, await DownloadFileBytesAsync(ytDlpDownloadUrl)); } public static async Task DownloadFFmpeg(string directoryPath = "") { await FFDownloader(directoryPath); } public static async Task DownloadFFprobe(string directoryPath = "") { await FFDownloader(directoryPath, FFmpegApi.BinaryType.FFprobe); } private static async Task FFDownloader(string directoryPath = "", FFmpegApi.BinaryType binary = FFmpegApi.BinaryType.FFmpeg) { if (string.IsNullOrEmpty(directoryPath)) { directoryPath = Directory.GetCurrentDirectory(); } FFmpegApi.Root root = JsonConvert.DeserializeObject<FFmpegApi.Root>(await (await _client.GetAsync("https://ffbinaries.com/api/v1/version/latest")).Content.ReadAsStringAsync()); FFmpegApi.OsBinVersion osBinVersion = OSHelper.GetOSVersion() switch { OSVersion.Windows => root?.Bin.Windows64, OSVersion.OSX => root?.Bin.Osx64, OSVersion.Linux => root?.Bin.Linux64, _ => throw new NotImplementedException("Your OS isn't supported"), }; string uri = ((binary == FFmpegApi.BinaryType.FFmpeg) ? osBinVersion.Ffmpeg : osBinVersion.Ffprobe); using MemoryStream stream = new MemoryStream(await DownloadFileBytesAsync(uri)); using ZipArchive zipArchive = new ZipArchive(stream, ZipArchiveMode.Read); if (zipArchive.Entries.Count > 0) { zipArchive.Entries[0].ExtractToFile(Path.Combine(directoryPath, zipArchive.Entries[0].FullName), overwrite: true); } } private static async Task<byte[]> DownloadFileBytesAsync(string uri) { if (!Uri.TryCreate(uri, UriKind.Absolute, out Uri _)) { throw new InvalidOperationException("URI is invalid."); } return await _client.GetByteArrayAsync(uri); } } public class YoutubeDL { private static readonly Regex rgxFile = new Regex("^outfile:\\s\\\"?(.*)\\\"?", RegexOptions.Compiled); private static Regex rgxFilePostProc = new Regex("\\[download\\] Destination: [a-zA-Z]:\\\\\\S+\\.\\S{3,}", RegexOptions.Compiled); protected ProcessRunner runner; public string YoutubeDLPath { get; set; } = Utils.YtDlpBinaryName; public string FFmpegPath { get; set; } = Utils.FfmpegBinaryName; public string OutputFolder { get; set; } = Environment.CurrentDirectory; public string OutputFileTemplate { get; set; } = "%(title)s [%(id)s].%(ext)s"; public bool RestrictFilenames { get; set; } public bool OverwriteFiles { get; set; } = true; public bool IgnoreDownloadErrors { get; set; } = true; public string Version => FileVersionInfo.GetVersionInfo(Utils.GetFullPath(YoutubeDLPath)).FileVersion; public YoutubeDL(byte maxNumberOfProcesses = 4) { runner = new ProcessRunner(maxNumberOfProcesses); } public async Task SetMaxNumberOfProcesses(byte count) { await runner.SetTotalCount(count); } public async Task<RunResult<string[]>> RunWithOptions(string[] urls, OptionSet options, CancellationToken ct) { List<string> output = new List<string>(); YoutubeDLProcess youtubeDLProcess = new YoutubeDLProcess(YoutubeDLPath); youtubeDLProcess.OutputReceived += delegate(object o, DataReceivedEventArgs e) { output.Add(e.Data); }; var (num, error) = await runner.RunThrottled(youtubeDLProcess, urls, options, ct); return new RunResult<string[]>(num == 0, error, output.ToArray()); } public async Task<RunResult<string>> RunWithOptions(string url, OptionSet options, CancellationToken ct = default(CancellationToken), IProgress<DownloadProgress> progress = null, IProgress<string> output = null, bool showArgs = true) { string outFile = string.Empty; YoutubeDLProcess youtubeDLProcess = new YoutubeDLProcess(YoutubeDLPath); if (showArgs) { output?.Report("Arguments: " + youtubeDLProcess.ConvertToArgs(new string[1] { url }, options) + "\n"); } else { output?.Report("Starting Download: " + url); } youtubeDLProcess.OutputReceived += delegate(object o, DataReceivedEventArgs e) { Match match = rgxFilePostProc.Match(e.Data); if (match.Success) { outFile = match.Groups[0].ToString().Replace("[download] Destination:", "").Replace(" ", ""); progress?.Report(new DownloadProgress(DownloadState.Success, 0f, null, null, null, 1, outFile)); } output?.Report(e.Data); }; var (num, error) = await runner.RunThrottled(youtubeDLProcess, new string[1] { url }, options, ct, progress); return new RunResult<string>(num == 0, error, outFile); } public async Task<string> RunUpdate() { string output = string.Empty; YoutubeDLProcess youtubeDLProcess = new YoutubeDLProcess(YoutubeDLPath); youtubeDLProcess.OutputReceived += delegate(object o, DataReceivedEventArgs e) { output = e.Data; }; await youtubeDLProcess.RunAsync(null, new OptionSet { Update = true }); return output; } public async Task<RunResult<VideoData>> RunVideoDataFetch(string url, CancellationToken ct = default(CancellationToken), bool flat = true, bool fetchComments = false, OptionSet overrideOptions = null) { OptionSet optionSet = GetDownloadOptions(); optionSet.DumpSingleJson = true; optionSet.FlatPlaylist = flat; optionSet.WriteComments = fetchComments; if (overrideOptions != null) { optionSet = optionSet.OverrideOptions(overrideOptions); } VideoData videoData = null; YoutubeDLProcess youtubeDLProcess = new YoutubeDLProcess(YoutubeDLPath); youtubeDLProcess.OutputReceived += delegate(object o, DataReceivedEventArgs e) { videoData = JsonConvert.DeserializeObject<VideoData>(e.Data); }; var (num, error) = await runner.RunThrottled(youtubeDLProcess, new string[1] { url }, optionSet, ct); return new RunResult<VideoData>(num == 0, error, videoData); } public async Task<RunResult<string>> RunVideoDownload(string url, string format = "bestvideo+bestaudio/best", DownloadMergeFormat mergeFormat = DownloadMergeFormat.Unspecified, VideoRecodeFormat recodeFormat = VideoRecodeFormat.None, CancellationToken ct = default(CancellationToken), IProgress<DownloadProgress> progress = null, IProgress<string> output = null, OptionSet overrideOptions = null) { OptionSet optionSet = GetDownloadOptions(); optionSet.Format = format; optionSet.MergeOutputFormat = mergeFormat; optionSet.RecodeVideo = recodeFormat; if (overrideOptions != null) { optionSet = optionSet.OverrideOptions(overrideOptions); } string outputFile = string.Empty; YoutubeDLProcess youtubeDLProcess = new YoutubeDLProcess(YoutubeDLPath); output?.Report("Arguments: " + youtubeDLProcess.ConvertToArgs(new string[1] { url }, optionSet) + "\n"); youtubeDLProcess.OutputReceived += delegate(object o, DataReceivedEventArgs e) { Match match = rgxFile.Match(e.Data); if (match.Success) { outputFile = match.Groups[1].ToString().Trim(new char[1] { '"' }); progress?.Report(new DownloadProgress(DownloadState.Success, 0f, null, null, null, 1, outputFile)); } output?.Report(e.Data); }; var (num, error) = await runner.RunThrottled(youtubeDLProcess, new string[1] { url }, optionSet, ct, progress); return new RunResult<string>(num == 0, error, outputFile); } public async Task<RunResult<string[]>> RunVideoPlaylistDownload(string url, int? start = 1, int? end = null, int[] items = null, string format = "bestvideo+bestaudio/best", VideoRecodeFormat recodeFormat = VideoRecodeFormat.None, CancellationToken ct = default(CancellationToken), IProgress<DownloadProgress> progress = null, IProgress<string> output = null, OptionSet overrideOptions = null) { OptionSet optionSet = GetDownloadOptions(); optionSet.NoPlaylist = false; optionSet.PlaylistStart = start; optionSet.PlaylistEnd = end; if (items != null) { optionSet.PlaylistItems = string.Join(",", items); } optionSet.Format = format; optionSet.RecodeVideo = recodeFormat; if (overrideOptions != null) { optionSet = optionSet.OverrideOptions(overrideOptions); } List<string> outputFiles = new List<string>(); YoutubeDLProcess youtubeDLProcess = new YoutubeDLProcess(YoutubeDLPath); output?.Report("Arguments: " + youtubeDLProcess.ConvertToArgs(new string[1] { url }, optionSet) + "\n"); youtubeDLProcess.OutputReceived += delegate(object o, DataReceivedEventArgs e) { Match match = rgxFile.Match(e.Data); if (match.Success) { string text = match.Groups[1].ToString().Trim(new char[1] { '"' }); outputFiles.Add(text); progress?.Report(new DownloadProgress(DownloadState.Success, 0f, null, null, null, 1, text)); } output?.Report(e.Data); }; var (num, error) = await runner.RunThrottled(youtubeDLProcess, new string[1] { url }, optionSet, ct, progress); return new RunResult<string[]>(num == 0, error, outputFiles.ToArray()); } public async Task<RunResult<string>> RunAudioDownload(string url, AudioConversionFormat format = AudioConversionFormat.Best, CancellationToken ct = default(CancellationToken), IProgress<DownloadProgress> progress = null, IProgress<string> output = null, OptionSet overrideOptions = null) { OptionSet optionSet = GetDownloadOptions(); optionSet.Format = "bestaudio/best"; optionSet.ExtractAudio = true; optionSet.AudioFormat = format; if (overrideOptions != null) { optionSet = optionSet.OverrideOptions(overrideOptions); } string outputFile = string.Empty; new List<string>(); YoutubeDLProcess youtubeDLProcess = new YoutubeDLProcess(YoutubeDLPath); output?.Report("Arguments: " + youtubeDLProcess.ConvertToArgs(new string[1] { url }, optionSet) + "\n"); youtubeDLProcess.OutputReceived += delegate(object o, DataReceivedEventArgs e) { Match match = rgxFile.Match(e.Data); if (match.Success) { outputFile = match.Groups[1].ToString().Trim(new char[1] { '"' }); progress?.Report(new DownloadProgress(DownloadState.Success, 0f, null, null, null, 1, outputFile)); } output?.Report(e.Data); }; var (num, error) = await runner.RunThrottled(youtubeDLProcess, new string[1] { url }, optionSet, ct, progress); return new RunResult<string>(num == 0, error, outputFile); } public async Task<RunResult<string[]>> RunAudioPlaylistDownload(string url, int? start = 1, int? end = null, int[] items = null, AudioConversionFormat format = AudioConversionFormat.Best, CancellationToken ct = default(CancellationToken), IProgress<DownloadProgress> progress = null, IProgress<string> output = null, OptionSet overrideOptions = null) { List<string> outputFiles = new List<string>(); OptionSet optionSet = GetDownloadOptions(); optionSet.NoPlaylist = false; optionSet.PlaylistStart = start; optionSet.PlaylistEnd = end; if (items != null) { optionSet.PlaylistItems = string.Join(",", items); } optionSet.Format = "bestaudio/best"; optionSet.ExtractAudio = true; optionSet.AudioFormat = format; if (overrideOptions != null) { optionSet = optionSet.OverrideOptions(overrideOptions); } YoutubeDLProcess youtubeDLProcess = new YoutubeDLProcess(YoutubeDLPath); output?.Report("Arguments: " + youtubeDLProcess.ConvertToArgs(new string[1] { url }, optionSet) + "\n"); youtubeDLProcess.OutputReceived += delegate(object o, DataReceivedEventArgs e) { Match match = rgxFile.Match(e.Data); if (match.Success) { string text = match.Groups[1].ToString().Trim(new char[1] { '"' }); outputFiles.Add(text); progress?.Report(new DownloadProgress(DownloadState.Success, 0f, null, null, null, 1, text)); } output?.Report(e.Data); }; var (num, error) = await runner.RunThrottled(youtubeDLProcess, new string[1] { url }, optionSet, ct, progress); return new RunResult<string[]>(num == 0, error, outputFiles.ToArray()); } protected virtual OptionSet GetDownloadOptions() { return new OptionSet { IgnoreErrors = IgnoreDownloadErrors, IgnoreConfig = true, NoPlaylist = true, Downloader = "m3u8:native", DownloaderArgs = "ffmpeg:-nostats -loglevel 0", Output = Path.Combine(OutputFolder, OutputFileTemplate), RestrictFilenames = RestrictFilenames, ForceOverwrites = OverwriteFiles, NoOverwrites = !OverwriteFiles, NoPart = true, FfmpegLocation = Utils.GetFullPath(FFmpegPath), Exec = "echo outfile: {}" }; } } public class YoutubeDLProcess { private static readonly Regex rgxPlaylist = new Regex("Downloading video (\\d+) of (\\d+)", RegexOptions.Compiled); private static readonly Regex rgxProgress = new Regex("\\[download\\]\\s+(?:(?<percent>[\\d\\.]+)%(?:\\s+of\\s+\\~?\\s*(?<total>[\\d\\.\\w]+))?\\s+at\\s+(?:(?<speed>[\\d\\.\\w]+\\/s)|[\\w\\s]+)\\s+ETA\\s(?<eta>[\\d\\:]+))?", RegexOptions.Compiled); private static readonly Regex rgxPost = new Regex("\\[(\\w+)\\]\\s+", RegexOptions.Compiled); public string PythonPath { get; set; } public string ExecutablePath { get; set; } public bool UseWindowsEncodingWorkaround { get; set; } = true; public event EventHandler<DataReceivedEventArgs> OutputReceived; public event EventHandler<DataReceivedEventArgs> ErrorReceived; public YoutubeDLProcess(string executablePath = "yt-dlp.exe") { ExecutablePath = executablePath; } internal string ConvertToArgs(string[] urls, OptionSet options) { return ((urls != null) ? string.Join(" ", urls.Select((string s) => "\"" + s + "\"")) : string.Empty) + options.ToString(); } public async Task<int> RunAsync(string[] urls, OptionSet options) { return await RunAsync(urls, options, CancellationToken.None); } public async Task<int> RunAsync(string[] urls, OptionSet options, CancellationToken ct, IProgress<DownloadProgress> progress = null) { TaskCompletionSource<int> tcs = new TaskCompletionSource<int>(); Process process = new Process(); ProcessStartInfo processStartInfo = new ProcessStartInfo { CreateNoWindow = true, UseShellExecute = false, RedirectStandardOutput = true, RedirectStandardError = true, StandardOutputEncoding = Encoding.UTF8, StandardErrorEncoding = Encoding.UTF8 }; if (OSHelper.IsWindows && UseWindowsEncodingWorkaround) { processStartInfo.FileName = "cmd.exe"; string text = (string.IsNullOrEmpty(PythonPath) ? ("\"" + ExecutablePath + "\" " + ConvertToArgs(urls, options)) : (PythonPath + " \"" + ExecutablePath + "\" " + ConvertToArgs(urls, options))); processStartInfo.Arguments = "/C chcp 65001 >nul 2>&1 && " + text; } else if (!string.IsNullOrEmpty(PythonPath)) { processStartInfo.FileName = PythonPath; processStartInfo.Arguments = "\"" + ExecutablePath + "\" " + ConvertToArgs(urls, options); } else { processStartInfo.FileName = ExecutablePath; processStartInfo.Arguments = ConvertToArgs(urls, options); } process.EnableRaisingEvents = true; process.StartInfo = processStartInfo; TaskCompletionSource<bool> tcsOut = new TaskCompletionSource<bool>(); bool isDownloading = false; process.OutputDataReceived += delegate(object o, DataReceivedEventArgs e) { if (e.Data == null) { tcsOut.SetResult(result: true); } else { Match match; if ((match = rgxProgress.Match(e.Data)).Success) { if (match.Groups.Count > 1 && match.Groups[1].Length > 0) { float progress2 = float.Parse(match.Groups[1].ToString(), CultureInfo.InvariantCulture) / 100f; Group group = match.Groups["total"]; string totalDownloadSize = (group.Success ? group.Value : null); Group group2 = match.Groups["speed"]; string downloadSpeed = (group2.Success ? group2.Value : null); Group group3 = match.Groups["eta"]; string eta = (group3.Success ? group3.Value : null); progress?.Report(new DownloadProgress(DownloadState.Downloading, progress2, totalDownloadSize, downloadSpeed, eta)); } else { progress?.Report(new DownloadProgress(DownloadState.Downloading)); } isDownloading = true; } else if ((match = rgxPlaylist.Match(e.Data)).Success) { int index = int.Parse(match.Groups[1].Value); progress?.Report(new DownloadProgress(DownloadState.PreProcessing, 0f, null, null, null, index)); isDownloading = false; } else if (isDownloading && (match = rgxPost.Match(e.Data)).Success) { progress?.Report(new DownloadProgress(DownloadState.PostProcessing, 1f)); isDownloading = false; } this.OutputReceived?.Invoke(this, e); } }; TaskCompletionSource<bool> tcsError = new TaskCompletionSource<bool>(); process.ErrorDataReceived += delegate(object o, DataReceivedEventArgs e) { if (e.Data == null) { tcsError.SetResult(result: true); } else { progress?.Report(new DownloadProgress(DownloadState.Error, 0f, null, null, null, 1, e.Data)); this.ErrorReceived?.Invoke(this, e); } }; process.Exited += async delegate { await tcsOut.Task; await tcsError.Task; tcs.TrySetResult(process.ExitCode); process.Dispose(); }; ct.Register(delegate { if (!tcs.Task.IsCompleted) { tcs.TrySetCanceled(); } try { if (!process.HasExited) { process.KillTree(); } } catch { } }); if (!(await Task.Run(() => process.Start()))) { tcs.TrySetException(new InvalidOperationException("Failed to start yt-dlp process.")); } process.BeginOutputReadLine(); process.BeginErrorReadLine(); progress?.Report(new DownloadProgress(DownloadState.PreProcessing)); return await tcs.Task; } } } namespace YoutubeDLSharp.Options { public enum DownloadMergeFormat { Unspecified, Mp4, Mkv, Ogg, Webm, Flv } public enum AudioConversionFormat { Best, Aac, Flac, Mp3, M4a, Opus, Vorbis, Wav } public enum VideoRecodeFormat { None, Mp4, Mkv, Ogg, Webm, Flv, Avi } public interface IOption { string DefaultOptionString { get; } string[] OptionStrings { get; } bool IsSet { get; } bool IsCustom { get; } void SetFromString(string s); IEnumerable<string> ToStringCollection(); } public class MultiOption<T> : IOption { private MultiValue<T> value; public string DefaultOptionString => OptionStrings.Last(); public string[] OptionStrings { get; } public bool IsSet { get; private set; } public bool IsCustom { get; } public MultiValue<T> Value { get { return value; } set { IsSet = !object.Equals(value, default(T)); this.value = value; } } public MultiOption(params string[] optionStrings) { OptionStrings = optionStrings; IsSet = false; } public MultiOption(bool isCustom, params string[] optionStrings) { OptionStrings = optionStrings; IsSet = false; IsCustom = isCustom; } public void SetFromString(string s) { string[] array = s.Split(new char[1] { ' ' }); string stringValue = s.Substring(array[0].Length).Trim().Trim(new char[1] { '"' }); if (!OptionStrings.Contains(array[0])) { throw new ArgumentException("Given string does not match required format."); } T val = Utils.OptionValueFromString<T>(stringValue); if (!IsSet) { Value = val; } else { Value.Values.Add(val); } } public override string ToString() { return string.Join(" ", ToStringCollection()); } public IEnumerable<string> ToStringCollection() { if (!IsSet) { return new string[1] { "" }; } List<string> list = new List<string>(); foreach (T value in Value.Values) { list.Add(DefaultOptionString + Utils.OptionValueToString(value)); } return list; } } public class MultiValue<T> { private readonly List<T> values; public List<T> Values => values; public MultiValue(params T[] values) { this.values = values.ToList(); } public static implicit operator MultiValue<T>(T value) { return new MultiValue<T>(value); } public static implicit operator MultiValue<T>(T[] values) { return new MultiValue<T>(values); } public static explicit operator T(MultiValue<T> value) { if (value.Values.Count == 1) { return value.Values[0]; } throw new InvalidCastException($"Cannot cast sequence of values to {typeof(T)}."); } public static explicit operator T[](MultiValue<T> value) { return value.Values.ToArray(); } } public class Option<T> : IOption { private T value; public string DefaultOptionString => OptionStrings.Last(); public string[] OptionStrings { get; } public bool IsSet { get; private set; } public T Value { get { return value; } set { IsSet = !object.Equals(value, default(T)); this.value = value; } } public bool IsCustom { get; } public Option(params string[] optionStrings) { OptionStrings = optionStrings; IsSet = false; } public Option(bool isCustom, params string[] optionStrings) { OptionStrings = optionStrings; IsSet = false; IsCustom = isCustom; } public void SetFromString(string s) { string[] array = s.Split(new char[1] { ' ' }); string stringValue = s.Substring(array[0].Length).Trim().Trim(new char[1] { '"' }); if (!OptionStrings.Contains(array[0])) { throw new ArgumentException("Given string does not match required format."); } Value = Utils.OptionValueFromString<T>(stringValue); } public override string ToString() { if (!IsSet) { return string.Empty; } string text = Utils.OptionValueToString(Value); return DefaultOptionString + text; } public IEnumerable<string> ToStringCollection() { return new string[1] { ToString() }; } } internal class OptionComparer : IEqualityComparer<IOption> { public bool Equals(IOption x, IOption y) { if (x != null) { if (y != null) { return x.ToString().Equals(y.ToString()); } return false; } return y == null; } public int GetHashCode(IOption obj) { return obj.ToString().GetHashCode(); } } public class OptionSet : ICloneable { private Option<string> username = new Option<string>("-u", "--username"); private Option<string> password = new Option<string>("-p", "--password"); private Option<string> twoFactor = new Option<string>("-2", "--twofactor"); private Option<bool> netrc = new Option<bool>("-n", "--netrc"); private Option<string> netrcLocation = new Option<string>("--netrc-location"); private Option<string> videoPassword = new Option<string>("--video-password"); private Option<string> apMso = new Option<string>("--ap-mso"); private Option<string> apUsername = new Option<string>("--ap-username"); private Option<string> apPassword = new Option<string>("--ap-password"); private Option<bool> apListMso = new Option<bool>("--ap-list-mso"); private Option<string> clientCertificate = new Option<string>("--client-certificate"); private Option<string> clientCertificateKey = new Option<string>("--client-certificate-key"); private Option<string> clientCertificatePassword = new Option<string>("--client-certificate-password"); private static readonly OptionComparer Comparer = new OptionComparer(); public static readonly OptionSet Default = new OptionSet(); private Option<bool> getDescription = new Option<bool>("--get-description"); private Option<bool> getDuration = new Option<bool>("--get-duration"); private Option<bool> getFilename = new Option<bool>("--get-filename"); private Option<bool> getFormat = new Option<bool>("--get-format"); private Option<bool> getId = new Option<bool>("--get-id"); private Option<bool> getThumbnail = new Option<bool>("--get-thumbnail"); private Option<bool> getTitle = new Option<bool>("-e", "--get-title"); private Option<bool> getUrl = new Option<bool>("-g", "--get-url"); private Option<string> matchTitle = new Option<string>("--match-title"); private Option<string> rejectTitle = new Option<string>("--reject-title"); private Option<long?> minViews = new Option<long?>("--min-views"); private Option<long?> maxViews = new Option<long?>("--max-views"); private Option<string> userAgent = new Option<string>("--user-agent"); private Option<string> referer = new Option<string>("--referer"); private Option<int?> playlistStart = new Option<int?>("--playlist-start"); private Option<int?> playlistEnd = new Option<int?>("--playlist-end"); private Option<bool> playlistReverse = new Option<bool>("--playlist-reverse"); private Option<bool> forceGenericExtractor = new Option<bool>("--force-generic-extractor"); private Option<string> execBeforeDownload = new Option<string>("--exec-before-download"); private Option<bool> noExecBeforeDownload = new Option<bool>("--no-exec-before-download"); private Option<bool> allFormats = new Option<bool>("--all-formats"); private Option<bool> allSubs = new Option<bool>("--all-subs"); private Option<bool> printJson = new Option<bool>("--print-json"); private Option<string> autonumberSize = new Option<string>("--autonumber-size"); private Option<int?> autonumberStart = new Option<int?>("--autonumber-start"); private Option<bool> id = new Option<bool>("--id"); private Option<string> metadataFromTitle = new Option<string>("--metadata-from-title"); private Option<bool> hlsPreferNative = new Option<bool>("--hls-prefer-native"); private Option<bool> hlsPreferFfmpeg = new Option<bool>("--hls-prefer-ffmpeg"); private Option<bool> listFormatsOld = new Option<bool>("--list-formats-old"); private Option<bool> listFormatsAsTable = new Option<bool>("--list-formats-as-table"); private Option<bool> youtubeSkipDashManifest = new Option<bool>("--youtube-skip-dash-manifest"); private Option<bool> youtubeSkipHlsManifest = new Option<bool>("--youtube-skip-hls-manifest"); private Option<int?> concurrentFragments = new Option<int?>("-N", "--concurrent-fragments"); private Option<long?> limitRate = new Option<long?>("-r", "--limit-rate"); private Option<long?> throttledRate = new Option<long?>("--throttled-rate"); private Option<int?> retries = new Option<int?>("-R", "--retries"); private Option<int?> fileAccessRetries = new Option<int?>("--file-access-retries"); private Option<int?> fragmentRetries = new Option<int?>("--fragment-retries"); private MultiOption<string> retrySleep = new MultiOption<string>("--retry-sleep"); private Option<bool> skipUnavailableFragments = new Option<bool>("--skip-unavailable-fragments"); private Option<bool> abortOnUnavailableFragment = new Option<bool>("--abort-on-unavailable-fragment"); private Option<bool> keepFragments = new Option<bool>("--keep-fragments"); private Option<bool> noKeepFragments = new Option<bool>("--no-keep-fragments"); private Option<long?> bufferSize = new Option<long?>("--buffer-size"); private Option<bool> resizeBuffer = new Option<bool>("--resize-buffer"); private Option<bool> noResizeBuffer = new Option<bool>("--no-resize-buffer"); private Option<long?> httpChunkSize = new Option<long?>("--http-chunk-size"); private Option<bool> playlistRandom = new Option<bool>("--playlist-random"); private Option<bool> lazyPlaylist = new Option<bool>("--lazy-playlist"); private Option<bool> noLazyPlaylist = new Option<bool>("--no-lazy-playlist"); private Option<bool> xattrSetFilesize = new Option<bool>("--xattr-set-filesize"); private Option<bool> hlsUseMpegts = new Option<bool>("--hls-use-mpegts"); private Option<bool> noHlsUseMpegts = new Option<bool>("--no-hls-use-mpegts"); private MultiOption<string> downloadSections = new MultiOption<string>("--download-sections"); private MultiOption<string> downloader = new MultiOption<string>("--downloader", "--external-downloader"); private MultiOption<string> downloaderArgs = new MultiOption<string>("--downloader-args", "--external-downloader-args"); private Option<int?> extractorRetries = new Option<int?>("--extractor-retries"); private Option<bool> allowDynamicMpd = new Option<bool>("--allow-dynamic-mpd"); private Option<bool> ignoreDynamicMpd = new Option<bool>("--ignore-dynamic-mpd"); private Option<bool> hlsSplitDiscontinuity = new Option<bool>("--hls-split-discontinuity"); private Option<bool> noHlsSplitDiscontinuity = new Option<bool>("--no-hls-split-discontinuity"); private MultiOption<string> extractorArgs = new MultiOption<string>("--extractor-args"); private Option<string> batchFile = new Option<string>("-a", "--batch-file"); private Option<bool> noBatchFile = new Option<bool>("--no-batch-file"); private Option<string> paths = new Option<string>("-P", "--paths"); private Option<string> output = new Option<string>("-o", "--output"); private Option<string> outputNaPlaceholder = new Option<string>("--output-na-placeholder"); private Option<bool> restrictFilenames = new Option<bool>("--restrict-filenames"); private Option<bool> noRestrictFilenames = new Option<bool>("--no-restrict-filenames"); private Option<bool> windowsFilenames = new Option<bool>("--windows-filenames"); private Option<bool> noWindowsFilenames = new Option<bool>("--no-windows-filenames"); private Option<int?> trimFilenames = new Option<int?>("--trim-filenames"); private Option<bool> noOverwrites = new Option<bool>("-w", "--no-overwrites"); private Option<bool> forceOverwrites = new Option<bool>("--force-overwrites"); private Option<bool> noForceOverwrites = new Option<bool>("--no-force-overwrites"); private Option<bool> doContinue = new Option<bool>("-c", "--continue"); private Option<bool> noContinue = new Option<bool>("--no-continue"); private Option<bool> part = new Option<bool>("--part"); private Option<bool> noPart = new Option<bool>("--no-part"); private Option<bool> mtime = new Option<bool>("--mtime"); private Option<bool> noMtime = new Option<bool>("--no-mtime"); private Option<bool> writeDescription = new Option<bool>("--write-description"); private Option<bool> noWriteDescription = new Option<bool>("--no-write-description"); private Option<bool> writeInfoJson = new Option<bool>("--write-info-json"); private Option<bool> noWriteInfoJson = new Option<bool>("--no-write-info-json"); private Option<bool> writePlaylistMetafiles = new Option<bool>("--write-playlist-metafiles"); private Option<bool> noWritePlaylistMetafiles = new Option<bool>("--no-write-playlist-metafiles"); private Option<bool> cleanInfoJson = new Option<bool>("--clean-info-json"); private Option<bool> noCleanInfoJson = new Option<bool>("--no-clean-info-json"); private Option<bool> writeComments = new Option<bool>("--write-comments"); private Option<bool> noWriteComments = new Option<bool>("--no-write-comments"); private Option<string> loadInfoJson = new Option<string>("--load-info-json"); private Option<string> cookies = new Option<string>("--cookies"); private Option<bool> noCookies = new Option<bool>("--no-cookies"); private Option<string> cookiesFromBrowser = new Option<string>("--cookies-from-browser"); private Option<bool> noCookiesFromBrowser = new Option<bool>("--no-cookies-from-browser"); private Option<string> cacheDir = new Option<string>("--cache-dir"); private Option<bool> noCacheDir = new Option<bool>("--no-cache-dir"); private Option<bool> removeCacheDir = new Option<bool>("--rm-cache-dir"); private Option<bool> help = new Option<bool>("-h", "--help"); private Option<bool> version = new Option<bool>("--version"); private Option<bool> update = new Option<bool>("-U", "--update"); private Option<bool> noUpdate = new Option<bool>("--no-update"); private Option<bool> ignoreErrors = new Option<bool>("-i", "--ignore-errors"); private Option<bool> noAbortOnError = new Option<bool>("--no-abort-on-error"); private Option<bool> abortOnError = new Option<bool>("--abort-on-error"); private Option<bool> dumpUserAgent = new Option<bool>("--dump-user-agent"); private Option<bool> listExtractors = new Option<bool>("--list-extractors"); private Option<bool> extractorDescriptions = new Option<bool>("--extractor-descriptions"); private Option<string> useExtractors = new Option<string>("--use-extractors"); private Option<string> defaultSearch = new Option<string>("--default-search"); private Option<bool> ignoreConfig = new Option<bool>("--ignore-config"); private Option<bool> noConfigLocations = new Option<bool>("--no-config-locations"); private MultiOption<string> configLocations = new MultiOption<string>("--config-locations"); private Option<bool> flatPlaylist = new Option<bool>("--flat-playlist"); private Option<bool> noFlatPlaylist = new Option<bool>("--no-flat-playlist"); private Option<bool> liveFromStart = new Option<bool>("--live-from-start"); private Option<bool> noLiveFromStart = new Option<bool>("--no-live-from-start"); private Option<string> waitForVideo = new Option<string>("--wait-for-video"); private Option<bool> noWaitForVideo = new Option<bool>("--no-wait-for-video"); private Option<bool> markWatched = new Option<bool>("--mark-watched"); private Option<bool> noMarkWatched = new Option<bool>("--no-mark-watched"); private Option<bool> noColors = new Option<bool>("--no-colors"); private Option<string> compatOptions = new Option<string>("--compat-options"); private Option<string> alias = new Option<string>("--alias"); private Option<string> geoVerificationProxy = new Option<string>("--geo-verification-proxy"); private Option<bool> geoBypass = new Option<bool>("--geo-bypass"); private Option<bool> noGeoBypass = new Option<bool>("--no-geo-bypass"); private Option<string> geoBypassCountry = new Option<string>("--geo-bypass-country"); private Option<string> geoBypassIpBlock = new Option<string>("--geo-bypass-ip-block"); private Option<bool> writeLink = new Option<bool>("--write-link"); private Option<bool> writeUrlLink = new Option<bool>("--write-url-link"); private Option<bool> writeWeblocLink = new Option<bool>("--write-webloc-link"); private Option<bool> writeDesktopLink = new Option<bool>("--write-desktop-link"); private Option<string> proxy = new Option<string>("--proxy"); private Option<int?> socketTimeout = new Option<int?>("--socket-timeout"); private Option<string> sourceAddress = new Option<string>("--source-address"); private Option<bool> forceIPv4 = new Option<bool>("-4", "--force-ipv4"); private Option<bool> forceIPv6 = new Option<bool>("-6", "--force-ipv6"); private Option<bool> extractAudio = new Option<bool>("-x", "--extract-audio"); private Option<AudioConversionFormat> audioFormat = new Option<AudioConversionFormat>("--audio-format"); private Option<byte?> audioQuality = new Option<byte?>("--audio-quality"); private Option<string> remuxVideo = new Option<string>("--remux-video"); private Option<VideoRecodeFormat> recodeVideo = new Option<VideoRecodeFormat>("--recode-video"); private MultiOption<string> postprocessorArgs = new MultiOption<string>("--postprocessor-args"); private Option<bool> keepVideo = new Option<bool>("-k", "--keep-video"); private Option<bool> noKeepVideo = new Option<bool>("--no-keep-video"); private Option<bool> postOverwrites = new Option<bool>("--post-overwrites"); private Option<bool> noPostOverwrites = new Option<bool>("--no-post-overwrites"); private Option<bool> embedSubs = new Option<bool>("--embed-subs"); private Option<bool> noEmbedSubs = new Option<bool>("--no-embed-subs"); private Option<bool> embedThumbnail = new Option<bool>("--embed-thumbnail"); private Option<bool> noEmbedThumbnail = new Option<bool>("--no-embed-thumbnail"); private Option<bool> embedMetadata = new Option<bool>("--embed-metadata"); private Option<bool> noEmbedMetadata = new Option<bool>("--no-embed-metadata"); private Option<bool> embedChapters = new Option<bool>("--embed-chapters"); private Option<bool> noEmbedChapters = new Option<bool>("--no-embed-chapters"); private Option<bool> embedInfoJson = new Option<bool>("--embed-info-json"); private Option<bool> noEmbedInfoJson = new Option<bool>("--no-embed-info-json"); private Option<string> parseMetadata = new Option<string>("--parse-metadata"); private MultiOption<string> replaceInMetadata = new MultiOption<string>("--replace-in-metadata"); private Option<bool> xattrs = new Option<bool>("--xattrs"); private Option<string> concatPlaylist = new Option<string>("--concat-playlist"); private Option<string> fixup = new Option<string>("--fixup"); private Option<string> ffmpegLocation = new Option<string>("--ffmpeg-location"); private MultiOption<string> exec = new MultiOption<string>("--exec"); private Option<bool> noExec = new Option<bool>("--no-exec"); private Option<string> convertSubs = new Option<string>("--convert-subs"); private Option<string> convertThumbnails = new Option<string>("--convert-thumbnails"); private Option<bool> splitChapters = new Option<bool>("--split-chapters"); private Option<bool> noSplitChapters = new Option<bool>("--no-split-chapters"); private MultiOption<string> removeChapters = new MultiOption<string>("--remove-chapters"); private Option<bool> noRemoveChapters = new Option<bool>("--no-remove-chapters"); private Option<bool> forceKeyframesAtCuts = new Option<bool>("--force-keyframes-at-cuts"); private Option<bool> noForceKeyframesAtCuts = new Option<bool>("--no-force-keyframes-at-cuts"); private MultiOption<string> usePostprocessor = new MultiOption<string>("--use-postprocessor"); private Option<string> sponsorblockMark = new Option<string>("--sponsorblock-mark"); private Option<string> sponsorblockRemove = new Option<string>("--sponsorblock-remove"); private Option<string> sponsorblockChapterTitle = new Option<string>("--sponsorblock-chapter-title"); private Option<bool> noSponsorblock = new Option<bool>("--no-sponsorblock"); private Option<string> sponsorblockApi = new Option<string>("--sponsorblock-api"); private Option<bool> writeSubs = new Option<bool>("--write-subs"); private Option<bool> noWriteSubs = new Option<bool>("--no-write-subs"); private Option<bool> writeAutoSubs = new Option<bool>("--write-auto-subs"); private Option<bool> noWriteAutoSubs = new Option<bool>("--no-write-auto-subs"); private Option<bool> listSubs = new Option<bool>("--list-subs"); private Option<string> subFormat = new Option<string>("--sub-format"); private Option<string> subLangs = new Option<string>("--sub-langs"); private Option<bool> writeThumbnail = new Option<bool>("--write-thumbnail"); private Option<bool> noWriteThumbnail = new Option<bool>("--no-write-thumbnail"); private Option<bool> writeAllThumbnails = new Option<bool>("--write-all-thumbnails"); private Option<bool> listThumbnails = new Option<bool>("--list-thumbnails"); private Option<bool> quiet = new Option<bool>("-q", "--quiet"); private Option<bool> noWarnings = new Option<bool>("--no-warnings"); private Option<bool> simulate = new Option<bool>("-s", "--simulate"); private Option<bool> noSimulate = new Option<bool>("--no-simulate"); private Option<bool> ignoreNoFormatsError = new Option<bool>("--ignore-no-formats-error"); private Option<bool> noIgnoreNoFormatsError = new Option<bool>("--no-ignore-no-formats-error"); private Option<bool> skipDownload = new Option<bool>("--skip-download"); private MultiOption<string> print = new MultiOption<string>("-O", "--print"); private MultiOption<string> printToFile = new MultiOption<string>("--print-to-file"); private Option<bool> dumpJson = new Option<bool>("-j", "--dump-json"); private Option<bool> dumpSingleJson = new Option<bool>("-J", "--dump-single-json"); private Option<bool> forceWriteArchive = new Option<bool>("--force-write-archive"); private Option<bool> newline = new Option<bool>("--newline"); private Option<bool> noProgress = new Option<bool>("--no-progress"); private Option<bool> progress = new Option<bool>("--progress"); private Option<bool> consoleTitle = new Option<bool>("--console-title"); private Option<string> progressTemplate = new Option<string>("--progress-template"); private Option<bool> verbose = new Option<bool>("-v", "--verbose"); private Option<bool> dumpPages = new Option<bool>("--dump-pages"); private Option<bool> writePages = new Option<bool>("--write-pages"); private Option<bool> printTraffic = new Option<bool>("--print-traffic"); private Option<string> format = new Option<string>("-f", "--format"); private Option<string> formatSort = new Option<string>("-S", "--format-sort"); private Option<bool> formatSortForce = new Option<bool>("--format-sort-force"); private Option<bool> noFormatSortForce = new Option<bool>("--no-format-sort-force"); private Option<bool> videoMultistreams = new Option<bool>("--video-multistreams"); private Option<bool> noVideoMultistreams = new Option<bool>("--no-video-multistreams"); private Option<bool> audioMultistreams = new Option<bool>("--audio-multistreams"); private Option<bool> noAudioMultistreams = new Option<bool>("--no-audio-multistreams"); private Option<bool> preferFreeFormats = new Option<bool>("--prefer-free-formats"); private Option<bool> noPreferFreeFormats = new Option<bool>("--no-prefer-free-formats"); private Option<bool> checkFormats = new Option<bool>("--check-formats"); private Option<bool> checkAllFormats = new Option<bool>("--check-all-formats"); private Option<bool> noCheckFormats = new Option<bool>("--no-check-formats"); private Option<bool> listFormats = new Option<bool>("-F", "--list-formats"); private Option<DownloadMergeFormat> mergeOutputFormat = new Option<DownloadMergeFormat>("--merge-output-format"); private Option<string> playlistItems = new Option<string>("-I", "--playlist-items"); private Option<string> minFilesize = new Option<string>("--min-filesize"); private Option<string> maxFilesize = new Option<string>("--max-filesize"); private Option<DateTime> date = new Option<DateTime>("--date"); private Option<DateTime> dateBefore = new Option<DateTime>("--datebefore"); private Option<DateTime> dateAfter = new Option<DateTime>("--dateafter"); private MultiOption<string> matchFilters = new MultiOption<string>("--match-filters"); private Option<bool> noMatchFilter = new Option<bool>("--no-match-filter"); private Option<bool> noPlaylist = new Option<bool>("--no-playlist"); private Option<bool> yesPlaylist = new Option<bool>("--yes-playlist"); private Option<byte?> ageLimit = new Option<byte?>("--age-limit"); private Option<string> downloadArchive = new Option<string>("--download-archive"); private Option<bool> noDownloadArchive = new Option<bool>("--no-download-archive"); private Option<int?> maxDownloads = new Option<int?>("--max-downloads"); private Option<bool> breakOnExisting = new Option<bool>("--break-on-existing"); private Option<bool> breakOnReject = new Option<bool>("--break-on-reject"); private Option<bool> breakPerInput = new Option<bool>("--break-per-input"); private Option<bool> noBreakPerInput = new Option<bool>("--no-break-per-input"); private Option<int?> skipPlaylistAfterErrors = new Option<int?>("--skip-playlist-after-errors"); private Option<string> encoding = new Option<string>("--encoding"); private Option<bool> legacyServerConnect = new Option<bool>("--legacy-server-connect"); private Option<bool> noCheckCertificates = new Option<bool>("--no-check-certificates"); private Option<bool> preferInsecure = new Option<bool>("--prefer-insecure"); private MultiOption<string> addHeader = new MultiOption<string>("--add-header"); private Option<bool> bidiWorkaround = new Option<bool>("--bidi-workaround"); private Option<int?> sleepRequests = new Option<int?>("--sleep-requests"); private Option<int?> sleepInterval = new Option<int?>("--sleep-interval"); private Option<int?> maxSleepInterval = new Option<int?>("--max-sleep-interval"); private Option<int?> sleepSubtitles = new Option<int?>("--sleep-subtitles"); public string Username { get { return username.Value; } set { username.Value = value; } } public string Password { get { return password.Value; } set { password.Value = value; } } public string TwoFactor { get { return twoFactor.Value; } set { twoFactor.Value = value; } } public bool Netrc { get { return netrc.Value; } set { netrc.Value = value; } } public string NetrcLocation { get { return netrcLocation.Value; } set { netrcLocation.Value = value; } } public string VideoPassword { get { return videoPassword.Value; } set { videoPassword.Value = value; } } public string ApMso { get { return apMso.Value; } set { apMso.Value = value; } } public string ApUsername { get { return apUsername.Value; } set { apUsername.Value = value; } } public string ApPassword { get { return apPassword.Value; } set { apPassword.Value = value; } } public bool ApListMso { get { return apListMso.Value; } set { apListMso.Value = value; } } public string ClientCertificate { get { return clientCertificate.Value; } set { clientCertificate.Value = value; } } public string ClientCertificateKey { get { return clientCertificateKey.Value; } set { clientCertificateKey.Value = value; } } public string ClientCertificatePassword { get { return clientCertificatePassword.Value; } set { clientCertificatePassword.Value = value; } } public IOption[] CustomOptions { get; set; } = new IOption[0]; [Obsolete("Deprecated in favor of: --print description.")] public bool GetDescription { get { return getDescription.Value; } set { getDescription.Value = value; } } [Obsolete("Deprecated in favor of: --print duration_string.")] public bool GetDuration { get { return getDuration.Value; } set { getDuration.Value = value; } } [Obsolete("Deprecated in favor of: --print filename.")] public bool GetFilename { get { return getFilename.Value; } set { getFilename.Value = value; } } [Obsolete("Deprecated in favor of: --print format.")] public bool GetFormat { get { return getFormat.Value; } set { getFormat.Value = value; } } [Obsolete("Deprecated in favor of: --print id.")] public bool GetId { get { return getId.Value; } set { getId.Value = value; } } [Obsolete("Deprecated in favor of: --print thumbnail.")] public bool GetThumbnail { get { return getThumbnail.Value; } set { getThumbnail.Value = value; } } [Obsolete("Deprecated in favor of: --print title.")] public bool GetTitle { get { return getTitle.Value; } set { getTitle.Value = value; } } [Obsolete("Deprecated in favor of: --print urls.")] public bool GetUrl { get { return getUrl.Value; } set { getUrl.Value = value; } } [Obsolete("Deprecated in favor of: --match-filter \"title ~= (?i)REGEX\".")] public string MatchTitle { get { return matchTitle.Value; } set { matchTitle.Value = value; } } [Obsolete("Deprecated in favor of: --match-filter \"title !~= (?i)REGEX\".")] public string RejectTitle { get { return rejectTitle.Value; } set { rejectTitle.Value = value; } } [Obsolete("Deprecated in favor of: --match-filter \"view_count >=? COUNT\".")] public long? MinViews { get { return minViews.Value; } set { minViews.Value = value; } } [Obsolete("Deprecated in favor of: --match-filter \"view_count <=? COUNT\".")] public long? MaxViews { get { return maxViews.Value; } set { maxViews.Value = value; } } [Obsolete("Deprecated in favor of: --add-header \"User-Agent:UA\".")] public string UserAgent { get { return userAgent.Value; } set { userAgent.Value = value; } } [Obsolete("Deprecated in favor of: --add-header \"Referer:URL\".")] public string Referer { get { return referer.Value; } set { referer.Value = value; } } [Obsolete("Deprecated in favor of: -I NUMBER:.")] public int? PlaylistStart { get { return playlistStart.Value; } set { playlistStart.Value = value; } } [Obsolete("Deprecated in favor of: -I :NUMBER.")] public int? PlaylistEnd { get { return playlistEnd.Value; } set { playlistEnd.Value = value; } } [Obsolete("Deprecated in favor of: -I ::-1.")] public bool PlaylistReverse { get { return playlistReverse.Value; } set { playlistReverse.Value = value; } } [Obsolete("Deprecated in favor of: --ies generic,default.")] public bool ForceGenericExtractor { get { return forceGenericExtractor.Value; } set { forceGenericExtractor.Value = value; } } [Obsolete("Deprecated in favor of: --exec \"before_dl:CMD\".")] public string ExecBeforeDownload { get { return execBeforeDownload.Value; } set { execBeforeDownload.Value = value; } } [Obsolete("Deprecated in favor of: --no-exec.")] public bool NoExecBeforeDownload { get { return noExecBeforeDownload.Value; } set { noExecBeforeDownload.Value = value; } } [Obsolete("Deprecated in favor of: -f all.")] public bool AllFormats { get { return allFormats.Value; } set { allFormats.Value = value; } } [Obsolete("Deprecated in favor of: --sub-langs all --write-subs.")] public bool AllSubs { get { return allSubs.Value; } set { allSubs.Value = value; } } [Obsolete("Deprecated in favor of: -j --no-simulate.")] public bool PrintJson { get { return printJson.Value; } set { printJson.Value = value; } } [Obsolete("Deprecated in favor of: Use string formatting, e.g. %(autonumber)03d.")] public string AutonumberSize { get { return autonumberSize.Value; } set { autonumberSize.Value = value; } } [Obsolete("Deprecated in favor of: Use internal field formatting like %(autonumber+NUMBER)s.")] public int? AutonumberStart { get { return autonumberStart.Value; } set { autonumberStart.Value = value; } } [Obsolete("Deprecated in favor of: -o \"%(id)s.%(ext)s\".")] public bool Id { get { return id.Value; } set { id.Value = value; } } [Obsolete("Deprecated in favor of: --parse-metadata \"%(title)s:FORMAT\".")] public string MetadataFromTitle { get { return metadataFromTitle.Value; } set { metadataFromTitle.Value = value; } } [Obsolete("Deprecated in favor of: --downloader \"m3u8:native\".")] public bool HlsPreferNative { get { return hlsPreferNative.Value; } set { hlsPreferNative.Value = value; } } [Obsolete("Deprecated in favor of: --downloader \"m3u8:ffmpeg\".")] public bool HlsPreferFfmpeg { get { return hlsPreferFfmpeg.Value; } set { hlsPreferFfmpeg.Value = value; } } [Obsolete("Deprecated in favor of: --compat-options list-formats (Alias: --no-list-formats-as-table).")] public bool ListFormatsOld { get { return listFormatsOld.Value; } set { listFormatsOld.Value = value; } } [Obsolete("Deprecated in favor of: --compat-options -list-formats [Default] (Alias: --no-list-formats-old).")] public bool ListFormatsAsTable { get { return listFormatsAsTable.Value; } set { listFormatsAsTable.Value = value; } } [Obsolete("Deprecated in favor of: --extractor-args \"youtube:skip=dash\" (Alias: --no-youtube-include-dash-manifest).")] public bool YoutubeSkipDashManifest { get { return youtubeSkipDashManifest.Value; } set { youtubeSkipDashManifest.Value = value; } } [Obsolete("Deprecated in favor of: --extractor-args \"youtube:skip=hls\" (Alias: --no-youtube-include-hls-manifest).")] public bool YoutubeSkipHlsManifest { get { return youtubeSkipHlsManifest.Value; } set { youtubeSkipHlsManifest.Value = value; } } public int? ConcurrentFragments { get { return concurrentFragments.Value; } set { concurrentFragments.Value = value; } } public long? LimitRate { get { return limitRate.Value; } set { limitRate.Value = value; } } public long? ThrottledRate { get { return throttledRate.Value; } set { throttledRate.Value = value; } } public int? Retries { get { return retries.Value; } set { retries.Value = value; } } public int? FileAccessRetries { get { return fileAccessRetries.Value; } set { fileAccessRetries.Value = value; } } public int? FragmentRetries { get { return fragmentRetries.Value; } set { fragmentRetries.Value = value; } } public MultiValue<string> RetrySleep { get { return retrySleep.Value; } set { retrySleep.Value = value; } } public bool SkipUnavailableFragments { get { return skipUnavailableFragments.Value; } set { skipUnavailableFragments.Value = value; } } public bool AbortOnUnavailableFragment { get { return abortOnUnavailableFragment.Value; } set { abortOnUnavailableFragment.Value = value; } } public bool KeepFragments { get { return keepFragments.Value; } set { keepFragments.Value = value; } } public bool NoKeepFragments { get { return noKeepFragments.Value; } set { noKeepFragments.Value = value; } } public long? BufferSize { get { return bufferSize.Value; } set { bufferSize.Value = value; } } public bool ResizeBuffer { get { return resizeBuffer.Value; } set { resizeBuffer.Value = value; } } public bool NoResizeBuffer { get { return noResizeBuffer.Value; } set { noResizeBuffer.Value = value; } } public long? HttpChunkSize { get { return httpChunkSize.Value; } set { httpChunkSize.Value = value; } } public bool PlaylistRandom { get { return playlistRandom.Value; } set { playlistRandom.Value = value; } } public bool LazyPlaylist { get { return lazyPlaylist.Value; } set { lazyPlaylist.Value = value; } } public bool NoLazyPlaylist { get { return noLazyPlaylist.Value; } set { noLazyPlaylist.Value = value; } } public bool XattrSetFilesize { get { return xattrSetFilesize.Value; } set { xattrSetFilesize.Value = value; } } public bool HlsUseMpegts { get { return hlsUseMpegts.Value; } set { hlsUseMpegts.Value = value; } } public bool NoHlsUseMpegts { get { return noHlsUseMpegts.Value; } set { noHlsUseMpegts.Value = value; } } public MultiValue<string> DownloadSections { get { return downloadSections.Value; } set { downloadSections.Value = value; } } public MultiValue<string> Downloader { get { return downloader.Value; } set { downloader.Value = value; } } public MultiValue<string> DownloaderArgs { get { return downloaderArgs.Value; } set { downloaderArgs.Value = value; } } public int? ExtractorRetries { get { return extractorRetries.Value; } set { extractorRetries.Value = value; } } public bool AllowDynamicMpd { get { return allowDynamicMpd.Value; } set { allowDynamicMpd.Value = value; } } public bool IgnoreDynamicMpd { get { return ignoreDynamicMpd.Value; } set { ignoreDynamicMpd.Value = value; } } public bool HlsSplitDiscontinuity { get { return hlsSplitDiscontinuity.Value; } set { hlsSplitDiscontinuity.Value = value; } } public bool NoHlsSplitDiscontinuity { get { return noHlsSplitDiscontinuity.Value; } set { noHlsSplitDiscontinuity.Value = value; } } public MultiValue<string> ExtractorArgs { get { return extractorArgs.Value; } set { extractorArgs.Value = value; } } public string BatchFile { get { return batchFile.Value; } set { batchFile.Value = value; } } public bool NoBatchFile { get { return noBatchFile.Value; } set { noBatchFile.Value = value; } } public string Paths { get { return paths.Value; } set { paths.Value = value; } } public string Output { get { return output.Value; } set { output.Value = value; } } public string OutputNaPlaceholder { get { return outputNaPlaceholder.Value; } set { outputNaPlaceholder.Value = value; } } public bool RestrictFilenames { get { return restrictFilenames.Value; } set { restrictFilenames.Value = value; } } public bool NoRestrictFilenames { get { return noRestrictFilenames.Value; } set { noRestrictFilenames.Value = value; } } public bool WindowsFilenames { get { return windowsFilenames.Value; } set { windowsFilenames.Value = value; } } public bool NoWindowsFilenames { get { return noWindowsFilenames.Value; } set { noWindowsFilenames.Value = value; } } public int? TrimFilenames { get { return trimFilenames.Value; } set { trimFilenames.Value = value; } } public bool NoOverwrites { get { return noOverwrites.Value; } set { noOverwrites.Value = value; } } public bool ForceOverwrites { get { return forceOverwrites.Value; } set { forceOverwrites.Value = value; } } public bool NoForceOverwrites { get { return noForceOverwrites.Value; } set { noForceOverwrites.Value = value; } } public bool Continue { get { return doContinue.Value; } set { doContinue.Value = value; } } public bool NoContinue { get { return noContinue.Value; } set { noContinue.Value = value; } } public bool Part { get { return part.Value; } set { part.Value = value; } } public bool NoPart { get { return noPart.Value; } set { noPart.Value = value; } } public bool Mtime { get { return mtime.Value; } set { mtime.Value = value; } } public bool NoMtime { get { return noMtime.Value; } set { noMtime.Value = value; } } public bool WriteDescription { get { return writeDescription.Value; } set { writeDescription.Value = value; } } public bool NoWriteDescription { get { return noWriteDescription.Value; } set { noWriteDescription.Value = value; } } public bool WriteInfoJson { get { return writeInfoJson.Value; } set { writeInfoJson.Value = value; } } public bool NoWriteInfoJson { get { return noWriteInfoJson.Value; } set { noWriteInfoJson.Value = value; } } public bool WritePlaylistMetafiles { get { return writePlaylistMetafiles.Value; } set { writePlaylistMetafiles.Value = value; } } public bool NoWritePlaylistMetafiles { get { return noWritePlaylistMetafiles.Value; } set { noWritePlaylistMetafiles.Value = value; } } public bool CleanInfoJson { get { return cleanInfoJson.Value; } set { cleanInfoJson.Value = value; } } public bool NoCleanInfoJson { get { return noCleanInfoJson.Value; } set { noCleanInfoJson.Value = value; } } public bool WriteComments { get { return writeComments.Value; } set { writeComments.Value = value; } } public bool NoWriteComments { get { return noWriteComments.Value; } set { noWriteComments.Value = value; } } public string LoadInfoJson { get { return loadInfoJson.Value; } set { loadInfoJson.Value = value; } } public string Cookies { get { return cookies.Value; } set { cookies.Value = value; } } public bool NoCookies { get { return noCookies.Value; } set { noCookies.Value = value; } } public string CookiesFromBrowser { get { return cookiesFromBrowser.Value; } set { cookiesFromBrowser.Value = value; } } public bool NoCookiesFromBrowser { get { return noCookiesFromBrowser.Value; } set { noCookiesFromBrowser.Value = value; } } public string CacheDir { get { return cacheDir.Value; } set { cacheDir.Value = value; } } public bool NoCacheDir { get { return noCacheDir.Value; } set { noCacheDir.Value = value; } } public bool RemoveCacheDir { get { return removeCacheDir.Value; } set { removeCacheDir.Value = value; } } public bool Help { get { return help.Value; } set { help.Value = value; } } public bool Version { get { return version.Value; } set { version.Value = value; } } public bool Update { get { return update.Value; } set { update.Value = value; } } public bool NoUpdate { get { return noUpdate.Value; } set { noUpdate.Value = value; } } public bool IgnoreErrors { get { return ignoreErrors.Value; } set { ignoreErrors.Value = value; } } public bool NoAbortOnError { get { return noAbortOnError.Value; } set { noAbortOnError.Value = value; } } public bool AbortOnError { get { return abortOnError.Value; } set { abortOnError.Value = value; } } public bool DumpUserAgent { get { return dumpUserAgent.Value; } set { dumpUserAgent.Value = value; } } public bool ListExtractors { get { return listExtractors.Value; } set { listExtractors.Value = value; } } public bool ExtractorDescriptions { get { return extractorDescriptions.Value; } set { extractorDescriptions.Value = value; } } public string UseExtractors { get { return useExtractors.Value; } set { useExtractors.Value = value; } } public string DefaultSearch { get { return defaultSearch.Value; } set { defaultSearch.Value = value; } } public bool IgnoreConfig { get { return ignoreConfig.Value; } set { ignoreConfig.Value = value; } } public bool NoConfigLocations { get { return noConfigLocations.Value; } set { noConfigLocations.Value = value; } } public MultiValue<string> ConfigLocations { get { return configLocations.Value; } set { configLocations.Value = value; } } public bool FlatPlaylist { get { return flatPlaylist.Value; } set { flatPlaylist.Value = value; } } public bool NoFlatPlaylist { get { return noFlatPlaylist.Value; } set { noFlatPlaylist.Value = value; } } public bool LiveFromStart { get { return liveFromStart.Value; } set { liveFromStart.Value = value; } } public bool NoLiveFromStart { get { return noLiveFromStart.Value; } set { noLiveFromStart.Value = value; } } public string WaitForVideo { get { return waitForVideo.Value; } set { waitForVideo.Value = value; } } public bool NoWaitForVideo { get { return noWaitForVideo.Value; } set { noWaitForVideo.Value = value; } } public bool MarkWatched { get { return markWatched.Value; } set { markWatched.Value = value; } } public bool NoMarkWatched { get { return noMarkWatched.Value; } set { noMarkWatched.Value = value; } } public bool NoColors { get { return noColors.Value; } set { noColors.Value = value; } } public string CompatOptions { get { return compatOptions.Value; } set { compatOptions.Value = value; } } public string Alias { get { return alias.Value; } set { alias.Value = value; } } public string GeoVerificationProxy { get { return geoVerificationProxy.Value; } set { geoVerificationProxy.Value = value; } } public bool GeoBypass { get { return geoBypass.Value; } set { geoBypass.Value = value; } } public bool NoGeoBypass { get { return noGeoBypass.Value; } set { noGeoBypass.Value = value; } } public string GeoBypassCountry { get { return geoBypassCountry.Value; } set { geoBypassCountry.Value = value; } } public string GeoBypassIpBlock { get { return geoBypassIpBlock.Value; } set { geoBypassIpBlock.Value = value; } } public bool WriteLink { get { return writeLink.Value; } set { writeLink.Value = value; } } public bool WriteUrlLink { get { return writeUrlLink.Value; } set { writeUrlLink.Value = value; } } public bool WriteWeblocLink { get { return writeWeblocLink.Value; } set { writeWeblocLink.Value = value; } } public bool WriteDesktopLink { get { return writeDesktopLink.Value; } set { writeDesktopLink.Value = value; } } public string Proxy { get { return proxy.Value; } set { proxy.Value = value; } } public int? SocketTimeout { get { return socketTimeout.Value; } set { socketTimeout.Value = value; } } public string SourceAddress { get { return sourceAddress.Value; } set { sourceAddress.Value = value; } } public bool ForceIPv4 { get { return forceIPv4.Value; } set { forceIPv4.Value = value; } } public bool ForceIPv6 { get { return forceIPv6.Value; } set { forceIPv6.Value = value; } } public bool ExtractAudio { get { return extractAudio.Value; } set { extractAudio.Value = value; } } public AudioConversionFormat AudioFormat { get { return audioFormat.Value; } set { audioFormat.Value = value; } } public byte? AudioQuality { get { return audioQuality.Value; } set { audioQuality.Value = value; } } public string RemuxVideo { get { return remuxVideo.Value; } set { remuxVideo.Value = value; } } public VideoRecodeFormat RecodeVideo { get { return recodeVideo.Value; } set { recodeVideo.Value = value; } } public MultiValue<string> PostprocessorArgs { get { return postprocessorArgs.Value; } set { postprocessorArgs.Value = value; } } public bool KeepVideo { get { return keepVideo.Value; } set { keepVideo.Value = value; } } public bool NoKeepVideo { get { return noKeepVideo.Value; } set { noKeepVideo.Value = value; } } public bool PostOverwrites { get { return postOverwrites.Value; } set { postOverwrites.Value = value; } } public bool NoPostOverwrites { get { return noPostOverwrites.Value; } set { noPostOverwrites.Value = value; } } public bool EmbedSubs { get { return embedSubs.Value; } set { embedSubs.Value = value; } } public bool NoEmbedSubs { get { return noEmbedSubs.Value; } set { noEmbedSubs.Value = value; } } public bool EmbedThumbnail { get { return embedThumbnail.Value; } set { embedThumbnail.Value = value; } } public bool NoEmbedThumbnail { get { return noEmbedThumbnail.Value; } set { noEmbedThumbnail.Value = value; } } public bool EmbedMetadata { get { return embedMetadata.Value; } set { embedMetadata.Value = value; } } public bool NoEmbedMetadata { get { return noEmbedMetadata.Value; } set { noEmbedMetadata.Value = value; } } public bool EmbedChapters { get { return embedChapters.Value; } set { embedChapters.Value = value; } } public bool NoEmbedChapters { get { return noEmbedChapters.Value; } set { noEmbedChapters.Value = value; } } public bool EmbedInfoJson { get { return embedInfoJson.Value; } set { embedInfoJson.Value = value; } } public bool NoEmbedInfoJson { get { return noEmbedInfoJson.Value; } set { noEmbedInfoJson.Value = value; } } public string ParseMetadata { get { return parseMetadata.Value; } set { parseMetadata.Value = value; } } public MultiValue<string> ReplaceInMetadata { get { return replaceInMetadata.Value; } set { replaceInMetadata.Value = value; } } public bool Xattrs { get { return xattrs.Value; } set { xattrs.Value = value; } } public string ConcatPlaylist { get { return concatPlaylist.Value; } set { concatPlaylist.Value = value; } } public string Fixup { get { return fixup.Value; } set { fixup.Value = value; } } public string FfmpegLocation { get { return ffmpegLocation.Value; } set { ffmpegLocation.Value = value; } } public MultiValue<string> Exec { get { return exec.Value; } set { exec.Value = value; } } public bool NoExec { get { return noExec.Value; } set { noExec.Value = value; } } public string ConvertSubs { get { return convertSubs.Value; } set { convertSubs.Value = value; } } public string ConvertThumbnails { get { return convertThumbnails.Value; } set { convertThumbnails.Value = value; } } public bool SplitChapters { get { return splitChapters.Value; } set { splitChapters.Value = value; } } public bool NoSplitChapters { get { return noSplitChapters.Value; } set { noSplitChapters.Value = value; } } public MultiValue<string> RemoveChapters { get { return removeChapters.Value; } set { removeChapters.Value = value; } } public bool NoRemoveChapters { get { return noRemoveChapters.Value; } set { noRemoveChapters.Value = value; } } public bool ForceKeyframesAtCuts { get { return forceKeyframesAtCuts.Value; } set { forceKeyframesAtCuts.Value = value; } } public bool NoForceKeyframesAtCuts { get { return noForceKeyframesAtCuts.Value; } set { noForceKeyframesAtCuts.Value = value; } } public MultiValue<string> UsePostprocessor { get { return usePostprocessor.Value; } set { usePostprocessor.Value = value; } } public string SponsorblockMark { get { return sponsorblockMark.Value; } set { sponsorblockMark.Value = value; } } public string SponsorblockRemove { get { return sponsorblockRemove.Value; } set { sponsorblockRemove.Value = value; } } public string SponsorblockChapterTitle { get { return sponsorblockChapterTitle.Value; } set { sponsorblockChapterTitle.Value = value; } } public bool NoSponsorblock { get { return noSponsorblock.Value; } set { noSponsorblock.Value = value; } } public string SponsorblockApi { get { return sponsorblockApi.Value; } set { sponsorblockApi.Value = value; } } public bool WriteSubs { get { return writeSubs.Value; } set { writeSubs.Value = value; } } public bool NoWriteSubs { get { return noWriteSubs.Value; } set { noWriteSubs.Value = value; } } public bool WriteAutoSubs { get { return writeAutoSubs.Value; } set { writeAutoSubs.Value = value; } } public bool NoWriteAutoSubs { get { return noWriteAutoSubs.Value; } set { noWriteAutoSubs.Value = value; } } public bool ListSubs { get { return listSubs.Value; } set { listSubs.Value = value; } } public string SubFormat { get { return subFormat.Value; } set { subFormat.Value = value; } } public string SubLangs { get { return subLangs.Value; } set { subLangs.Value = value; } } public bool WriteThumbnail { get { return writeThumbnail.Value; } set { writeThumbnail.Value = value; } } public bool NoWriteThumbnail { get { return noWriteThumbnail.Value; } set { noWriteThumbnail.Value = value; } } public bool WriteAllThumbnails { get { return writeAllThumbnails.Value; } set { writeAllThumbnails.Value = value; } } public bool ListThumbnails { get { return listThumbnails.Value; } set { listThumbnails.Value = value; } } public bool Quiet { get { return quiet.Value; } set { quiet.Value = value; } } public bool NoWarnings { get { return noWarnings.Value; } set { noWarnings.Value = value; } } public bool Simulate { get { return simulate.Value; } set { simulate.Value = value; } } public bool NoSimulate { get { return noSimulate.Value; } set { noSimulate.Value = value; } } public bool IgnoreNoFormatsError { get { return ignoreNoFormatsError.Value; } set { ignoreNoFormatsError.Value = value; } } public bool NoIgnoreNoFormatsError { get { return noIgnoreNoFormatsError.Value; } set { noIgnoreNoFormatsError.Value = value; } } public bool SkipDownload { get { return skipDownload.Value; } set { skipDownload.Value = value; } } public MultiValue<string> Print { get { return print.Value; } set { print.Value = value; } } public MultiValue<string> PrintToFile { get { return printToFile.Value; } set { printToFile.Value = value; } } public bool DumpJson { get { return dumpJson.Value; } set { dumpJson.Value = value; } } public bool DumpSingleJson { get { return dumpSingleJson.Value; } set { dumpSingleJson.Value = value; } } public bool ForceWriteArchive { get { return forceWriteArchive.Value; } set { forceWriteArchive.Value = value; } } public bool Newline { get { return newline.Value; } set { newline.Value = value; } } public bool NoProgress { get { return noProgress.Value; } set { noProgress.Value = value; } } public bool Progress { get { return progress.Value; } set { progress.Value = value; } } public bool ConsoleTitle { get { return consoleTitle.Value; } set { consoleTitle.Value = value; } } public string ProgressTemplate { get { return progressTemplate.Value; } set { progressTemplate.Value = value; } } public bool Verbose { get { return verbose.Value; } set { verbose.Value = value; } } public bool DumpPages { get { return dumpPages.Value; } set { dumpPages.Value = value; } } public bool WritePages { get { return writePages.Value; } set { writePages.Value = value; } } public bool PrintTraffic { get { return printTraffic.Value; } set { printTraffic.Value = value; } } public string Format { get { return format.Value; } set { format.Value = value; } } public string FormatSort { get { return formatSort.Value; } set { formatSort.Value = value; } } public bool FormatSortForce { get { return formatSortForce.Value; } set { formatSortForce.Value = value; } } public bool NoFormatSortForce { get { return noFormatSortForce.Value; } set { noFormatSortForce.Value = value; } } public bool VideoMultistreams { get { return videoMultistreams.Value; } set { videoMultistreams.Value = value; } } public bool NoVideoMultistreams { get { return noVideoMultistreams.Value; } set { noVideoMultistreams.Value = value; } } public bool AudioMultistreams { get { return audioMultistreams.Value; } set { audioMultistreams.Value = value; } } public bool NoAudioMultistreams { get { return noAudioMultistreams.Value; } set { noAudioMultistreams.Value = value; } } public bool PreferFreeFormats { get { return preferFreeFormats.Value; } set { preferFreeFormats.Value = value; } } public bool NoPreferFreeFormats { get { return noPreferFreeFormats.Value; } set { noPreferFreeFormats.Value = value; } } public bool CheckFormats { get { return checkFormats.Value; } set { checkFormats.Value = value; } } public bool CheckAllFormats { get { return checkAllFormats.Value; } set { checkAllFormats.Value = value; } } public bool NoCheckFormats { get { return noCheckFormats.Value; } set { noCheckFormats.Value = value; } } public bool ListFormats { get { return listFormats.Value; } set { listFormats.Value = value; } } public DownloadMergeFormat MergeOutputFormat { get { return mergeOutputFormat.Value; } set { mergeOutputFormat.Value = value; } } public string PlaylistItems { get { return playlistItems.Value; } set { playlistItems.Value = value; } } public string MinFilesize { get { return minFilesize.Value; } set { minFilesize.Value = value; } } public string MaxFilesize { get { return maxFilesize.Value; } set { maxFilesize.Value = value; } } public DateTime Date { get { return date.Value; } set { date.Value = value; } } public DateTime DateBefore { get { return dateBefore.Value; } set { dateBefore.Value = value; } } public DateTime DateAfter { get { return dateAfter.Value; } set { dateAfter.Value = value; } } public MultiValue<string> MatchFilters { get { return matchFilters.Value; } set { matchFilters.Value = value; } } public bool NoMatchFilter { get { return noMatchFilter.Value; } set { noMatchFilter.Value = value; } } public bool NoPlaylist { get { return noPlaylist.Value; } set { noPlaylist.Value = value; } } public bool YesPlaylist { get { return yesPlaylist.Value; } set { yesPlaylist.Value = value; } } public byte? AgeLimit { get { return ageLimit.Value; } set { ageLimit.Value = value; } } public string DownloadArchive { get { return downloadArchive.Value; } set { downloadArchive.Value = value; } } public bool NoDownloadArchive { get { return noDownloadArchive.Value; } set { noDownloadArchive.Value = value; } } public int? MaxDownloads { get { return maxDownloads.Value; } set { maxDownloads.Value = value; } } public bool BreakOnExisting { get { return breakOnExisting.Value; } set { breakOnExisting.Value = value; } } public bool BreakOnReject { get { return breakOnReject.Value; } set { breakOnReject.Value = value; } } public bool BreakPerInput { get { return breakPerInput.Value; } set { breakPerInput.Value = value; } } public bool NoBreakPerInput { get { return noBreakPerInput.Value; } set { noBreakPerInput.Value = value; } } public int? SkipPlaylistAfterErrors { get { return skipPlaylistAfterErrors.Value; } set { skipPlaylistAfterErrors.Value = value; } } public string Encoding { get { return encoding.Value; } set { encoding.Value = value; } } public bool LegacyServerConnect { get { return legacyServerConnect.Value; } set { legacyServerConnect.Value = value; } } public bool NoCheckCertificates { get { return noCheckCertificates.Value; } set { noCheckCertificates.Value = value; } } public bool PreferInsecure { get { return preferInsecure.Value; } set { preferInsecure.Value = value; } } public MultiValue<string> AddHeader { get { return addHeader.Value; } set { addHeader.Value = value; } } public bool BidiWorkaround { get { return bidiWorkaround.Value; } set { bidiWorkaround.Value = value; } } public int? SleepRequests { get { return sleepRequests.Value; } set { sleepRequests.Value = value; } } public int? SleepInterval { get { return sleepInterval.Value; } set { sleepInterval.Value = value; } } public int? MaxSleepInterval { get { return maxSleepInterval.Value; } set { maxSleepInterval.Value = value; } } public int? SleepSubtitles { get { return sleepSubtitles.Value; } set { sleepSubtitles.Value = value; } } public void WriteConfigFile(string path) { File.WriteAllLines(path, GetOptionFlags()); } public override string ToString() { return " " + string.Join(" ", GetOptionFlags()); } public IEnumerable<string> GetOptionFlags() { return from value in GetKnownOptions().Concat(CustomOptions).SelectMany((IOption opt) => opt.ToStringCollection()) where !string.IsNullOrWhiteSpace(value) select value; } internal IEnumerable<IOption> GetKnownOptions() { return (from p in GetType().GetRuntimeFields() where p.FieldType.IsGenericType && p.FieldType.GetInterfaces().Contains(typeof(IOption)) select p.GetValue(this)).Cast<IOption>(); } public OptionSet OverrideOptions(OptionSet overrideOptions) { OptionSet optionSet = (OptionSet)Clone(); optionSet.CustomOptions = optionSet.CustomOptions.Concat(overrideOptions.CustomOptions).Distinct(Comparer).ToArray(); IEnumerable<FieldInfo> enumerable = from p in overrideOptions.GetType().GetRuntimeFields() where p.FieldType.IsGenericType && p.FieldType.GetInterfaces().Contains(typeof(IOption)) select p; foreach (FieldInfo item in enumerable) { IOption option = (IOption)item.GetValue(overrideOptions); if (option.IsSet) { optionSet.GetType().GetField(item.Name, BindingFlags.Instance | BindingFlags.NonPublic).SetValue(optionSet, option); } } return optionSet; } public static OptionSet FromString(IEnumerable<string> lines) { OptionSet optionSet = new OptionSet(); IOption[] customOptions = (from option in GetOptions(lines, optionSet.GetKnownOptions()) where option.IsCustom select option).ToArray(); optionSet.CustomOptions = customOptions; return optionSet; } private static IEnumerable<IOption> GetOptions(IEnumerable<string> lines, IEnumerable<IOption> options) { IEnumerable<IOption> knownOptions = options.ToList(); foreach (string line in lines) { string text = line.Trim(); if (!text.StartsWith("#") && !string.IsNullOrWhiteSpace(text)) { string[] array = text.Split(new char[1] { ' ' }); string flag = array[0]; IOption option = knownOptions.FirstOrDefault((IOption o) => o.OptionStrings.Contains(flag)); IOption option3; if (array.Length <= 1) { IOption option2 = new Option<bool>(true, flag); option3 = option2; } else { IOption option2 = new Option<string>(true, flag); option3 = option2; } IOption option4 = option3; IOption option5 = option ?? option4; option5.SetFromString(text); yield return option5; } } } public static OptionSet LoadConfigFile(string path) { return FromString(File.ReadAllLines(path)); } public object Clone() { return FromString(GetOptionFlags()); } public void AddCustomOption<T>(string optionString, T value) { Option<T> option = new Option<T>(true, optionString); option.Value = value; CustomOptions = CustomOptions.Concat(new Option<T>[1] { option }).ToArray(); } public void SetCustomOption<T>(string optionString, T value) { foreach (IOption item in CustomOptions.Where((IOption o) => o.OptionStrings.Contains(optionString))) { if (item is Option<T> option) { option.Value = value; continue; } throw new ArgumentException($"Value passed to option '{optionString}' has invalid type '{value.GetType()}'."); } } public void DeleteCustomOption(string optionString) { CustomOptions = CustomOptions.Where((IOption o) => !o.OptionStrings.Contains(optionString)).ToArray(); } } internal static class Utils { internal static T OptionValueFromString<T>(string stringValue) { if (typeof(T) == typeof(bool)) { return (T)(object)true; } if (typeof(T) == typeof(Enum)) { string value = CultureInfo.InvariantCulture.TextInfo.ToTitleCase(stringValue); return (T)Enum.Parse(typeof(T), value); } if (typeof(T) == typeof(DateTime)) { return (T)(object)DateTime.ParseExact(stringValue, "yyyyMMdd", null); } TypeConverter converter = TypeDescriptor.GetConverter(typeof(T)); return (T)converter.ConvertFrom(stringValue); } internal static string OptionValueToString<T>(T value) { if (value is bool) { return string.Empty; } if (value is Enum) { return " \"" + value.ToString().ToLower() + "\""; } if (value is DateTime) { object obj = value; return " " + ((DateTime)((obj is DateTime) ? obj : null)).ToString("yyyyMMdd"); } if (value is string) { return $" \"{value}\""; } T val = value; return " " + val; } } } namespace YoutubeDLSharp.Metadata { public class ChapterData { [JsonProperty("start_time")] public float? StartTime { get; set; } [JsonProperty("end_time")] public float? EndTime { get; set; } [JsonProperty("title")] public string Title { get; set; } } public class CommentData { [JsonProperty("id")] public string ID { get; set; } [JsonProperty("author")] public string Author { get; set; } [JsonProperty("author_id")] public string AuthorID { get; set; } [JsonProperty("author_thumbnail")] public string AuthorThumbnail { get; set; } [JsonProperty("html")] public string Html { get; set; } [JsonProperty("text")] public string Text { get; set; } [JsonProperty("timestamp")] [JsonConverter(typeof(UnixTimestampConverter))] public DateTime Timestamp { get; set; } [JsonProperty("parent")] public string Parent { get; set; } [JsonProperty("like_count")] public int? LikeCount { get; set; } [JsonProperty("dislike_count")] public int? DislikeCount { get; set; } [JsonProperty("is_favorited")] public bool? IsFavorited { get; set; } [JsonProperty("author_is_uploader")] public bool? AuthorIsUploader { get; set; } } public class FormatData { [JsonProperty("url")] public string Url { get; set; } [JsonProperty("manifest_url")] public string ManifestUrl { get; set; } [JsonProperty("ext")] public string Extension { get; set; } [JsonProperty("format")] public string Format { get; set; } [JsonProperty("format_id")] public string FormatId { get; set; } [JsonProperty("format_note")] public string FormatNote { get; set; } [JsonProperty("width")] public int? Width { get; set; } [JsonProperty("height")] public int? Height { get; set; } [JsonProperty("resolution")] public string Resolution { get; set; } [JsonProperty("dynamic_range")] public string DynamicRange { get; set; } [JsonProperty("tbr")] public double? Bitrate { get; set; } [JsonProperty("abr")] public double? AudioBitrate { get; set; } [JsonProperty("acodec")] public string AudioCodec { get; set; } [JsonProperty("asr")] public double? AudioSamplingRate { get; set; } [JsonProperty("audio_channels")] public int? AudioChannels { get; set; } [JsonProperty("vbr")] public double? VideoBitrate { get; set; } [JsonProperty("fps")] public float? FrameRate { get; set; } [JsonProperty("vcodec")] public string VideoCodec { get; set; } [JsonProperty("container")] public string ContainerFormat { get; set; } [JsonProperty("filesize")] public long? FileSize { get; set; } [JsonProperty("filesize_approx")] public long? ApproximateFileSize { get; set; } [JsonProperty("player_url")] public string PlayerUrl { get; set; } [JsonProperty("protocol")] public string Protocol { get; set; } [JsonProperty("fragment_base_url")] public string FragmentBaseUrl { get; set; } [JsonProperty("is_from_start")] public bool? IsFromStart { get; set; } [JsonProperty("preference")] public int? Preference { get; set; } [JsonProperty("language")] public string Language { get; set; } [JsonProperty("language_preference")] public int? LanguagePreference { get; set; } [JsonProperty("quality")] public double? Quality { get; set; } [JsonProperty("source_preference")] public int? SourcePreference { get; set; } [JsonProperty("stretched_ratio")] public float? StretchedRatio { get; set; } [JsonProperty("no_resume")] public bool? NoResume { get; set; } [JsonProperty("has_drm")] public string HasDRM { get; set; } public override string ToString() { return "[" + Extension + "] " + Format; } } public enum MetadataType { [EnumMember(Value = "video")] Video, [EnumMember(Value = "playlist")] Playlist, [EnumMember(Value = "multi_video")] MultiVideo, [EnumMember(Value = "url")] Url, [EnumMember(Value = "url_transparent")] UrlTransparent } public enum LiveStatus { [EnumMember(Value = "unknown")] None, [EnumMember(Value = "is_live")] IsLive, [EnumMember(Value = "is_upcoming")] IsUpcoming, [EnumMember(Value = "was_live")] WasLive, [EnumMember(Value = "not_live")] NotLive, [EnumMember(Value = "post_live")] PostLive } public enum Availability { [EnumMember(Value = "private")] Private, [EnumMember(Value = "premium_only")] PremiumOnly, [EnumMember(Value = "subscriber_only")] SubscriberOnly, [EnumMember(Value = "needs_auth")] NeedsAuth, [EnumMember(Value = "unlisted")] Unlisted, [EnumMember(Value = "public")] Public } public class SubtitleData { [JsonProperty("ext")] public string Ext { get; set; } [JsonProperty("data")] publ
BepInEx/plugins/sunnobunno-YippeeMod/YippeeMod.dll
Decompiled a year agousing System; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using BepInEx; using BepInEx.Logging; using HarmonyLib; using Microsoft.CodeAnalysis; using UnityEngine; using YippeeMod.Patches; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")] [assembly: AssemblyCompany("YippeeMod")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("YippeeMod")] [assembly: AssemblyTitle("YippeeMod")] [assembly: AssemblyVersion("1.0.0.0")] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte P_0) { Flag = P_0; } } } namespace YippeeMod { [BepInPlugin("sunnobunno.YippeeMod", "Yippee tbh mod", "1.2.2")] public class YippeeModBase : BaseUnityPlugin { private const string modGUID = "sunnobunno.YippeeMod"; private const string modName = "Yippee tbh mod"; private const string modVersion = "1.2.2"; private readonly Harmony harmony = new Harmony("sunnobunno.YippeeMod"); private static YippeeModBase? Instance; internal ManualLogSource? mls; internal static AudioClip[]? newSFX; private void Awake() { if ((Object)(object)Instance == (Object)null) { Instance = this; } mls = Logger.CreateLogSource("sunnobunno.YippeeMod"); mls.LogInfo((object)"sunnobunno.YippeeMod is loading."); string location = ((BaseUnityPlugin)Instance).Info.Location; string text = "YippeeMod.dll"; string text2 = location.TrimEnd(text.ToCharArray()); string text3 = text2 + "yippeesound"; AssetBundle val = AssetBundle.LoadFromFile(text3); if ((Object)(object)val == (Object)null) { mls.LogError((object)"Failed to load audio assets!"); return; } newSFX = val.LoadAssetWithSubAssets<AudioClip>("assets/yippee-tbh.mp3"); harmony.PatchAll(typeof(HoarderBugPatch)); mls.LogInfo((object)"sunnobunno.YippeeMod is loaded. Yippee!!!"); } } } namespace YippeeMod.Patches { [HarmonyPatch(typeof(HoarderBugAI))] internal class HoarderBugPatch { [HarmonyPatch("Start")] [HarmonyPostfix] public static void hoarderBugAudioPatch(ref AudioClip[] ___chitterSFX) { AudioClip[] newSFX = YippeeModBase.newSFX; ___chitterSFX = newSFX; } } }
BepInEx/plugins/Suskitech-AlwaysHearActiveWalkies/AlwaysHearWalkie.dll
Decompiled a year agousing System; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Logging; using GameNetcodeStuff; using HarmonyLib; using LCAlwaysHearWalkieMod.Patches; using Microsoft.CodeAnalysis; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("AlwaysHearWalkie")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.4.2.0")] [assembly: AssemblyInformationalVersion("1.4.2+4173bc4d88b293dfbed3e97cfc3a082065ce4da9")] [assembly: AssemblyProduct("Always Hear Active Walkies")] [assembly: AssemblyTitle("AlwaysHearWalkie")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.4.2.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; } } } namespace BepInEx5.PluginTemplate { [BepInPlugin("suskitech.LCAlwaysHearActiveWalkie", "LC Always Hear Active Walkies", "1.4.2")] public class LCAlwaysHearWalkieMod : BaseUnityPlugin { public static ManualLogSource Log; private const string modGUID = "suskitech.LCAlwaysHearActiveWalkie"; private const string modName = "LC Always Hear Active Walkies"; private const string modVersion = "1.4.2"; private readonly Harmony harmony = new Harmony("suskitech.LCAlwaysHearActiveWalkie"); private static LCAlwaysHearWalkieMod Instance; private void Awake() { if ((Object)(object)Instance == (Object)null) { Instance = this; } Log = Logger.CreateLogSource("suskitech.LCAlwaysHearActiveWalkie"); Log.LogInfo((object)"\\ /"); Log.LogInfo((object)"/|\\"); Log.LogInfo((object)" |----|"); Log.LogInfo((object)" |[__]| Always Hear Active Walkies"); Log.LogInfo((object)" |. .| Version 1.4.2 Loaded"); Log.LogInfo((object)" |____|"); harmony.PatchAll(typeof(LCAlwaysHearWalkieMod)); harmony.PatchAll(typeof(PlayerControllerBPatch)); harmony.PatchAll(typeof(WalkieTalkiePatch)); } } public static class MyPluginInfo { public const string PLUGIN_GUID = "AlwaysHearWalkie"; public const string PLUGIN_NAME = "Always Hear Active Walkies"; public const string PLUGIN_VERSION = "1.4.2"; } } namespace LCAlwaysHearWalkieMod.Patches { [HarmonyPatch(typeof(PlayerControllerB))] internal class PlayerControllerBPatch { private static float AudibleDistance = 20f; private static float throttleInterval = 0.4f; private static float throttle = 0f; private static float AverageDistanceToHeldWalkie = 2f; private static float WalkieRecordingRange = 20f; private static float PlayerToPlayerSpatialHearingRange = 20f; [HarmonyPatch("Update")] [HarmonyPostfix] private static void alwaysHearWalkieTalkiesPatch(ref bool ___holdingWalkieTalkie, ref PlayerControllerB __instance) { //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_02b7: Unknown result type (might be due to invalid IL or missing references) //IL_02c3: Unknown result type (might be due to invalid IL or missing references) //IL_031c: Unknown result type (might be due to invalid IL or missing references) //IL_0327: Unknown result type (might be due to invalid IL or missing references) //IL_0371: Unknown result type (might be due to invalid IL or missing references) //IL_037d: Unknown result type (might be due to invalid IL or missing references) throttle += Time.deltaTime; if (throttle < throttleInterval) { return; } throttle = 0f; if ((Object)(object)__instance == (Object)null || (Object)(object)GameNetworkManager.Instance == (Object)null || (Object)(object)__instance != (Object)(object)GameNetworkManager.Instance.localPlayerController || (Object)(object)GameNetworkManager.Instance.localPlayerController == (Object)null || GameNetworkManager.Instance.localPlayerController.isPlayerDead) { return; } List<WalkieTalkie> list = new List<WalkieTalkie>(); List<WalkieTalkie> list2 = new List<WalkieTalkie>(); for (int i = 0; i < WalkieTalkie.allWalkieTalkies.Count; i++) { float num = Vector3.Distance(((Component)WalkieTalkie.allWalkieTalkies[i]).transform.position, ((Component)__instance).transform.position); if (num <= AudibleDistance) { if (((GrabbableObject)WalkieTalkie.allWalkieTalkies[i]).isBeingUsed) { list.Add(WalkieTalkie.allWalkieTalkies[i]); } } else { list2.Add(WalkieTalkie.allWalkieTalkies[i]); } } bool flag = list.Count > 0; if (flag != __instance.holdingWalkieTalkie) { ___holdingWalkieTalkie = flag; for (int j = 0; j < list2.Count; j++) { if (j < list.Count) { list2[j].thisAudio.Stop(); } } } if (!flag) { return; } PlayerControllerB val = ((!GameNetworkManager.Instance.localPlayerController.isPlayerDead || !((Object)(object)GameNetworkManager.Instance.localPlayerController.spectatedPlayerScript != (Object)null)) ? GameNetworkManager.Instance.localPlayerController : GameNetworkManager.Instance.localPlayerController.spectatedPlayerScript); for (int k = 0; k < StartOfRound.Instance.allPlayerScripts.Length; k++) { if ((!StartOfRound.Instance.allPlayerScripts[k].isPlayerControlled && !StartOfRound.Instance.allPlayerScripts[k].isPlayerDead) || (Object)(object)StartOfRound.Instance.allPlayerScripts[k] == (Object)(object)GameNetworkManager.Instance.localPlayerController || StartOfRound.Instance.allPlayerScripts[k].isPlayerDead) { continue; } PlayerControllerB val2 = StartOfRound.Instance.allPlayerScripts[k]; if (!val2.holdingWalkieTalkie) { continue; } float num2 = Vector3.Distance(((Component)val).transform.position, ((Component)val2).transform.position); float num3 = float.MaxValue; float num4 = float.MaxValue; for (int l = 0; l < WalkieTalkie.allWalkieTalkies.Count; l++) { if (!((GrabbableObject)WalkieTalkie.allWalkieTalkies[l]).isBeingUsed) { continue; } float num5 = Vector3.Distance(((Component)WalkieTalkie.allWalkieTalkies[l].target).transform.position, ((Component)val).transform.position); if (num5 < num4) { num4 = num5; } if (!WalkieTalkie.allWalkieTalkies[l].speakingIntoWalkieTalkie) { float num6 = Vector3.Distance(((Component)WalkieTalkie.allWalkieTalkies[l]).transform.position, ((Component)val2).transform.position); if (num6 < num3) { num3 = num6; } } } float num7 = Mathf.Min(1f - Mathf.InverseLerp(AverageDistanceToHeldWalkie, WalkieRecordingRange, num3), 1f - Mathf.InverseLerp(AverageDistanceToHeldWalkie, WalkieRecordingRange, num4)); float num8 = 1f - Mathf.InverseLerp(0f, PlayerToPlayerSpatialHearingRange, num2); val2.voicePlayerState.Volume = Mathf.Max(num7, num8); } } } [HarmonyPatch(typeof(WalkieTalkie))] internal class WalkieTalkiePatch { [HarmonyPatch("EnableWalkieTalkieListening")] [HarmonyPrefix] private static bool alwaysHearWalkieTalkiesEnableWalkieTalkieListeningPatch(bool enable) { if (!enable) { return false; } return true; } } }
BepInEx/plugins/SZAKI-RemoteRemastered/RemoteRemaster.dll
Decompiled a year agousing System.Collections; using System.Diagnostics; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using BepInEx.Logging; using HarmonyLib; using RemoteRemaster.Patches; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("RemoteRemaster")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("RemoteRemaster")] [assembly: AssemblyCopyright("Copyright © 2023")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("2430fe76-5a6d-4896-8561-0e409525ff6f")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyVersion("1.0.0.0")] namespace RemoteRemaster { [BepInPlugin("SZAKI.RemoteRemaster", "Remote Remaster", "1.0.1.0")] public class RemoteRemasterBase : BaseUnityPlugin { private const string modGUID = "SZAKI.RemoteRemaster"; private const string modName = "Remote Remaster"; private const string modVersion = "1.0.1.0"; private readonly Harmony harmony = new Harmony("SZAKI.RemoteRemaster"); private static RemoteRemasterBase Instance; public static ManualLogSource mls; private void Awake() { if ((Object)(object)Instance == (Object)null) { Instance = this; } mls = Logger.CreateLogSource("SZAKI.RemoteRemaster"); mls.LogInfo((object)"Successfully awaken!"); harmony.PatchAll(typeof(RemoteRemasterBase)); harmony.PatchAll(typeof(RemotePropPatch)); } } } namespace RemoteRemaster.Patches { [HarmonyPatch(typeof(RemoteProp))] internal class RemotePropPatch { public class RemotePropPatchMB : MonoBehaviour { } private static RemotePropPatchMB remotePropPatchMB; public static bool isTurretFount = true; public static bool isLandmineFount = true; public static float minDistance = 15f; [HarmonyPatch(typeof(RemoteProp), "ItemActivate")] [HarmonyPrefix] public static bool ItemActivatePatch(ref RemoteProp __instance, ref AudioSource ___remoteAudio, bool used, bool buttonDown = true) { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Expected O, but got Unknown //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0172: Unknown result type (might be due to invalid IL or missing references) //IL_0178: Unknown result type (might be due to invalid IL or missing references) //IL_0156: 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) //IL_0260: Unknown result type (might be due to invalid IL or missing references) //IL_0266: Unknown result type (might be due to invalid IL or missing references) //IL_0244: Unknown result type (might be due to invalid IL or missing references) //IL_024a: Unknown result type (might be due to invalid IL or missing references) //IL_0318: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)remotePropPatchMB == (Object)null) { GameObject val = new GameObject("RemotePropMB"); remotePropPatchMB = val.AddComponent<RemotePropPatchMB>(); } StartOfRound val2 = Object.FindObjectOfType<StartOfRound>(); Transform transform = ((Component)val2.localPlayerController).transform; AudioSource obj = ___remoteAudio; if (obj != null) { obj.PlayOneShot(___remoteAudio.clip); } WalkieTalkie.TransmitOneShotAudio(___remoteAudio, ___remoteAudio.clip, 0.7f); RoundManager.Instance.PlayAudibleNoise(transform.position, 8f, 0.4f, 0, StartOfRound.Instance.hangarDoorsClosed, 0); Turret[] array = Object.FindObjectsOfType<Turret>(); if (array.Count() == 0) { ManualLogSource mls = RemoteRemasterBase.mls; if (mls != null) { mls.LogInfo((object)" No Turrent found on this map!"); } isTurretFount = false; } Landmine[] array2 = Object.FindObjectsOfType<Landmine>(); if (array2.Count() == 0) { ManualLogSource mls2 = RemoteRemasterBase.mls; if (mls2 != null) { mls2.LogInfo((object)" No landmines found on this map!"); } isLandmineFount = false; } if (!isTurretFount && !isLandmineFount) { return false; } if (isTurretFount) { Turret val3 = array[0]; float num = -1f; Turret[] array3 = array; foreach (Turret val4 in array3) { if (num == -1f) { num = Vector3.Distance(((Component)val4).transform.position, transform.position); continue; } float num2 = Vector3.Distance(((Component)val4).transform.position, transform.position); if (num > num2) { val3 = val4; num = num2; } } ManualLogSource mls3 = RemoteRemasterBase.mls; if (mls3 != null) { mls3.LogInfo((object)(" Closest turret is " + num + " away!")); } if (num <= minDistance && val3.turretActive) { ((MonoBehaviour)remotePropPatchMB).StartCoroutine(TurnOffAndOnTurret(val3, __instance)); } } if (isLandmineFount) { Landmine val5 = array2[0]; float num3 = -1f; Landmine[] array4 = array2; foreach (Landmine val6 in array4) { if (num3 == -1f) { num3 = Vector3.Distance(((Component)val6).transform.position, transform.position); continue; } float num4 = Vector3.Distance(((Component)val6).transform.position, transform.position); if (num3 > num4) { val5 = val6; num3 = num4; } } ManualLogSource mls4 = RemoteRemasterBase.mls; if (mls4 != null) { mls4.LogInfo((object)(" Closest landmine is " + num3 + " away!")); } if (num3 <= minDistance && ((Behaviour)val5).isActiveAndEnabled) { AudioSource obj2 = ___remoteAudio; if (obj2 != null) { obj2.PlayOneShot(val5.mineAudio.clip); } WalkieTalkie.TransmitOneShotAudio(val5.mineAudio, val5.mineAudio.clip, 0.7f); RoundManager.Instance.PlayAudibleNoise(transform.position, 8f, 0.4f, 0, StartOfRound.Instance.hangarDoorsClosed, 0); ((MonoBehaviour)remotePropPatchMB).StartCoroutine(TurnOffAndOnLandmine(val5, __instance)); } } return false; } public static IEnumerator TurnOffAndOnTurret(Turret _turret, RemoteProp _remote) { ((GrabbableObject)_remote).UseItemBatteries(); _turret.ToggleTurretEnabled(false); yield return (object)new WaitForSeconds(5f); _turret.ToggleTurretEnabled(true); } public static IEnumerator TurnOffAndOnLandmine(Landmine _landmine, RemoteProp _remote) { ((GrabbableObject)_remote).UseItemBatteries(); _landmine.ToggleMine(false); yield return (object)new WaitForSeconds(5f); _landmine.ToggleMine(true); } } }
BepInEx/plugins/TheBeeTeam-PersistentPurchases/Assembly-CSharp-firstpass.dll
Decompiled a year ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.CodeDom.Compiler; using System.Collections; using System.Collections.Generic; using System.ComponentModel; using System.Diagnostics; using System.Globalization; using System.IO; using System.IO.Compression; using System.Linq; using System.Numerics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Serialization; using System.Security.Cryptography; using System.Text; using ES3Internal; using ES3Types; using Unity.Collections; using UnityEngine; using UnityEngine.EventSystems; using UnityEngine.Experimental.Rendering; using UnityEngine.Networking; using UnityEngine.Rendering; using UnityEngine.SceneManagement; using UnityEngine.Scripting; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: AssemblyVersion("0.0.0.0")] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field)] public class ES3Serializable : Attribute { } [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field)] public class ES3NonSerializable : Attribute { } public class ES3AutoSave : MonoBehaviour, ISerializationCallbackReceiver { public bool saveLayer = true; public bool saveTag = true; public bool saveName = true; public bool saveHideFlags = true; public bool saveActive = true; public bool saveChildren; private bool isQuitting; public List<Component> componentsToSave = new List<Component>(); public void Reset() { saveLayer = false; saveTag = false; saveName = false; saveHideFlags = false; saveActive = false; saveChildren = false; } public void Awake() { if ((Object)(object)ES3AutoSaveMgr.Current == (Object)null) { ES3Debug.LogWarning("<b>No GameObjects in this scene will be autosaved</b> because there is no Easy Save 3 Manager. To add a manager to this scene, exit playmode and go to Assets > Easy Save 3 > Add Manager to Scene.", (Object)(object)this); } else { ES3AutoSaveMgr.AddAutoSave(this); } } public void OnApplicationQuit() { isQuitting = true; } public void OnDestroy() { if (!isQuitting) { ES3AutoSaveMgr.RemoveAutoSave(this); } } public void OnBeforeSerialize() { } public void OnAfterDeserialize() { componentsToSave.RemoveAll((Component c) => (Object)(object)c == (Object)null || ((object)c).GetType() == typeof(Component)); } } public class ES3AutoSaveMgr : MonoBehaviour { public enum LoadEvent { None, Awake, Start } public enum SaveEvent { None, OnApplicationQuit, OnApplicationPause } public static ES3AutoSaveMgr _current; public string key = Guid.NewGuid().ToString(); public SaveEvent saveEvent = SaveEvent.OnApplicationQuit; public LoadEvent loadEvent = LoadEvent.Awake; public ES3SerializableSettings settings = new ES3SerializableSettings("AutoSave.es3", ES3.Location.Cache); public HashSet<ES3AutoSave> autoSaves = new HashSet<ES3AutoSave>(); public static ES3AutoSaveMgr Current { get { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_current == (Object)null) { Scene activeScene = SceneManager.GetActiveScene(); GameObject[] rootGameObjects = ((Scene)(ref activeScene)).GetRootGameObjects(); GameObject[] array = rootGameObjects; foreach (GameObject val in array) { if (((Object)val).name == "Easy Save 3 Manager") { return _current = val.GetComponent<ES3AutoSaveMgr>(); } } array = rootGameObjects; for (int i = 0; i < array.Length; i++) { if ((Object)(object)(_current = array[i].GetComponentInChildren<ES3AutoSaveMgr>()) != (Object)null) { return _current; } } } return _current; } } public static ES3AutoSaveMgr Instance => Current; public void Save() { if (autoSaves == null || autoSaves.Count == 0) { return; } if (settings.location == ES3.Location.Cache && !ES3.FileExists(settings)) { ES3.CacheFile(settings); } if (autoSaves == null || autoSaves.Count == 0) { ES3.DeleteKey(key, settings); } else { List<GameObject> list = new List<GameObject>(); foreach (ES3AutoSave autoSafe in autoSaves) { if ((Object)(object)autoSafe != (Object)null && ((Behaviour)autoSafe).enabled) { list.Add(((Component)autoSafe).gameObject); } } ES3.Save(key, list.OrderBy((GameObject x) => GetDepth(x.transform)).ToArray(), settings); } if (settings.location == ES3.Location.Cache && ES3.FileExists(settings)) { ES3.StoreCachedFile(settings); } } public void Load() { try { if (settings.location == ES3.Location.Cache && !ES3.FileExists(settings)) { ES3.CacheFile(settings); } } catch { } ES3.Load(key, (GameObject[])(object)new GameObject[0], settings); } private void Start() { if (loadEvent == LoadEvent.Start) { Load(); } } public void Awake() { GetAutoSaves(); if (loadEvent == LoadEvent.Awake) { Load(); } } private void OnApplicationQuit() { if (saveEvent == SaveEvent.OnApplicationQuit) { Save(); } } private void OnApplicationPause(bool paused) { if ((saveEvent == SaveEvent.OnApplicationPause || (Application.isMobilePlatform && saveEvent == SaveEvent.OnApplicationQuit)) && paused) { Save(); } } public static void AddAutoSave(ES3AutoSave autoSave) { if ((Object)(object)Current != (Object)null) { Current.autoSaves.Add(autoSave); } } public static void RemoveAutoSave(ES3AutoSave autoSave) { if ((Object)(object)Current != (Object)null) { Current.autoSaves.Remove(autoSave); } } public void GetAutoSaves() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) autoSaves = new HashSet<ES3AutoSave>(); Scene scene = ((Component)this).gameObject.scene; GameObject[] rootGameObjects = ((Scene)(ref scene)).GetRootGameObjects(); foreach (GameObject val in rootGameObjects) { autoSaves.UnionWith(val.GetComponentsInChildren<ES3AutoSave>(true)); } } private static int GetDepth(Transform t) { int num = 0; while ((Object)(object)t.parent != (Object)null) { t = t.parent; num++; } return num; } } public class ES3 { public enum Location { File, PlayerPrefs, InternalMS, Resources, Cache } public enum Directory { PersistentDataPath, DataPath } public enum EncryptionType { None, AES } public enum CompressionType { None, Gzip } public enum Format { JSON } public enum ReferenceMode { ByRef, ByValue, ByRefAndValue } public enum ImageType { JPEG, PNG } public static void Save(string key, object value) { ES3.Save<object>(key, value, new ES3Settings()); } public static void Save(string key, object value, string filePath) { ES3.Save<object>(key, value, new ES3Settings(filePath)); } public static void Save(string key, object value, string filePath, ES3Settings settings) { ES3.Save<object>(key, value, new ES3Settings(filePath, settings)); } public static void Save(string key, object value, ES3Settings settings) { ES3.Save<object>(key, value, settings); } public static void Save<T>(string key, T value) { Save(key, value, new ES3Settings()); } public static void Save<T>(string key, T value, string filePath) { Save(key, value, new ES3Settings(filePath)); } public static void Save<T>(string key, T value, string filePath, ES3Settings settings) { Save(key, value, new ES3Settings(filePath, settings)); } public static void Save<T>(string key, T value, ES3Settings settings) { if (settings.location == Location.Cache) { ES3File.GetOrCreateCachedFile(settings).Save(key, value); return; } using ES3Writer eS3Writer = ES3Writer.Create(settings); eS3Writer.Write<T>(key, value); eS3Writer.Save(); } public static void SaveRaw(byte[] bytes) { SaveRaw(bytes, new ES3Settings()); } public static void SaveRaw(byte[] bytes, string filePath) { SaveRaw(bytes, new ES3Settings(filePath)); } public static void SaveRaw(byte[] bytes, string filePath, ES3Settings settings) { SaveRaw(bytes, new ES3Settings(filePath, settings)); } public static void SaveRaw(byte[] bytes, ES3Settings settings) { if (settings.location == Location.Cache) { ES3File.GetOrCreateCachedFile(settings).SaveRaw(bytes, settings); return; } using (Stream stream = ES3Stream.CreateStream(settings, ES3FileMode.Write)) { stream.Write(bytes, 0, bytes.Length); } ES3IO.CommitBackup(settings); } public static void SaveRaw(string str) { SaveRaw(str, new ES3Settings()); } public static void SaveRaw(string str, string filePath) { SaveRaw(str, new ES3Settings(filePath)); } public static void SaveRaw(string str, string filePath, ES3Settings settings) { SaveRaw(str, new ES3Settings(filePath, settings)); } public static void SaveRaw(string str, ES3Settings settings) { SaveRaw(settings.encoding.GetBytes(str), settings); } public static void AppendRaw(byte[] bytes) { AppendRaw(bytes, new ES3Settings()); } public static void AppendRaw(byte[] bytes, string filePath, ES3Settings settings) { AppendRaw(bytes, new ES3Settings(filePath, settings)); } public static void AppendRaw(byte[] bytes, ES3Settings settings) { if (settings.location == Location.Cache) { ES3File.GetOrCreateCachedFile(settings).AppendRaw(bytes); return; } using Stream stream = ES3Stream.CreateStream(new ES3Settings(settings.path, settings) { encryptionType = EncryptionType.None, compressionType = CompressionType.None }, ES3FileMode.Append); stream.Write(bytes, 0, bytes.Length); } public static void AppendRaw(string str) { AppendRaw(str, new ES3Settings()); } public static void AppendRaw(string str, string filePath) { AppendRaw(str, new ES3Settings(filePath)); } public static void AppendRaw(string str, string filePath, ES3Settings settings) { AppendRaw(str, new ES3Settings(filePath, settings)); } public static void AppendRaw(string str, ES3Settings settings) { byte[] bytes = settings.encoding.GetBytes(str); ES3Settings eS3Settings = new ES3Settings(settings.path, settings); eS3Settings.encryptionType = EncryptionType.None; eS3Settings.compressionType = CompressionType.None; if (settings.location == Location.Cache) { ES3File.GetOrCreateCachedFile(settings).SaveRaw(bytes); return; } using Stream stream = ES3Stream.CreateStream(eS3Settings, ES3FileMode.Append); stream.Write(bytes, 0, bytes.Length); } public static void SaveImage(Texture2D texture, string imagePath) { SaveImage(texture, new ES3Settings(imagePath)); } public static void SaveImage(Texture2D texture, string imagePath, ES3Settings settings) { SaveImage(texture, new ES3Settings(imagePath, settings)); } public static void SaveImage(Texture2D texture, ES3Settings settings) { SaveImage(texture, 75, settings); } public static void SaveImage(Texture2D texture, int quality, string imagePath) { SaveImage(texture, quality, new ES3Settings(imagePath)); } public static void SaveImage(Texture2D texture, int quality, string imagePath, ES3Settings settings) { SaveImage(texture, quality, new ES3Settings(imagePath, settings)); } public static void SaveImage(Texture2D texture, int quality, ES3Settings settings) { string text = ES3IO.GetExtension(settings.path).ToLower(); if (string.IsNullOrEmpty(text)) { throw new ArgumentException("File path must have a file extension when using ES3.SaveImage."); } byte[] bytes; switch (text) { case ".jpg": case ".jpeg": bytes = ImageConversion.EncodeToJPG(texture, quality); break; case ".png": bytes = ImageConversion.EncodeToPNG(texture); break; default: throw new ArgumentException("File path must have extension of .png, .jpg or .jpeg when using ES3.SaveImage."); } SaveRaw(bytes, settings); } public static byte[] SaveImageToBytes(Texture2D texture, int quality, ImageType imageType) { if (imageType == ImageType.JPEG) { return ImageConversion.EncodeToJPG(texture, quality); } return ImageConversion.EncodeToPNG(texture); } public static object Load(string key) { return Load<object>(key, new ES3Settings()); } public static object Load(string key, string filePath) { return Load<object>(key, new ES3Settings(filePath)); } public static object Load(string key, string filePath, ES3Settings settings) { return Load<object>(key, new ES3Settings(filePath, settings)); } public static object Load(string key, ES3Settings settings) { return Load<object>(key, settings); } public static object Load(string key, object defaultValue) { return ES3.Load<object>(key, defaultValue, new ES3Settings()); } public static object Load(string key, string filePath, object defaultValue) { return ES3.Load<object>(key, defaultValue, new ES3Settings(filePath)); } public static object Load(string key, string filePath, object defaultValue, ES3Settings settings) { return ES3.Load<object>(key, defaultValue, new ES3Settings(filePath, settings)); } public static object Load(string key, object defaultValue, ES3Settings settings) { return ES3.Load<object>(key, defaultValue, settings); } public static T Load<T>(string key) { return Load<T>(key, new ES3Settings()); } public static T Load<T>(string key, string filePath) { return Load<T>(key, new ES3Settings(filePath)); } public static T Load<T>(string key, string filePath, ES3Settings settings) { return Load<T>(key, new ES3Settings(filePath, settings)); } public static T Load<T>(string key, ES3Settings settings) { if (settings.location == Location.Cache) { return ES3File.GetOrCreateCachedFile(settings).Load<T>(key); } using ES3Reader eS3Reader = ES3Reader.Create(settings); if (eS3Reader == null) { throw new FileNotFoundException("File \"" + settings.FullPath + "\" could not be found."); } return eS3Reader.Read<T>(key); } public static T Load<T>(string key, T defaultValue) { return Load(key, defaultValue, new ES3Settings()); } public static T Load<T>(string key, string filePath, T defaultValue) { return Load(key, defaultValue, new ES3Settings(filePath)); } public static T Load<T>(string key, string filePath, T defaultValue, ES3Settings settings) { return Load(key, defaultValue, new ES3Settings(filePath, settings)); } public static T Load<T>(string key, T defaultValue, ES3Settings settings) { if (settings.location == Location.Cache) { return ES3File.GetOrCreateCachedFile(settings).Load(key, defaultValue); } using ES3Reader eS3Reader = ES3Reader.Create(settings); if (eS3Reader == null) { return defaultValue; } return eS3Reader.Read(key, defaultValue); } public static void LoadInto<T>(string key, object obj) where T : class { ES3.LoadInto<object>(key, obj, new ES3Settings()); } public static void LoadInto(string key, string filePath, object obj) { ES3.LoadInto<object>(key, obj, new ES3Settings(filePath)); } public static void LoadInto(string key, string filePath, object obj, ES3Settings settings) { ES3.LoadInto<object>(key, obj, new ES3Settings(filePath, settings)); } public static void LoadInto(string key, object obj, ES3Settings settings) { ES3.LoadInto<object>(key, obj, settings); } public static void LoadInto<T>(string key, T obj) where T : class { LoadInto(key, obj, new ES3Settings()); } public static void LoadInto<T>(string key, string filePath, T obj) where T : class { LoadInto(key, obj, new ES3Settings(filePath)); } public static void LoadInto<T>(string key, string filePath, T obj, ES3Settings settings) where T : class { LoadInto(key, obj, new ES3Settings(filePath, settings)); } public static void LoadInto<T>(string key, T obj, ES3Settings settings) where T : class { if (ES3Reflection.IsValueType(obj.GetType())) { throw new InvalidOperationException("ES3.LoadInto can only be used with reference types, but the data you're loading is a value type. Use ES3.Load instead."); } if (settings.location == Location.Cache) { ES3File.GetOrCreateCachedFile(settings).LoadInto(key, obj); return; } if (settings == null) { settings = new ES3Settings(); } using ES3Reader eS3Reader = ES3Reader.Create(settings); if (eS3Reader == null) { throw new FileNotFoundException("File \"" + settings.FullPath + "\" could not be found."); } eS3Reader.ReadInto(key, obj); } public static string LoadString(string key, string defaultValue, ES3Settings settings) { return Load(key, null, defaultValue, settings); } public static string LoadString(string key, string defaultValue, string filePath = null, ES3Settings settings = null) { return Load(key, filePath, defaultValue, settings); } public static byte[] LoadRawBytes() { return LoadRawBytes(new ES3Settings()); } public static byte[] LoadRawBytes(string filePath) { return LoadRawBytes(new ES3Settings(filePath)); } public static byte[] LoadRawBytes(string filePath, ES3Settings settings) { return LoadRawBytes(new ES3Settings(filePath, settings)); } public static byte[] LoadRawBytes(ES3Settings settings) { if (settings.location == Location.Cache) { return ES3File.GetOrCreateCachedFile(settings).LoadRawBytes(); } using Stream stream = ES3Stream.CreateStream(settings, ES3FileMode.Read); if (stream == null) { throw new FileNotFoundException("File " + settings.path + " could not be found"); } if (stream.GetType() == typeof(GZipStream)) { GZipStream source = (GZipStream)stream; using MemoryStream memoryStream = new MemoryStream(); ES3Stream.CopyTo(source, memoryStream); return memoryStream.ToArray(); } byte[] array = new byte[stream.Length]; stream.Read(array, 0, array.Length); return array; } public static string LoadRawString() { return LoadRawString(new ES3Settings()); } public static string LoadRawString(string filePath) { return LoadRawString(new ES3Settings(filePath)); } public static string LoadRawString(string filePath, ES3Settings settings) { return LoadRawString(new ES3Settings(filePath, settings)); } public static string LoadRawString(ES3Settings settings) { byte[] array = LoadRawBytes(settings); return settings.encoding.GetString(array, 0, array.Length); } public static Texture2D LoadImage(string imagePath) { return LoadImage(new ES3Settings(imagePath)); } public static Texture2D LoadImage(string imagePath, ES3Settings settings) { return LoadImage(new ES3Settings(imagePath, settings)); } public static Texture2D LoadImage(ES3Settings settings) { return LoadImage(LoadRawBytes(settings)); } public static Texture2D LoadImage(byte[] bytes) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Expected O, but got Unknown //IL_0010: Expected O, but got Unknown Texture2D val = new Texture2D(1, 1); ImageConversion.LoadImage(val, bytes); return val; } public static AudioClip LoadAudio(string audioFilePath, AudioType audioType) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) return LoadAudio(audioFilePath, audioType, new ES3Settings()); } public static AudioClip LoadAudio(string audioFilePath, AudioType audioType, ES3Settings settings) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Invalid comparison between Unknown and I4 //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Invalid comparison between Unknown and I4 //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006c: 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_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Invalid comparison between Unknown and I4 //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Invalid comparison between Unknown and I4 if (settings.location != 0) { throw new InvalidOperationException("ES3.LoadAudio can only be used with the File save location"); } if ((int)Application.platform == 17) { throw new InvalidOperationException("You cannot use ES3.LoadAudio with WebGL"); } string text = ES3IO.GetExtension(audioFilePath).ToLower(); if (text == ".mp3" && ((int)Application.platform == 2 || (int)Application.platform == 1)) { throw new InvalidOperationException("You can only load Ogg, WAV, XM, IT, MOD or S3M on Unity Standalone"); } if (text == ".ogg" && ((int)Application.platform == 8 || (int)Application.platform == 11 || (int)Application.platform == 20)) { throw new InvalidOperationException("You can only load MP3, WAV, XM, IT, MOD or S3M on Unity Standalone"); } ES3Settings eS3Settings = new ES3Settings(audioFilePath, settings); UnityWebRequest audioClip = UnityWebRequestMultimedia.GetAudioClip("file://" + eS3Settings.FullPath, audioType); try { audioClip.SendWebRequest(); while (!audioClip.isDone) { } if (ES3WebClass.IsNetworkError(audioClip)) { throw new Exception(audioClip.error); } return DownloadHandlerAudioClip.GetContent(audioClip); } finally { ((IDisposable)audioClip)?.Dispose(); } } public static byte[] Serialize<T>(T value, ES3Settings settings = null) { return Serialize(value, ES3TypeMgr.GetOrCreateES3Type(typeof(T)), settings); } internal static byte[] Serialize(object value, ES3Type type, ES3Settings settings = null) { if (settings == null) { settings = new ES3Settings(); } using MemoryStream memoryStream = new MemoryStream(); using Stream stream = ES3Stream.CreateStream(memoryStream, settings, ES3FileMode.Write); using (ES3Writer eS3Writer = ES3Writer.Create(stream, settings, writeHeaderAndFooter: false, overwriteKeys: false)) { eS3Writer.Write(value, type, settings.referenceMode); } return memoryStream.ToArray(); } public static T Deserialize<T>(byte[] bytes, ES3Settings settings = null) { return (T)Deserialize(ES3TypeMgr.GetOrCreateES3Type(typeof(T)), bytes, settings); } internal static object Deserialize(ES3Type type, byte[] bytes, ES3Settings settings = null) { if (settings == null) { settings = new ES3Settings(); } using MemoryStream stream = new MemoryStream(bytes, writable: false); using Stream stream2 = ES3Stream.CreateStream(stream, settings, ES3FileMode.Read); using ES3Reader eS3Reader = ES3Reader.Create(stream2, settings, readHeaderAndFooter: false); return eS3Reader.Read<object>(type); } public static void DeserializeInto<T>(byte[] bytes, T obj, ES3Settings settings = null) where T : class { DeserializeInto(ES3TypeMgr.GetOrCreateES3Type(typeof(T)), bytes, obj, settings); } public static void DeserializeInto<T>(ES3Type type, byte[] bytes, T obj, ES3Settings settings = null) where T : class { if (settings == null) { settings = new ES3Settings(); } using MemoryStream stream = new MemoryStream(bytes, writable: false); using ES3Reader eS3Reader = ES3Reader.Create(stream, settings, readHeaderAndFooter: false); eS3Reader.ReadInto<T>(obj, type); } public static byte[] EncryptBytes(byte[] bytes, string password = null) { if (string.IsNullOrEmpty(password)) { password = ES3Settings.defaultSettings.encryptionPassword; } return new AESEncryptionAlgorithm().Encrypt(bytes, password, ES3Settings.defaultSettings.bufferSize); } public static byte[] DecryptBytes(byte[] bytes, string password = null) { if (string.IsNullOrEmpty(password)) { password = ES3Settings.defaultSettings.encryptionPassword; } return new AESEncryptionAlgorithm().Decrypt(bytes, password, ES3Settings.defaultSettings.bufferSize); } public static string EncryptString(string str, string password = null) { return Convert.ToBase64String(EncryptBytes(ES3Settings.defaultSettings.encoding.GetBytes(str), password)); } public static string DecryptString(string str, string password = null) { return ES3Settings.defaultSettings.encoding.GetString(DecryptBytes(Convert.FromBase64String(str), password)); } public static byte[] CompressBytes(byte[] bytes) { using MemoryStream memoryStream = new MemoryStream(); ES3Settings eS3Settings = new ES3Settings(); eS3Settings.location = Location.InternalMS; eS3Settings.compressionType = CompressionType.Gzip; eS3Settings.encryptionType = EncryptionType.None; using (Stream stream = ES3Stream.CreateStream(memoryStream, eS3Settings, ES3FileMode.Write)) { stream.Write(bytes, 0, bytes.Length); } return memoryStream.ToArray(); } public static byte[] DecompressBytes(byte[] bytes) { using MemoryStream stream = new MemoryStream(bytes); ES3Settings eS3Settings = new ES3Settings(); eS3Settings.location = Location.InternalMS; eS3Settings.compressionType = CompressionType.Gzip; eS3Settings.encryptionType = EncryptionType.None; using MemoryStream memoryStream = new MemoryStream(); using (Stream source = ES3Stream.CreateStream(stream, eS3Settings, ES3FileMode.Read)) { ES3Stream.CopyTo(source, memoryStream); } return memoryStream.ToArray(); } public static string CompressString(string str) { return Convert.ToBase64String(CompressBytes(ES3Settings.defaultSettings.encoding.GetBytes(str))); } public static string DecompressString(string str) { return ES3Settings.defaultSettings.encoding.GetString(DecompressBytes(Convert.FromBase64String(str))); } public static void DeleteFile() { DeleteFile(new ES3Settings()); } public static void DeleteFile(string filePath) { DeleteFile(new ES3Settings(filePath)); } public static void DeleteFile(string filePath, ES3Settings settings) { DeleteFile(new ES3Settings(filePath, settings)); } public static void DeleteFile(ES3Settings settings) { if (settings.location == Location.File) { ES3IO.DeleteFile(settings.FullPath); } else if (settings.location == Location.PlayerPrefs) { PlayerPrefs.DeleteKey(settings.FullPath); } else if (settings.location == Location.Cache) { ES3File.RemoveCachedFile(settings); } else if (settings.location == Location.Resources) { throw new NotSupportedException("Deleting files from Resources is not possible."); } } public static void CopyFile(string oldFilePath, string newFilePath) { CopyFile(new ES3Settings(oldFilePath), new ES3Settings(newFilePath)); } public static void CopyFile(string oldFilePath, string newFilePath, ES3Settings oldSettings, ES3Settings newSettings) { CopyFile(new ES3Settings(oldFilePath, oldSettings), new ES3Settings(newFilePath, newSettings)); } public static void CopyFile(ES3Settings oldSettings, ES3Settings newSettings) { if (oldSettings.location != newSettings.location) { throw new InvalidOperationException("Cannot copy file from " + oldSettings.location.ToString() + " to " + newSettings.location.ToString() + ". Location must be the same for both source and destination."); } if (oldSettings.location == Location.File) { if (ES3IO.FileExists(oldSettings.FullPath)) { string directoryPath = ES3IO.GetDirectoryPath(newSettings.FullPath); if (!ES3IO.DirectoryExists(directoryPath)) { ES3IO.CreateDirectory(directoryPath); } else { ES3IO.DeleteFile(newSettings.FullPath); } ES3IO.CopyFile(oldSettings.FullPath, newSettings.FullPath); } } else if (oldSettings.location == Location.PlayerPrefs) { PlayerPrefs.SetString(newSettings.FullPath, PlayerPrefs.GetString(oldSettings.FullPath)); } else if (oldSettings.location == Location.Cache) { ES3File.CopyCachedFile(oldSettings, newSettings); } else if (oldSettings.location == Location.Resources) { throw new NotSupportedException("Modifying files from Resources is not allowed."); } } public static void RenameFile(string oldFilePath, string newFilePath) { RenameFile(new ES3Settings(oldFilePath), new ES3Settings(newFilePath)); } public static void RenameFile(string oldFilePath, string newFilePath, ES3Settings oldSettings, ES3Settings newSettings) { RenameFile(new ES3Settings(oldFilePath, oldSettings), new ES3Settings(newFilePath, newSettings)); } public static void RenameFile(ES3Settings oldSettings, ES3Settings newSettings) { if (oldSettings.location != newSettings.location) { throw new InvalidOperationException("Cannot rename file in " + oldSettings.location.ToString() + " to " + newSettings.location.ToString() + ". Location must be the same for both source and destination."); } if (oldSettings.location == Location.File) { if (ES3IO.FileExists(oldSettings.FullPath)) { ES3IO.DeleteFile(newSettings.FullPath); ES3IO.MoveFile(oldSettings.FullPath, newSettings.FullPath); } } else if (oldSettings.location == Location.PlayerPrefs) { PlayerPrefs.SetString(newSettings.FullPath, PlayerPrefs.GetString(oldSettings.FullPath)); PlayerPrefs.DeleteKey(oldSettings.FullPath); } else if (oldSettings.location == Location.Cache) { ES3File.CopyCachedFile(oldSettings, newSettings); ES3File.RemoveCachedFile(oldSettings); } else if (oldSettings.location == Location.Resources) { throw new NotSupportedException("Modifying files from Resources is not allowed."); } } public static void CopyDirectory(string oldDirectoryPath, string newDirectoryPath) { CopyDirectory(new ES3Settings(oldDirectoryPath), new ES3Settings(newDirectoryPath)); } public static void CopyDirectory(string oldDirectoryPath, string newDirectoryPath, ES3Settings oldSettings, ES3Settings newSettings) { CopyDirectory(new ES3Settings(oldDirectoryPath, oldSettings), new ES3Settings(newDirectoryPath, newSettings)); } public static void CopyDirectory(ES3Settings oldSettings, ES3Settings newSettings) { if (oldSettings.location != 0) { throw new InvalidOperationException("ES3.CopyDirectory can only be used when the save location is 'File'"); } if (!DirectoryExists(oldSettings)) { throw new DirectoryNotFoundException("Directory " + oldSettings.FullPath + " not found"); } if (!DirectoryExists(newSettings)) { ES3IO.CreateDirectory(newSettings.FullPath); } string[] files = GetFiles(oldSettings); foreach (string fileOrDirectoryName in files) { CopyFile(ES3IO.CombinePathAndFilename(oldSettings.path, fileOrDirectoryName), ES3IO.CombinePathAndFilename(newSettings.path, fileOrDirectoryName)); } files = GetDirectories(oldSettings); foreach (string fileOrDirectoryName2 in files) { CopyDirectory(ES3IO.CombinePathAndFilename(oldSettings.path, fileOrDirectoryName2), ES3IO.CombinePathAndFilename(newSettings.path, fileOrDirectoryName2)); } } public static void RenameDirectory(string oldDirectoryPath, string newDirectoryPath) { RenameDirectory(new ES3Settings(oldDirectoryPath), new ES3Settings(newDirectoryPath)); } public static void RenameDirectory(string oldDirectoryPath, string newDirectoryPath, ES3Settings oldSettings, ES3Settings newSettings) { RenameDirectory(new ES3Settings(oldDirectoryPath, oldSettings), new ES3Settings(newDirectoryPath, newSettings)); } public static void RenameDirectory(ES3Settings oldSettings, ES3Settings newSettings) { if (oldSettings.location == Location.File) { if (ES3IO.DirectoryExists(oldSettings.FullPath)) { ES3IO.DeleteDirectory(newSettings.FullPath); ES3IO.MoveDirectory(oldSettings.FullPath, newSettings.FullPath); } return; } if (oldSettings.location == Location.PlayerPrefs || oldSettings.location == Location.Cache) { throw new NotSupportedException("Directories cannot be renamed when saving to Cache, PlayerPrefs, tvOS or using WebGL."); } if (oldSettings.location != Location.Resources) { return; } throw new NotSupportedException("Modifying files from Resources is not allowed."); } public static void DeleteDirectory(string directoryPath) { DeleteDirectory(new ES3Settings(directoryPath)); } public static void DeleteDirectory(string directoryPath, ES3Settings settings) { DeleteDirectory(new ES3Settings(directoryPath, settings)); } public static void DeleteDirectory(ES3Settings settings) { if (settings.location == Location.File) { ES3IO.DeleteDirectory(settings.FullPath); return; } if (settings.location == Location.PlayerPrefs || settings.location == Location.Cache) { throw new NotSupportedException("Deleting Directories using Cache or PlayerPrefs is not supported."); } if (settings.location != Location.Resources) { return; } throw new NotSupportedException("Deleting directories from Resources is not allowed."); } public static void DeleteKey(string key) { DeleteKey(key, new ES3Settings()); } public static void DeleteKey(string key, string filePath) { DeleteKey(key, new ES3Settings(filePath)); } public static void DeleteKey(string key, string filePath, ES3Settings settings) { DeleteKey(key, new ES3Settings(filePath, settings)); } public static void DeleteKey(string key, ES3Settings settings) { if (settings.location == Location.Resources) { throw new NotSupportedException("Modifying files in Resources is not allowed."); } if (settings.location == Location.Cache) { ES3File.DeleteKey(key, settings); } else if (FileExists(settings)) { using (ES3Writer eS3Writer = ES3Writer.Create(settings)) { eS3Writer.MarkKeyForDeletion(key); eS3Writer.Save(); } } } public static bool KeyExists(string key) { return KeyExists(key, new ES3Settings()); } public static bool KeyExists(string key, string filePath) { return KeyExists(key, new ES3Settings(filePath)); } public static bool KeyExists(string key, string filePath, ES3Settings settings) { return KeyExists(key, new ES3Settings(filePath, settings)); } public static bool KeyExists(string key, ES3Settings settings) { if (settings.location == Location.Cache) { return ES3File.KeyExists(key, settings); } using ES3Reader eS3Reader = ES3Reader.Create(settings); return eS3Reader?.Goto(key) ?? false; } public static bool FileExists() { return FileExists(new ES3Settings()); } public static bool FileExists(string filePath) { return FileExists(new ES3Settings(filePath)); } public static bool FileExists(string filePath, ES3Settings settings) { return FileExists(new ES3Settings(filePath, settings)); } public static bool FileExists(ES3Settings settings) { if (settings.location == Location.File) { return ES3IO.FileExists(settings.FullPath); } if (settings.location == Location.PlayerPrefs) { return PlayerPrefs.HasKey(settings.FullPath); } if (settings.location == Location.Cache) { return ES3File.FileExists(settings); } if (settings.location == Location.Resources) { return Resources.Load(settings.FullPath) != (Object)null; } return false; } public static bool DirectoryExists(string folderPath) { return DirectoryExists(new ES3Settings(folderPath)); } public static bool DirectoryExists(string folderPath, ES3Settings settings) { return DirectoryExists(new ES3Settings(folderPath, settings)); } public static bool DirectoryExists(ES3Settings settings) { if (settings.location == Location.File) { return ES3IO.DirectoryExists(settings.FullPath); } if (settings.location == Location.PlayerPrefs || settings.location == Location.Cache) { throw new NotSupportedException("Directories are not supported for the Cache and PlayerPrefs location."); } if (settings.location == Location.Resources) { throw new NotSupportedException("Checking existence of folder in Resources not supported."); } return false; } public static string[] GetKeys() { return GetKeys(new ES3Settings()); } public static string[] GetKeys(string filePath) { return GetKeys(new ES3Settings(filePath)); } public static string[] GetKeys(string filePath, ES3Settings settings) { return GetKeys(new ES3Settings(filePath, settings)); } public static string[] GetKeys(ES3Settings settings) { if (settings.location == Location.Cache) { return ES3File.GetKeys(settings); } List<string> list = new List<string>(); using (ES3Reader eS3Reader = ES3Reader.Create(settings)) { foreach (string property in eS3Reader.Properties) { list.Add(property); eS3Reader.Skip(); } } return list.ToArray(); } public static string[] GetFiles() { ES3Settings eS3Settings = new ES3Settings(); if (eS3Settings.location == Location.File) { if (eS3Settings.directory == Directory.PersistentDataPath) { eS3Settings.path = ES3IO.persistentDataPath; } else { eS3Settings.path = ES3IO.dataPath; } } return GetFiles(new ES3Settings()); } public static string[] GetFiles(string directoryPath) { return GetFiles(new ES3Settings(directoryPath)); } public static string[] GetFiles(string directoryPath, ES3Settings settings) { return GetFiles(new ES3Settings(directoryPath, settings)); } public static string[] GetFiles(ES3Settings settings) { if (settings.location == Location.Cache) { return ES3File.GetFiles(); } if (settings.location != 0) { throw new NotSupportedException("ES3.GetFiles can only be used when the location is set to File or Cache."); } return ES3IO.GetFiles(settings.FullPath, getFullPaths: false); } public static string[] GetDirectories() { return GetDirectories(new ES3Settings()); } public static string[] GetDirectories(string directoryPath) { return GetDirectories(new ES3Settings(directoryPath)); } public static string[] GetDirectories(string directoryPath, ES3Settings settings) { return GetDirectories(new ES3Settings(directoryPath, settings)); } public static string[] GetDirectories(ES3Settings settings) { if (settings.location != 0) { throw new NotSupportedException("ES3.GetDirectories can only be used when the location is set to File."); } return ES3IO.GetDirectories(settings.FullPath, getFullPaths: false); } public static void CreateBackup() { CreateBackup(new ES3Settings()); } public static void CreateBackup(string filePath) { CreateBackup(new ES3Settings(filePath)); } public static void CreateBackup(string filePath, ES3Settings settings) { CreateBackup(new ES3Settings(filePath, settings)); } public static void CreateBackup(ES3Settings settings) { ES3Settings newSettings = new ES3Settings(settings.path + ".bac", settings); CopyFile(settings, newSettings); } public static bool RestoreBackup(string filePath) { return RestoreBackup(new ES3Settings(filePath)); } public static bool RestoreBackup(string filePath, ES3Settings settings) { return RestoreBackup(new ES3Settings(filePath, settings)); } public static bool RestoreBackup(ES3Settings settings) { ES3Settings eS3Settings = new ES3Settings(settings.path + ".bac", settings); if (!FileExists(eS3Settings)) { return false; } RenameFile(eS3Settings, settings); return true; } public static DateTime GetTimestamp() { return GetTimestamp(new ES3Settings()); } public static DateTime GetTimestamp(string filePath) { return GetTimestamp(new ES3Settings(filePath)); } public static DateTime GetTimestamp(string filePath, ES3Settings settings) { return GetTimestamp(new ES3Settings(filePath, settings)); } public static DateTime GetTimestamp(ES3Settings settings) { if (settings.location == Location.File) { return ES3IO.GetTimestamp(settings.FullPath); } if (settings.location == Location.PlayerPrefs) { return new DateTime(long.Parse(PlayerPrefs.GetString("timestamp_" + settings.FullPath, "0")), DateTimeKind.Utc); } if (settings.location == Location.Cache) { return ES3File.GetTimestamp(settings); } return new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc); } public static void StoreCachedFile() { ES3File.Store(); } public static void StoreCachedFile(string filePath) { StoreCachedFile(new ES3Settings(filePath)); } public static void StoreCachedFile(string filePath, ES3Settings settings) { StoreCachedFile(new ES3Settings(filePath, settings)); } public static void StoreCachedFile(ES3Settings settings) { ES3File.Store(settings); } public static void CacheFile() { CacheFile(new ES3Settings()); } public static void CacheFile(string filePath) { CacheFile(new ES3Settings(filePath)); } public static void CacheFile(string filePath, ES3Settings settings) { CacheFile(new ES3Settings(filePath, settings)); } public static void CacheFile(ES3Settings settings) { ES3File.CacheFile(settings); } public static void Init() { _ = ES3Settings.defaultSettings; _ = ES3IO.persistentDataPath; ES3TypeMgr.Init(); } } public class ES3File { [EditorBrowsable(EditorBrowsableState.Never)] public static Dictionary<string, ES3File> cachedFiles = new Dictionary<string, ES3File>(); public ES3Settings settings; private Dictionary<string, ES3Data> cache = new Dictionary<string, ES3Data>(); private bool syncWithFile; private DateTime timestamp = DateTime.UtcNow; public ES3File() : this(new ES3Settings(), syncWithFile: true) { } public ES3File(string filePath) : this(new ES3Settings(filePath), syncWithFile: true) { } public ES3File(string filePath, ES3Settings settings) : this(new ES3Settings(filePath, settings), syncWithFile: true) { } public ES3File(ES3Settings settings) : this(settings, syncWithFile: true) { } public ES3File(bool syncWithFile) : this(new ES3Settings(), syncWithFile) { } public ES3File(string filePath, bool syncWithFile) : this(new ES3Settings(filePath), syncWithFile) { } public ES3File(string filePath, ES3Settings settings, bool syncWithFile) : this(new ES3Settings(filePath, settings), syncWithFile) { } public ES3File(ES3Settings settings, bool syncWithFile) { this.settings = settings; this.syncWithFile = syncWithFile; if (!syncWithFile) { return; } ES3Settings eS3Settings = (ES3Settings)settings.Clone(); eS3Settings.typeChecking = true; using (ES3Reader eS3Reader = ES3Reader.Create(eS3Settings)) { if (eS3Reader == null) { return; } foreach (KeyValuePair<string, ES3Data> item in eS3Reader.RawEnumerator) { cache[item.Key] = item.Value; } } timestamp = ES3.GetTimestamp(eS3Settings); } public ES3File(byte[] bytes, ES3Settings settings = null) { if (settings == null) { this.settings = new ES3Settings(); } else { this.settings = settings; } syncWithFile = true; SaveRaw(bytes, settings); } public void Sync() { Sync(settings); } public void Sync(string filePath, ES3Settings settings = null) { Sync(new ES3Settings(filePath, settings)); } public void Sync(ES3Settings settings = null) { if (settings == null) { settings = new ES3Settings(); } if (cache.Count == 0) { ES3.DeleteFile(settings); return; } using ES3Writer eS3Writer = ES3Writer.Create(settings, writeHeaderAndFooter: true, !syncWithFile, append: false); foreach (KeyValuePair<string, ES3Data> item in cache) { eS3Writer.Write(type: (item.Value.type != null) ? item.Value.type.type : typeof(object), key: item.Key, value: item.Value.bytes); } eS3Writer.Save(!syncWithFile); } public void Clear() { cache.Clear(); } public string[] GetKeys() { Dictionary<string, ES3Data>.KeyCollection keys = cache.Keys; string[] array = new string[keys.Count]; keys.CopyTo(array, 0); return array; } public void Save<T>(string key, T value) { ES3Settings eS3Settings = (ES3Settings)settings.Clone(); eS3Settings.encryptionType = ES3.EncryptionType.None; eS3Settings.compressionType = ES3.CompressionType.None; Type type = ((value != null) ? value.GetType() : typeof(T)); cache[key] = new ES3Data(ES3TypeMgr.GetOrCreateES3Type(type), ES3.Serialize(value, eS3Settings)); } public void SaveRaw(byte[] bytes, ES3Settings settings = null) { if (settings == null) { settings = new ES3Settings(); } ES3Settings eS3Settings = (ES3Settings)settings.Clone(); eS3Settings.typeChecking = true; using ES3Reader eS3Reader = ES3Reader.Create(bytes, eS3Settings); if (eS3Reader == null) { return; } foreach (KeyValuePair<string, ES3Data> item in eS3Reader.RawEnumerator) { cache[item.Key] = item.Value; } } public void AppendRaw(byte[] bytes, ES3Settings settings = null) { if (settings == null) { settings = new ES3Settings(); } SaveRaw(bytes, settings); } public object Load(string key) { return Load<object>(key); } public object Load(string key, object defaultValue) { return this.Load<object>(key, defaultValue); } public T Load<T>(string key) { if (!cache.TryGetValue(key, out var value)) { throw new KeyNotFoundException("Key \"" + key + "\" was not found in this ES3File. Use Load<T>(key, defaultValue) if you want to return a default value if the key does not exist."); } ES3Settings eS3Settings = (ES3Settings)settings.Clone(); eS3Settings.encryptionType = ES3.EncryptionType.None; eS3Settings.compressionType = ES3.CompressionType.None; if (typeof(T) == typeof(object)) { return (T)ES3.Deserialize(value.type, value.bytes, eS3Settings); } return ES3.Deserialize<T>(value.bytes, eS3Settings); } public T Load<T>(string key, T defaultValue) { if (!cache.TryGetValue(key, out var value)) { return defaultValue; } ES3Settings eS3Settings = (ES3Settings)settings.Clone(); eS3Settings.encryptionType = ES3.EncryptionType.None; eS3Settings.compressionType = ES3.CompressionType.None; if (typeof(T) == typeof(object)) { return (T)ES3.Deserialize(value.type, value.bytes, eS3Settings); } return ES3.Deserialize<T>(value.bytes, eS3Settings); } public void LoadInto<T>(string key, T obj) where T : class { if (!cache.TryGetValue(key, out var value)) { throw new KeyNotFoundException("Key \"" + key + "\" was not found in this ES3File. Use Load<T>(key, defaultValue) if you want to return a default value if the key does not exist."); } ES3Settings eS3Settings = (ES3Settings)settings.Clone(); eS3Settings.encryptionType = ES3.EncryptionType.None; eS3Settings.compressionType = ES3.CompressionType.None; if (typeof(T) == typeof(object)) { ES3.DeserializeInto(value.type, value.bytes, obj, eS3Settings); } else { ES3.DeserializeInto(value.bytes, obj, eS3Settings); } } public byte[] LoadRawBytes() { ES3Settings eS3Settings = (ES3Settings)settings.Clone(); if (!eS3Settings.postprocessRawCachedData) { eS3Settings.encryptionType = ES3.EncryptionType.None; eS3Settings.compressionType = ES3.CompressionType.None; } return GetBytes(eS3Settings); } public string LoadRawString() { if (cache.Count == 0) { return ""; } return settings.encoding.GetString(LoadRawBytes()); } internal byte[] GetBytes(ES3Settings settings = null) { if (cache.Count == 0) { return new byte[0]; } if (settings == null) { settings = this.settings; } using MemoryStream memoryStream = new MemoryStream(); ES3Settings eS3Settings = (ES3Settings)settings.Clone(); eS3Settings.location = ES3.Location.InternalMS; if (!eS3Settings.postprocessRawCachedData) { eS3Settings.encryptionType = ES3.EncryptionType.None; eS3Settings.compressionType = ES3.CompressionType.None; } using (ES3Writer eS3Writer = ES3Writer.Create(ES3Stream.CreateStream(memoryStream, eS3Settings, ES3FileMode.Write), eS3Settings, writeHeaderAndFooter: true, overwriteKeys: false)) { foreach (KeyValuePair<string, ES3Data> item in cache) { eS3Writer.Write(item.Key, item.Value.type.type, item.Value.bytes); } eS3Writer.Save(overwriteKeys: false); } return memoryStream.ToArray(); } public void DeleteKey(string key) { cache.Remove(key); } public bool KeyExists(string key) { return cache.ContainsKey(key); } public int Size() { int num = 0; foreach (KeyValuePair<string, ES3Data> item in cache) { num += item.Value.bytes.Length; } return num; } public Type GetKeyType(string key) { if (!cache.TryGetValue(key, out var value)) { throw new KeyNotFoundException("Key \"" + key + "\" was not found in this ES3File. Use Load<T>(key, defaultValue) if you want to return a default value if the key does not exist."); } return value.type.type; } [EditorBrowsable(EditorBrowsableState.Never)] internal static ES3File GetOrCreateCachedFile(ES3Settings settings) { if (!cachedFiles.TryGetValue(settings.path, out var value)) { value = new ES3File(settings, syncWithFile: false); cachedFiles.Add(settings.path, value); value.syncWithFile = true; } value.settings = settings; return value; } internal static void CacheFile(ES3Settings settings) { if (settings.location == ES3.Location.Cache) { settings = (ES3Settings)settings.Clone(); settings.location = ((ES3Settings.defaultSettings.location != ES3.Location.Cache) ? ES3Settings.defaultSettings.location : ES3.Location.File); } if (ES3.FileExists(settings)) { ES3Settings eS3Settings = (ES3Settings)settings.Clone(); eS3Settings.compressionType = ES3.CompressionType.None; eS3Settings.encryptionType = ES3.EncryptionType.None; cachedFiles[settings.path] = new ES3File(ES3.LoadRawBytes(eS3Settings), settings); } } [EditorBrowsable(EditorBrowsableState.Never)] internal static void Store(ES3Settings settings = null) { if (settings == null) { settings = new ES3Settings(ES3.Location.File); } else if (settings.location == ES3.Location.Cache) { settings = (ES3Settings)settings.Clone(); settings.location = ((ES3Settings.defaultSettings.location != ES3.Location.Cache) ? ES3Settings.defaultSettings.location : ES3.Location.File); } if (!cachedFiles.TryGetValue(settings.path, out var value)) { throw new FileNotFoundException("The file '" + settings.path + "' could not be stored because it could not be found in the cache."); } value.Sync(settings); } [EditorBrowsable(EditorBrowsableState.Never)] internal static void RemoveCachedFile(ES3Settings settings) { cachedFiles.Remove(settings.path); } [EditorBrowsable(EditorBrowsableState.Never)] internal static void CopyCachedFile(ES3Settings oldSettings, ES3Settings newSettings) { if (!cachedFiles.TryGetValue(oldSettings.path, out var value)) { throw new FileNotFoundException("The file '" + oldSettings.path + "' could not be copied because it could not be found in the cache."); } if (cachedFiles.ContainsKey(newSettings.path)) { throw new InvalidOperationException("Cannot copy file '" + oldSettings.path + "' to '" + newSettings.path + "' because '" + newSettings.path + "' already exists"); } cachedFiles.Add(newSettings.path, (ES3File)value.MemberwiseClone()); } [EditorBrowsable(EditorBrowsableState.Never)] internal static void DeleteKey(string key, ES3Settings settings) { if (cachedFiles.TryGetValue(settings.path, out var value)) { value.DeleteKey(key); } } [EditorBrowsable(EditorBrowsableState.Never)] internal static bool KeyExists(string key, ES3Settings settings) { if (cachedFiles.TryGetValue(settings.path, out var value)) { return value.KeyExists(key); } return false; } [EditorBrowsable(EditorBrowsableState.Never)] internal static bool FileExists(ES3Settings settings) { return cachedFiles.ContainsKey(settings.path); } [EditorBrowsable(EditorBrowsableState.Never)] internal static string[] GetKeys(ES3Settings settings) { if (!cachedFiles.TryGetValue(settings.path, out var value)) { throw new FileNotFoundException("Could not get keys from the file '" + settings.path + "' because it could not be found in the cache."); } return value.cache.Keys.ToArray(); } [EditorBrowsable(EditorBrowsableState.Never)] internal static string[] GetFiles() { return cachedFiles.Keys.ToArray(); } internal static DateTime GetTimestamp(ES3Settings settings) { if (!cachedFiles.TryGetValue(settings.path, out var value)) { return new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc); } return value.timestamp; } } [ExecuteInEditMode] public class ES3GameObject : MonoBehaviour { public List<Component> components = new List<Component>(); private void Update() { _ = Application.isPlaying; } } public class ES3InspectorInfo : MonoBehaviour { } public class ES3ReferenceMgr : ES3ReferenceMgrBase { } public class ES3Spreadsheet { protected struct Index { public int col; public int row; public Index(int col, int row) { this.col = col; this.row = row; } } private int cols; private int rows; private Dictionary<Index, string> cells = new Dictionary<Index, string>(); private const string QUOTE = "\""; private const char QUOTE_CHAR = '"'; private const char COMMA_CHAR = ','; private const char NEWLINE_CHAR = '\n'; private const string ESCAPED_QUOTE = "\"\""; private static char[] CHARS_TO_ESCAPE = new char[4] { ',', '"', '\n', ' ' }; public int ColumnCount => cols; public int RowCount => rows; public int GetColumnLength(int col) { if (col >= cols) { return 0; } int num = -1; foreach (Index key in cells.Keys) { if (key.col == col && key.row > num) { num = key.row; } } return num + 1; } public int GetRowLength(int row) { if (row >= rows) { return 0; } int num = -1; foreach (Index key in cells.Keys) { if (key.row == row && key.col > num) { num = key.col; } } return num + 1; } public void SetCell(int col, int row, object value) { Type type = value.GetType(); if (type == typeof(string)) { SetCellString(col, row, (string)value); return; } ES3Settings eS3Settings = new ES3Settings(); if (ES3Reflection.IsPrimitive(type)) { SetCellString(col, row, value.ToString()); } else { SetCellString(col, row, eS3Settings.encoding.GetString(ES3.Serialize(value, ES3TypeMgr.GetOrCreateES3Type(type)))); } if (col >= cols) { cols = col + 1; } if (row >= rows) { rows = row + 1; } } private void SetCellString(int col, int row, string value) { cells[new Index(col, row)] = value; if (col >= cols) { cols = col + 1; } if (row >= rows) { rows = row + 1; } } public T GetCell<T>(int col, int row) { object cell = GetCell(typeof(T), col, row); if (cell == null) { return default(T); } return (T)cell; } public object GetCell(Type type, int col, int row) { if (col >= cols || row >= rows) { throw new IndexOutOfRangeException("Cell (" + col + ", " + row + ") is out of bounds of spreadsheet (" + cols + ", " + rows + ")."); } if (!cells.TryGetValue(new Index(col, row), out var value) || value == null) { return null; } if (type == typeof(string)) { return value; } ES3Settings eS3Settings = new ES3Settings(); return ES3.Deserialize(ES3TypeMgr.GetOrCreateES3Type(type), eS3Settings.encoding.GetBytes(value), eS3Settings); } public void Load(string filePath) { Load(new ES3Settings(filePath)); } public void Load(string filePath, ES3Settings settings) { Load(new ES3Settings(filePath, settings)); } public void Load(ES3Settings settings) { Load(ES3Stream.CreateStream(settings, ES3FileMode.Read), settings); } public void LoadRaw(string str) { Load(new MemoryStream(new ES3Settings().encoding.GetBytes(str)), new ES3Settings()); } public void LoadRaw(string str, ES3Settings settings) { Load(new MemoryStream(settings.encoding.GetBytes(str)), settings); } private void Load(Stream stream, ES3Settings settings) { using StreamReader streamReader = new StreamReader(stream); string text = ""; int num = 0; int num2 = 0; while (true) { int num3 = streamReader.Read(); char c = (char)num3; if (c == '"') { while (true) { c = (char)streamReader.Read(); if (c == '"') { if ((ushort)streamReader.Peek() != 34) { break; } c = (char)streamReader.Read(); } text += c; } } else if (c == ',' || c == '\n' || num3 == -1) { SetCell(num, num2, text); text = ""; switch (c) { case ',': num++; break; case '\n': num = 0; num2++; break; default: return; } } else { text += c; } } } public void Save(string filePath) { Save(new ES3Settings(filePath), append: false); } public void Save(string filePath, ES3Settings settings) { Save(new ES3Settings(filePath, settings), append: false); } public void Save(ES3Settings settings) { Save(settings, append: false); } public void Save(string filePath, bool append) { Save(new ES3Settings(filePath), append); } public void Save(string filePath, ES3Settings settings, bool append) { Save(new ES3Settings(filePath, settings), append); } public void Save(ES3Settings settings, bool append) { using (StreamWriter streamWriter = new StreamWriter(ES3Stream.CreateStream(settings, (!append) ? ES3FileMode.Write : ES3FileMode.Append))) { if (append && ES3.FileExists(settings)) { streamWriter.Write('\n'); } string[,] array = ToArray(); for (int i = 0; i < rows; i++) { if (i != 0) { streamWriter.Write('\n'); } for (int j = 0; j < cols; j++) { if (j != 0) { streamWriter.Write(','); } streamWriter.Write(Escape(array[j, i])); } } } if (!append) { ES3IO.CommitBackup(settings); } } private static string Escape(string str, bool isAlreadyWrappedInQuotes = false) { if (str == "") { return "\"\""; } if (str == null) { return null; } if (str.Contains("\"")) { str = str.Replace("\"", "\"\""); } if (str.IndexOfAny(CHARS_TO_ESCAPE) > -1) { str = "\"" + str + "\""; } return str; } private static string Unescape(string str) { if (str.StartsWith("\"") && str.EndsWith("\"")) { str = str.Substring(1, str.Length - 2); if (str.Contains("\"\"")) { str = str.Replace("\"\"", "\""); } } return str; } private string[,] ToArray() { string[,] array = new string[cols, rows]; foreach (KeyValuePair<Index, string> cell in cells) { array[cell.Key.col, cell.Key.row] = cell.Value; } return array; } } public abstract class ES3Reader : IDisposable { [EditorBrowsable(EditorBrowsableState.Never)] public class ES3ReaderPropertyEnumerator { public ES3Reader reader; public ES3ReaderPropertyEnumerator(ES3Reader reader) { this.reader = reader; } public IEnumerator GetEnumerator() { while (true) { if (reader.overridePropertiesName != null) { string overridePropertiesName = reader.overridePropertiesName; reader.overridePropertiesName = null; yield return overridePropertiesName; continue; } string text; if ((text = reader.ReadPropertyName()) == null) { break; } yield return text; } } } [EditorBrowsable(EditorBrowsableState.Never)] public class ES3ReaderRawEnumerator { public ES3Reader reader; public ES3ReaderRawEnumerator(ES3Reader reader) { this.reader = reader; } public IEnumerator GetEnumerator() { while (true) { string text = reader.ReadPropertyName(); if (text == null) { break; } Type type = reader.ReadTypeFromHeader<object>(); byte[] bytes = reader.ReadElement(); reader.ReadKeySuffix(); if (type != null) { yield return new KeyValuePair<string, ES3Data>(text, new ES3Data(type, bytes)); } } } } public ES3Settings settings; protected int serializationDepth; internal string overridePropertiesName; public virtual ES3ReaderPropertyEnumerator Properties => new ES3ReaderPropertyEnumerator(this); internal virtual ES3ReaderRawEnumerator RawEnumerator => new ES3ReaderRawEnumerator(this); internal abstract int Read_int(); internal abstract float Read_float(); internal abstract bool Read_bool(); internal abstract char Read_char(); internal abstract decimal Read_decimal(); internal abstract double Read_double(); internal abstract long Read_long(); internal abstract ulong Read_ulong(); internal abstract byte Read_byte(); internal abstract sbyte Read_sbyte(); internal abstract short Read_short(); internal abstract ushort Read_ushort(); internal abstract uint Read_uint(); internal abstract string Read_string(); internal abstract byte[] Read_byteArray(); internal abstract long Read_ref(); [EditorBrowsable(EditorBrowsableState.Never)] public abstract string ReadPropertyName(); protected abstract Type ReadKeyPrefix(bool ignore = false); protected abstract void ReadKeySuffix(); internal abstract byte[] ReadElement(bool skip = false); public abstract void Dispose(); internal virtual bool Goto(string key) { if (key == null) { throw new ArgumentNullException("Key cannot be NULL when loading data."); } string text; while ((text = ReadPropertyName()) != key) { if (text == null) { return false; } Skip(); } return true; } internal virtual bool StartReadObject() { serializationDepth++; return false; } internal virtual void EndReadObject() { serializationDepth--; } internal abstract bool StartReadDictionary(); internal abstract void EndReadDictionary(); internal abstract bool StartReadDictionaryKey(); internal abstract void EndReadDictionaryKey(); internal abstract void StartReadDictionaryValue(); internal abstract bool EndReadDictionaryValue(); internal abstract bool StartReadCollection(); internal abstract void EndReadCollection(); internal abstract bool StartReadCollectionItem(); internal abstract bool EndReadCollectionItem(); internal ES3Reader(ES3Settings settings, bool readHeaderAndFooter = true) { this.settings = settings; } [EditorBrowsable(EditorBrowsableState.Never)] public virtual void Skip() { ReadElement(skip: true); } public virtual T Read<T>() { return Read<T>(ES3TypeMgr.GetOrCreateES3Type(typeof(T))); } public virtual void ReadInto<T>(object obj) { ReadInto<T>(obj, ES3TypeMgr.GetOrCreateES3Type(typeof(T))); } [EditorBrowsable(EditorBrowsableState.Never)] public T ReadProperty<T>() { return ReadProperty<T>(ES3TypeMgr.GetOrCreateES3Type(typeof(T))); } [EditorBrowsable(EditorBrowsableState.Never)] public T ReadProperty<T>(ES3Type type) { ReadPropertyName(); return Read<T>(type); } [EditorBrowsable(EditorBrowsableState.Never)] public long ReadRefProperty() { ReadPropertyName(); return Read_ref(); } internal Type ReadType() { return ES3Reflection.GetType(Read<string>(ES3Type_string.Instance)); } public object SetPrivateProperty(string name, object value, object objectContainingProperty) { ES3Reflection.ES3ReflectedMember eS3ReflectedProperty = ES3Reflection.GetES3ReflectedProperty(objectContainingProperty.GetType(), name); if (eS3ReflectedProperty.IsNull) { throw new MissingMemberException("A private property named " + name + " does not exist in the type " + objectContainingProperty.GetType()); } eS3ReflectedProperty.SetValue(objectContainingProperty, value); return objectContainingProperty; } public object SetPrivateField(string name, object value, object objectContainingField) { ES3Reflection.ES3ReflectedMember eS3ReflectedMember = ES3Reflection.GetES3ReflectedMember(objectContainingField.GetType(), name); if (eS3ReflectedMember.IsNull) { throw new MissingMemberException("A private field named " + name + " does not exist in the type " + objectContainingField.GetType()); } eS3ReflectedMember.SetValue(objectContainingField, value); return objectContainingField; } public virtual T Read<T>(string key) { if (!Goto(key)) { throw new KeyNotFoundException("Key \"" + key + "\" was not found in file \"" + settings.FullPath + "\". Use Load<T>(key, defaultValue) if you want to return a default value if the key does not exist."); } Type type = ReadTypeFromHeader<T>(); return Read<T>(ES3TypeMgr.GetOrCreateES3Type(type)); } public virtual T Read<T>(string key, T defaultValue) { if (!Goto(key)) { return defaultValue; } Type type = ReadTypeFromHeader<T>(); return Read<T>(ES3TypeMgr.GetOrCreateES3Type(type)); } public virtual void ReadInto<T>(string key, T obj) where T : class { if (!Goto(key)) { throw new KeyNotFoundException("Key \"" + key + "\" was not found in file \"" + settings.FullPath + "\""); } Type type = ReadTypeFromHeader<T>(); ReadInto<T>(obj, ES3TypeMgr.GetOrCreateES3Type(type)); } protected virtual void ReadObject<T>(object obj, ES3Type type) { if (!StartReadObject()) { type.ReadInto<T>(this, obj); EndReadObject(); } } protected virtual T ReadObject<T>(ES3Type type) { if (StartReadObject()) { return default(T); } object obj = type.Read<T>(this); EndReadObject(); return (T)obj; } [EditorBrowsable(EditorBrowsableState.Never)] public virtual T Read<T>(ES3Type type) { if (type == null || type.isUnsupported) { throw new NotSupportedException("Type of " + type?.ToString() + " is not currently supported, and could not be loaded using reflection."); } if (type.isPrimitive) { return (T)type.Read<T>(this); } if (type.isCollection) { return (T)((ES3CollectionType)type).Read(this); } if (type.isDictionary) { return (T)((ES3DictionaryType)type).Read(this); } return ReadObject<T>(type); } [EditorBrowsable(EditorBrowsableState.Never)] public virtual void ReadInto<T>(object obj, ES3Type type) { if (type == null || type.isUnsupported) { throw new NotSupportedException("Type of " + obj.GetType()?.ToString() + " is not currently supported, and could not be loaded using reflection."); } if (type.isCollection) { ((ES3CollectionType)type).ReadInto(this, obj); } else if (type.isDictionary) { ((ES3DictionaryType)type).ReadInto(this, obj); } else { ReadObject<T>(obj, type); } } [EditorBrowsable(EditorBrowsableState.Never)] internal Type ReadTypeFromHeader<T>() { if (typeof(T) == typeof(object)) { return ReadKeyPrefix(); } if (settings.typeChecking) { Type type = ReadKeyPrefix(); if (type != typeof(T)) { throw new InvalidOperationException("Trying to load data of type " + typeof(T)?.ToString() + ", but data contained in file is type of " + type?.ToString() + "."); } return type; } ReadKeyPrefix(ignore: true); return typeof(T); } public static ES3Reader Create() { return Create(new ES3Settings()); } public static ES3Reader Create(string filePath) { return Create(new ES3Settings(filePath)); } public static ES3Reader Create(string filePath, ES3Settings settings) { return Create(new ES3Settings(filePath, settings)); } public static ES3Reader Create(ES3Settings settings) { Stream stream = ES3Stream.CreateStream(settings, ES3FileMode.Read); if (stream == null) { return null; } if (settings.format == ES3.Format.JSON) { return new ES3JSONReader(stream, settings); } return null; } public static ES3Reader Create(byte[] bytes) { return Create(bytes, new ES3Settings()); } public static ES3Reader Create(byte[] bytes, ES3Settings settings) { Stream stream = ES3Stream.CreateStream(new MemoryStream(bytes), settings, ES3FileMode.Read); if (stream == null) { return null; } if (settings.format == ES3.Format.JSON) { return new ES3JSONReader(stream, settings); } return null; } internal static ES3Reader Create(Stream stream, ES3Settings settings) { stream = ES3Stream.CreateStream(stream, settings, ES3FileMode.Read); if (settings.format == ES3.Format.JSON) { return new ES3JSONReader(stream, settings); } return null; } internal static ES3Reader Create(Stream stream, ES3Settings settings, bool readHeaderAndFooter) { if (settings.format == ES3.Format.JSON) { return new ES3JSONReader(stream, settings, readHeaderAndFooter); } return null; } } public class ES3XMLReader { } public class ES3Defaults : ScriptableObject { [SerializeField] public ES3SerializableSettings settings = new ES3SerializableSettings(); public bool addMgrToSceneAutomatically; public bool autoUpdateReferences = true; public bool addAllPrefabsToManager = true; public int collectDependenciesDepth = 4; public int collectDependenciesTimeout = 10; public bool updateReferencesWhenSceneChanges = true; public bool updateReferencesWhenSceneIsSaved = true; public bool updateReferencesWhenSceneIsOpened = true; [Tooltip("Folders listed here will be searched for references every time the reference manager is refreshed. Path should be relative to the project folder.")] public string[] referenceFolders = new string[0]; public bool logDebugInfo; public bool logWarnings = true; public bool logErrors = true; } public class ES3Settings : ICloneable { private static ES3Settings _defaults = null; private static ES3Defaults _defaultSettingsScriptableObject; private const string defaultSettingsPath = "ES3/ES3Defaults"; private static ES3Settings _unencryptedUncompressedSettings = null; private static readonly string[] resourcesExtensions = new string[9] { ".txt", ".htm", ".html", ".xml", ".bytes", ".json", ".csv", ".yaml", ".fnt" }; [SerializeField] private ES3.Location _location; public string path = "SaveFile.es3"; public ES3.EncryptionType encryptionType; public ES3.CompressionType compressionType; public string encryptionPassword = "password"; public ES3.Directory directory; public ES3.Format format; public bool prettyPrint = true; public int bufferSize = 2048; public Encoding encoding = Encoding.UTF8; public bool saveChildren = true; public bool postprocessRawCachedData; [EditorBrowsable(EditorBrowsableState.Never)] public bool typeChecking = true; [EditorBrowsable(EditorBrowsableState.Never)] public bool safeReflection = true; [EditorBrowsable(EditorBrowsableState.Never)] public ES3.ReferenceMode memberReferenceMode; [EditorBrowsable(EditorBrowsableState.Never)] public ES3.ReferenceMode referenceMode = ES3.ReferenceMode.ByRefAndValue; [EditorBrowsable(EditorBrowsableState.Never)] public int serializationDepthLimit = 64; [EditorBrowsable(EditorBrowsableState.Never)] public string[] assemblyNames = new string[2] { "Assembly-CSharp-firstpass", "Assembly-CSharp" }; public static ES3Defaults defaultSettingsScriptableObject { get { if ((Object)(object)_defaultSettingsScriptableObject == (Object)null) { _defaultSettingsScriptableObject = Resources.Load<ES3Defaults>("ES3/ES3Defaults"); } return _defaultSettingsScriptableObject; } } public static ES3Settings defaultSettings { get { if (_defaults == null && (Object)(object)defaultSettingsScriptableObject != (Object)null) { _defaults = defaultSettingsScriptableObject.settings; } return _defaults; } } internal static ES3Settings unencryptedUncompressedSettings { get { if (_unencryptedUncompressedSettings == null) { _unencryptedUncompressedSettings = new ES3Settings(ES3.EncryptionType.None, ES3.CompressionType.None); } return _unencryptedUncompressedSettings; } } public ES3.Location location { get { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Invalid comparison between Unknown and I4 //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Invalid comparison between Unknown and I4 if (_location == ES3.Location.File && ((int)Application.platform == 17 || (int)Application.platform == 31)) { return ES3.Location.PlayerPrefs; } return _location; } set { _location = value; } } public string FullPath { get { if (path == null) { throw new NullReferenceException("The 'path' field of this ES3Settings is null, indicating that it was not possible to load the default settings from Resources. Please check that the ES3 Default Settings.prefab exists in Assets/Plugins/Resources/ES3/"); } if (IsAbsolute(path)) { return path; } if (location == ES3.Location.File) { if (directory == ES3.Directory.PersistentDataPath) { return ES3IO.persistentDataPath + "/" + path; } if (directory == ES3.Directory.DataPath) { return Application.dataPath + "/" + path; } throw new NotImplementedException("File directory \"" + directory.ToString() + "\" has not been implemented."); } if (location == ES3.Location.Resources) { string extension = Path.GetExtension(path); bool flag = false; string[] array = resourcesExtensions; foreach (string text in array) { if (extension == text) { flag = true; break; } } if (!flag) { throw new ArgumentException("Extension of file in Resources must be .json, .bytes, .txt, .csv, .htm, .html, .xml, .yaml or .fnt, but path given was \"" + path + "\""); } return path.Replace(extension, ""); } return path; } } public ES3Settings(string path = null, ES3Settings settings = null) : this(applyDefaults: true) { settings?.CopyInto(this); if (path != null) { this.path = path; } } public ES3Settings(string path, params Enum[] enums) : this(enums) { if (path != null) { this.path = path; } } public ES3Settings(params Enum[] enums) : this(applyDefaults: true) { foreach (Enum @enum in enums) { if (@enum is ES3.EncryptionType) { encryptionType = (ES3.EncryptionType)(object)@enum; } else if (@enum is ES3.Location) { location = (ES3.Location)(object)@enum; } else if (@enum is ES3.CompressionType) { compressionType = (ES3.CompressionType)(object)@enum; } else if (@enum is ES3.ReferenceMode) { referenceMode = (ES3.ReferenceMode)(object)@enum; } else if (@enum is ES3.Format) { format = (ES3.Format)(object)@enum; } else if (@enum is ES3.Directory) { directory = (ES3.Directory)(object)@enum; } } } public ES3Settings(ES3.EncryptionType encryptionType, string encryptionPassword) : this(applyDefaults: true) { this.encryptionType = encryptionType; this.encryptionPassword = encryptionPassword; } public ES3Settings(string path, ES3.EncryptionType encryptionType, string encryptionPassword, ES3Settings settings = null) : this(path, settings) { this.encryptionType = encryptionType; this.encryptionPassword = encryptionPassword; } [EditorBrowsable(EditorBrowsableState.Never)] public ES3Settings(bool applyDefaults) { if (applyDefaults && defaultSettings != null) { _defaults.CopyInto(this); } } private static bool IsAbsolute(string path) { if (path.Length > 0 && (path[0] == '/' || path[0] == '\\')) { return true; } if (path.Length > 1 && path[1] == ':') { return true; } return false; } [EditorBrowsable(EditorBrowsableState.Never)] public object Clone() { ES3Settings eS3Settings = new ES3Settings(); CopyInto(eS3Settings); return eS3Settings; } private void CopyInto(ES3Settings newSettings) { newSettings._location = _location; newSettings.directory = directory; newSettings.format = format; newSettings.prettyPrint = prettyPrint; newSettings.path = path; newSettings.encryptionType = encryptionType; newSettings.encryptionPassword = encryptionPassword; newSettings.compressionType = compressionType; newSettings.bufferSize = bufferSize; newSettings.encoding = encoding; newSettings.typeChecking = typeChecking; newSettings.safeReflection = safeReflection; newSettings.referenceMode = referenceMode; newSettings.memberReferenceMode = memberReferenceMode; newSettings.assemblyNames = assemblyNames; newSettings.saveChildren = saveChildren; newSettings.serializationDepthLimit = serializationDepthLimit; newSettings.postprocessRawCachedData = postprocessRawCachedData; } } [Serializable] [EditorBrowsable(EditorBrowsableState.Never)] public class ES3SerializableSettings : ES3Settings { public ES3SerializableSettings() : base(applyDefaults: false) { } public ES3SerializableSettings(bool applyDefaults) : base(applyDefaults) { } public ES3SerializableSettings(string path) : base(applyDefaults: false) { base.path = path; } public ES3SerializableSettings(string path, ES3.Location location) : base(applyDefaults: false) { base.location = location; } } public class ES3Ref { public long id; public ES3Ref(long id) { this.id = id; } } public class UnityObjectType : MonoBehaviour { public List<Object> objs; private void Start() { if (!ES3.KeyExists("this")) { ES3.Save("this", this); } else { ES3.LoadInto("this", this); } foreach (Object obj in objs) { Debug.Log((object)obj); } } } public class ES3Cloud : ES3WebClass { private int timeout = 20; public Encoding encoding = Encoding.UTF8; private byte[] _data; public byte[] data => _data; public string text { get { if (data == null) { return null; } return encoding.GetString(data); } } public string[] filenames { get { if (data == null || data.Length == 0) { return new string[0]; } return text.Split(new char[1] { ';' }, StringSplitOptions.RemoveEmptyEntries); } } public DateTime timestamp { get { if (data == null || data.Length == 0) { return new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc); } if (!double.TryParse(text, out var result)) { throw new FormatException("Could not convert downloaded data to a timestamp. Data downloaded was: " + text); } return new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc).AddSeconds(result); } } public ES3Cloud(string url, string apiKey) : base(url, apiKey) { } public ES3Cloud(string url, string apiKey, int timeout) : base(url, apiKey) { this.timeout = timeout; } public IEnumerator Sync() { return Sync(new ES3Settings(), "", ""); } public IEnumerator Sync(string filePath) { return Sync(new ES3Settings(filePath), "", ""); } public IEnumerator Sync(string filePath, string user) { return Sync(new ES3Settings(filePath), user, ""); } public IEnumerator Sync(string filePath, string user, string password) { return Sync(new ES3Settings(filePath), user, password); } public IEnumerator Sync(string filePath, ES3Settings settings) { return Sync(new ES3Settings(filePath, settings), "", ""); } public IEnumerator Sync(string filePath, string user, ES3Settings settings) { return Sync(new ES3Settings(filePath, settings), user, ""); } public IEnumerator Sync(string filePath, string user, string password, ES3Settings settings) { return Sync(new ES3Settings(filePath, settings), user, password); } private IEnumerator Sync(ES3Settings settings, string user, string password) { Reset(); yield return DownloadFile(settings, user, password, GetFileTimestamp(settings)); if (errorCode == 3) { Reset(); if (ES3.FileExists(settings)) { yield return UploadFile(settings, user, password); } } isDone = true; } public IEnumerator UploadFile() { return UploadFile(new ES3Settings(), "", ""); } public IEnumerator UploadFile(string filePath) { return UploadFile(new ES3Settings(filePath), "", ""); } public IEnumerator UploadFile(string filePath, string user) { return UploadFile(new ES3Settings(filePath), user, ""); } public IEnumerator UploadFile(string filePath, string user, string password) { return UploadFile(new ES3Settings(filePath), user, password); } public IEnumerator UploadFile(string filePath, ES3Settings settings) { return UploadFile(new ES3Settings(filePath, settings), "", ""); } public IEnumerator UploadFile(string filePath, string user, ES3Settings settings) { return UploadFile(new ES3Settings(filePath, settings), user, ""); } public IEnumerator UploadFile(string filePath, string user, string password, ES3Settings settings) { return UploadFile(new ES3Settings(filePath, settings), user, password); } public IEnumerator UploadFile(ES3File es3File) { return UploadFile(es3File.GetBytes(), es3File.settings, "", "", DateTimeToUnixTimestamp(DateTime.Now)); } public IEnumerator UploadFile(ES3File es3File, string user) { return UploadFile(es3File.GetBytes(), es3File.settings, user, "", DateTimeToUnixTimestamp(DateTime.Now)); } public IEnumerator UploadFile(ES3File es3File, string user, string password) { return UploadFile(es3File.GetBytes(), es3File.settings, user, password, DateTimeToUnixTimestamp(DateTime.Now)); } public IEnumerator UploadFile(ES3Settings settings, string user, string password) { return UploadFile(ES3.LoadRawBytes(settings), settings, user, password); } public IEnumerator UploadFile(byte[] bytes, ES3Settings settings, string user, string password) { return UploadFile(bytes, settings, user, password, DateTimeToUnixTimestamp(ES3.GetTimestamp(settings))); } private IEnumerator UploadFile(byte[] bytes, ES3Settings settings, string user, string password, long fileTimestamp) { Reset(); WWWForm val = CreateWWWForm(); val.AddField("apiKey", apiKey); val.AddField("putFile", settings.path); val.AddField("timestamp", fileTimestamp.ToString()); val.AddField("user", GetUser(user, password)); val.AddBinaryData("data", bytes, "data.dat", "multipart/form-data"); UnityWebRequest webRequest = UnityWebRequest.Post(url, val); try { webRequest.timeout = timeout; yield return SendWebRequest(webRequest); HandleError(webRequest, errorIfDataIsDownloaded: true); } finally { ((IDisposable)webRequest)?.Dispose(); } isDone = true; } public IEnumerator DownloadFile() { return DownloadFile(new ES3Settings(), "", "", 0L); } public IEnumerator DownloadFile(string filePath) { return DownloadFile(new ES3Settings(filePath), "", "", 0L); } public IEnumerator DownloadFile(string filePath, string user) { return DownloadFile(new ES3Settings(filePath), user, "", 0L); } public IEnumerator DownloadFile(string filePath, string user, string password) { return DownloadFile(new ES3Settings(filePath), user, password, 0L); } public IEnumerator DownloadFile(string filePath, ES3Settings settings) { return DownloadFile(new ES3Settings(filePath, settings), "", "", 0L); } public IEnumerator DownloadFile(string filePath, string user, ES3Settings settings) { return DownloadFile(new ES3Settings(filePath, settings), user, "", 0L); } public IEnumerator DownloadFile(string filePath, string user, string password, ES3Settings settings) { return DownloadFile(new ES3Settings(filePath, settings), user, password, 0L); } public IEnumerator DownloadFile(ES3File es3File) { return DownloadFile(es3File, "", "", 0L); } public IEnumerator DownloadFile(ES3File es3File, string user) { return DownloadFile(es3File, user, "", 0L); } public IEnumerator DownloadFile(ES3File es3File, string user, string password) { return DownloadFile(es3File, user, password, 0L); } private IEnumerator DownloadFile(ES3File es3File, string user, string password, long timestamp) { Reset(); WWWForm val = CreateWWWForm(); val.AddField("apiKey", apiKey); val.AddField("getFile", es3File.settings.path); val.AddField("user", GetUser(user, password)); if (timestamp > 0) { val.AddField("timestamp", timestamp.ToString()); } UnityWebRequest webRequest = UnityWebRequest.Post(url, val); try { webRequest.timeout = timeout; yield return SendWebRequest(webRequest); if (!HandleError(webRequest, errorIfDataIsDownloaded: false)) { if (webRequest.downloadedBytes != 0) { es3File.Clear(); es3File.SaveRaw(webRequest.downloadHandler.data); } else { error = $"File {es3File.settings.path} was not found on the server."; errorCode = 3L; } } } finally { ((IDisposable)webRequest)?.Dispose(); } isDone = true; } private IEnumerator DownloadFile(ES3Settings settings, string user, string password, long timestamp) { Reset(); WWWForm val = CreateWWWForm(); val.AddField("apiKey", apiKey); val.AddField("getFile", settings.path); val.AddField("user", GetUser(user, password)); if (timestamp > 0) { val.AddField("timestamp", timestamp.ToString()); } UnityWebRequest webRequest = UnityWebRequest.Post(url, val); try { webRequest.timeout = timeout; yield return SendWebRequest(webRequest); if (!HandleError(webRequest, errorIfDataIsDownloaded: false)) { if (webRequest.downloadedBytes != 0) { ES3.SaveRaw(webRequest.downloadHandler.data, settings); } else { error = $"File {settings.path} was not found on the server."; errorCode = 3L; } } } finally { ((IDisposable)webRequest)?.Dispose(); } isDone = true; } public IEnumerator DeleteFile() { return DeleteFile(new ES3Settings(), "", ""); } public IEnumerator DeleteFile(string filePath) { return DeleteFile(new ES3Settings(filePath), "", ""); } public IEnumerator DeleteFile(string filePath, string user) { return DeleteFile(new ES3Settings(filePath), user, ""); } public IEnumerator DeleteFile(string filePath, string user, string password) { return DeleteFile(new ES3Settings(filePath), user, password); } public IEnumerator DeleteFile(string filePath, ES3Settings settings) { return DeleteFile(new ES3Settings(filePath, settings), "", ""); } public IEnumerator DeleteFile(string filePath, string user, ES3Settings settings) { return DeleteFile(new ES3Settings(filePath, settings), user, ""); } public IEnumerator DeleteFile(string filePath, string user, string password, ES3Settings settings) { return DeleteFile(new ES3Settings(filePath, settings), user, password); } private IEnumerator DeleteFile(ES3Settings settings, string user, string password) { Reset(); WWWForm val = CreateWWWForm(); val.AddField("apiKey", apiKey); val.AddField("deleteFile", settings.path); val.AddField("user", GetUser(user, password)); UnityWebRequest webRequest = UnityWebRequest.Post(url, val); try { webRequest.timeout = timeout; yield return SendWebRequest(webRequest); HandleError(webRequest, errorIfDataIsDownloaded: true); } finally { ((IDisposable)webRequest)?.Dispose(); } isDone = true; } public IEnumerator RenameFile(string filePath, string newFilePath) { return RenameFile(new ES3Settings(filePath), new ES3Settings(newFilePath), "", ""); } public IEnumerator RenameFile(string filePath, string newFilePath, string user) { return RenameFile(new ES3Settings(filePath), new ES3Settings(newFilePath), user, ""); } public IEnumerator RenameFile(string filePath, string newFilePath, string user, string password) { return RenameFile(new ES3Settings(filePath), new ES3Settings(newFilePath), user, password); } public IEnumerator RenameFile(string filePath, string newFilePath, ES3Settings settings) { return RenameFile(new ES3Settings(filePath, settings), new ES3Settings(newFilePath, settings), "", ""); } public IEnumerator RenameFile(string filePath, string newFilePath, string user, ES3Settings settings) { return RenameFile(new ES3Settings(filePath, settings), new ES3Settings(newFilePath, settings), user, ""); } public IEnumerator RenameFile(string filePath, string newFilePath, string user, string password, ES3Settings settings) { return RenameFile(new ES3Settings(filePath, settings), new ES3Settings(newFilePath, settings), user, password); } private IEnumerator RenameFile(ES3Settings settings, ES3Settings newSettings, string user, string password) { Reset(); WWWForm val = CreateWWWForm(); val.AddField("apiKey", apiKey); val.AddField("renameFile", settings.path); val.AddField("newFilename", newSettings.path); val.AddField("user", GetUser(user, password)); UnityWebRequest webRequest = UnityWebRequest.Post(url, val); try { webRequest.timeout = timeout; yield return SendWebRequest(webRequest); HandleError(webRequest, errorIfDataIsDownloaded: true); } finally { ((IDisposable)webRequest)?.Dispose(); } isDone = true; } public IEnumerator DownloadFilenames(string user = "", string password = "") { Reset(); WWWForm val = CreateWWWForm(); val.AddField("apiKey", apiKey); val.AddField("getFilenames", ""); val.AddField("user", GetUser(user, password)); UnityWebRequest webRequest = UnityWebRequest.Post(url, val); try { webRequest.timeout = timeout; yield return SendWebRequest(webRequest); if (!HandleError(webRequest, errorIfDataIsDownloaded: false)) { _data = webRequest.downloadHandler.data; } } finally { ((IDisposable)webRequest)?.Dispose(); } isDone = true; } public IEnumerator SearchFilenames(string searchPattern, string user = "", string password = "") { Reset(); WWWForm val = CreateWWWForm(); val.AddField("apiKey", apiKey); val.AddField("getFilenames", ""); val.AddField("user", GetUser(user, password)); if (!string.IsNullOrEmpty(searchPattern)) { val.AddField("pattern", searchPattern); } UnityWebRequest webRequest = UnityWebRequest.Post(url, val); try { webRequest.timeout = timeout; yield return SendWebRequest(webRequest); if (!HandleError(webRequest, errorIfDataIsDownloaded: false)) { _data = webRequest.downloadHandler.data; } } finally { ((IDisposable)webRequest)?.Dispose(); } isDone = true; } public IEnumerator DownloadTimestamp() { return DownloadTimestamp(new ES3Settings(), "", ""); } public IEnumerator DownloadTimestamp(string filePath) { return DownloadTimestamp(new ES3Settings(filePath), "", ""); } public IEnumerator DownloadTimestamp(string filePath, string user) { return DownloadTimestamp(new ES3Settings(filePath), user, ""); } public IEnumerator DownloadTimestamp(string filePath, string user, string password) { return DownloadTimestamp(new ES3Settings(filePath), user, password); } public IEnumerator DownloadTimestamp(string filePath, ES3Settings settings) { return DownloadTimestamp(new ES3Settings(filePath, settings), "", ""); } public IEnumerator DownloadTimestamp(string filePath, string user, ES3Settings settings) { return DownloadTimestamp(new ES3Settings(filePath, settings), user, ""); } public IEnumerator DownloadTimestamp(string filePath, string user, string password, ES3Settings settings) { return DownloadTimestamp(new ES3Settings(filePath, settings), user, password); } private IEnumerator DownloadTimestamp(ES3Settings settings, string user, string password) { Reset(); WWWForm val = CreateWWWForm(); val.AddField("apiKey", apiKey); val.AddField("getTimestamp", settings.path); val.AddField("user", GetUser(user, password)); UnityWebRequest webRequest = UnityWebRequest.Post(url, val); try { webRequest.timeout = timeout; yield return SendWebRequest(webRequest); if (!HandleError(webRequest, errorIfDataIsDownloaded: false)) { _data = webRequest.downloadHandler.data; } } finally { ((IDisposable)webRequest)?.Dispose(); } isDone = true; } private long DateTimeToUnixTimestamp(DateTime dt) { return Convert.ToInt64((dt.ToUniversalTime() - new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc)).TotalSeconds); } private long GetFileTimestamp(ES3Settings settings) { return DateTimeToUnixTimestamp(ES3.GetTimestamp(settings)); } protected override void Reset() { _data = null; base.Reset(); } } public abstract class ES3Writer : IDisposable { public ES3Settings settings; protected HashSet<string> keysToDelete = new HashSet<string>(); internal bool writeHeaderAndFooter = true; internal bool overwriteKeys = true; protected int serializationDepth; internal abstract void WriteNull(); internal virtual void StartWriteFile() { serializationDepth++; } internal virtual void EndWriteFile() { serializationDepth--; } internal virtual void StartWriteObject(string name) { serializationDepth++; } internal virtual void EndWriteObject(string name) { serializationDepth--; } internal virtual void StartWriteProperty(string name) { if (name == null) { throw new ArgumentNullException("Key or field name cannot be NULL when saving data."); } ES3Debug.Log("<b>" + name + "</b> (writing property)", null, serializationDepth); } internal virtual void EndWriteProperty(string name) { } internal virtual void StartWriteCollection() { serializationDepth++; } internal virtual void EndWriteCollection() { serializationDepth--; } internal abstract void StartWriteCollectionItem(int index); internal abstract void EndWriteCollectionItem(int index); internal abstract void StartWriteDictionary(); internal abstract void EndWriteDictionary(); internal abstract void StartWriteDictionaryKey(int index); internal abstract void EndWriteDictionaryKey(int index); internal abstract void StartWriteDictionaryValue(int index); internal abstract void EndWriteDictionaryValue(int index); public abstract void Dispose(); internal abstract void WriteRawProperty(string name, byte[] bytes); internal abstract void WritePrimitive(int value); internal abstract void WritePrimitive(float value); internal abstract void WritePrimitive(bool value); internal abstract void WritePrimitive(decimal value); internal abstract void WritePrimitive(double value); internal abstract void WritePrimitive(long value); internal abstract void WritePrimitive(ulong value); internal abstract void WritePrimitive(uint value); internal abstract void WritePrimitive(byte value); internal abstract void WritePrimitive(sbyte value); internal abstract void WritePrimitive(short value); internal abstract void WritePrimitive(ushort value); internal abstract void WritePrimitive(char value); internal abstract void WritePrimitive(string value); internal abstract void WritePrimitive(byte[] value); protected ES3Writer(ES3Settings settings, bool writeHeaderAndFooter, bool overwriteKeys) { this.settings = settings; this.writeHeaderAndFooter = writeHeaderAndFooter; this.overwriteKeys = overwriteKeys; } internal virtual void Write(string key, Type type, byte[] value) { StartWriteProperty(key); StartWriteObject(key); WriteType(type); WriteRawProperty("value", value); EndWriteObject(key); EndWriteProperty(key); MarkKeyForDeletion(key); } public virtual void Write<T>(string key, object value) { if (typeof(T) == typeof(object)) { Write(value.GetType(), key, value); } else { Write(typeof(T), key, value); } } [EditorBrowsable(EditorBrowsableState.Never)] public virtual void Write(Type type, string key, object value) { StartWriteProperty(key); StartWriteObject(key); WriteType(type); WriteProperty("value", value, ES3TypeMgr.GetOrCreateES3Type(type), settings.referenceMode); EndWriteObject(key); EndWriteProperty(key); MarkKeyForDeletion(key); } [EditorBrowsable(EditorBrowsableState.Never)] public virtual void Write(object value, ES3.ReferenceMode memberReferenceMode = ES3.ReferenceMode.ByRef) { if (value == null) { WriteNull(); return; } ES3Type orCreateES3Type = ES3TypeMgr.GetOrCreateES3Type(value.GetType()); Write(value, orCreateES3Type, memberReferenceMode); } [EditorBrowsable(EditorBrowsableState.Never)] public virtual void Write(object value, ES3Type type, ES3.ReferenceMode memberReferenceMode = ES3.ReferenceMode.ByRef) { if (value == null || (ES3Reflection.IsAssignableFrom(typeof(Object), value.GetType()) && (Object)((value is Object) ? value : null) == (Object)null)) { WriteNull(); return; } if (type == null || type.type == typeof(object)) { Type type2 = value.GetType(); type = ES3TypeMgr.GetOrCreateES3Type(type2); if (type == null) { throw new NotSupportedException("Types of " + type2?.ToString() + " are not supported. Please see the Supported Types guide for more information: https://docs.moodkie.com/easy-save-3/es3-supported-types/"); } if (!type.isCollection && !type.isDictionary) { StartWriteObject(null); WriteType(type2); type.Write(value, this); EndWriteObject(null); return; } } if (type == null) { throw new ArgumentNullException("ES3Type argument cannot be null."); } if (type.isUnsupported) { if (type.isCollection || type.isDictionary) { throw new NotSupportedException(type.type?.ToString() + " is not supported because it's element type is not supported. Please see the Supported Types guide for more information: https://docs.moodkie.com/easy-save-3/es3-supported-types/"); } throw new NotSupportedException("Types of " + type.type?.ToString() + " are not supported. Please see the Supported Types guide for more information: https://docs.moodkie.com/easy-save-3/es3-supported-types/"); } if (type.isPrimitive || type.isEnum) { type.Write(value, this); return; } if (type.isCollection) { StartWriteCollection(); ((ES3CollectionType)type).Write(value, this, memberReferenceMode); EndWriteCollection(); return; } if (type.isDictionary) { StartWriteDictionary(); ((ES3DictionaryType)type).Write(value, this, memberReferenceMode); EndWriteDictionary(); return; } if (type.type == typeof(GameObject)) { ((ES3Type_GameObject)type).saveChildren = settings.saveChildren; } StartWriteObject(null); if (type.isES3TypeUnityObject) { ((ES3UnityObjectType)type).WriteObject(value, this, memberReferenceMode); } else { type.Write(value, this); } EndWriteObject(null); } internal virtual void WriteRef(Object obj) { ES3ReferenceMgrBase current = ES3ReferenceMgrBase.Current; if ((Object)(object)current == (Object)null) { throw new InvalidOperationException("An Easy Save 3 Manager is required to save references. To add one to your scene, exit playmode and go to Tools > Easy Save 3 > Add Manager to Scene"); } long num = current.Get(obj); if (num == -1) { num = current.Add(obj); } WriteProperty("_ES3Ref", num.ToString()); } public virtual void WriteProperty(string name, object value) { WriteProperty(name, value, settings.memberReferenceMode); } public virtual void WriteProperty(string name, object value, ES3.ReferenceMode memberReferenceMode) { if (!SerializationDepthLimitExceeded()) { StartWriteProperty(name); Write(value, memberReferenceMode); EndWriteProperty(name); } } public virtual void WriteProperty<T>(string name, object value) { WriteProperty(name, value, ES3TypeMgr.GetOrCreateES3Type(typeof(T)), settings.memberReferenceMode); } [EditorBrowsable(EditorBrowsableState.Never)] public virtual void WriteProperty(string name, object value, ES3Type type) { WriteProperty(name, value, type, settings.memberReferenceMode); } [EditorBrowsable(EditorBrowsableState.Never)] public virtual void WriteProperty(string name, object value, ES3Type type, ES3.ReferenceMode memberReferenceMode) { if (!SerializationDepthLimitExceeded()) { StartWriteProperty(name); Write(value, type, memberReferenceMode); EndWriteProperty(name); } } [EditorBrowsable(EditorBrowsableState.Never)] public virtual void WritePropertyByRef(string name, Object value) { if (!SerializationDepthLimitExceeded()) { StartWriteProperty(name); if (value == (Object)null) { WriteNull(); return; } StartWriteObject(name); WriteRef(value); EndWriteObject(name); EndWriteProperty(name); } } public void WritePrivateProperty(string name, object objectContainingProperty) { ES3Reflection.ES3ReflectedMember eS3ReflectedProperty = ES3Reflection.GetES3ReflectedProperty(objectContainingProperty.GetType(), name); if (eS3ReflectedProperty.IsNull) { throw new MissingMemberException("A private property named " + name + " does not exist in the type " + objectContainingProperty.GetType()); } WriteProperty(name, eS3ReflectedProperty.GetValue(objectContainingProperty), ES3TypeMgr.GetOrCreateES3Type(eS3ReflectedProperty.MemberType)); } public void WritePrivateField(string name, object objectContainingField) { ES3Reflection.ES3ReflectedMember eS3ReflectedMember = ES3Reflection.GetES3ReflectedMember(objectContainingField.GetType(), name); if (eS3ReflectedMember.IsNull) { throw new MissingMemberException("A private field named " + name + " does not exist in the type " + objectContainingField.GetType()); } WriteProperty(name, eS3ReflectedMember.GetValue(objectContainingField), ES3TypeMgr.GetOrCreateES3Type(eS3ReflectedMember.MemberType)); } [EditorBrowsable(EditorBrowsableState.Never)] public void WritePrivateProperty(string name, object objectContainingProperty, ES3Type type) { ES3Reflection.ES3ReflectedMember eS3ReflectedProperty = ES3Reflection.GetES3ReflectedProperty(objectContainingProperty.GetType(), name); if (eS3ReflectedProperty.IsNull) { throw new MissingMemberException("A private property named " + name + " does not exist in the type " + objectContainingProperty.GetType()); } WriteProperty(name, eS3ReflectedProperty.GetValue(objectContainingProperty), type); } [EditorBrowsable(EditorBrowsableState.Never)] public void WritePrivateField(string name, object objectContainingField, ES3Type type) { ES3Reflection.ES3ReflectedMember eS3ReflectedMember = ES3Reflection.GetES3ReflectedMember(objectContainingField.GetType(), name); if (eS3ReflectedMember.IsNull
BepInEx/plugins/TheBeeTeam-PersistentPurchases/Assembly-CSharp.dll
Decompiled a year ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.CodeDom.Compiler; using System.Collections; using System.Collections.Generic; using System.Collections.ObjectModel; using System.ComponentModel; using System.Diagnostics; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Text; using System.Text.RegularExpressions; using System.Threading; using DigitalRuby.ThunderAndLightning; using Dissonance; using Dissonance.Audio.Playback; using Dissonance.Datastructures; using Dissonance.Extensions; using Dissonance.Integrations.Unity_NFGO; using Dissonance.Networking; using DunGen; using DunGen.Analysis; using DunGen.Graph; using DunGen.Tags; using GameNetcodeStuff; using JetBrains.Annotations; using Netcode.Transports.Facepunch; using Steamworks; using Steamworks.Data; using Steamworks.ServerList; using TMPro; using Unity.AI.Navigation; using Unity.Collections; using Unity.Netcode; using Unity.Netcode.Components; using Unity.Netcode.Samples; using Unity.Netcode.Transports.UTP; using UnityEngine; using UnityEngine.AI; using UnityEngine.Animations.Rigging; using UnityEngine.Audio; using UnityEngine.EventSystems; using UnityEngine.Events; using UnityEngine.InputSystem; using UnityEngine.InputSystem.Controls; using UnityEngine.InputSystem.Utilities; using UnityEngine.Rendering; using UnityEngine.Rendering.HighDefinition; using UnityEngine.SceneManagement; using UnityEngine.Serialization; using UnityEngine.Tilemaps; using UnityEngine.UI; using UnityEngine.VFX; using UnityEngine.Video; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: AssemblyVersion("0.0.0.0")] public class AlarmButton : MonoBehaviour { private Animator buttonAnimator; public float timeSincePushing; public void PushAlarmButton() { if (!(timeSincePushing < 1f)) { buttonAnimator.SetTrigger("press"); HUDManager.Instance.TriggerAlarmHornEffect(); } } private void Update() { if (timeSincePushing <= 5f) { timeSincePushing += Time.deltaTime; } } } public class AnimatedItem : GrabbableObject { public string grabItemBoolString; public string dropItemTriggerString; public bool makeAnimationWhenDropping; public Animator itemAnimator; public AudioSource itemAudio; public AudioClip grabAudio; public AudioClip dropAudio; public bool loopGrabAudio; public bool loopDropAudio; [Range(0f, 100f)] public int chanceToTriggerAnimation = 100; public int chanceToTriggerAlternateMesh; public Mesh alternateMesh; private Mesh normalMesh; private Random itemRandomChance; public float noiseRange; public float noiseLoudness; private int timesPlayedInOneSpot; private float makeNoiseInterval; private Vector3 lastPosition; public AudioLowPassFilter itemAudioLowPassFilter; private bool wasInPocket; public override void Start() { base.Start(); itemRandomChance = new Random(StartOfRound.Instance.randomMapSeed + StartOfRound.Instance.currentLevelID + itemProperties.itemId); Debug.Log((object)$"Seed: {StartOfRound.Instance.randomMapSeed} + {StartOfRound.Instance.currentLevelID} + {itemProperties.itemId}"); if (chanceToTriggerAlternateMesh > 0) { normalMesh = ((Component)this).gameObject.GetComponent<MeshFilter>().mesh; } } public override void EquipItem() { base.EquipItem(); if ((Object)(object)itemAudioLowPassFilter != (Object)null) { itemAudioLowPassFilter.cutoffFrequency = 20000f; } itemAudio.volume = 1f; if (chanceToTriggerAlternateMesh > 0) { if (itemRandomChance.Next(0, 100) < chanceToTriggerAlternateMesh) { ((Component)this).gameObject.GetComponent<MeshFilter>().mesh = alternateMesh; itemAudio.Stop(); return; } ((Component)this).gameObject.GetComponent<MeshFilter>().mesh = normalMesh; } if (!wasInPocket) { if (itemRandomChance.Next(0, 100) > chanceToTriggerAnimation) { itemAudio.Stop(); return; } } else { wasInPocket = false; } if ((Object)(object)itemAnimator != (Object)null) { itemAnimator.SetBool(grabItemBoolString, true); } if ((Object)(object)itemAudio != (Object)null) { itemAudio.clip = grabAudio; itemAudio.loop = loopGrabAudio; itemAudio.Play(); } } public override void DiscardItem() { base.DiscardItem(); if ((Object)(object)itemAnimator != (Object)null) { itemAnimator.SetBool(grabItemBoolString, false); } if (chanceToTriggerAlternateMesh > 0) { ((Component)this).gameObject.GetComponent<MeshFilter>().mesh = normalMesh; } if (!makeAnimationWhenDropping) { itemAudio.Stop(); return; } if (itemRandomChance.Next(0, 100) < chanceToTriggerAnimation) { itemAudio.Stop(); return; } if ((Object)(object)itemAnimator != (Object)null) { itemAnimator.SetTrigger(dropItemTriggerString); } if ((Object)(object)itemAudio != (Object)null) { itemAudio.loop = loopDropAudio; itemAudio.clip = dropAudio; itemAudio.Play(); if ((Object)(object)itemAudioLowPassFilter != (Object)null) { itemAudioLowPassFilter.cutoffFrequency = 20000f; } itemAudio.volume = 1f; } } public override void PocketItem() { base.PocketItem(); wasInPocket = true; if ((Object)(object)itemAudio != (Object)null) { if ((Object)(object)itemAudioLowPassFilter != (Object)null) { itemAudioLowPassFilter.cutoffFrequency = 1700f; } itemAudio.volume = 0.5f; } } public override void Update() { //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_004c: 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_0087: Unknown result type (might be due to invalid IL or missing references) base.Update(); if ((Object)(object)itemAudio == (Object)null || !itemAudio.isPlaying) { return; } if (makeNoiseInterval <= 0f) { makeNoiseInterval = 0.75f; if (Vector3.Distance(lastPosition, ((Component)this).transform.position) < 4f) { timesPlayedInOneSpot++; } else { timesPlayedInOneSpot = 0; } if (isPocketed) { RoundManager.Instance.PlayAudibleNoise(((Component)this).transform.position, noiseRange / 2f, noiseLoudness / 2f, timesPlayedInOneSpot, isInElevator && StartOfRound.Instance.hangarDoorsClosed); } else { RoundManager.Instance.PlayAudibleNoise(((Component)this).transform.position, noiseRange, noiseLoudness, timesPlayedInOneSpot, isInElevator && StartOfRound.Instance.hangarDoorsClosed); } } else { makeNoiseInterval -= Time.deltaTime; } } protected override void __initializeVariables() { base.__initializeVariables(); } protected internal override string __getTypeName() { return "AnimatedItem"; } } public class AnimatedTextureUV : MonoBehaviour { private Material[] setMaterials; public MeshRenderer meshRenderer; public SkinnedMeshRenderer skinnedMeshRenderer; public int materialIndex; public int columns = 1; public int rows = 1; public float waitFrameTime = 0.005f; private float horizontalOffset; private float verticalOffset; private Coroutine animateMaterial; private bool skinnedMesh; private void OnEnable() { if (animateMaterial == null) { Debug.Log((object)"Animating material now"); animateMaterial = ((MonoBehaviour)this).StartCoroutine(AnimateUV()); } } private void OnDisable() { if (animateMaterial != null) { ((MonoBehaviour)this).StopCoroutine(animateMaterial); } } private IEnumerator AnimateUV() { yield return null; if ((Object)(object)skinnedMeshRenderer != (Object)null) { setMaterials = ((Renderer)skinnedMeshRenderer).materials; skinnedMesh = true; } else { setMaterials = ((Renderer)meshRenderer).materials; } float maxVertical = 1f - 1f / (float)columns; float maxHorizontal = 1f - 1f / (float)rows; while (((Behaviour)this).enabled) { yield return (object)new WaitForSeconds(waitFrameTime); horizontalOffset += 1f / (float)rows; if (horizontalOffset > maxHorizontal) { horizontalOffset = 0f; verticalOffset += 1f / (float)columns; if (verticalOffset > maxVertical) { verticalOffset = 0f; } } setMaterials[materialIndex].SetTextureOffset("_BaseColorMap", new Vector2(horizontalOffset, verticalOffset)); if (skinnedMesh) { ((Renderer)skinnedMeshRenderer).materials = setMaterials; } else { ((Renderer)skinnedMeshRenderer).materials = setMaterials; } } } } public class AnimationStopPoints : MonoBehaviour { public bool canAnimationStop; public int animationPosition = 1; public void SetAnimationStopPosition1() { canAnimationStop = true; animationPosition = 1; } public void SetAnimationGo() { canAnimationStop = false; } public void SetAnimationStopPosition2() { canAnimationStop = true; animationPosition = 2; } } public class AudioReverbPresets : MonoBehaviour { public AudioReverbTrigger[] audioPresets; } public class AutoParentToShip : NetworkBehaviour { public bool disableObject; public Vector3 positionOffset; public Vector3 rotationOffset; [HideInInspector] public Vector3 startingPosition; [HideInInspector] public Vector3 startingRotation; public bool overrideOffset; private void Awake() { //IL_0019: 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_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: 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_0096: Unknown result type (might be due to invalid IL or missing references) //IL_009b: 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_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_0078: 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_0089: 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) if (!overrideOffset) { positionOffset = StartOfRound.Instance.elevatorTransform.InverseTransformPoint(((Component)this).transform.position); rotationOffset = StartOfRound.Instance.elevatorTransform.InverseTransformDirection(((Component)this).transform.eulerAngles); } MoveToOffset(); PlaceableShipObject component = ((Component)this).gameObject.GetComponent<PlaceableShipObject>(); if ((Object)(object)component != (Object)null && (Object)(object)component.parentObjectSecondary != (Object)null) { startingPosition = component.parentObjectSecondary.position; startingRotation = component.parentObjectSecondary.eulerAngles; } else { startingPosition = positionOffset; startingRotation = rotationOffset; } } private void LateUpdate() { //IL_002a: Unknown result type (might be due to invalid IL or missing references) if (!StartOfRound.Instance.suckingFurnitureOutOfShip) { if (disableObject) { ((Component)this).transform.position = new Vector3(800f, -100f, 0f); } else { MoveToOffset(); } } } public void StartSuckingOutOfShip() { ((MonoBehaviour)this).StartCoroutine(SuckObjectOutOfShip()); } private IEnumerator SuckObjectOutOfShip() { Vector3 dir = Vector3.Normalize((StartOfRound.Instance.middleOfSpaceNode.position - ((Component)this).transform.position) * 10000f); Debug.Log((object)dir); Quaternion randomRotation = Random.rotation; while (StartOfRound.Instance.suckingFurnitureOutOfShip) { yield return null; ((Component)this).transform.position = ((Component)this).transform.position + dir * (Time.deltaTime * Mathf.Clamp(StartOfRound.Instance.suckingPower, 1.1f, 100f) * 17f); ((Component)this).transform.rotation = Quaternion.Lerp(((Component)this).transform.rotation, ((Component)this).transform.rotation * randomRotation, Time.deltaTime * StartOfRound.Instance.suckingPower); Debug.DrawRay(((Component)this).transform.position + Vector3.up * 0.2f, StartOfRound.Instance.middleOfSpaceNode.position - ((Component)this).transform.position, Color.blue); Debug.DrawRay(((Component)this).transform.position, dir, Color.green); } } public void MoveToOffset() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_003b: 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_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_005c: 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_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006e: 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) ((Component)this).transform.rotation = StartOfRound.Instance.elevatorTransform.rotation; ((Component)this).transform.Rotate(rotationOffset); ((Component)this).transform.position = StartOfRound.Instance.elevatorTransform.position; Vector3 val = positionOffset; val = StartOfRound.Instance.elevatorTransform.rotation * val; Transform transform = ((Component)this).transform; transform.position += val; } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected internal override string __getTypeName() { return "AutoParentToShip"; } } public class BaboonBirdAI : EnemyAI { public Dictionary<Transform, Threat> threats = new Dictionary<Transform, Threat>(); public Transform focusedThreatTransform; public Threat focusedThreat; public bool focusingOnThreat; public bool focusedThreatIsInView; private int focusLevel; private float fearLevel; private float fearLevelNoDistComparison; private Vector3 agentLocalVelocity; private float velX; private float velZ; private Vector3 previousPosition; public Transform animationContainer; public MultiAimConstraint headLookRig; public Transform headLookTarget; private Ray lookRay; public float fov; public float visionDistance; private int visibleThreatsMask = 524296; private int scrapMask = 64; private int leadershipLevel; private int previousBehaviourState = -1; public BaboonHawkGroup scoutingGroup; private float miscAnimationTimer; private int currentMiscAnimation; private Vector3 lookTarget; private Vector3 peekTarget; private float peekTimer; public AISearchRoutine scoutingSearchRoutine; public static Vector3 baboonCampPosition; public float scoutTimer; public float timeToScout; private float timeSinceRestWhileScouting; private float restingDuringScouting; private bool eyesClosed; private bool restingAtCamp; private float restAtCampTimer; private float chosenDistanceToCamp = 1f; private float timeSincePingingBirdInterest; private float timeSinceLastMiscAnimation; private int aggressiveMode; private int previousAggressiveMode; private float fightTimer; public AudioSource aggressionAudio; private Vector3 debugSphere; public Collider ownCollider; private float timeSinceAggressiveDisplay; private float timeSpentFocusingOnThreat; private float timeSinceFighting; private bool doingKillAnimation; private Coroutine killAnimCoroutine; private float timeSinceHitting; public Transform deadBodyPoint; public AudioClip[] cawScreamSFX; public AudioClip[] cawLaughSFX; private float noiseTimer; private float noiseInterval; public GrabbableObject focusedScrap; public GrabbableObject heldScrap; public bool movingToScrap; public Transform grabTarget; public TwoBoneIKConstraint leftArmRig; public TwoBoneIKConstraint rightArmRig; private bool oddAIInterval; private DeadBodyInfo killAnimationBody; private float timeSinceBeingAttackedByPlayer; private float timeSinceJoiningOrLeavingScoutingGroup; private BaboonBirdAI biggestBaboon; public override void Start() { //IL_003a: 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) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) base.Start(); if (!((NetworkBehaviour)this).IsOwner) { return; } Random random = new Random(StartOfRound.Instance.randomMapSeed + thisEnemyIndex); leadershipLevel = random.Next(0, 500); if (baboonCampPosition == Vector3.zero) { List<GameObject> list = new List<GameObject>(); for (int i = 0; i < RoundManager.Instance.outsideAINodes.Length - 2; i += 2) { if (Vector3.Distance(RoundManager.Instance.outsideAINodes[i].transform.position, StartOfRound.Instance.elevatorTransform.position) > 30f && !PathIsIntersectedByLineOfSight(RoundManager.Instance.outsideAINodes[i].transform.position, calculatePathDistance: false, avoidLineOfSight: false)) { list.Add(RoundManager.Instance.outsideAINodes[i]); } } baboonCampPosition = RoundManager.Instance.GetRandomNavMeshPositionInBoxPredictable(list[random.Next(0, list.Count)].transform.position, 15f, RoundManager.Instance.navHit, random); } SyncInitialValuesServerRpc(leadershipLevel, baboonCampPosition); } [ServerRpc] public void SyncInitialValuesServerRpc(int syncLeadershipLevel, Vector3 campPosition) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Invalid comparison between Unknown and I4 //IL_011d: 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_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: 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) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3452382367u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, syncLeadershipLevel); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref campPosition); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3452382367u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { SyncInitialValuesClientRpc(syncLeadershipLevel, campPosition); } } [ClientRpc] public void SyncInitialValuesClientRpc(int syncLeadershipLevel, Vector3 campPosition) { //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_00dc: 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_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3856685904u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, syncLeadershipLevel); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref campPosition); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3856685904u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost)) { leadershipLevel = syncLeadershipLevel; baboonCampPosition = campPosition; ((Component)this).transform.localScale = ((Component)this).transform.localScale * Mathf.Max((float)leadershipLevel / 200f * 0.6f, 0.9f); } } } public void LateUpdate() { //IL_00d9: 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) if ((!inSpecialAnimation && ((Object)(object)focusedThreatTransform == (Object)null || currentBehaviourStateIndex != 2) && peekTimer < 0f) || isEnemyDead) { agent.angularSpeed = 300f; ((RigConstraint<MultiAimConstraintJob, MultiAimConstraintData, MultiAimConstraintJobBinder<MultiAimConstraintData>>)(object)headLookRig).weight = Mathf.Lerp(((RigConstraint<MultiAimConstraintJob, MultiAimConstraintData, MultiAimConstraintJobBinder<MultiAimConstraintData>>)(object)headLookRig).weight, 0f, Time.deltaTime * 10f); return; } agent.angularSpeed = 0f; ((RigConstraint<MultiAimConstraintJob, MultiAimConstraintData, MultiAimConstraintJobBinder<MultiAimConstraintData>>)(object)headLookRig).weight = Mathf.Lerp(((RigConstraint<MultiAimConstraintJob, MultiAimConstraintData, MultiAimConstraintJobBinder<MultiAimConstraintData>>)(object)headLookRig).weight, 1f, Time.deltaTime * 10f); if (peekTimer >= 0f) { peekTimer -= Time.deltaTime; AnimateLooking(peekTarget); } else { AnimateLooking(lookTarget); } } public override void OnCollideWithPlayer(Collider other) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: 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_002f: Unknown result type (might be due to invalid IL or missing references) //IL_003a: 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) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0053: 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_0062: 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_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0073: 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_0082: 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_0088: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0098: 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_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0181: Unknown result type (might be due to invalid IL or missing references) base.OnCollideWithPlayer(other); if (timeSinceHitting < 0.5f) { return; } Vector3 val = Vector3.Normalize(((Component)this).transform.position + Vector3.up * 0.7f - (((Component)other).transform.position + Vector3.up * 0.4f)) * 0.5f; if (Physics.Linecast(((Component)this).transform.position + Vector3.up * 0.7f + val, ((Component)other).transform.position + Vector3.up * 0.4f, StartOfRound.Instance.collidersAndRoomMaskAndDefault, (QueryTriggerInteraction)1)) { return; } PlayerControllerB playerControllerB = MeetsStandardPlayerCollisionConditions(other, inSpecialAnimation || doingKillAnimation); if ((Object)(object)playerControllerB != (Object)null) { timeSinceHitting = 0f; playerControllerB.DamagePlayer(30); if (playerControllerB.isPlayerDead) { StabPlayerDeathAnimServerRpc((int)playerControllerB.playerClientId); return; } creatureAnimator.ResetTrigger("Hit"); creatureAnimator.SetTrigger("Hit"); creatureSFX.PlayOneShot(enemyType.audioClips[5]); WalkieTalkie.TransmitOneShotAudio(creatureSFX, enemyType.audioClips[5]); RoundManager.Instance.PlayAudibleNoise(((Component)creatureSFX).transform.position, 8f, 0.7f); } } public override void OnCollideWithEnemy(Collider other, EnemyAI enemyScript = null) { //IL_00b5: Unknown result type (might be due to invalid IL or missing references) base.OnCollideWithEnemy(other); if (!((Object)(object)enemyScript.enemyType == (Object)(object)enemyType) && !(timeSinceHitting < 0.75f) && ((NetworkBehaviour)this).IsOwner && enemyScript.enemyType.canDie) { timeSinceHitting = 0f; creatureAnimator.ResetTrigger("Hit"); creatureAnimator.SetTrigger("Hit"); creatureSFX.PlayOneShot(enemyType.audioClips[5]); WalkieTalkie.TransmitOneShotAudio(creatureSFX, enemyType.audioClips[5]); RoundManager.Instance.PlayAudibleNoise(((Component)creatureSFX).transform.position, 8f, 0.7f); enemyScript.HitEnemy(1, null, playHitSFX: true); } } public override void HitEnemy(int force = 1, PlayerControllerB playerWhoHit = null, bool playHitSFX = false) { base.HitEnemy(force, playerWhoHit, playHitSFX); if (isEnemyDead) { return; } creatureAnimator.SetTrigger("TakeDamage"); if ((Object)(object)playerWhoHit != (Object)null) { timeSinceBeingAttackedByPlayer = 0f; if (threats.TryGetValue(((Component)playerWhoHit).transform, out var value)) { value.hasAttacked = true; } } enemyHP -= force; if (((NetworkBehaviour)this).IsOwner && enemyHP <= 0 && !isEnemyDead) { KillEnemyOnOwnerClient(); } StopKillAnimation(); } public override void KillEnemy(bool destroy = false) { base.KillEnemy(destroy); creatureAnimator.SetBool("IsDead", true); if ((Object)(object)heldScrap != (Object)null && ((NetworkBehaviour)this).IsOwner) { DropHeldItemAndSync(); } StopKillAnimation(); } public void StopKillAnimation() { if (killAnimCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(killAnimCoroutine); } agent.acceleration = 17f; inSpecialAnimation = false; doingKillAnimation = false; if ((Object)(object)killAnimationBody != (Object)null) { killAnimationBody.attachedLimb = null; killAnimationBody.attachedTo = null; killAnimationBody = null; } } [ServerRpc(RequireOwnership = false)] public void StabPlayerDeathAnimServerRpc(int playerObject) { //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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2476579270u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, playerObject); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2476579270u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost) && !doingKillAnimation) { if (((NetworkBehaviour)this).IsOwner && (Object)(object)heldScrap != (Object)null) { DropHeldItemAndSync(); } doingKillAnimation = true; StabPlayerDeathAnimClientRpc(playerObject); } } [ClientRpc] public void StabPlayerDeathAnimClientRpc(int playerObject) { //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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3749667856u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, playerObject); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3749667856u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost)) { doingKillAnimation = true; inSpecialAnimation = true; agent.acceleration = 70f; agent.speed = 0f; if (killAnimCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(killAnimCoroutine); } killAnimCoroutine = ((MonoBehaviour)this).StartCoroutine(killPlayerAnimation(playerObject)); } } private IEnumerator killPlayerAnimation(int playerObject) { PlayerControllerB killedPlayer = StartOfRound.Instance.allPlayerScripts[playerObject]; creatureAnimator.ResetTrigger("KillAnimation"); creatureAnimator.SetTrigger("KillAnimation"); creatureVoice.PlayOneShot(enemyType.audioClips[4]); WalkieTalkie.TransmitOneShotAudio(creatureVoice, enemyType.audioClips[4]); float startTime = Time.realtimeSinceStartup; yield return (object)new WaitUntil((Func<bool>)(() => Time.realtimeSinceStartup - startTime > 1f || (Object)(object)killedPlayer.deadBody != (Object)null)); if ((Object)(object)killedPlayer.deadBody != (Object)null) { killAnimationBody = killedPlayer.deadBody; killAnimationBody.attachedLimb = killedPlayer.deadBody.bodyParts[5]; killAnimationBody.attachedTo = deadBodyPoint; killAnimationBody.matchPositionExactly = true; killAnimationBody.canBeGrabbedBackByPlayers = false; yield return (object)new WaitForSeconds(1.7f); killAnimationBody.attachedLimb = null; killAnimationBody.attachedTo = null; } agent.acceleration = 17f; inSpecialAnimation = false; doingKillAnimation = false; } private void InteractWithScrap() { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0076: 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) //IL_0085: 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_00b0: 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_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: 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_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)heldScrap != (Object)null) { focusedScrap = null; if (Vector3.Distance(((Component)this).transform.position, baboonCampPosition) < Random.Range(1f, 7f) || heldScrap.isHeld) { DropHeldItemAndSync(); } } else if ((Object)(object)focusedScrap != (Object)null) { if (debugEnemyAI) { Debug.DrawRay(((Component)focusedScrap).transform.position, Vector3.up * 3f, Color.yellow); } if (!CanGrabScrap(focusedScrap)) { focusedScrap = null; } else if (Vector3.Distance(((Component)this).transform.position, ((Component)focusedScrap).transform.position) < 0.4f && !Physics.Linecast(((Component)this).transform.position, ((Component)focusedScrap).transform.position + Vector3.up * 0.5f, StartOfRound.Instance.collidersAndRoomMaskAndDefault, (QueryTriggerInteraction)1)) { GrabItemAndSync(((NetworkBehaviour)focusedScrap).NetworkObject); } } } private bool CanGrabScrap(GrabbableObject scrap) { //IL_005c: 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) if (scrap.itemProperties.itemId == 1531) { return false; } if (scrap.isInShipRoom && !isInsidePlayerShip) { return false; } if (isEnemyDead) { return false; } if (!scrap.heldByPlayerOnServer && !scrap.isHeld && ((Object)(object)scrap == (Object)(object)heldScrap || !scrap.isHeldByEnemy)) { return Vector3.Distance(((Component)scrap).transform.position, baboonCampPosition) > 8f; } return false; } private void DropHeldItemAndSync() { //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_0076: 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) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)heldScrap == (Object)null) { Debug.LogError((object)$"Baboon #{thisEnemyIndex} Error: DropItemAndSync called when baboon has no scrap!"); } NetworkObject networkObject = ((NetworkBehaviour)heldScrap).NetworkObject; if ((Object)(object)networkObject == (Object)null) { Debug.LogError((object)$"Baboon #{thisEnemyIndex} Error: No network object in held scrap {((Object)((Component)heldScrap).gameObject).name}"); } Vector3 itemFloorPosition = heldScrap.GetItemFloorPosition(); DropScrap(networkObject, itemFloorPosition); DropScrapServerRpc(NetworkObjectReference.op_Implicit(networkObject), itemFloorPosition, (int)GameNetworkManager.Instance.localPlayerController.playerClientId); } [ServerRpc] public void DropScrapServerRpc(NetworkObjectReference item, Vector3 targetFloorPosition, int clientWhoSentRPC) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Invalid comparison between Unknown and I4 //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_0138: 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_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: 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) //IL_00f7: 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_0084: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(1418775270u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe<NetworkObjectReference>(ref item, default(ForNetworkSerializable)); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref targetFloorPosition); BytePacker.WriteValueBitPacked(val2, clientWhoSentRPC); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1418775270u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { DropScrapClientRpc(item, targetFloorPosition, clientWhoSentRPC); } } [ClientRpc] public void DropScrapClientRpc(NetworkObjectReference item, Vector3 targetFloorPosition, int clientWhoSentRPC) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: 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_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: 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 = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1865475504u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe<NetworkObjectReference>(ref item, default(ForNetworkSerializable)); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref targetFloorPosition); BytePacker.WriteValueBitPacked(val2, clientWhoSentRPC); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1865475504u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost) && clientWhoSentRPC != (int)GameNetworkManager.Instance.localPlayerController.playerClientId) { NetworkObject item2 = default(NetworkObject); if (((NetworkObjectReference)(ref item)).TryGet(ref item2, (NetworkManager)null)) { DropScrap(item2, targetFloorPosition); } else { Debug.LogError((object)$"Baboon #{thisEnemyIndex}; Error, was not able to get network object from dropped item client rpc"); } } } private void DropScrap(NetworkObject item, Vector3 targetFloorPosition) { //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: 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_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)heldScrap == (Object)null) { Debug.LogError((object)"Baboon: my held item is null when attempting to drop it!!"); return; } if (heldScrap.isHeld) { heldScrap.DiscardItemFromEnemy(); heldScrap.isHeldByEnemy = false; heldScrap = null; Debug.Log((object)$"Baboon #{thisEnemyIndex}: Dropped item which was held by a player"); return; } heldScrap.parentObject = null; ((Component)heldScrap).transform.SetParent(StartOfRound.Instance.propsContainer, true); heldScrap.EnablePhysics(enable: true); heldScrap.fallTime = 0f; heldScrap.startFallingPosition = ((Component)heldScrap).transform.parent.InverseTransformPoint(((Component)heldScrap).transform.position); heldScrap.targetFloorPosition = ((Component)heldScrap).transform.parent.InverseTransformPoint(targetFloorPosition); heldScrap.floorYRot = -1; heldScrap.DiscardItemFromEnemy(); heldScrap.isHeldByEnemy = false; heldScrap = null; Debug.Log((object)$"Baboon #{thisEnemyIndex}: Dropped item"); } private void GrabItemAndSync(NetworkObject item) { //IL_0031: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)heldScrap != (Object)null) { Debug.LogError((object)$"Baboon #{thisEnemyIndex} Error: GrabItemAndSync called when baboon is already carrying scrap!"); } GrabScrap(item); GrabScrapServerRpc(NetworkObjectReference.op_Implicit(item), (int)GameNetworkManager.Instance.localPlayerController.playerClientId); } [ServerRpc] public void GrabScrapServerRpc(NetworkObjectReference item, int clientWhoSentRPC) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Invalid comparison between Unknown and I4 //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: 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_0084: Invalid comparison between Unknown and I4 //IL_016b: 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)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(869682226u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe<NetworkObjectReference>(ref item, default(ForNetworkSerializable)); BytePacker.WriteValueBitPacked(val2, clientWhoSentRPC); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 869682226u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { NetworkObject val3 = default(NetworkObject); if (!((NetworkObjectReference)(ref item)).TryGet(ref val3, (NetworkManager)null)) { Debug.LogError((object)$"Baboon #{thisEnemyIndex} error: Could not get grabbed network object from reference on server"); } else if (Object.op_Implicit((Object)(object)((Component)val3).GetComponent<GrabbableObject>()) && !((Component)val3).GetComponent<GrabbableObject>().heldByPlayerOnServer) { GrabScrapClientRpc(item, clientWhoSentRPC); } } } [ClientRpc] public void GrabScrapClientRpc(NetworkObjectReference item, int clientWhoSentRPC) { //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_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_008c: 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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1564051222u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe<NetworkObjectReference>(ref item, default(ForNetworkSerializable)); BytePacker.WriteValueBitPacked(val2, clientWhoSentRPC); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1564051222u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost) && clientWhoSentRPC != (int)GameNetworkManager.Instance.localPlayerController.playerClientId) { NetworkObject item2 = default(NetworkObject); if (((NetworkObjectReference)(ref item)).TryGet(ref item2, (NetworkManager)null)) { GrabScrap(item2); } else { Debug.LogError((object)$"Baboon #{thisEnemyIndex}; Error, was not able to get id from grabbed item client rpc"); } } } private void GrabScrap(NetworkObject item) { //IL_0077: 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_007e: Unknown result type (might be due to invalid IL or missing references) Debug.Log((object)$"held item null: {(Object)(object)heldScrap == (Object)null}"); if ((Object)(object)heldScrap != (Object)null) { Debug.Log((object)$"Baboon #{thisEnemyIndex}: Trying to grab another item ({((Object)((Component)item).gameObject).name}) while hands are already full with item ({((Object)((Component)heldScrap).gameObject).name}). Dropping the currently held one."); DropScrap(((Component)heldScrap).GetComponent<NetworkObject>(), heldScrap.GetItemFloorPosition()); } GrabbableObject grabbableObject = (heldScrap = ((Component)item).gameObject.GetComponent<GrabbableObject>()); grabbableObject.parentObject = grabTarget; grabbableObject.hasHitGround = false; grabbableObject.GrabItemFromEnemy(); grabbableObject.isHeldByEnemy = true; grabbableObject.EnablePhysics(enable: false); Debug.Log((object)$"Baboon #{thisEnemyIndex}: Grabbing item!!! {((Object)((Component)heldScrap).gameObject).name}"); } public override void ReachedNodeInSearch() { base.ReachedNodeInSearch(); if (currentSearch.nodesEliminatedInCurrentSearch > 14 && timeSinceRestWhileScouting > 17f && timeSinceAggressiveDisplay > 6f) { timeSinceRestWhileScouting = 0f; restingDuringScouting = 12f; } } public override void DoAIInterval() { //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Unknown result type (might be due to invalid IL or missing references) //IL_05d2: Unknown result type (might be due to invalid IL or missing references) //IL_05c3: Unknown result type (might be due to invalid IL or missing references) //IL_05e4: Unknown result type (might be due to invalid IL or missing references) //IL_05e9: Unknown result type (might be due to invalid IL or missing references) //IL_07b7: Unknown result type (might be due to invalid IL or missing references) //IL_07c2: Unknown result type (might be due to invalid IL or missing references) //IL_02c8: Unknown result type (might be due to invalid IL or missing references) //IL_0389: Unknown result type (might be due to invalid IL or missing references) //IL_039e: Unknown result type (might be due to invalid IL or missing references) //IL_03f9: Unknown result type (might be due to invalid IL or missing references) //IL_040e: Unknown result type (might be due to invalid IL or missing references) //IL_03c0: Unknown result type (might be due to invalid IL or missing references) //IL_049a: Unknown result type (might be due to invalid IL or missing references) //IL_04af: Unknown result type (might be due to invalid IL or missing references) //IL_04e4: Unknown result type (might be due to invalid IL or missing references) //IL_04f3: Unknown result type (might be due to invalid IL or missing references) //IL_04f8: Unknown result type (might be due to invalid IL or missing references) //IL_0a76: Unknown result type (might be due to invalid IL or missing references) //IL_0a86: Unknown result type (might be due to invalid IL or missing references) //IL_0a90: Unknown result type (might be due to invalid IL or missing references) //IL_0a95: Unknown result type (might be due to invalid IL or missing references) //IL_0a9a: Unknown result type (might be due to invalid IL or missing references) //IL_0a9c: Unknown result type (might be due to invalid IL or missing references) //IL_0a9e: Unknown result type (might be due to invalid IL or missing references) //IL_0aa8: Unknown result type (might be due to invalid IL or missing references) //IL_0aad: Unknown result type (might be due to invalid IL or missing references) //IL_0ac5: Unknown result type (might be due to invalid IL or missing references) //IL_0aca: Unknown result type (might be due to invalid IL or missing references) //IL_0ad4: Unknown result type (might be due to invalid IL or missing references) //IL_0ad9: Unknown result type (might be due to invalid IL or missing references) //IL_0ae4: Unknown result type (might be due to invalid IL or missing references) //IL_0ae9: Unknown result type (might be due to invalid IL or missing references) //IL_0af3: Unknown result type (might be due to invalid IL or missing references) //IL_0af8: Unknown result type (might be due to invalid IL or missing references) //IL_0afd: Unknown result type (might be due to invalid IL or missing references) //IL_0aff: Unknown result type (might be due to invalid IL or missing references) //IL_0b09: Unknown result type (might be due to invalid IL or missing references) //IL_0b0e: Unknown result type (might be due to invalid IL or missing references) //IL_0b18: Unknown result type (might be due to invalid IL or missing references) //IL_0921: Unknown result type (might be due to invalid IL or missing references) //IL_0931: Unknown result type (might be due to invalid IL or missing references) //IL_093b: Unknown result type (might be due to invalid IL or missing references) //IL_0940: Unknown result type (might be due to invalid IL or missing references) //IL_0945: Unknown result type (might be due to invalid IL or missing references) //IL_0947: Unknown result type (might be due to invalid IL or missing references) //IL_0949: Unknown result type (might be due to invalid IL or missing references) //IL_0953: Unknown result type (might be due to invalid IL or missing references) //IL_0958: Unknown result type (might be due to invalid IL or missing references) //IL_0969: Unknown result type (might be due to invalid IL or missing references) //IL_0b60: Unknown result type (might be due to invalid IL or missing references) //IL_0b6a: Unknown result type (might be due to invalid IL or missing references) //IL_0b75: Unknown result type (might be due to invalid IL or missing references) //IL_0b7a: Unknown result type (might be due to invalid IL or missing references) //IL_0b38: Unknown result type (might be due to invalid IL or missing references) //IL_0b42: Unknown result type (might be due to invalid IL or missing references) //IL_0b4d: Unknown result type (might be due to invalid IL or missing references) //IL_0b52: Unknown result type (might be due to invalid IL or missing references) //IL_0a61: Unknown result type (might be due to invalid IL or missing references) //IL_0b7c: Unknown result type (might be due to invalid IL or missing references) //IL_0b7e: Unknown result type (might be due to invalid IL or missing references) //IL_0b83: Unknown result type (might be due to invalid IL or missing references) //IL_0b98: Unknown result type (might be due to invalid IL or missing references) //IL_0bbc: Unknown result type (might be due to invalid IL or missing references) //IL_0bce: Unknown result type (might be due to invalid IL or missing references) //IL_0bd0: Unknown result type (might be due to invalid IL or missing references) //IL_0ba3: Unknown result type (might be due to invalid IL or missing references) //IL_0ba5: Unknown result type (might be due to invalid IL or missing references) base.DoAIInterval(); if (isEnemyDead) { agent.speed = 0f; if (scoutingSearchRoutine.inProgress) { StopSearch(scoutingSearchRoutine, clear: false); } return; } if (stunNormalizedTimer > 0f || miscAnimationTimer > 0f) { agent.speed = 0f; if ((Object)(object)heldScrap != (Object)null && ((NetworkBehaviour)this).IsOwner) { DropHeldItemAndSync(); } if ((Object)(object)stunnedByPlayer != (Object)null) { PingBaboonInterest(((Component)stunnedByPlayer.gameplayCamera).transform.position, 4); } } if (inSpecialAnimation) { agent.speed = 0f; return; } if (!eyesClosed) { DoLOSCheck(); } InteractWithScrap(); switch (currentBehaviourStateIndex) { case 0: if (previousBehaviourState != currentBehaviourStateIndex) { timeToScout = Random.Range(25, 70); scoutTimer = 0f; Debug.Log((object)$"Baboon #{thisEnemyIndex} changed to state 0; set time to scout: {timeToScout}"); restingAtCamp = false; restAtCampTimer = 0f; SetAggressiveMode(0); previousBehaviourState = currentBehaviourStateIndex; } if (!((NetworkBehaviour)this).IsOwner) { break; } if ((Object)(object)focusedScrap != (Object)null) { SetDestinationToPosition(((Component)focusedScrap).transform.position); } if (scoutingGroup == null || (Object)(object)scoutingGroup.leader == (Object)(object)this || !scoutingGroup.members.Contains(this)) { Debug.Log((object)$"{((Object)((Component)this).gameObject).name}: scouting group null?: {scoutingGroup == null};"); if (scoutingGroup != null) { Debug.Log((object)$"Scouting group not null. Leader: {((Object)((Component)scoutingGroup.leader).gameObject).name}; members contains this: {!scoutingGroup.members.Contains(this)}"); } if (restingDuringScouting >= 0f) { if (scoutingSearchRoutine.inProgress) { StopSearch(scoutingSearchRoutine, clear: false); } if (!creatureAnimator.GetBool("sit")) { EnemyEnterRestModeServerRpc(sleep: false, atCamp: false); } creatureAnimator.SetBool("sit", true); restingDuringScouting -= AIIntervalTime; agent.speed = 0f; } else { if (!scoutingSearchRoutine.inProgress && (Object)(object)focusedScrap == (Object)null) { StartSearch(baboonCampPosition, scoutingSearchRoutine); } if (creatureAnimator.GetBool("sit")) { EnemyGetUpServerRpc(); creatureAnimator.SetBool("sit", false); } agent.speed = 10f; } } else { if (scoutingSearchRoutine.inProgress) { Debug.Log((object)$"Baboon #{thisEnemyIndex} joined a group; Stopping scouting."); StopSearch(scoutingSearchRoutine); } if (creatureAnimator.GetBool("sit")) { EnemyGetUpServerRpc(); creatureAnimator.SetBool("sit", false); } agent.speed = 12f; if (Vector3.Distance(((Component)this).transform.position, ((Component)scoutingGroup.leader).transform.position) > 60f || PathIsIntersectedByLineOfSight(((Component)scoutingGroup.leader).transform.position, calculatePathDistance: false, avoidLineOfSight: false)) { Debug.Log((object)$"Baboon #{thisEnemyIndex} leaving group with leader {scoutingGroup.leader.thisEnemyIndex}; distance: {Vector3.Distance(((Component)this).transform.position, ((Component)scoutingGroup.leader).transform.position)}"); LeaveCurrentScoutingGroup(sync: true); } else { Debug.Log((object)$"Baboon #{thisEnemyIndex}: following leader. {scoutingGroup == null}; {(Object)(object)scoutingGroup.leader == (Object)(object)this}; {scoutingGroup.members.Contains(this)}"); if (Vector3.Distance(destination, ((Component)scoutingGroup.leader).transform.position) > 8f && (Object)(object)focusedScrap == (Object)null) { SetDestinationToPosition(RoundManager.Instance.GetRandomNavMeshPositionInRadiusSpherical(((Component)scoutingGroup.leader).transform.position, 6f, RoundManager.Instance.navHit)); } } } if (scoutTimer < timeToScout && (Object)(object)heldScrap == (Object)null) { scoutTimer += AIIntervalTime; } else { SwitchToBehaviourState(1); } break; case 1: if (previousBehaviourState != currentBehaviourStateIndex) { restingDuringScouting = 0f; scoutTimer = 0f; chosenDistanceToCamp = Random.Range(1f, 7f); LeaveCurrentScoutingGroup(sync: true); SetAggressiveMode(0); previousBehaviourState = currentBehaviourStateIndex; } if (scoutingSearchRoutine.inProgress) { StopSearch(scoutingSearchRoutine); } if ((Object)(object)focusedScrap != (Object)null) { SetDestinationToPosition(((Component)focusedScrap).transform.position); } else { SetDestinationToPosition(baboonCampPosition); } if (Vector3.Distance(((Component)this).transform.position, baboonCampPosition) < chosenDistanceToCamp && peekTimer < 0f) { if (!restingAtCamp) { restingAtCamp = true; restAtCampTimer = Random.Range(15f, 30f); if ((Object)(object)heldScrap != (Object)null) { DropHeldItemAndSync(); } bool sleep = false; if (Random.Range(0, 100) < 35) { sleep = true; } EnemyEnterRestModeServerRpc(sleep, atCamp: true); } else if (restAtCampTimer <= 0f) { SwitchToBehaviourState(0); } else { restAtCampTimer -= AIIntervalTime; } agent.speed = 0f; } else { if (restingAtCamp) { restingAtCamp = false; EnemyGetUpServerRpc(); } creatureAnimator.SetBool("sit", false); creatureAnimator.SetBool("sleep", false); agent.speed = 9f; } break; case 2: { if (previousBehaviourState != currentBehaviourStateIndex) { timeSpentFocusingOnThreat = 0f; creatureAnimator.SetBool("sleep", false); creatureAnimator.SetBool("sit", false); EnemyGetUpServerRpc(); previousBehaviourState = currentBehaviourStateIndex; } if (focusedThreat == null || !focusingOnThreat) { StopFocusingThreat(); } if (scoutingSearchRoutine.inProgress) { StopSearch(scoutingSearchRoutine, clear: false); } agent.speed = 9f; float num = fearLevelNoDistComparison * 2f; if (focusedThreat.interestLevel <= 0 || enemyHP <= 3) { num = Mathf.Max(num, 1f); } float num2 = GetComfortableDistanceToThreat(focusedThreat) + num; float num3 = Vector3.Distance(((Component)this).transform.position, focusedThreat.lastSeenPosition); bool flag = false; float num4 = Time.realtimeSinceStartup - focusedThreat.timeLastSeen; if (num4 > 5f) { SetThreatInView(inView: false); focusLevel = 0; StopFocusingThreat(); break; } if (num4 > 3f) { SetThreatInView(inView: false); focusLevel = 1; if (num2 - num3 > 2f) { StopFocusingThreat(); break; } } else if (num4 > 1f) { flag = true; focusedThreatIsInView = false; SetThreatInView(inView: false); focusLevel = 2; SetAggressiveMode(0); } else if (num4 < 0.55f) { flag = true; SetThreatInView(inView: true); } bool flag2 = fearLevel > 0f || focusedThreat.interestLevel > 0 || fearLevel < -6f || focusedThreat.hasAttacked; if (aggressiveMode == 2) { focusLevel = 3; if ((Object)(object)heldScrap != (Object)null) { DropHeldItemAndSync(); focusedScrap = heldScrap; } Debug.Log((object)("Baboon: Entered fight mode with threat '" + ((Object)focusedThreat.threatScript.GetThreatTransform()).name + "'")); Debug.Log((object)$"Fight timer: {fightTimer}"); Vector3 val = focusedThreat.threatScript.GetThreatTransform().position + focusedThreat.threatScript.GetThreatVelocity() * 10f; Debug.DrawRay(val, Vector3.up * 5f, Color.red, AIIntervalTime); SetDestinationToPosition(val, checkForPath: true); if (fightTimer > 4f || timeSinceBeingAttackedByPlayer < 4f || (fightTimer > 2f && (fearLevel >= 1f || !flag2)) || (enemyHP <= 3 && !flag2)) { scoutTimer = timeToScout - 20f; fightTimer = -7f; SetAggressiveMode(1); } else if (num3 > 4f) { fightTimer += AIIntervalTime * 2f; } else if (num3 > 1f) { fightTimer += AIIntervalTime; } else { fightTimer += AIIntervalTime / 2f; } break; } bool flag3 = false; if ((Object)(object)focusedScrap != (Object)null && (!flag || fearLevel <= 0f)) { SetDestinationToPosition(((Component)focusedScrap).transform.position); flag3 = true; } Vector3 val2 = focusedThreat.lastSeenPosition + focusedThreat.threatScript.GetThreatVelocity() * -17f; Debug.DrawRay(val2, Vector3.up * 3f, Color.red, AIIntervalTime); Ray val3 = default(Ray); ((Ray)(ref val3))..ctor(((Component)this).transform.position + Vector3.up * 0.5f, Vector3.Normalize((((Component)this).transform.position + Vector3.up * 0.5f - val2) * 100f)); RaycastHit val4 = default(RaycastHit); Vector3 val5 = ((!Physics.Raycast(val3, ref val4, num2 - num3, StartOfRound.Instance.collidersAndRoomMaskAndDefault, (QueryTriggerInteraction)1)) ? RoundManager.Instance.GetNavMeshPosition(((Ray)(ref val3)).GetPoint(num2 - num3), RoundManager.Instance.navHit, 8f) : RoundManager.Instance.GetNavMeshPosition(((RaycastHit)(ref val4)).point, RoundManager.Instance.navHit, 8f)); Debug.DrawRay(val5, Vector3.up, Color.blue, AIIntervalTime); if (!flag3) { if (SetDestinationToPosition(val5, checkForPath: true)) { debugSphere = val5; } else { Debug.Log((object)$"Baboon #{thisEnemyIndex}: Could not get path to avoidance position at {val5}"); debugSphere = val5; } } if (fightTimer > 7f && timeSinceFighting > 4f) { fightTimer = -6f; SetAggressiveMode(2); break; } bool flag4 = false; if (scoutingGroup != null) { for (int i = 0; i < scoutingGroup.members.Count; i++) { if (scoutingGroup.members[i].aggressiveMode == 2) { flag4 = true; } } } float num5 = GetComfortableDistanceToThreat(focusedThreat) - num3; if (fearLevel < -5f && flag2) { if (noiseTimer >= noiseInterval) { noiseInterval = Random.Range(0.2f, 0.7f); noiseTimer = 0f; RoundManager.PlayRandomClip(creatureVoice, cawLaughSFX, randomize: true, 1f, 1105); } else { noiseTimer += Time.deltaTime; } } if ((flag && ((num5 > 8f && flag2) || num3 < 5f)) || timeSinceBeingAttackedByPlayer < 2.5f) { if (timeSinceFighting > 5f) { fightTimer += AIIntervalTime * 10.6f / (focusedThreat.distanceToThreat * 0.3f); } SetAggressiveMode(1); } else if (num5 > 4f && fearLevel < 3f && flag2) { fightTimer += AIIntervalTime * 7.4f / (focusedThreat.distanceToThreat * 0.3f); SetAggressiveMode(1); } else { if (!(num5 < 2f)) { break; } if (timeSinceAggressiveDisplay > 2.5f) { SetAggressiveMode(0); } fightTimer -= Mathf.Max(-6f, AIIntervalTime * 0.2f); if (timeSpentFocusingOnThreat > 4f + (float)focusedThreat.interestLevel * 8f && !flag4) { if (fightTimer > 4f) { fightTimer -= Mathf.Max(-6f, AIIntervalTime * 0.5f * (focusedThreat.distanceToThreat * 0.1f)); } else { StopFocusingThreat(); } } } break; } } } private void StopFocusingThreat() { if (currentBehaviourStateIndex == 2) { Debug.Log((object)$"Stopped focusing on threat '{focusedThreat.threatScript.GetThreatTransform()}'"); aggressiveMode = 0; focusingOnThreat = false; focusedThreatIsInView = false; focusedThreatTransform = null; focusedThreat = null; if ((Object)(object)heldScrap == (Object)null) { SwitchToBehaviourStateOnLocalClient(0); } else { SwitchToBehaviourStateOnLocalClient(1); } StopFocusingThreatServerRpc((Object)(object)heldScrap == (Object)null); } } [ServerRpc] public void StopFocusingThreatServerRpc(bool enterScoutingMode) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Invalid comparison between Unknown and I4 //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: 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_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(1546030380u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref enterScoutingMode, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1546030380u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { StopFocusingThreatClientRpc(enterScoutingMode); } } [ClientRpc] public void StopFocusingThreatClientRpc(bool enterScoutingMode) { //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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3360048400u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref enterScoutingMode, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3360048400u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost) && !((NetworkBehaviour)this).IsOwner) { aggressiveMode = 0; focusedThreatTransform = null; focusedThreat = null; if (enterScoutingMode) { SwitchToBehaviourStateOnLocalClient(0); } else { SwitchToBehaviourStateOnLocalClient(1); } } } private void SetAggressiveMode(int mode) { if (aggressiveMode != mode) { if (mode == 2) { Debug.Log((object)"Baboon entering fight mode (aggressive mode 2)"); } aggressiveMode = mode; SetAggressiveModeServerRpc(mode); } } [ServerRpc] public void SetAggressiveModeServerRpc(int mode) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Invalid comparison between Unknown and I4 //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: 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_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(443869275u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, mode); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 443869275u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { SetAggressiveModeClientRpc(mode); } } [ClientRpc] public void SetAggressiveModeClientRpc(int mode) { //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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1782649174u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, mode); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1782649174u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost) && !((NetworkBehaviour)this).IsOwner) { aggressiveMode = mode; } } } private void SetThreatInView(bool inView) { if (focusedThreatIsInView != inView) { focusedThreatIsInView = inView; SetThreatInViewServerRpc(inView); } } [ServerRpc] public void SetThreatInViewServerRpc(bool inView) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Invalid comparison between Unknown and I4 //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: 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_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3428942850u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref inView, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3428942850u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { SetThreatInViewClientRpc(inView); } } [ClientRpc] public void SetThreatInViewClientRpc(bool inView) { //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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2073937320u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref inView, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2073937320u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost) && !((NetworkBehaviour)this).IsOwner) { focusedThreatIsInView = inView; } } } [ServerRpc] public void EnemyEnterRestModeServerRpc(bool sleep, bool atCamp) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Invalid comparison between Unknown and I4 //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: 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_0084: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(1806580287u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref sleep, default(ForPrimitives)); ((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref atCamp, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1806580287u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { EnemyEnterRestModeClientRpc(sleep, atCamp); } } [ClientRpc] public void EnemyEnterRestModeClientRpc(bool sleep, bool atCamp) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: 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_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009e: 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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1567928363u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref sleep, default(ForPrimitives)); ((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref atCamp, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1567928363u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost)) { restingAtCamp = atCamp; if (sleep) { eyesClosed = true; creatureAnimator.SetBool("sleep", true); creatureAnimator.SetBool("sit", false); } else { eyesClosed = false; creatureAnimator.SetBool("sleep", false); creatureAnimator.SetBool("sit", true); } } } [ServerRpc] public void EnemyGetUpServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Invalid comparison between Unknown and I4 //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: 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_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3614203845u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3614203845u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { EnemyGetUpClientRpc(); } } [ClientRpc] public void EnemyGetUpClientRpc() { //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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1155909339u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1155909339u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost) && !((NetworkBehaviour)this).IsOwner) { creatureAnimator.SetBool("sit", false); } } } public override void OnDrawGizmos() { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: 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) //IL_002e: 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_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: 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_00d8: 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_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: 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_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) if (!debugEnemyAI) { return; } if (currentBehaviourStateIndex == 1) { Gizmos.DrawCube(((Component)this).transform.position + Vector3.up * 2f, new Vector3(0.2f, 0.2f, 0.2f)); } else if (scoutingGroup != null) { if ((Object)(object)scoutingGroup.leader == (Object)(object)this) { Gizmos.DrawSphere(((Component)this).transform.position + Vector3.up * 2f, 0.6f); return; } Gizmos.DrawLine(((Component)scoutingGroup.leader).transform.position + Vector3.up * 2f, ((Component)this).transform.position + Vector3.up * 2f); Gizmos.DrawSphere(((Component)this).transform.position + Vector3.up * 2f, 0.1f); } } public override void DetectNoise(Vector3 noisePosition, float noiseLoudness, int timesPlayedInOneSpot = 0, int noiseID = 0) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //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) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0038: 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_006e: 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) if (!((NetworkBehaviour)this).IsOwner || isEnemyDead) { return; } base.DetectNoise(noisePosition, noiseLoudness, timesPlayedInOneSpot, noiseID); if (Vector3.Distance(noisePosition, ((Component)this).transform.position + Vector3.up * 0.4f) < 0.75f || noiseID == 1105 || noiseID == 24751) { return; } Debug.Log((object)"Detected noise"); float num = Vector3.Distance(noisePosition, ((Component)this).transform.position); float num2 = noiseLoudness / num; Debug.Log((object)$"noise relative loudness: {noiseLoudness / num}"); if (eyesClosed) { num2 *= 0.75f; } if (num2 < 0.12f && peekTimer >= 0f && focusLevel > 0) { return; } if (focusLevel >= 3) { if (num > 3f || num2 <= 0.06f) { return; } } else if (focusLevel == 2) { if (num > 25f || num2 <= 0.05f) { return; } } else if (focusLevel == 1 && (num > 40f || num2 <= 0.05f)) { return; } PingBaboonInterest(noisePosition, focusLevel); } private void AnimateLooking(Vector3 lookAtPosition) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001d: 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) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_003b: 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_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005c: 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_0085: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: 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_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) headLookTarget.position = Vector3.Lerp(headLookTarget.position, lookAtPosition, 15f * Time.deltaTime); Vector3 position = headLookTarget.position; position.y = ((Component)this).transform.position.y; if (Vector3.Angle(((Component)this).transform.forward, position - ((Component)this).transform.position) > 30f) { RoundManager.Instance.tempTransform.position = ((Component)this).transform.position; RoundManager.Instance.tempTransform.LookAt(position); ((Component)this).transform.rotation = Quaternion.Lerp(((Component)this).transform.rotation, RoundManager.Instance.tempTransform.rotation, 4f * Time.deltaTime); ((Component)this).transform.eulerAngles = new Vector3(0f, ((Component)this).transform.eulerAngles.y, 0f); } } public override void Update() { //IL_0525: Unknown result type (might be due to invalid IL or missing references) //IL_052a: Unknown result type (might be due to invalid IL or missing references) base.Update(); if (isEnemyDead) { return; } timeSinceHitting += Time.deltaTime; if (stunNormalizedTimer > 0f || miscAnimationTimer > 0f) { agent.speed = 0f; } creatureAnimator.SetBool("stunned", stunNormalizedTimer > 0f); if (miscAnimationTimer <= 0f) { currentMiscAnimation = -1; } else { miscAnimationTimer -= Time.deltaTime; } CalculateAnimationDirection(2f); timeSinceLastMiscAnimation += Time.deltaTime; timeSincePingingBirdInterest += Time.deltaTime; timeSinceBeingAttackedByPlayer += Time.deltaTime; timeSinceJoiningOrLeavingScoutingGroup += Time.deltaTime; if (debugEnemyAI) { if (focusedThreat != null && focusingOnThreat) { HUDManager.Instance.SetDebugText(string.Format("{0}; {1}; \n Focused threat level: {2}", fearLevel.ToString("0.0"), fearLevelNoDistComparison.ToString("0.0"), focusedThreat.threatLevel)); } else { HUDManager.Instance.SetDebugText(fearLevel.ToString("0.0") + "; " + fearLevelNoDistComparison.ToString("0.0")); } } if ((Object)(object)heldScrap != (Object)null && !isEnemyDead) { creatureAnimator.SetLayerWeight(1, Mathf.Lerp(creatureAnimator.GetLayerWeight(1), 1f, 12f * Time.deltaTime)); ((RigConstraint<TwoBoneIKConstraintJob, TwoBoneIKConstraintData, TwoBoneIKConstraintJobBinder<TwoBoneIKConstraintData>>)(object)rightArmRig).weight = Mathf.Lerp(((RigConstraint<TwoBoneIKConstraintJob, TwoBoneIKConstraintData, TwoBoneIKConstraintJobBinder<TwoBoneIKConstraintData>>)(object)rightArmRig).weight, 0f, 12f * Time.deltaTime); ((RigConstraint<TwoBoneIKConstraintJob, TwoBoneIKConstraintData, TwoBoneIKConstraintJobBinder<TwoBoneIKConstraintData>>)(object)leftArmRig).weight = Mathf.Lerp(((RigConstraint<TwoBoneIKConstraintJob, TwoBoneIKConstraintData, TwoBoneIKConstraintJobBinder<TwoBoneIKConstraintData>>)(object)leftArmRig).weight, 0f, 12f * Time.deltaTime); } else { creatureAnimator.SetLayerWeight(1, Mathf.Lerp(creatureAnimator.GetLayerWeight(1), 0f, 12f * Time.deltaTime)); ((RigConstraint<TwoBoneIKConstraintJob, TwoBoneIKConstraintData, TwoBoneIKConstraintJobBinder<TwoBoneIKConstraintData>>)(object)rightArmRig).weight = Mathf.Lerp(((RigConstraint<TwoBoneIKConstraintJob, TwoBoneIKConstraintData, TwoBoneIKConstraintJobBinder<TwoBoneIKConstraintData>>)(object)rightArmRig).weight, 1f, 12f * Time.deltaTime); ((RigConstraint<TwoBoneIKConstraintJob, TwoBoneIKConstraintData, TwoBoneIKConstraintJobBinder<TwoBoneIKConstraintData>>)(object)leftArmRig).weight = Mathf.Lerp(((RigConstraint<TwoBoneIKConstraintJob, TwoBoneIKConstraintData, TwoBoneIKConstraintJobBinder<TwoBoneIKConstraintData>>)(object)leftArmRig).weight, 1f, 12f * Time.deltaTime); } switch (aggressiveMode) { case 0: if (previousAggressiveMode != aggressiveMode) { creatureAnimator.SetBool("aggressiveDisplay", false); creatureAnimator.SetBool("fighting", false); previousAggressiveMode = aggressiveMode; } if (aggressionAudio.volume <= 0f) { aggressionAudio.Stop(); } else { aggressionAudio.volume = Mathf.Max(aggressionAudio.volume - Time.deltaTime * 5f, 0f); } timeSinceAggressiveDisplay = 0f; break; case 1: if (previousAggressiveMode != aggressiveMode) { creatureAnimator.SetBool("aggressiveDisplay", true); creatureAnimator.SetBool("fighting", false); RoundManager.PlayRandomClip(creatureVoice, cawScreamSFX, randomize: true, 1f, 1105); WalkieTalkie.TransmitOneShotAudio(creatureVoice, enemyType.audioClips[1]); aggressionAudio.clip = enemyType.audioClips[2]; aggressionAudio.Play(); previousAggressiveMode = aggressiveMode; } timeSinceAggressiveDisplay += Time.deltaTime; aggressionAudio.volume = Mathf.Min(aggressionAudio.volume + Time.deltaTime * 4f, 1f); break; case 2: if (previousAggressiveMode != aggressiveMode) { creatureAnimator.SetBool("fighting", true); aggressionAudio.clip = enemyType.audioClips[3]; aggressionAudio.Play(); previousAggressiveMode = aggressiveMode; } timeSinceAggressiveDisplay += Time.deltaTime; aggressionAudio.volume = Mathf.Min(aggressionAudio.volume + Time.deltaTime * 5f, 1f); break; } switch (currentBehaviourStateIndex) { case 0: creatureAnimator.SetBool("sleep", false); restingAtCamp = false; eyesClosed = false; focusedThreatTransform = null; break; case 1: focusedThreatTransform = null; break; case 2: if ((Object)(object)focusedThreatTransform != (Object)null && focusedThreatIsInView) { lookTarget = focusedThreatTransform.position; } timeSpentFocusingOnThreat += Time.deltaTime; timeSinceFighting += Time.deltaTime; break; } } private float GetComfortableDistanceToThreat(Threat focusedThreat) { return Mathf.Min((float)focusedThreat.threatLevel * 6f, 25f); } private void ReactToThreat(Threat closestThreat) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) if (Vector3.Distance(closestThreat.lastSeenPosition, baboonCampPosition) < 18f) { closestThreat.interestLevel++; } if (closestThreat != focusedThreat && (focusedThreat == null || focusedThreat.threatLevel <= closestThreat.threatLevel) && closestThreat.distanceToThreat < GetComfortableDistanceToThreat(closestThreat)) { Transform threatTransform = closestThreat.threatScript.GetThreatTransform(); NetworkObject component = ((Component)threatTransform).gameObject.GetComponent<NetworkObject>(); if ((Object)(object)component == (Object)null) { Debug.LogError((object)"Baboon: Error, threat did not contain network object. All objects implementing IVisibleThreat must have a NetworkObject"); return; } Debug.Log((object)("Focusing on new threat: '" + ((Object)threatTransform).name + "'")); fightTimer = 0f; focusingOnThreat = true; StartFocusOnThreatServerRpc(NetworkObjectReference.op_Implicit(component)); focusedThreat = closestThreat; focusedThreatTransform = closestThreat.threatScript.GetThreatLookTransform(); } } [ServerRpc] public void StartFocusOnThreatServerRpc(NetworkObjectReference netObject) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Invalid comparison between Unknown and I4 //IL_011d: 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_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result
BepInEx/plugins/TheBeeTeam-PersistentPurchases/PersistentPurchases.dll
Decompiled a year agousing System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Reflection; using System.Reflection.Emit; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using HarmonyLib; using Microsoft.CodeAnalysis; using PersistentPurchases; using Unity.Netcode; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("PersistentPurchases")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyDescription("Bought cosmetics never leave you")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+9b0b3632fd7c37c882fe0f1421c863585ff320ae")] [assembly: AssemblyProduct("PersistentPurchases")] [assembly: AssemblyTitle("PersistentPurchases")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.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 Patches { [HarmonyPrefix] [HarmonyPatch(typeof(GameNetworkManager), "ResetUnlockablesListValues")] public static bool dontResetAnything() { //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)StartOfRound.Instance != (Object)null) { Debug.Log((object)"CONDITIONALLY resetting unlockables list!"); List<UnlockableItem> unlockables = StartOfRound.Instance.unlockablesList.unlockables; for (int i = 0; i < unlockables.Count; i++) { if (Plugin.shouldReset(i, "dontResetAnything")) { Plugin.log.LogInfo((object)("Resetting " + unlockables[i].unlockableName)); unlockables[i].hasBeenUnlockedByPlayer = false; if (unlockables[i].unlockableType == 1) { unlockables[i].placedPosition = Vector3.zero; unlockables[i].placedRotation = Vector3.zero; unlockables[i].hasBeenMoved = false; unlockables[i].inStorage = false; } } } } return false; } [HarmonyPostfix] [HarmonyPatch(typeof(GameNetworkManager), "ResetSavedGameValues")] public static void okayMaybeDoALittleResetting() { if (!ES3.KeyExists("UnlockedShipObjects", GameNetworkManager.Instance.currentSaveFileName)) { return; } int[] source = ES3.Load<int[]>("UnlockedShipObjects", GameNetworkManager.Instance.currentSaveFileName); source = source.Where((int id) => !Plugin.shouldReset(id, "okayMaybeDoALittleResetting1")).ToArray(); ES3.Save<int[]>("UnlockedShipObjects", source, GameNetworkManager.Instance.currentSaveFileName); for (int i = 0; i < StartOfRound.Instance.unlockablesList.unlockables.Count; i++) { UnlockableItem val = StartOfRound.Instance.unlockablesList.unlockables[i]; if (Plugin.shouldReset(i, "okayMaybeDoALittleResetting2") && val.unlockableType == 1) { ES3.DeleteKey("ShipUnlockMoved_" + val.unlockableName, GameNetworkManager.Instance.currentSaveFileName); ES3.DeleteKey("ShipUnlockStored_" + val.unlockableName, GameNetworkManager.Instance.currentSaveFileName); ES3.DeleteKey("ShipUnlockPos_" + val.unlockableName, GameNetworkManager.Instance.currentSaveFileName); ES3.DeleteKey("ShipUnlockRot_" + val.unlockableName, GameNetworkManager.Instance.currentSaveFileName); } } } [HarmonyPostfix] [HarmonyPatch(typeof(StartOfRound), "ResetShip")] public static void unfuckObjects() { //IL_0161: Unknown result type (might be due to invalid IL or missing references) PlaceableShipObject[] array = Object.FindObjectsOfType<PlaceableShipObject>(); for (int i = 0; i < array.Length; i++) { UnlockableItem val = StartOfRound.Instance.unlockablesList.unlockables[array[i].unlockableID]; if (val.spawnPrefab) { if (val.hasBeenUnlockedByPlayer && !Plugin.shouldReset(array[i].unlockableID)) { if (Plugin.shouldDefault()) { val.inStorage = true; } } else { val.hasBeenUnlockedByPlayer = false; val.inStorage = false; } Collider[] componentsInChildren = ((Component)array[i].parentObject).GetComponentsInChildren<Collider>(); for (int j = 0; j < componentsInChildren.Length; j++) { componentsInChildren[j].enabled = true; } } else { if (!Plugin.shouldDefault()) { continue; } if (val.alreadyUnlocked) { val.inStorage = false; array[i].parentObject.disableObject = false; ShipBuildModeManager.Instance.ResetShipObjectToDefaultPosition(array[i]); continue; } if (Plugin.shouldReset(array[i].unlockableID)) { val.hasBeenUnlockedByPlayer = false; val.inStorage = false; } else { val.hasBeenUnlockedByPlayer = true; val.inStorage = true; } array[i].parentObject.disableObject = true; ShipBuildModeManager.Instance.StoreObjectServerRpc(NetworkObjectReference.op_Implicit(((Component)array[i].parentObject).GetComponent<NetworkObject>()), (int)GameNetworkManager.Instance.localPlayerController.playerClientId); } } for (int k = 0; k < StartOfRound.Instance.unlockablesList.unlockables.Count; k++) { UnlockableItem val2 = StartOfRound.Instance.unlockablesList.unlockables[k]; if (val2.alreadyUnlocked || !val2.spawnPrefab || !Plugin.shouldReset(k)) { continue; } if (!StartOfRound.Instance.SpawnedShipUnlockables.TryGetValue(k, out var value)) { StartOfRound.Instance.SpawnedShipUnlockables.Remove(k); continue; } if ((Object)(object)value == (Object)null) { StartOfRound.Instance.SpawnedShipUnlockables.Remove(k); continue; } StartOfRound.Instance.SpawnedShipUnlockables.Remove(k); NetworkObject component = value.GetComponent<NetworkObject>(); if ((Object)(object)component != (Object)null && component.IsSpawned) { component.Despawn(true); } } } } [HarmonyPatch(typeof(GameNetworkManager), "ResetSavedGameValues")] public class ResetSavedGameValues { private static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions) { Plugin.log.LogWarning((object)"Beginning transpilation of GameNetworkManager.ResetSavedGameValues()"); List<CodeInstruction> list = new List<CodeInstruction>(instructions); int num = -1; List<int> list2 = new List<int>(); for (int i = 0; i < list.Count; i++) { if (list[i].opcode == OpCodes.Ldstr) { if (list[i].operand.ToString() == "UnlockedShipObjects") { num = i; Plugin.log.LogInfo((object)$"Found ship object opcode at {i}"); } else if (list[i].operand.ToString().EndsWith("_")) { list2.Add(i); Plugin.log.LogInfo((object)$"Found placeable ship object data opcode at {i}"); } } } for (int num2 = list2.Count - 1; num2 >= 0; num2--) { list.RemoveRange(list2[num2], 11); } if (num >= 0) { list.RemoveRange(num, 4); } return list.AsEnumerable(); } } [HarmonyPatch(typeof(StartOfRound), "ResetShip")] public class ResetShip { private static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions) { //IL_0221: Unknown result type (might be due to invalid IL or missing references) //IL_0227: Expected O, but got Unknown //IL_0251: Unknown result type (might be due to invalid IL or missing references) //IL_0257: Expected O, but got Unknown //IL_0263: Unknown result type (might be due to invalid IL or missing references) //IL_0269: Expected O, but got Unknown //IL_0286: Unknown result type (might be due to invalid IL or missing references) //IL_028c: Expected O, but got Unknown Plugin.log.LogWarning((object)"Beginning transpilation of StartOfRound.ResetShip()"); List<CodeInstruction> list = new List<CodeInstruction>(instructions); int num = -1; CodeInstruction val = null; int num2 = -1; CodeInstruction val2 = null; int num3 = -1; for (int i = 0; i < list.Count; i++) { if (list[i].opcode == OpCodes.Ldfld && list[i].operand.ToString() == "System.Boolean spawnPrefab") { if (num == -1) { num = i + 2; val = list[i + 1].Clone(); val.opcode = OpCodes.Brfalse_S; Plugin.log.LogInfo((object)$"Found ship object prefab opcode at {i} (1)"); } else if (num2 == -1) { num2 = i + 2; val2 = list[i + 1].Clone(); val2.opcode = OpCodes.Brfalse_S; Plugin.log.LogInfo((object)$"Found ship object prefab opcode at {i} (1)"); } } if (list[i].opcode == OpCodes.Call && list[i].operand.ToString() == "Void SwitchSuitForPlayer(GameNetcodeStuff.PlayerControllerB, Int32, Boolean)") { num3 = i; Plugin.log.LogInfo((object)$"Found suit reset opcode at {i}"); } if (list[i].opcode == OpCodes.Stfld && list[i].operand.ToString() == "System.Boolean disableObject") { list[i - 1].opcode = OpCodes.Ldc_I4_1; } } if (num3 >= 0) { list.RemoveRange(num3 - 6, 7); } if (num2 >= 0) { list.InsertRange(num2, (IEnumerable<CodeInstruction>)(object)new CodeInstruction[2] { new CodeInstruction(OpCodes.Call, (object)AccessTools.Method(typeof(Plugin), "shouldDefault", (Type[])null, (Type[])null)), val2 }); } if (num >= 0) { list.InsertRange(num, (IEnumerable<CodeInstruction>)(object)new CodeInstruction[4] { new CodeInstruction(OpCodes.Ldloc_3, (object)null), new CodeInstruction(OpCodes.Ldstr, (object)"StartOfRound1"), new CodeInstruction(OpCodes.Call, (object)AccessTools.Method(typeof(Plugin), "shouldReset", (Type[])null, (Type[])null)), val }); } return list.AsEnumerable(); } } [HarmonyPatch(typeof(StartOfRound), "SyncShipUnlockablesServerRpc")] public class InSanityCheck { private static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions) { //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Expected O, but got Unknown //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Expected O, but got Unknown //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Expected O, but got Unknown //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Expected O, but got Unknown Plugin.log.LogWarning((object)"Beginning transpilation of StartOfRound.SyncShipUnlockablesServerRpc()"); List<CodeInstruction> list = new List<CodeInstruction>(instructions); for (int i = 0; i < list.Count; i++) { if (list[i].opcode == OpCodes.Ldstr && list[i].operand.ToString() == "Server: placeableObject #{0}: {1}") { list.InsertRange(i - 1, (IEnumerable<CodeInstruction>)(object)new CodeInstruction[4] { new CodeInstruction(OpCodes.Ldloc_S, (object)5), new CodeInstruction(OpCodes.Ldloc_S, (object)10), new CodeInstruction(OpCodes.Ldelem_Ref, (object)null), new CodeInstruction(OpCodes.Call, (object)AccessTools.Method(typeof(InSanityCheck), "WhatIsGoingOn", (Type[])null, (Type[])null)) }); Plugin.log.LogWarning((object)"This crash is not evading me"); break; } } return list.AsEnumerable(); } public static void WhatIsGoingOn(PlaceableShipObject pso) { //IL_00ea: 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) Plugin.log.LogWarning((object)"Seeing what the fuck is going wrong here with syncing unlockables, prepare for spam"); Plugin.log.LogInfo((object)$"ship object is not null? {(Object)(object)pso != (Object)null}"); Plugin.log.LogInfo((object)$"ship object transform is not null? {(Object)(object)((Component)pso).transform != (Object)null}"); int unlockableID = pso.unlockableID; Plugin.log.LogInfo((object)$"ship object unlockable id {unlockableID}"); Plugin.log.LogInfo((object)$"unlockables has id? {unlockableID < StartOfRound.Instance.unlockablesList.unlockables.Count}"); UnlockableItem val = StartOfRound.Instance.unlockablesList.unlockables[unlockableID]; Plugin.log.LogInfo((object)$"unlockable is not null? {val != null}"); Plugin.log.LogInfo((object)$"unlockable position {val.placedPosition}"); Plugin.log.LogInfo((object)$"unlockable rotation {val.placedPosition}"); Plugin.log.LogInfo((object)$"unlockable in storage? {val.inStorage}"); } } namespace PersistentPurchases { [BepInPlugin("beeisyou.PersistentPurchases", "Persistent Purchases", "1.1.0")] public class Plugin : BaseUnityPlugin { private static ConfigEntry<bool> resetSuits; private static ConfigEntry<bool> resetFurniture; private static ConfigEntry<bool> resetUpgrades; private static ConfigEntry<bool> defaultPlacement; public static ManualLogSource log = new ManualLogSource("Persistent Purchases"); public static Harmony harmony = new Harmony("beeisyou.PersistentPurchases"); public static int[] suits = new int[4] { 0, 1, 2, 3 }; public static int[] upgrades = new int[3] { 5, 18, 19 }; public static int[] defaults = new int[5] { 7, 8, 11, 15, 16 }; private void Awake() { Logger.Sources.Add((ILogSource)(object)log); resetSuits = ((BaseUnityPlugin)this).Config.Bind<bool>("Resetting", "ResetSuits", false, "Remove all but the orange suit on game over"); resetFurniture = ((BaseUnityPlugin)this).Config.Bind<bool>("Resetting", "ResetFurniture", false, "Remove cosmetic purchases on game over"); resetUpgrades = ((BaseUnityPlugin)this).Config.Bind<bool>("Resetting", "ResetUpgrades", true, "Remove ship upgrades on game over"); defaultPlacement = ((BaseUnityPlugin)this).Config.Bind<bool>("Resetting", "DefaultPlacement", true, "Reset objects to their default position, and put everything else in storage"); harmony.PatchAll(typeof(Patches)); harmony.PatchAll(typeof(ResetSavedGameValues)); harmony.PatchAll(typeof(ResetShip)); harmony.PatchAll(typeof(InSanityCheck)); log.LogMessage((object)"Plugin Persistent Purchases is loaded!"); } public static bool shouldReset(int id, string debugType = "") { if (suits.Contains(id)) { if (!resetSuits.Value) { log.LogInfo((object)$"Not resetting {id} {debugType}"); return false; } } else if (upgrades.Contains(id)) { if (!resetUpgrades.Value) { log.LogInfo((object)$"Not resetting {id} {debugType}"); return false; } } else if (!resetFurniture.Value) { log.LogInfo((object)$"Not resetting {id} {debugType}"); return false; } if (defaults.Contains(id)) { log.LogInfo((object)$"Not resetting {id} {debugType}"); return false; } log.LogInfo((object)$"Is resetting {id} {debugType}"); return true; } public static bool shouldDefault() { return defaultPlacement.Value; } } public static class PluginInfo { public const string PLUGIN_GUID = "PersistentPurchases"; public const string PLUGIN_NAME = "PersistentPurchases"; public const string PLUGIN_VERSION = "1.0.0"; } }
BepInEx/plugins/TheBeeTeam-PersistentPurchases/Unity.InputSystem.dll
Decompiled a year ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.CodeDom.Compiler; using System.Collections; using System.Collections.Generic; using System.ComponentModel; using System.Diagnostics; using System.Globalization; using System.IO; using System.Linq; using System.Linq.Expressions; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Serialization; using System.Security; using System.Security.Permissions; using System.Text; using System.Text.RegularExpressions; using Unity.Collections; using Unity.Collections.LowLevel.Unsafe; using Unity.XR.GoogleVr; using Unity.XR.Oculus.Input; using Unity.XR.OpenVR; using UnityEngine.EventSystems; using UnityEngine.Events; using UnityEngine.Experimental.Rendering; using UnityEngine.InputSystem; using UnityEngine.InputSystem.Composites; using UnityEngine.InputSystem.Controls; using UnityEngine.InputSystem.DualShock; using UnityEngine.InputSystem.DualShock.LowLevel; using UnityEngine.InputSystem.HID; using UnityEngine.InputSystem.Haptics; using UnityEngine.InputSystem.Interactions; using UnityEngine.InputSystem.Layouts; using UnityEngine.InputSystem.LowLevel; using UnityEngine.InputSystem.Processors; using UnityEngine.InputSystem.Switch; using UnityEngine.InputSystem.Switch.LowLevel; using UnityEngine.InputSystem.UI; using UnityEngine.InputSystem.Users; using UnityEngine.InputSystem.Utilities; using UnityEngine.InputSystem.XInput; using UnityEngine.InputSystem.XInput.LowLevel; using UnityEngine.InputSystem.XR; using UnityEngine.InputSystem.XR.Haptics; using UnityEngine.Networking.PlayerConnection; using UnityEngine.Pool; using UnityEngine.Scripting; using UnityEngine.Serialization; using UnityEngine.UI; using UnityEngine.UIElements; using UnityEngine.XR; using UnityEngine.XR.WindowsMR.Input; using UnityEngineInternal.Input; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: InternalsVisibleTo("Unity.InputSystem.TestFramework")] [assembly: InternalsVisibleTo("Unity.InputSystem.Tests.Editor")] [assembly: InternalsVisibleTo("Unity.InputSystem.Tests")] [assembly: InternalsVisibleTo("Unity.InputSystem.IntegrationTests")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.7.0.0")] [module: UnverifiableCode] internal static class UISupport { public static void Initialize() { InputSystem.RegisterLayout("\n {\n \"name\" : \"VirtualMouse\",\n \"extend\" : \"Mouse\"\n }\n "); } } [CompilerGenerated] [EditorBrowsable(EditorBrowsableState.Never)] [GeneratedCode("Unity.MonoScriptGenerator.MonoScriptInfoGenerator", null)] internal class UnitySourceGeneratedAssemblyMonoScriptTypes_v1 { private struct MonoScriptData { public byte[] FilePathsData; public byte[] TypesData; public int TotalTypes; public int TotalFiles; public bool IsEditorOnly; } [MethodImpl(MethodImplOptions.AggressiveInlining)] private static MonoScriptData Get() { MonoScriptData result = default(MonoScriptData); result.FilePathsData = new byte[24040] { 0, 0, 0, 1, 0, 0, 0, 97, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 65, 99, 116, 105, 111, 110, 115, 92, 67, 111, 109, 112, 111, 115, 105, 116, 101, 115, 92, 65, 120, 105, 115, 67, 111, 109, 112, 111, 115, 105, 116, 101, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 105, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 65, 99, 116, 105, 111, 110, 115, 92, 67, 111, 109, 112, 111, 115, 105, 116, 101, 115, 92, 66, 117, 116, 116, 111, 110, 87, 105, 116, 104, 79, 110, 101, 77, 111, 100, 105, 102, 105, 101, 114, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 106, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 65, 99, 116, 105, 111, 110, 115, 92, 67, 111, 109, 112, 111, 115, 105, 116, 101, 115, 92, 66, 117, 116, 116, 111, 110, 87, 105, 116, 104, 84, 119, 111, 77, 111, 100, 105, 102, 105, 101, 114, 115, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 104, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 65, 99, 116, 105, 111, 110, 115, 92, 67, 111, 109, 112, 111, 115, 105, 116, 101, 115, 92, 79, 110, 101, 77, 111, 100, 105, 102, 105, 101, 114, 67, 111, 109, 112, 111, 115, 105, 116, 101, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 105, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 65, 99, 116, 105, 111, 110, 115, 92, 67, 111, 109, 112, 111, 115, 105, 116, 101, 115, 92, 84, 119, 111, 77, 111, 100, 105, 102, 105, 101, 114, 115, 67, 111, 109, 112, 111, 115, 105, 116, 101, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 100, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 65, 99, 116, 105, 111, 110, 115, 92, 67, 111, 109, 112, 111, 115, 105, 116, 101, 115, 92, 86, 101, 99, 116, 111, 114, 50, 67, 111, 109, 112, 111, 115, 105, 116, 101, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 100, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 65, 99, 116, 105, 111, 110, 115, 92, 67, 111, 109, 112, 111, 115, 105, 116, 101, 115, 92, 86, 101, 99, 116, 111, 114, 51, 67, 111, 109, 112, 111, 115, 105, 116, 101, 46, 99, 115, 0, 0, 0, 2, 0, 0, 0, 95, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 65, 99, 116, 105, 111, 110, 115, 92, 73, 73, 110, 112, 117, 116, 65, 99, 116, 105, 111, 110, 67, 111, 108, 108, 101, 99, 116, 105, 111, 110, 46, 99, 115, 0, 0, 0, 3, 0, 0, 0, 90, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 65, 99, 116, 105, 111, 110, 115, 92, 73, 73, 110, 112, 117, 116, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 46, 99, 115, 0, 0, 0, 2, 0, 0, 0, 84, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 65, 99, 116, 105, 111, 110, 115, 92, 73, 110, 112, 117, 116, 65, 99, 116, 105, 111, 110, 46, 99, 115, 0, 0, 0, 3, 0, 0, 0, 89, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 65, 99, 116, 105, 111, 110, 115, 92, 73, 110, 112, 117, 116, 65, 99, 116, 105, 111, 110, 65, 115, 115, 101, 116, 46, 99, 115, 0, 0, 0, 11, 0, 0, 0, 87, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 65, 99, 116, 105, 111, 110, 115, 92, 73, 110, 112, 117, 116, 65, 99, 116, 105, 111, 110, 77, 97, 112, 46, 99, 115, 0, 0, 0, 5, 0, 0, 0, 94, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 65, 99, 116, 105, 111, 110, 115, 92, 73, 110, 112, 117, 116, 65, 99, 116, 105, 111, 110, 80, 97, 114, 97, 109, 101, 116, 101, 114, 115, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 92, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 65, 99, 116, 105, 111, 110, 115, 92, 73, 110, 112, 117, 116, 65, 99, 116, 105, 111, 110, 80, 114, 111, 112, 101, 114, 116, 121, 46, 99, 115, 0, 0, 0, 3, 0, 0, 0, 103, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 65, 99, 116, 105, 111, 110, 115, 92, 73, 110, 112, 117, 116, 65, 99, 116, 105, 111, 110, 82, 101, 98, 105, 110, 100, 105, 110, 103, 69, 120, 116, 101, 110, 115, 105, 111, 110, 115, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 93, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 65, 99, 116, 105, 111, 110, 115, 92, 73, 110, 112, 117, 116, 65, 99, 116, 105, 111, 110, 82, 101, 102, 101, 114, 101, 110, 99, 101, 46, 99, 115, 0, 0, 0, 4, 0, 0, 0, 99, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 65, 99, 116, 105, 111, 110, 115, 92, 73, 110, 112, 117, 116, 65, 99, 116, 105, 111, 110, 83, 101, 116, 117, 112, 69, 120, 116, 101, 110, 115, 105, 111, 110, 115, 46, 99, 115, 0, 0, 0, 7, 0, 0, 0, 89, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 65, 99, 116, 105, 111, 110, 115, 92, 73, 110, 112, 117, 116, 65, 99, 116, 105, 111, 110, 83, 116, 97, 116, 101, 46, 99, 115, 0, 0, 0, 3, 0, 0, 0, 89, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 65, 99, 116, 105, 111, 110, 115, 92, 73, 110, 112, 117, 116, 65, 99, 116, 105, 111, 110, 84, 114, 97, 99, 101, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 85, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 65, 99, 116, 105, 111, 110, 115, 92, 73, 110, 112, 117, 116, 66, 105, 110, 100, 105, 110, 103, 46, 99, 115, 0, 0, 0, 2, 0, 0, 0, 94, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 65, 99, 116, 105, 111, 110, 115, 92, 73, 110, 112, 117, 116, 66, 105, 110, 100, 105, 110, 103, 67, 111, 109, 112, 111, 115, 105, 116, 101, 46, 99, 115, 0, 0, 0, 3, 0, 0, 0, 101, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 65, 99, 116, 105, 111, 110, 115, 92, 73, 110, 112, 117, 116, 66, 105, 110, 100, 105, 110, 103, 67, 111, 109, 112, 111, 115, 105, 116, 101, 67, 111, 110, 116, 101, 120, 116, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 93, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 65, 99, 116, 105, 111, 110, 115, 92, 73, 110, 112, 117, 116, 66, 105, 110, 100, 105, 110, 103, 82, 101, 115, 111, 108, 118, 101, 114, 46, 99, 115, 0, 0, 0, 7, 0, 0, 0, 91, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 65, 99, 116, 105, 111, 110, 115, 92, 73, 110, 112, 117, 116, 67, 111, 110, 116, 114, 111, 108, 83, 99, 104, 101, 109, 101, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 96, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 65, 99, 116, 105, 111, 110, 115, 92, 73, 110, 112, 117, 116, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 67, 111, 110, 116, 101, 120, 116, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 101, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 65, 99, 116, 105, 111, 110, 115, 92, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 115, 92, 72, 111, 108, 100, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 105, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 65, 99, 116, 105, 111, 110, 115, 92, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 115, 92, 77, 117, 108, 116, 105, 84, 97, 112, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 102, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 65, 99, 116, 105, 111, 110, 115, 92, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 115, 92, 80, 114, 101, 115, 115, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 104, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 65, 99, 116, 105, 111, 110, 115, 92, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 115, 92, 83, 108, 111, 119, 84, 97, 112, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 100, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 65, 99, 116, 105, 111, 110, 115, 92, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 115, 92, 84, 97, 112, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 77, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 65, 115, 115, 101, 109, 98, 108, 121, 73, 110, 102, 111, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 87, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 67, 111, 110, 116, 114, 111, 108, 115, 92, 65, 110, 121, 75, 101, 121, 67, 111, 110, 116, 114, 111, 108, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 85, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 67, 111, 110, 116, 114, 111, 108, 115, 92, 65, 120, 105, 115, 67, 111, 110, 116, 114, 111, 108, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 87, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 67, 111, 110, 116, 114, 111, 108, 115, 92, 66, 117, 116, 116, 111, 110, 67, 111, 110, 116, 114, 111, 108, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 86, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 67, 111, 110, 116, 114, 111, 108, 115, 92, 67, 111, 109, 109, 111, 110, 85, 115, 97, 103, 101, 115, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 86, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 67, 111, 110, 116, 114, 111, 108, 115, 92, 68, 101, 108, 116, 97, 67, 111, 110, 116, 114, 111, 108, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 95, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 67, 111, 110, 116, 114, 111, 108, 115, 92, 68, 105, 115, 99, 114, 101, 116, 101, 66, 117, 116, 116, 111, 110, 67, 111, 110, 116, 114, 111, 108, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 87, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 67, 111, 110, 116, 114, 111, 108, 115, 92, 68, 111, 117, 98, 108, 101, 67, 111, 110, 116, 114, 111, 108, 46, 99, 115, 0, 0, 0, 2, 0, 0, 0, 85, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 67, 111, 110, 116, 114, 111, 108, 115, 92, 68, 112, 97, 100, 67, 111, 110, 116, 114, 111, 108, 46, 99, 115, 0, 0, 0, 2, 0, 0, 0, 86, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 67, 111, 110, 116, 114, 111, 108, 115, 92, 73, 110, 112, 117, 116, 67, 111, 110, 116, 114, 111, 108, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 95, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 67, 111, 110, 116, 114, 111, 108, 115, 92, 73, 110, 112, 117, 116, 67, 111, 110, 116, 114, 111, 108, 65, 116, 116, 114, 105, 98, 117, 116, 101, 46, 99, 115, 0, 0, 0, 5, 0, 0, 0, 96, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 67, 111, 110, 116, 114, 111, 108, 115, 92, 73, 110, 112, 117, 116, 67, 111, 110, 116, 114, 111, 108, 69, 120, 116, 101, 110, 115, 105, 111, 110, 115, 46, 99, 115, 0, 0, 0, 13, 0, 0, 0, 92, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 67, 111, 110, 116, 114, 111, 108, 115, 92, 73, 110, 112, 117, 116, 67, 111, 110, 116, 114, 111, 108, 76, 97, 121, 111, 117, 116, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 101, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 67, 111, 110, 116, 114, 111, 108, 115, 92, 73, 110, 112, 117, 116, 67, 111, 110, 116, 114, 111, 108, 76, 97, 121, 111, 117, 116, 65, 116, 116, 114, 105, 98, 117, 116, 101, 46, 99, 115, 0, 0, 0, 2, 0, 0, 0, 90, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 67, 111, 110, 116, 114, 111, 108, 115, 92, 73, 110, 112, 117, 116, 67, 111, 110, 116, 114, 111, 108, 76, 105, 115, 116, 46, 99, 115, 0, 0, 0, 3, 0, 0, 0, 90, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 67, 111, 110, 116, 114, 111, 108, 115, 92, 73, 110, 112, 117, 116, 67, 111, 110, 116, 114, 111, 108, 80, 97, 116, 104, 46, 99, 115, 0, 0, 0, 2, 0, 0, 0, 88, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 67, 111, 110, 116, 114, 111, 108, 115, 92, 73, 110, 112, 117, 116, 80, 114, 111, 99, 101, 115, 115, 111, 114, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 88, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 67, 111, 110, 116, 114, 111, 108, 115, 92, 73, 110, 116, 101, 103, 101, 114, 67, 111, 110, 116, 114, 111, 108, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 84, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 67, 111, 110, 116, 114, 111, 108, 115, 92, 75, 101, 121, 67, 111, 110, 116, 114, 111, 108, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 106, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 67, 111, 110, 116, 114, 111, 108, 115, 92, 80, 114, 111, 99, 101, 115, 115, 111, 114, 115, 92, 65, 120, 105, 115, 68, 101, 97, 100, 122, 111, 110, 101, 80, 114, 111, 99, 101, 115, 115, 111, 114, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 99, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 67, 111, 110, 116, 114, 111, 108, 115, 92, 80, 114, 111, 99, 101, 115, 115, 111, 114, 115, 92, 67, 108, 97, 109, 112, 80, 114, 111, 99, 101, 115, 115, 111, 114, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 113, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 67, 111, 110, 116, 114, 111, 108, 115, 92, 80, 114, 111, 99, 101, 115, 115, 111, 114, 115, 92, 67, 111, 109, 112, 101, 110, 115, 97, 116, 101, 68, 105, 114, 101, 99, 116, 105, 111, 110, 80, 114, 111, 99, 101, 115, 115, 111, 114, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 112, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 67, 111, 110, 116, 114, 111, 108, 115, 92, 80, 114, 111, 99, 101, 115, 115, 111, 114, 115, 92, 67, 111, 109, 112, 101, 110, 115, 97, 116, 101, 82, 111, 116, 97, 116, 105, 111, 110, 80, 114, 111, 99, 101, 115, 115, 111, 114, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 100, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 67, 111, 110, 116, 114, 111, 108, 115, 92, 80, 114, 111, 99, 101, 115, 115, 111, 114, 115, 92, 73, 110, 118, 101, 114, 116, 80, 114, 111, 99, 101, 115, 115, 111, 114, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 107, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 67, 111, 110, 116, 114, 111, 108, 115, 92, 80, 114, 111, 99, 101, 115, 115, 111, 114, 115, 92, 73, 110, 118, 101, 114, 116, 86, 101, 99, 116, 111, 114, 50, 80, 114, 111, 99, 101, 115, 115, 111, 114, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 107, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 67, 111, 110, 116, 114, 111, 108, 115, 92, 80, 114, 111, 99, 101, 115, 115, 111, 114, 115, 92, 73, 110, 118, 101, 114, 116, 86, 101, 99, 116, 111, 114, 51, 80, 114, 111, 99, 101, 115, 115, 111, 114, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 103, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 67, 111, 110, 116, 114, 111, 108, 115, 92, 80, 114, 111, 99, 101, 115, 115, 111, 114, 115, 92, 78, 111, 114, 109, 97, 108, 105, 122, 101, 80, 114, 111, 99, 101, 115, 115, 111, 114, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 110, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 67, 111, 110, 116, 114, 111, 108, 115, 92, 80, 114, 111, 99, 101, 115, 115, 111, 114, 115, 92, 78, 111, 114, 109, 97, 108, 105, 122, 101, 86, 101, 99, 116, 111, 114, 50, 80, 114, 111, 99, 101, 115, 115, 111, 114, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 110, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 67, 111, 110, 116, 114, 111, 108, 115, 92, 80, 114, 111, 99, 101, 115, 115, 111, 114, 115, 92, 78, 111, 114, 109, 97, 108, 105, 122, 101, 86, 101, 99, 116, 111, 114, 51, 80, 114, 111, 99, 101, 115, 115, 111, 114, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 99, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 67, 111, 110, 116, 114, 111, 108, 115, 92, 80, 114, 111, 99, 101, 115, 115, 111, 114, 115, 92, 83, 99, 97, 108, 101, 80, 114, 111, 99, 101, 115, 115, 111, 114, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 106, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 67, 111, 110, 116, 114, 111, 108, 115, 92, 80, 114, 111, 99, 101, 115, 115, 111, 114, 115, 92, 83, 99, 97, 108, 101, 86, 101, 99, 116, 111, 114, 50, 80, 114, 111, 99, 101, 115, 115, 111, 114, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 106, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 67, 111, 110, 116, 114, 111, 108, 115, 92, 80, 114, 111, 99, 101, 115, 115, 111, 114, 115, 92, 83, 99, 97, 108, 101, 86, 101, 99, 116, 111, 114, 51, 80, 114, 111, 99, 101, 115, 115, 111, 114, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 107, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 67, 111, 110, 116, 114, 111, 108, 115, 92, 80, 114, 111, 99, 101, 115, 115, 111, 114, 115, 92, 83, 116, 105, 99, 107, 68, 101, 97, 100, 122, 111, 110, 101, 80, 114, 111, 99, 101, 115, 115, 111, 114, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 91, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 67, 111, 110, 116, 114, 111, 108, 115, 92, 81, 117, 97, 116, 101, 114, 110, 105, 111, 110, 67, 111, 110, 116, 114, 111, 108, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 86, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 67, 111, 110, 116, 114, 111, 108, 115, 92, 83, 116, 105, 99, 107, 67, 111, 110, 116, 114, 111, 108, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 86, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 67, 111, 110, 116, 114, 111, 108, 115, 92, 84, 111, 117, 99, 104, 67, 111, 110, 116, 114, 111, 108, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 91, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 67, 111, 110, 116, 114, 111, 108, 115, 92, 84, 111, 117, 99, 104, 80, 104, 97, 115, 101, 67, 111, 110, 116, 114, 111, 108, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 91, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 67, 111, 110, 116, 114, 111, 108, 115, 92, 84, 111, 117, 99, 104, 80, 114, 101, 115, 115, 67, 111, 110, 116, 114, 111, 108, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 88, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 67, 111, 110, 116, 114, 111, 108, 115, 92, 86, 101, 99, 116, 111, 114, 50, 67, 111, 110, 116, 114, 111, 108, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 88, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 67, 111, 110, 116, 114, 111, 108, 115, 92, 86, 101, 99, 116, 111, 114, 51, 67, 111, 110, 116, 114, 111, 108, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 102, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 68, 101, 118, 105, 99, 101, 115, 92, 67, 111, 109, 109, 97, 110, 100, 115, 92, 68, 105, 115, 97, 98, 108, 101, 68, 101, 118, 105, 99, 101, 67, 111, 109, 109, 97, 110, 100, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 101, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 68, 101, 118, 105, 99, 101, 115, 92, 67, 111, 109, 109, 97, 110, 100, 115, 92, 69, 110, 97, 98, 108, 101, 68, 101, 118, 105, 99, 101, 67, 111, 109, 109, 97, 110, 100, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 109, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 68, 101, 118, 105, 99, 101, 115, 92, 67, 111, 109, 109, 97, 110, 100, 115, 92, 69, 110, 97, 98, 108, 101, 73, 77, 69, 67, 111, 109, 112, 111, 115, 105, 116, 105, 111, 110, 67, 111, 109, 109, 97, 110, 100, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 105, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 68, 101, 118, 105, 99, 101, 115, 92, 67, 111, 109, 109, 97, 110, 100, 115, 92, 73, 73, 110, 112, 117, 116, 68, 101, 118, 105, 99, 101, 67, 111, 109, 109, 97, 110, 100, 73, 110, 102, 111, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 115, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 68, 101, 118, 105, 99, 101, 115, 92, 67, 111, 109, 109, 97, 110, 100, 115, 92, 73, 110, 105, 116, 105, 97, 116, 101, 85, 115, 101, 114, 65, 99, 99, 111, 117, 110, 116, 80, 97, 105, 114, 105, 110, 103, 67, 111, 109, 109, 97, 110, 100, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 100, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 68, 101, 118, 105, 99, 101, 115, 92, 67, 111, 109, 109, 97, 110, 100, 115, 92, 73, 110, 112, 117, 116, 68, 101, 118, 105, 99, 101, 67, 111, 109, 109, 97, 110, 100, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 105, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 68, 101, 118, 105, 99, 101, 115, 92, 67, 111, 109, 109, 97, 110, 100, 115, 92, 81, 117, 101, 114, 121, 67, 97, 110, 82, 117, 110, 73, 110, 66, 97, 99, 107, 103, 114, 111, 117, 110, 100, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 104, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 68, 101, 118, 105, 99, 101, 115, 92, 67, 111, 109, 109, 97, 110, 100, 115, 92, 81, 117, 101, 114, 121, 68, 105, 109, 101, 110, 115, 105, 111, 110, 115, 67, 111, 109, 109, 97, 110, 100, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 106, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 68, 101, 118, 105, 99, 101, 115, 92, 67, 111, 109, 109, 97, 110, 100, 115, 92, 81, 117, 101, 114, 121, 69, 110, 97, 98, 108, 101, 100, 83, 116, 97, 116, 101, 67, 111, 109, 109, 97, 110, 100, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 108, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 68, 101, 118, 105, 99, 101, 115, 92, 67, 111, 109, 109, 97, 110, 100, 115, 92, 81, 117, 101, 114, 121, 75, 101, 121, 98, 111, 97, 114, 100, 76, 97, 121, 111, 117, 116, 67, 111, 109, 109, 97, 110, 100, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 101, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 68, 101, 118, 105, 99, 101, 115, 92, 67, 111, 109, 109, 97, 110, 100, 115, 92, 81, 117, 101, 114, 121, 75, 101, 121, 78, 97, 109, 101, 67, 111, 109, 109, 97, 110, 100, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 111, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 68, 101, 118, 105, 99, 101, 115, 92, 67, 111, 109, 109, 97, 110, 100, 115, 92, 81, 117, 101, 114, 121, 80, 97, 105, 114, 101, 100, 85, 115, 101, 114, 65, 99, 99, 111, 117, 110, 116, 67, 111, 109, 109, 97, 110, 100, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 111, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 68, 101, 118, 105, 99, 101, 115, 92, 67, 111, 109, 109, 97, 110, 100, 115, 92, 81, 117, 101, 114, 121, 83, 97, 109, 112, 108, 105, 110, 103, 70, 114, 101, 113, 117, 101, 110, 99, 121, 67, 111, 109, 109, 97, 110, 100, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 100, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 68, 101, 118, 105, 99, 101, 115, 92, 67, 111, 109, 109, 97, 110, 100, 115, 92, 81, 117, 101, 114, 121, 85, 115, 101, 114, 73, 100, 67, 111, 109, 109, 97, 110, 100, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 101, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 68, 101, 118, 105, 99, 101, 115, 92, 67, 111, 109, 109, 97, 110, 100, 115, 92, 82, 101, 113, 117, 101, 115, 116, 82, 101, 115, 101, 116, 67, 111, 109, 109, 97, 110, 100, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 100, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 68, 101, 118, 105, 99, 101, 115, 92, 67, 111, 109, 109, 97, 110, 100, 115, 92, 82, 101, 113, 117, 101, 115, 116, 83, 121, 110, 99, 67, 111, 109, 109, 97, 110, 100, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 109, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 68, 101, 118, 105, 99, 101, 115, 92, 67, 111, 109, 109, 97, 110, 100, 115, 92, 83, 101, 116, 73, 77, 69, 67, 117, 114, 115, 111, 114, 80, 111, 115, 105, 116, 105, 111, 110, 67, 111, 109, 109, 97, 110, 100, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 109, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 68, 101, 118, 105, 99, 101, 115, 92, 67, 111, 109, 109, 97, 110, 100, 115, 92, 83, 101, 116, 83, 97, 109, 112, 108, 105, 110, 103, 70, 114, 101, 113, 117, 101, 110, 99, 121, 67, 111, 109, 109, 97, 110, 100, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 110, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 68, 101, 118, 105, 99, 101, 115, 92, 67, 111, 109, 109, 97, 110, 100, 115, 92, 85, 115, 101, 87, 105, 110, 100, 111, 119, 115, 71, 97, 109, 105, 110, 103, 73, 110, 112, 117, 116, 67, 111, 109, 109, 97, 110, 100, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 106, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 68, 101, 118, 105, 99, 101, 115, 92, 67, 111, 109, 109, 97, 110, 100, 115, 92, 87, 97, 114, 112, 77, 111, 117, 115, 101, 80, 111, 115, 105, 116, 105, 111, 110, 67, 111, 109, 109, 97, 110, 100, 46, 99, 115, 0, 0, 0, 2, 0, 0, 0, 80, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 68, 101, 118, 105, 99, 101, 115, 92, 71, 97, 109, 101, 112, 97, 100, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 96, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 68, 101, 118, 105, 99, 101, 115, 92, 72, 97, 112, 116, 105, 99, 115, 92, 68, 117, 97, 108, 77, 111, 116, 111, 114, 82, 117, 109, 98, 108, 101, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 103, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 68, 101, 118, 105, 99, 101, 115, 92, 72, 97, 112, 116, 105, 99, 115, 92, 68, 117, 97, 108, 77, 111, 116, 111, 114, 82, 117, 109, 98, 108, 101, 67, 111, 109, 109, 97, 110, 100, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 97, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 68, 101, 118, 105, 99, 101, 115, 92, 72, 97, 112, 116, 105, 99, 115, 92, 73, 68, 117, 97, 108, 77, 111, 116, 111, 114, 82, 117, 109, 98, 108, 101, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 89, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 68, 101, 118, 105, 99, 101, 115, 92, 72, 97, 112, 116, 105, 99, 115, 92, 73, 72, 97, 112, 116, 105, 99, 115, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 91, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 68, 101, 118, 105, 99, 101, 115, 92, 73, 67, 117, 115, 116, 111, 109, 68, 101, 118, 105, 99, 101, 82, 101, 115, 101, 116, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 85, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 68, 101, 118, 105, 99, 101, 115, 92, 73, 69, 118, 101, 110, 116, 77, 101, 114, 103, 101, 114, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 91, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 68, 101, 118, 105, 99, 101, 115, 92, 73, 69, 118, 101, 110, 116, 80, 114, 101, 80, 114, 111, 99, 101, 115, 115, 111, 114, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 101, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 68, 101, 118, 105, 99, 101, 115, 92, 73, 73, 110, 112, 117, 116, 85, 112, 100, 97, 116, 101, 67, 97, 108, 108, 98, 97, 99, 107, 82, 101, 99, 101, 105, 118, 101, 114, 46, 99, 115, 0, 0, 0, 2, 0, 0, 0, 84, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 68, 101, 118, 105, 99, 101, 115, 92, 73, 110, 112, 117, 116, 68, 101, 118, 105, 99, 101, 46, 99, 115, 0, 0, 0, 2, 0, 0, 0, 91, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 68, 101, 118, 105, 99, 101, 115, 92, 73, 110, 112, 117, 116, 68, 101, 118, 105, 99, 101, 66, 117, 105, 108, 100, 101, 114, 46, 99, 115, 0, 0, 0, 2, 0, 0, 0, 95, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 68, 101, 118, 105, 99, 101, 115, 92, 73, 110, 112, 117, 116, 68, 101, 118, 105, 99, 101, 68, 101, 115, 99, 114, 105, 112, 116, 105, 111, 110, 46, 99, 115, 0, 0, 0, 3, 0, 0, 0, 91, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 68, 101, 118, 105, 99, 101, 115, 92, 73, 110, 112, 117, 116, 68, 101, 118, 105, 99, 101, 77, 97, 116, 99, 104, 101, 114, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 91, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 68, 101, 118, 105, 99, 101, 115, 92, 73, 84, 101, 120, 116, 73, 110, 112, 117, 116, 82, 101, 99, 101, 105, 118, 101, 114, 46, 99, 115, 0, 0, 0, 2, 0, 0, 0, 81, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 68, 101, 118, 105, 99, 101, 115, 92, 74, 111, 121, 115, 116, 105, 99, 107, 46, 99, 115, 0, 0, 0, 2, 0, 0, 0, 81, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 68, 101, 118, 105, 99, 101, 115, 92, 75, 101, 121, 98, 111, 97, 114, 100, 46, 99, 115, 0, 0, 0, 2, 0, 0, 0, 78, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 68, 101, 118, 105, 99, 101, 115, 92, 77, 111, 117, 115, 101, 46, 99, 115, 0, 0, 0, 2, 0, 0, 0, 76, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 68, 101, 118, 105, 99, 101, 115, 92, 80, 101, 110, 46, 99, 115, 0, 0, 0, 2, 0, 0, 0, 80, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 68, 101, 118, 105, 99, 101, 115, 92, 80, 111, 105, 110, 116, 101, 114, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 97, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 68, 101, 118, 105, 99, 101, 115, 92, 80, 114, 101, 99, 111, 109, 112, 105, 108, 101, 100, 92, 70, 97, 115, 116, 75, 101, 121, 98, 111, 97, 114, 100, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 94, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 68, 101, 118, 105, 99, 101, 115, 92, 80, 114, 101, 99, 111, 109, 112, 105, 108, 101, 100, 92, 70, 97, 115, 116, 77, 111, 117, 115, 101, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 102, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 68, 101, 118, 105, 99, 101, 115, 92, 80, 114, 101, 99, 111, 109, 112, 105, 108, 101, 100, 92, 70, 97, 115, 116, 77, 111, 117, 115, 101, 46, 112, 97, 114, 116, 105, 97, 108, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 100, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 68, 101, 118, 105, 99, 101, 115, 92, 80, 114, 101, 99, 111, 109, 112, 105, 108, 101, 100, 92, 70, 97, 115, 116, 84, 111, 117, 99, 104, 115, 99, 114, 101, 101, 110, 46, 99, 115, 0, 0, 0, 17, 0, 0, 0, 93, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 68, 101, 118, 105, 99, 101, 115, 92, 82, 101, 109, 111, 116, 101, 92, 73, 110, 112, 117, 116, 82, 101, 109, 111, 116, 105, 110, 103, 46, 99, 115, 0, 0, 0, 2, 0, 0, 0, 107, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 68, 101, 118, 105, 99, 101, 115, 92, 82, 101, 109, 111, 116, 101, 92, 82, 101, 109, 111, 116, 101, 73, 110, 112, 117, 116, 80, 108, 97, 121, 101, 114, 67, 111, 110, 110, 101, 99, 116, 105, 111, 110, 46, 99, 115, 0, 0, 0, 18, 0, 0, 0, 79, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 68, 101, 118, 105, 99, 101, 115, 92, 83, 101, 110, 115, 111, 114, 46, 99, 115, 0, 0, 0, 3, 0, 0, 0, 84, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 68, 101, 118, 105, 99, 101, 115, 92, 84, 111, 117, 99, 104, 115, 99, 114, 101, 101, 110, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 86, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 68, 101, 118, 105, 99, 101, 115, 92, 84, 114, 97, 99, 107, 101, 100, 68, 101, 118, 105, 99, 101, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 83, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 69, 118, 101, 110, 116, 115, 92, 65, 99, 116, 105, 111, 110, 69, 118, 101, 110, 116, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 87, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 69, 118, 101, 110, 116, 115, 92, 68, 101, 108, 116, 97, 83, 116, 97, 116, 101, 69, 118, 101, 110, 116, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 96, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 69, 118, 101, 110, 116, 115, 92, 68, 101, 118, 105, 99, 101, 67, 111, 110, 102, 105, 103, 117, 114, 97, 116, 105, 111, 110, 69, 118, 101, 110, 116, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 89, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 69, 118, 101, 110, 116, 115, 92, 68, 101, 118, 105, 99, 101, 82, 101, 109, 111, 118, 101, 69, 118, 101, 110, 116, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 88, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 69, 118, 101, 110, 116, 115, 92, 68, 101, 118, 105, 99, 101, 82, 101, 115, 101, 116, 69, 118, 101, 110, 116, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 91, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 69, 118, 101, 110, 116, 115, 92, 73, 73, 110, 112, 117, 116, 69, 118, 101, 110, 116, 84, 121, 112, 101, 73, 110, 102, 111, 46, 99, 115, 0, 0, 0, 3, 0, 0, 0, 91, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 69, 118, 101, 110, 116, 115, 92, 73, 77, 69, 67, 111, 109, 112, 111, 115, 105, 116, 105, 111, 110, 69, 118, 101, 110, 116, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 82, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 69, 118, 101, 110, 116, 115, 92, 73, 110, 112, 117, 116, 69, 118, 101, 110, 116, 46, 99, 115, 0, 0, 0, 2, 0, 0, 0, 88, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 69, 118, 101, 110, 116, 115, 92, 73, 110, 112, 117, 116, 69, 118, 101, 110, 116, 66, 117, 102, 102, 101, 114, 46, 99, 115, 0, 0, 0, 3, 0, 0, 0, 90, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 69, 118, 101, 110, 116, 115, 92, 73, 110, 112, 117, 116, 69, 118, 101, 110, 116, 76, 105, 115, 116, 101, 110, 101, 114, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 85, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 69, 118, 101, 110, 116, 115, 92, 73, 110, 112, 117, 116, 69, 118, 101, 110, 116, 80, 116, 114, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 88, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 69, 118, 101, 110, 116, 115, 92, 73, 110, 112, 117, 116, 69, 118, 101, 110, 116, 83, 116, 114, 101, 97, 109, 46, 99, 115, 0, 0, 0, 4, 0, 0, 0, 87, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 69, 118, 101, 110, 116, 115, 92, 73, 110, 112, 117, 116, 69, 118, 101, 110, 116, 84, 114, 97, 99, 101, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 82, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 69, 118, 101, 110, 116, 115, 92, 83, 116, 97, 116, 101, 69, 118, 101, 110, 116, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 81, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 69, 118, 101, 110, 116, 115, 92, 84, 101, 120, 116, 69, 118, 101, 110, 116, 46, 99, 115, 0, 0, 0, 3, 0, 0, 0, 78, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 73, 73, 110, 112, 117, 116, 82, 117, 110, 116, 105, 109, 101, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 80, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 73, 110, 112, 117, 116, 69, 120, 116, 101, 110, 115, 105, 111, 110, 115, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 82, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 73, 110, 112, 117, 116, 70, 101, 97, 116, 117, 114, 101, 78, 97, 109, 101, 115, 46, 99, 115, 0, 0, 0, 2, 0, 0, 0, 77, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 73, 110, 112, 117, 116, 77, 97, 110, 97, 103, 101, 114, 46, 99, 115, 0, 0, 0, 4, 0, 0, 0, 90, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 73, 110, 112, 117, 116, 77, 97, 110, 97, 103, 101, 114, 83, 116, 97, 116, 101, 77, 111, 110, 105, 116, 111, 114, 115, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 77, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 73, 110, 112, 117, 116, 77, 101, 116, 114, 105, 99, 115, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 78, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 73, 110, 112, 117, 116, 83, 101, 116, 116, 105, 110, 103, 115, 46, 99, 115, 0, 0, 0, 3, 0, 0, 0, 76, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 46, 99, 115, 0, 0, 0, 3, 0, 0, 0, 80, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 73, 110, 112, 117, 116, 85, 112, 100, 97, 116, 101, 84, 121, 112, 101, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 83, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 78, 97, 116, 105, 118, 101, 73, 110, 112, 117, 116, 82, 117, 110, 116, 105, 109, 101, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 99, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 80, 108, 117, 103, 105, 110, 115, 92, 68, 117, 97, 108, 83, 104, 111, 99, 107, 92, 68, 117, 97, 108, 83, 104, 111, 99, 107, 71, 97, 109, 101, 112, 97, 100, 46, 99, 115, 0, 0, 0, 15, 0, 0, 0, 102, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 80, 108, 117, 103, 105, 110, 115, 92, 68, 117, 97, 108, 83, 104, 111, 99, 107, 92, 68, 117, 97, 108, 83, 104, 111, 99, 107, 71, 97, 109, 101, 112, 97, 100, 72, 73, 68, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 99, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 80, 108, 117, 103, 105, 110, 115, 92, 68, 117, 97, 108, 83, 104, 111, 99, 107, 92, 68, 117, 97, 108, 83, 104, 111, 99, 107, 83, 117, 112, 112, 111, 114, 116, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 100, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 80, 108, 117, 103, 105, 110, 115, 92, 68, 117, 97, 108, 83, 104, 111, 99, 107, 92, 73, 68, 117, 97, 108, 83, 104, 111, 99, 107, 72, 97, 112, 116, 105, 99, 115, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 107, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 80, 108, 117, 103, 105, 110, 115, 92, 69, 110, 104, 97, 110, 99, 101, 100, 84, 111, 117, 99, 104, 92, 69, 110, 104, 97, 110, 99, 101, 100, 84, 111, 117, 99, 104, 83, 117, 112, 112, 111, 114, 116, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 93, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 80, 108, 117, 103, 105, 110, 115, 92, 69, 110, 104, 97, 110, 99, 101, 100, 84, 111, 117, 99, 104, 92, 70, 105, 110, 103, 101, 114, 46, 99, 115, 0, 0, 0, 4, 0, 0, 0, 92, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 80, 108, 117, 103, 105, 110, 115, 92, 69, 110, 104, 97, 110, 99, 101, 100, 84, 111, 117, 99, 104, 92, 84, 111, 117, 99, 104, 46, 99, 115, 0, 0, 0, 2, 0, 0, 0, 99, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 80, 108, 117, 103, 105, 110, 115, 92, 69, 110, 104, 97, 110, 99, 101, 100, 84, 111, 117, 99, 104, 92, 84, 111, 117, 99, 104, 72, 105, 115, 116, 111, 114, 121, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 102, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 80, 108, 117, 103, 105, 110, 115, 92, 69, 110, 104, 97, 110, 99, 101, 100, 84, 111, 117, 99, 104, 92, 84, 111, 117, 99, 104, 83, 105, 109, 117, 108, 97, 116, 105, 111, 110, 46, 99, 115, 0, 0, 0, 6, 0, 0, 0, 80, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 80, 108, 117, 103, 105, 110, 115, 92, 72, 73, 68, 92, 72, 73, 68, 46, 99, 115, 0, 0, 0, 4, 0, 0, 0, 86, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 80, 108, 117, 103, 105, 110, 115, 92, 72, 73, 68, 92, 72, 73, 68, 80, 97, 114, 115, 101, 114, 46, 99, 115, 0, 0, 0, 2, 0, 0, 0, 87, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 80, 108, 117, 103, 105, 110, 115, 92, 72, 73, 68, 92, 72, 73, 68, 83, 117, 112, 112, 111, 114, 116, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 96, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 80, 108, 117, 103, 105, 110, 115, 92, 79, 110, 83, 99, 114, 101, 101, 110, 92, 79, 110, 83, 99, 114, 101, 101, 110, 66, 117, 116, 116, 111, 110, 46, 99, 115, 0, 0, 0, 2, 0, 0, 0, 97, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 80, 108, 117, 103, 105, 110, 115, 92, 79, 110, 83, 99, 114, 101, 101, 110, 92, 79, 110, 83, 99, 114, 101, 101, 110, 67, 111, 110, 116, 114, 111, 108, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 95, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 80, 108, 117, 103, 105, 110, 115, 92, 79, 110, 83, 99, 114, 101, 101, 110, 92, 79, 110, 83, 99, 114, 101, 101, 110, 83, 116, 105, 99, 107, 46, 99, 115, 0, 0, 0, 5, 0, 0, 0, 104, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 80, 108, 117, 103, 105, 110, 115, 92, 80, 108, 97, 121, 101, 114, 73, 110, 112, 117, 116, 92, 68, 101, 102, 97, 117, 108, 116, 73, 110, 112, 117, 116, 65, 99, 116, 105, 111, 110, 115, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 95, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 80, 108, 117, 103, 105, 110, 115, 92, 80, 108, 97, 121, 101, 114, 73, 110, 112, 117, 116, 92, 73, 110, 112, 117, 116, 86, 97, 108, 117, 101, 46, 99, 115, 0, 0, 0, 5, 0, 0, 0, 96, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 80, 108, 117, 103, 105, 110, 115, 92, 80, 108, 97, 121, 101, 114, 73, 110, 112, 117, 116, 92, 80, 108, 97, 121, 101, 114, 73, 110, 112, 117, 116, 46, 99, 115, 0, 0, 0, 3, 0, 0, 0, 103, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 80, 108, 117, 103, 105, 110, 115, 92, 80, 108, 97, 121, 101, 114, 73, 110, 112, 117, 116, 92, 80, 108, 97, 121, 101, 114, 73, 110, 112, 117, 116, 77, 97, 110, 97, 103, 101, 114, 46, 99, 115, 0, 0, 0, 9, 0, 0, 0, 102, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 80, 108, 117, 103, 105, 110, 115, 92, 83, 119, 105, 116, 99, 104, 92, 83, 119, 105, 116, 99, 104, 80, 114, 111, 67, 111, 110, 116, 114, 111, 108, 108, 101, 114, 72, 73, 68, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 96, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 80, 108, 117, 103, 105, 110, 115, 92, 83, 119, 105, 116, 99, 104, 92, 83, 119, 105, 116, 99, 104, 83, 117, 112, 112, 111, 114, 116, 72, 73, 68, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 93, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 80, 108, 117, 103, 105, 110, 115, 92, 85, 73, 92, 66, 97, 115, 101, 73, 110, 112, 117, 116, 79, 118, 101, 114, 114, 105, 100, 101, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 97, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 80, 108, 117, 103, 105, 110, 115, 92, 85, 73, 92, 69, 120, 116, 101, 110, 100, 101, 100, 65, 120, 105, 115, 69, 118, 101, 110, 116, 68, 97, 116, 97, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 100, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 80, 108, 117, 103, 105, 110, 115, 92, 85, 73, 92, 69, 120, 116, 101, 110, 100, 101, 100, 80, 111, 105, 110, 116, 101, 114, 69, 118, 101, 110, 116, 68, 97, 116, 97, 46, 99, 115, 0, 0, 0, 2, 0, 0, 0, 100, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 80, 108, 117, 103, 105, 110, 115, 92, 85, 73, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 85, 73, 73, 110, 112, 117, 116, 77, 111, 100, 117, 108, 101, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 98, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 80, 108, 117, 103, 105, 110, 115, 92, 85, 73, 92, 77, 117, 108, 116, 105, 112, 108, 97, 121, 101, 114, 69, 118, 101, 110, 116, 83, 121, 115, 116, 101, 109, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 91, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 80, 108, 117, 103, 105, 110, 115, 92, 85, 73, 92, 78, 97, 118, 105, 103, 97, 116, 105, 111, 110, 77, 111, 100, 101, 108, 46, 99, 115, 0, 0, 0, 2, 0, 0, 0, 88, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 80, 108, 117, 103, 105, 110, 115, 92, 85, 73, 92, 80, 111, 105, 110, 116, 101, 114, 77, 111, 100, 101, 108, 46, 99, 115, 0, 0, 0, 2, 0, 0, 0, 98, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 80, 108, 117, 103, 105, 110, 115, 92, 85, 73, 92, 84, 114, 97, 99, 107, 101, 100, 68, 101, 118, 105, 99, 101, 82, 97, 121, 99, 97, 115, 116, 101, 114, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 85, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 80, 108, 117, 103, 105, 110, 115, 92, 85, 73, 92, 85, 73, 83, 117, 112, 112, 111, 114, 116, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 93, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 80, 108, 117, 103, 105, 110, 115, 92, 85, 73, 92, 86, 105, 114, 116, 117, 97, 108, 77, 111, 117, 115, 101, 73, 110, 112, 117, 116, 46, 99, 115, 0, 0, 0, 6, 0, 0, 0, 88, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 80, 108, 117, 103, 105, 110, 115, 92, 85, 115, 101, 114, 115, 92, 73, 110, 112, 117, 116, 85, 115, 101, 114, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 101, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 80, 108, 117, 103, 105, 110, 115, 92, 85, 115, 101, 114, 115, 92, 73, 110, 112, 117, 116, 85, 115, 101, 114, 65, 99, 99, 111, 117, 110, 116, 72, 97, 110, 100, 108, 101, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 96, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 80, 108, 117, 103, 105, 110, 115, 92, 85, 115, 101, 114, 115, 92, 73, 110, 112, 117, 116, 85, 115, 101, 114, 83, 101, 116, 116, 105, 110, 103, 115, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 94, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 80, 108, 117, 103, 105, 110, 115, 92, 88, 73, 110, 112, 117, 116, 92, 73, 88, 98, 111, 120, 79, 110, 101, 82, 117, 109, 98, 108, 101, 46, 99, 115, 0, 0, 0, 2, 0, 0, 0, 96, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 80, 108, 117, 103, 105, 110, 115, 92, 88, 73, 110, 112, 117, 116, 92, 88, 73, 110, 112, 117, 116, 67, 111, 110, 116, 114, 111, 108, 108, 101, 114, 46, 99, 115, 0, 0, 0, 2, 0, 0, 0, 103, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 80, 108, 117, 103, 105, 110, 115, 92, 88, 73, 110, 112, 117, 116, 92, 88, 73, 110, 112, 117, 116, 67, 111, 110, 116, 114, 111, 108, 108, 101, 114, 87, 105, 110, 100, 111, 119, 115, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 93, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 80, 108, 117, 103, 105, 110, 115, 92, 88, 73, 110, 112, 117, 116, 92, 88, 73, 110, 112, 117, 116, 83, 117, 112, 112, 111, 114, 116, 46, 99, 115, 0, 0, 0, 2, 0, 0, 0, 96, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 80, 108, 117, 103, 105, 110, 115, 92, 88, 82, 92, 67, 111, 110, 116, 114, 111, 108, 115, 92, 80, 111, 115, 101, 67, 111, 110, 116, 114, 111, 108, 46, 99, 115, 0, 0, 0, 2, 0, 0, 0, 92, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 80, 108, 117, 103, 105, 110, 115, 92, 88, 82, 92, 68, 101, 118, 105, 99, 101, 115, 92, 71, 111, 111, 103, 108, 101, 86, 82, 46, 99, 115, 0, 0, 0, 6, 0, 0, 0, 90, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 80, 108, 117, 103, 105, 110, 115, 92, 88, 82, 92, 68, 101, 118, 105, 99, 101, 115, 92, 79, 99, 117, 108, 117, 115, 46, 99, 115, 0, 0, 0, 7, 0, 0, 0, 90, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 80, 108, 117, 103, 105, 110, 115, 92, 88, 82, 92, 68, 101, 118, 105, 99, 101, 115, 92, 79, 112, 101, 110, 86, 82, 46, 99, 115, 0, 0, 0, 3, 0, 0, 0, 93, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 80, 108, 117, 103, 105, 110, 115, 92, 88, 82, 92, 68, 101, 118, 105, 99, 101, 115, 92, 87, 105, 110, 100, 111, 119, 115, 77, 82, 46, 99, 115, 0, 0, 0, 3, 0, 0, 0, 91, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 80, 108, 117, 103, 105, 110, 115, 92, 88, 82, 92, 71, 101, 110, 101, 114, 105, 99, 88, 82, 68, 101, 118, 105, 99, 101, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 98, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 80, 108, 117, 103, 105, 110, 115, 92, 88, 82, 92, 72, 97, 112, 116, 105, 99, 115, 92, 66, 117, 102, 102, 101, 114, 101, 100, 82, 117, 109, 98, 108, 101, 46, 99, 115, 0, 0, 0, 2, 0, 0, 0, 112, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 80, 108, 117, 103, 105, 110, 115, 92, 88, 82, 92, 72, 97, 112, 116, 105, 99, 115, 92, 71, 101, 116, 67, 117, 114, 114, 101, 110, 116, 72, 97, 112, 116, 105, 99, 83, 116, 97, 116, 101, 67, 111, 109, 109, 97, 110, 100, 46, 99, 115, 0, 0, 0, 2, 0, 0, 0, 112, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 80, 108, 117, 103, 105, 110, 115, 92, 88, 82, 92, 72, 97, 112, 116, 105, 99, 115, 92, 71, 101, 116, 72, 97, 112, 116, 105, 99, 67, 97, 112, 97, 98, 105, 108, 105, 116, 105, 101, 115, 67, 111, 109, 109, 97, 110, 100, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 110, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 80, 108, 117, 103, 105, 110, 115, 92, 88, 82, 92, 72, 97, 112, 116, 105, 99, 115, 92, 83, 101, 110, 100, 66, 117, 102, 102, 101, 114, 101, 100, 72, 97, 112, 116, 105, 99, 115, 67, 111, 109, 109, 97, 110, 100, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 108, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 80, 108, 117, 103, 105, 110, 115, 92, 88, 82, 92, 72, 97, 112, 116, 105, 99, 115, 92, 83, 101, 110, 100, 72, 97, 112, 116, 105, 99, 73, 109, 112, 117, 108, 115, 101, 67, 111, 109, 109, 97, 110, 100, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 93, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 80, 108, 117, 103, 105, 110, 115, 92, 88, 82, 92, 84, 114, 97, 99, 107, 101, 100, 80, 111, 115, 101, 68, 114, 105, 118, 101, 114, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 91, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 80, 108, 117, 103, 105, 110, 115, 92, 88, 82, 92, 88, 82, 76, 97, 121, 111, 117, 116, 66, 117, 105, 108, 100, 101, 114, 46, 99, 115, 0, 0, 0, 9, 0, 0, 0, 85, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 80, 108, 117, 103, 105, 110, 115, 92, 88, 82, 92, 88, 82, 83, 117, 112, 112, 111, 114, 116, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 98, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 83, 116, 97, 116, 101, 92, 73, 73, 110, 112, 117, 116, 83, 116, 97, 116, 101, 67, 97, 108, 108, 98, 97, 99, 107, 82, 101, 99, 101, 105, 118, 101, 114, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 95, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 83, 116, 97, 116, 101, 92, 73, 73, 110, 112, 117, 116, 83, 116, 97, 116, 101, 67, 104, 97, 110, 103, 101, 77, 111, 110, 105, 116, 111, 114, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 90, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 83, 116, 97, 116, 101, 92, 73, 73, 110, 112, 117, 116, 83, 116, 97, 116, 101, 84, 121, 112, 101, 73, 110, 102, 111, 46, 99, 115, 0, 0, 0, 2, 0, 0, 0, 81, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 83, 116, 97, 116, 101, 92, 73, 110, 112, 117, 116, 83, 116, 97, 116, 101, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 86, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 83, 116, 97, 116, 101, 92, 73, 110, 112, 117, 116, 83, 116, 97, 116, 101, 66, 108, 111, 99, 107, 46, 99, 115, 0, 0, 0, 2, 0, 0, 0, 88, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 83, 116, 97, 116, 101, 92, 73, 110, 112, 117, 116, 83, 116, 97, 116, 101, 66, 117, 102, 102, 101, 114, 115, 46, 99, 115, 0, 0, 0, 7, 0, 0, 0, 88, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 105, 110, 112, 117, 116, 115, 121, 115, 116, 101, 109, 64, 49, 46, 55, 46, 48, 92, 73, 110, 112, 117, 116, 83, 121, 115, 116, 101, 109, 92, 83, 116, 97, 116, 101, 92, 73, 110, 112, 117, 116, 83, 116, 97, 116, 101, 72, 105, 115, 116,
BepInEx/plugins/tinyhoot-ShipLoot/ShipLoot/ShipLoot.dll
Decompiled a year agousing System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Logging; using HarmonyLib; using TMPro; using UnityEngine; using UnityEngine.InputSystem; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: AssemblyTitle("ShipLoot")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyProduct("ShipLoot")] [assembly: AssemblyCopyright("Copyright © tinyhoot 2023")] [assembly: ComVisible(false)] [assembly: AssemblyFileVersion("1.0")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] namespace ShipLoot { [BepInPlugin("com.github.tinyhoot.ShipLoot", "ShipLoot", "1.0")] internal class ShipLoot : BaseUnityPlugin { public const string GUID = "com.github.tinyhoot.ShipLoot"; public const string NAME = "ShipLoot"; public const string VERSION = "1.0"; internal static ManualLogSource Log; private void Awake() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) Log = ((BaseUnityPlugin)this).Logger; new Harmony("com.github.tinyhoot.ShipLoot").PatchAll(Assembly.GetExecutingAssembly()); } } } namespace ShipLoot.Patches { [HarmonyPatch] internal class HudManagerPatcher { private static GameObject _totalCounter; private static TextMeshProUGUI _textMesh; private static float _displayTimeLeft; private const float DisplayTime = 5f; [HarmonyPrefix] [HarmonyPatch(typeof(HUDManager), "PingScan_performed")] private static void OnScan(HUDManager __instance, CallbackContext context) { if (!((Object)(object)GameNetworkManager.Instance.localPlayerController == (Object)null) && ((CallbackContext)(ref context)).performed && __instance.CanPlayerScan() && !(__instance.playerPingingScan > -0.5f) && (StartOfRound.Instance.inShipPhase || GameNetworkManager.Instance.localPlayerController.isInHangarShipRoom)) { if (!Object.op_Implicit((Object)(object)_totalCounter)) { CopyValueCounter(); } float num = CalculateLootValue(); ((TMP_Text)_textMesh).text = $"SHIP: ${num:F0}"; _displayTimeLeft = 5f; if (!_totalCounter.activeSelf) { ((MonoBehaviour)GameNetworkManager.Instance).StartCoroutine(ShipLootCoroutine()); } } } private static IEnumerator ShipLootCoroutine() { _totalCounter.SetActive(true); while (_displayTimeLeft > 0f) { float displayTimeLeft = _displayTimeLeft; _displayTimeLeft = 0f; yield return (object)new WaitForSeconds(displayTimeLeft); } _totalCounter.SetActive(false); } private static float CalculateLootValue() { List<GrabbableObject> list = (from obj in GameObject.Find("/Environment/HangarShip").GetComponentsInChildren<GrabbableObject>() where ((Object)obj).name != "ClipboardManual" && ((Object)obj).name != "StickyNoteItem" select obj).ToList(); ShipLoot.Log.LogDebug((object)"Calculating total ship scrap value."); CollectionExtensions.Do<GrabbableObject>((IEnumerable<GrabbableObject>)list, (Action<GrabbableObject>)delegate(GrabbableObject scrap) { ShipLoot.Log.LogDebug((object)$"{((Object)scrap).name} - ${scrap.scrapValue}"); }); return list.Sum((GrabbableObject scrap) => scrap.scrapValue); } private static void CopyValueCounter() { //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0076: 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_008d: Unknown result type (might be due to invalid IL or missing references) GameObject val = GameObject.Find("/Systems/UI/Canvas/IngamePlayerHUD/BottomMiddle/ValueCounter"); if (!Object.op_Implicit((Object)(object)val)) { ShipLoot.Log.LogError((object)"Failed to find ValueCounter object to copy!"); } _totalCounter = Object.Instantiate<GameObject>(val.gameObject, val.transform.parent, false); _totalCounter.transform.Translate(0f, 1f, 0f); Vector3 localPosition = _totalCounter.transform.localPosition; _totalCounter.transform.localPosition = new Vector3(localPosition.x + 50f, -50f, localPosition.z); _textMesh = _totalCounter.GetComponentInChildren<TextMeshProUGUI>(); } } }
BepInEx/plugins/vasanex-ItemQuickSwitch/ItemQuickSwitchMod.dll
Decompiled a year agousing System; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Configuration; using GameNetcodeStuff; using HarmonyLib; using Microsoft.CodeAnalysis; using Unity.Netcode; using UnityEngine; using UnityEngine.InputSystem; using UnityEngine.InputSystem.Controls; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("ItemQuickSwitchMod")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyDescription("Mod for selecting item slots directly")] [assembly: AssemblyFileVersion("1.1.0.0")] [assembly: AssemblyInformationalVersion("1.1.0")] [assembly: AssemblyProduct("ItemQuickSwitchMod")] [assembly: AssemblyTitle("ItemQuickSwitchMod")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.1.0.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; } } } namespace ItemQuickSwitchMod { public sealed class CustomAction { public class ActionItem { public string Id { get; } public Key Shortcut { get; } public string Description { get; } public int SlotNumber { get; } public ConfigEntry<Key> ConfigEntry { get; set; } public ActionItem(string id, Key config, string description, int slotNumber) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0018: 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) Id = id; Shortcut = config; Description = description; SlotNumber = slotNumber; } } public static readonly ActionItem Emote1 = new ActionItem("Emote1", (Key)94, "Dance emote", 0); public static readonly ActionItem Emote2 = new ActionItem("Emote2", (Key)95, "Point emote", 0); public static readonly ActionItem Slot1 = new ActionItem("Slot1", (Key)41, "Equip Slot 1", 0); public static readonly ActionItem Slot2 = new ActionItem("Slot2", (Key)42, "Equip Slot 2", 1); public static readonly ActionItem Slot3 = new ActionItem("Slot3", (Key)43, "Equip Slot 3", 2); public static readonly ActionItem Slot4 = new ActionItem("Slot4", (Key)44, "Equip Slot 4", 3); public static readonly ActionItem[] AllActions = new ActionItem[6] { Emote1, Emote2, Slot1, Slot2, Slot3, Slot4 }; } [BepInPlugin("de.vasanex.ItemQuickSwitchMod", "ItemQuickSwitchMod", "1.1.0")] public class ItemQuickSwitchMod : BaseUnityPlugin { private Harmony _harmony; private void Awake() { //IL_0034: 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_0068: Expected O, but got Unknown ((BaseUnityPlugin)this).Logger.LogInfo((object)"ItemQuickSwitchMod is creating binds!"); CustomAction.ActionItem[] allActions = CustomAction.AllActions; foreach (CustomAction.ActionItem actionItem in allActions) { ConfigEntry<Key> configEntry = ((BaseUnityPlugin)this).Config.Bind<Key>("Bindings", actionItem.Id, actionItem.Shortcut, actionItem.Description); actionItem.ConfigEntry = configEntry; } _harmony = new Harmony("de.vasanex.ItemQuickSwitchMod"); _harmony.PatchAll(); ((BaseUnityPlugin)this).Logger.LogInfo((object)"Plugin ItemQuickSwitchMod is loaded!"); } } public static class StaticPluginInfo { public const string GUID = "de.vasanex.ItemQuickSwitchMod"; public const string NAME = "ItemQuickSwitchMod"; } public static class PluginInfo { public const string PLUGIN_GUID = "ItemQuickSwitchMod"; public const string PLUGIN_NAME = "ItemQuickSwitchMod"; public const string PLUGIN_VERSION = "1.1.0"; } } namespace ItemQuickSwitchMod.Patches { [HarmonyPatch(typeof(PlayerControllerB))] internal class PlayerControllerBPatch { private static readonly Dictionary<string, MethodInfo> MethodCache = new Dictionary<string, MethodInfo>(); private static readonly object[] BackwardsParam = new object[1] { false }; private static readonly object[] ForwardsParam = new object[1] { true }; private static object InvokePrivateMethod(PlayerControllerB instance, string methodName, object[] parameters = null) { MethodCache.TryGetValue(methodName, out var value); if ((object)value == null) { value = typeof(PlayerControllerB).GetMethod(methodName, BindingFlags.Instance | BindingFlags.NonPublic); } MethodCache[methodName] = value; return value?.Invoke(instance, parameters); } [HarmonyPatch("Update")] [HarmonyPostfix] public static void PlayerControllerB_Update(PlayerControllerB __instance, ref float ___timeSinceSwitchingSlots, ref bool ___throwingObject) { if ((!((NetworkBehaviour)__instance).IsOwner || !__instance.isPlayerControlled || (((NetworkBehaviour)__instance).IsServer && !__instance.isHostPlayerObject)) && !__instance.isTestingPlayer) { return; } CustomAction.ActionItem actionItem = Array.Find(CustomAction.AllActions, (CustomAction.ActionItem it) => ((ButtonControl)Keyboard.current[it.ConfigEntry.Value]).wasPressedThisFrame); if (actionItem == null) { return; } string id = actionItem.Id; string text = id; if (!(text == "Emote1")) { if (text == "Emote2") { PerformEmote(__instance, 2); return; } StopEmotes(__instance); if (SwitchItemSlots(__instance, actionItem.SlotNumber, ___timeSinceSwitchingSlots, ___throwingObject)) { ___timeSinceSwitchingSlots = 0f; } } else { PerformEmote(__instance, 1); } } private static void PerformEmote(PlayerControllerB __instance, int emoteId) { __instance.timeSinceStartingEmote = 0f; __instance.performingEmote = true; __instance.playerBodyAnimator.SetInteger("emoteNumber", emoteId); __instance.StartPerformingEmoteServerRpc(); } private static bool SwitchItemSlots(PlayerControllerB __instance, int requestedSlot, float timeSinceSwitchingSlots, bool isThrowingObject) { if (!IsItemSwitchPossible(__instance, timeSinceSwitchingSlots, isThrowingObject) || __instance.currentItemSlot == requestedSlot) { return false; } int num = __instance.currentItemSlot - requestedSlot; bool flag = num > 0; if (Math.Abs(num) == __instance.ItemSlots.Length - 1) { object[] parameters = (flag ? ForwardsParam : BackwardsParam); InvokePrivateMethod(__instance, "SwitchItemSlotsServerRpc", parameters); } else { object[] parameters2 = (flag ? BackwardsParam : ForwardsParam); do { InvokePrivateMethod(__instance, "SwitchItemSlotsServerRpc", parameters2); num += ((!flag) ? 1 : (-1)); } while (num != 0); } ShipBuildModeManager.Instance.CancelBuildMode(true); __instance.playerBodyAnimator.SetBool("GrabValidated", false); object[] parameters3 = new object[2] { requestedSlot, null }; InvokePrivateMethod(__instance, "SwitchToItemSlot", parameters3); if ((Object)(object)__instance.currentlyHeldObjectServer != (Object)null) { ((Component)__instance.currentlyHeldObjectServer).gameObject.GetComponent<AudioSource>().PlayOneShot(__instance.currentlyHeldObjectServer.itemProperties.grabSFX, 0.6f); } return true; } private static bool IsItemSwitchPossible(PlayerControllerB __instance, float timeSinceSwitchingSlots, bool isThrowingObject) { return !((double)timeSinceSwitchingSlots < 0.01 || __instance.inTerminalMenu || __instance.isGrabbingObjectAnimation || __instance.inSpecialInteractAnimation || isThrowingObject) && !__instance.isTypingChat && !__instance.twoHanded && !__instance.activatingItem && !__instance.jetpackControls && !__instance.disablingJetpackControls; } private static void StopEmotes(PlayerControllerB __instance) { __instance.performingEmote = false; __instance.StopPerformingEmoteServerRpc(); __instance.timeSinceStartingEmote = 0f; } } }
BepInEx/plugins/x753-Mimics/Mimics.dll
Decompiled a year agousing System; using System.CodeDom.Compiler; using System.Collections; using System.Collections.Generic; using System.ComponentModel; using System.Diagnostics; using System.Globalization; using System.Reflection; using System.Resources; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using DunGen; using GameNetcodeStuff; using HarmonyLib; using LethalCompanyMimics.Properties; using Unity.Netcode; using UnityEngine; using UnityEngine.Events; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = "")] [assembly: AssemblyCompany("Mimics")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyDescription("A mod that adds mimics to Lethal Company")] [assembly: AssemblyFileVersion("2.0.0.0")] [assembly: AssemblyInformationalVersion("2.0.0")] [assembly: AssemblyProduct("Mimics")] [assembly: AssemblyTitle("Mimics")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("2.0.0.0")] [module: UnverifiableCode] internal class <Module> { static <Module>() { } } namespace LethalCompanyMimics.Properties { [GeneratedCode("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] [DebuggerNonUserCode] [CompilerGenerated] internal class Resources { private static ResourceManager resourceMan; private static CultureInfo resourceCulture; [EditorBrowsable(EditorBrowsableState.Advanced)] internal static ResourceManager ResourceManager { get { if (resourceMan == null) { ResourceManager resourceManager = new ResourceManager("LethalCompanyMimics.Properties.Resources", typeof(Resources).Assembly); resourceMan = resourceManager; } return resourceMan; } } [EditorBrowsable(EditorBrowsableState.Advanced)] internal static CultureInfo Culture { get { return resourceCulture; } set { resourceCulture = value; } } internal static byte[] mimicdoor { get { object @object = ResourceManager.GetObject("mimicdoor", resourceCulture); return (byte[])@object; } } internal Resources() { } } } namespace Mimics { [BepInPlugin("x753.Mimics", "Mimics", "2.0.0")] public class Mimics : BaseUnityPlugin { [HarmonyPatch(typeof(GameNetworkManager))] internal class GameNetworkManagerPatch { [HarmonyPatch("Start")] [HarmonyPostfix] private static void StartPatch() { ((Component)GameNetworkManager.Instance).GetComponent<NetworkManager>().AddNetworkPrefab(MimicNetworkerPrefab); } } [HarmonyPatch(typeof(RoundManager))] internal class RoundManagerPatch { [HarmonyPatch("SetExitIDs")] [HarmonyPostfix] private static void SetExitIDsPatch(ref RoundManager __instance, Vector3 mainEntrancePosition) { //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: 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_0113: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_013f: Unknown result type (might be due to invalid IL or missing references) //IL_014f: 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_0160: Unknown result type (might be due to invalid IL or missing references) //IL_0167: 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_0480: Unknown result type (might be due to invalid IL or missing references) //IL_0491: Unknown result type (might be due to invalid IL or missing references) //IL_0496: Unknown result type (might be due to invalid IL or missing references) //IL_049b: Unknown result type (might be due to invalid IL or missing references) //IL_04a0: Unknown result type (might be due to invalid IL or missing references) //IL_04ae: Unknown result type (might be due to invalid IL or missing references) //IL_04b3: Unknown result type (might be due to invalid IL or missing references) //IL_04b5: 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_01f6: Unknown result type (might be due to invalid IL or missing references) //IL_0207: Unknown result type (might be due to invalid IL or missing references) //IL_020c: Unknown result type (might be due to invalid IL or missing references) //IL_0211: Unknown result type (might be due to invalid IL or missing references) //IL_0216: Unknown result type (might be due to invalid IL or missing references) //IL_0220: Unknown result type (might be due to invalid IL or missing references) //IL_0225: Unknown result type (might be due to invalid IL or missing references) //IL_022a: Unknown result type (might be due to invalid IL or missing references) //IL_0230: Unknown result type (might be due to invalid IL or missing references) //IL_0238: Unknown result type (might be due to invalid IL or missing references) //IL_0241: Unknown result type (might be due to invalid IL or missing references) //IL_024b: Unknown result type (might be due to invalid IL or missing references) //IL_04eb: Unknown result type (might be due to invalid IL or missing references) //IL_052c: Unknown result type (might be due to invalid IL or missing references) //IL_02cd: Unknown result type (might be due to invalid IL or missing references) //IL_02d5: Unknown result type (might be due to invalid IL or missing references) //IL_02de: Unknown result type (might be due to invalid IL or missing references) //IL_02e8: Unknown result type (might be due to invalid IL or missing references) //IL_05c6: Unknown result type (might be due to invalid IL or missing references) //IL_05cb: Unknown result type (might be due to invalid IL or missing references) //IL_05cf: Unknown result type (might be due to invalid IL or missing references) //IL_05db: Unknown result type (might be due to invalid IL or missing references) //IL_05e0: Unknown result type (might be due to invalid IL or missing references) //IL_05e4: Unknown result type (might be due to invalid IL or missing references) //IL_05e9: Unknown result type (might be due to invalid IL or missing references) //IL_06d9: Unknown result type (might be due to invalid IL or missing references) //IL_06e3: Expected O, but got Unknown //IL_07b2: Unknown result type (might be due to invalid IL or missing references) //IL_07d9: Unknown result type (might be due to invalid IL or missing references) //IL_0753: Unknown result type (might be due to invalid IL or missing references) //IL_077a: Unknown result type (might be due to invalid IL or missing references) //IL_088d: Unknown result type (might be due to invalid IL or missing references) //IL_08b4: Unknown result type (might be due to invalid IL or missing references) if (((NetworkBehaviour)__instance).IsServer && (Object)(object)MimicNetworker.Instance == (Object)null) { GameObject val = Object.Instantiate<GameObject>(MimicNetworkerPrefab); val.GetComponent<NetworkObject>().Spawn(true); } MimicDoor.allMimics = new List<MimicDoor>(); int num = 0; Dungeon currentDungeon = __instance.dungeonGenerator.Generator.CurrentDungeon; List<Doorway> list = new List<Doorway>(); Bounds val3 = default(Bounds); foreach (Tile allTile in currentDungeon.AllTiles) { foreach (Doorway unusedDoorway in allTile.UnusedDoorways) { if (unusedDoorway.HasDoorPrefabInstance || (Object)(object)((Component)unusedDoorway).GetComponentInChildren<SpawnSyncedObject>(true) == (Object)null) { continue; } GameObject gameObject = ((Component)((Component)((Component)unusedDoorway).GetComponentInChildren<SpawnSyncedObject>(true)).transform.parent).gameObject; if (!((Object)gameObject).name.StartsWith("AlleyExitDoorContainer") || gameObject.activeSelf) { continue; } bool flag = false; Matrix4x4 val2 = Matrix4x4.TRS(((Component)unusedDoorway).transform.position, ((Component)unusedDoorway).transform.rotation, new Vector3(1f, 1f, 1f)); ((Bounds)(ref val3))..ctor(new Vector3(0f, 1.5f, 5.5f), new Vector3(2f, 6f, 8f)); ((Bounds)(ref val3)).center = ((Matrix4x4)(ref val2)).MultiplyPoint3x4(((Bounds)(ref val3)).center); Collider[] array = Physics.OverlapBox(((Bounds)(ref val3)).center, ((Bounds)(ref val3)).extents, ((Component)unusedDoorway).transform.rotation, LayerMask.GetMask(new string[3] { "Room", "Railing", "MapHazards" })); Collider[] array2 = array; int num2 = 0; if (num2 < array2.Length) { Collider val4 = array2[num2]; flag = true; } if (flag) { continue; } foreach (Tile allTile2 in currentDungeon.AllTiles) { if (!((Object)(object)allTile == (Object)(object)allTile2)) { Vector3 origin = ((Component)unusedDoorway).transform.position + 5f * ((Component)unusedDoorway).transform.forward; Bounds val5 = UnityUtil.CalculateProxyBounds(((Component)allTile2).gameObject, true, Vector3.up); Ray val6 = default(Ray); ((Ray)(ref val6)).origin = origin; ((Ray)(ref val6)).direction = Vector3.up; if (((Bounds)(ref val5)).IntersectRay(val6) && (((Object)allTile2).name.Contains("Catwalk") || ((Object)allTile2).name.Contains("LargeForkTile") || ((Object)allTile2).name.Contains("4x4BigStair") || ((Object)allTile2).name.Contains("ElevatorConnector") || (((Object)allTile2).name.Contains("StartRoom") && !((Object)allTile2).name.Contains("Manor")))) { flag = true; } val6 = default(Ray); ((Ray)(ref val6)).origin = origin; ((Ray)(ref val6)).direction = Vector3.down; if (((Bounds)(ref val5)).IntersectRay(val6) && (((Object)allTile2).name.Contains("MediumRoomHallway1B") || ((Object)allTile2).name.Contains("LargeForkTile") || ((Object)allTile2).name.Contains("4x4BigStair") || ((Object)allTile2).name.Contains("ElevatorConnector") || ((Object)allTile2).name.Contains("StartRoom"))) { flag = true; } } } if (!flag) { list.Add(unusedDoorway); } } } Shuffle(list, StartOfRound.Instance.randomMapSeed); List<Vector3> list2 = new List<Vector3>(); foreach (Doorway item in list) { int num3 = 0; int num4 = 0; int[] spawnRates = SpawnRates; foreach (int num5 in spawnRates) { num4 += num5; } Random random = new Random(StartOfRound.Instance.randomMapSeed + 753); int num6 = random.Next(0, num4); int num7 = 0; for (int j = 0; j < SpawnRates.Length; j++) { if (num6 < SpawnRates[j] + num7) { num3 = j; break; } num7 += SpawnRates[j]; } if (num3 == num && num3 != 6) { break; } bool flag2 = false; Vector3 val7 = ((Component)item).transform.position + 5f * ((Component)item).transform.forward; foreach (Vector3 item2 in list2) { if (Vector3.Distance(val7, item2) < 4f) { flag2 = true; break; } } if (flag2) { continue; } list2.Add(val7); GameObject gameObject2 = ((Component)((Component)((Component)item).GetComponentInChildren<SpawnSyncedObject>(true)).transform.parent).gameObject; GameObject val8 = Object.Instantiate<GameObject>(MimicPrefab, ((Component)item).transform); val8.transform.position = gameObject2.transform.position; MimicDoor component = val8.GetComponent<MimicDoor>(); AudioSource[] componentsInChildren = val8.GetComponentsInChildren<AudioSource>(true); foreach (AudioSource val9 in componentsInChildren) { val9.volume = MimicVolume / 100f; val9.outputAudioMixerGroup = StartOfRound.Instance.ship3DAudio.outputAudioMixerGroup; } MimicDoor.allMimics.Add(component); component.mimicIndex = num; num++; GameObject gameObject3 = ((Component)((Component)item).transform.GetChild(0)).gameObject; gameObject3.SetActive(false); Bounds bounds = ((Collider)component.frameBox).bounds; Vector3 center = ((Bounds)(ref bounds)).center; bounds = ((Collider)component.frameBox).bounds; Collider[] array3 = Physics.OverlapBox(center, ((Bounds)(ref bounds)).extents, Quaternion.identity); foreach (Collider val10 in array3) { if (((Object)((Component)val10).gameObject).name.Contains("Shelf")) { ((Component)val10).gameObject.SetActive(false); } } Light componentInChildren = gameObject2.GetComponentInChildren<Light>(true); ((Component)componentInChildren).transform.parent.SetParent(val8.transform); MeshRenderer[] componentsInChildren2 = val8.GetComponentsInChildren<MeshRenderer>(); MeshRenderer[] array4 = componentsInChildren2; foreach (MeshRenderer val11 in array4) { Material[] materials = ((Renderer)val11).materials; foreach (Material val12 in materials) { val12.shader = ((Renderer)gameObject3.GetComponentInChildren<MeshRenderer>(true)).material.shader; val12.renderQueue = ((Renderer)gameObject3.GetComponentInChildren<MeshRenderer>(true)).material.renderQueue; } } component.interactTrigger.onInteract = new InteractEvent(); ((UnityEvent<PlayerControllerB>)(object)component.interactTrigger.onInteract).AddListener((UnityAction<PlayerControllerB>)component.TouchMimic); if (MimicPerfection) { continue; } component.interactTrigger.timeToHold = 0.9f; if (!ColorBlindMode) { if ((StartOfRound.Instance.randomMapSeed + num) % 2 == 0) { ((Renderer)val8.GetComponentsInChildren<MeshRenderer>()[0]).material.color = new Color(0.490566f, 0.1226415f, 0.1302275f); ((Renderer)val8.GetComponentsInChildren<MeshRenderer>()[1]).material.color = new Color(0.4339623f, 0.1043965f, 0.1150277f); componentInChildren.colorTemperature = 1250f; } else { ((Renderer)val8.GetComponentsInChildren<MeshRenderer>()[0]).material.color = new Color(0.5f, 0.1580188f, 0.1657038f); ((Renderer)val8.GetComponentsInChildren<MeshRenderer>()[1]).material.color = new Color(43f / 106f, 0.1358579f, 0.1393619f); componentInChildren.colorTemperature = 1300f; } } else if ((StartOfRound.Instance.randomMapSeed + num) % 2 == 0) { component.interactTrigger.timeToHold = 1.1f; } else { component.interactTrigger.timeToHold = 1f; } if (!EasyMode) { continue; } Random random2 = new Random(StartOfRound.Instance.randomMapSeed + num); switch (random2.Next(0, 4)) { case 0: if (!ColorBlindMode) { ((Renderer)val8.GetComponentsInChildren<MeshRenderer>()[0]).material.color = new Color(0.489f, 0.2415526f, 0.1479868f); ((Renderer)val8.GetComponentsInChildren<MeshRenderer>()[1]).material.color = new Color(0.489f, 0.2415526f, 0.1479868f); } else { component.interactTrigger.timeToHold = 1.5f; } break; case 1: component.interactTrigger.hoverTip = "Feed : [LMB]"; component.interactTrigger.holdTip = "Feed : [LMB]"; break; case 2: component.interactTrigger.hoverIcon = component.LostFingersIcon; break; case 3: component.interactTrigger.holdTip = "DIE : [LMB]"; component.interactTrigger.timeToHold = 0.5f; break; default: component.interactTrigger.hoverTip = "BUG, REPORT TO DEVELOPER"; break; } } } } [HarmonyPatch(typeof(SprayPaintItem))] internal class SprayPaintItemPatch { private static FieldInfo SprayHit = typeof(SprayPaintItem).GetField("sprayHit", BindingFlags.Instance | BindingFlags.NonPublic); [HarmonyPatch("SprayPaintClientRpc")] [HarmonyPostfix] private static void SprayPaintClientRpcPatch(SprayPaintItem __instance, Vector3 sprayPos, Vector3 sprayRot) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) RaycastHit val = (RaycastHit)SprayHit.GetValue(__instance); if (((Object)((RaycastHit)(ref val)).collider).name == "MimicSprayCollider") { MimicDoor component = ((Component)((Component)((RaycastHit)(ref val)).collider).transform.parent.parent).GetComponent<MimicDoor>(); component.sprayCount++; if (component.sprayCount > 9) { MimicNetworker.Instance.MimicAddAnger(1, component.mimicIndex); } } } } private const string modGUID = "x753.Mimics"; private const string modName = "Mimics"; private const string modVersion = "2.0.0"; private readonly Harmony harmony = new Harmony("x753.Mimics"); private static Mimics Instance; public static GameObject MimicPrefab; public static GameObject MimicNetworkerPrefab; public static int[] SpawnRates; public static bool MimicPerfection; public static bool EasyMode; public static bool ColorBlindMode; public static float MimicVolume; private void Awake() { AssetBundle val = AssetBundle.LoadFromMemory(Resources.mimicdoor); MimicPrefab = val.LoadAsset<GameObject>("Assets/MimicDoor.prefab"); MimicNetworkerPrefab = val.LoadAsset<GameObject>("Assets/MimicNetworker.prefab"); if ((Object)(object)Instance == (Object)null) { Instance = this; } harmony.PatchAll(); ((BaseUnityPlugin)this).Logger.LogInfo((object)"Plugin Mimics is loaded!"); SpawnRates = new int[7] { ((BaseUnityPlugin)this).Config.Bind<int>("Spawn Rate", "Zero Mimics", 22, "Weight of zero mimics spawning").Value, ((BaseUnityPlugin)this).Config.Bind<int>("Spawn Rate", "One Mimic", 69, "Weight of one mimic spawning").Value, ((BaseUnityPlugin)this).Config.Bind<int>("Spawn Rate", "Two Mimics", 7, "Weight of two mimics spawning").Value, ((BaseUnityPlugin)this).Config.Bind<int>("Spawn Rate", "Three Mimics", 1, "Weight of three mimics spawning").Value, ((BaseUnityPlugin)this).Config.Bind<int>("Spawn Rate", "Four Mimics", 1, "Weight of four mimics spawning").Value, ((BaseUnityPlugin)this).Config.Bind<int>("Spawn Rate", "Five Mimics", 0, "Weight of five mimics spawning").Value, ((BaseUnityPlugin)this).Config.Bind<int>("Spawn Rate", "Maximum Mimics", 0, "Weight of maximum mimics spawning").Value }; MimicPerfection = ((BaseUnityPlugin)this).Config.Bind<bool>("Difficulty", "Perfect Mimics", false, "Select this if you want mimics to be the exact same color as the real thing. Overrides all difficulty settings.").Value; EasyMode = ((BaseUnityPlugin)this).Config.Bind<bool>("Difficulty", "Easy Mode", false, "Each mimic will have one of several possible imperfections to help you tell if it's a mimic.").Value; ColorBlindMode = ((BaseUnityPlugin)this).Config.Bind<bool>("Difficulty", "Color Blind Mode", false, "Replaces all color differences with another way to differentiate mimics.").Value; MimicVolume = ((BaseUnityPlugin)this).Config.Bind<int>("General", "SFX Volume", 100, "Volume of the mimic's SFX (0-100)").Value; if (MimicVolume < 0f) { MimicVolume = 0f; } if (MimicVolume > 100f) { MimicVolume = 100f; } ((BaseUnityPlugin)this).Config.Bind<int>("Difficulty", "Difficulty Level", 0, "This is an old setting, ignore it."); ((BaseUnityPlugin)this).Config.Remove(((BaseUnityPlugin)this).Config["Difficulty", "Difficulty Level"].Definition); ((BaseUnityPlugin)this).Config.Save(); 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); } } } } public static void Shuffle<T>(IList<T> list, int seed) { Random random = new Random(seed); int num = list.Count; while (num > 1) { num--; int index = random.Next(num + 1); T value = list[index]; list[index] = list[num]; list[num] = value; } } } public class MimicNetworker : NetworkBehaviour { public static MimicNetworker Instance; private void Awake() { Instance = this; } public void MimicAttack(int playerId, int mimicIndex, bool ownerOnly = false) { if (((NetworkBehaviour)this).IsOwner) { Instance.MimicAttackClientRpc(playerId, mimicIndex); } else if (!ownerOnly) { Instance.MimicAttackServerRpc(playerId, mimicIndex); } } [ClientRpc] public void MimicAttackClientRpc(int playerId, int mimicIndex) { //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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2885019175u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, playerId); BytePacker.WriteValueBitPacked(val2, mimicIndex); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2885019175u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost)) { ((MonoBehaviour)this).StartCoroutine(MimicDoor.allMimics[mimicIndex].Attack(playerId)); } } } [ServerRpc(RequireOwnership = false)] public void MimicAttackServerRpc(int playerId, int mimicIndex) { //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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(1024971481u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, playerId); BytePacker.WriteValueBitPacked(val2, mimicIndex); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1024971481u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { Instance.MimicAttackClientRpc(playerId, mimicIndex); } } } public void MimicAddAnger(int amount, int mimicIndex) { if (((NetworkBehaviour)this).IsOwner) { Instance.MimicAddAngerClientRpc(amount, mimicIndex); } else { Instance.MimicAddAngerServerRpc(amount, mimicIndex); } } [ClientRpc] public void MimicAddAngerClientRpc(int amount, int mimicIndex) { //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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1137632670u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, amount); BytePacker.WriteValueBitPacked(val2, mimicIndex); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1137632670u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost)) { ((MonoBehaviour)this).StartCoroutine(MimicDoor.allMimics[mimicIndex].AddAnger(amount)); } } } [ServerRpc(RequireOwnership = false)] public void MimicAddAngerServerRpc(int amount, int mimicIndex) { //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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(669208889u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, amount); BytePacker.WriteValueBitPacked(val2, mimicIndex); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 669208889u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { Instance.MimicAddAngerClientRpc(amount, mimicIndex); } } } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } [RuntimeInitializeOnLoadMethod] internal static void InitializeRPCS_MimicNetworker() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Expected O, but got Unknown //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Expected O, but got Unknown NetworkManager.__rpc_func_table.Add(2885019175u, new RpcReceiveHandler(__rpc_handler_2885019175)); NetworkManager.__rpc_func_table.Add(1024971481u, new RpcReceiveHandler(__rpc_handler_1024971481)); NetworkManager.__rpc_func_table.Add(1137632670u, new RpcReceiveHandler(__rpc_handler_1137632670)); NetworkManager.__rpc_func_table.Add(669208889u, new RpcReceiveHandler(__rpc_handler_669208889)); } private static void __rpc_handler_2885019175(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) { int playerId = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerId); int mimicIndex = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref mimicIndex); target.__rpc_exec_stage = (__RpcExecStage)2; ((MimicNetworker)(object)target).MimicAttackClientRpc(playerId, mimicIndex); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1024971481(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) { int playerId = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerId); int mimicIndex = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref mimicIndex); target.__rpc_exec_stage = (__RpcExecStage)1; ((MimicNetworker)(object)target).MimicAttackServerRpc(playerId, mimicIndex); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1137632670(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) { int amount = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref amount); int mimicIndex = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref mimicIndex); target.__rpc_exec_stage = (__RpcExecStage)2; ((MimicNetworker)(object)target).MimicAddAngerClientRpc(amount, mimicIndex); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_669208889(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) { int amount = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref amount); int mimicIndex = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref mimicIndex); target.__rpc_exec_stage = (__RpcExecStage)1; ((MimicNetworker)(object)target).MimicAddAngerServerRpc(amount, mimicIndex); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "MimicNetworker"; } } public class MimicDoor : MonoBehaviour { public GameObject playerTarget; public BoxCollider frameBox; public Sprite LostFingersIcon; public Animator mimicAnimator; public GameObject grabPoint; public InteractTrigger interactTrigger; public int anger; public bool angering; public int sprayCount; private bool attacking; public static List<MimicDoor> allMimics; public int mimicIndex; public void TouchMimic(PlayerControllerB player) { if (!attacking) { MimicNetworker.Instance.MimicAttack((int)player.playerClientId, mimicIndex); } } public IEnumerator Attack(int playerId) { attacking = true; interactTrigger.interactable = false; PlayerControllerB player = StartOfRound.Instance.allPlayerScripts[playerId]; mimicAnimator.SetTrigger("Attack"); playerTarget.transform.position = ((Component)player).transform.position; yield return (object)new WaitForSeconds(0.1f); playerTarget.transform.position = ((Component)player).transform.position; yield return (object)new WaitForSeconds(0.1f); playerTarget.transform.position = ((Component)player).transform.position; yield return (object)new WaitForSeconds(0.1f); playerTarget.transform.position = ((Component)player).transform.position; yield return (object)new WaitForSeconds(0.1f); float num = Vector3.Distance(((Component)GameNetworkManager.Instance.localPlayerController).transform.position, ((Component)frameBox).transform.position); if (num < 8f) { HUDManager.Instance.ShakeCamera((ScreenShakeType)1); } else if (num < 14f) { HUDManager.Instance.ShakeCamera((ScreenShakeType)0); } yield return (object)new WaitForSeconds(0.2f); if (((NetworkBehaviour)player).IsOwner && Vector3.Distance(((Component)player).transform.position, ((Component)this).transform.position) < 10f) { player.KillPlayer(Vector3.zero, true, (CauseOfDeath)0, 0); } float startTime = Time.timeSinceLevelLoad; yield return (object)new WaitUntil((Func<bool>)(() => (Object)(object)player.deadBody != (Object)null || Time.timeSinceLevelLoad - startTime > 4f)); if ((Object)(object)player.deadBody != (Object)null) { player.deadBody.attachedTo = grabPoint.transform; player.deadBody.attachedLimb = player.deadBody.bodyParts[5]; player.deadBody.matchPositionExactly = true; for (int i = 0; i < player.deadBody.bodyParts.Length; i++) { ((Component)player.deadBody.bodyParts[i]).GetComponent<Collider>().excludeLayers = LayerMask.op_Implicit(-1); } } yield return (object)new WaitForSeconds(2f); if ((Object)(object)player.deadBody != (Object)null) { player.deadBody.attachedTo = null; player.deadBody.attachedLimb = null; player.deadBody.matchPositionExactly = false; ((Component)((Component)player.deadBody).transform.GetChild(0)).gameObject.SetActive(false); player.deadBody = null; } yield return (object)new WaitForSeconds(4.5f); attacking = false; interactTrigger.interactable = true; } public IEnumerator AddAnger(int amount) { if (angering || attacking) { yield break; } angering = true; anger += amount; if (anger == 1) { Sprite oldIcon2 = interactTrigger.hoverIcon; interactTrigger.hoverIcon = LostFingersIcon; mimicAnimator.SetTrigger("Growl"); yield return (object)new WaitForSeconds(2.75f); interactTrigger.hoverIcon = oldIcon2; sprayCount = 0; angering = false; yield break; } if (anger == 2) { interactTrigger.holdTip = "DIE : [LMB]"; interactTrigger.timeToHold = 0.25f; Sprite oldIcon2 = interactTrigger.hoverIcon; interactTrigger.hoverIcon = LostFingersIcon; mimicAnimator.SetTrigger("Growl"); yield return (object)new WaitForSeconds(2.75f); interactTrigger.hoverIcon = oldIcon2; sprayCount = 0; angering = false; yield break; } if (anger > 2) { PlayerControllerB val = null; float num = 9999f; PlayerControllerB[] allPlayerScripts = StartOfRound.Instance.allPlayerScripts; foreach (PlayerControllerB val2 in allPlayerScripts) { float num2 = Vector3.Distance(((Component)this).transform.position, ((Component)val2).transform.position); if (num2 < num) { num = num2; val = val2; } } if ((Object)(object)val != (Object)null) { MimicNetworker.Instance.MimicAttackClientRpc((int)val.playerClientId, mimicIndex); } } sprayCount = 0; angering = false; } } public class MimicCollider : MonoBehaviour, IHittable { public MimicDoor mimic; void IHittable.Hit(int force, Vector3 hitDirection, PlayerControllerB playerWhoHit = null, bool playHitSFX = false) { MimicNetworker.Instance.MimicAddAnger(1, mimic.mimicIndex); } } }
BepInEx/plugins/x753-More_Suits/MoreSuits.dll
Decompiled a year agousing System; 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 BepInEx; using HarmonyLib; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = "")] [assembly: AssemblyCompany("MoreSuits")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyDescription("A mod that adds more suit options to Lethal Company")] [assembly: AssemblyFileVersion("1.4.0.0")] [assembly: AssemblyInformationalVersion("1.4.0")] [assembly: AssemblyProduct("MoreSuits")] [assembly: AssemblyTitle("MoreSuits")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.4.0.0")] [module: UnverifiableCode] namespace MoreSuits; [BepInPlugin("x753.More_Suits", "More Suits", "1.4.0")] public class MoreSuitsMod : BaseUnityPlugin { [HarmonyPatch(typeof(StartOfRound))] internal class StartOfRoundPatch { [HarmonyPatch("Start")] [HarmonyPrefix] private static void StartPatch(ref StartOfRound __instance) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Expected O, but got Unknown //IL_055a: Unknown result type (might be due to invalid IL or missing references) //IL_055f: Unknown result type (might be due to invalid IL or missing references) //IL_0565: Unknown result type (might be due to invalid IL or missing references) //IL_056a: Unknown result type (might be due to invalid IL or missing references) //IL_0342: Unknown result type (might be due to invalid IL or missing references) //IL_0349: Expected O, but got Unknown //IL_0259: Unknown result type (might be due to invalid IL or missing references) //IL_0260: Expected O, but got Unknown //IL_0476: Unknown result type (might be due to invalid IL or missing references) try { if (SuitsAdded) { return; } int count = __instance.unlockablesList.unlockables.Count; UnlockableItem val = new UnlockableItem(); int num = 0; for (int i = 0; i < __instance.unlockablesList.unlockables.Count; i++) { UnlockableItem val2 = __instance.unlockablesList.unlockables[i]; if (!((Object)(object)val2.suitMaterial != (Object)null) || !val2.alreadyUnlocked) { continue; } val = val2; List<string> list = Directory.GetDirectories(Paths.PluginPath, "moresuits", SearchOption.AllDirectories).ToList(); List<string> list2 = new List<string>(); List<string> list3 = DisabledSuits.ToLower().Replace(".png", "").Split(',') .ToList(); List<string> list4 = new List<string>(); if (!LoadAllSuits) { foreach (string item in list) { if (File.Exists(Path.Combine(item, "!less-suits.txt"))) { string[] collection = new string[9] { "glow", "kirby", "knuckles", "luigi", "mario", "minion", "skeleton", "slayer", "smile" }; list4.AddRange(collection); break; } } } foreach (string item2 in list) { if (item2 != "") { string[] files = Directory.GetFiles(item2, "*.png"); list2.AddRange(files); } } list2.Sort(); foreach (string item3 in list2) { if (list3.Contains(Path.GetFileNameWithoutExtension(item3).ToLower())) { continue; } string directoryName = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); if (list4.Contains(Path.GetFileNameWithoutExtension(item3).ToLower()) && item3.Contains(directoryName)) { continue; } UnlockableItem val3; Material val4; if (Path.GetFileNameWithoutExtension(item3).ToLower() == "default") { val3 = val; val4 = val3.suitMaterial; } else { val3 = JsonUtility.FromJson<UnlockableItem>(JsonUtility.ToJson((object)val)); val4 = Object.Instantiate<Material>(val3.suitMaterial); } byte[] array = File.ReadAllBytes(item3); Texture2D val5 = new Texture2D(2, 2); ImageConversion.LoadImage(val5, array); val4.mainTexture = (Texture)(object)val5; val3.unlockableName = Path.GetFileNameWithoutExtension(item3); try { string path = Path.Combine(Path.GetDirectoryName(item3), "advanced", val3.unlockableName + ".json"); if (File.Exists(path)) { string[] array2 = File.ReadAllLines(path); for (int j = 0; j < array2.Length; j++) { string[] array3 = array2[j].Trim().Split(':'); if (array3.Length != 2) { continue; } string text = array3[0].Trim('"', ' ', ','); string text2 = array3[1].Trim('"', ' ', ','); if (text2.Contains(".png")) { byte[] array4 = File.ReadAllBytes(Path.Combine(Path.GetDirectoryName(item3), "advanced", text2)); Texture2D val6 = new Texture2D(2, 2); ImageConversion.LoadImage(val6, array4); val4.SetTexture(text, (Texture)(object)val6); continue; } if (text == "PRICE" && int.TryParse(text2, out var result)) { try { val3 = AddToRotatingShop(val3, result, __instance.unlockablesList.unlockables.Count); } catch (Exception ex) { Debug.Log((object)("Something went wrong with More Suits! Could not add a suit to the rotating shop. Error: " + ex)); } continue; } switch (text2) { case "KEYWORD": val4.EnableKeyword(text); continue; case "DISABLEKEYWORD": val4.DisableKeyword(text); continue; case "SHADERPASS": val4.SetShaderPassEnabled(text, true); continue; case "DISABLESHADERPASS": val4.SetShaderPassEnabled(text, false); continue; } float result2; Vector4 vector; if (text == "SHADER") { Shader shader = Shader.Find(text2); val4.shader = shader; } else if (float.TryParse(text2, out result2)) { val4.SetFloat(text, result2); } else if (TryParseVector4(text2, out vector)) { val4.SetVector(text, vector); } } } } catch (Exception ex2) { Debug.Log((object)("Something went wrong with More Suits! Error: " + ex2)); } val3.suitMaterial = val4; if (val3.unlockableName.ToLower() != "default") { if (num == MaxSuits) { Debug.Log((object)"Attempted to add a suit, but you've already reached the max number of suits! Modify the config if you want more."); continue; } __instance.unlockablesList.unlockables.Add(val3); num++; } } SuitsAdded = true; break; } UnlockableItem val7 = JsonUtility.FromJson<UnlockableItem>(JsonUtility.ToJson((object)val)); val7.alreadyUnlocked = false; val7.hasBeenMoved = false; val7.placedPosition = Vector3.zero; val7.placedRotation = Vector3.zero; while (__instance.unlockablesList.unlockables.Count < count + MaxSuits) { __instance.unlockablesList.unlockables.Add(val7); } } catch (Exception ex3) { Debug.Log((object)("Something went wrong with More Suits! Error: " + ex3)); } } [HarmonyPatch("PositionSuitsOnRack")] [HarmonyPrefix] private static bool PositionSuitsOnRackPatch(ref StartOfRound __instance) { //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: 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_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: 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_00d6: Unknown result type (might be due to invalid IL or missing references) List<UnlockableSuit> source = Object.FindObjectsOfType<UnlockableSuit>().ToList(); source = source.OrderBy((UnlockableSuit suit) => suit.syncedSuitID.Value).ToList(); int num = 0; foreach (UnlockableSuit item in source) { AutoParentToShip component = ((Component)item).gameObject.GetComponent<AutoParentToShip>(); component.overrideOffset = true; float num2 = 0.18f; if (MakeSuitsFitOnRack && source.Count > 13) { num2 /= (float)Math.Min(source.Count, 20) / 12f; } component.positionOffset = new Vector3(-2.45f, 2.75f, -8.41f) + __instance.rightmostSuitPosition.forward * num2 * (float)num; component.rotationOffset = new Vector3(0f, 90f, 0f); num++; } return false; } } private const string modGUID = "x753.More_Suits"; private const string modName = "More Suits"; private const string modVersion = "1.4.0"; private readonly Harmony harmony = new Harmony("x753.More_Suits"); private static MoreSuitsMod Instance; public static bool SuitsAdded; public static string DisabledSuits; public static bool LoadAllSuits; public static bool MakeSuitsFitOnRack; public static int MaxSuits; private static TerminalNode cancelPurchase; private static TerminalKeyword buyKeyword; private void Awake() { if ((Object)(object)Instance == (Object)null) { Instance = this; } DisabledSuits = ((BaseUnityPlugin)this).Config.Bind<string>("General", "Disabled Suit List", "UglySuit751.png,UglySuit752.png,UglySuit753.png", "Comma-separated list of suits that shouldn't be loaded").Value; LoadAllSuits = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "Ignore !less-suits.txt", false, "If true, ignores the !less-suits.txt file and will attempt to load every suit, except those in the disabled list. This should be true if you're not worried about having too many suits.").Value; MakeSuitsFitOnRack = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "Make Suits Fit on Rack", true, "If true, squishes the suits together so they all fit on the rack.").Value; MaxSuits = ((BaseUnityPlugin)this).Config.Bind<int>("General", "Max Suits", 100, "The maximum number of suits to load. If you have more, some will be ignored.").Value; harmony.PatchAll(); ((BaseUnityPlugin)this).Logger.LogInfo((object)"Plugin More Suits is loaded!"); } private static UnlockableItem AddToRotatingShop(UnlockableItem newSuit, int price, int unlockableID) { //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Expected O, but got Unknown //IL_01ce: Unknown result type (might be due to invalid IL or missing references) //IL_01d4: Expected O, but got Unknown //IL_0298: Unknown result type (might be due to invalid IL or missing references) //IL_029f: Expected O, but got Unknown Terminal val = Object.FindObjectOfType<Terminal>(); for (int i = 0; i < val.terminalNodes.allKeywords.Length; i++) { if (((Object)val.terminalNodes.allKeywords[i]).name == "Buy") { buyKeyword = val.terminalNodes.allKeywords[i]; break; } } newSuit.alreadyUnlocked = false; newSuit.hasBeenMoved = false; newSuit.placedPosition = Vector3.zero; newSuit.placedRotation = Vector3.zero; newSuit.shopSelectionNode = ScriptableObject.CreateInstance<TerminalNode>(); ((Object)newSuit.shopSelectionNode).name = newSuit.unlockableName + "SuitBuy1"; newSuit.shopSelectionNode.creatureName = newSuit.unlockableName + " suit"; newSuit.shopSelectionNode.displayText = "You have requested to order " + newSuit.unlockableName + " suits.\nTotal cost of item: [totalCost].\n\nPlease CONFIRM or DENY.\n\n"; newSuit.shopSelectionNode.clearPreviousText = true; newSuit.shopSelectionNode.shipUnlockableID = unlockableID; newSuit.shopSelectionNode.itemCost = price; newSuit.shopSelectionNode.overrideOptions = true; CompatibleNoun val2 = new CompatibleNoun(); val2.noun = ScriptableObject.CreateInstance<TerminalKeyword>(); val2.noun.word = "confirm"; val2.noun.isVerb = true; val2.result = ScriptableObject.CreateInstance<TerminalNode>(); ((Object)val2.result).name = newSuit.unlockableName + "SuitBuyConfirm"; val2.result.creatureName = ""; val2.result.displayText = "Ordered " + newSuit.unlockableName + " suits! Your new balance is [playerCredits].\n\n"; val2.result.clearPreviousText = true; val2.result.shipUnlockableID = unlockableID; val2.result.buyUnlockable = true; val2.result.itemCost = price; val2.result.terminalEvent = ""; CompatibleNoun val3 = new CompatibleNoun(); val3.noun = ScriptableObject.CreateInstance<TerminalKeyword>(); val3.noun.word = "deny"; val3.noun.isVerb = true; if ((Object)(object)cancelPurchase == (Object)null) { cancelPurchase = ScriptableObject.CreateInstance<TerminalNode>(); } val3.result = cancelPurchase; ((Object)val3.result).name = "MoreSuitsCancelPurchase"; val3.result.displayText = "Cancelled order.\n"; newSuit.shopSelectionNode.terminalOptions = (CompatibleNoun[])(object)new CompatibleNoun[2] { val2, val3 }; TerminalKeyword val4 = ScriptableObject.CreateInstance<TerminalKeyword>(); ((Object)val4).name = newSuit.unlockableName + "Suit"; val4.word = newSuit.unlockableName.ToLower() + " suit"; val4.defaultVerb = buyKeyword; CompatibleNoun val5 = new CompatibleNoun(); val5.noun = val4; val5.result = newSuit.shopSelectionNode; List<CompatibleNoun> list = buyKeyword.compatibleNouns.ToList(); list.Add(val5); buyKeyword.compatibleNouns = list.ToArray(); List<TerminalKeyword> list2 = val.terminalNodes.allKeywords.ToList(); list2.Add(val4); list2.Add(val2.noun); list2.Add(val3.noun); val.terminalNodes.allKeywords = list2.ToArray(); return newSuit; } public static bool TryParseVector4(string input, out Vector4 vector) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: 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_0056: Unknown result type (might be due to invalid IL or missing references) vector = Vector4.zero; string[] array = input.Split(','); if (array.Length == 4 && float.TryParse(array[0], out var result) && float.TryParse(array[1], out var result2) && float.TryParse(array[2], out var result3) && float.TryParse(array[3], out var result4)) { vector = new Vector4(result, result2, result3, result4); return true; } return false; } }