using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Net.Http; using System.Net.Http.Headers; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using System.Text; using System.Threading; using System.Threading.Tasks; using BepInEx; using BepInEx.Logging; using HarmonyLib; using UnityEngine; using UnityEngine.EventSystems; using UnityEngine.Events; 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: AssemblyTitle("VitaSync")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("VitaSync")] [assembly: AssemblyCopyright("Copyright © 2026")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("03be851d-d716-4088-9f09-0015b76be97a")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")] [assembly: AssemblyVersion("1.0.0.0")] namespace VitaSync; public static class LifeSyncClient { public class PhysicalProfile { public int Puntos { get; set; } public int CostoStamina { get; private set; } public int CostoGrip { get; private set; } public int CostoHealth { get; private set; } public int CostoSpeed { get; private set; } public int CanjesUsados { get; set; } public int CanjesMax { get; set; } public bool PuedeCanjeaMas => CanjesUsados < CanjesMax; public PhysicalProfile() { Puntos = 0; CostoStamina = 20; CostoGrip = 20; CostoHealth = 30; CostoSpeed = 30; CanjesUsados = 0; CanjesMax = 2; } public static PhysicalProfile FromPoints(int pts) { return new PhysicalProfile { Puntos = pts }; } public bool PuedePagar(int costo) { return PuedeCanjeaMas && Puntos >= costo; } public override string ToString() { return "Puntos=" + Puntos + " | Canjes=" + CanjesUsados + "/" + CanjesMax; } } internal static string ExtractString(string json, string key) { string text = "\"" + key + "\""; int num = json.IndexOf(text, StringComparison.Ordinal); if (num < 0) { return null; } int num2 = json.IndexOf(':', num + text.Length); if (num2 < 0) { return null; } int i; for (i = num2 + 1; i < json.Length && char.IsWhiteSpace(json[i]); i++) { } if (i >= json.Length) { return null; } if (json[i] == '"') { int num3 = json.IndexOf('"', i + 1); return (num3 < 0) ? null : json.Substring(i + 1, num3 - i - 1); } int j; for (j = i; j < json.Length && json[j] != ',' && json[j] != '}' && json[j] != ']'; j++) { } return json.Substring(i, j - i).Trim(); } internal static int ParseDimensionBalance(string json, string dimId) { int startIndex = 0; while (true) { int num = json.IndexOf("\"id_point_dimension\"", startIndex, StringComparison.Ordinal); if (num < 0) { break; } int num2 = json.IndexOf('}', num); if (num2 < 0) { break; } string json2 = json.Substring(num, num2 - num + 1); string text = ExtractString(json2, "id_point_dimension"); if (text == dimId) { string s = ExtractString(json2, "balance"); if (int.TryParse(s, out var result)) { return result; } } startIndex = num2 + 1; } return 0; } } public class LoginHUDPanel : MonoBehaviour { private class CursorKeeper : MonoBehaviour { private void Update() { Cursor.lockState = (CursorLockMode)0; Cursor.visible = true; } } private static LoginHUDPanel _instance; private GameObject _canvasGO; private InputField _userInput; private InputField _passInput; private Text _statusText; private Button _loginBtn; private bool _loginInProgress = false; private bool _passVisible = false; private static readonly string[] SPIN = new string[4] { "/", "-", "\\", "|" }; private int _spinIdx = 0; private float _spinTimer = 0f; private const float SPIN_DT = 0.12f; private static readonly Color C_BG = new Color(0.13f, 0.11f, 0.09f, 0.93f); private static readonly Color C_HDR = new Color(0.18f, 0.14f, 0.1f, 0.97f); private static readonly Color C_GOLD = new Color(0.78f, 0.6f, 0.18f, 1f); private static readonly Color C_TEXT = new Color(0.8f, 0.76f, 0.7f, 1f); private static readonly Color C_DIM = new Color(0.48f, 0.44f, 0.38f, 1f); private static readonly Color C_INPUT_BG = new Color(0.1f, 0.09f, 0.07f, 1f); private static readonly Color C_INPUT_TXT = new Color(0.86f, 0.82f, 0.74f, 1f); private static readonly Color C_INPUT_PH = new Color(0.35f, 0.31f, 0.26f, 1f); private static readonly Color C_INPUT_LINE = new Color(0.78f, 0.6f, 0.18f, 0.5f); private static readonly Color C_BTN_OK = new Color(0.12f, 0.2f, 0.08f, 1f); private static readonly Color C_BTN_OK_T = new Color(0.8f, 0.76f, 0.7f, 1f); private static readonly Color C_BTN_SKIP = new Color(0.16f, 0.13f, 0.1f, 1f); private static readonly Color C_BTN_SKIP_T = new Color(0.45f, 0.41f, 0.35f, 1f); private static readonly Color C_BTN_EYE = new Color(0.2f, 0.16f, 0.11f, 1f); private static readonly Color C_BTN_EYE_T = new Color(0.78f, 0.6f, 0.18f, 1f); private static readonly Color C_ERROR = new Color(0.9f, 0.25f, 0.18f, 1f); private static readonly Color C_WARN = new Color(0.78f, 0.6f, 0.18f, 1f); public static void Initialize() { //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Expected O, but got Unknown //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Expected O, but got Unknown if (!((Object)(object)_instance != (Object)null)) { if ((Object)(object)Object.FindObjectOfType() == (Object)null) { GameObject val = new GameObject("VitaSync_EventSystem"); val.AddComponent(); val.AddComponent(); Object.DontDestroyOnLoad((Object)(object)val); } GameObject val2 = new GameObject("VitaSync_LoginHUD"); Object.DontDestroyOnLoad((Object)(object)val2); _instance = val2.AddComponent(); _instance.BuildUI(); } } public static void DestroyIfExists() { if (!((Object)(object)_instance == (Object)null)) { if ((Object)(object)_instance._canvasGO != (Object)null) { Object.Destroy((Object)(object)_instance._canvasGO); } Object.Destroy((Object)(object)((Component)_instance).gameObject); _instance = null; } } private void Update() { if ((Object)(object)_canvasGO != (Object)null && _canvasGO.activeSelf) { Cursor.lockState = (CursorLockMode)0; Cursor.visible = true; } if (_loginInProgress && (Object)(object)_statusText != (Object)null) { _spinTimer += Time.deltaTime; if (_spinTimer >= 0.12f) { _spinTimer = 0f; _spinIdx = (_spinIdx + 1) % SPIN.Length; string text = _statusText.text; if (text.Length > 0 && Array.IndexOf(SPIN, text[text.Length - 1].ToString()) >= 0) { _statusText.text = text.Substring(0, text.Length - 1) + SPIN[_spinIdx]; } } } if (_loginInProgress) { return; } if (Input.GetKeyDown((KeyCode)9)) { if ((Object)(object)_userInput != (Object)null && _userInput.isFocused) { InputField passInput = _passInput; if (passInput != null) { ((Selectable)passInput).Select(); } } else { InputField userInput = _userInput; if (userInput != null) { ((Selectable)userInput).Select(); } } } if (Input.GetKeyDown((KeyCode)13) || Input.GetKeyDown((KeyCode)271)) { HandleLogin(); } } private static Font GetFont() { return Resources.GetBuiltinResource("Arial.ttf"); } private void BuildUI() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Expected O, but got Unknown //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: 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_00af: 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_00ca: 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) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_0105: 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_011e: 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_0134: Expected O, but got Unknown //IL_014d: 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_0183: 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) //IL_01b1: 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_01de: Unknown result type (might be due to invalid IL or missing references) //IL_01ed: Unknown result type (might be due to invalid IL or missing references) //IL_01fc: Unknown result type (might be due to invalid IL or missing references) //IL_0201: Unknown result type (might be due to invalid IL or missing references) //IL_0206: Unknown result type (might be due to invalid IL or missing references) //IL_0226: Unknown result type (might be due to invalid IL or missing references) //IL_022b: Unknown result type (might be due to invalid IL or missing references) //IL_023a: 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_0263: Unknown result type (might be due to invalid IL or missing references) //IL_0272: Unknown result type (might be due to invalid IL or missing references) //IL_0281: Unknown result type (might be due to invalid IL or missing references) //IL_0288: 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_02bf: Unknown result type (might be due to invalid IL or missing references) //IL_02e6: Unknown result type (might be due to invalid IL or missing references) //IL_02f5: Unknown result type (might be due to invalid IL or missing references) //IL_0304: Unknown result type (might be due to invalid IL or missing references) //IL_030b: Unknown result type (might be due to invalid IL or missing references) //IL_033e: Unknown result type (might be due to invalid IL or missing references) //IL_034a: Unknown result type (might be due to invalid IL or missing references) //IL_0376: Unknown result type (might be due to invalid IL or missing references) //IL_0385: Unknown result type (might be due to invalid IL or missing references) //IL_038a: Unknown result type (might be due to invalid IL or missing references) //IL_038f: Unknown result type (might be due to invalid IL or missing references) //IL_03b0: Unknown result type (might be due to invalid IL or missing references) //IL_03ba: Expected O, but got Unknown //IL_03d0: Unknown result type (might be due to invalid IL or missing references) //IL_03df: 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_03fd: 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_0446: Unknown result type (might be due to invalid IL or missing references) //IL_0455: Unknown result type (might be due to invalid IL or missing references) //IL_0464: Unknown result type (might be due to invalid IL or missing references) //IL_046b: 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_04a5: Unknown result type (might be due to invalid IL or missing references) //IL_04aa: 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_04dc: Unknown result type (might be due to invalid IL or missing references) //IL_04e6: Expected O, but got Unknown //IL_0501: Unknown result type (might be due to invalid IL or missing references) //IL_0510: Unknown result type (might be due to invalid IL or missing references) //IL_0515: Unknown result type (might be due to invalid IL or missing references) //IL_051a: Unknown result type (might be due to invalid IL or missing references) //IL_0537: Unknown result type (might be due to invalid IL or missing references) //IL_0541: Expected O, but got Unknown //IL_0557: Unknown result type (might be due to invalid IL or missing references) //IL_0566: Unknown result type (might be due to invalid IL or missing references) //IL_0575: Unknown result type (might be due to invalid IL or missing references) //IL_057b: Unknown result type (might be due to invalid IL or missing references) _canvasGO = new GameObject("VitaSync_LoginCanvas"); Object.DontDestroyOnLoad((Object)(object)_canvasGO); Canvas val = _canvasGO.AddComponent(); val.renderMode = (RenderMode)0; val.sortingOrder = 9999; _canvasGO.AddComponent(); _canvasGO.AddComponent(); GameObject val2 = new GameObject("Panel"); val2.transform.SetParent(_canvasGO.transform, false); ((Graphic)val2.AddComponent()).color = C_BG; RectTransform component = val2.GetComponent(); Vector2 val3 = default(Vector2); ((Vector2)(ref val3))..ctor(0.5f, 0.5f); component.pivot = val3; Vector2 anchorMin = (component.anchorMax = val3); component.anchorMin = anchorMin; component.sizeDelta = new Vector2(360f, 310f); component.anchoredPosition = Vector2.zero; MakeRect(val2.transform, "Accent", new Vector2(0f, 0f), new Vector2(0f, 1f), new Vector2(3f, 0f), Vector2.zero, C_GOLD); GameObject val5 = new GameObject("Hdr"); val5.transform.SetParent(val2.transform, false); ((Graphic)val5.AddComponent()).color = C_HDR; RectTransform component2 = val5.GetComponent(); component2.anchorMin = new Vector2(0f, 1f); component2.anchorMax = new Vector2(1f, 1f); component2.pivot = new Vector2(0.5f, 1f); component2.sizeDelta = new Vector2(0f, 42f); component2.anchoredPosition = Vector2.zero; MakeRect(val5.transform, "HdrLine", new Vector2(0f, 0f), new Vector2(1f, 0f), new Vector2(0f, 2f), Vector2.zero, C_GOLD); MakeLbl(val5.transform, "LIFESYNC GAMES - ACCESO", new Vector2(0.5f, 0.5f), Vector2.zero, new Vector2(360f, 42f), 14, C_GOLD, bold: true, (TextAnchor)4); MakeLbl(val2.transform, "USUARIO", new Vector2(0.5f, 0.5f), new Vector2(0f, 96f), new Vector2(320f, 18f), 11, C_GOLD, bold: true, (TextAnchor)3); _userInput = MakeInput(val2.transform, "User", "correo@usach.cl", new Vector2(0f, 72f), new Vector2(320f, 30f), isPass: false, 12); MakeLbl(val2.transform, "CLAVE", new Vector2(0.5f, 0.5f), new Vector2(0f, 38f), new Vector2(320f, 18f), 11, C_GOLD, bold: true, (TextAnchor)3); float num = 280f; float num2 = -20f; _passInput = MakeInput(val2.transform, "Pass", "••••••••", new Vector2(num2, 14f), new Vector2(num, 30f), isPass: true, 12); GameObject val6 = MakeBtn(val2.transform, "BtnEye", "VER", new Vector2(145f, 14f), new Vector2(34f, 30f), C_BTN_EYE, C_BTN_EYE_T, 9); ((UnityEvent)val6.GetComponent