using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Globalization; using System.IO; 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 System.Text; using System.Text.RegularExpressions; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using Extensions; using GWYFVR.Input; using GWYFVR.Patches; using GWYFVR.Player; using GWYFVR.UI; using GWYFVR.XR; using HarmonyLib; using Microsoft.CodeAnalysis; using Mirror; using TMPro; using UnityEngine; using UnityEngine.EventSystems; using UnityEngine.Events; using UnityEngine.Experimental.Rendering; using UnityEngine.InputSystem; using UnityEngine.InputSystem.Controls; using UnityEngine.InputSystem.LowLevel; using UnityEngine.InputSystem.Utilities; using UnityEngine.Rendering; using UnityEngine.Rendering.Universal; using UnityEngine.SceneManagement; using UnityEngine.UI; using UnityEngine.XR; using UnityEngine.XR.Management; using UnityEngine.XR.OpenXR; using UnityEngine.XR.OpenXR.Features; using UnityEngine.XR.OpenXR.Features.Interactions; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: IgnoresAccessChecksTo("Assembly-CSharp-firstpass")] [assembly: IgnoresAccessChecksTo("Assembly-CSharp")] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("GWYFVR")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyDescription("VR mod for Gamble With Your Friends")] [assembly: AssemblyFileVersion("0.3.4.0")] [assembly: AssemblyInformationalVersion("0.3.4+2c4039e981e085ba8d9fd3c0f8da301d948f24fc")] [assembly: AssemblyProduct("GWYFVR")] [assembly: AssemblyTitle("GWYFVR")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("0.3.4.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; } } } namespace GWYFVR { internal class DevCommands : MonoBehaviour { private static DevCommands Instance; private float nextCheck; private bool lastGrip; private bool lastTrigger; private static string CommandFile => Path.Combine(Paths.BepInExRootPath, "gwyfvr-command.txt"); private void Awake() { Instance = this; } private void LogPresses() { _ = HandRoles.Active; bool flag = XRControllers.Left.Grip || XRControllers.Right.Grip; bool flag2 = XRControllers.Left.Trigger || XRControllers.Right.Trigger; if ((flag && !lastGrip) || (flag2 && !lastTrigger)) { Run(new string[1] { "state" }, ((flag && !lastGrip) ? "Grip" : "Trigger") + " press: "); } lastGrip = flag; lastTrigger = flag2; } private void Update() { LogPresses(); if (Time.unscaledTime < nextCheck) { return; } nextCheck = Time.unscaledTime + 0.5f; if (!File.Exists(CommandFile)) { return; } string[] array; try { array = File.ReadAllLines(CommandFile); File.Delete(CommandFile); } catch (IOException) { return; } string[] array2 = array; foreach (string text in array2) { if (!string.IsNullOrWhiteSpace(text)) { try { Run(text.Trim().Split(new char[1] { ' ' }, 2)); } catch (Exception arg) { Plugin.Log.LogError((object)$"Dev command '{text}' failed: {arg}"); } } } } private static string RayHit() { //IL_0030: 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) Camera val = (((Object)(object)VRPointer.Instance != (Object)null) ? VRPointer.Instance.PointerCamera : null); if ((Object)(object)val == (Object)null) { return ""; } RaycastHit[] array = Physics.RaycastAll(((Component)val).transform.position, ((Component)val).transform.forward, 5f, -1, (QueryTriggerInteraction)2); Array.Sort(array, (RaycastHit a, RaycastHit b) => ((RaycastHit)(ref a)).distance.CompareTo(((RaycastHit)(ref b)).distance)); StringBuilder stringBuilder = new StringBuilder(); for (int num = 0; num < array.Length && num < 4; num++) { stringBuilder.Append(string.Format("{0} [{1}{2}] {3:F2}m; ", PathOf(((Component)((RaycastHit)(ref array[num])).collider).transform), LayerMask.LayerToName(((Component)((RaycastHit)(ref array[num])).collider).gameObject.layer), ((RaycastHit)(ref array[num])).collider.isTrigger ? ", trigger" : "", ((RaycastHit)(ref array[num])).distance)); } return stringBuilder.ToString(); } private static void Run(string[] args, string prefix = "") { //IL_06b9: Unknown result type (might be due to invalid IL or missing references) //IL_04da: Unknown result type (might be due to invalid IL or missing references) //IL_04df: Unknown result type (might be due to invalid IL or missing references) //IL_06d0: Unknown result type (might be due to invalid IL or missing references) //IL_146c: Unknown result type (might be due to invalid IL or missing references) //IL_1473: Unknown result type (might be due to invalid IL or missing references) //IL_1478: Unknown result type (might be due to invalid IL or missing references) //IL_147d: Unknown result type (might be due to invalid IL or missing references) //IL_1490: Unknown result type (might be due to invalid IL or missing references) //IL_149c: Unknown result type (might be due to invalid IL or missing references) //IL_14a3: Unknown result type (might be due to invalid IL or missing references) //IL_14a8: Unknown result type (might be due to invalid IL or missing references) //IL_14bc: Unknown result type (might be due to invalid IL or missing references) //IL_14c1: Unknown result type (might be due to invalid IL or missing references) //IL_14c5: Unknown result type (might be due to invalid IL or missing references) //IL_12da: Unknown result type (might be due to invalid IL or missing references) //IL_12e1: Expected O, but got Unknown //IL_12fd: Unknown result type (might be due to invalid IL or missing references) //IL_10b0: Unknown result type (might be due to invalid IL or missing references) //IL_10b5: Unknown result type (might be due to invalid IL or missing references) //IL_10b9: Unknown result type (might be due to invalid IL or missing references) //IL_10be: Unknown result type (might be due to invalid IL or missing references) //IL_10c0: Unknown result type (might be due to invalid IL or missing references) //IL_10c5: Unknown result type (might be due to invalid IL or missing references) //IL_06f8: Unknown result type (might be due to invalid IL or missing references) //IL_0702: Unknown result type (might be due to invalid IL or missing references) //IL_070c: Unknown result type (might be due to invalid IL or missing references) //IL_06e7: Unknown result type (might be due to invalid IL or missing references) //IL_15f9: Unknown result type (might be due to invalid IL or missing references) //IL_0500: Unknown result type (might be due to invalid IL or missing references) //IL_111b: Unknown result type (might be due to invalid IL or missing references) //IL_1120: Unknown result type (might be due to invalid IL or missing references) //IL_1124: Unknown result type (might be due to invalid IL or missing references) //IL_11c3: Unknown result type (might be due to invalid IL or missing references) //IL_11c8: Unknown result type (might be due to invalid IL or missing references) //IL_11ca: Unknown result type (might be due to invalid IL or missing references) //IL_11cf: Unknown result type (might be due to invalid IL or missing references) //IL_0a75: Unknown result type (might be due to invalid IL or missing references) //IL_0641: Unknown result type (might be due to invalid IL or missing references) //IL_1239: Unknown result type (might be due to invalid IL or missing references) //IL_0c12: Unknown result type (might be due to invalid IL or missing references) //IL_0c17: Unknown result type (might be due to invalid IL or missing references) //IL_0c1b: Unknown result type (might be due to invalid IL or missing references) //IL_0c22: Unknown result type (might be due to invalid IL or missing references) //IL_0c27: Unknown result type (might be due to invalid IL or missing references) //IL_0c2c: Unknown result type (might be due to invalid IL or missing references) //IL_0c41: Unknown result type (might be due to invalid IL or missing references) //IL_0c46: Unknown result type (might be due to invalid IL or missing references) //IL_096f: Unknown result type (might be due to invalid IL or missing references) //IL_0cb6: Unknown result type (might be due to invalid IL or missing references) //IL_0cbb: Unknown result type (might be due to invalid IL or missing references) //IL_0cbf: Unknown result type (might be due to invalid IL or missing references) //IL_0da6: Unknown result type (might be due to invalid IL or missing references) //IL_0dad: Unknown result type (might be due to invalid IL or missing references) //IL_0db2: Unknown result type (might be due to invalid IL or missing references) //IL_0db7: Unknown result type (might be due to invalid IL or missing references) //IL_0dcc: Unknown result type (might be due to invalid IL or missing references) //IL_0dd1: Unknown result type (might be due to invalid IL or missing references) //IL_16b1: Unknown result type (might be due to invalid IL or missing references) //IL_0e90: Unknown result type (might be due to invalid IL or missing references) Bounds bounds; Vector3 val2; switch (args[0]) { case "screenshot": { string text = ((args.Length > 1) ? args[1] : Path.Combine(Paths.BepInExRootPath, "gwyfvr-screenshot.png")); ScreenCapture.CaptureScreenshot(text); Plugin.Log.LogInfo((object)("Screenshot saved to " + text)); break; } case "capture": Capture((args.Length > 1) ? args[1] : Path.Combine(Paths.BepInExRootPath, "gwyfvr-capture.png")); break; case "xrcapture": XRSubmitter.CaptureFile = ((args.Length > 1) ? args[1] : Path.Combine(Paths.BepInExRootPath, "gwyfvr-xrcapture.png")); if (URPXRSetup.Active) { ((MonoBehaviour)Instance).StartCoroutine(CaptureHeadsetAtEndOfFrame()); } break; case "buttons": { Button[] array7 = Object.FindObjectsByType