Decompiled source of WhiteKnuckleVR v1.1.3
BepInEx/plugins/WhiteKnuckleVRMod/Managed/Unity.XR.Management.dll
Decompiled a day agousing System; using System.CodeDom.Compiler; using System.Collections; using System.Collections.Generic; using System.ComponentModel; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using UnityEngine.Rendering; using UnityEngine.Serialization; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: InternalsVisibleTo("Unity.XR.Management.Editor")] [assembly: InternalsVisibleTo("Unity.XR.Management.Tests")] [assembly: InternalsVisibleTo("Unity.XR.Management.EditorTests")] [assembly: AssemblyVersion("0.0.0.0")] [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() { return new MonoScriptData { FilePathsData = new byte[522] { 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, 120, 114, 46, 109, 97, 110, 97, 103, 101, 109, 101, 110, 116, 64, 52, 46, 53, 46, 50, 92, 82, 117, 110, 116, 105, 109, 101, 92, 88, 82, 67, 111, 110, 102, 105, 103, 117, 114, 97, 116, 105, 111, 110, 68, 97, 116, 97, 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, 120, 114, 46, 109, 97, 110, 97, 103, 101, 109, 101, 110, 116, 64, 52, 46, 53, 46, 50, 92, 82, 117, 110, 116, 105, 109, 101, 92, 88, 82, 71, 101, 110, 101, 114, 97, 108, 83, 101, 116, 116, 105, 110, 103, 115, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 71, 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, 120, 114, 46, 109, 97, 110, 97, 103, 101, 109, 101, 110, 116, 64, 52, 46, 53, 46, 50, 92, 82, 117, 110, 116, 105, 109, 101, 92, 88, 82, 76, 111, 97, 100, 101, 114, 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, 120, 114, 46, 109, 97, 110, 97, 103, 101, 109, 101, 110, 116, 64, 52, 46, 53, 46, 50, 92, 82, 117, 110, 116, 105, 109, 101, 92, 88, 82, 76, 111, 97, 100, 101, 114, 72, 101, 108, 112, 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, 120, 114, 46, 109, 97, 110, 97, 103, 101, 109, 101, 110, 116, 64, 52, 46, 53, 46, 50, 92, 82, 117, 110, 116, 105, 109, 101, 92, 88, 82, 77, 97, 110, 97, 103, 101, 109, 101, 110, 116, 65, 110, 97, 108, 121, 116, 105, 99, 115, 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, 120, 114, 46, 109, 97, 110, 97, 103, 101, 109, 101, 110, 116, 64, 52, 46, 53, 46, 50, 92, 82, 117, 110, 116, 105, 109, 101, 92, 88, 82, 77, 97, 110, 97, 103, 101, 114, 83, 101, 116, 116, 105, 110, 103, 115, 46, 99, 115 }, TypesData = new byte[354] { 0, 0, 0, 0, 54, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 77, 97, 110, 97, 103, 101, 109, 101, 110, 116, 124, 88, 82, 67, 111, 110, 102, 105, 103, 117, 114, 97, 116, 105, 111, 110, 68, 97, 116, 97, 65, 116, 116, 114, 105, 98, 117, 116, 101, 0, 0, 0, 0, 43, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 77, 97, 110, 97, 103, 101, 109, 101, 110, 116, 124, 88, 82, 71, 101, 110, 101, 114, 97, 108, 83, 101, 116, 116, 105, 110, 103, 115, 0, 0, 0, 0, 34, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 77, 97, 110, 97, 103, 101, 109, 101, 110, 116, 124, 88, 82, 76, 111, 97, 100, 101, 114, 0, 0, 0, 0, 40, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 77, 97, 110, 97, 103, 101, 109, 101, 110, 116, 124, 88, 82, 76, 111, 97, 100, 101, 114, 72, 101, 108, 112, 101, 114, 0, 0, 0, 0, 47, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 77, 97, 110, 97, 103, 101, 109, 101, 110, 116, 124, 88, 82, 77, 97, 110, 97, 103, 101, 109, 101, 110, 116, 65, 110, 97, 108, 121, 116, 105, 99, 115, 0, 0, 0, 0, 58, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 77, 97, 110, 97, 103, 101, 109, 101, 110, 116, 46, 88, 82, 77, 97, 110, 97, 103, 101, 109, 101, 110, 116, 65, 110, 97, 108, 121, 116, 105, 99, 115, 124, 66, 117, 105, 108, 100, 69, 118, 101, 110, 116, 0, 0, 0, 0, 43, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 77, 97, 110, 97, 103, 101, 109, 101, 110, 116, 124, 88, 82, 77, 97, 110, 97, 103, 101, 114, 83, 101, 116, 116, 105, 110, 103, 115 }, TotalFiles = 6, TotalTypes = 7, IsEditorOnly = false }; } } namespace UnityEngine.XR.Management; [AttributeUsage(AttributeTargets.Class)] public sealed class XRConfigurationDataAttribute : Attribute { public string displayName { get; set; } public string buildSettingsKey { get; set; } private XRConfigurationDataAttribute() { } public XRConfigurationDataAttribute(string displayName, string buildSettingsKey) { this.displayName = displayName; this.buildSettingsKey = buildSettingsKey; } } public class XRGeneralSettings : ScriptableObject { public static string k_SettingsKey = "com.unity.xr.management.loader_settings"; internal static XRGeneralSettings s_RuntimeSettingsInstance = null; [SerializeField] internal XRManagerSettings m_LoaderManagerInstance; [SerializeField] [Tooltip("Toggling this on/off will enable/disable the automatic startup of XR at run time.")] internal bool m_InitManagerOnStart = true; private XRManagerSettings m_XRManager; private bool m_ProviderIntialized; private bool m_ProviderStarted; public XRManagerSettings Manager { get { return m_LoaderManagerInstance; } set { m_LoaderManagerInstance = value; } } public static XRGeneralSettings Instance => s_RuntimeSettingsInstance; public XRManagerSettings AssignedSettings => m_LoaderManagerInstance; public bool InitManagerOnStart => m_InitManagerOnStart; private void Awake() { Debug.Log((object)"XRGeneral Settings awakening..."); s_RuntimeSettingsInstance = this; Application.quitting += Quit; Object.DontDestroyOnLoad((Object)(object)s_RuntimeSettingsInstance); } private static void Quit() { XRGeneralSettings instance = Instance; if (!((Object)(object)instance == (Object)null)) { instance.DeInitXRSDK(); } } private void Start() { StartXRSDK(); } private void OnDestroy() { DeInitXRSDK(); } [RuntimeInitializeOnLoadMethod(/*Could not decode attribute arguments.*/)] internal static void AttemptInitializeXRSDKOnLoad() { XRGeneralSettings instance = Instance; if (!((Object)(object)instance == (Object)null) && instance.InitManagerOnStart) { instance.InitXRSDK(); } } [RuntimeInitializeOnLoadMethod(/*Could not decode attribute arguments.*/)] internal static void AttemptStartXRSDKOnBeforeSplashScreen() { XRGeneralSettings instance = Instance; if (!((Object)(object)instance == (Object)null) && instance.InitManagerOnStart) { instance.StartXRSDK(); } } private void InitXRSDK() { if (!((Object)(object)Instance == (Object)null) && !((Object)(object)Instance.m_LoaderManagerInstance == (Object)null) && Instance.m_InitManagerOnStart) { m_XRManager = Instance.m_LoaderManagerInstance; if ((Object)(object)m_XRManager == (Object)null) { Debug.LogError((object)"Assigned GameObject for XR Management loading is invalid. No XR Providers will be automatically loaded."); return; } m_XRManager.automaticLoading = false; m_XRManager.automaticRunning = false; m_XRManager.InitializeLoaderSync(); m_ProviderIntialized = true; } } private void StartXRSDK() { if ((Object)(object)m_XRManager != (Object)null && (Object)(object)m_XRManager.activeLoader != (Object)null) { m_XRManager.StartSubsystems(); m_ProviderStarted = true; } } private void StopXRSDK() { if ((Object)(object)m_XRManager != (Object)null && (Object)(object)m_XRManager.activeLoader != (Object)null) { m_XRManager.StopSubsystems(); m_ProviderStarted = false; } } private void DeInitXRSDK() { if ((Object)(object)m_XRManager != (Object)null && (Object)(object)m_XRManager.activeLoader != (Object)null) { m_XRManager.DeinitializeLoader(); m_XRManager = null; m_ProviderIntialized = false; } } } public abstract class XRLoader : ScriptableObject { public virtual bool Initialize() { return true; } public virtual bool Start() { return true; } public virtual bool Stop() { return true; } public virtual bool Deinitialize() { return true; } public abstract T GetLoadedSubsystem<T>() where T : class, ISubsystem; public virtual List<GraphicsDeviceType> GetSupportedGraphicsDeviceTypes(bool buildingPlayer) { return new List<GraphicsDeviceType>(); } } public abstract class XRLoaderHelper : XRLoader { protected Dictionary<Type, ISubsystem> m_SubsystemInstanceMap = new Dictionary<Type, ISubsystem>(); public override T GetLoadedSubsystem<T>() { Type typeFromHandle = typeof(T); m_SubsystemInstanceMap.TryGetValue(typeFromHandle, out var value); return value as T; } protected void StartSubsystem<T>() where T : class, ISubsystem { T loadedSubsystem = GetLoadedSubsystem<T>(); if (loadedSubsystem != null) { ((ISubsystem)loadedSubsystem).Start(); } } protected void StopSubsystem<T>() where T : class, ISubsystem { T loadedSubsystem = GetLoadedSubsystem<T>(); if (loadedSubsystem != null) { ((ISubsystem)loadedSubsystem).Stop(); } } protected void DestroySubsystem<T>() where T : class, ISubsystem { T loadedSubsystem = GetLoadedSubsystem<T>(); if (loadedSubsystem != null) { Type typeFromHandle = typeof(T); if (m_SubsystemInstanceMap.ContainsKey(typeFromHandle)) { m_SubsystemInstanceMap.Remove(typeFromHandle); } ((ISubsystem)loadedSubsystem).Destroy(); } } protected void CreateSubsystem<TDescriptor, TSubsystem>(List<TDescriptor> descriptors, string id) where TDescriptor : ISubsystemDescriptor where TSubsystem : ISubsystem { if (descriptors == null) { throw new ArgumentNullException("descriptors"); } SubsystemManager.GetSubsystemDescriptors<TDescriptor>(descriptors); if (descriptors.Count <= 0) { return; } foreach (TDescriptor descriptor in descriptors) { ISubsystem val = null; if (string.Compare(((ISubsystemDescriptor)descriptor).id, id, ignoreCase: true) == 0) { val = ((ISubsystemDescriptor)descriptor/*cast due to .constrained prefix*/).Create(); } if (val != null) { m_SubsystemInstanceMap[typeof(TSubsystem)] = val; break; } } } [Obsolete("This method is obsolete. Please use the geenric CreateSubsystem method.", false)] protected void CreateIntegratedSubsystem<TDescriptor, TSubsystem>(List<TDescriptor> descriptors, string id) where TDescriptor : IntegratedSubsystemDescriptor where TSubsystem : IntegratedSubsystem { CreateSubsystem<TDescriptor, TSubsystem>(descriptors, id); } [Obsolete("This method is obsolete. Please use the generic CreateSubsystem method.", false)] protected void CreateStandaloneSubsystem<TDescriptor, TSubsystem>(List<TDescriptor> descriptors, string id) where TDescriptor : SubsystemDescriptor where TSubsystem : Subsystem { CreateSubsystem<TDescriptor, TSubsystem>(descriptors, id); } public override bool Deinitialize() { m_SubsystemInstanceMap.Clear(); return base.Deinitialize(); } } internal static class XRManagementAnalytics { [Serializable] private struct BuildEvent { public string buildGuid; public string buildTarget; public string buildTargetGroup; public string[] assigned_loaders; } private const int kMaxEventsPerHour = 1000; private const int kMaxNumberOfElements = 1000; private const string kVendorKey = "unity.xrmanagement"; private const string kEventBuild = "xrmanagment_build"; private static bool s_Initialized; private static bool Initialize() { return s_Initialized; } } public sealed class XRManagerSettings : ScriptableObject { [HideInInspector] private bool m_InitializationComplete; [HideInInspector] [SerializeField] private bool m_RequiresSettingsUpdate; [SerializeField] [Tooltip("Determines if the XR Manager instance is responsible for creating and destroying the appropriate loader instance.")] [FormerlySerializedAs("AutomaticLoading")] private bool m_AutomaticLoading; [SerializeField] [Tooltip("Determines if the XR Manager instance is responsible for starting and stopping subsystems for the active loader instance.")] [FormerlySerializedAs("AutomaticRunning")] private bool m_AutomaticRunning; [SerializeField] [Tooltip("List of XR Loader instances arranged in desired load order.")] [FormerlySerializedAs("Loaders")] private List<XRLoader> m_Loaders = new List<XRLoader>(); [SerializeField] [HideInInspector] private HashSet<XRLoader> m_RegisteredLoaders = new HashSet<XRLoader>(); public bool automaticLoading { get { return m_AutomaticLoading; } set { m_AutomaticLoading = value; } } public bool automaticRunning { get { return m_AutomaticRunning; } set { m_AutomaticRunning = value; } } [Obsolete("'XRManagerSettings.loaders' property is obsolete. Use 'XRManagerSettings.activeLoaders' instead to get a list of the current loaders.")] public List<XRLoader> loaders => m_Loaders; public IReadOnlyList<XRLoader> activeLoaders => m_Loaders; public bool isInitializationComplete => m_InitializationComplete; [HideInInspector] public XRLoader activeLoader { get; private set; } internal List<XRLoader> currentLoaders { get { return m_Loaders; } set { m_Loaders = value; } } internal HashSet<XRLoader> registeredLoaders => m_RegisteredLoaders; public T ActiveLoaderAs<T>() where T : XRLoader { return activeLoader as T; } public void InitializeLoaderSync() { if ((Object)(object)activeLoader != (Object)null) { Debug.LogWarning((object)"XR Management has already initialized an active loader in this scene. Please make sure to stop all subsystems and deinitialize the active loader before initializing a new one."); return; } foreach (XRLoader currentLoader in currentLoaders) { if ((Object)(object)currentLoader != (Object)null && CheckGraphicsAPICompatibility(currentLoader) && currentLoader.Initialize()) { activeLoader = currentLoader; m_InitializationComplete = true; return; } } activeLoader = null; } public IEnumerator InitializeLoader() { if ((Object)(object)activeLoader != (Object)null) { Debug.LogWarning((object)"XR Management has already initialized an active loader in this scene. Please make sure to stop all subsystems and deinitialize the active loader before initializing a new one."); yield break; } foreach (XRLoader currentLoader in currentLoaders) { if ((Object)(object)currentLoader != (Object)null && CheckGraphicsAPICompatibility(currentLoader) && currentLoader.Initialize()) { activeLoader = currentLoader; m_InitializationComplete = true; yield break; } yield return null; } activeLoader = null; } public bool TryAddLoader(XRLoader loader, int index = -1) { if ((Object)(object)loader == (Object)null || currentLoaders.Contains(loader)) { return false; } if (!m_RegisteredLoaders.Contains(loader)) { return false; } if (index < 0 || index >= currentLoaders.Count) { currentLoaders.Add(loader); } else { currentLoaders.Insert(index, loader); } return true; } public bool TryRemoveLoader(XRLoader loader) { bool result = true; if (currentLoaders.Contains(loader)) { result = currentLoaders.Remove(loader); } return result; } public bool TrySetLoaders(List<XRLoader> reorderedLoaders) { List<XRLoader> list = new List<XRLoader>(activeLoaders); currentLoaders.Clear(); foreach (XRLoader reorderedLoader in reorderedLoaders) { if (!TryAddLoader(reorderedLoader)) { currentLoaders = list; return false; } } return true; } private void Awake() { foreach (XRLoader currentLoader in currentLoaders) { if (!m_RegisteredLoaders.Contains(currentLoader)) { m_RegisteredLoaders.Add(currentLoader); } } } private unsafe bool CheckGraphicsAPICompatibility(XRLoader loader) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: 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) GraphicsDeviceType graphicsDeviceType = SystemInfo.graphicsDeviceType; List<GraphicsDeviceType> supportedGraphicsDeviceTypes = loader.GetSupportedGraphicsDeviceTypes(buildingPlayer: false); if (supportedGraphicsDeviceTypes.Count > 0 && !supportedGraphicsDeviceTypes.Contains(graphicsDeviceType)) { Debug.LogWarning((object)$"The {((Object)loader).name} does not support the initialized graphics device, {((object)(*(GraphicsDeviceType*)(&graphicsDeviceType))/*cast due to .constrained prefix*/).ToString()}. Please change the preffered Graphics API in PlayerSettings. Attempting to start the next XR loader."); return false; } return true; } public void StartSubsystems() { if (!m_InitializationComplete) { Debug.LogWarning((object)"Call to StartSubsystems without an initialized manager.Please make sure wait for initialization to complete before calling this API."); } else if ((Object)(object)activeLoader != (Object)null) { activeLoader.Start(); } } public void StopSubsystems() { if (!m_InitializationComplete) { Debug.LogWarning((object)"Call to StopSubsystems without an initialized manager.Please make sure wait for initialization to complete before calling this API."); } else if ((Object)(object)activeLoader != (Object)null) { activeLoader.Stop(); } } public void DeinitializeLoader() { if (!m_InitializationComplete) { Debug.LogWarning((object)"Call to DeinitializeLoader without an initialized manager.Please make sure wait for initialization to complete before calling this API."); return; } StopSubsystems(); if ((Object)(object)activeLoader != (Object)null) { activeLoader.Deinitialize(); activeLoader = null; } m_InitializationComplete = false; } private void Start() { if (automaticLoading && automaticRunning) { StartSubsystems(); } } private void OnDisable() { if (automaticLoading && automaticRunning) { StopSubsystems(); } } private void OnDestroy() { if (automaticLoading) { DeinitializeLoader(); } } }
BepInEx/plugins/WhiteKnuckleVRMod/Managed/Unity.XR.OpenXR.dll
Decompiled a day 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.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Security; using System.Security.Cryptography; using System.Security.Permissions; using System.Text; using System.Threading; using AOT; using UnityEngine.Analytics; using UnityEngine.Events; using UnityEngine.InputSystem; using UnityEngine.InputSystem.Controls; using UnityEngine.InputSystem.Layouts; using UnityEngine.InputSystem.LowLevel; using UnityEngine.InputSystem.Utilities; using UnityEngine.InputSystem.XR; using UnityEngine.Rendering; using UnityEngine.Scripting; using UnityEngine.Serialization; using UnityEngine.XR.Management; using UnityEngine.XR.OpenXR.Features; using UnityEngine.XR.OpenXR.Features.Interactions; using UnityEngine.XR.OpenXR.Input; using UnityEngine.XR.OpenXR.NativeTypes; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: InternalsVisibleTo("Unity.XR.OpenXR.Editor")] [assembly: InternalsVisibleTo("UnityEditor.XR.OpenXR.Tests")] [assembly: Preserve] [assembly: InternalsVisibleTo("Unity.XR.OpenXR.TestHelpers")] [assembly: InternalsVisibleTo("Unity.XR.OpenXR.Tests")] [assembly: InternalsVisibleTo("Unity.XR.OpenXR.Tests.Editor")] [assembly: InternalsVisibleTo("Unity.XR.OpenXR.Features.MockRuntime")] [assembly: InternalsVisibleTo("Unity.XR.OpenXR.Features.ConformanceAutomation")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("0.0.0.0")] [module: UnverifiableCode] [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() { return new MonoScriptData { FilePathsData = new byte[4123] { 0, 0, 0, 2, 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, 120, 114, 46, 111, 112, 101, 110, 120, 114, 64, 49, 46, 49, 52, 46, 51, 92, 82, 117, 110, 116, 105, 109, 101, 92, 70, 101, 97, 116, 117, 114, 101, 115, 92, 69, 120, 116, 101, 110, 115, 105, 111, 110, 115, 92, 88, 114, 80, 101, 114, 102, 111, 114, 109, 97, 110, 99, 101, 83, 101, 116, 116, 105, 110, 103, 115, 70, 101, 97, 116, 117, 114, 101, 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, 120, 114, 46, 111, 112, 101, 110, 120, 114, 64, 49, 46, 49, 52, 46, 51, 92, 82, 117, 110, 116, 105, 109, 101, 92, 70, 101, 97, 116, 117, 114, 101, 115, 92, 69, 120, 116, 101, 110, 115, 105, 111, 110, 115, 92, 88, 114, 80, 101, 114, 102, 111, 114, 109, 97, 110, 99, 101, 83, 101, 116, 116, 105, 110, 103, 115, 84, 121, 112, 101, 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, 120, 114, 46, 111, 112, 101, 110, 120, 114, 64, 49, 46, 49, 52, 46, 51, 92, 82, 117, 110, 116, 105, 109, 101, 92, 70, 101, 97, 116, 117, 114, 101, 115, 92, 70, 111, 118, 101, 97, 116, 101, 100, 82, 101, 110, 100, 101, 114, 105, 110, 103, 70, 101, 97, 116, 117, 114, 101, 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, 120, 114, 46, 111, 112, 101, 110, 120, 114, 64, 49, 46, 49, 52, 46, 51, 92, 82, 117, 110, 116, 105, 109, 101, 92, 70, 101, 97, 116, 117, 114, 101, 115, 92, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 115, 92, 68, 80, 97, 100, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 46, 99, 115, 0, 0, 0, 3, 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, 120, 114, 46, 111, 112, 101, 110, 120, 114, 64, 49, 46, 49, 52, 46, 51, 92, 82, 117, 110, 116, 105, 109, 101, 92, 70, 101, 97, 116, 117, 114, 101, 115, 92, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 115, 92, 69, 121, 101, 71, 97, 122, 101, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 46, 99, 115, 0, 0, 0, 2, 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, 120, 114, 46, 111, 112, 101, 110, 120, 114, 64, 49, 46, 49, 52, 46, 51, 92, 82, 117, 110, 116, 105, 109, 101, 92, 70, 101, 97, 116, 117, 114, 101, 115, 92, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 115, 92, 72, 97, 110, 100, 67, 111, 109, 109, 111, 110, 80, 111, 115, 101, 115, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 46, 99, 115, 0, 0, 0, 2, 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, 120, 114, 46, 111, 112, 101, 110, 120, 114, 64, 49, 46, 49, 52, 46, 51, 92, 82, 117, 110, 116, 105, 109, 101, 92, 70, 101, 97, 116, 117, 114, 101, 115, 92, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 115, 92, 72, 97, 110, 100, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 80, 114, 111, 102, 105, 108, 101, 46, 99, 115, 0, 0, 0, 2, 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, 120, 114, 46, 111, 112, 101, 110, 120, 114, 64, 49, 46, 49, 52, 46, 51, 92, 82, 117, 110, 116, 105, 109, 101, 92, 70, 101, 97, 116, 117, 114, 101, 115, 92, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 115, 92, 72, 80, 82, 101, 118, 101, 114, 98, 71, 50, 67, 111, 110, 116, 114, 111, 108, 108, 101, 114, 80, 114, 111, 102, 105, 108, 101, 46, 99, 115, 0, 0, 0, 2, 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, 120, 114, 46, 111, 112, 101, 110, 120, 114, 64, 49, 46, 49, 52, 46, 51, 92, 82, 117, 110, 116, 105, 109, 101, 92, 70, 101, 97, 116, 117, 114, 101, 115, 92, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 115, 92, 72, 84, 67, 86, 105, 118, 101, 67, 111, 110, 116, 114, 111, 108, 108, 101, 114, 80, 114, 111, 102, 105, 108, 101, 46, 99, 115, 0, 0, 0, 2, 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, 120, 114, 46, 111, 112, 101, 110, 120, 114, 64, 49, 46, 49, 52, 46, 51, 92, 82, 117, 110, 116, 105, 109, 101, 92, 70, 101, 97, 116, 117, 114, 101, 115, 92, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 115, 92, 75, 72, 82, 83, 105, 109, 112, 108, 101, 67, 111, 110, 116, 114, 111, 108, 108, 101, 114, 80, 114, 111, 102, 105, 108, 101, 46, 99, 115, 0, 0, 0, 2, 0, 0, 0, 117, 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, 120, 114, 46, 111, 112, 101, 110, 120, 114, 64, 49, 46, 49, 52, 46, 51, 92, 82, 117, 110, 116, 105, 109, 101, 92, 70, 101, 97, 116, 117, 114, 101, 115, 92, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 115, 92, 77, 101, 116, 97, 81, 117, 101, 115, 116, 84, 111, 117, 99, 104, 80, 108, 117, 115, 67, 111, 110, 116, 114, 111, 108, 108, 101, 114, 80, 114, 111, 102, 105, 108, 101, 46, 99, 115, 0, 0, 0, 2, 0, 0, 0, 116, 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, 120, 114, 46, 111, 112, 101, 110, 120, 114, 64, 49, 46, 49, 52, 46, 51, 92, 82, 117, 110, 116, 105, 109, 101, 92, 70, 101, 97, 116, 117, 114, 101, 115, 92, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 115, 92, 77, 101, 116, 97, 81, 117, 101, 115, 116, 84, 111, 117, 99, 104, 80, 114, 111, 67, 111, 110, 116, 114, 111, 108, 108, 101, 114, 80, 114, 111, 102, 105, 108, 101, 46, 99, 115, 0, 0, 0, 2, 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, 120, 114, 46, 111, 112, 101, 110, 120, 114, 64, 49, 46, 49, 52, 46, 51, 92, 82, 117, 110, 116, 105, 109, 101, 92, 70, 101, 97, 116, 117, 114, 101, 115, 92, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 115, 92, 77, 105, 99, 114, 111, 115, 111, 102, 116, 72, 97, 110, 100, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 46, 99, 115, 0, 0, 0, 2, 0, 0, 0, 114, 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, 120, 114, 46, 111, 112, 101, 110, 120, 114, 64, 49, 46, 49, 52, 46, 51, 92, 82, 117, 110, 116, 105, 109, 101, 92, 70, 101, 97, 116, 117, 114, 101, 115, 92, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 115, 92, 77, 105, 99, 114, 111, 115, 111, 102, 116, 77, 111, 116, 105, 111, 110, 67, 111, 110, 116, 114, 111, 108, 108, 101, 114, 80, 114, 111, 102, 105, 108, 101, 46, 99, 115, 0, 0, 0, 2, 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, 120, 114, 46, 111, 112, 101, 110, 120, 114, 64, 49, 46, 49, 52, 46, 51, 92, 82, 117, 110, 116, 105, 109, 101, 92, 70, 101, 97, 116, 117, 114, 101, 115, 92, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 115, 92, 79, 99, 117, 108, 117, 115, 84, 111, 117, 99, 104, 67, 111, 110, 116, 114, 111, 108, 108, 101, 114, 80, 114, 111, 102, 105, 108, 101, 46, 99, 115, 0, 0, 0, 2, 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, 120, 114, 46, 111, 112, 101, 110, 120, 114, 64, 49, 46, 49, 52, 46, 51, 92, 82, 117, 110, 116, 105, 109, 101, 92, 70, 101, 97, 116, 117, 114, 101, 115, 92, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 115, 92, 80, 97, 108, 109, 80, 111, 115, 101, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 46, 99, 115, 0, 0, 0, 2, 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, 120, 114, 46, 111, 112, 101, 110, 120, 114, 64, 49, 46, 49, 52, 46, 51, 92, 82, 117, 110, 116, 105, 109, 101, 92, 70, 101, 97, 116, 117, 114, 101, 115, 92, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 115, 92, 86, 97, 108, 118, 101, 73, 110, 100, 101, 120, 67, 111, 110, 116, 114, 111, 108, 108, 101, 114, 80, 114, 111, 102, 105, 108, 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, 120, 114, 46, 111, 112, 101, 110, 120, 114, 64, 49, 46, 49, 52, 46, 51, 92, 82, 117, 110, 116, 105, 109, 101, 92, 70, 101, 97, 116, 117, 114, 101, 115, 92, 79, 112, 101, 110, 88, 82, 70, 101, 97, 116, 117, 114, 101, 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, 120, 114, 46, 111, 112, 101, 110, 120, 114, 64, 49, 46, 49, 52, 46, 51, 92, 82, 117, 110, 116, 105, 109, 101, 92, 70, 101, 97, 116, 117, 114, 101, 115, 92, 79, 112, 101, 110, 88, 82, 70, 101, 97, 116, 117, 114, 101, 73, 110, 116, 101, 114, 110, 97, 108, 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, 120, 114, 46, 111, 112, 101, 110, 120, 114, 64, 49, 46, 49, 52, 46, 51, 92, 82, 117, 110, 116, 105, 109, 101, 92, 70, 101, 97, 116, 117, 114, 101, 115, 92, 79, 112, 101, 110, 88, 82, 70, 101, 97, 116, 117, 114, 101, 83, 101, 116, 116, 105, 110, 103, 115, 46, 99, 115, 0, 0, 0, 6, 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, 120, 114, 46, 111, 112, 101, 110, 120, 114, 64, 49, 46, 49, 52, 46, 51, 92, 82, 117, 110, 116, 105, 109, 101, 92, 70, 101, 97, 116, 117, 114, 101, 115, 92, 79, 112, 101, 110, 88, 82, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 70, 101, 97, 116, 117, 114, 101, 46, 99, 115, 0, 0, 0, 2, 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, 120, 114, 46, 111, 112, 101, 110, 120, 114, 64, 49, 46, 49, 52, 46, 51, 92, 82, 117, 110, 116, 105, 109, 101, 92, 105, 110, 112, 117, 116, 92, 72, 97, 112, 116, 105, 99, 67, 111, 110, 116, 114, 111, 108, 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, 120, 114, 46, 111, 112, 101, 110, 120, 114, 64, 49, 46, 49, 52, 46, 51, 92, 82, 117, 110, 116, 105, 109, 101, 92, 105, 110, 112, 117, 116, 92, 79, 112, 101, 110, 88, 82, 68, 101, 118, 105, 99, 101, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 75, 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, 120, 114, 46, 111, 112, 101, 110, 120, 114, 64, 49, 46, 49, 52, 46, 51, 92, 82, 117, 110, 116, 105, 109, 101, 92, 105, 110, 112, 117, 116, 92, 79, 112, 101, 110, 88, 82, 72, 109, 100, 46, 99, 115, 0, 0, 0, 4, 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, 120, 114, 46, 111, 112, 101, 110, 120, 114, 64, 49, 46, 49, 52, 46, 51, 92, 82, 117, 110, 116, 105, 109, 101, 92, 105, 110, 112, 117, 116, 92, 79, 112, 101, 110, 88, 82, 73, 110, 112, 117, 116, 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, 120, 114, 46, 111, 112, 101, 110, 120, 114, 64, 49, 46, 49, 52, 46, 51, 92, 82, 117, 110, 116, 105, 109, 101, 92, 105, 110, 112, 117, 116, 92, 80, 111, 115, 101, 67, 111, 110, 116, 114, 111, 108, 46, 99, 115, 0, 0, 0, 2, 0, 0, 0, 75, 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, 120, 114, 46, 111, 112, 101, 110, 120, 114, 64, 49, 46, 49, 52, 46, 51, 92, 82, 117, 110, 116, 105, 109, 101, 92, 79, 112, 101, 110, 88, 82, 65, 110, 97, 108, 121, 116, 105, 99, 115, 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, 120, 114, 46, 111, 112, 101, 110, 120, 114, 64, 49, 46, 49, 52, 46, 51, 92, 82, 117, 110, 116, 105, 109, 101, 92, 79, 112, 101, 110, 88, 82, 67, 111, 108, 111, 114, 83, 117, 98, 109, 105, 115, 115, 111, 110, 77, 111, 100, 101, 76, 105, 115, 116, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 75, 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, 120, 114, 46, 111, 112, 101, 110, 120, 114, 64, 49, 46, 49, 52, 46, 51, 92, 82, 117, 110, 116, 105, 109, 101, 92, 79, 112, 101, 110, 88, 82, 67, 111, 110, 115, 116, 97, 110, 116, 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, 120, 114, 46, 111, 112, 101, 110, 120, 114, 64, 49, 46, 49, 52, 46, 51, 92, 82, 117, 110, 116, 105, 109, 101, 92, 79, 112, 101, 110, 88, 82, 68, 105, 97, 103, 110, 111, 115, 116, 105, 99, 82, 101, 112, 111, 114, 116, 46, 99, 115, 0, 0, 0, 3, 0, 0, 0, 72, 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, 120, 114, 46, 111, 112, 101, 110, 120, 114, 64, 49, 46, 49, 52, 46, 51, 92, 82, 117, 110, 116, 105, 109, 101, 92, 79, 112, 101, 110, 88, 82, 76, 111, 97, 100, 101, 114, 46, 99, 115, 0, 0, 0, 1, 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, 120, 114, 46, 111, 112, 101, 110, 120, 114, 64, 49, 46, 49, 52, 46, 51, 92, 82, 117, 110, 116, 105, 109, 101, 92, 79, 112, 101, 110, 88, 82, 76, 111, 97, 100, 101, 114, 66, 97, 115, 101, 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, 120, 114, 46, 111, 112, 101, 110, 120, 114, 64, 49, 46, 49, 52, 46, 51, 92, 82, 117, 110, 116, 105, 109, 101, 92, 79, 112, 101, 110, 88, 82, 76, 111, 97, 100, 101, 114, 78, 111, 80, 114, 101, 73, 110, 105, 116, 46, 99, 115, 0, 0, 0, 7, 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, 120, 114, 46, 111, 112, 101, 110, 120, 114, 64, 49, 46, 49, 52, 46, 51, 92, 82, 117, 110, 116, 105, 109, 101, 92, 79, 112, 101, 110, 88, 82, 78, 97, 116, 105, 118, 101, 84, 121, 112, 101, 115, 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, 120, 114, 46, 111, 112, 101, 110, 120, 114, 64, 49, 46, 49, 52, 46, 51, 92, 82, 117, 110, 116, 105, 109, 101, 92, 79, 112, 101, 110, 88, 82, 82, 101, 110, 100, 101, 114, 83, 101, 116, 116, 105, 110, 103, 115, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 75, 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, 120, 114, 46, 111, 112, 101, 110, 120, 114, 64, 49, 46, 49, 52, 46, 51, 92, 82, 117, 110, 116, 105, 109, 101, 92, 79, 112, 101, 110, 88, 82, 82, 101, 115, 116, 97, 114, 116, 101, 114, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 73, 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, 120, 114, 46, 111, 112, 101, 110, 120, 114, 64, 49, 46, 49, 52, 46, 51, 92, 82, 117, 110, 116, 105, 109, 101, 92, 79, 112, 101, 110, 88, 82, 82, 117, 110, 116, 105, 109, 101, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 74, 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, 120, 114, 46, 111, 112, 101, 110, 120, 114, 64, 49, 46, 49, 52, 46, 51, 92, 82, 117, 110, 116, 105, 109, 101, 92, 79, 112, 101, 110, 88, 82, 83, 101, 116, 116, 105, 110, 103, 115, 46, 99, 115, 0, 0, 0, 1, 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, 120, 114, 46, 111, 112, 101, 110, 120, 114, 64, 49, 46, 49, 52, 46, 51, 92, 82, 117, 110, 116, 105, 109, 101, 92, 79, 112, 101, 110, 88, 82, 83, 112, 97, 99, 101, 83, 101, 116, 116, 105, 110, 103, 115, 46, 99, 115, 0, 0, 0, 3, 0, 0, 0, 74, 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, 120, 114, 46, 111, 112, 101, 110, 120, 114, 64, 49, 46, 49, 52, 46, 51, 92, 82, 117, 110, 116, 105, 109, 101, 92, 79, 112, 101, 110, 88, 82, 85, 110, 105, 116, 121, 65, 80, 73, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 73, 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, 120, 114, 46, 111, 112, 101, 110, 120, 114, 64, 49, 46, 49, 52, 46, 51, 92, 82, 117, 110, 116, 105, 109, 101, 92, 79, 112, 101, 110, 88, 82, 85, 116, 105, 108, 105, 116, 121, 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, 120, 114, 46, 111, 112, 101, 110, 120, 114, 64, 49, 46, 49, 52, 46, 51, 92, 82, 117, 110, 116, 105, 109, 101, 92, 87, 97, 105, 116, 70, 111, 114, 82, 101, 115, 116, 97, 114, 116, 70, 105, 110, 105, 115, 104, 46, 99, 115 }, TypesData = new byte[5137] { 0, 0, 0, 0, 90, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 46, 70, 101, 97, 116, 117, 114, 101, 115, 46, 69, 120, 116, 101, 110, 115, 105, 111, 110, 115, 46, 80, 101, 114, 102, 111, 114, 109, 97, 110, 99, 101, 83, 101, 116, 116, 105, 110, 103, 115, 124, 88, 114, 80, 101, 114, 102, 111, 114, 109, 97, 110, 99, 101, 83, 101, 116, 116, 105, 110, 103, 115, 70, 101, 97, 116, 117, 114, 101, 0, 0, 0, 0, 100, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 46, 70, 101, 97, 116, 117, 114, 101, 115, 46, 69, 120, 116, 101, 110, 115, 105, 111, 110, 115, 46, 80, 101, 114, 102, 111, 114, 109, 97, 110, 99, 101, 83, 101, 116, 116, 105, 110, 103, 115, 46, 88, 114, 80, 101, 114, 102, 111, 114, 109, 97, 110, 99, 101, 83, 101, 116, 116, 105, 110, 103, 115, 70, 101, 97, 116, 117, 114, 101, 124, 78, 97, 116, 105, 118, 101, 65, 112, 105, 0, 0, 0, 0, 91, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 46, 70, 101, 97, 116, 117, 114, 101, 115, 46, 69, 120, 116, 101, 110, 115, 105, 111, 110, 115, 46, 80, 101, 114, 102, 111, 114, 109, 97, 110, 99, 101, 83, 101, 116, 116, 105, 110, 103, 115, 124, 80, 101, 114, 102, 111, 114, 109, 97, 110, 99, 101, 67, 104, 97, 110, 103, 101, 78, 111, 116, 105, 102, 105, 99, 97, 116, 105, 111, 110, 0, 0, 0, 0, 55, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 46, 70, 101, 97, 116, 117, 114, 101, 115, 124, 70, 111, 118, 101, 97, 116, 101, 100, 82, 101, 110, 100, 101, 114, 105, 110, 103, 70, 101, 97, 116, 117, 114, 101, 0, 0, 0, 0, 59, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 46, 70, 101, 97, 116, 117, 114, 101, 115, 46, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 115, 124, 68, 80, 97, 100, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 0, 0, 0, 0, 64, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 46, 70, 101, 97, 116, 117, 114, 101, 115, 46, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 115, 46, 68, 80, 97, 100, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 124, 68, 80, 97, 100, 0, 0, 0, 0, 62, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 46, 70, 101, 97, 116, 117, 114, 101, 115, 46, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 115, 124, 69, 121, 101, 71, 97, 122, 101, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 0, 0, 0, 0, 76, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 46, 70, 101, 97, 116, 117, 114, 101, 115, 46, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 115, 46, 69, 121, 101, 71, 97, 122, 101, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 124, 69, 121, 101, 71, 97, 122, 101, 68, 101, 118, 105, 99, 101, 0, 0, 0, 0, 61, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 46, 70, 101, 97, 116, 117, 114, 101, 115, 46, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 115, 124, 69, 121, 101, 84, 114, 97, 99, 107, 105, 110, 103, 85, 115, 97, 103, 101, 115, 0, 0, 0, 0, 70, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 46, 70, 101, 97, 116, 117, 114, 101, 115, 46, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 115, 124, 72, 97, 110, 100, 67, 111, 109, 109, 111, 110, 80, 111, 115, 101, 115, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 0, 0, 0, 0, 91, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 46, 70, 101, 97, 116, 117, 114, 101, 115, 46, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 115, 46, 72, 97, 110, 100, 67, 111, 109, 109, 111, 110, 80, 111, 115, 101, 115, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 124, 72, 97, 110, 100, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 80, 111, 115, 101, 115, 0, 0, 0, 0, 66, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 46, 70, 101, 97, 116, 117, 114, 101, 115, 46, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 115, 124, 72, 97, 110, 100, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 80, 114, 111, 102, 105, 108, 101, 0, 0, 0, 0, 82, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 46, 70, 101, 97, 116, 117, 114, 101, 115, 46, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 115, 46, 72, 97, 110, 100, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 80, 114, 111, 102, 105, 108, 101, 124, 72, 97, 110, 100, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 0, 0, 0, 0, 71, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 46, 70, 101, 97, 116, 117, 114, 101, 115, 46, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 115, 124, 72, 80, 82, 101, 118, 101, 114, 98, 71, 50, 67, 111, 110, 116, 114, 111, 108, 108, 101, 114, 80, 114, 111, 102, 105, 108, 101, 0, 0, 0, 0, 90, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 46, 70, 101, 97, 116, 117, 114, 101, 115, 46, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 115, 46, 72, 80, 82, 101, 118, 101, 114, 98, 71, 50, 67, 111, 110, 116, 114, 111, 108, 108, 101, 114, 80, 114, 111, 102, 105, 108, 101, 124, 82, 101, 118, 101, 114, 98, 71, 50, 67, 111, 110, 116, 114, 111, 108, 108, 101, 114, 0, 0, 0, 0, 68, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 46, 70, 101, 97, 116, 117, 114, 101, 115, 46, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 115, 124, 72, 84, 67, 86, 105, 118, 101, 67, 111, 110, 116, 114, 111, 108, 108, 101, 114, 80, 114, 111, 102, 105, 108, 101, 0, 0, 0, 0, 83, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 46, 70, 101, 97, 116, 117, 114, 101, 115, 46, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 115, 46, 72, 84, 67, 86, 105, 118, 101, 67, 111, 110, 116, 114, 111, 108, 108, 101, 114, 80, 114, 111, 102, 105, 108, 101, 124, 86, 105, 118, 101, 67, 111, 110, 116, 114, 111, 108, 108, 101, 114, 0, 0, 0, 0, 70, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 46, 70, 101, 97, 116, 117, 114, 101, 115, 46, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 115, 124, 75, 72, 82, 83, 105, 109, 112, 108, 101, 67, 111, 110, 116, 114, 111, 108, 108, 101, 114, 80, 114, 111, 102, 105, 108, 101, 0, 0, 0, 0, 90, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 46, 70, 101, 97, 116, 117, 114, 101, 115, 46, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 115, 46, 75, 72, 82, 83, 105, 109, 112, 108, 101, 67, 111, 110, 116, 114, 111, 108, 108, 101, 114, 80, 114, 111, 102, 105, 108, 101, 124, 75, 72, 82, 83, 105, 109, 112, 108, 101, 67, 111, 110, 116, 114, 111, 108, 108, 101, 114, 0, 0, 0, 0, 79, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 46, 70, 101, 97, 116, 117, 114, 101, 115, 46, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 115, 124, 77, 101, 116, 97, 81, 117, 101, 115, 116, 84, 111, 117, 99, 104, 80, 108, 117, 115, 67, 111, 110, 116, 114, 111, 108, 108, 101, 114, 80, 114, 111, 102, 105, 108, 101, 0, 0, 0, 0, 104, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 46, 70, 101, 97, 116, 117, 114, 101, 115, 46, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 115, 46, 77, 101, 116, 97, 81, 117, 101, 115, 116, 84, 111, 117, 99, 104, 80, 108, 117, 115, 67, 111, 110, 116, 114, 111, 108, 108, 101, 114, 80, 114, 111, 102, 105, 108, 101, 124, 81, 117, 101, 115, 116, 84, 111, 117, 99, 104, 80, 108, 117, 115, 67, 111, 110, 116, 114, 111, 108, 108, 101, 114, 0, 0, 0, 0, 78, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 46, 70, 101, 97, 116, 117, 114, 101, 115, 46, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 115, 124, 77, 101, 116, 97, 81, 117, 101, 115, 116, 84, 111, 117, 99, 104, 80, 114, 111, 67, 111, 110, 116, 114, 111, 108, 108, 101, 114, 80, 114, 111, 102, 105, 108, 101, 0, 0, 0, 0, 102, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 46, 70, 101, 97, 116, 117, 114, 101, 115, 46, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 115, 46, 77, 101, 116, 97, 81, 117, 101, 115, 116, 84, 111, 117, 99, 104, 80, 114, 111, 67, 111, 110, 116, 114, 111, 108, 108, 101, 114, 80, 114, 111, 102, 105, 108, 101, 124, 81, 117, 101, 115, 116, 80, 114, 111, 84, 111, 117, 99, 104, 67, 111, 110, 116, 114, 111, 108, 108, 101, 114, 0, 0, 0, 0, 68, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 46, 70, 101, 97, 116, 117, 114, 101, 115, 46, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 115, 124, 77, 105, 99, 114, 111, 115, 111, 102, 116, 72, 97, 110, 100, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 0, 0, 0, 0, 81, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 46, 70, 101, 97, 116, 117, 114, 101, 115, 46, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 115, 46, 77, 105, 99, 114, 111, 115, 111, 102, 116, 72, 97, 110, 100, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 124, 72, 111, 108, 111, 76, 101, 110, 115, 72, 97, 110, 100, 0, 0, 0, 0, 76, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 46, 70, 101, 97, 116, 117, 114, 101, 115, 46, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 115, 124, 77, 105, 99, 114, 111, 115, 111, 102, 116, 77, 111, 116, 105, 111, 110, 67, 111, 110, 116, 114, 111, 108, 108, 101, 114, 80, 114, 111, 102, 105, 108, 101, 0, 0, 0, 0, 97, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 46, 70, 101, 97, 116, 117, 114, 101, 115, 46, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 115, 46, 77, 105, 99, 114, 111, 115, 111, 102, 116, 77, 111, 116, 105, 111, 110, 67, 111, 110, 116, 114, 111, 108, 108, 101, 114, 80, 114, 111, 102, 105, 108, 101, 124, 87, 77, 82, 83, 112, 97, 116, 105, 97, 108, 67, 111, 110, 116, 114, 111, 108, 108, 101, 114, 0, 0, 0, 0, 72, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 46, 70, 101, 97, 116, 117, 114, 101, 115, 46, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 115, 124, 79, 99, 117, 108, 117, 115, 84, 111, 117, 99, 104, 67, 111, 110, 116, 114, 111, 108, 108, 101, 114, 80, 114, 111, 102, 105, 108, 101, 0, 0, 0, 0, 94, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 46, 70, 101, 97, 116, 117, 114, 101, 115, 46, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 115, 46, 79, 99, 117, 108, 117, 115, 84, 111, 117, 99, 104, 67, 111, 110, 116, 114, 111, 108, 108, 101, 114, 80, 114, 111, 102, 105, 108, 101, 124, 79, 99, 117, 108, 117, 115, 84, 111, 117, 99, 104, 67, 111, 110, 116, 114, 111, 108, 108, 101, 114, 0, 0, 0, 0, 63, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 46, 70, 101, 97, 116, 117, 114, 101, 115, 46, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 115, 124, 80, 97, 108, 109, 80, 111, 115, 101, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 0, 0, 0, 0, 72, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 46, 70, 101, 97, 116, 117, 114, 101, 115, 46, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 115, 46, 80, 97, 108, 109, 80, 111, 115, 101, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 124, 80, 97, 108, 109, 80, 111, 115, 101, 0, 0, 0, 0, 71, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 46, 70, 101, 97, 116, 117, 114, 101, 115, 46, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 115, 124, 86, 97, 108, 118, 101, 73, 110, 100, 101, 120, 67, 111, 110, 116, 114, 111, 108, 108, 101, 114, 80, 114, 111, 102, 105, 108, 101, 0, 0, 0, 0, 92, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 46, 70, 101, 97, 116, 117, 114, 101, 115, 46, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 115, 46, 86, 97, 108, 118, 101, 73, 110, 100, 101, 120, 67, 111, 110, 116, 114, 111, 108, 108, 101, 114, 80, 114, 111, 102, 105, 108, 101, 124, 86, 97, 108, 118, 101, 73, 110, 100, 101, 120, 67, 111, 110, 116, 114, 111, 108, 108, 101, 114, 1, 0, 0, 0, 44, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 46, 70, 101, 97, 116, 117, 114, 101, 115, 124, 79, 112, 101, 110, 88, 82, 70, 101, 97, 116, 117, 114, 101, 1, 0, 0, 0, 44, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 46, 70, 101, 97, 116, 117, 114, 101, 115, 124, 79, 112, 101, 110, 88, 82, 70, 101, 97, 116, 117, 114, 101, 1, 0, 0, 0, 36, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 124, 79, 112, 101, 110, 88, 82, 83, 101, 116, 116, 105, 110, 103, 115, 0, 0, 0, 0, 55, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 46, 70, 101, 97, 116, 117, 114, 101, 115, 124, 79, 112, 101, 110, 88, 82, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 70, 101, 97, 116, 117, 114, 101, 0, 0, 0, 0, 69, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 46, 70, 101, 97, 116, 117, 114, 101, 115, 46, 79, 112, 101, 110, 88, 82, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 70, 101, 97, 116, 117, 114, 101, 124, 65, 99, 116, 105, 111, 110, 66, 105, 110, 100, 105, 110, 103, 0, 0, 0, 0, 68, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 46, 70, 101, 97, 116, 117, 114, 101, 115, 46, 79, 112, 101, 110, 88, 82, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 70, 101, 97, 116, 117, 114, 101, 124, 65, 99, 116, 105, 111, 110, 67, 111, 110, 102, 105, 103, 0, 0, 0, 0, 68, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 46, 70, 101, 97, 116, 117, 114, 101, 115, 46, 79, 112, 101, 110, 88, 82, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 70, 101, 97, 116, 117, 114, 101, 124, 68, 101, 118, 105, 99, 101, 67, 111, 110, 102, 105, 103, 0, 0, 0, 0, 71, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 46, 70, 101, 97, 116, 117, 114, 101, 115, 46, 79, 112, 101, 110, 88, 82, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 70, 101, 97, 116, 117, 114, 101, 124, 65, 99, 116, 105, 111, 110, 77, 97, 112, 67, 111, 110, 102, 105, 103, 0, 0, 0, 0, 65, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 46, 70, 101, 97, 116, 117, 114, 101, 115, 46, 79, 112, 101, 110, 88, 82, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 70, 101, 97, 116, 117, 114, 101, 124, 85, 115, 101, 114, 80, 97, 116, 104, 115, 0, 0, 0, 0, 34, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 46, 73, 110, 112, 117, 116, 124, 72, 97, 112, 116, 105, 99, 0, 0, 0, 0, 41, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 46, 73, 110, 112, 117, 116, 124, 72, 97, 112, 116, 105, 99, 67, 111, 110, 116, 114, 111, 108, 0, 0, 0, 0, 40, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 46, 73, 110, 112, 117, 116, 124, 79, 112, 101, 110, 88, 82, 68, 101, 118, 105, 99, 101, 0, 0, 0, 0, 37, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 46, 73, 110, 112, 117, 116, 124, 79, 112, 101, 110, 88, 82, 72, 109, 100, 0, 0, 0, 0, 39, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 46, 73, 110, 112, 117, 116, 124, 79, 112, 101, 110, 88, 82, 73, 110, 112, 117, 116, 0, 0, 0, 0, 54, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 46, 73, 110, 112, 117, 116, 46, 79, 112, 101, 110, 88, 82, 73, 110, 112, 117, 116, 124, 83, 101, 114, 105, 97, 108, 105, 122, 101, 100, 71, 117, 105, 100, 0, 0, 0, 0, 57, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 46, 73, 110, 112, 117, 116, 46, 79, 112, 101, 110, 88, 82, 73, 110, 112, 117, 116, 124, 83, 101, 114, 105, 97, 108, 105, 122, 101, 100, 66, 105, 110, 100, 105, 110, 103, 0, 0, 0, 0, 66, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 46, 73, 110, 112, 117, 116, 46, 79, 112, 101, 110, 88, 82, 73, 110, 112, 117, 116, 124, 71, 101, 116, 73, 110, 116, 101, 114, 110, 97, 108, 68, 101, 118, 105, 99, 101, 73, 100, 67, 111, 109, 109, 97, 110, 100, 0, 0, 0, 0, 32, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 46, 73, 110, 112, 117, 116, 124, 80, 111, 115, 101, 0, 0, 0, 0, 39, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 46, 73, 110, 112, 117, 116, 124, 80, 111, 115, 101, 67, 111, 110, 116, 114, 111, 108, 0, 0, 0, 0, 37, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 124, 79, 112, 101, 110, 88, 82, 65, 110, 97, 108, 121, 116, 105, 99, 115, 0, 0, 0, 0, 53, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 46, 79, 112, 101, 110, 88, 82, 65, 110, 97, 108, 121, 116, 105, 99, 115, 124, 73, 110, 105, 116, 105, 97, 108, 105, 122, 101, 69, 118, 101, 110, 116, 1, 0, 0, 0, 36, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 124, 79, 112, 101, 110, 88, 82, 83, 101, 116, 116, 105, 110, 103, 115, 0, 0, 0, 0, 60, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 46, 79, 112, 101, 110, 88, 82, 83, 101, 116, 116, 105, 110, 103, 115, 124, 67, 111, 108, 111, 114, 83, 117, 98, 109, 105, 115, 115, 105, 111, 110, 77, 111, 100, 101, 76, 105, 115, 116, 0, 0, 0, 0, 31, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 124, 67, 111, 110, 115, 116, 97, 110, 116, 115, 0, 0, 0, 0, 38, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 124, 68, 105, 97, 103, 110, 111, 115, 116, 105, 99, 82, 101, 112, 111, 114, 116, 0, 0, 0, 0, 34, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 124, 79, 112, 101, 110, 88, 82, 76, 111, 97, 100, 101, 114, 1, 0, 0, 0, 38, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 124, 79, 112, 101, 110, 88, 82, 76, 111, 97, 100, 101, 114, 66, 97, 115, 101, 0, 0, 0, 0, 57, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 46, 79, 112, 101, 110, 88, 82, 76, 111, 97, 100, 101, 114, 66, 97, 115, 101, 124, 70, 101, 97, 116, 117, 114, 101, 76, 111, 103, 103, 105, 110, 103, 73, 110, 102, 111, 1, 0, 0, 0, 38, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 124, 79, 112, 101, 110, 88, 82, 76, 111, 97, 100, 101, 114, 66, 97, 115, 101, 0, 0, 0, 0, 43, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 124, 79, 112, 101, 110, 88, 82, 76, 111, 97, 100, 101, 114, 78, 111, 80, 114, 101, 73, 110, 105, 116, 0, 0, 0, 0, 52, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 46, 78, 97, 116, 105, 118, 101, 84, 121, 112, 101, 115, 124, 88, 114, 82, 101, 115, 117, 108, 116, 69, 120, 116, 101, 110, 115, 105, 111, 110, 115, 0, 0, 0, 0, 51, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 46, 78, 97, 116, 105, 118, 101, 84, 121, 112, 101, 115, 124, 88, 114, 66, 97, 115, 101, 73, 110, 83, 116, 114, 117, 99, 116, 117, 114, 101, 0, 0, 0, 0, 44, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 46, 78, 97, 116, 105, 118, 101, 84, 121, 112, 101, 115, 124, 88, 114, 86, 101, 99, 116, 111, 114, 50, 102, 0, 0, 0, 0, 44, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 46, 78, 97, 116, 105, 118, 101, 84, 121, 112, 101, 115, 124, 88, 114, 86, 101, 99, 116, 111, 114, 51, 102, 0, 0, 0, 0, 47, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 46, 78, 97, 116, 105, 118, 101, 84, 121, 112, 101, 115, 124, 88, 114, 81, 117, 97, 116, 101, 114, 110, 105, 111, 110, 102, 0, 0, 0, 0, 41, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 46, 78, 97, 116, 105, 118, 101, 84, 121, 112, 101, 115, 124, 88, 114, 80, 111, 115, 101, 102, 0, 0, 0, 0, 55, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 46, 78, 97, 116, 105, 118, 101, 84, 121, 112, 101, 115, 124, 88, 114, 83, 119, 97, 112, 99, 104, 97, 105, 110, 67, 114, 101, 97, 116, 101, 73, 110, 102, 111, 1, 0, 0, 0, 36, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 124, 79, 112, 101, 110, 88, 82, 83, 101, 116, 116, 105, 110, 103, 115, 0, 0, 0, 0, 37, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 124, 79, 112, 101, 110, 88, 82, 82, 101, 115, 116, 97, 114, 116, 101, 114, 0, 0, 0, 0, 35, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 124, 79, 112, 101, 110, 88, 82, 82, 117, 110, 116, 105, 109, 101, 1, 0, 0, 0, 36, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 124, 79, 112, 101, 110, 88, 82, 83, 101, 116, 116, 105, 110, 103, 115, 1, 0, 0, 0, 36, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 124, 79, 112, 101, 110, 88, 82, 83, 101, 116, 116, 105, 110, 103, 115, 0, 0, 0, 0, 44, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 46, 65, 80, 73, 124, 85, 110, 105, 116, 121, 88, 82, 84, 101, 120, 116, 117, 114, 101, 68, 97, 116, 97, 0, 0, 0, 0, 50, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 46, 65, 80, 73, 124, 85, 110, 105, 116, 121, 88, 82, 82, 101, 110, 100, 101, 114, 84, 101, 120, 116, 117, 114, 101, 68, 101, 115, 99, 0, 0, 0, 0, 40, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 46, 65, 80, 73, 124, 85, 110, 105, 116, 121, 88, 82, 68, 105, 115, 112, 108, 97, 121, 0, 0, 0, 0, 35, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 124, 79, 112, 101, 110, 88, 82, 85, 116, 105, 108, 105, 116, 121, 0, 0, 0, 0, 42, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 124, 87, 97, 105, 116, 70, 111, 114, 82, 101, 115, 116, 97, 114, 116, 70, 105, 110, 105, 115, 104 }, TotalFiles = 42, TotalTypes = 80, IsEditorOnly = false }; } } namespace UnityEngine.XR.OpenXR { [Serializable] public class OpenXRSettings : ScriptableObject { public enum ColorSubmissionModeGroup { [InspectorName("8 bits per channel (LDR, default)")] kRenderTextureFormatGroup8888, [InspectorName("10 bits floating-point per color channel, 2 bit alpha (HDR)")] kRenderTextureFormatGroup1010102_Float, [InspectorName("16 bits floating-point per channel (HDR)")] kRenderTextureFormatGroup16161616_Float, [InspectorName("5,6,5 bit packed (LDR, mobile)")] kRenderTextureFormatGroup565, [InspectorName("11,11,10 bit packed floating-point (HDR)")] kRenderTextureFormatGroup111110_Float } [Serializable] public class ColorSubmissionModeList { public ColorSubmissionModeGroup[] m_List = new ColorSubmissionModeGroup[1]; } public enum RenderMode { MultiPass, SinglePassInstanced } public enum DepthSubmissionMode { None, Depth16Bit, Depth24Bit } public enum BackendFovationApi : byte { Legacy, SRPFoveation } public enum SpaceWarpMotionVectorTextureFormat { RGBA16f, RG16f } [FormerlySerializedAs("extensions")] [HideInInspector] [SerializeField] internal OpenXRFeature[] features = new OpenXRFeature[0]; public static readonly ColorSubmissionModeGroup kDefaultColorMode; [SerializeField] private RenderMode m_renderMode = RenderMode.SinglePassInstanced; [SerializeField] private bool m_autoColorSubmissionMode = true; [SerializeField] private ColorSubmissionModeList m_colorSubmissionModes = new ColorSubmissionModeList(); [SerializeField] private DepthSubmissionMode m_depthSubmissionMode; [SerializeField] private SpaceWarpMotionVectorTextureFormat m_spacewarpMotionVectorTextureFormat; [SerializeField] private bool m_optimizeBufferDiscards; [SerializeField] private bool m_symmetricProjection; private const string LibraryName = "UnityOpenXR"; private static OpenXRSettings s_RuntimeInstance; public int featureCount => features.Length; public RenderMode renderMode { get { if ((Object)(object)OpenXRLoaderBase.Instance != (Object)null) { return Internal_GetRenderMode(); } return m_renderMode; } set { if ((Object)(object)OpenXRLoaderBase.Instance != (Object)null) { Internal_SetRenderMode(value); } else { m_renderMode = value; } } } public bool autoColorSubmissionMode { get { return m_autoColorSubmissionMode; } set { m_autoColorSubmissionMode = value; } } public ColorSubmissionModeGroup[] colorSubmissionModes { get { if (m_autoColorSubmissionMode) { return new ColorSubmissionModeGroup[1] { kDefaultColorMode }; } if ((Object)(object)OpenXRLoaderBase.Instance != (Object)null) { int num = Internal_GetColorSubmissionModes(null, 0); int[] array = new int[num]; Internal_GetColorSubmissionModes(array, num); return array.Select((int i) => (ColorSubmissionModeGroup)i).ToArray(); } return m_colorSubmissionModes.m_List; } set { if ((Object)(object)OpenXRLoaderBase.Instance != (Object)null) { Internal_SetColorSubmissionModes(value.Select((ColorSubmissionModeGroup e) => (int)e).ToArray(), value.Length); } else { m_colorSubmissionModes.m_List = value; } } } public DepthSubmissionMode depthSubmissionMode { get { if ((Object)(object)OpenXRLoaderBase.Instance != (Object)null) { return Internal_GetDepthSubmissionMode(); } return m_depthSubmissionMode; } set { if ((Object)(object)OpenXRLoaderBase.Instance != (Object)null) { Internal_SetDepthSubmissionMode(value); } else { m_depthSubmissionMode = value; } } } public SpaceWarpMotionVectorTextureFormat spacewarpMotionVectorTextureFormat { get { if ((Object)(object)OpenXRLoaderBase.Instance != (Object)null) { return Internal_GetSpaceWarpMotionVectorTextureFormat(); } return m_spacewarpMotionVectorTextureFormat; } set { if ((Object)(object)OpenXRLoaderBase.Instance != (Object)null) { Internal_SetSpaceWarpMotionVectorTextureFormat(value); } else { m_spacewarpMotionVectorTextureFormat = value; } } } public bool optimizeBufferDiscards { get { return m_optimizeBufferDiscards; } set { if ((Object)(object)OpenXRLoaderBase.Instance != (Object)null) { Internal_SetOptimizeBufferDiscards(value); } else { m_optimizeBufferDiscards = value; } } } public bool symmetricProjection { get { return m_symmetricProjection; } set { if ((Object)(object)OpenXRLoaderBase.Instance != (Object)null) { Internal_SetSymmetricProjection(value); } else { m_symmetricProjection = value; } } } public BackendFovationApi foveatedRenderingApi => BackendFovationApi.Legacy; public static OpenXRSettings ActiveBuildTargetInstance => GetInstance(useActiveBuildTarget: true); public static OpenXRSettings Instance => GetInstance(useActiveBuildTarget: false); public static bool AllowRecentering => Internal_GetAllowRecentering(); public static float FloorOffset => Internal_GetFloorOffset(); public TFeature GetFeature<TFeature>() where TFeature : OpenXRFeature { return (TFeature)GetFeature(typeof(TFeature)); } public OpenXRFeature GetFeature(Type featureType) { OpenXRFeature[] array = features; foreach (OpenXRFeature openXRFeature in array) { if (featureType.IsInstanceOfType(openXRFeature)) { return openXRFeature; } } return null; } public OpenXRFeature[] GetFeatures<TFeature>() { return GetFeatures(typeof(TFeature)); } public OpenXRFeature[] GetFeatures(Type featureType) { List<OpenXRFeature> list = new List<OpenXRFeature>(); OpenXRFeature[] array = features; foreach (OpenXRFeature openXRFeature in array) { if (featureType.IsInstanceOfType(openXRFeature)) { list.Add(openXRFeature); } } return list.ToArray(); } public int GetFeatures<TFeature>(List<TFeature> featuresOut) where TFeature : OpenXRFeature { featuresOut.Clear(); OpenXRFeature[] array = features; for (int i = 0; i < array.Length; i++) { if (array[i] is TFeature item) { featuresOut.Add(item); } } return featuresOut.Count; } public int GetFeatures(Type featureType, List<OpenXRFeature> featuresOut) { featuresOut.Clear(); OpenXRFeature[] array = features; foreach (OpenXRFeature openXRFeature in array) { if (featureType.IsInstanceOfType(openXRFeature)) { featuresOut.Add(openXRFeature); } } return featuresOut.Count; } public OpenXRFeature[] GetFeatures() { return ((OpenXRFeature[])features?.Clone()) ?? new OpenXRFeature[0]; } public int GetFeatures(List<OpenXRFeature> featuresOut) { featuresOut.Clear(); featuresOut.AddRange(features); return featuresOut.Count; } private static void PermissionGrantedCallback(string permissionName) { } private void ApplyRenderSettings() { Internal_SetSymmetricProjection(m_symmetricProjection); Internal_SetRenderMode(m_renderMode); Internal_SetColorSubmissionModes(m_colorSubmissionModes.m_List.Select((ColorSubmissionModeGroup e) => (int)e).ToArray(), m_colorSubmissionModes.m_List.Length); Internal_SetDepthSubmissionMode(m_depthSubmissionMode); Internal_SetSpaceWarpMotionVectorTextureFormat(m_spacewarpMotionVectorTextureFormat); Internal_SetOptimizeBufferDiscards(m_optimizeBufferDiscards); } [DllImport("UnityOpenXR", EntryPoint = "NativeConfig_SetRenderMode")] private static extern void Internal_SetRenderMode(RenderMode renderMode); [DllImport("UnityOpenXR", EntryPoint = "NativeConfig_GetRenderMode")] private static extern RenderMode Internal_GetRenderMode(); [DllImport("UnityOpenXR", EntryPoint = "NativeConfig_SetDepthSubmissionMode")] private static extern void Internal_SetDepthSubmissionMode(DepthSubmissionMode depthSubmissionMode); [DllImport("UnityOpenXR", EntryPoint = "NativeConfig_GetDepthSubmissionMode")] private static extern DepthSubmissionMode Internal_GetDepthSubmissionMode(); [DllImport("UnityOpenXR", EntryPoint = "NativeConfig_SetSpaceWarpMotionVectorTextureFormat")] private static extern void Internal_SetSpaceWarpMotionVectorTextureFormat(SpaceWarpMotionVectorTextureFormat spaceWarpMotionVectorTextureFormat); [DllImport("UnityOpenXR", EntryPoint = "NativeConfig_GetSpaceWarpMotionVectorTextureFormat")] private static extern SpaceWarpMotionVectorTextureFormat Internal_GetSpaceWarpMotionVectorTextureFormat(); [DllImport("UnityOpenXR", EntryPoint = "NativeConfig_SetSymmetricProjection")] private static extern void Internal_SetSymmetricProjection([MarshalAs(UnmanagedType.I1)] bool enabled); [DllImport("UnityOpenXR", EntryPoint = "NativeConfig_SetOptimizeMultiviewRenderRegions")] private static extern void Internal_SetOptimizeMultiviewRenderRegions([MarshalAs(UnmanagedType.I1)] bool enabled); [DllImport("UnityOpenXR", EntryPoint = "NativeConfig_SetOptimizeBufferDiscards")] private static extern void Internal_SetOptimizeBufferDiscards([MarshalAs(UnmanagedType.I1)] bool enabled); [DllImport("UnityOpenXR", EntryPoint = "OculusFoveation_SetUsedApi")] private static extern void Internal_SetUsedFoveatedRenderingApi(BackendFovationApi api); [DllImport("UnityOpenXR", EntryPoint = "OculusFoveation_GetUsedApi")] internal static extern BackendFovationApi Internal_GetUsedFoveatedRenderingApi(); [DllImport("UnityOpenXR", EntryPoint = "OculusFoveation_HasRequestedEyeTrackingPermissions")] [return: MarshalAs(UnmanagedType.U1)] internal static extern bool Internal_HasRequestedEyeTrackingPermissions(); [DllImport("UnityOpenXR", EntryPoint = "OculusFoveation_GetHasEyeTrackingPermissions")] [return: MarshalAs(UnmanagedType.U1)] internal static extern bool Internal_GetHasEyeTrackingPermissions(); [DllImport("UnityOpenXR", EntryPoint = "OculusFoveation_SetHasEyeTrackingPermissions")] internal static extern void Internal_SetHasEyeTrackingPermissions([MarshalAs(UnmanagedType.I1)] bool value); [DllImport("UnityOpenXR", EntryPoint = "NativeConfig_SetColorSubmissionMode")] private static extern void Internal_SetColorSubmissionMode(ColorSubmissionModeGroup[] colorSubmissionMode); [DllImport("UnityOpenXR", EntryPoint = "NativeConfig_SetColorSubmissionModes")] private static extern void Internal_SetColorSubmissionModes(int[] colorSubmissionMode, int arraySize); [DllImport("UnityOpenXR", EntryPoint = "NativeConfig_GetColorSubmissionModes")] private static extern int Internal_GetColorSubmissionModes([Out] int[] colorSubmissionMode, int arraySize); [DllImport("UnityOpenXR", EntryPoint = "NativeConfig_GetIsUsingLegacyXRDisplay")] [return: MarshalAs(UnmanagedType.U1)] private static extern bool Internal_GetIsUsingLegacyXRDisplay(); private void Awake() { s_RuntimeInstance = this; } internal void ApplySettings() { ApplyRenderSettings(); } private static OpenXRSettings GetInstance(bool useActiveBuildTarget) { OpenXRSettings openXRSettings = null; openXRSettings = s_RuntimeInstance; if ((Object)(object)openXRSettings == (Object)null) { openXRSettings = ScriptableObject.CreateInstance<OpenXRSettings>(); } return openXRSettings; } public static void SetAllowRecentering(bool allowRecentering, float floorOffset = 1.5f) { Internal_SetAllowRecentering(allowRecentering, floorOffset); } public static void RefreshRecenterSpace() { Internal_RegenerateTrackingOrigin(); } [DllImport("UnityOpenXR", EntryPoint = "NativeConfig_SetAllowRecentering")] private static extern void Internal_SetAllowRecentering([MarshalAs(UnmanagedType.U1)] bool active, float height); [DllImport("UnityOpenXR", EntryPoint = "NativeConfig_RegenerateTrackingOrigin")] private static extern void Internal_RegenerateTrackingOrigin(); [DllImport("UnityOpenXR", EntryPoint = "NativeConfig_GetAllowRecentering")] [return: MarshalAs(UnmanagedType.U1)] private static extern bool Internal_GetAllowRecentering(); [DllImport("UnityOpenXR", EntryPoint = "NativeConfig_GetFloorOffsetHeight")] private static extern float Internal_GetFloorOffset(); } internal static class OpenXRAnalytics { [Serializable] private struct InitializeEvent { public bool success; public string runtime; public string runtime_version; public string plugin_version; public string api_version; public string[] available_extensions; public string[] enabled_extensions; public string[] enabled_features; public string[] failed_features; } private const int kMaxEventsPerHour = 1000; private const int kMaxNumberOfElements = 1000; private const string kVendorKey = "unity.openxr"; private const string kEventInitialize = "openxr_initialize"; private static bool s_Initialized; private static bool Initialize() { //IL_0022: Unknown result type (might be due to invalid IL or missing references) if (s_Initialized) { return true; } if ((int)Analytics.RegisterEvent("openxr_initialize", 1000, 1000, "unity.openxr", "") != 0) { return false; } s_Initialized = true; return true; } public static void SendInitializeEvent(bool success) { if (s_Initialized || Initialize()) { SendPlayerAnalytics(CreateInitializeEvent(success)); } } private static InitializeEvent CreateInitializeEvent(bool success) { return new InitializeEvent { success = success, runtime = OpenXRRuntime.name, runtime_version = OpenXRRuntime.version, plugin_version = OpenXRRuntime.pluginVersion, api_version = OpenXRRuntime.apiVersion, enabled_extensions = (from ext in OpenXRRuntime.GetEnabledExtensions() select $"{ext}_{OpenXRRuntime.GetExtensionVersion(ext)}").ToArray(), available_extensions = (from ext in OpenXRRuntime.GetAvailableExtensions() select $"{ext}_{OpenXRRuntime.GetExtensionVersion(ext)}").ToArray(), enabled_features = (from f in OpenXRSettings.Instance.features where (Object)(object)f != (Object)null && f.enabled select ((object)f).GetType().FullName + "_" + f.version).ToArray(), failed_features = (from f in OpenXRSettings.Instance.features where (Object)(object)f != (Object)null && f.failedInitialization select ((object)f).GetType().FullName + "_" + f.version).ToArray() }; } private static void SendPlayerAnalytics(InitializeEvent data) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) Analytics.SendEvent("openxr_initialize", (object)data, 1, ""); } } public static class Constants { public const string k_SettingsKey = "com.unity.xr.openxr.settings4"; } internal class DiagnosticReport { private const string LibraryName = "UnityOpenXR"; public static readonly ulong k_NullSection; [DllImport("UnityOpenXR", EntryPoint = "DiagnosticReport_StartReport")] public static extern void StartReport(); [DllImport("UnityOpenXR", CharSet = CharSet.Ansi, EntryPoint = "DiagnosticReport_GetSection")] public static extern ulong GetSection(string sectionName); [DllImport("UnityOpenXR", CharSet = CharSet.Ansi, EntryPoint = "DiagnosticReport_AddSectionEntry")] public static extern void AddSectionEntry(ulong sectionHandle, string sectionEntry, string sectionBody); [DllImport("UnityOpenXR", CharSet = CharSet.Ansi, EntryPoint = "DiagnosticReport_AddSectionBreak")] public static extern void AddSectionBreak(ulong sectionHandle); [DllImport("UnityOpenXR", CharSet = CharSet.Ansi, EntryPoint = "DiagnosticReport_AddEventEntry")] public static extern void AddEventEntry(string eventName, string eventData); [DllImport("UnityOpenXR", EntryPoint = "DiagnosticReport_DumpReport")] private static extern void Internal_DumpReport(); [DllImport("UnityOpenXR", EntryPoint = "DiagnosticReport_DumpReportWithReason")] private static extern void Internal_DumpReport(string reason); [DllImport("UnityOpenXR", EntryPoint = "DiagnosticReport_GenerateReport")] private static extern IntPtr Internal_GenerateReport(); [DllImport("UnityOpenXR", EntryPoint = "DiagnosticReport_ReleaseReport")] private static extern void Internal_ReleaseReport(IntPtr report); internal static string GenerateReport() { string result = ""; IntPtr intPtr = Internal_GenerateReport(); if (intPtr != IntPtr.Zero) { result = Marshal.PtrToStringAnsi(intPtr); Internal_ReleaseReport(intPtr); intPtr = IntPtr.Zero; } return result; } public static void DumpReport(string reason) { Internal_DumpReport(reason); } } public class OpenXRLoader : OpenXRLoaderBase { } public class OpenXRLoaderBase : XRLoaderHelper { private class FeatureLoggingInfo { public string m_nameUi; public string m_version; public string m_company; public string m_openxrExtensionStrings; public FeatureLoggingInfo(string nameUi, string version, string company, string extensionStrings) { m_nameUi = nameUi; m_version = version; m_company = company; m_openxrExtensionStrings = extensionStrings; } } internal enum LoaderState { Uninitialized, InitializeAttempted, Initialized, StartAttempted, Started, StopAttempted, Stopped, DeinitializeAttempted } internal delegate void ReceiveNativeEventDelegate(OpenXRFeature.NativeEvent e, ulong payload); private List<FeatureLoggingInfo> featureLoggingInfo; private const double k_IdlePollingWaitTimeInSeconds = 0.1; private static List<XRDisplaySubsystemDescriptor> s_DisplaySubsystemDescriptors = new List<XRDisplaySubsystemDescriptor>(); private static List<XRInputSubsystemDescriptor> s_InputSubsystemDescriptors = new List<XRInputSubsystemDescriptor>(); private List<LoaderState> validLoaderInitStates = new List<LoaderState> { LoaderState.Uninitialized, LoaderState.InitializeAttempted }; private List<LoaderState> validLoaderStartStates = new List<LoaderState> { LoaderState.Initialized, LoaderState.StartAttempted, LoaderState.Stopped }; private List<LoaderState> validLoaderStopStates = new List<LoaderState> { LoaderState.StartAttempted, LoaderState.Started, LoaderState.StopAttempted }; private List<LoaderState> validLoaderDeinitStates = new List<LoaderState> { LoaderState.InitializeAttempted, LoaderState.Initialized, LoaderState.Stopped, LoaderState.DeinitializeAttempted }; private List<LoaderState> runningStates = new List<LoaderState> { LoaderState.Initialized, LoaderState.StartAttempted, LoaderState.Started }; private OpenXRFeature.NativeEvent currentOpenXRState; private bool actionSetsAttached; private UnhandledExceptionEventHandler unhandledExceptionHandler; internal bool DisableValidationChecksOnEnteringPlaymode; private double lastPollCheckTime; private const string LibraryName = "UnityOpenXR"; internal static OpenXRLoaderBase Instance { get; private set; } internal LoaderState currentLoaderState { get; private set; } internal XRDisplaySubsystem displaySubsystem => ((XRLoaderHelper)this).GetLoadedSubsystem<XRDisplaySubsystem>(); internal XRInputSubsystem inputSubsystem { get { OpenXRLoaderBase instance = Instance; if (instance == null) { return null; } return ((XRLoaderHelper)instance).GetLoadedSubsystem<XRInputSubsystem>(); } } private bool isInitialized { get { if (currentLoaderState != LoaderState.Uninitialized) { return currentLoaderState != LoaderState.DeinitializeAttempted; } return false; } } private bool isStarted => runningStates.Contains(currentLoaderState); private static void ExceptionHandler(object sender, UnhandledExceptionEventArgs args) { ulong section = DiagnosticReport.GetSection("Unhandled Exception Report"); DiagnosticReport.AddSectionEntry(section, "Is Terminating", $"{args.IsTerminating}"); Exception ex = (Exception)args.ExceptionObject; DiagnosticReport.AddSectionEntry(section, "Message", ex.Message ?? ""); DiagnosticReport.AddSectionEntry(section, "Source", ex.Source ?? ""); DiagnosticReport.AddSectionEntry(section, "Stack Trace", "\n" + ex.StackTrace); DiagnosticReport.DumpReport("Uncaught Exception"); } public override bool Initialize() { if (currentLoaderState == LoaderState.Initialized) { return true; } if (!validLoaderInitStates.Contains(currentLoaderState)) { return false; } if ((Object)(object)Instance != (Object)null) { Debug.LogError((object)"Only one OpenXRLoader can be initialized at any given time"); return false; } DiagnosticReport.StartReport(); try { if (InitializeInternal()) { return true; } } catch (Exception ex) { Debug.LogException(ex); } ((XRLoader)this).Deinitialize(); Instance = null; OpenXRAnalytics.SendInitializeEvent(success: false); return false; } private bool InitializeInternal() { //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Expected O, but got Unknown Instance = this; currentLoaderState = LoaderState.InitializeAttempted; Internal_SetSuccessfullyInitialized(value: false); OpenXRInput.RegisterLayouts(); OpenXRFeature.Initialize(); if (!LoadOpenXRSymbols()) { Debug.LogError((object)"Failed to load openxr runtime loader."); return false; } OpenXRSettings.Instance.features = (from f in OpenXRSettings.Instance.features where (Object)(object)f != (Object)null orderby f.priority descending, f.nameUi select f).ToArray(); OpenXRFeature.HookGetInstanceProcAddr(); if (!Internal_InitializeSession()) { return false; } RequestOpenXRFeatures(); RegisterOpenXRCallbacks(); if ((Object)null != (Object)(object)OpenXRSettings.Instance) { OpenXRSettings.Instance.ApplySettings(); } if (!CreateSubsystems()) { return false; } if (OpenXRFeature.requiredFeatureFailed) { return false; } SetApplicationInfo(); OpenXRAnalytics.SendInitializeEvent(success: true); OpenXRFeature.ReceiveLoaderEvent(this, OpenXRFeature.LoaderEvent.SubsystemCreate); DebugLogEnabledSpecExtensions(); Application.onBeforeRender += new UnityAction(ProcessOpenXRMessageLoop); currentLoaderState = LoaderState.Initialized; return true; } private bool CreateSubsystems() { if (displaySubsystem == null) { this.CreateSubsystem<XRDisplaySubsystemDescriptor, XRDisplaySubsystem>(s_DisplaySubsystemDescriptors, "OpenXR Display"); if (displaySubsystem == null) { return false; } } if (inputSubsystem == null) { this.CreateSubsystem<XRInputSubsystemDescriptor, XRInputSubsystem>(s_InputSubsystemDescriptors, "OpenXR Input"); if (inputSubsystem == null) { return false; } } return true; } internal void ProcessOpenXRMessageLoop() { if (currentOpenXRState == OpenXRFeature.NativeEvent.XrIdle || currentOpenXRState == OpenXRFeature.NativeEvent.XrStopping || currentOpenXRState == OpenXRFeature.NativeEvent.XrExiting || currentOpenXRState == OpenXRFeature.NativeEvent.XrLossPending || currentOpenXRState == OpenXRFeature.NativeEvent.XrInstanceLossPending) { float realtimeSinceStartup = Time.realtimeSinceStartup; if ((double)realtimeSinceStartup - lastPollCheckTime < 0.1) { return; } lastPollCheckTime = realtimeSinceStartup; } Internal_PumpMessageLoop(); } public override bool Start() { if (currentLoaderState == LoaderState.Started) { return true; } if (!validLoaderStartStates.Contains(currentLoaderState)) { return false; } currentLoaderState = LoaderState.StartAttempted; if (!StartInternal()) { ((XRLoader)this).Stop(); return false; } currentLoaderState = LoaderState.Started; return true; } private bool StartInternal() { if (!Internal_CreateSessionIfNeeded()) { return false; } if (currentOpenXRState != OpenXRFeature.NativeEvent.XrReady || (currentLoaderState != LoaderState.StartAttempted && currentLoaderState != LoaderState.Started)) { return true; } this.StartSubsystem<XRDisplaySubsystem>(); XRDisplaySubsystem obj = displaySubsystem; if (obj != null && !((IntegratedSubsystem)obj).running) { return false; } Internal_BeginSession(); if (!actionSetsAttached) { OpenXRInput.AttachActionSets(); actionSetsAttached = true; } XRDisplaySubsystem obj2 = displaySubsystem; if (obj2 != null && !((IntegratedSubsystem)obj2).running) { this.StartSubsystem<XRDisplaySubsystem>(); } XRInputSubsystem obj3 = inputSubsystem; if (obj3 != null && !((IntegratedSubsystem)obj3).running) { this.StartSubsystem<XRInputSubsystem>(); } XRInputSubsystem obj4 = inputSubsystem; bool num = obj4 != null && ((IntegratedSubsystem)obj4).running; XRDisplaySubsystem obj5 = displaySubsystem; bool flag = obj5 != null && ((IntegratedSubsystem)obj5).running; if (num && flag) { OpenXRFeature.ReceiveLoaderEvent(this, OpenXRFeature.LoaderEvent.SubsystemStart); return true; } return false; } public override bool Stop() { if (currentLoaderState == LoaderState.Stopped) { return true; } if (!validLoaderStopStates.Contains(currentLoaderState)) { return false; } currentLoaderState = LoaderState.StopAttempted; XRInputSubsystem obj = inputSubsystem; bool num = obj != null && ((IntegratedSubsystem)obj).running; XRDisplaySubsystem obj2 = displaySubsystem; bool flag = obj2 != null && ((IntegratedSubsystem)obj2).running; if (num || flag) { OpenXRFeature.ReceiveLoaderEvent(this, OpenXRFeature.LoaderEvent.SubsystemStop); } if (num) { this.StopSubsystem<XRInputSubsystem>(); } if (flag) { this.StopSubsystem<XRDisplaySubsystem>(); } StopInternal(); currentLoaderState = LoaderState.Stopped; return true; } private void StopInternal() { Internal_EndSession(); ProcessOpenXRMessageLoop(); } public override bool Deinitialize() { //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Expected O, but got Unknown if (currentLoaderState == LoaderState.Uninitialized) { return true; } if (!validLoaderDeinitStates.Contains(currentLoaderState)) { return false; } currentLoaderState = LoaderState.DeinitializeAttempted; try { Internal_RequestExitSession(); Application.onBeforeRender -= new UnityAction(ProcessOpenXRMessageLoop); ProcessOpenXRMessageLoop(); OpenXRFeature.ReceiveLoaderEvent(this, OpenXRFeature.LoaderEvent.SubsystemDestroy); this.DestroySubsystem<XRInputSubsystem>(); this.DestroySubsystem<XRDisplaySubsystem>(); DiagnosticReport.DumpReport("System Shutdown"); Internal_DestroySession(); ProcessOpenXRMessageLoop(); Internal_UnloadOpenXRLibrary(); currentLoaderState = LoaderState.Uninitialized; actionSetsAttached = false; if (unhandledExceptionHandler != null) { AppDomain.CurrentDomain.UnhandledException -= unhandledExceptionHandler; unhandledExceptionHandler = null; } return ((XRLoaderHelper)this).Deinitialize(); } finally { Instance = null; } } internal void CreateSubsystem<TDescriptor, TSubsystem>(List<TDescriptor> descriptors, string id) where TDescriptor : ISubsystemDescriptor where TSubsystem : ISubsystem { ((XRLoaderHelper)this).CreateSubsystem<TDescriptor, TSubsystem>(descriptors, id); } internal void StartSubsystem<T>() where T : class, ISubsystem { ((XRLoaderHelper)this).StartSubsystem<T>(); } internal void StopSubsystem<T>() where T : class, ISubsystem { ((XRLoaderHelper)this).StopSubsystem<T>(); } internal void DestroySubsystem<T>() where T : class, ISubsystem { ((XRLoaderHelper)this).DestroySubsystem<T>(); } private void SetApplicationInfo() { byte[] array = MD5.Create().ComputeHash(Encoding.UTF8.GetBytes(Application.version)); if (BitConverter.IsLittleEndian) { Array.Reverse(array); } uint applicationVersionHash = BitConverter.ToUInt32(array, 0); Internal_SetApplicationInfo(Application.productName, Application.version, applicationVersionHash, Application.unityVersion); } internal static byte[] StringToWCHAR_T(string s) { return ((Environment.OSVersion.Platform == PlatformID.Unix) ? Encoding.UTF32 : Encoding.Unicode).GetBytes(s + "\0"); } private bool LoadOpenXRSymbols() { if (!Internal_LoadOpenXRLibrary(StringToWCHAR_T("openxr_loader"))) { return false; } return true; } private void RequestOpenXRFeatures() { OpenXRSettings instance = OpenXRSettings.Instance; if ((Object)(object)instance == (Object)null || instance.features == null) { return; } featureLoggingInfo = new List<FeatureLoggingInfo>(instance.featureCount); OpenXRFeature[] features = instance.features; foreach (OpenXRFeature openXRFeature in features) { if ((Object)(object)openXRFeature == (Object)null || !openXRFeature.enabled) { continue; } featureLoggingInfo.Add(new FeatureLoggingInfo(openXRFeature.nameUi, openXRFeature.version, openXRFeature.company, openXRFeature.openxrExtensionStrings)); if (string.IsNullOrEmpty(openXRFeature.openxrExtensionStrings)) { continue; } string[] array = openXRFeature.openxrExtensionStrings.Split(' '); foreach (string text in array) { if (!string.IsNullOrWhiteSpace(text)) { Internal_RequestEnableExtensionString(text); } } } } private void LogRequestedOpenXRFeatures() { OpenXRSettings instance = OpenXRSettings.Instance; if ((Object)(object)instance == (Object)null || instance.features == null) { return; } StringBuilder stringBuilder = new StringBuilder(""); StringBuilder stringBuilder2 = new StringBuilder(""); uint num = 0u; uint num2 = 0u; foreach (FeatureLoggingInfo item in featureLoggingInfo) { stringBuilder.Append(" " + item.m_nameUi + ": Version=" + item.m_version + ", Company=\"" + item.m_company + "\""); if (!string.IsNullOrEmpty(item.m_openxrExtensionStrings)) { stringBuilder.Append(", Extensions=\"" + item.m_openxrExtensionStrings + "\""); string[] array = item.m_openxrExtensionStrings.Split(' '); foreach (string text in array) { if (!string.IsNullOrWhiteSpace(text) && !Internal_IsExtensionEnabled(text)) { num2++; stringBuilder2.Append(" " + text + ": Feature=\"" + item.m_nameUi + "\": Version=" + item.m_version + ", Company=\"" + item.m_company + "\"\n"); } } } stringBuilder.Append("\n"); } ulong section = DiagnosticReport.GetSection("OpenXR Runtime Info"); DiagnosticReport.AddSectionBreak(section); DiagnosticReport.AddSectionEntry(section, "Features requested to be enabled", $"({num})\n{stringBuilder.ToString()}"); DiagnosticReport.AddSectionBreak(section); DiagnosticReport.AddSectionEntry(section, "Requested feature extensions not supported by runtime", $"({num2})\n{stringBuilder2.ToString()}"); } private static void DebugLogEnabledSpecExtensions() { ulong section = DiagnosticReport.GetSection("OpenXR Runtime Info"); DiagnosticReport.AddSectionBreak(section); string[] enabledExtensions = OpenXRRuntime.GetEnabledExtensions(); StringBuilder stringBuilder = new StringBuilder($"({enabledExtensions.Length})\n"); string[] array = enabledExtensions; foreach (string text in array) { stringBuilder.Append($" {text}: Version={OpenXRRuntime.GetExtensionVersion(text)}\n"); } DiagnosticReport.AddSectionEntry(section, "Runtime extensions enabled", stringBuilder.ToString()); } [MonoPInvokeCallback(typeof(ReceiveNativeEventDelegate))] private static void ReceiveNativeEvent(OpenXRFeature.NativeEvent e, ulong payload) { OpenXRLoaderBase instance = Instance; if ((Object)(object)instance != (Object)null) { instance.currentOpenXRState = e; } switch (e) { case OpenXRFeature.NativeEvent.XrRestartRequested: OpenXRRestarter.Instance.ShutdownAndRestart(); break; case OpenXRFeature.NativeEvent.XrReady: instance.StartInternal(); break; case OpenXRFeature.NativeEvent.XrBeginSession: instance.LogRequestedOpenXRFeatures(); break; case OpenXRFeature.NativeEvent.XrFocused: DiagnosticReport.DumpReport("System Startup Completed"); break; case OpenXRFeature.NativeEvent.XrRequestRestartLoop: Debug.Log((object)"XR Initialization failed, will try to restart xr periodically."); OpenXRRestarter.Instance.PauseAndShutdownAndRestart(); break; case OpenXRFeature.NativeEvent.XrRequestGetSystemLoop: OpenXRRestarter.Instance.PauseAndRetryInitialization(); break; case OpenXRFeature.NativeEvent.XrStopping: instance.StopInternal(); break; } OpenXRFeature.ReceiveNativeEvent(e, payload); if ((!((Object)(object)instance == (Object)null) && instance.isStarted) || e == OpenXRFeature.NativeEvent.XrInstanceChanged) { switch (e) { case OpenXRFeature.NativeEvent.XrExiting: OpenXRRestarter.Instance.Shutdown(); break; case OpenXRFeature.NativeEvent.XrLossPending: OpenXRRestarter.Instance.ShutdownAndRestart(); break; case OpenXRFeature.NativeEvent.XrInstanceLossPending: OpenXRRestarter.Instance.Shutdown(); break; } } } internal static void RegisterOpenXRCallbacks() { Internal_SetCallbacks(ReceiveNativeEvent); } [DllImport("UnityOpenXR", EntryPoint = "main_LoadOpenXRLibrary")] [return: MarshalAs(UnmanagedType.U1)] internal static extern bool Internal_LoadOpenXRLibrary(byte[] loaderPath); [DllImport("UnityOpenXR", EntryPoint = "main_UnloadOpenXRLibrary")] internal static extern void Internal_UnloadOpenXRLibrary(); [DllImport("UnityOpenXR", EntryPoint = "NativeConfig_SetCallbacks")] private static extern void Internal_SetCallbacks(ReceiveNativeEventDelegate callback); [DllImport("UnityOpenXR", CharSet = CharSet.Ansi, EntryPoint = "NativeConfig_SetApplicationInfo")] private static extern void Internal_SetApplicationInfo(string applicationName, string applicationVersion, uint applicationVersionHash, string engineVersion); [DllImport("UnityOpenXR", EntryPoint = "session_RequestExitSession")] internal static extern void Internal_RequestExitSession(); [DllImport("UnityOpenXR", EntryPoint = "session_InitializeSession")] [return: MarshalAs(UnmanagedType.U1)] internal static extern bool Internal_InitializeSession(); [DllImport("UnityOpenXR", EntryPoint = "session_CreateSessionIfNeeded")] [return: MarshalAs(UnmanagedType.U1)] internal static extern bool Internal_CreateSessionIfNeeded(); [DllImport("UnityOpenXR", EntryPoint = "session_BeginSession")] internal static extern void Internal_BeginSession(); [DllImport("UnityOpenXR", EntryPoint = "session_EndSession")] internal static extern void Internal_EndSession(); [DllImport("UnityOpenXR", EntryPoint = "session_DestroySession")] internal static extern void Internal_DestroySession(); [DllImport("UnityOpenXR", EntryPoint = "messagepump_PumpMessageLoop")] private static extern void Internal_PumpMessageLoop(); [DllImport("UnityOpenXR", EntryPoint = "session_SetSuccessfullyInitialized")] internal static extern void Internal_SetSuccessfullyInitialized([MarshalAs(UnmanagedType.I1)] bool value); [DllImport("UnityOpenXR", CharSet = CharSet.Ansi, EntryPoint = "unity_ext_RequestEnableExtensionString")] [return: MarshalAs(UnmanagedType.U1)] internal static extern bool Internal_RequestEnableExtensionString(string extensionString); [DllImport("UnityOpenXR", EntryPoint = "unity_ext_IsExtensionEnabled")] [return: MarshalAs(UnmanagedType.U1)] private static extern bool Internal_IsExtensionEnabled(string extensionName); } public class OpenXRLoaderNoPreInit : OpenXRLoaderBase { } internal class OpenXRRestarter : MonoBehaviour { internal Action onAfterRestart; internal Action onAfterShutdown; internal Action onQuit; internal Action onAfterCoroutine; internal Action onAfterSuccessfulRestart; private static OpenXRRestarter s_Instance; private Coroutine m_Coroutine; private static int m_pauseAndRestartCoroutineCount; private Object m_PauseAndRestartCoroutineCountLock = new Object(); private static int m_pauseAndRestartAttempts; public bool isRunning => m_Coroutine != null; public static float TimeBetweenRestartAttempts { get; set; } public static int PauseAndRestartAttempts => m_pauseAndRestartAttempts; internal static int PauseAndRestartCoroutineCount => m_pauseAndRestartCoroutineCount; public static OpenXRRestarter Instance { get { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Expected O, but got Unknown if ((Object)(object)s_Instance == (Object)null) { GameObject val = GameObject.Find("~oxrestarter"); if ((Object)(object)val == (Object)null) { val = new GameObject("~oxrestarter"); ((Object)val).hideFlags = (HideFlags)61; val.AddComponent<OpenXRRestarter>(); } s_Instance = val.GetComponent<OpenXRRestarter>(); } return s_Instance; } } internal static bool DisableApplicationQuit { get; set; } static OpenXRRestarter() { TimeBetweenRestartAttempts = 5f; DisableApplicationQuit = false; } public void ResetCallbacks() { onAfterRestart = null; onAfterSuccessfulRestart = null; onAfterShutdown = null; onAfterCoroutine = null; onQuit = null; m_pauseAndRestartAttempts = 0; } public void Shutdown() { if (!((Object)(object)OpenXRLoaderBase.Instance == (Object)null)) { if (m_Coroutine != null) { Debug.LogError((object)"Only one shutdown or restart can be executed at a time"); } else { m_Coroutine = ((MonoBehaviour)this).StartCoroutine(RestartCoroutine(shouldRestart: false, shouldShutdown: true)); } } } public void ShutdownAndRestart() { if (!((Object)(object)OpenXRLoaderBase.Instance == (Object)null)) { if (m_Coroutine != null) { Debug.LogError((object)"Only one shutdown or restart can be executed at a time"); } else { m_Coroutine = ((MonoBehaviour)this).StartCoroutine(RestartCoroutine(shouldRestart: true, shouldShutdown: true)); } } } public void PauseAndShutdownAndRestart() { if (!((Object)(object)OpenXRLoaderBase.Instance == (Object)null)) { ((MonoBehaviour)this).StartCoroutine(PauseAndShutdownAndRestartCoroutine(TimeBetweenRestartAttempts)); } } public void PauseAndRetryInitialization() { if (!((Object)(object)OpenXRLoaderBase.Instance == (Object)null)) { ((MonoBehaviour)this).StartCoroutine(PauseAndRetryInitializationCoroutine(TimeBetweenRestartAttempts)); } } private void IncrementPauseAndRestartCoroutineCount() { lock (m_PauseAndRestartCoroutineCountLock) { m_pauseAndRestartCoroutineCount++; } } private void DecrementPauseAndRestartCoroutineCount() { lock (m_PauseAndRestartCoroutineCountLock) { m_pauseAndRestartCoroutineCount--; } } private IEnumerator PauseAndShutdownAndRestartCoroutine(float pauseTimeInSeconds) { IncrementPauseAndRestartCoroutineCount(); try { yield return (object)new WaitForSeconds(pauseTimeInSeconds); yield return new WaitForRestartFinish(); m_pauseAndRestartAttempts++; m_Coroutine = ((MonoBehaviour)this).StartCoroutine(RestartCoroutine(shouldRestart: true, shouldShutdown: true)); } finally { onAfterCoroutine?.Invoke(); } DecrementPauseAndRestartCoroutineCount(); } private IEnumerator PauseAndRetryInitializationCoroutine(float pauseTimeInSeconds) { IncrementPauseAndRestartCoroutineCount(); try { yield return (object)new WaitForSeconds(pauseTimeInSeconds); yield return new WaitForRestartFinish(); if (!((Object)(object)XRGeneralSettings.Instance.Manager.activeLoader != (Object)null)) { m_pauseAndRestartAttempts++; m_Coroutine = ((MonoBehaviour)this).StartCoroutine(RestartCoroutine(shouldRestart: true, shouldShutdown: false)); } } finally { onAfterCoroutine?.Invoke(); } DecrementPauseAndRestartCoroutineCount(); } private IEnumerator RestartCoroutine(bool shouldRestart, bool shouldShutdown) { try { if (shouldShutdown) { Debug.Log((object)"Shutting down OpenXR."); yield return null; XRGeneralSettings.Instance.Manager.DeinitializeLoader(); yield return null; onAfterShutdown?.Invoke(); } if (shouldRestart && OpenXRRuntime.ShouldRestart()) { Debug.Log((object)"Initializing OpenXR."); yield return XRGeneralSettings.Instance.Manager.InitializeLoader(); XRGeneralSettings.Instance.Manager.StartSubsystems(); if ((Object)(object)XRGeneralSettings.Instance.Manager.activeLoader != (Object)null) { m_pauseAndRestartAttempts = 0; onAfterSuccessfulRestart?.Invoke(); } onAfterRestart?.Invoke(); } else if (OpenXRRuntime.ShouldQuit()) { onQuit?.Invoke(); if (!DisableApplicationQuit) { Application.Quit(); } } } finally { OpenXRRestarter openXRRestarter = this; openXRRestarter.m_Coroutine = null; openXRRestarter.onAfterCoroutine?.Invoke(); } } } public static class OpenXRRuntime { private const string LibraryName = "UnityOpenXR"; public static string name { get { if (!Internal_GetRuntimeName(out var runtimeNamePtr)) { return ""; } return Marshal.PtrToStringAnsi(runtimeNamePtr); } } public static string version { get { if (!Internal_GetRuntimeVersion(out var major, out var minor, out var patch)) { return ""; } return $"{major}.{minor}.{patch}"; } } public static string apiVersion { get { if (!Internal_GetAPIVersion(out var major, out var minor, out var patch)) { return ""; } return $"{major}.{minor}.{patch}"; } } public static string pluginVersion { get { if (!Internal_GetPluginVersion(out var pluginVersionPtr)) { return ""; } return Marshal.PtrToStringAnsi(pluginVersionPtr); } } public static bool retryInitializationOnFormFactorErrors { get { return Internal_GetSoftRestartLoopAtInitialization(); } set { Internal_SetSoftRestartLoopAtInitialization(value); } } public static event Func<bool> wantsToQuit; public static event Func<bool> wantsToRestart; internal static bool isRuntimeAPIVersionGreaterThan1_1() { if (Internal_GetAPIVersion(out var major, out var minor, out var _) && major >= 1 && minor >= 1) { return true; } return false; } public static bool IsExtensionEnabled(string extensionName) { return Internal_IsExtensionEnabled(extensionName); } public static uint GetExtensionVersion(string extensionName) { return Internal_GetExtensionVersion(extensionName); } public static string[] GetEnabledExtensions() { string[] array = new string[Internal_GetEnabledExtensionCount()]; for (int i = 0; i < array.Length; i++) { Internal_GetEnabledExtensionName((uint)i, out var extensionName); array[i] = extensionName ?? ""; } return array; } public static string[] GetAvailableExtensions() { string[] array = new string[Internal_GetAvailableExtensionCount()]; for (int i = 0; i < array.Length; i++) { Internal_GetAvailableExtensionName((uint)i, out var extensionName); array[i] = extensionName ?? ""; } return array; } private static bool InvokeEvent(Func<bool> func) { if (func == null) { return true; } Delegate[] invocationList = func.GetInvocationList(); for (int i = 0; i < invocationList.Length; i++) { Func<bool> func2 = (Func<bool>)invocationList[i]; try { if (!func2()) { return false; } } catch (Exception ex) { Debug.LogException(ex); } } return true; } internal static bool ShouldQuit() { return InvokeEvent(OpenXRRuntime.wantsToQuit); } internal static bool ShouldRestart() { return InvokeEvent(OpenXRRuntime.wantsToRestart); } [DllImport("UnityOpenXR", EntryPoint = "NativeConfig_GetRuntimeName")] [return: MarshalAs(UnmanagedType.U1)] private static extern bool Internal_GetRuntimeName(out IntPtr runtimeNamePtr); [DllImport("UnityOpenXR", EntryPoint = "NativeConfig_GetRuntimeVersion")] [return: MarshalAs(UnmanagedType.U1)] private static extern bool Internal_GetRuntimeVersion(out ushort major, out ushort minor, out uint patch); [DllImport("UnityOpenXR", EntryPoint = "NativeConfig_GetAPIVersion")] [return: MarshalAs(UnmanagedType.U1)] private static extern bool Internal_GetAPIVersion(out ushort major, out ushort minor, out uint patch); [DllImport("UnityOpenXR", EntryPoint = "NativeConfig_GetPluginVersion")] [return: MarshalAs(UnmanagedType.U1)] private static extern bool Internal_GetPluginVersion(out IntPtr pluginVersionPtr); [DllImport("UnityOpenXR", EntryPoint = "unity_ext_IsExtensionEnabled")] [return: MarshalAs(UnmanagedType.U1)] private static extern bool Internal_IsExtensionEnabled(string extensionName); [DllImport("UnityOpenXR", EntryPoint = "unity_ext_GetExtensionVersion")] private static extern uint Internal_GetExtensionVersion(string extensionName); [DllImport("UnityOpenXR", EntryPoint = "unity_ext_GetEnabledExtensionCount")] private static extern uint Internal_GetEnabledExtensionCount(); [DllImport("UnityOpenXR", CharSet = CharSet.Ansi, EntryPoint = "unity_ext_GetEnabledExtensionName")] [return: MarshalAs(UnmanagedType.U1)] private static extern bool Internal_GetEnabledExtensionNamePtr(uint index, out IntPtr outName); [DllImport("UnityOpenXR", EntryPoint = "session_SetSoftRestartLoopAtInitialization")] private static extern void Internal_SetSoftRestartLoopAtInitialization([MarshalAs(UnmanagedType.I1)] bool value); [DllImport("UnityOpenXR", EntryPoint = "session_GetSoftRestartLoopAtInitialization")] [return: MarshalAs(UnmanagedType.U1)] private static extern bool Internal_GetSoftRestartLoopAtInitialization(); private static bool Internal_GetEnabledExtensionName(uint index, out string extensionName) { if (!Internal_GetEnabledExtensionNamePtr(index, out var outName)) { extensionName = ""; return false; } extensionName = Marshal.PtrToStringAnsi(outName); return true; } [DllImport("UnityOpenXR", EntryPoint = "unity_ext_GetAvailableExtensionCount")] private static extern uint Internal_GetAvailableExtensionCount(); [DllImport("UnityOpenXR", CharSet = CharSet.Ansi, EntryPoint = "unity_ext_GetAvailableExtensionName")] [return: MarshalAs(UnmanagedType.U1)] private static extern bool Internal_GetAvailableExtensionNamePtr(uint index, out IntPtr extensionName); private static bool Internal_GetAvailableExtensionName(uint index, out string extensionName) { if (!Internal_GetAvailableExtensionNamePtr(index, out var extensionName2)) { extensionName = ""; return false; } extensionName = Marshal.PtrToStringAnsi(extensionName2); return true; } [DllImport("UnityOpenXR", CharSet = CharSet.Ansi, EntryPoint = "session_GetLastError")] [return: MarshalAs(UnmanagedType.U1)] private static extern bool Internal_GetLastError(out IntPtr error); internal static bool GetLastError(out string error) { if (!Internal_GetLastError(out var error2)) { error = ""; return false; } error = Marshal.PtrToStringAnsi(error2); return true; } internal static void LogLastError() { if (GetLastError(out var error)) { Debug.LogError((object)error); } } } public static class OpenXRUtility { private const string LibraryName = "UnityOpenXR"; public static bool IsSessionFocused => Internal_IsSessionFocused(); public static bool IsUserPresent => Internal_GetUserPresence(); private static Pose Inverse(Pose p) { //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_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_0015: 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) //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_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) Pose val = default(Pose); val.rotation = Quaternion.Inverse(p.rotation); val.position = val.rotation * -p.position; return val; } public static Pose ComputePoseToWorldSpace(Transform t, Camera camera) { //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_0031: 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_0044: 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_0056: 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) //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_0065: 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_000b: 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) if ((Object)(object)camera == (Object)null) { return default(Pose); } Transform transform = ((Component)camera).transform; Pose val = default(Pose); ((Pose)(ref val))..ctor(transform.localPosition, transform.localRotation); Pose p = default(Pose); ((Pose)(ref p))..ctor(transform.position, transform.rotation); Pose val2 = default(Pose); ((Pose)(ref val2))..ctor(t.position, t.rotation); Pose transformedBy = ((Pose)(ref val2)).GetTransformedBy(Inverse(p)); return ((Pose)(ref transformedBy)).GetTransformedBy(val); } [DllImport("UnityOpenXR", EntryPoint = "NativeConfig_IsSessionFocused")] [return: MarshalAs(UnmanagedType.U1)] private static extern bool Internal_IsSessionFocused(); [DllImport("UnityOpenXR", EntryPoint = "NativeConfig_GetUserPresence")] [return: MarshalAs(UnmanagedType.U1)] private static extern bool Internal_GetUserPresence(); } internal sealed class WaitForRestartFinish : CustomYieldInstruction { private float m_Timeout; public override bool keepWaiting { get { if (!OpenXRRestarter.Instance.isRunning) { return false; } if (Time.realtimeSinceStartup > m_Timeout) { Debug.LogError((object)"WaitForRestartFinish: Timeout"); return false; } return true; } } public WaitForRestartFinish(float timeout = 5f) { m_Timeout = Time.realtimeSinceStartup + timeout; } } } namespace UnityEngine.XR.OpenXR.API { public enum UnityXRRenderTextureFormat { kUnityXRRenderTextureFormatRGBA32 = 0, kUnityXRRenderTextureFormatBGRA32 = 1, kUnityXRRenderTextureFormatRGB565 = 2, kUnityXRRenderTextureFormatR16G16B16A16_SFloat = 3, kUnityXRRenderTextureFormatRGBA1010102 = 4, kUnityXRRenderTextureFormatBGRA1010102 = 5, kUnityXRRenderTextureFormatR11G11B10_UFloat = 6, kUnityXRRenderTextureFormatReference = 64, kUnityXRRenderTextureFormatSoftReferenceMSAA = 65, kUnityXRRenderTextureFormatNone = 66 } public struct UnityXRTextureData { public IntPtr nativePtr; public uint referenceTextureId; } public enum UnityXRDepthTextureFormat { kUnityXRDepthTextureFormat24bitOrGreater, kUnityXRDepthTextureFormat16bit, kUnityXRDepthTextureFormatReference, kUnityXRDepthTextureFormatNone } public enum UnityXRShadingRateFormat { kUnityXRShadingRateFormatNone, kUnityXRShadingRateR8G8 } public enum UnityXRRenderTextureFlags { kUnityXRRenderTextureFlagsUVDirectionTopToBottom = 1, kUnityXRRenderTextureFlagsMultisampleAutoResolve = 2, kUnityXRRenderTextureFlagsLockedWidthHeight = 4, kUnityXRRenderTextureFlagsWriteOnly = 8, kUnityXRRenderTextureFlagsSRGB = 0x10, kUnityXRRenderTextureFlagsOptimizeBufferDiscards = 0x20, kUnityXRRenderTextureFlagsMotionVectorTexture = 0x40, kUnityXRRenderTextureFlagsFoveationOffset = 0x80, kUnityXRRenderTextureFlagsViewportAsRenderArea = 0x100, kUnityXRRenderTextureFlagsHDR = 0x200 } public struct UnityXRRenderTextureDesc { public UnityXRRenderTextureFormat colorFormat; public UnityXRTextureData color; public UnityXRDepthTextureFormat depthFormat; public UnityXRTextureData depth; public UnityXRShadingRateFormat shadingRateFormat; public UnityXRTextureData shadingRate; public uint width; public uint height; public uint textureArrayLength; public uint flags;
BepInEx/plugins/WhiteKnuckleVRMod/WhiteKnuckleVRMod.dll
Decompiled a day 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.Globalization; using System.IO; 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 System.Text; using BepInEx; using BepInEx.Logging; using DarkMachine.UI; using HarmonyLib; using HarmonyLib.Tools; using Microsoft.CodeAnalysis; using TMPro; using UnityEngine; using UnityEngine.EventSystems; using UnityEngine.Events; using UnityEngine.InputSystem; using UnityEngine.InputSystem.Controls; using UnityEngine.InputSystem.LowLevel; using UnityEngine.InputSystem.Users; using UnityEngine.InputSystem.Utilities; using UnityEngine.InputSystem.XR; using UnityEngine.Rendering; using UnityEngine.Rendering.PostProcessing; using UnityEngine.SceneManagement; using UnityEngine.UI; using UnityEngine.XR; using UnityEngine.XR.OpenXR; using UnityEngine.XR.OpenXR.Features; using UnityEngine.XR.OpenXR.Features.Interactions; using WhiteKnuckleVRMod; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: IgnoresAccessChecksTo("Assembly-CSharp")] [assembly: TargetFramework(".NETFramework,Version=v4.7", FrameworkDisplayName = ".NET Framework 4.7")] [assembly: AssemblyCompany("WhiteKnuckleVRMod")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+aa74a6885563e9de6cca3c77dadeb9c55cb92ca0")] [assembly: AssemblyProduct("WhiteKnuckleVRMod")] [assembly: AssemblyTitle("WhiteKnuckleVRMod")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [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] [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; } } [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 static class CanvasManager { private const float WORLD_SPACE_SCALE = 0.0013f; public const float DEFAULT_UI_DISTANCE = 1.8f; private const float UI_X_OFFSET = 0f; private const float UI_Y_OFFSET = 0f; private static void DisableCanvasScaler(Canvas canvas, ManualLogSource logger) { CanvasScaler component = ((Component)canvas).GetComponent<CanvasScaler>(); if ((Object)(object)component != (Object)null && ((Behaviour)component).enabled) { ((Behaviour)component).enabled = false; if (VRLog.VerboseEnabled) { logger.LogInfo((object)("Disabled CanvasScaler on '" + ((Object)canvas).name + "' so it stops overwriting localScale.")); } } } public static void CanvasToWorldSpace(Canvas canvas, Transform playerRoot, Camera vrCamera, ManualLogSource logger, float scale = 0.0013f, float distance = 1.8f) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Invalid comparison between Unknown and I4 //IL_008f: 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_00c1: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)canvas == (Object)null) { logger.LogError((object)"Attempted to convert a null Canvas."); return; } if ((int)canvas.renderMode == 2) { logger.LogWarning((object)("Canvas '" + ((Object)canvas).name + "' is already in WorldSpace. Skipping conversion.")); return; } if (VRLog.VerboseEnabled) { logger.LogInfo((object)("Converting Canvas: " + ((Object)canvas).name + " to WorldSpace.")); } DisableCanvasScaler(canvas, logger); ((Component)canvas).transform.SetParent(playerRoot, false); canvas.renderMode = (RenderMode)2; canvas.worldCamera = vrCamera; VRCanvasOverlaySentinel.Attach(((Component)canvas).gameObject); ((Component)canvas).transform.localRotation = Quaternion.identity; ((Component)canvas).transform.localPosition = new Vector3(0f, 0f, distance); ((Component)canvas).transform.localScale = new Vector3(scale, scale, scale); canvas.planeDistance = distance; if (VRLog.VerboseEnabled) { logger.LogInfo((object)$"Canvas '{((Object)canvas).name}' converted. Positioned {distance}m in front of player."); } } private static void ConvertNestedCanvasInPlace(Canvas canvas, Camera vrCamera, ManualLogSource logger) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Invalid comparison between Unknown and I4 if ((int)canvas.renderMode != 2) { DisableCanvasScaler(canvas, logger); canvas.renderMode = (RenderMode)2; canvas.worldCamera = vrCamera; VRCanvasOverlaySentinel.Attach(((Component)canvas).gameObject); if (VRLog.VerboseEnabled) { logger.LogInfo((object)("Converted nested Canvas '" + ((Object)canvas).name + "' to WorldSpace in place (no reparent).")); } } } public static void ConvertCanvasHierarchyToWorldSpace(Canvas rootCanvas, Transform playerRoot, Camera vrCamera, ManualLogSource logger, float scale = 0.0013f, float distance = 1.8f) { if ((Object)(object)rootCanvas == (Object)null) { logger.LogError((object)"Attempted to convert a null root Canvas hierarchy."); return; } CanvasToWorldSpace(rootCanvas, playerRoot, vrCamera, logger, scale, distance); Canvas[] componentsInChildren = ((Component)rootCanvas).GetComponentsInChildren<Canvas>(true); Canvas[] array = componentsInChildren; foreach (Canvas val in array) { if (!((Object)(object)val == (Object)(object)rootCanvas)) { ConvertNestedCanvasInPlace(val, vrCamera, logger); } } } } namespace WhiteKnuckleVRMod { internal static class BepInExConfigGuard { private const string SettingKey = "HideManagerGameObject"; public static void EnsureManagerObjectHidden(ManualLogSource logger) { string text = Path.Combine(Paths.ConfigPath, "BepInEx.cfg"); try { if (!File.Exists(text)) { logger.LogWarning((object)(text + " not found, cannot verify HideManagerGameObject.")); return; } string[] array = File.ReadAllLines(text); int num = FindSettingLine(array); if (num < 0) { logger.LogWarning((object)"HideManagerGameObject not present in BepInEx.cfg. If the VR mod never starts, add 'HideManagerGameObject = true' under [Chainloader] and relaunch."); } else if (!ReadsTrue(array[num])) { array[num] = "HideManagerGameObject = true"; File.WriteAllLines(text, array); logger.LogWarning((object)"================================================================"); logger.LogWarning((object)"White Knuckle destroys the BepInEx manager object unless HideManagerGameObject"); logger.LogWarning((object)"is enabled, which stops every plugin including this one from starting."); logger.LogWarning((object)"HideManagerGameObject has been set to true in BepInEx/config/BepInEx.cfg."); logger.LogWarning((object)"RESTART THE GAME to finish loading the VR mod."); logger.LogWarning((object)"================================================================"); } } catch (Exception arg) { logger.LogError((object)string.Format("Failed to verify {0} in {1}: {2}", "HideManagerGameObject", text, arg)); } } private static int FindSettingLine(string[] lines) { for (int i = 0; i < lines.Length; i++) { string text = lines[i].TrimStart(); if (!text.StartsWith("#") && text.StartsWith("HideManagerGameObject", StringComparison.OrdinalIgnoreCase)) { int num = text.IndexOf('='); if (num >= 0 && text.Substring(0, num).Trim().Equals("HideManagerGameObject", StringComparison.OrdinalIgnoreCase)) { return i; } } } return -1; } private static bool ReadsTrue(string line) { int num = line.IndexOf('='); if (num >= 0) { return line.Substring(num + 1).Trim().Equals("true", StringComparison.OrdinalIgnoreCase); } return false; } } internal static class VRPluginInfo { public const string PLUGIN_GUID = "com.whiteknucklevr.vrmod"; public const string PLUGIN_NAME = "White Knuckle VR Mod"; public const string PLUGIN_VERSION = "1.1.3"; } internal static class VRPluginConstants { public const float MENU_PLAYER_HEIGHT = 0.45f; public const float MOUSE_SENSITIVITY = 0.05f; public const float SNAP_TURN_DEADZONE = 0.5f; } public class MathUtils { public static Quaternion ExtractComponentVector(Quaternion rotation, Vector3 components) { //IL_000d: 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_001a: 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_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_0039: 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) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005d: 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) float num = default(float); Vector3 val = default(Vector3); ((Quaternion)(ref rotation)).ToAngleAxis(ref num, ref val); Vector3 val2 = default(Vector3); ((Vector3)(ref val2))..ctor(val.x * components.x, val.y * components.y, val.z * components.z); if (Mathf.Abs(val2.x) < 1E-06f && Mathf.Abs(val2.y) < 1E-06f && Mathf.Abs(val2.z) < 1E-06f) { return Quaternion.identity; } ((Vector3)(ref val2)).Normalize(); return Quaternion.AngleAxis(num, val2); } public static float RotationAroundAxis(Quaternion rotation, Vector3 axis) { //IL_001b: 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) float num = default(float); Vector3 val = default(Vector3); ((Quaternion)(ref rotation)).ToAngleAxis(ref num, ref val); if (num > 180f) { num -= 360f; } float num2 = Vector3.Dot(val, axis); if (Mathf.Abs(num2) < 1E-06f) { return 0f; } return num * num2; } } public static class Scenes { public static readonly string Intro = "Intro"; public static readonly string MainMenu = "Main-Menu"; public static readonly string GameMain = "Game-Main"; public static readonly string Playground = "Playground"; } [BepInPlugin("com.whiteknucklevr.vrmod", "White Knuckle VR Mod", "1.1.3")] public class VRRenderingPipeline : BaseUnityPlugin { private class ENT_Player_Patch { private static Vector3 positionBeforeMovementThisTick = Vector3.zero; private static VRCameraSpoof propGrabSpoof; private static VRCameraSpoof hangSpoof; [HarmonyPrefix] [HarmonyPatch(typeof(ENT_Player), "MouseLook")] private static bool MouseLook_Patch(ENT_Player __instance) { //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_0030: 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_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) //IL_0067: 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_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_009f: 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_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) if (!__instance.IsMoveLocked() || !__instance.IsInputLocked()) { __instance.InterpolateCamera(); } if (__instance.IsLocked()) { return false; } if (vrInitialized) { Quaternion canonicalHeadRotation = CanonicalHeadRotation; float num = MathUtils.RotationAroundAxis(canonicalHeadRotation, Vector3.up); AlignLocomotionYawToSpawnOnce(__instance, num); float num2 = num + locomotionYaw; ((Component)__instance).transform.rotation = Quaternion.AngleAxis(num2, Vector3.up); __instance.camTransform.localRotation = VRLookOffset.PitchRotationFor(canonicalHeadRotation) * MathUtils.ExtractComponentVector(canonicalHeadRotation, new Vector3(1f, 0f, 1f)); __instance.camY = num2; __instance.cameraPosition = __instance.camTransform.position; __instance.cameraRotation = __instance.camTransform.rotation; } return false; } [HarmonyPrefix] [HarmonyPatch(typeof(ENT_Player), "FixedUpdate")] private static void FixedUpdate_RefreshInput_Prefix() { if (vrInitialized && MotionControlsActive) { VRHandInput.Advance(); } } [HarmonyPostfix] [HarmonyPatch(typeof(ENT_Player), "FixedUpdate")] private static void FixedUpdate_Patch(ENT_Player __instance) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) if (vrInitialized) { RecordFixedPlayerPosition(((Component)__instance).transform.position); } } [HarmonyPostfix] [HarmonyPatch(typeof(ENT_Player), "LateUpdate")] private static void LateUpdate_OwnCrouch_Postfix(ENT_Player __instance) { if (vrInitialized && MotionControlsActive && Settings.physicalCrouchEnabled && !((Object)(object)CL_GameManager.gMan == (Object)null) && !CL_GameManager.gMan.isPaused) { __instance.crouchPressed = VRPhysicalCrouch.Crouched; } } [HarmonyPrefix] [HarmonyPatch(typeof(ENT_Player), "Movement")] private static void Movement_Prefix(ENT_Player __instance) { //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) ApplyHeadsetPositionalMovement(__instance); positionBeforeMovementThisTick = ((Component)__instance).transform.position; if (MotionControlsActive) { VRClimbControl.Apply(__instance); } } [HarmonyPostfix] [HarmonyPatch(typeof(ENT_Player), "Movement")] private static void Movement_Postfix(ENT_Player __instance) { //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_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) Vector3 val = ((Component)__instance).transform.position - positionBeforeMovementThisTick; val.y = 0f; RecordStickSpeed(((Vector3)(ref val)).magnitude / Time.fixedDeltaTime); } [HarmonyPrefix] [HarmonyPatch(typeof(ENT_Player), "GrabPropUpdate")] private static void GrabPropUpdate_Prefix(ENT_Player __instance, int hand) { if (MotionControlsActive) { propGrabSpoof = VRPropGrab.AimHeldProp(__instance, hand); } } [HarmonyFinalizer] [HarmonyPatch(typeof(ENT_Player), "GrabPropUpdate")] private static void GrabPropUpdate_Finalizer() { propGrabSpoof.Dispose(); propGrabSpoof = default(VRCameraSpoof); } [HarmonyPrefix] [HarmonyPatch(typeof(ENT_Player), "Hang")] private static void Hang_Prefix(ENT_Player __instance) { //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_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_004b: 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_0050: 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_0053: 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_005a: 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_006c: 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_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) if (MotionControlsActive && !((Object)(object)__instance.cam == (Object)null) && __instance.IsHanging() && !VRClimbControl.JoystickClimbActive) { Vector3 forward = ((Component)__instance).transform.forward; Vector3 lastClimbIntentDirection = VRClimbControl.LastClimbIntentDirection; Vector3 intentDirection = ((((Vector3)(ref lastClimbIntentDirection)).sqrMagnitude > 0.0001f) ? ((Vector3)(ref lastClimbIntentDirection)).normalized : forward); intentDirection = VRClimbControl.ProjectIntentOffSurface(__instance, intentDirection, forward); Vector3 upHint = ((Mathf.Abs(intentDirection.y) > 0.99f) ? forward : Vector3.up); hangSpoof = VRCameraSpoof.FaceDirection(intentDirection, upHint); } } [HarmonyFinalizer] [HarmonyPatch(typeof(ENT_Player), "Hang")] private static void Hang_Finalizer() { hangSpoof.Dispose(); } [HarmonyPrefix] [HarmonyPatch(typeof(ENT_Player), "InteractCheck")] private static void InteractCheck_Prefix(int hand) { if (MotionControlsActive) { VRBackpack.BeginBagAim(hand); } } [HarmonyFinalizer] [HarmonyPatch(typeof(ENT_Player), "InteractCheck")] private static void InteractCheck_Finalizer() { VRBackpack.EndBagAim(); } [HarmonyPrefix] [HarmonyPatch(typeof(ENT_Player), "HandAnimation")] private static void HandAnimation_Prefix(Hand curhand, out string? __state) { __state = null; if (!MotionControlsActive || curhand == null || !ENT_Player_Hand_Patch.GripIsSecondInput()) { return; } int id = curhand.id; if (id >= 0 && id < VRHandInput.Hands.Length) { VRHand vRHand = VRHandInput.ForHandId(id); bool flag = vRHand.Grip.Pressed || vRHand.Grip.Down; bool flag2 = vRHand.Trigger.Pressed || vRHand.Trigger.Down; if (!(!flag2 || flag) && !string.IsNullOrEmpty(curhand.fireButton)) { __state = curhand.fireButton; curhand.fireButton = VRHandButtons.GrabName(id); } } } [HarmonyFinalizer] [HarmonyPatch(typeof(ENT_Player), "HandAnimation")] private static void HandAnimation_Finalizer(Hand curhand, string? __state) { if (__state != null && curhand != null) { curhand.fireButton = __state; } } } private class CL_Prop_Patch { [HarmonyPostfix] [HarmonyPatch(typeof(CL_Prop), "Interact")] private static void Interact_Postfix(InteractionInfo info) { //IL_0020: Unknown result type (might be due to invalid IL or missing references) if (MotionControlsActive && info != null && info.hand != null) { VRPropGrab.RecordGrabDistance(info.hand.id, info.interactionPoint); } } [HarmonyPostfix] [HarmonyPatch(typeof(CL_Prop), "StopInteract")] private static void StopInteract_Postfix(Hand hand) { if (hand != null) { VRPropGrab.ClearGrabDistance(hand.id); } } } private class CL_HoldLever_Patch { private static VRCameraSpoof updateSpoof; private static VRCameraSpoof lateUpdateSpoof; private static VRCameraSpoof interactSpoof; [HarmonyPrefix] [HarmonyPatch(typeof(CL_HoldLever), "Update")] private static void Update_Prefix(CL_HoldLever __instance) { updateSpoof = VRPropGrab.AimLever(__instance); } [HarmonyFinalizer] [HarmonyPatch(typeof(CL_HoldLever), "Update")] private static void Update_Finalizer() { updateSpoof.Dispose(); updateSpoof = default(VRCameraSpoof); } [HarmonyPrefix] [HarmonyPatch(typeof(CL_HoldLever), "LateUpdate")] private static void LateUpdate_Prefix(CL_HoldLever __instance) { lateUpdateSpoof = VRPropGrab.AimLever(__instance); } [HarmonyFinalizer] [HarmonyPatch(typeof(CL_HoldLever), "LateUpdate")] private static void LateUpdate_Finalizer() { lateUpdateSpoof.Dispose(); lateUpdateSpoof = default(VRCameraSpoof); } [HarmonyPrefix] [HarmonyPatch(typeof(CL_HoldLever), "Interact", new Type[] { typeof(InteractionInfo) })] private static void Interact_Prefix(InteractionInfo info) { if (MotionControlsActive && info != null && info.hand != null) { interactSpoof = VRAimRay.AimFromHandId(info.hand.id); } } [HarmonyFinalizer] [HarmonyPatch(typeof(CL_HoldLever), "Interact", new Type[] { typeof(InteractionInfo) })] private static void Interact_Finalizer() { interactSpoof.Dispose(); interactSpoof = default(VRCameraSpoof); } } private class M_Level_Patch { [HarmonyPostfix] [HarmonyPatch(typeof(M_Level), "OnSpawn")] private static void OnSpawn_Postfix(M_Level __instance) { VRSoftDepth.CompensateHierarchy(((Component)__instance).transform); } } private class CL_Handhold_Patch { [HarmonyPostfix] [HarmonyPatch(typeof(CL_Handhold), "LateUpdate")] private static void LateUpdate_Postfix(CL_Handhold __instance) { if (vrInitialized && VRShimmer.HandholdShimmerEnabled && !((Object)(object)__instance.handholdRenderer == (Object)null)) { VRShimmer.ApplyWorldSpaceWave(__instance.handholdRenderer); } } [HarmonyPostfix] [HarmonyPatch(typeof(CL_Handhold), "Interact")] private static void Interact_Postfix(CL_Handhold __instance, InteractionInfo info) { if (vrInitialized && Settings.verboseLogging) { int num = ((info.hand != null) ? info.hand.id : (-1)); } } [HarmonyPostfix] [HarmonyPatch(typeof(CL_Handhold), "StopInteract")] private static void StopInteract_Postfix(CL_Handhold __instance, Hand dropHand) { if (vrInitialized) { _ = Settings.verboseLogging; } } } private class UT_CameraTakeover_Patch { [HarmonyPostfix] [HarmonyPatch(typeof(UT_CameraTakeover), "TakeoverCamera")] private static void TakeoverCamera_Postfix(UT_CameraTakeover __instance) { VRTerminalView.BeginTakeover(__instance); } [HarmonyPostfix] [HarmonyPatch(typeof(UT_CameraTakeover), "EndTakeover")] private static void EndTakeover_Postfix(UT_CameraTakeover __instance) { VRTerminalView.EndTakeover(__instance); } } private class InputManager_Patch { [HarmonyPostfix] [HarmonyPatch(typeof(InputManager), "UpdateInputs")] private static void UpdateInputs_Postfix() { if (MotionControlsActive) { VRPhysicalCrouch.WriteCrouchInput(); VRHandSwapGesture.WriteSwapInput(); } } } private class Inventory_Patch { private static VRCameraSpoof lookAwaySpoof; [HarmonyPrefix] [HarmonyPatch(typeof(Inventory), "TryPocketItemInHand")] private static void TryPocketItemInHand_Prefix(Inventory __instance, int handID) { if (vrInitialized && Settings.verboseLogging && __instance.pockets != null && handID < __instance.pockets.Count) { Pocket val = __instance.pockets[handID]; if (val != null && val.pouch != null) { Item val2 = ((val.targetHandID < __instance.itemHands.Length) ? __instance.itemHands[val.targetHandID].currentItem : null); } } } [HarmonyPostfix] [HarmonyPatch(typeof(Inventory), "CalculateEncumberance")] private static void CalculateEncumberance_Postfix(Inventory __instance) { _ = vrInitialized; } [HarmonyPrefix] [HarmonyPatch(typeof(Inventory), "Update")] private static void Update_Prefix(Inventory __instance) { //IL_003d: 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) if (vrInitialized) { if (MotionControlsActive) { VRBackpack.BeginInventoryButtonOverride(); } if (MotionControlsActive) { VRPocketDrop.BeginPocketButtonOverride(); } if (__instance.showingInventory && !((Object)(object)__instance.inventory == (Object)null)) { lookAwaySpoof = VRCameraSpoof.FaceDirection(__instance.inventory.forward, Vector3.up); } } } [HarmonyFinalizer] [HarmonyPatch(typeof(Inventory), "Update")] private static void Update_Finalizer() { lookAwaySpoof.Dispose(); if (MotionControlsActive) { VRBackpack.EndInventoryButtonOverride(); } if (MotionControlsActive) { VRPocketDrop.EndPocketButtonOverride(); } } [HarmonyPostfix] [HarmonyPatch(typeof(Inventory), "Update")] private static void Update_Postfix() { if (vrInitialized) { VRBackpack.PlaceBag(); } } } private class HandItem_Aim_Patch { private static readonly VRCameraSpoof[] spoofStack = new VRCameraSpoof[8]; private static int spoofDepth; private static void Push(HandItem handItem) { if (!MotionControlsActive) { spoofDepth++; return; } if (spoofDepth < 0 || spoofDepth >= spoofStack.Length) { spoofDepth++; return; } spoofStack[spoofDepth] = VRAimRay.AimFromHand(handItem); spoofDepth++; } private static void Pop() { spoofDepth--; if (spoofDepth < 0 || spoofDepth >= spoofStack.Length) { if (spoofDepth < 0) { spoofDepth = 0; } } else { spoofStack[spoofDepth].Dispose(); spoofStack[spoofDepth] = default(VRCameraSpoof); } } [HarmonyPrefix] [HarmonyPatch(typeof(HandItem_Shoot), "Shoot")] private static void Shoot_Prefix(HandItem_Shoot __instance) { Push((HandItem)(object)__instance); } [HarmonyFinalizer] [HarmonyPatch(typeof(HandItem_Shoot), "Shoot")] private static void Shoot_Finalizer() { Pop(); } [HarmonyPrefix] [HarmonyPatch(typeof(HandItem_Melee), "HitCast")] private static void HitCast_Prefix(HandItem_Melee __instance) { Push((HandItem)(object)__instance); } [HarmonyFinalizer] [HarmonyPatch(typeof(HandItem_Melee), "HitCast")] private static void HitCast_Finalizer() { Pop(); } [HarmonyPrefix] [HarmonyPatch(typeof(HandItem_Melee), "Hit")] private static void Hit_Prefix(HandItem_Melee __instance) { Push((HandItem)(object)__instance); } [HarmonyFinalizer] [HarmonyPatch(typeof(HandItem_Melee), "Hit")] private static void Hit_Finalizer() { Pop(); } [HarmonyPrefix] [HarmonyPatch(typeof(HandItem_Piton), "PitonHit")] private static void PitonHit_Prefix(HandItem_Piton __instance) { Push((HandItem)(object)__instance); } [HarmonyFinalizer] [HarmonyPatch(typeof(HandItem_Piton), "PitonHit")] private static void PitonHit_Finalizer() { Pop(); } [HarmonyPrefix] [HarmonyPatch(typeof(HandItem_Piton), "PitonRaycast")] private static void PitonRaycast_Prefix(HandItem_Piton __instance) { Push((HandItem)(object)__instance); } [HarmonyFinalizer] [HarmonyPatch(typeof(HandItem_Piton), "PitonRaycast")] private static void PitonRaycast_Finalizer() { Pop(); } [HarmonyPrefix] [HarmonyPatch(typeof(HandItem_BlinkEye), "LateUpdate")] private static void BlinkEyeLateUpdate_Prefix(HandItem_BlinkEye __instance) { Push((HandItem)(object)__instance); } [HarmonyFinalizer] [HarmonyPatch(typeof(HandItem_BlinkEye), "LateUpdate")] private static void BlinkEyeLateUpdate_Finalizer() { Pop(); } [HarmonyPostfix] [HarmonyPatch(typeof(HandItem_BlinkEye), "LateUpdate")] private static void BlinkEyeLateUpdate_Postfix(HandItem_BlinkEye __instance) { //IL_002a: 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) if (((HandItem)__instance).used && MotionControlsActive && !((Object)(object)__instance.blinkHoldEffect == (Object)null)) { ((Component)__instance.blinkHoldEffect).transform.localPosition = Vector3.zero; ((Component)__instance.blinkHoldEffect).transform.localRotation = Quaternion.identity; } } [HarmonyPrefix] [HarmonyPatch(typeof(HandItem_Melee_Rapier), "OnChargeAttack")] private static void RapierOnChargeAttack_Prefix(HandItem_Melee_Rapier __instance) { Push((HandItem)(object)__instance); } [HarmonyFinalizer] [HarmonyPatch(typeof(HandItem_Melee_Rapier), "OnChargeAttack")] private static void RapierOnChargeAttack_Finalizer() { Pop(); } [HarmonyPrefix] [HarmonyPatch(typeof(HandItem_Melee_Rapier), "PogoCheck")] private static void RapierPogoCheck_Prefix(HandItem_Melee_Rapier __instance) { Push((HandItem)(object)__instance); } [HarmonyFinalizer] [HarmonyPatch(typeof(HandItem_Melee_Rapier), "PogoCheck")] private static void RapierPogoCheck_Finalizer() { Pop(); } [HarmonyPrefix] [HarmonyPatch(typeof(HandItem_GrapplingHook), "Grapple")] private static void GrapplingHookGrapple_Prefix(HandItem_GrapplingHook __instance) { Push((HandItem)(object)__instance); } [HarmonyFinalizer] [HarmonyPatch(typeof(HandItem_GrapplingHook), "Grapple")] private static void GrapplingHookGrapple_Finalizer() { Pop(); } } private class ViewSway_Patch { [HarmonyPostfix] [HarmonyPatch(typeof(ViewSway), "Update")] private static void Update_Postfix(ViewSway __instance, Hand ___hand) { //IL_0032: 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_0044: Unknown result type (might be due to invalid IL or missing references) if (MotionControlsActive && ___hand != null && !HandItem_LateUpdate_Patch.IsNested(((Component)__instance).transform) && VRAimRay.TryGetHandRay(___hand.id, out var _, out var direction)) { ((Component)__instance).transform.rotation = Quaternion.LookRotation(direction, VRHandInput.Hands[___hand.id].Up); } } } private class Inventory_ShowInventory_Patch { [HarmonyPostfix] [HarmonyPatch(typeof(Inventory), "ShowInventory")] private static void ShowInventory_Postfix(Inventory __instance) { //IL_003e: Unknown result type (might be due to invalid IL or missing references) Bag_Handler bagHandler = __instance.bagHandler; if ((Object)(object)bagHandler == (Object)null || bagHandler.extraPouches == null) { return; } foreach (Bag_Pouch extraPouch in bagHandler.extraPouches) { if (!((Object)(object)extraPouch == (Object)null)) { ((Component)extraPouch).transform.localRotation = Quaternion.identity; } } } } private class SubmitSlider_Patch { [HarmonyPostfix] [HarmonyPatch(typeof(SubmitSlider), "OnSubmit")] private static void OnSubmit_Postfix(SubmitSlider __instance) { VRMenuSelection.ToggleSliderEngagement(__instance); } [HarmonyPostfix] [HarmonyPatch(typeof(SubmitSlider), "OnDeselect")] private static void OnDeselect_Postfix(SubmitSlider __instance) { VRMenuSelection.ReleaseSliderEngagement(__instance); } } private class CosmeticInfoPanel_Patch { [HarmonyPostfix] [HarmonyPatch(typeof(UI_CosmeticInfoPanel), "Open")] private static void Open_Postfix(UI_CosmeticInfoPanel __instance) { ForceMenuCanvasGroupVisible(__instance.parentGroup); VRMenuSelection.SelectFirstInteractable(((Component)__instance).gameObject); } [HarmonyPostfix] [HarmonyPatch(typeof(UI_CosmeticInfoPanel), "Close")] private static void Close_Postfix(UI_CosmeticInfoPanel __instance) { ReleaseMenuCanvasGroupVisible(__instance.parentGroup); VRMenuSelection.ClearSliderEngagement(); } } private class Item_Object_Flashlight_Patch { [HarmonyPostfix] [HarmonyPatch(typeof(Item_Object_Flashlight), "Execute")] private static void Execute_Postfix(Item_Object_Flashlight __instance, Inventory inv) { //IL_0059: 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_0084: 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) if (vrInitialized) { Camera vrCamera = VrCamera; if (!((Object)(object)vrCamera == (Object)null) && !((Object)(object)__instance.lamp == (Object)null) && ((Item_Object)__instance).itemData.InInventory() && !((Object)(object)((Item_Object)__instance).itemData.GetHandItem() != (Object)null)) { ((Component)__instance.lamp).transform.position = ((Component)vrCamera).transform.position; ((Component)__instance.lamp).transform.rotation = Quaternion.Lerp(((Component)__instance.lamp).transform.rotation, ((Component)vrCamera).transform.rotation, Time.deltaTime * 8f); } } } } private class Message_Manager_Patch { [HarmonyPostfix] [HarmonyPatch(typeof(Message_Manager), "CreateMessage")] private static void CreateMessage_Postfix(Message __result) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)__result == (Object)null)) { ((Component)__result).transform.localRotation = Quaternion.identity; } } } private class Hand_Takeover_Patch { [HarmonyPrefix] [HarmonyPatch(typeof(Hand_Takeover), "LateUpdate")] private static bool LateUpdate_Prefix(Hand_Takeover __instance, ref float ___curBlend) { if (!MotionControlsActive) { return true; } ___curBlend = 0f; if ((Object)(object)__instance.backgroundRenderer != (Object)null) { ((Component)__instance.backgroundRenderer).gameObject.SetActive(false); } if ((Object)(object)__instance.foregroundRenderer != (Object)null) { ((Component)__instance.foregroundRenderer).gameObject.SetActive(false); } return false; } } private class HandItem_LateUpdate_Patch { private class VisualBinding { public Transform[] containers = Array.Empty<Transform>(); public Vector3[] authoredLocalPosition = Array.Empty<Vector3>(); public bool freezePosition; public Quaternion[] preCorrectionLocalRotation = Array.Empty<Quaternion>(); public Quaternion[] writtenLocalRotation = Array.Empty<Quaternion>(); public Transform[] lamps = Array.Empty<Transform>(); public Vector3[] lampAimWorldPosition = Array.Empty<Vector3>(); public Quaternion[] lampAimWorldRotation = Array.Empty<Quaternion>(); public Vector3[] lampPreCorrectionLocalPosition = Array.Empty<Vector3>(); public Quaternion[] lampPreCorrectionLocalRotation = Array.Empty<Quaternion>(); public Vector3[] lampWrittenLocalPosition = Array.Empty<Vector3>(); public Quaternion[] lampWrittenLocalRotation = Array.Empty<Quaternion>(); public bool hasWritten; public bool nested; } private static readonly Dictionary<HandItem, VisualBinding> bindings = new Dictionary<HandItem, VisualBinding>(); private static readonly string[] FreezePositionItemNameContains = new string[1] { "handgun" }; public static bool IsNested(Transform root) { if ((Object)(object)root.parent != (Object)null) { return (Object)(object)((Component)root.parent).GetComponentInParent<HandItem>() != (Object)null; } return false; } private static bool UsesFrozenPositionCorrection(HandItem handItem) { string text = ((handItem.item != null && !string.IsNullOrEmpty(handItem.item.itemName)) ? handItem.item.itemName : ((Object)handItem).name); string[] freezePositionItemNameContains = FreezePositionItemNameContains; foreach (string value in freezePositionItemNameContains) { if (text.IndexOf(value, StringComparison.OrdinalIgnoreCase) >= 0) { return true; } } return false; } [HarmonyPostfix] [HarmonyPatch(typeof(HandItem), "LateUpdate")] private static void LateUpdate_Postfix(HandItem __instance) { //IL_0133: 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_0139: 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_0155: Unknown result type (might be due to invalid IL or missing references) //IL_0158: Unknown result type (might be due to invalid IL or missing references) //IL_01db: 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_01e3: Unknown result type (might be due to invalid IL or missing references) //IL_01e8: Unknown result type (might be due to invalid IL or missing references) //IL_01eb: Unknown result type (might be due to invalid IL or missing references) //IL_01f0: Unknown result type (might be due to invalid IL or missing references) //IL_01f2: 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) //IL_01f6: Unknown result type (might be due to invalid IL or missing references) //IL_01fb: 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_0197: Unknown result type (might be due to invalid IL or missing references) //IL_019c: Unknown result type (might be due to invalid IL or missing references) //IL_01ab: Unknown result type (might be due to invalid IL or missing references) //IL_01b0: 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_01c4: 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_0073: 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_0221: 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_00c1: 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_0252: Unknown result type (might be due to invalid IL or missing references) //IL_0256: 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_026f: Unknown result type (might be due to invalid IL or missing references) //IL_0274: Unknown result type (might be due to invalid IL or missing references) //IL_0235: Unknown result type (might be due to invalid IL or missing references) //IL_0237: 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_0246: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: 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) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_02b2: Unknown result type (might be due to invalid IL or missing references) //IL_02c6: Unknown result type (might be due to invalid IL or missing references) //IL_02da: 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) //IL_02ee: 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_0113: Unknown result type (might be due to invalid IL or missing references) if (!MotionControlsActive || ((Hand_Base)__instance).hand == null || !VRAimRay.TryGetHandRay(((Hand_Base)__instance).hand.id, out var _, out var direction)) { return; } VisualBinding visualBinding = ResolveBinding(__instance); if (visualBinding.nested) { return; } Transform transform = ((Component)__instance).transform; if (visualBinding.hasWritten) { for (int i = 0; i < visualBinding.containers.Length; i++) { Transform val = visualBinding.containers[i]; if (!((Object)(object)val == (Object)null) && IsUntouchedSinceWrite(val.localRotation, visualBinding.writtenLocalRotation[i])) { val.localRotation = visualBinding.preCorrectionLocalRotation[i]; } } for (int j = 0; j < visualBinding.lamps.Length; j++) { Transform val2 = visualBinding.lamps[j]; if (!((Object)(object)val2 == (Object)null)) { if (IsUntouchedSinceWrite(val2.localPosition, visualBinding.lampWrittenLocalPosition[j])) { val2.localPosition = visualBinding.lampPreCorrectionLocalPosition[j]; } if (IsUntouchedSinceWrite(val2.localRotation, visualBinding.lampWrittenLocalRotation[j])) { val2.localRotation = visualBinding.lampPreCorrectionLocalRotation[j]; } } } } Quaternion rotation = transform.rotation; Quaternion val3 = (transform.rotation = Quaternion.LookRotation(direction, VRHandInput.Hands[((Hand_Base)__instance).hand.id].Up)); for (int k = 0; k < visualBinding.lamps.Length; k++) { Transform val5 = visualBinding.lamps[k]; if (!((Object)(object)val5 == (Object)null)) { visualBinding.lampAimWorldPosition[k] = val5.position; visualBinding.lampAimWorldRotation[k] = val5.rotation; visualBinding.lampPreCorrectionLocalPosition[k] = val5.localPosition; visualBinding.lampPreCorrectionLocalRotation[k] = val5.localRotation; } } Quaternion correction = Quaternion.Inverse(val3) * rotation; Vector3 lossyScale = transform.lossyScale; Quaternion val6 = MirrorAcrossNegativeScaleAxes(correction, lossyScale); for (int l = 0; l < visualBinding.containers.Length; l++) { Transform val7 = visualBinding.containers[l]; if (!((Object)(object)val7 == (Object)null)) { visualBinding.preCorrectionLocalRotation[l] = val7.localRotation; if (visualBinding.freezePosition) { val7.localPosition = CorrectLocalPosition(correction, lossyScale, visualBinding.authoredLocalPosition[l]); } val7.localRotation = val6 * val7.localRotation; visualBinding.writtenLocalRotation[l] = val7.localRotation; } } for (int m = 0; m < visualBinding.lamps.Length; m++) { Transform val8 = visualBinding.lamps[m]; if (!((Object)(object)val8 == (Object)null)) { val8.position = visualBinding.lampAimWorldPosition[m]; val8.rotation = visualBinding.lampAimWorldRotation[m]; visualBinding.lampWrittenLocalPosition[m] = val8.localPosition; visualBinding.lampWrittenLocalRotation[m] = val8.localRotation; } } visualBinding.hasWritten = true; } private static bool IsUntouchedSinceWrite(Vector3 current, Vector3 written) { //IL_0000: 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_000e: 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: 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) if (current.x == written.x && current.y == written.y) { return current.z == written.z; } return false; } private static bool IsUntouchedSinceWrite(Quaternion current, Quaternion written) { //IL_0000: 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_000e: 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: 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_002a: 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) if (current.x == written.x && current.y == written.y && current.z == written.z) { return current.w == written.w; } return false; } private static Quaternion MirrorAcrossNegativeScaleAxes(Quaternion correction, Vector3 scale) { //IL_0000: 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_000f: 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_001c: 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_005c: 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) //IL_0044: 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_0051: 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_006b: 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_0079: 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) if (scale.x < 0f) { ((Quaternion)(ref correction))..ctor(correction.x, 0f - correction.y, 0f - correction.z, correction.w); } if (scale.y < 0f) { ((Quaternion)(ref correction))..ctor(0f - correction.x, correction.y, 0f - correction.z, correction.w); } if (scale.z < 0f) { ((Quaternion)(ref correction))..ctor(0f - correction.x, 0f - correction.y, correction.z, correction.w); } return correction; } private static Vector3 CorrectLocalPosition(Quaternion correction, Vector3 scale, Vector3 localPosition) { //IL_0000: 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_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_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_0036: 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_0038: 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) //IL_003e: 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_0019: 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_0050: 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_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0027: 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_0065: 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_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_008c: 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) //IL_009e: 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_00b3: Unknown result type (might be due to invalid IL or missing references) if (Mathf.Approximately(scale.x, scale.y) && Mathf.Approximately(scale.y, scale.z)) { return correction * localPosition; } Vector3 val = Vector3.Scale(scale, localPosition); Vector3 val2 = correction * val; return new Vector3(Mathf.Approximately(scale.x, 0f) ? val2.x : (val2.x / scale.x), Mathf.Approximately(scale.y, 0f) ? val2.y : (val2.y / scale.y), Mathf.Approximately(scale.z, 0f) ? val2.z : (val2.z / scale.z)); } private static void DropBindingsForDestroyedItems() { List<HandItem> list = bindings.Keys.Where((HandItem item) => (Object)(object)item == (Object)null).ToList(); foreach (HandItem item in list) { bindings.Remove(item); } } private static VisualBinding ResolveBinding(HandItem handItem) { if (bindings.TryGetValue(handItem, out VisualBinding value)) { return value; } DropBindingsForDestroyedItems(); Transform transform = ((Component)handItem).transform; VisualBinding visualBinding = new VisualBinding { nested = IsNested(transform) }; if (!visualBinding.nested) { List<Transform> list = new List<Transform>(); for (int i = 0; i < transform.childCount; i++) { Transform child = transform.GetChild(i); if (((Component)child).GetComponentsInChildren<SpriteRenderer>(true).Length != 0 || ((Component)child).GetComponentsInChildren<MeshRenderer>(true).Length != 0) { list.Add(child); } } visualBinding.containers = list.ToArray(); visualBinding.authoredLocalPosition = list.Select((Transform container) => container.localPosition).ToArray(); visualBinding.freezePosition = UsesFrozenPositionCorrection(handItem); visualBinding.preCorrectionLocalRotation = (Quaternion[])(object)new Quaternion[list.Count]; visualBinding.writtenLocalRotation = (Quaternion[])(object)new Quaternion[list.Count]; List<Transform> list2 = new List<Transform>(); foreach (Transform item in list) { CL_Lamp[] componentsInChildren = ((Component)item).GetComponentsInChildren<CL_Lamp>(true); foreach (CL_Lamp val in componentsInChildren) { list2.Add(((Component)val).transform); } } visualBinding.lamps = list2.ToArray(); visualBinding.lampAimWorldPosition = (Vector3[])(object)new Vector3[list2.Count]; visualBinding.lampAimWorldRotation = (Quaternion[])(object)new Quaternion[list2.Count]; visualBinding.lampPreCorrectionLocalPosition = (Vector3[])(object)new Vector3[list2.Count]; visualBinding.lampPreCorrectionLocalRotation = (Quaternion[])(object)new Quaternion[list2.Count]; visualBinding.lampWrittenLocalPosition = (Vector3[])(object)new Vector3[list2.Count]; visualBinding.lampWrittenLocalRotation = (Quaternion[])(object)new Quaternion[list2.Count]; } bindings[handItem] = visualBinding; return visualBinding; } } private class ENT_Player_Hand_Patch { private struct ReachCandidate { public int Index; public float Cost; public Vector3 Point; public Vector3 Normal; public bool Exists => Index >= 0; public static ReachCandidate None => new ReachCandidate { Index = -1, Cost = float.MaxValue, Normal = Vector3.up }; public void TakeIfCheaper(int index, float cost, Vector3 point, Vector3 normal) { //IL_0019: 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) //IL_0020: 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) if (!(cost >= Cost)) { Index = index; Cost = cost; Point = point; Normal = normal; } } } private static readonly VRReach.ReachSample[] sampleBuffer = new VRReach.ReachSample[6]; private static readonly int[] lastSampledFrame = new int[2] { -1, -1 }; private static bool inMultiCast; private static bool castOverrideActive; private static float castOverrideDistance; private static float castOverrideRadius; private const float AngleCostScale = 1000f; [HarmonyPrefix] [HarmonyPatch(typeof(Hand), "EnqueueInteractCast")] private static bool EnqueueInteractCast_Prefix(Hand __instance) { //IL_00bf: 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) if (inMultiCast) { return true; } castOverrideActive = false; if (!MotionControlsActive) { return true; } ENT_Player player = __instance.player; if ((Object)(object)player == (Object)null || (Object)(object)player.cam == (Object)null) { return true; } int id = __instance.id; int frameCount = Time.frameCount; if (id >= 0 && id < lastSampledFrame.Length && lastSampledFrame[id] == frameCount) { return false; } int num = VRReach.BuildReachSamples(player, id, sampleBuffer); if (num == 0) { if (id >= 0 && id < VRReach.HasLastCastHit.Length) { VRReach.ClearHand(id); } return true; } if (id >= 0 && id < lastSampledFrame.Length) { lastSampledFrame[id] = frameCount; } using (VRCameraSpoof vRCameraSpoof = VRCameraSpoof.Capture()) { try { inMultiCast = true; for (int i = 0; i < num; i++) { VRReach.ReachSample reachSample = sampleBuffer[i]; vRCameraSpoof.Aim(reachSample.Origin, reachSample.Direction); castOverrideDistance = reachSample.Distance; castOverrideRadius = reachSample.Radius; castOverrideActive = true; __instance.EnqueueInteractCast(); } } finally { castOverrideActive = false; inMultiCast = false; } } RecordCastHit(__instance, num); return false; } private static void RecordCastHit(Hand hand, int sampleCount) { //IL_0044: 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_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_0077: 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_008e: 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_0094: 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_0148: 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_00b1: 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_0171: 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_010a: 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_00f9: 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) //IL_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_01fa: Unknown result type (might be due to invalid IL or missing references) //IL_01ff: 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_0216: Unknown result type (might be due to invalid IL or missing references) //IL_025a: Unknown result type (might be due to invalid IL or missing references) //IL_0353: Unknown result type (might be due to invalid IL or missing references) //IL_0358: Unknown result type (might be due to invalid IL or missing references) //IL_0365: Unknown result type (might be due to invalid IL or missing references) //IL_036a: Unknown result type (might be due to invalid IL or missing references) //IL_0301: Unknown result type (might be due to invalid IL or missing references) //IL_0306: 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_0310: Unknown result type (might be due to invalid IL or missing references) //IL_0316: Unknown result type (might be due to invalid IL or missing references) //IL_031f: Unknown result type (might be due to invalid IL or missing references) int id = hand.id; if (id < 0 || id >= VRReach.HasLastCastHit.Length) { return; } List<HandPhysicsHits> queuedHits = hand.queuedHits; if (queuedHits == null || queuedHits.Count == 0) { VRReach.ClearHand(id); return; } int num = Mathf.Max(0, queuedHits.Count - sampleCount); Vector3 val = VRReach.LastAxisOrigin[id]; Vector3 val2 = VRReach.LastAxisDirection[id]; VRSettings settings = Settings; ReachCandidate none = ReachCandidate.None; ReachCandidate none2 = ReachCandidate.None; for (int i = num; i < queuedHits.Count; i++) { if (TryResolveCandidate(queuedHits[i], out var point, out var normal, out var isHandhold)) { Vector3 val3 = point - val; float magnitude = ((Vector3)(ref val3)).magnitude; float num2 = ((magnitude > 0.0001f) ? Vector3.Angle(val2, val3) : 0f); float num3 = Mathf.Max(0f, num2 - settings.reachAngleTolerance) * 1000f; float num4 = (0f - magnitude) * settings.reachFarthestBias; float cost = num2 + num3 + num4; if (isHandhold) { none.TakeIfCheaper(i, cost, point, normal); } else { none2.TakeIfCheaper(i, cost, point, normal); } } } VRReach.HasHandhold[id] = none.Exists; if (none.Exists) { VRReach.HandholdPoint[id] = none.Point; } VRReach.HasItem[id] = none2.Exists; if (none2.Exists) { VRReach.ItemPoint[id] = none2.Point; } bool exists = none.Exists; bool exists2 = none2.Exists; ResolveGrabExclusivity(id, out var allowHandhold, out var allowItem); exists = exists && allowHandhold; exists2 = exists2 && allowItem; if (!allowHandhold) { hand.memoryTime = 0f; hand.nohandholdsMemoryTime = 0f; } if (exists) { HandPhysicsHits entry = queuedHits[none.Index]; if (FilterEntryForExclusivity(ref entry, allowHandhold, allowItem)) { queuedHits[none.Index] = entry; } else { exists = false; } } if (exists2) { HandPhysicsHits entry2 = queuedHits[none2.Index]; if (FilterEntryForExclusivity(ref entry2, allowHandhold, allowItem)) { queuedHits[none2.Index] = entry2; } else { exists2 = false; } } bool flag = exists && (!exists2 || none.Cost <= none2.Cost); int num5 = -1; int num6 = -1; for (int num7 = queuedHits.Count - 1; num7 >= 0; num7--) { if (TryResolveCandidate(queuedHits[num7], out var _, out var _, out var isHandhold2)) { if (isHandhold2 && exists && num7 == none.Index) { num5 = num7; } else if (!isHandhold2 && exists2 && num7 == none2.Index) { num6 = num7; } else { queuedHits.RemoveAt(num7); if (num5 > num7) { num5--; } if (num6 > num7) { num6--; } } } } if (num5 >= 0 && num6 >= 0) { int num8 = (flag ? num5 : num6); int num9 = (flag ? num6 : num5); if (num8 > num9) { List<HandPhysicsHits> list = queuedHits; int index = num8; int index2 = num9; HandPhysicsHits value = queuedHits[num9]; HandPhysicsHits value2 = queuedHits[num8]; list[index] = value; queuedHits[index2] = value2; } } if (!exists && !exists2) { VRReach.HasLastCastHit[id] = false; VRReach.LastCastHitIsHandhold[id] = false; return; } ReachCandidate reachCandidate = (flag ? none : none2); VRReach.LastCastHitPoint[id] = reachCandidate.Point; VRReach.LastCastHitNormal[id] = reachCandidate.Normal; VRReach.LastCastHitIsHandhold[id] = flag; VRReach.HasLastCastHit[id] = true; } internal static bool GripIsSecondInput() { if (!VRControllerProfile.DualTargetPaths) { return Settings.indexGripGrabsLedges; } return true; } internal static void ResolveGrabExclusivity(int handId, out bool allowHandhold, out bool allowItem) { VRHand vRHand = VRHandInput.Hands[handId]; bool flag = vRHand.Grip.Pressed || vRHand.Grip.Down; bool flag2 = vRHand.Trigger.Pressed || vRHand.Trigger.Down; bool flag3 = GripIsSecondInput(); if (flag3 && flag) { allowHandhold = true; allowItem = false; } else if (flag3 && flag2) { allowHandhold = false; allowItem = true; } else { allowHandhold = true; allowItem = true; } } private static bool TryResolveCandidate(HandPhysicsHits sample, out Vector3 point, out Vector3 normal, out bool isHandhold) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: 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_0025: 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) if (TryResolveHit(sample.directHit, out point, out normal, out isHandhold)) { return true; } if (TryResolveHit(sample.sphereCastHit, out point, out normal, out isHandhold)) { return true; } point = default(Vector3); normal = Vector3.up; isHandhold = false; return false; } private static bool TryResolveHit(RaycastHit hit, out Vector3 point, out Vector3 normal, out bool isHandhold) { //IL_0001: 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_000d: 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_007c: 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_008f: 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_009c: Unknown result type (might be due to invalid IL or missing references) point = default(Vector3); normal = Vector3.up; isHandhold = false; if ((Object)(object)((RaycastHit)(ref hit)).collider == (Object)null) { return false; } ObjectTagger component = ((Component)((RaycastHit)(ref hit)).collider).GetComponent<ObjectTagger>(); if ((Object)(object)component == (Object)null) { return false; } isHandhold = component.HasTag("Handhold"); if (!isHandhold && !component.HasTag("Item")) { return false; } point = (((Object)(object)((Component)((RaycastHit)(ref hit)).collider).GetComponent<MeshCollider>() != (Object)null) ? ((RaycastHit)(ref hit)).point : ((RaycastHit)(ref hit)).collider.ClosestPoint(((RaycastHit)(ref hit)).point)); normal = ((RaycastHit)(ref hit)).normal; return true; } private static bool ColliderIsDisallowed(Collider collider, bool allowHandhold, bool allowItem) { ObjectTagger component = ((Component)collider).GetComponent<ObjectTagger>(); if ((Object)(object)component == (Object)null) { return false; } if (component.HasTag("Handhold") && !allowHandhold) { return true; } if (component.HasTag("Item") && !allowItem) { return true; } return false; } private static bool FilterEntryForExclusivity(ref HandPhysicsHits entry, bool allowHandhold, bool allowItem) { Collider collider = ((RaycastHit)(ref entry.directHit)).collider; if ((Object)(object)collider != (Object)null && ColliderIsDisallowed(collider, allowHandhold, allowItem)) { return false; } Collider collider2 = ((RaycastHit)(ref entry.sphereCastHit)).collider; if ((Object)(object)collider2 != (Object)null && ColliderIsDisallowed(collider2, allowHandhold, allowItem)) { return false; } if (!allowHandhold && entry.lineHit != null) { for (int i = 0; i < entry.lineHitCount; i++) { Collider collider3 = ((RaycastHit)(ref entry.lineHit[i])).collider; if (!((Object)(object)collider3 == (Object)null)) { ObjectTagger component = ((Component)collider3).GetComponent<ObjectTagger>(); if ((Object)(object)component != (Object)null && component.HasTag("Handhold")) { entry.lineHitCount = 0; break; } } } } if (entry.sphereCheck != null) { for (int j = 0; j < entry.sphereCheckCount; j++) { Collider val = entry.sphereCheck[j]; if (!((Object)(object)val == (Object)null) && ColliderIsDisallowed(val, allowHandhold, allowItem)) { entry.sphereCheck[j] = null; } } } return true; } [HarmonyPostfix] [HarmonyPatch(typeof(ENT_Player), "GetInteractDistance")] private static void GetInteractDistance_Postfix(ref float __result) { if (castOverrideActive) { __result = castOverrideDistance; } } [HarmonyPostfix] [HarmonyPatch(typeof(ENT_Player), "InteractSphereRadius")] private static void InteractSphereRadius_Postfix(ref float __result) { if (castOverrideActive) { __result = castOverrideRadius; } } } private class ENT_Player_CrouchHeight_Patch { [HarmonyPrefix] [HarmonyPatch(typeof(ENT_Player), "ChangeHeight")] private static bool ChangeHeight_Prefix(ENT_Player __instance, float targetHeight, ref IEnumerator __result) { //IL_0029: 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_0040: Unknown result type (might be due to invalid IL or missing references) if (!MotionControlsActive) { return true; } if (!Settings.physicalCrouchEnabled) { return true; } __instance.cCon.height = targetHeight; __instance.cCon.center = Vector3.up * (targetHeight - __instance.standingHeight) * 0.5f; __result = NoHeightAnimation(); return false; } private static IEnumerator NoHeightAnimation() { yield break; } } private class ENT_Player_Interact_Patch { [HarmonyPrefix] [HarmonyPatch(typeof(ENT_Player), "Interact")] private static void Interact_Prefix(Interaction interaction) { if (MotionControlsActive && interaction != null && !((Object)(object)interaction.tagger == (Object)null) && interaction.curhand != null && (interaction.tagger.HasTag("Button") || interaction.tagger.HasTag("HoldButton"))) { interaction.fireButton = VRHandButtons.UseName(interaction.curhand.id); } } } private class CL_CameraControl_Patch { [HarmonyPrefix] [HarmonyPatch(typeof(CL_CameraControl), "ShakeCamera", new Type[] { typeof(float) })] private static bool ShakeCamera_Patch(CL_CameraControl __instance, float amount) { return false; } } private class FXManager_Patch { private static int lastBlendedFrame = -1; private static FXData? blendedThisFrame; private static Camera? forwardPlusProxy; private static RenderTexture? forwardPlusProxyTarget; [HarmonyPostfix] [HarmonyPatch(typeof(FXManager), "CameraFX")] private static void CameraFX_Postfix() { if (vrInitialized) { if (lastBlendedFrame != Time.frameCount) { lastBlendedFrame = Time.frameCount; blendedThisFrame = FXManager.fxData; } else if (blendedThisFrame != null) { FXManager.fxData = blendedThisFrame; FXManager.FXRender(); } } } [HarmonyPrefix] [HarmonyPatch(typeof(FXManager), "PreRender")] private static bool PreRender_Patch(FXManager __instance, Camera camera) { //IL_0035: 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_0076: Unknown result type (might be due to invalid IL or missing references) if (!vrInitialized) { return true; } Camera vrCamera = VrCamera; if ((Object)(object)vrCamera == (Object)null || (Object)(object)camera != (Object)(object)vrCamera) { return false; } if (LastSetCameraLocalRotationFrame == Time.frameCount) { float num = Quaternion.Angle(((Component)camera).transform.localRotation, LastSetCameraLocalRotation); if (num > 0.05f) { Debug.LogWarning((object)$"Camera rotation drifted between onPreCull and onPreRender: {num:F3} deg, frame={Time.frameCount}"); } } if (Application.isPlaying) { RunForwardPlusForEye(__instance, vrCamera, camera.stereoActiveEye); } return false; } private static void RunForwardPlusForEye(FXManager manager, Camera vrCamera, MonoOrStereoscopicEye activeEye) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Invalid comparison between Unknown and I4 //IL_0008: 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) //IL_0061: Expected O, but got Unknown //IL_006d: 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_0077: 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_0087: 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_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_009e: 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) //IL_00b0: 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_00bd: Unknown result type (might be due to invalid IL or missing references) StereoscopicEye val = (StereoscopicEye)((int)activeEye == 1); Camera val2 = ResolveForwardPlusProxy(); int eyeTextureWidth = XRSettings.eyeTextureWidth; int eyeTextureHeight = XRSettings.eyeTextureHeight; if (eyeTextureWidth <= 0 || eyeTextureHeight <= 0) { manager.FXForwardPlus(vrCamera); return; } if ((Object)(object)forwardPlusProxyTarget == (Object)null || ((Texture)forwardPlusProxyTarget).width != eyeTextureWidth || ((Texture)forwardPlusProxyTarget).height != eyeTextureHeight) { forwardPlusProxyTarget = new RenderTexture(eyeTextureWidth, eyeTextureHeight, 0, (RenderTextureFormat)16); val2.targetTexture = forwardPlusProxyTarget; } Matrix4x4 stereoViewMatrix = vrCamera.GetStereoViewMatrix(val); Matrix4x4 inverse = ((Matrix4x4)(ref stereoViewMatrix)).inverse; ((Component)val2).transform.SetPositionAndRotation(Vector4.op_Implicit(((Matrix4x4)(ref inverse)).GetColumn(3)), Quaternion.LookRotation(-Vector4.op_Implicit(((Matrix4x4)(ref inverse)).GetColumn(2)), Vector4.op_Implicit(((Matrix4x4)(ref inverse)).GetColumn(1)))); val2.projectionMatrix = vrCamera.GetStereoProjectionMatrix(val); val2.nearClipPlane = vrCamera.nearClipPlane; val2.farClipPlane = vrCamera.farClipPlane; val2.cullingMask = vrCamera.cullingMask; manager.FXForwardPlus(val2); } private static Camera ResolveForwardPlusProxy() { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Expected O, but got Unknown if ((Object)(object)forwardPlusProxy != (Object)null) { return forwardPlusProxy; } GameObject val = new GameObject("VR ForwardPlus Eye Proxy"); Object.DontDestroyOnLoad((Object)(object)val); forwardPlusProxy = val.AddComponent<Camera>(); ((Behaviour)forwardPlusProxy).enabled = false; forwardPlusProxy.stereoTargetEye = (StereoTargetEyeMask)0; return forwardPlusProxy; } } public static VRRenderingPipeline? instance; public static bool vrInitialized = false; public static VRSettings Settings = new VRSettings(); private GameObject? vrCameraOffset; private GameObject? vrCameraGo; private Camera? vrCamera; public static Camera? mainCamera; public static GameObject? mainCameraGo; private GameObject? vrRigGo; private GameObject? clPlayerGo; private GameObject? leftHandGo; private GameObject? rightHandGo; private GameObject? vrLeftHandGo; private GameObject? vrRightHandGo; private readonly bool[] wasGripped = new bool[2]; private readonly Vector3[] handGrabNormal = (Vector3[])(object)new Vector3[2] { Vector3.up, Vector3.up }; private readonly Transform?[] cachedHandModel = (Transform?[])(object)new Transform[2]; private readonly Renderer[]?[] handModelRenderers = new Renderer[2][]; private GameObject? vrLeftHeldItemGo; private GameObject? vrRightHeldItemGo; private readonly HandItem?[] attachedHandItem = (HandItem?[])(object)new HandItem[2]; private readonly Vector3[] attachedHandItemVanillaLocalScale = (Vector3[])(object)new Vector3[2]; private readonly float[] attachedHandItemVanillaToVrScale = new float[2]; private VRItemAimBeam? leftItemAimBeam; private VRItemAimBeam? rightItemAimBeam; private VRBagPlacementMarker? leftPlacementMarker; private VRBagPlacementMarker? rightPlacementMarker; private GameObject? vrLeftInteractIconGo; private GameObject? vrRightInteractIconGo; private GameObject? vrLeftSecondaryIconGo; private GameObject? vrRightSecondaryIconGo; private const float INDICATOR_SURFACE_LIFT = 0.03f; private const float INDICATOR_ANGULAR_SIZE = 0.11f; private const float INDICATOR_MIN_SIZE = 0.05f; private const float INDICATOR_MAX_SIZE = 0.28f; private readonly List<CanvasGroup> menuCanvasGroups = new List<CanvasGroup>(); private readonly List<Canvas> convertedCanvasRoots = new List<Canvas>(); private Vector3 menuHeadPositionReference = Vector3.zero; private bool menuHeadReferenceCaptured; private static float locomotionYaw = 0f; public static Quaternion CanonicalHeadRotation = Quaternion.identity; public static int CanonicalHeadRotationFrame = -1; private Quaternion lastKnownHeadRotation = Quaternion.identity; private bool pauseMenuWasOpen; private static bool spawnYawAligned; public static Quaternion LastSetCameraLocalRotation = Quaternion.identity; public static int LastSetCameraLocalRotationFrame = -1; private const int MaxVRInitAttempts = 5; private float lastMenuCanvasGroupCacheTime; private static bool menuCanvasGroupCacheDirty = false; private bool menuWasVisible; private int menuCanvasGroupCleanScans; private static readonly HashSet<CanvasGroup> forcedVisibleMenuCanvasGroups = new HashSet<CanvasGroup>(); private const string ViewmodelOverlayLayerName = "Overlay"; private int baseWorldCullingMask; private const string ViewmodelHandLayerName = "Player"; public static CameraClearFlags vanillaClearFlags = (CameraClearFlags)2; public static Color vanillaBackgroundColor = Color.black; private static bool vanillaClearCaptured; private const float StrayCameraSettleInterval = 0.25f; private const int StrayCameraScansToSettle = 3; private readonly HashSet<int> suppressedStereoCameraIds = new HashSet<int>(); private float lastStrayCameraSweepTime; private Camera[] strayCameraBuffer = (Camera[])(object)new Camera[8]; private int lastSeenCameraCount = -1; private int strayCameraCleanScans; private bool strayCameraSweepSettled; private Camera? suppressedOverlayCamera; private readonly HashSet<int> suppressedEffectCameraIds = new HashSet<int>(); private bool overlayUiManagerConverted; private Transform? abilityVignettesRoot; private bool wasPlayerDeadForVignetteReset; private static bool hookedMenuRecenter = false; private bool snapTurnReady = true; private static Vector3 previousFixedPlayerPosition = Vector3.zero; private static Vector3 currentFixedPlayerPosition = Vector3.zero; private static bool hasFixedPlayerPositionSample = false; private static Vector3 previousFixedHeadPlayspacePosition = Vector3.zero; private static bool hasFixedHeadPlayspaceSample = false; private static float observedMaxMovementSpeed = 0f; private static float stickSpeedLastTick = 0f; private static Vector3 standingCamTargetLocalPosition; private static bool hasStandingCamTarget; private static bool loggedCamTargetCorrection; private VRLaserPointer? leftLaser; private VRLaserPointer? rightLaser; private readonly bool[] handWasTracked = new bool[2]; private static readonly string[] GripGrabsWhileHeldItemNameContains = new string[1] { "glove" }; public static bool MotionControlsActive { get { if (vrInitialized) { return Settings.useMotionControls; } return false; } } private ManualLogSource Logger => ((BaseUnityPlugin)this).Logger; public static ManualLogSource? StaticLogger => instance?.Logger; public static Camera? VrCamera => instance?.vrCamera; public static Transform? VrLeftHand { get { VRRenderingPipeline? vRRenderingPipeline = instance; if (vRRenderingPipeline == null) { return null; } GameObject? obj = vRRenderingPipeline.vrLeftHandGo; if (obj == null) { return null; } return obj.transform; } } public static Transform? VrRightHand { get { VRRenderingPipeline? vRRenderingPipeline = instance; if (vRRenderingPipeline == null) { return null; } GameObject? obj = vRRenderingPipeline.vrRightHandGo; if (obj == null) { return null; } return obj.transform; } } public static bool MenuOpen { get { //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) if (!((Object)(object)CL_GameManager.gMan != (Object)null) || !CL_GameManager.gMan.isPaused) { Scene activeScene = SceneManager.GetActiveScene(); return ((Scene)(ref activeScene)).name == Scenes.MainMenu; } return true; } } private void ApplyHarmonyPatches() { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Expected O, but got Unknown Logger.LogInfo((object)"Applying Harmony Patches"); HarmonyFileLog.Enabled = true; Harmony val = new Harmony("com.whiteknucklevr.harmonypatcher"); val.PatchAll(typeof(CL_CameraControl_Patch)); val.PatchAll(typeof(ENT_Player_Patch)); val.PatchAll(typeof(ENT_Player_Hand_Patch)); val.PatchAll(typeof(ENT_Player_Interact_Patch)); val.PatchAll(typeof(FXManager_Patch)); val.PatchAll(typeof(Inventory_Patch)); val.PatchAll(typeof(InputManager_Patch)); val.PatchAll(typeof(CL_Handhold_Patch)); val.PatchAll(typeof(M_Level_Patch)); val.PatchAll(typeof(CL_HoldLever_Patch)); val.PatchAll(typeof(CL_Prop_Patch)); val.PatchAll(typeof(UT_CameraTakeover_Patch)); val.PatchAll(typeof(HandItem_Aim_Patch)); val.PatchAll(typeof(ViewSway_Patch)); val.PatchAll(typeof(Hand_Takeover_Patch)); val.PatchAll(typeof(HandItem_LateUpdate_Patch)); val.PatchAll(typeof(Message_Manager_Patch)); val.PatchAll(typeof(Inventory_ShowInventory_Patch)); val.PatchAll(typeof(Item_Object_Flashlight_Patch)); val.PatchAll(typeof(CosmeticInfoPanel_Patch)); val.PatchAll(typeof(SubmitSlider_Patch)); IEnumerable<MethodBase> patchedMethods = val.GetPatchedMethods(); foreach (MethodBase item in patchedMethods) { if (item != null && Settings.verboseLogging) { Logger.LogInfo((object)$"Patched method: {item.DeclaringType}.{item.Name}"); } } } private void Awake() { if ((Object)(object)instance != (Object)null) { Object.Destroy((Object)(object)this); return; } Settings = VRSettingsManager.Load(Logger); if (!Settings.activateVR) { Logger.LogWarning((object)"activateVR is false in VRToggle.json - running the game unmodified. Set it back to true and relaunch to re-enable VR."); ((Behaviour)this).enabled = false; return; } BepInExConfigGuard.EnsureManagerObjectHidden(Logger); VRDataFolderGuard.EnsureRedistFilesPresent(Logger); XRLibraryInjector.ForceLoadDLLs(Logger); instance = this; Object.DontDestroyOnLoad((Object)(object)this); } private void Start() { //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Expected O, but got Unknown //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Expected O, but got Unknown Logger.LogInfo((object)"VR Mod Starting"); ApplyHarmonyPatches(); SceneManager.sceneLoaded += OnSceneLoaded; SceneManager.sceneUnloaded += OnSceneUnloaded; Camera.onPreCull = (CameraCallback)Delegate.Combine((Delegate?)(object)Camera.onPreCull, (Delegate?)new CameraCallback(ApplyFreshestHeadRotation)); SuppressStereoCameras(); ((MonoBehaviour)this).StartCoroutine(InitializeVR()); ((MonoBehaviour)this).StartCoroutine(SuppressVisualsUntilMainMenu()); } private void SuppressStereoCameras() { Camera[] allCameras = Camera.allCameras; foreach (Camera val in allCameras) { val.stereoTargetEye = (StereoTargetEyeMask)0; } } private void ApplyFreshestHeadRotation(Camera cam) { //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) if (!((Object)(object)cam != (Object)(object)vrCamera) && vrInitialized && !((Object)(object)vrCameraGo == (Object)null)) { LastSetCameraLocalRotation = vrCameraGo.transform.localRotation; LastSetCameraLocalRotationFrame = Time.frameCount; } } private void UpdateCanonicalHeadRotation() { //IL_0009: 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_0011: 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_0044: 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_0020: 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_0027: Unknown result type (might be due to invalid IL or missing references) if (vrInitialized) { InputDevice deviceAtXRNode = InputDevices.GetDeviceAtXRNode((XRNode)3); Quaternion canonicalHeadRotation = default(Quaternion); if (((InputDevice)(ref deviceAtXRNode)).TryGetFeatureValue(CommonUsages.deviceRotation, ref canonicalHeadRotation)) { CanonicalHeadRotation = canonicalHeadRotation; lastKnownHeadRotation = canonicalHeadRotation; } else { Logger.LogWarning((object)"UpdateCanonicalHeadRotation: TryGetFeatureValue(deviceRotation) failed; keeping last known head rotation for this frame."); CanonicalHeadRotation = lastKnownHeadRotation; } CanonicalHeadRotationFrame = Time.frameCount; } } private void RecentreMenusWhenPauseOpens() { //IL_0064: 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_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_0085: 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) //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_00b8: 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_00bb: 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_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: 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_010a: 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) bool flag = (Object)(object)CL_GameManager.gMan != (Object)null && CL_GameManager.gMan.isPaused; if (flag == pauseMenuWasOpen) { return; } pauseMenuWasOpen = flag; if (!flag || (Object)(object)vrRigGo == (Object)null || (Object)(object)vrCameraGo == (Object)null) { return; } Transform transform = vrRigGo.transform; Vector3 val = transform.InverseTransformPoint(vrCameraGo.transform.position); Vector3 val2 = transform.InverseTransformDirection(vrCameraGo.transform.forward); val2.y = 0f; if (((Vector3)(ref val2)).sqrMagnitude < 0.0001f) { val2 = Vector3.forward; } ((Vector3)(ref val2)).Normalize(); Quaternion localRotation = Quaternion.LookRotation(val2, Vector3.up); Vector3 localPosition = val + val2 * 1.8f; foreach (Canvas convertedCanvasRoot in convertedCanvasRoots) { if (!((Object)(object)convertedCanvasRoot == (Object)null) && !((Object)(object)((Component)convertedCanvasRoot).transform.parent != (Object)(object)transform)) { ((Component)convertedCanvasRoot).transform.localRotation = localRotation; ((Component)convertedCanvasRoot).transform.localPosition = localPosition; } } } private void FollowMenusWithLookYaw() { //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_005a: 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_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_0094: Unknown result type (might be due to invalid IL or missing references) //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_009f: 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_012f: 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) //IL_0138: Unknown result type (might be due to invalid IL or missing references) //IL_0184: 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_0192: Unknown result type (might be due to invalid IL or missing references) //IL_01a0: 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_01a3: Unknown result type (might be due to invalid IL or missing references) //IL_01a8: Unknown result type (might be due to invalid IL or missing references) //IL_01b2: Unknown result type (might be due to invalid IL or missing references) //IL_01b7: Unknown result type (might be due to invalid IL or missing references) if (!Settings.menuFollowYaw || (Object)(object)vrRigGo == (Object)null || (Object)(object)vrCameraGo == (Object)null || convertedCanvasRoots.Count == 0) { return; } Transform transform = vrRigGo.transform; Vector3 val = transform.InverseTransformPoint(vrCameraGo.transform.position); Vector3 val2 = transform.InverseTransformDirection(vrCameraGo.transform.forward); val2.y = 0f; if (((Vector3)(ref val2)).sqrMagnitude < 0.0001f) { return; } ((Vector3)(ref val2)).Normalize(); Quaternion val3 = Quaternion.LookRotation(val2, Vector3.up); float y = ((Quaternion)(ref val3)).eulerAngles.y; float menuFollowYawDeadzoneDegrees = Settings.menuFollowYawDeadzoneDegrees; float num = 1f - Mathf.Exp((0f - Settings.menuFollowSpeed) * Time.unscaledDeltaTime); foreach (Canvas convertedCanvasRoot in convertedCanvasRoots) { if (!((Object)(object)convertedCanvasRoot == (Object)null) && !((Object)(object)((Component)convertedCanvasRoot).transform.parent != (Object)(object)transform) && ((Component)convertedCanvasRoot).gameObject.activeInHierarchy) { val3 = ((Component)convertedCanvasRoot).transform.localRotation; float y2 = ((Quaternion)(ref val3)).eulerAngles.y; float num2 = Mathf.DeltaAngle(y2, y); float num3 = y2; if (Mathf.Abs(num2) > menuFollowYawDeadzoneDegrees) { float num4 = y - Mathf.Sign(num2) * menuFollowYawDeadzoneDegrees; num3 = Mathf.LerpAngle(y2, num4, num); } Quaternion val4 = Quaternion.Euler(0f, num3, 0f); ((Component)convertedCanvasRoot).transform.localRotation = val4; ((Component)convertedCanvasRoot).transform.localPosition = val + val4 * Vector3.forward * 1.8f; } } } private void UpdateLocomotionYaw() { //IL_0066: 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_006b: 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_0087: 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) if (!vrInitialized || (Object)(object)clPlayerGo == (Object)null || ((Object)(object)CL_GameManager.gMan != (Object)null && CL_GameManager.gMan.isPaused)) { return; } VRHand turnHand = VRHandInput.TurnHand; bool flag = VRVirtualGamepad.VrIsActive && turnHand.IsTracked; Gamepad val = VRVirtualGamepad.ActiveDevice ?? Gamepad.current; Vector2 val2 = ((val != null) ? ((InputControl<Vector2>)(object)val.rightStick).ReadValue() : Vector2.zero); float num = (flag ? turnHand.Stick.x : val2.x); float stickY = (flag ? turnHand.Stick.y : val2.y); VRLookOffset.Advance(stickY, Mathf.Min(Time.deltaTime, 1f / 90f)); if (!(Settings.turnStyle == "disabled")) { if (Settings.turnStyle == "snap") { DebounceSnapTurn(num); return; } float num2 = (flag ? 0f : (((InputControl<Vector2>)(object)((Pointer)Mouse.current).delta).ReadValue().x * 0.05f)); float num3 = ((Mathf.Abs(num2) > Mathf.Abs(num)) ? num2 : num); float num4 = Mathf.Min(Time.deltaTime, 1f / 90f); locomotionYaw += num3 * Settings.smoothTurnSpeed * num4; } } public static void AlignLocomotionYawToSpawnOnce(ENT_Player player, float hmdYaw) { //IL_001d: 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_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) if (!spawnYawAligned && !((Object)(object)player == (Object)null)) { spawnYawAligned = true; float num = MathUtils.RotationAroundAxis(((Component)player).transform.rotation, Vector3.up); locomotionYaw = Mathf.DeltaAngle(hmdYaw, num); if ((Object)(object)instance != (Object)null && (Object)(object)instance.vrRigGo != (Object)null) { instance.vrRigGo.transform.rotation = Quaternion.AngleAxis(locomotionYaw, Vector3.up); } } } private void ResetLocomotionYaw() { //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) locomotionYaw = 0f; spawnYawAligned = false; VRLookOffset.Reset(); if ((Object)(object)vrRigGo != (Object)null) { vrRigGo.transform.rotation = Quaternion.AngleAxis(locomotionYaw, Vector3.up); } ResetHeadsetMovementBaseline(); } private IEnumerator InitializeVR() { int attempt = 0; while (!XRSettings.isDeviceActive) { attempt++; yield return VRDeviceLoader.InitializeXRSubsystems(Logger, useSinglePassInstanced: false); if (!XRSettings.isDeviceActive) { if (attempt >= 5) { Logger.LogError((object)$"No active XR runtime detected after {attempt} attempts; giving up and staying in flatscreen mode."); yield break; } Logger.LogWarning((object)$"No active XR runtime detected; retrying in 5s (attempt {attempt}/{5})"); yield return (object)new WaitForSeconds(5f); } } XRSettings.eyeTextureResolutionScale = Settings.renderScale; QualitySettings.vSyncCount = 0; Application.targetFrameRate = -1; Logger.LogInfo((object)$"XR active: {XRSettings.isDeviceActive}"); Logger.LogInfo((object)("XR active device name: " + XRSettings.loadedDeviceName)); InitializeVRCamera(); vrInitialized = true; Scene activeScene = SceneManager.GetActiveScene(); bool inGameMain = ((Scene)(ref activeScene)).name == Scenes.GameMain || ((Scene)(ref activeScene)).name == Scenes.Playground; ((MonoBehaviour)this).StartCoroutine(InjectVRCamera(inGameMain)); } private IEnumerator SuppressVisualsUntilMainMenu() { yield return (object)new WaitUntil((Func<bool>)(() => (Object)(object)vrCamera != (Object)null)); while (true) { Scene val = SceneManager.GetActiveScene(); if (!(((Scene)(ref val)).name != Scenes.MainMenu)) { break; } Canvas[] array = Resources.FindObjectsOfTypeAll<Canvas>(); foreach (Canvas val2 in array) { val = ((Component)val2).gameObject.scene; if (((Scene)(ref val)).IsValid() && ((Behaviour)val2).enabled) { ((Behaviour)val2).enabled = false; } } yield return null; } baseWorldCullingMask = -1; ApplyMergedCullingMask(); Logger.LogInfo((object)"Loading Main Menu"); } private static bool IsRelevantMenuScene(Scene scene, Scene activeScene) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) if (!((Scene)(ref scene)).IsValid()) { return false; } if (!(scene == activeScene)) { return ((Scene)(ref scene)).name == "DontDestroyOnLoad"; } return true; } private void CacheMenuCanvasGroups() { //IL_000b: Unknown result type (might be due to invalid IL or missing