using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Globalization; using System.IO; using System.Linq; using System.Net.Http; 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 System.Text.RegularExpressions; using System.Threading.Tasks; using System.Xml; using BepInEx; using HarmonyLib; using Jaket.Sam; using Microsoft.CodeAnalysis; using Newtonsoft.Json.Linq; using Steamworks; using Steamworks.Data; using TMPro; using ULTRAKILL.Cheats; using UltraNet; using UltraNet.Canvas; using UltraNet.Classes; using UnityEngine; using UnityEngine.AddressableAssets; using UnityEngine.EventSystems; using UnityEngine.Events; using UnityEngine.InputSystem; using UnityEngine.Networking; 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: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: IgnoresAccessChecksTo("Assembly-CSharp")] [assembly: AssemblyCompany("UltraNet")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyDescription("Description")] [assembly: AssemblyFileVersion("0.0.1.0")] [assembly: AssemblyInformationalVersion("0.0.1")] [assembly: AssemblyProduct("UltraNet")] [assembly: AssemblyTitle("UltraNet")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("0.0.1.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } public class BundlesManager : MonoBehaviour { public static AssetBundle netBundle; public void Awake() { Object.DontDestroyOnLoad((Object)(object)((Component)this).gameObject); Assembly executingAssembly = Assembly.GetExecutingAssembly(); string text = "UltraNet.Assets.ultranet.bundle"; using Stream stream = executingAssembly.GetManifestResourceStream(text); if (stream == null) { Plugin.LogError("Embedded resource '" + text + "' not found!"); return; } byte[] array = new byte[stream.Length]; stream.Read(array, 0, array.Length); netBundle = AssetBundle.LoadFromMemory(array); if ((Object)(object)netBundle != (Object)null) { Plugin.LogInfo("Loaded embedded AssetBundle!"); } else { Plugin.LogError("Failed to load AssetBundle from memory!"); } } public void OnDestroy() { AssetBundle obj = netBundle; if (obj != null) { obj.Unload(false); } } } namespace UltraNet { [BepInPlugin("duviz.UltraNet", "UltraNet", "0.1.9")] public class Plugin : BaseUnityPlugin { public static Plugin instance; public static bool debugMode; private GameObject canvasObject; private GameObject canvasInstance; private bool lastPlayerActive = false; private bool openedOnce = false; public static TMP_SpriteAsset defaultSpriteAsset; public void Awake() { //IL_001a: Unknown result type (might be due to invalid IL or missing references) ((Object)((Component)this).gameObject).hideFlags = (HideFlags)61; instance = this; new Harmony("duviz.UltraNet").PatchAll(); LogInfo("UltraNet loaded."); } public void Start() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Expected O, but got Unknown //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: Expected O, but got Unknown GameObject val = new GameObject("Managers") { hideFlags = (HideFlags)61 }; GameObject val2 = new GameObject("PlayerFetcher") { hideFlags = (HideFlags)61 }; val.AddComponent(); val.AddComponent(); val.AddComponent(); val2.AddComponent(); GameObject val3 = Object.Instantiate(BundlesManager.netBundle.LoadAsset("UltraNetNotifications")); canvasObject = BundlesManager.netBundle.LoadAsset("UltraNetCanvas"); canvasInstance = Object.Instantiate(canvasObject); canvasInstance.SetActive(false); canvasInstance.GetComponent().screenMatchMode = (ScreenMatchMode)1; defaultSpriteAsset = BundlesManager.netBundle.LoadAsset("ilovemen"); Object.DontDestroyOnLoad((Object)(object)canvasInstance); Object.DontDestroyOnLoad((Object)(object)val2); Object.DontDestroyOnLoad((Object)(object)val); openedOnce = PlayerPrefs.GetInt("UltraNet_Opened", 0) == 1; SceneManager.sceneLoaded += SceneLoadDelayed; } public void SceneLoadDelayed(Scene _, LoadSceneMode __) { ((MonoBehaviour)this).Invoke("SceneLoad", 0.1f); } public void SceneLoad() { if (SceneHelper.CurrentScene == "Main Menu" && (Object)(object)((Component)this).gameObject.GetComponent() == (Object)null) { ((Component)this).gameObject.AddComponent(); } } public void Update() { if ((Object)(object)MonoSingleton.Instance != (Object)null && !openedOnce) { if (lastPlayerActive != MonoSingleton.Instance.activated) { MonoSingleton.Instance.SendHudMessage("Press (T) to open UltraNet", "", "", 0, false, false, true); } lastPlayerActive = MonoSingleton.Instance.activated; } } public void PressKey() { if (!UIBusy()) { canvasInstance.SetActive(!canvasInstance.activeSelf); if (canvasInstance.activeSelf) { ContentManager.instance.Open(); } if (!openedOnce) { PlayerPrefs.SetInt("UltraNet_Opened", 1); openedOnce = true; } } } public static bool UIBusy() { return (Object)(object)EventSystem.current != (Object)null && (Object)(object)EventSystem.current.currentSelectedGameObject != (Object)null && (Object)(object)EventSystem.current.currentSelectedGameObject.GetComponent() != (Object)null && EventSystem.current.currentSelectedGameObject.GetComponent().isFocused && EventSystem.current.currentSelectedGameObject.activeInHierarchy; } public void OnApplicationFocus(bool isFocused) { if ((Object)(object)MonoSingleton.Instance != (Object)null && SceneHelper.CurrentScene != "Main Menu" && !MonoSingleton.Instance.paused) { MonoSingleton.Instance.Pause(); } } public static T Ass(string path) { //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) return Addressables.LoadAssetAsync((object)path).WaitForCompletion(); } public static void LogInfo(object msg) { ((BaseUnityPlugin)instance).Logger.LogInfo(msg); } public static void LogWarning(object msg) { ((BaseUnityPlugin)instance).Logger.LogWarning(msg); } public static void LogError(object msg) { ((BaseUnityPlugin)instance).Logger.LogError(msg); } } public class PluginInfo { public const string GUID = "duviz.UltraNet"; public const string Name = "UltraNet"; public const string Version = "0.1.9"; } } namespace UltraNet.Patches { [HarmonyPatch] public class CheatFix { [HarmonyPrefix] [HarmonyPatch(typeof(CheatsManager), "HandleCheatBind")] private static bool Patch1() { return !Plugin.UIBusy(); } [HarmonyPrefix] [HarmonyPatch(typeof(CheatsController), "Update")] private static bool Patch2() { return !Plugin.UIBusy(); } [HarmonyPrefix] [HarmonyPatch(typeof(Noclip), "UpdateTick")] private static bool Patch3() { return !Plugin.UIBusy(); } [HarmonyPrefix] [HarmonyPatch(typeof(Flight), "Update")] private static bool Patch4() { return !Plugin.UIBusy(); } } [HarmonyPatch(typeof(FinalCyberRank))] public static class FinalCyberRankPatch { public const string url = "https://duviz.xyz/ultranet/user/completeCybergrind"; public static int rankScore; public static float lastTime; [HarmonyPostfix] [HarmonyPatch(typeof(FinalCyberRank), "GameOver")] public static void GameOver(FinalCyberRank __instance) { if (!PlayerFetcher.CheatsActive() && LeaderboardController.CanSubmitScores && !(lastTime + 30f > Time.unscaledTime)) { lastTime = Time.unscaledTime; ((MonoBehaviour)Numerators.instance).StartCoroutine(Numerators.PostRequest("https://duviz.xyz/ultranet/user/completeCybergrind", new Dictionary { { "token", ContentManager.GetToken() }, { "wave", Mathf.ClampToInt((long)__instance.savedWaves).ToString() } }, delegate { })); } } } [HarmonyPatch(typeof(FinalPit))] public static class LevelCompletionPatch { public const string url = "https://duviz.xyz/ultranet/user/complete"; public static int rankScore; public static float lastTime; [HarmonyPrefix] [HarmonyPatch(typeof(FinalPit), "SendInfo")] public static void SendInfo(FinalPit __instance) { if (!__instance.infoSent && !PlayerFetcher.CheatsActive() && LeaderboardController.CanSubmitScores && !(lastTime + 30f > Time.unscaledTime)) { lastTime = Time.unscaledTime; float seconds = MonoSingleton.Instance.seconds; int num = Mathf.FloorToInt(seconds / 60f); int num2 = Mathf.FloorToInt(seconds % 60f); int num3 = Mathf.FloorToInt(seconds * 1000f % 1000f); string value = $"{num:00}:{num2:00}:{num3:000}"; ((MonoBehaviour)Numerators.instance).StartCoroutine(Numerators.PostRequest("https://duviz.xyz/ultranet/user/complete", new Dictionary { { "token", ContentManager.GetToken() }, { "level", SceneHelper.CurrentScene }, { "time", value }, { "rank", GetRank() } }, delegate { })); } } public static string GetRank() { rankScore = 0; StatsManager instance = MonoSingleton.Instance; GetRanks(instance.timeRanks, instance.seconds, reverse: true, addToRankScore: true); GetRanks(instance.killRanks, instance.kills, reverse: false, addToRankScore: true); GetRanks(instance.styleRanks, instance.stylePoints, reverse: false, addToRankScore: true); string currentScene = SceneHelper.CurrentScene; int num = MonoSingleton.Instance.GetInt("difficulty", 0); if (rankScore == 12 && instance.restarts == 0) { return "P"; } return GetRankName((float)rankScore / 3f); } public static string GetRankName(float score) { int num = Mathf.RoundToInt(score); bool flag = false; string result; switch (num) { case 1: result = "C"; break; case 2: result = "B"; break; case 3: result = "A"; break; case 4: case 5: case 6: result = "S"; break; default: result = "D"; break; } bool flag2 = false; return result; } public static string GetRanks(int[] ranksToCheck, float value, bool reverse, bool addToRankScore = false) { int num = 0; bool flag = true; while (flag) { if (num >= ranksToCheck.Length) { if (addToRankScore) { rankScore += 4; } return "S"; } if ((reverse && value <= (float)ranksToCheck[num]) || (!reverse && value >= (float)ranksToCheck[num])) { num++; continue; } if (addToRankScore) { rankScore += num; } switch (num) { case 0: return "D"; case 1: return "C"; case 2: return "B"; case 3: return "A"; } } return "X"; } } } namespace UltraNet.Classes { public static class CustomBindingsPoCPlugin { public class InputListener : MonoBehaviour { private InputListenerInstance inputs; public void Start() { inputs = InputListenerInstance.Instance; } public void Update() { if (!((Object)(object)inputs == (Object)null) && inputs.SomeFirstAction.WasPerformedThisFrame()) { Plugin.instance.PressKey(); } } } [HarmonyPatch(typeof(InputActions))] public static class InputActionPatches { [HarmonyPostfix] [HarmonyPatch(/*Could not decode attribute arguments.*/)] public static void InputActions_Constructor_Postfix(InputActions __instance) { if (__instance.asset.FindActionMap("UltraNet", false) == null) { MergeInputActionAssets(__instance); } } private static void MergeInputActionAssets(InputActions ukInputActions) { InputActionAsset asset = ukInputActions.asset; bool enabled = asset.enabled; if (enabled) { asset.Disable(); } InputActionSetupExtensions.AddActionMap(asset, ActionMap); if (enabled) { asset.Enable(); } } } public class InputListenerInstance : MonoBehaviour { public static InputListenerInstance Instance; private InputActionMap _actionMap; public InputAction SomeFirstAction { get; private set; } public void Awake() { Instance = this; ((MonoBehaviour)this).StartCoroutine(WaitForIt()); } public IEnumerator WaitForIt() { while ((Object)(object)MonoSingleton.Instance == (Object)null) { yield return null; } _actionMap = MonoSingleton.Instance.InputSource.Actions.asset.FindActionMap("UltraNet", false); SomeFirstAction = _actionMap.FindAction("Toggle panel", false); } } [HarmonyPatch(typeof(ControlsOptions))] public static class ControlsOptionsPatches { [HarmonyTranspiler] [HarmonyPatch(typeof(ControlsOptions), "Rebuild")] private static IEnumerable Transpiler(IEnumerable instructions) { List list = new List(instructions); MethodInfo addMap = AccessTools.Method(typeof(ControlsOptionsPatches), "AddMap", (Type[])null, (Type[])null); FieldInfo mapField = AccessTools.Field(typeof(CustomBindingsPoCPlugin), "ActionMap"); foreach (CodeInstruction inst in list) { int num; if (inst.opcode == OpCodes.Newarr) { object operand = inst.operand; if (operand is Type t) { num = ((t == typeof(InputActionMap)) ? 1 : 0); goto IL_0145; } } num = 0; goto IL_0145; IL_0145: if (num != 0) { yield return inst; yield return new CodeInstruction(OpCodes.Ldsfld, (object)mapField); yield return new CodeInstruction(OpCodes.Call, (object)addMap); } else { yield return inst; } } } private static InputActionMap[] AddMap(InputActionMap[] original, InputActionMap extra) { if (original == null) { return (InputActionMap[])(object)new InputActionMap[1] { extra }; } InputActionMap[] array = (InputActionMap[])(object)new InputActionMap[original.Length + 1]; Array.Copy(original, array, original.Length); array[^1] = extra; return array; } } private const string InputMapName = "UltraNet"; private const string SomeFirstActionName = "Toggle panel"; private static readonly string YourActionMapJson = "{\r\n\t\t\"maps\": [\r\n\t\t\t{\r\n\t\t\t\t\"name\": \"UltraNet\",\r\n\t\t\t\t\"id\": \"6212261a-20ba-4c68-8568-ef2c0f5d770f\",\r\n\t\t\t\t\"actions\": [\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t\"name\": \"Toggle panel\",\r\n\t\t\t\t\t\t\"type\": \"Button\",\r\n\t\t\t\t\t\t\"id\": \"bc66ba63-9493-499b-8c3d-0cf0992fc6a8\",\r\n\t\t\t\t\t\t\"expectedControlType\": \"Button\",\r\n\t\t\t\t\t\t\"processors\": \"\",\r\n\t\t\t\t\t\t\"interactions\": \"\",\r\n\t\t\t\t\t\t\"initialStateCheck\": false\r\n\t\t\t\t\t}\r\n\t\t\t\t],\r\n\t\t\t\t\"bindings\": [\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t\"name\": \"\",\r\n\t\t\t\t\t\t\"id\": \"81a50518-0cf2-4bcd-a000-892c93e461e7\",\r\n\t\t\t\t\t\t\"path\": \"/t\",\r\n\t\t\t\t\t\t\"interactions\": \"\",\r\n\t\t\t\t\t\t\"processors\": \"\",\r\n\t\t\t\t\t\t\"groups\": \"Keyboard & Mouse\",\r\n\t\t\t\t\t\t\"action\": \"Toggle panel\",\r\n\t\t\t\t\t\t\"isComposite\": false,\r\n\t\t\t\t\t\t\"isPartOfComposite\": false\r\n\t\t\t\t\t}\r\n\t\t\t\t]\r\n\t\t\t}\r\n\t\t]\r\n\t}"; private static readonly InputActionMap ActionMap = InputActionMap.FromJson(YourActionMapJson)[0]; } public class Numerators : MonoBehaviour { public static Numerators instance; public static bool _busy; public void Awake() { ((Object)((Component)this).gameObject).hideFlags = (HideFlags)61; instance = this; } public IEnumerator TimerButton(Button button, float time) { yield return (object)new WaitForSecondsRealtime(time); if (!((Object)(object)button == (Object)null)) { if (!_busy) { ((UnityEvent)button.onClick).Invoke(); } ((MonoBehaviour)this).StartCoroutine(TimerButton(button, time)); } } public static IEnumerator GetStringFromUrl(string url, Action callback) { UnityWebRequest www = UnityWebRequest.Get(url); try { www.timeout = 10; yield return www.SendWebRequest(); if ((int)www.result != 1) { if (!string.IsNullOrEmpty(www.error) && www.error.Contains("Unknown Error")) { callback?.Invoke("?"); } Plugin.LogError("Failed to load string: " + www.error); callback?.Invoke(null); } else { callback?.Invoke(www.downloadHandler.text); } } finally { ((IDisposable)www)?.Dispose(); } } public static IEnumerator PostRequest(string url, Dictionary postData, Action callback) { _ = Time.realtimeSinceStartup; WWWForm form = new WWWForm(); foreach (KeyValuePair pair in postData) { form.AddField(pair.Key, pair.Value); } UnityWebRequest www = UnityWebRequest.Post(url, form); try { www.timeout = 10; yield return www.SendWebRequest(); if ((int)www.result != 1) { if (!string.IsNullOrEmpty(www.error) && www.error.Contains("Unknown Error")) { callback?.Invoke("?"); } Plugin.LogError("Failed to post request: " + www.error); callback?.Invoke(null); } else { callback?.Invoke(www.downloadHandler.text); } } finally { ((IDisposable)www)?.Dispose(); } } } public class Player : MonoBehaviour { public float lerpSpeed = 2f; private Vector3 targetPos; private Vector3Lerp lerpPos; private TMP_Text t; private string originalText; private bool lastCheats = false; public void SetTarget(Vector3 newPos, bool cheats) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) targetPos = newPos; lerpPos.Set(newPos); if (lastCheats != cheats) { t.text = (cheats ? ("(C)" + originalText) : originalText); } lastCheats = cheats; } public void CreateName(string text, string id, string url) { //IL_002b: Unknown result type (might be due to invalid IL or missing references) GameObject val = Object.Instantiate(BundlesManager.netBundle.LoadAsset("PlayerName")); val.transform.localScale = new Vector3(-0.5f, 0.5f, 1f); val.transform.SetParent(((Component)this).transform, false); val.GetComponentInChildren().text = TextParser.Parse(text); t = val.GetComponentInChildren(); originalText = TextParser.Parse(text); GetPfp(id, val, url); } public async void GetPfp(string id, GameObject obj, string url) { if (!string.IsNullOrEmpty(url)) { obj.GetComponentInChildren().imageUrl = url; obj.GetComponentInChildren().SetImg(); } } public void Update() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) ((Component)this).transform.position = lerpPos.Grab(); ((Component)this).transform.LookAt(((Object)(object)Camera.main != (Object)null) ? ((Component)Camera.main).transform.position : Vector3.zero); } } public class PlayerFetcher : MonoBehaviour { public static PlayerFetcher instance; public static float syncTime = 0.4f; private Dictionary players = new Dictionary(); private string syncUrl = "https://duviz.xyz/ultranet/user/update"; private float timer = 0f; private bool _busy = false; private int attempts = 0; public void Update() { timer += Time.unscaledDeltaTime; if (timer >= syncTime && !((Object)(object)MonoSingleton.Instance == (Object)null)) { timer = 0f; Sync(); } } public void Sync() { attempts++; if (attempts >= 10) { _busy = false; } if (_busy) { timer = syncTime; return; } _busy = true; attempts = 0; ((MonoBehaviour)this).StopAllCoroutines(); ((MonoBehaviour)this).StartCoroutine(Numerators.PostRequest(syncUrl, new Dictionary { { "token", ContentManager.GetToken() }, { "position", ContentManager.GetPosition() }, { "level", SceneHelper.CurrentScene }, { "cheats", CheatsActive().ToString() } }, delegate(string json) { _busy = false; if (json != null) { ParseJson(json); } })); } public GameObject CreatePlayer(string id, Vector3 pos, string name, string url) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown //IL_0012: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("Player viewer"); val.transform.position = pos; Player player = val.AddComponent(); player.CreateName(name, id, url); players.Add(id, val); return val; } public void ParseJson(string json) { //IL_0097: 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_00d5: Expected O, but got Unknown //IL_01e1: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Unknown result type (might be due to invalid IL or missing references) //IL_0150: 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_019a: Unknown result type (might be due to invalid IL or missing references) JObject val; try { val = JObject.Parse(json); } catch (Exception arg) { Plugin.LogError($"Failed to parse scene json: {arg}"); return; } foreach (KeyValuePair item in players.ToList()) { if ((Object)(object)item.Value == (Object)null) { players.Remove(item.Key); } } List list = new List(); foreach (KeyValuePair item2 in (JObject)val["players"]) { string id = item2.Key; JObject val2 = (JObject)item2.Value; string input = ((object)val2["position"])?.ToString(); string name = ((object)val2["name"])?.ToString(); string url = ((object)val2["pfp"])?.ToString(); string text = ((object)val2["cheats"]).ToString(); bool cheats = text.ToLower() == "true"; Vector3 val3 = ParseVector3(input); GameObject val4 = players.FirstOrDefault((KeyValuePair keyValuePair) => keyValuePair.Key == id).Value; list.Add(id); if ((Object)(object)val4 == (Object)null) { val4 = CreatePlayer(id, val3, name, url); } val4.GetComponent().SetTarget(val3, cheats); } foreach (KeyValuePair item3 in (JObject)val["events"]) { string key = item3.Key; DoEvent(key); } foreach (KeyValuePair item4 in players.ToList()) { if (!list.Contains(item4.Key)) { GameObject value = item4.Value; players.Remove(item4.Key); if ((Object)(object)value != (Object)null) { Object.Destroy((Object)(object)value); } } } } private void DoEvent(string e) { //IL_0027: 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_0060: 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) //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) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_0101: 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) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_017c: 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) if (e == "filth") { GameObject val = Plugin.Ass("Assets/Prefabs/Enemies/Zombie.prefab"); GameObject val2 = Object.Instantiate(val, ((Component)MonoSingleton.Instance).transform.position, Quaternion.identity); } if (e == "stray") { GameObject val3 = Plugin.Ass("Assets/Prefabs/Enemies/Projectile Zombie.prefab"); GameObject val4 = Object.Instantiate(val3, ((Component)MonoSingleton.Instance).transform.position, Quaternion.identity); } if (e == "minos") { GameObject val5 = Plugin.Ass("Assets/Prefabs/Enemies/MinosPrime.prefab"); GameObject val6 = Object.Instantiate(val5, ((Component)MonoSingleton.Instance).transform.position, Quaternion.identity); } if (e == "explosion") { GameObject val7 = Plugin.Ass("Assets/Prefabs/Attacks and Projectiles/Explosions/Explosion.prefab"); GameObject val8 = Object.Instantiate(val7, ((Component)MonoSingleton.Instance).transform.position, Quaternion.identity); } if (e == "gravity") { Physics.gravity = new Vector3(0f - Physics.gravity.y, 0f - Physics.gravity.z, 0f - Physics.gravity.x); } if (e.StartsWith("custom_")) { GameObject val9 = Plugin.Ass("Assets/Prefabs/" + e.Replace("custom_", "") + ".prefab"); GameObject val10 = Object.Instantiate(val9, ((Component)MonoSingleton.Instance).transform.position, Quaternion.identity); } } private Vector4 ParseVector4(string input) { //IL_007f: 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_0043: 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) //IL_0087: Unknown result type (might be due to invalid IL or missing references) input = input.Trim('(', ')', ' '); string[] array = input.Split(','); if (array.Length != 4) { Plugin.LogError("Invalid Vector4 format: " + input); return Vector4.zero; } return new Vector4(float.Parse(array[0], CultureInfo.InvariantCulture), float.Parse(array[1], CultureInfo.InvariantCulture), float.Parse(array[2], CultureInfo.InvariantCulture), float.Parse(array[3], CultureInfo.InvariantCulture)); } public static Vector3 ParseVector3(string input) { //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_0043: 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) //IL_007a: Unknown result type (might be due to invalid IL or missing references) input = input.Trim('(', ')', ' '); string[] array = input.Split(','); if (array.Length != 3) { Plugin.LogError("Invalid Vector3 format: " + input); return Vector3.zero; } return new Vector3(float.Parse(array[0], CultureInfo.InvariantCulture), float.Parse(array[1], CultureInfo.InvariantCulture), float.Parse(array[2], CultureInfo.InvariantCulture)); } public static Vector2 ParseVector2(string input) { //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_0043: 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) //IL_006d: Unknown result type (might be due to invalid IL or missing references) input = input.Trim('(', ')', ' '); string[] array = input.Split(','); if (array.Length != 2) { Plugin.LogError("Invalid Vector2 format: " + input); return Vector2.zero; } return new Vector2(float.Parse(array[0], CultureInfo.InvariantCulture), float.Parse(array[1], CultureInfo.InvariantCulture)); } public static bool CheatsActive() { return MonoSingleton.Instance.cheatsEnabled || MonoSingleton.Instance.majorUsed; } } public class SteamAvatarFetcher : MonoBehaviour { private static readonly HttpClient client = new HttpClient(); public async Task GetSteamAvatarURL(string steamID64) { string xmlUrl = "https://steamcommunity.com/profiles/" + steamID64 + "/?xml=1"; try { string xml = await client.GetStringAsync(xmlUrl); XmlDocument doc = new XmlDocument(); doc.LoadXml(xml); XmlNode avatarFullNode = doc.SelectSingleNode("//avatarFull"); if (avatarFullNode != null) { return avatarFullNode.InnerText; } Plugin.LogWarning("Not found."); return null; } catch (HttpRequestException ex) { HttpRequestException ex2 = ex; HttpRequestException e = ex2; Plugin.LogError("HTTP request error: " + e.Message); return null; } catch (XmlException ex3) { XmlException ex4 = ex3; XmlException e2 = ex4; Plugin.LogError("XML parsing error: " + e2.Message); return null; } } } public struct Vector3Lerp { public Vector3 PreviousValue; public Vector3 TargetValue; public float Duration; public float StartTime; public Vector3 Grab() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: 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_0025: 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) return Vector3.Lerp(PreviousValue, TargetValue, (Time.realtimeSinceStartup - StartTime) / Duration); } public void Set(Vector3 value) { //IL_0017: 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) //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_001f: Unknown result type (might be due to invalid IL or missing references) PreviousValue = ((StartTime == 0f) ? value : Grab()); TargetValue = value; Duration = Mathf.Max(Time.realtimeSinceStartup - StartTime, PlayerFetcher.syncTime); StartTime = Time.realtimeSinceStartup; } } } namespace UltraNet.Canvas { [Serializable] public class ChatMessage { public string author; public string authorid; public string chat; public string content; public string custom; public string time; public string name; } [Serializable] public class ChatMessageList { public List messages; } public static class ChatParser { public static List Parse(string json) { try { string text = "{ \"messages\": " + json + "}"; ChatMessageList chatMessageList = JsonUtility.FromJson(text); return chatMessageList.messages; } catch (Exception) { return new List(); } } } public class ContentManager : MonoBehaviour { [Serializable] public class R_Window { public string id; public GameObject prefab; public R_Window(string id, GameObject prefab) { this.id = id; this.prefab = prefab; } } public static ContentManager instance; public static List openWindows = new List(); public static List openWindowsObjs = new List(); public const string mainUrl = "D"; public const string loginUrl = "https://duviz.xyz/login"; public const string chatUrl = "https://duviz.xyz/ultranet/chat"; public const string sendChatUrl = "https://duviz.xyz/ultranet/chat/sendMessageV2"; public const string profileUrl = "https://duviz.xyz/ultranet/profileV2"; public const string sendFriendRequestUrl = "https://duviz.xyz/ultranet/sendFriendRequest"; public const string setFriendsUrl = "https://duviz.xyz/ultranet/setFriends"; public const string getFriendsUrl = "https://duviz.xyz/ultranet/getFriends"; public const string getFriendRequestsUrl = "https://duviz.xyz/ultranet/getFriendRequests"; public const string getNotificationsUrl = "https://duviz.xyz/ultranet/getNotifications"; public static string steamid = ""; public static string compressedid = ""; public static TMP_InputField CurrentChatField; [Header("Prefabs")] public List windows = new List(); public AudioSource source = null; private bool checking = false; public static string profileSetBioUrl => "https://duviz.xyz/ultranet/user/" + steamid + "/editBio"; public static string profileSetPronounsUrl => "https://duviz.xyz/ultranet/user/" + steamid + "/editPron"; public void Awake() { instance = this; } public void Start() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) source = new GameObject("Audio").AddComponent(); source.playOnAwake = false; source.volume = 1f; Object.DontDestroyOnLoad((Object)(object)((Component)source).gameObject); MonoBehaviour.print((object)windows.Count); MonoBehaviour.print((object)windows); foreach (R_Window window in windows) { Plugin.LogInfo($"Window: {window.id}, isnull: {(Object)(object)window.prefab == (Object)null}"); } if (windows.Count == 0) { Plugin.LogWarning("Windows list is empty, loading from bundles..."); windows.Add(new R_Window("login", BundlesManager.netBundle.LoadAsset("Login Variant"))); windows.Add(new R_Window("main", BundlesManager.netBundle.LoadAsset("UltranetMain Variant"))); windows.Add(new R_Window("rules", BundlesManager.netBundle.LoadAsset("Rules Variant"))); windows.Add(new R_Window("chat", BundlesManager.netBundle.LoadAsset("Chat Variant"))); windows.Add(new R_Window("profile", BundlesManager.netBundle.LoadAsset("Profile Variant"))); windows.Add(new R_Window("profilesettings", BundlesManager.netBundle.LoadAsset("Profile Settings Variant"))); windows.Add(new R_Window("friends", BundlesManager.netBundle.LoadAsset("Friends Variant"))); windows.Add(new R_Window("requests", BundlesManager.netBundle.LoadAsset("FriendRequests Variant"))); windows.Add(new R_Window("friendChat", BundlesManager.netBundle.LoadAsset("Friend Chat Variant"))); } } public void CheckForLogin() { if (checking) { return; } checking = true; if (GetToken() == "") { SpawnWindow("login"); checking = false; return; } ((MonoBehaviour)Numerators.instance).StartCoroutine(Numerators.PostRequest("https://duviz.xyz/login", new Dictionary { { "token", GetToken() } }, delegate(string json) { checking = false; if (json.StartsWith("Yay!")) { string text = json.Replace("Yay!", ""); steamid = text.Split('#')[0]; compressedid = text.Split('#')[1]; SpawnWindow("main"); } else { SpawnWindow("login"); } })); } public void Open() { TMP_InputField currentChatField = CurrentChatField; if (currentChatField != null) { currentChatField.ActivateInputField(); } } public void ClearWindows() { foreach (GameObject item in openWindowsObjs.ToList()) { if ((Object)(object)item != (Object)null) { Object.Destroy((Object)(object)item); } } openWindows = new List(); openWindowsObjs = new List(); } public void Login(string key) { if (key == "") { key = GUIUtility.systemCopyBuffer; } PlayerPrefs.SetString("UltranetToken", key); ClearWindows(); } public void OpenProfile(string steamid) { GameObject val = SpawnWindow("profile"); if (Object.op_Implicit((Object)(object)val)) { val.GetComponent().LoadProfile(steamid); } } public GameObject SpawnWindow(string id) { return SpawnWindowCustomID(id, id); } public GameObject SpawnWindowCustomID(string id, string customID) { R_Window r_Window = windows.Where((R_Window r_Window2) => r_Window2.id == id).FirstOrDefault(); if (r_Window != null) { if (openWindows.Contains(customID)) { Plugin.LogError("Window with id '" + customID + "' is already open!"); return null; } Plugin.LogInfo("Spawning window '" + id + "' with custom id '" + customID + "'"); GameObject val = Object.Instantiate(r_Window.prefab, ((Component)this).transform.GetChild(1)); ((Object)val).name = customID; return val; } Plugin.LogError("No window with id '" + id + "' found!"); return null; } public void Update() { if ((Object)(object)MonoSingleton.Instance != (Object)null && SceneHelper.CurrentScene != "Main Menu" && !MonoSingleton.Instance.paused) { MonoSingleton.Instance.Pause(); } Time.timeScale = 0f; Cursor.visible = true; Cursor.lockState = (CursorLockMode)0; if (Input.GetKeyDown((KeyCode)27)) { Time.timeScale = 1f; ((Component)this).gameObject.SetActive(false); if ((Object)(object)MonoSingleton.Instance != (Object)null && SceneHelper.CurrentScene != "Main Menu") { MonoSingleton.Instance.UnPause(); } } if (openWindows.Count == 0) { CheckForLogin(); } } public Color ParseColor(string colorStr) { //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_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) Color result = default(Color); if (ColorUtility.TryParseHtmlString(colorStr, ref result)) { return result; } return Color.white; } public static string GetToken() { return PlayerPrefs.GetString("UltranetToken", ""); } public static string GetPosition() { //IL_0031: 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_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) if ((Object)(object)Camera.main == (Object)null) { return ((object)Vector3.zero/*cast due to .constrained prefix*/).ToString(); } return ((object)((Component)Camera.main).transform.position/*cast due to .constrained prefix*/).ToString(); } } public class DMUrlText : MonoBehaviour, IPointerClickHandler, IEventSystemHandler, IPointerEnterHandler, IPointerExitHandler { public TMP_Text text; private bool hoveringLink; private bool hovering; public void OnPointerClick(PointerEventData eventData) { //IL_0007: 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_0035: Unknown result type (might be due to invalid IL or missing references) int num = TMP_TextUtilities.FindIntersectingLink(text, Input.mousePosition, (Camera)null); if (num != -1) { TMP_LinkInfo val = text.textInfo.linkInfo[num]; string linkID = ((TMP_LinkInfo)(ref val)).GetLinkID(); Application.OpenURL(linkID); } } public void Update() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) int num = TMP_TextUtilities.FindIntersectingLink(text, Input.mousePosition, (Camera)null); if (num != -1 && hovering) { if (!hoveringLink) { hoveringLink = true; Tooltip.ShowTooltip("Open URL"); } } else if (hoveringLink) { hoveringLink = false; Tooltip.HideTooltip(); } } public void OnPointerEnter(PointerEventData eventData) { hovering = true; } public void OnPointerExit(PointerEventData eventData) { hovering = false; } } public class EnterButton : MonoBehaviour { public void Update() { if (Input.GetKeyDown((KeyCode)13)) { ((UnityEvent)((Component)this).GetComponent