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.Versioning; using System.Security.Cryptography; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using HarmonyLib; using ItemShareFix.Core; using Microsoft.CodeAnalysis; using RoR2; using TMPro; using UnityEngine; using UnityEngine.EventSystems; using UnityEngine.Networking; using UnityEngine.SceneManagement; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("ItemShareFix")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("ItemShareFix")] [assembly: AssemblyTitle("ItemShareFix")] [assembly: AssemblyVersion("1.0.0.0")] 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; } } } namespace ItemShareFix { internal sealed class LocalPickupPresentationGate : MonoBehaviour { private readonly Dictionary _renderers = new Dictionary(); private readonly Dictionary _lights = new Dictionary(); private readonly Dictionary _visualBehaviours = new Dictionary(); private bool _hidden; public void ApplyHidden() { _hidden = true; RefreshAndApply(); } public void Restore() { _hidden = false; KeyValuePair[] array = _renderers.ToArray(); for (int i = 0; i < array.Length; i++) { KeyValuePair keyValuePair = array[i]; if ((Object)(object)keyValuePair.Key != (Object)null) { keyValuePair.Key.forceRenderingOff = keyValuePair.Value; } } KeyValuePair[] array2 = _lights.ToArray(); for (int i = 0; i < array2.Length; i++) { KeyValuePair keyValuePair2 = array2[i]; if ((Object)(object)keyValuePair2.Key != (Object)null) { ((Behaviour)keyValuePair2.Key).enabled = keyValuePair2.Value; } } KeyValuePair[] array3 = _visualBehaviours.ToArray(); for (int i = 0; i < array3.Length; i++) { KeyValuePair keyValuePair3 = array3[i]; if ((Object)(object)keyValuePair3.Key != (Object)null) { keyValuePair3.Key.enabled = keyValuePair3.Value; } } _renderers.Clear(); _lights.Clear(); _visualBehaviours.Clear(); } public void RefreshAndApply() { if (!_hidden) { return; } Renderer[] componentsInChildren = ((Component)this).GetComponentsInChildren(true); foreach (Renderer val in componentsInChildren) { if (!((Object)(object)val == (Object)null)) { if (!_renderers.ContainsKey(val)) { _renderers[val] = val.forceRenderingOff; } val.forceRenderingOff = true; } } Light[] componentsInChildren2 = ((Component)this).GetComponentsInChildren(true); foreach (Light val2 in componentsInChildren2) { if (!((Object)(object)val2 == (Object)null)) { if (!_lights.ContainsKey(val2)) { _lights[val2] = ((Behaviour)val2).enabled; } ((Behaviour)val2).enabled = false; } } Behaviour[] componentsInChildren3 = ((Component)this).GetComponentsInChildren(true); foreach (Behaviour val3 in componentsInChildren3) { if (!((Object)(object)val3 == (Object)null) && !(val3 is Light) && IsPresentationOnlyBehaviour(((object)val3).GetType().FullName ?? ((object)val3).GetType().Name)) { if (!_visualBehaviours.ContainsKey(val3)) { _visualBehaviours[val3] = val3.enabled; } val3.enabled = false; } } PruneDestroyed(); } private static bool IsPresentationOnlyBehaviour(string typeName) { if (typeName.IndexOf("Highlight", StringComparison.OrdinalIgnoreCase) < 0 && typeName.IndexOf("VisualEffect", StringComparison.OrdinalIgnoreCase) < 0) { return typeName.IndexOf("PickupDisplayGlow", StringComparison.OrdinalIgnoreCase) >= 0; } return true; } private void PruneDestroyed() { Renderer[] array = _renderers.Keys.Where((Renderer x) => (Object)(object)x == (Object)null).ToArray(); foreach (Renderer key in array) { _renderers.Remove(key); } Light[] array2 = _lights.Keys.Where((Light x) => (Object)(object)x == (Object)null).ToArray(); foreach (Light key2 in array2) { _lights.Remove(key2); } Behaviour[] array3 = _visualBehaviours.Keys.Where((Behaviour x) => (Object)(object)x == (Object)null).ToArray(); foreach (Behaviour key3 in array3) { _visualBehaviours.Remove(key3); } } private void OnDestroy() { if (_hidden) { Restore(); } } } internal sealed class LocalCommandPresentationGate : MonoBehaviour { private readonly Dictionary _renderers = new Dictionary(); private readonly Dictionary _lights = new Dictionary(); private readonly Dictionary _visualBehaviours = new Dictionary(); private bool _hidden; public bool IsHidden => _hidden; public void ApplyHidden() { _hidden = true; RefreshAndApply(); } public void Restore() { _hidden = false; KeyValuePair[] array = _renderers.ToArray(); for (int i = 0; i < array.Length; i++) { KeyValuePair keyValuePair = array[i]; if ((Object)(object)keyValuePair.Key != (Object)null) { keyValuePair.Key.forceRenderingOff = keyValuePair.Value; } } KeyValuePair[] array2 = _lights.ToArray(); for (int i = 0; i < array2.Length; i++) { KeyValuePair keyValuePair2 = array2[i]; if ((Object)(object)keyValuePair2.Key != (Object)null) { ((Behaviour)keyValuePair2.Key).enabled = keyValuePair2.Value; } } KeyValuePair[] array3 = _visualBehaviours.ToArray(); for (int i = 0; i < array3.Length; i++) { KeyValuePair keyValuePair3 = array3[i]; if ((Object)(object)keyValuePair3.Key != (Object)null) { keyValuePair3.Key.enabled = keyValuePair3.Value; } } _renderers.Clear(); _lights.Clear(); _visualBehaviours.Clear(); } public void RefreshAndApply() { if (!_hidden) { return; } Renderer[] componentsInChildren = ((Component)this).GetComponentsInChildren(true); foreach (Renderer val in componentsInChildren) { if (!((Object)(object)val == (Object)null)) { if (!_renderers.ContainsKey(val)) { _renderers[val] = val.forceRenderingOff; } val.forceRenderingOff = true; } } Light[] componentsInChildren2 = ((Component)this).GetComponentsInChildren(true); foreach (Light val2 in componentsInChildren2) { if (!((Object)(object)val2 == (Object)null)) { if (!_lights.ContainsKey(val2)) { _lights[val2] = ((Behaviour)val2).enabled; } ((Behaviour)val2).enabled = false; } } Behaviour[] componentsInChildren3 = ((Component)this).GetComponentsInChildren(true); foreach (Behaviour val3 in componentsInChildren3) { if (!((Object)(object)val3 == (Object)null) && !(val3 is Light) && !(val3 is PickupPickerController) && !(val3 is NetworkBehaviour) && IsPresentationOnlyBehaviour(((object)val3).GetType().FullName ?? ((object)val3).GetType().Name)) { if (!_visualBehaviours.ContainsKey(val3)) { _visualBehaviours[val3] = val3.enabled; } val3.enabled = false; } } PruneDestroyed(); } private static bool IsPresentationOnlyBehaviour(string typeName) { if (typeName.IndexOf("Highlight", StringComparison.OrdinalIgnoreCase) < 0 && typeName.IndexOf("VisualEffect", StringComparison.OrdinalIgnoreCase) < 0) { return typeName.IndexOf("PickupDisplayGlow", StringComparison.OrdinalIgnoreCase) >= 0; } return true; } private void PruneDestroyed() { Renderer[] array = _renderers.Keys.Where((Renderer x) => (Object)(object)x == (Object)null).ToArray(); foreach (Renderer key in array) { _renderers.Remove(key); } Light[] array2 = _lights.Keys.Where((Light x) => (Object)(object)x == (Object)null).ToArray(); foreach (Light key2 in array2) { _lights.Remove(key2); } Behaviour[] array3 = _visualBehaviours.Keys.Where((Behaviour x) => (Object)(object)x == (Object)null).ToArray(); foreach (Behaviour key3 in array3) { _visualBehaviours.Remove(key3); } } private void OnDestroy() { if (_hidden) { Restore(); } } } internal sealed class PersonalPickupMarker { public int InstanceId { get; set; } public GenericPickupController Pickup { get; set; } public string Label { get; set; } = string.Empty; public string ItemSemanticKey { get; set; } = string.Empty; public string ClassName { get; set; } = "UNKNOWN"; public MarkerClassKind Kind { get; set; } public Color TextColor { get; set; } = Color.white; public MarkerLifetimeKind Lifetime { get; set; } } internal sealed class PersonalCommandMarker { public int InstanceId { get; set; } public PickupPickerController Picker { get; set; } public string Label { get; set; } = string.Empty; public string ItemSemanticKey { get; set; } = string.Empty; public string ClassName { get; set; } = "UNKNOWN"; public MarkerClassKind Kind { get; set; } public Color TextColor { get; set; } = Color.white; public MarkerLifetimeKind Lifetime { get; set; } = (MarkerLifetimeKind)3; } internal readonly struct MarkerRuntimeMetadata { public MarkerClassKind Kind { get; } public string ClassName { get; } public string Label { get; } public Color TextColor { get; } public bool ExactClass { get; } public MarkerRuntimeMetadata(MarkerClassKind kind, string className, string label, Color textColor, bool exactClass) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) Kind = kind; ClassName = className; Label = label; TextColor = textColor; ExactClass = exactClass; } } internal sealed class ClientPresentationCoordinator { private readonly PluginConfig _config; private readonly UpstreamBridge _upstream; private readonly ManualLogSource _log; private readonly Dictionary _gates = new Dictionary(); private readonly Dictionary _commandGates = new Dictionary(); private readonly Dictionary _localCommandGateDiagnosticState = new Dictionary(); private readonly Dictionary _localPickupVisualDiagnosticState = new Dictionary(); private readonly Dictionary _localPickupInteractionDiagnosticState = new Dictionary(); private readonly HashSet _upstreamVisibilityGateObserved = new HashSet(); private readonly List _markers = new List(); private readonly List _commandMarkers = new List(); private readonly PersonalMarkerRegistry _markerRegistry = new PersonalMarkerRegistry(96); private readonly HashSet _ordinaryRenderLogged = new HashSet(); private readonly Dictionary _commandRemovalReasons = new Dictionary(); private readonly HashSet _commandOptionDisagreementLogged = new HashSet(); private readonly HashSet _commandLifetimeUnknownLogged = new HashSet(); private readonly Dictionary _commandShareabilityDiagnosticState = new Dictionary(); private float _nextSweep; private int _lastStageToken = int.MinValue; private int _localMastersFrame = -1; private CharacterMaster[] _cachedLocalMasters = Array.Empty(); private bool _refreshRequested; private int _upstreamNormalizationDepth; private readonly MarkerRuntimePerformanceCounters _performance = new MarkerRuntimePerformanceCounters(); private readonly NativeHudMarkerRenderer _hudRenderer; private readonly Dictionary _markerProjectionDiagnosticState = new Dictionary(); private readonly LocalHudPresentationProbe _localHudProbe; private readonly List _dynamicHudZones = new List(1); private readonly List _renderInputs = new List(96); private bool? _modalHudSuppressionDiagnosticState; private string _modalHudSuppressionReason = string.Empty; private bool? _messageHudDiagnosticState; private bool _hasMessageHudDiagnosticRect; private MarkerHudRect _messageHudDiagnosticRect; private Camera? _presentationCamera; private float _nextPresentationCameraRefresh; private float _nextPerformanceSummary; private int _lastPerformanceMarkerCount; public ClientPresentationCoordinator(PluginConfig config, UpstreamBridge upstream, ManualLogSource log) { //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Expected O, but got Unknown //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Expected O, but got Unknown _config = config; _upstream = upstream; _log = log; _localHudProbe = new LocalHudPresentationProbe(_performance); _hudRenderer = new NativeHudMarkerRenderer(log, _performance); _config.MarkerPresentationSettingChanged += OnMarkerPresentationSettingChanged; _log.LogInfo((object)"ISF_MARKER_WORLD_CLUSTER_CONFIG merge=4.50 split=6.00 dwell=0.35 solve=0.20"); } private void OnMarkerPresentationSettingChanged(object? sender, EventArgs args) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) _hudRenderer.InvalidatePresentationSettings(_config.MarkerSettingsSnapshot(), _config.MarkerVisualSettingsSnapshot()); if (sender == _config.PersonalMarkersEnabled) { if (!_config.PersonalMarkersEnabled.Value) { _hudRenderer.Clear(); } RequestRefresh(); } else if (sender == _config.ShareTemporaryItems) { RequestRefresh(); } } public void RecordUnityUpdate() { _performance.RecordUnityUpdate(); } public void RequestRefresh() { _refreshRequested = true; } public void OnBlockingModalLifecycleObserved(Component component) { _localHudProbe.ObserveBlockingModalLifecycle(component); } public bool TryEvaluateLocalCollected(GenericPickupController pickup, out bool collectedByAllLocalParticipants) { collectedByAllLocalParticipants = false; if (!_config.Enabled.Value || !_config.PersonalPickupVisibilityRepairEnabled.Value || !_upstream.IsIndividualMode || !_upstream.HideCollectedOrbsEnabled || (Object)(object)pickup == (Object)null || !_upstream.IsShareable(pickup)) { return false; } CharacterMaster[] localMastersSnapshot = GetLocalMastersSnapshot(); if (localMastersSnapshot.Length == 0) { return false; } collectedByAllLocalParticipants = localMastersSnapshot.All((CharacterMaster master) => _upstream.HasCollected(pickup, master)); return true; } public bool ShouldSuppressLocalPickupInteraction(GenericPickupController pickup, Interactor interactor) { if (!_config.Enabled.Value || !_config.PersonalPickupVisibilityRepairEnabled.Value || !_upstream.IsIndividualMode || !_upstream.HideCollectedOrbsEnabled || (Object)(object)pickup == (Object)null || (Object)(object)interactor == (Object)null) { return false; } bool flag = _upstream.IsShareable(pickup); CharacterBody component = ((Component)interactor).GetComponent(); if ((Object)(object)component == (Object)null || (Object)(object)component.master == (Object)null) { return false; } CharacterMaster master = component.master; bool hasAuthority = ((NetworkBehaviour)master).hasAuthority; bool flag2 = hasAuthority && _upstream.HasCollected(pickup, master); bool flag3 = LocalPickupSuppressionPolicy.ShouldSuppressInteractor(true, true, flag, hasAuthority, flag2); if (hasAuthority) { LogLocalInteractionGateTransition(pickup, master, flag2, flag3); } return flag3; } public void OnUpstreamVisibilityApplied(GenericPickupController pickup) { if ((Object)(object)pickup == (Object)null || _upstreamNormalizationDepth > 0) { return; } int instanceID = ((Object)pickup).GetInstanceID(); if (!TryEvaluateLocalCollected(pickup, out var collectedByAllLocalParticipants)) { ReleaseGate(instanceID); RequestRefresh(); return; } if (!collectedByAllLocalParticipants) { ReleaseGate(instanceID); return; } NormalizeUpstreamForGate(pickup); if (!_gates.TryGetValue(instanceID, out LocalPickupPresentationGate value) || (Object)(object)value == (Object)null) { value = ((Component)pickup).gameObject.GetComponent() ?? ((Component)pickup).gameObject.AddComponent(); _gates[instanceID] = value; } value.ApplyHidden(); if (_config.DiagnosticLogging.Value && _upstreamVisibilityGateObserved.Add(instanceID)) { LogInfo("ISF_C20_LOCAL_PICKUP_GATE pickup=" + instanceID.ToString(CultureInfo.InvariantCulture) + " localMaster=process localCollected=all visualSuppressed=true interactionSuppressed=participant-specific action=upstream-visibility-applied reason=all-local-collected"); } } public void Tick() { int num = CurrentStageToken(); if (num != _lastStageToken) { RestoreAll("stage-or-run-boundary"); _localHudProbe.InvalidateLifecycle(); _presentationCamera = null; _nextPresentationCameraRefresh = 0f; _lastStageToken = num; _refreshRequested = true; } if (_refreshRequested || !(Time.unscaledTime < _nextSweep)) { _refreshRequested = false; _nextSweep = Time.unscaledTime + Math.Max(0.08f, _config.PresentationSweepSeconds.Value); Sweep(); } } public void RenderFrame() { //IL_0180: 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_01eb: Unknown result type (might be due to invalid IL or missing references) //IL_01ed: Unknown result type (might be due to invalid IL or missing references) //IL_020f: Unknown result type (might be due to invalid IL or missing references) //IL_024e: Unknown result type (might be due to invalid IL or missing references) //IL_0253: Unknown result type (might be due to invalid IL or missing references) //IL_0298: Unknown result type (might be due to invalid IL or missing references) //IL_029a: Unknown result type (might be due to invalid IL or missing references) //IL_02c1: 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_02c8: Unknown result type (might be due to invalid IL or missing references) //IL_02d2: Unknown result type (might be due to invalid IL or missing references) //IL_02d7: Unknown result type (might be due to invalid IL or missing references) //IL_02e5: Unknown result type (might be due to invalid IL or missing references) //IL_02fc: Unknown result type (might be due to invalid IL or missing references) //IL_0303: Unknown result type (might be due to invalid IL or missing references) //IL_0316: Unknown result type (might be due to invalid IL or missing references) //IL_0423: Unknown result type (might be due to invalid IL or missing references) //IL_0433: Unknown result type (might be due to invalid IL or missing references) //IL_0375: Unknown result type (might be due to invalid IL or missing references) //IL_0377: Unknown result type (might be due to invalid IL or missing references) //IL_039e: Unknown result type (might be due to invalid IL or missing references) //IL_03a3: Unknown result type (might be due to invalid IL or missing references) //IL_03a5: Unknown result type (might be due to invalid IL or missing references) //IL_03af: Unknown result type (might be due to invalid IL or missing references) //IL_03b4: Unknown result type (might be due to invalid IL or missing references) //IL_03bd: Unknown result type (might be due to invalid IL or missing references) //IL_03c2: Unknown result type (might be due to invalid IL or missing references) //IL_03d9: Unknown result type (might be due to invalid IL or missing references) //IL_03e0: Unknown result type (might be due to invalid IL or missing references) //IL_03e8: Unknown result type (might be due to invalid IL or missing references) _performance.RecordRenderFrame(); bool flag = _config.Enabled.Value && _config.PersonalMarkersEnabled.Value && (_markers.Count > 0 || _commandMarkers.Count > 0); if (!flag) { if (_lastPerformanceMarkerCount > 0) { EmitPerformanceSummary("marker-teardown", 0, force: true); } _lastPerformanceMarkerCount = 0; _hudRenderer.SetPresentationSuppressed(suppressed: false); _hudRenderer.Clear(); return; } MaybeEmitPerformanceSummary(_lastPerformanceMarkerCount = _markers.Count + _commandMarkers.Count); string reason; bool flag2 = _localHudProbe.TryGetBlockingModal(out reason); if (!_modalHudSuppressionDiagnosticState.HasValue || _modalHudSuppressionDiagnosticState.Value != flag2 || (flag2 && !string.Equals(_modalHudSuppressionReason, reason, StringComparison.Ordinal))) { _modalHudSuppressionDiagnosticState = flag2; _modalHudSuppressionReason = reason; LogInfo("ISF_MARKER_HUD_SUPPRESS reason=" + (flag2 ? reason : "pause-menu") + " active=" + flag2); } _hudRenderer.SetPresentationSuppressed(flag2); if (!MarkerPresentationPolicy.ShouldRenderHudMarkers(flag, flag2)) { return; } _dynamicHudZones.Clear(); MarkerHudRect rect; bool flag3 = _localHudProbe.TryGetVisibleMessageHudRect(out rect); if (flag3) { _dynamicHudZones.Add(new MarkerHudExclusionZone("message-hud-runtime", ((MarkerHudRect)(ref rect)).Left, ((MarkerHudRect)(ref rect)).Right, ((MarkerHudRect)(ref rect)).Bottom, ((MarkerHudRect)(ref rect)).Top)); } bool flag4 = flag3 && (!_hasMessageHudDiagnosticRect || !SameDiagnosticRect(_messageHudDiagnosticRect, rect)); if (!_messageHudDiagnosticState.HasValue || _messageHudDiagnosticState.Value != flag3 || flag4) { _messageHudDiagnosticState = flag3; _hasMessageHudDiagnosticRect = flag3; _messageHudDiagnosticRect = rect; LogInfo("ISF_MARKER_MESSAGE_HUD active=" + flag3 + (flag3 ? (" rect=" + FormatMarkerRect(rect)) : string.Empty)); } Camera presentationCamera = GetPresentationCamera(); if ((Object)(object)presentationCamera == (Object)null || !TryGetFiniteCameraPosition(presentationCamera, out var cameraPosition)) { _hudRenderer.Clear(); return; } MarkerLanguage val = CurrentMarkerLanguage(); _renderInputs.Clear(); int num = 0; while (num < _markers.Count) { PersonalPickupMarker personalPickupMarker = _markers[num]; if (!TryResolveOrdinaryMarkerTarget(personalPickupMarker.Pickup, out Vector3 worldPosition, out string invalidReason)) { RemoveOrdinaryMarkerNow(personalPickupMarker, invalidReason); continue; } if (!TryResolvePresentationDistance(cameraPosition, worldPosition, out int roundedDistanceMeters, out invalidReason)) { RemoveOrdinaryMarkerNow(personalPickupMarker, invalidReason); continue; } _renderInputs.Add(new MarkerRenderInput(new PersonalMarkerIdentity((PersonalMarkerKind)0, personalPickupMarker.InstanceId), worldPosition + Vector3.up * 1.2f, roundedDistanceMeters, PickupLabel(personalPickupMarker.Pickup, val), personalPickupMarker.ItemSemanticKey, personalPickupMarker.ClassName, personalPickupMarker.Kind, personalPickupMarker.TextColor, ResolvePickupIcon(personalPickupMarker.Pickup), personalPickupMarker.Lifetime)); num++; } int num2 = 0; while (num2 < _commandMarkers.Count) { PersonalCommandMarker personalCommandMarker = _commandMarkers[num2]; if (!TryResolveCommandMarkerTarget(personalCommandMarker.Picker, out Vector3 worldPosition2, out string invalidReason2)) { RemoveCommandMarkerNow(personalCommandMarker, invalidReason2); continue; } if (!TryResolvePresentationDistance(cameraPosition, worldPosition2, out int roundedDistanceMeters2, out invalidReason2)) { RemoveCommandMarkerNow(personalCommandMarker, invalidReason2); continue; } _renderInputs.Add(new MarkerRenderInput(new PersonalMarkerIdentity((PersonalMarkerKind)1, personalCommandMarker.InstanceId), worldPosition2 + Vector3.up * 1.35f, roundedDistanceMeters2, MarkerClassPolicy.LocalizedReadableClassLabel(personalCommandMarker.Kind, val), personalCommandMarker.ItemSemanticKey, personalCommandMarker.ClassName, personalCommandMarker.Kind, personalCommandMarker.TextColor, null, personalCommandMarker.Lifetime)); num2++; } _hudRenderer.Render(presentationCamera, _renderInputs, _config.MarkerSettingsSnapshot(), _config.MarkerVisualSettingsSnapshot(), val, OnMarkerRendered, _dynamicHudZones); } public void Dispose() { _config.MarkerPresentationSettingChanged -= OnMarkerPresentationSettingChanged; RestoreAll("external-or-plugin-teardown"); _hudRenderer.Dispose(); } public void RestoreAll() { RestoreAll("external-or-plugin-teardown"); } private void RestoreAll(string reason) { //IL_019a: Unknown result type (might be due to invalid IL or missing references) if (_markers.Count > 0 || _commandMarkers.Count > 0) { EmitPerformanceSummary(reason, 0, force: true); } _lastPerformanceMarkerCount = 0; LocalPickupPresentationGate[] array = _gates.Values.ToArray(); foreach (LocalPickupPresentationGate localPickupPresentationGate in array) { if (!((Object)(object)localPickupPresentationGate == (Object)null)) { localPickupPresentationGate.Restore(); Object.Destroy((Object)(object)localPickupPresentationGate); } } _gates.Clear(); LocalCommandPresentationGate[] array2 = _commandGates.Values.ToArray(); foreach (LocalCommandPresentationGate localCommandPresentationGate in array2) { if (!((Object)(object)localCommandPresentationGate == (Object)null)) { localCommandPresentationGate.Restore(); Object.Destroy((Object)(object)localCommandPresentationGate); } } _commandGates.Clear(); _localCommandGateDiagnosticState.Clear(); _localPickupVisualDiagnosticState.Clear(); _localPickupInteractionDiagnosticState.Clear(); _upstreamVisibilityGateObserved.Clear(); PersonalCommandMarker[] array3 = _commandMarkers.ToArray(); foreach (PersonalCommandMarker personalCommandMarker in array3) { LogCommandCleanup(personalCommandMarker.InstanceId, reason); } _markers.Clear(); _commandMarkers.Clear(); _markerRegistry.Clear(); _ordinaryRenderLogged.Clear(); _commandRemovalReasons.Clear(); _commandOptionDisagreementLogged.Clear(); _commandShareabilityDiagnosticState.Clear(); _markerProjectionDiagnosticState.Clear(); _modalHudSuppressionDiagnosticState = null; _modalHudSuppressionReason = string.Empty; _messageHudDiagnosticState = null; _hasMessageHudDiagnosticRect = false; _messageHudDiagnosticRect = default(MarkerHudRect); _localHudProbe.InvalidateLifecycle(); _presentationCamera = null; _nextPresentationCameraRefresh = 0f; _hudRenderer.SetPresentationSuppressed(suppressed: false); _hudRenderer.Clear(); } private unsafe void Sweep() { //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_0077: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_014c: Unknown result type (might be due to invalid IL or missing references) //IL_02c0: Unknown result type (might be due to invalid IL or missing references) //IL_02c5: Unknown result type (might be due to invalid IL or missing references) //IL_02ce: Unknown result type (might be due to invalid IL or missing references) //IL_02d3: Unknown result type (might be due to invalid IL or missing references) //IL_02ea: Unknown result type (might be due to invalid IL or missing references) //IL_0323: Unknown result type (might be due to invalid IL or missing references) //IL_0329: Unknown result type (might be due to invalid IL or missing references) //IL_033d: Unknown result type (might be due to invalid IL or missing references) //IL_0342: Unknown result type (might be due to invalid IL or missing references) //IL_0359: Unknown result type (might be due to invalid IL or missing references) //IL_035f: Invalid comparison between Unknown and I4 //IL_03a7: Unknown result type (might be due to invalid IL or missing references) //IL_03b4: Unknown result type (might be due to invalid IL or missing references) //IL_03bf: Unknown result type (might be due to invalid IL or missing references) //IL_0596: Unknown result type (might be due to invalid IL or missing references) //IL_059b: Unknown result type (might be due to invalid IL or missing references) //IL_05a0: Unknown result type (might be due to invalid IL or missing references) //IL_0c2b: Unknown result type (might be due to invalid IL or missing references) //IL_0c30: Unknown result type (might be due to invalid IL or missing references) //IL_0c34: Unknown result type (might be due to invalid IL or missing references) //IL_0c5b: Unknown result type (might be due to invalid IL or missing references) //IL_0c60: Unknown result type (might be due to invalid IL or missing references) //IL_0c43: Unknown result type (might be due to invalid IL or missing references) //IL_0c48: Unknown result type (might be due to invalid IL or missing references) //IL_05ef: Unknown result type (might be due to invalid IL or missing references) //IL_05f1: Unknown result type (might be due to invalid IL or missing references) //IL_069f: Unknown result type (might be due to invalid IL or missing references) //IL_06b0: Unknown result type (might be due to invalid IL or missing references) //IL_06d3: Unknown result type (might be due to invalid IL or missing references) //IL_06e0: Unknown result type (might be due to invalid IL or missing references) //IL_06e3: Invalid comparison between Unknown and I4 //IL_0788: Unknown result type (might be due to invalid IL or missing references) //IL_092b: Unknown result type (might be due to invalid IL or missing references) //IL_0930: Unknown result type (might be due to invalid IL or missing references) //IL_0932: Unknown result type (might be due to invalid IL or missing references) //IL_0935: Invalid comparison between Unknown and I4 //IL_0985: Unknown result type (might be due to invalid IL or missing references) //IL_0992: Unknown result type (might be due to invalid IL or missing references) //IL_099d: Unknown result type (might be due to invalid IL or missing references) //IL_09af: Unknown result type (might be due to invalid IL or missing references) //IL_09b2: Invalid comparison between Unknown and I4 //IL_089e: Unknown result type (might be due to invalid IL or missing references) //IL_0a50: Unknown result type (might be due to invalid IL or missing references) //IL_09b4: Unknown result type (might be due to invalid IL or missing references) //IL_09b7: Invalid comparison between Unknown and I4 if (!_config.Enabled.Value || !_upstream.IsIndividualMode) { RestoreAll("feature-disabled-or-non-individual-mode"); return; } CharacterMaster[] localMastersSnapshot = GetLocalMastersSnapshot(); if (localMastersSnapshot.Length == 0) { RestoreAll("no-local-master"); return; } ParticipantState[] array = localMastersSnapshot.Select(LocalParticipantResolver.ClassifyLocal).ToArray(); MarkerLanguage val = CurrentMarkerLanguage(); Camera presentationCamera = GetPresentationCamera(); Vector3 cameraPosition = default(Vector3); bool flag = (Object)(object)presentationCamera != (Object)null && TryGetFiniteCameraPosition(presentationCamera, out cameraPosition); _markerRegistry.BeginSweep(); List list = new List(); HashSet seenPickups = new HashSet(); HashSet hashSet = new HashSet(_markers.Select((PersonalPickupMarker x) => x.InstanceId)); int num = 0; int roundedDistanceMeters; foreach (GenericPickupController pickup in InstanceTracker.GetInstancesList()) { if ((Object)(object)pickup == (Object)null) { continue; } int instanceID = ((Object)pickup).GetInstanceID(); if (!TryResolveOrdinaryMarkerTarget(pickup, out Vector3 worldPosition, out string invalidReason) || (flag && !TryResolvePresentationDistance(cameraPosition, worldPosition, out roundedDistanceMeters, out invalidReason))) { ReleaseGate(instanceID); _markerRegistry.Remove((PersonalMarkerKind)0, instanceID); _ordinaryRenderLogged.Remove(instanceID); if (hashSet.Contains(instanceID)) { LogOrdinaryCleanup(instanceID, invalidReason); } } else { if (!_upstream.IsShareable(pickup)) { continue; } seenPickups.Add(instanceID); bool[] array2 = localMastersSnapshot.Select((CharacterMaster master) => _upstream.HasCollected(pickup, master)).ToArray(); int num2 = array2.Count((bool result) => result); bool flag2 = LocalPickupSuppressionPolicy.ShouldSuppressProcessVisual(_config.PersonalPickupVisibilityRepairEnabled.Value, _upstream.HideCollectedOrbsEnabled, array2.Length, num2); if (flag2) { if (!_gates.TryGetValue(instanceID, out LocalPickupPresentationGate value) || (Object)(object)value == (Object)null) { NormalizeUpstreamForGate(pickup); value = ((Component)pickup).gameObject.GetComponent() ?? ((Component)pickup).gameObject.AddComponent(); _gates[instanceID] = value; } value.ApplyHidden(); } else { ReleaseGate(instanceID); } LogLocalVisualGateTransition(pickup, num2, array2.Length, flag2); UniquePickup pickup2 = pickup.pickup; MarkerLifetimeKind val2 = MarkerLifetimePolicy.FromTemporaryFlag(((UniquePickup)(ref pickup2)).isTempItem); if (_config.PersonalMarkersEnabled.Value && MarkerLifetimePolicy.IsMarkerEligible(val2, _config.ShareTemporaryItems.Value) && num < 64 && ShouldShowMarker(array, array2)) { string text = MarkerPresentationPolicy.NormalizeLabel(PickupLabel(pickup, val), MarkerTextLocalization.FallbackSharedPickup(val)); MarkerRuntimeMetadata markerRuntimeMetadata = ResolvePickupMarkerMetadata(pickup.pickup.pickupIndex); if ((int)_markerRegistry.MarkPending((PersonalMarkerKind)0, instanceID, text) != 3) { list.Add(new PersonalPickupMarker { InstanceId = instanceID, Pickup = pickup, Label = text, ItemSemanticKey = PickupSemanticKey(pickup), ClassName = markerRuntimeMetadata.ClassName, Kind = markerRuntimeMetadata.Kind, TextColor = markerRuntimeMetadata.TextColor, Lifetime = val2 }); num++; } } } } int[] array3 = _gates.Keys.Where((int x) => !seenPickups.Contains(x)).ToArray(); for (roundedDistanceMeters = 0; roundedDistanceMeters < array3.Length; roundedDistanceMeters++) { int instanceId = array3[roundedDistanceMeters]; ReleaseGate(instanceId); } List list2 = new List(); HashSet seenCommandCandidateIds = new HashSet(); _commandRemovalReasons.Clear(); HashSet hashSet2 = new HashSet(_commandMarkers.Select((PersonalCommandMarker x) => x.InstanceId)); int num3 = 0; if (_upstream.ShareCommandPicksEnabled) { foreach (PickupPickerController instances in InstanceTracker.GetInstancesList()) { if ((Object)(object)instances == (Object)null) { continue; } int instanceID2 = ((Object)instances).GetInstanceID(); if (!_upstream.IsCommandCube(instances)) { ReleaseCommandGate(instanceID2, "classifier-false"); if (hashSet2.Contains(instanceID2)) { _commandRemovalReasons[instanceID2] = "classifier-false"; } continue; } seenCommandCandidateIds.Add(instanceID2); bool?[] array4 = new bool?[localMastersSnapshot.Length]; bool flag3 = false; bool flag4 = true; for (int num4 = 0; num4 < localMastersSnapshot.Length; num4++) { if (!_upstream.TryHasCommandPicked(instances, localMastersSnapshot[num4], out var picked)) { array4[num4] = null; flag4 = false; continue; } array4[num4] = picked; if (ProjectionPolicy.ShowPersonalMarker(true, array[num4], picked, false)) { flag3 = true; } } LocalCommandPresentationDecision decision = LocalCommandPresentationPolicy.Evaluate((IReadOnlyList)array4); ApplyLocalCommandPresentation(instances, decision); if (!_config.PersonalMarkersEnabled.Value) { if (hashSet2.Contains(instanceID2)) { _commandRemovalReasons[instanceID2] = "markers-disabled"; } continue; } if (!TryResolveCommandMarkerTarget(instances, out Vector3 worldPosition2, out string invalidReason2) || (flag && !TryResolvePresentationDistance(cameraPosition, worldPosition2, out roundedDistanceMeters, out invalidReason2))) { _markerRegistry.Remove((PersonalMarkerKind)1, instanceID2); if (hashSet2.Contains(instanceID2)) { LogCommandCleanup(instanceID2, invalidReason2); } continue; } bool flag5 = flag3 || flag4; if (num3 >= 32 || !MarkerPresentationPolicy.ShouldTrackCommandMarker(_config.PersonalMarkersEnabled.Value, _upstream.IsIndividualMode, _upstream.ShareCommandPicksEnabled, true, flag5, flag3)) { if (hashSet2.Contains(instanceID2)) { _commandRemovalReasons[instanceID2] = (flag4 ? "local-completed" : "local-state-unresolved"); } continue; } string optionSource; int resolvedOptionCount; bool sourceDisagreement; CommandShareabilityDecision shareability; MarkerRuntimeMetadata markerRuntimeMetadata2 = ResolveCommandMarkerMetadata(instances, val, out optionSource, out resolvedOptionCount, out sourceDisagreement, out shareability); MarkerLifetimeKind lifetime = (MarkerLifetimeKind)3; int exactNestedAvailableOptionCount = 0; int unresolvedAvailableOptionCount = 0; _upstream.TryGetCommandChoiceLifetime(instances, out lifetime, out exactNestedAvailableOptionCount, out unresolvedAvailableOptionCount); string text2 = MarkerPresentationPolicy.NormalizeLabel(markerRuntimeMetadata2.Label, MarkerTextLocalization.FallbackCommandChoice(val)); if ((int)lifetime == 3 && _commandLifetimeUnknownLogged.Add(instanceID2)) { LogInfo("ISF_COMMAND_LIFETIME pickerInstanceId=" + instanceID2.ToString(CultureInfo.InvariantCulture) + " lifetime=Unknown exactNestedAvailable=" + exactNestedAvailableOptionCount.ToString(CultureInfo.InvariantCulture) + " unresolvedAvailable=" + unresolvedAvailableOptionCount.ToString(CultureInfo.InvariantCulture) + " assertion=none"); } if (sourceDisagreement && _commandOptionDisagreementLogged.Add(instanceID2)) { LogInfo("ISF_COMMAND_OPTION_SOURCE_DISAGREEMENT pickerInstanceId=" + instanceID2.ToString(CultureInfo.InvariantCulture) + " nestedWins=True optionSource=" + optionSource); } if (!MarkerLifetimePolicy.IsMarkerEligible(lifetime, _config.ShareTemporaryItems.Value)) { _commandShareabilityDiagnosticState[instanceID2] = "temporary-sharing-disabled"; if (hashSet2.Contains(instanceID2)) { _commandRemovalReasons[instanceID2] = "temporary-sharing-disabled"; } continue; } if (!((CommandShareabilityDecision)(ref shareability)).MarkerEligible) { string text3 = ((CommandShareabilityDecision)(ref shareability)).DiagnosticToken + ":" + ((CommandShareabilityDecision)(ref shareability)).FilterReason; if (!_commandShareabilityDiagnosticState.TryGetValue(instanceID2, out string value2) || !string.Equals(value2, text3, StringComparison.Ordinal)) { _commandShareabilityDiagnosticState[instanceID2] = text3; LogInfo("ISF_COMMAND_MARKER filtered pickerInstanceId=" + instanceID2.ToString(CultureInfo.InvariantCulture) + " optionSource=" + optionSource + " resolvedOptionCount=" + resolvedOptionCount.ToString(CultureInfo.InvariantCulture) + " class=" + markerRuntimeMetadata2.ClassName + " label=" + text2 + " color=" + ColorEvidence(markerRuntimeMetadata2.TextColor) + " shareability=" + ((CommandShareabilityDecision)(ref shareability)).DiagnosticToken + " reason=" + ((CommandShareabilityDecision)(ref shareability)).FilterReason); } if (hashSet2.Contains(instanceID2)) { _commandRemovalReasons[instanceID2] = ((CommandShareabilityDecision)(ref shareability)).FilterReason; } continue; } _commandShareabilityDiagnosticState[instanceID2] = ((CommandShareabilityDecision)(ref shareability)).DiagnosticToken + ":eligible"; PersonalMarkerTransition val3 = _markerRegistry.MarkPending((PersonalMarkerKind)1, instanceID2, text2); if ((int)val3 != 3) { list2.Add(new PersonalCommandMarker { InstanceId = instanceID2, Picker = instances, Label = text2, ItemSemanticKey = "COMMAND:" + instanceID2.ToString(CultureInfo.InvariantCulture), ClassName = markerRuntimeMetadata2.ClassName, Kind = markerRuntimeMetadata2.Kind, TextColor = markerRuntimeMetadata2.TextColor, Lifetime = lifetime }); num3++; if ((int)val3 == 1 || (int)val3 == 2) { string[] obj = new string[28] { "ISF_COMMAND_MARKER pending pickerInstanceId=", instanceID2.ToString(CultureInfo.InvariantCulture), " localPending=True providerHasState=", _upstream.HasPickerProviderState(instances).ToString(), " discovery=InstanceTracker optionSource=", optionSource, " resolvedOptionCount=", resolvedOptionCount.ToString(CultureInfo.InvariantCulture), " class=", markerRuntimeMetadata2.ClassName, " label=", text2, " color=", ColorEvidence(markerRuntimeMetadata2.TextColor), " style=", MarkerPresentationPolicy.NativeHudStyleToken, " renderer=canvas-tmp-ui-graphic fontSize=", null, null, null, null, null, null, null, null, null, null, null }; roundedDistanceMeters = MarkerPresentationPolicy.BuildNativeHudFontSize(Screen.height); obj[17] = roundedDistanceMeters.ToString(CultureInfo.InvariantCulture); obj[18] = " shareability="; obj[19] = ((CommandShareabilityDecision)(ref shareability)).DiagnosticToken; obj[20] = " exactClass="; obj[21] = markerRuntimeMetadata2.ExactClass.ToString(); obj[22] = " lifetime="; obj[23] = ((object)(*(MarkerLifetimeKind*)(&lifetime))/*cast due to .constrained prefix*/).ToString(); obj[24] = " lifetimeExactNested="; obj[25] = exactNestedAvailableOptionCount.ToString(CultureInfo.InvariantCulture); obj[26] = " lifetimeUnresolved="; obj[27] = unresolvedAvailableOptionCount.ToString(CultureInfo.InvariantCulture); LogInfo(string.Concat(obj)); } } } } array3 = _commandGates.Keys.Where((int x) => !seenCommandCandidateIds.Contains(x)).ToArray(); foreach (int instanceId2 in array3) { ReleaseCommandGate(instanceId2, "picker-destroyed-stale-or-sharing-disabled"); } array3 = _commandShareabilityDiagnosticState.Keys.Where((int x) => !seenCommandCandidateIds.Contains(x)).ToArray(); foreach (int key in array3) { _commandShareabilityDiagnosticState.Remove(key); } _commandLifetimeUnknownLogged.RemoveWhere((int x) => !seenCommandCandidateIds.Contains(x)); foreach (PersonalMarkerDescriptor item in _markerRegistry.EndSweep()) { PersonalMarkerIdentity identity = item.Identity; if ((int)((PersonalMarkerIdentity)(ref identity)).Kind == 0) { HashSet ordinaryRenderLogged = _ordinaryRenderLogged; identity = item.Identity; ordinaryRenderLogged.Remove(((PersonalMarkerIdentity)(ref identity)).InstanceId); } else { identity = item.Identity; int instanceId3 = ((PersonalMarkerIdentity)(ref identity)).InstanceId; string value3; string reason = (_commandRemovalReasons.TryGetValue(instanceId3, out value3) ? value3 : "destroyed-or-untracked"); LogCommandCleanup(instanceId3, reason); } } _markers.Clear(); _markers.AddRange(list); _commandMarkers.Clear(); _commandMarkers.AddRange(list2); } private unsafe void OnMarkerRendered(MarkerRenderDiagnostic diagnostic) { //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_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001b: 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_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0086: 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_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0229: Unknown result type (might be due to invalid IL or missing references) //IL_0296: Unknown result type (might be due to invalid IL or missing references) //IL_029b: Unknown result type (might be due to invalid IL or missing references) //IL_02c3: Unknown result type (might be due to invalid IL or missing references) //IL_0322: Unknown result type (might be due to invalid IL or missing references) //IL_0327: Unknown result type (might be due to invalid IL or missing references) PersonalMarkerIdentity identity = diagnostic.Input.Identity; MarkerHudPlacement placement = diagnostic.Placement; MarkerHudMode mode = ((MarkerHudPlacement)(ref placement)).Mode; MarkerHudEdge edge = ((MarkerHudPlacement)(ref placement)).Edge; int laneSlot = ((MarkerHudPlacement)(ref placement)).LaneSlot; int railSlot = ((MarkerHudPlacement)(ref placement)).RailSlot; bool hudRelocated = ((MarkerHudPlacement)(ref placement)).HudRelocated; bool messageHudRelocated = ((MarkerHudPlacement)(ref placement)).MessageHudRelocated; bool collisionRelocated = ((MarkerHudPlacement)(ref placement)).CollisionRelocated; bool usedMeasurementFallback = diagnostic.UsedMeasurementFallback; float labelPreferredWidth = diagnostic.LabelPreferredWidth; MarkerHudVisualFootprint footprint = diagnostic.Footprint; MarkerHudDiagnosticState val = MarkerRuntimeHotPathPolicy.BuildHudDiagnosticState(mode, edge, laneSlot, railSlot, hudRelocated, messageHudRelocated, collisionRelocated, usedMeasurementFallback, labelPreferredWidth, ((MarkerHudVisualFootprint)(ref footprint)).Width); MarkerHudDiagnosticState value; bool flag = !_markerProjectionDiagnosticState.TryGetValue(diagnostic.ClusterKey, out value) || !((MarkerHudDiagnosticState)(ref value)).Equals(val); if (flag) { _markerProjectionDiagnosticState[diagnostic.ClusterKey] = val; } bool flag2 = (int)((PersonalMarkerIdentity)(ref identity)).Kind == 0 && _ordinaryRenderLogged.Add(((PersonalMarkerIdentity)(ref identity)).InstanceId); if (flag || flag2) { string text = (((int)((MarkerHudPlacement)(ref placement)).Mode == 0) ? "onscreen" : "edge"); string text2 = FormatEdge(((MarkerHudPlacement)(ref placement)).Edge); if (flag) { MarkerHudRect finalRect = ((MarkerHudPlacement)(ref placement)).FinalRect; string[] obj = new string[39] { "ISF_MARKER_HUD clusterKey=", diagnostic.ClusterKey.ToString(CultureInfo.InvariantCulture), " fingerprint=", diagnostic.MemberFingerprint, " total=", diagnostic.ClusterTotal.ToString(CultureInfo.InvariantCulture), " representative=", ((object)(*(PersonalMarkerIdentity*)(&identity))/*cast due to .constrained prefix*/).ToString(), " mode=", text, " semantic=", diagnostic.SemanticText.Replace("\n", " | "), " edge=", text2, " stackSlot=", ((MarkerHudPlacement)(ref placement)).StackSlot.ToString(CultureInfo.InvariantCulture), " laneSlot=", ((MarkerHudPlacement)(ref placement)).LaneSlot.ToString(CultureInfo.InvariantCulture), " railSlot=", ((MarkerHudPlacement)(ref placement)).RailSlot.ToString(CultureInfo.InvariantCulture), " rect=", FormatMarkerRect(finalRect), " hudRelocated=", ((MarkerHudPlacement)(ref placement)).HudRelocated.ToString(), " messageHudRelocated=", ((MarkerHudPlacement)(ref placement)).MessageHudRelocated.ToString(), " collisionRelocated=", ((MarkerHudPlacement)(ref placement)).CollisionRelocated.ToString(), " anchorDisplacement=", MarkerHudNavigationPolicy.OnScreenAnchorDisplacement(diagnostic.SourceProjection, placement).ToString("F1", CultureInfo.InvariantCulture), " anchorDisplacementBound=", MarkerHudNavigationPolicy.GetMaxOnScreenAnchorDisplacement(diagnostic.Footprint, (float)Screen.width, (float)Screen.height).ToString("F1", CultureInfo.InvariantCulture), " labelPreferredWidth=", diagnostic.LabelPreferredWidth.ToString("F1", CultureInfo.InvariantCulture), " footprintWidth=", null, null, null, null }; footprint = diagnostic.Footprint; obj[35] = ((MarkerHudVisualFootprint)(ref footprint)).Width.ToString("F1", CultureInfo.InvariantCulture); obj[36] = " measurementFallback="; obj[37] = diagnostic.UsedMeasurementFallback.ToString(); obj[38] = " semanticModel=world-space-cluster renderer=canvas-tmp-ui-graphic"; LogInfo(string.Concat(obj)); } if (flag2) { LogInfo("ISF_MARKER_RENDER ordinary pickupInstanceId=" + ((PersonalMarkerIdentity)(ref identity)).InstanceId.ToString(CultureInfo.InvariantCulture) + " clusterKey=" + diagnostic.ClusterKey.ToString(CultureInfo.InvariantCulture) + " fingerprint=" + diagnostic.MemberFingerprint + " total=" + diagnostic.ClusterTotal.ToString(CultureInfo.InvariantCulture) + " indicatorSource=" + MarkerPresentationPolicy.IndicatorAssetSourceToken + " style=" + MarkerPresentationPolicy.NativeHudStyleToken + " renderer=canvas-tmp-ui-graphic mode=" + text + " edge=" + text2); } } } private static string FormatEdge(MarkerHudEdge edge) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Expected I4, but got Unknown return (edge - 1) switch { 0 => "left", 1 => "right", 2 => "top", 3 => "bottom", _ => "none", }; } private static bool SameDiagnosticRect(MarkerHudRect left, MarkerHudRect right) { if (Math.Abs(((MarkerHudRect)(ref left)).Left - ((MarkerHudRect)(ref right)).Left) < 0.5f && Math.Abs(((MarkerHudRect)(ref left)).Right - ((MarkerHudRect)(ref right)).Right) < 0.5f && Math.Abs(((MarkerHudRect)(ref left)).Bottom - ((MarkerHudRect)(ref right)).Bottom) < 0.5f) { return Math.Abs(((MarkerHudRect)(ref left)).Top - ((MarkerHudRect)(ref right)).Top) < 0.5f; } return false; } private static string FormatMarkerRect(MarkerHudRect rect) { return ((MarkerHudRect)(ref rect)).Left.ToString("F1", CultureInfo.InvariantCulture) + "," + ((MarkerHudRect)(ref rect)).Bottom.ToString("F1", CultureInfo.InvariantCulture) + "," + ((MarkerHudRect)(ref rect)).Right.ToString("F1", CultureInfo.InvariantCulture) + "," + ((MarkerHudRect)(ref rect)).Top.ToString("F1", CultureInfo.InvariantCulture); } private static bool ShouldShowMarker(ParticipantState[] localStates, bool[] collected) { for (int i = 0; i < localStates.Length; i++) { if (ProjectionPolicy.ShowPersonalMarker(true, localStates[i], collected[i], false)) { return true; } } return false; } private CharacterMaster[] GetLocalMastersSnapshot() { if (_localMastersFrame == Time.frameCount) { return _cachedLocalMasters; } _localMastersFrame = Time.frameCount; _cachedLocalMasters = (from x in LocalParticipantResolver.GetLocalMasters() where (Object)(object)x != (Object)null select x).ToArray(); return _cachedLocalMasters; } private void NormalizeUpstreamForGate(GenericPickupController pickup) { try { _upstreamNormalizationDepth++; _upstream.NormalizeUpstreamVisualSubtree(pickup); } finally { _upstreamNormalizationDepth--; } } private void ReleaseGate(int instanceId) { if (_gates.TryGetValue(instanceId, out LocalPickupPresentationGate value)) { if ((Object)(object)value != (Object)null) { value.Restore(); Object.Destroy((Object)(object)value); } _gates.Remove(instanceId); } } private void ApplyLocalCommandPresentation(PickupPickerController picker, LocalCommandPresentationDecision decision) { int instanceID = ((Object)picker).GetInstanceID(); if (((LocalCommandPresentationDecision)(ref decision)).SuppressWorldPresentation) { if (!_commandGates.TryGetValue(instanceID, out LocalCommandPresentationGate value) || (Object)(object)value == (Object)null) { value = ((Component)picker).gameObject.GetComponent() ?? ((Component)picker).gameObject.AddComponent(); _commandGates[instanceID] = value; } value.ApplyHidden(); LogLocalCommandGateTransition(instanceID, visualSuppressed: true, "all-local-completed"); } else { string reason = ((!((LocalCommandPresentationDecision)(ref decision)).AllLocalStateResolved) ? "local-state-unresolved" : (((LocalCommandPresentationDecision)(ref decision)).AnyLocalPending ? "local-participant-pending" : "not-all-local-completed")); ReleaseCommandGate(instanceID, reason); } } private void ReleaseCommandGate(int instanceId, string reason) { LocalCommandPresentationGate value; bool num = _commandGates.TryGetValue(instanceId, out value); if (num) { if ((Object)(object)value != (Object)null) { value.Restore(); Object.Destroy((Object)(object)value); } _commandGates.Remove(instanceId); } bool value2; bool flag = _localCommandGateDiagnosticState.TryGetValue(instanceId, out value2) && value2; if (num || flag) { LogLocalCommandGateTransition(instanceId, visualSuppressed: false, reason); } } private void LogLocalCommandGateTransition(int instanceId, bool visualSuppressed, string reason) { if (_config.DiagnosticLogging.Value && (!_localCommandGateDiagnosticState.TryGetValue(instanceId, out var value) || value != visualSuppressed)) { _localCommandGateDiagnosticState[instanceId] = visualSuppressed; LogInfo("ISF_C20_LOCAL_COMMAND_GATE picker=" + instanceId.ToString(CultureInfo.InvariantCulture) + " allLocalCompleted=" + visualSuppressed.ToString().ToLowerInvariant() + " visualSuppressed=" + visualSuppressed.ToString().ToLowerInvariant() + " reason=" + reason); } } private void LogLocalVisualGateTransition(GenericPickupController pickup, int collectedCount, int localCount, bool visualSuppressed) { if (_config.DiagnosticLogging.Value && !((Object)(object)pickup == (Object)null)) { string text = collectedCount.ToString(CultureInfo.InvariantCulture) + "/" + localCount.ToString(CultureInfo.InvariantCulture) + ":" + visualSuppressed; int instanceID = ((Object)pickup).GetInstanceID(); if (!_localPickupVisualDiagnosticState.TryGetValue(instanceID, out string value) || !string.Equals(value, text, StringComparison.Ordinal)) { _localPickupVisualDiagnosticState[instanceID] = text; LogInfo("ISF_C20_LOCAL_PICKUP_GATE pickup=" + instanceID.ToString(CultureInfo.InvariantCulture) + " localMaster=process localCollected=" + collectedCount.ToString(CultureInfo.InvariantCulture) + "/" + localCount.ToString(CultureInfo.InvariantCulture) + " visualSuppressed=" + visualSuppressed.ToString().ToLowerInvariant() + " interactionSuppressed=participant-specific action=visual-state reason=" + (visualSuppressed ? "all-local-collected" : "local-participant-still-needs-pickup")); } } } private void LogLocalInteractionGateTransition(GenericPickupController pickup, CharacterMaster master, bool collected, bool interactionSuppressed) { //IL_008a: 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) if (_config.DiagnosticLogging.Value && !((Object)(object)pickup == (Object)null) && !((Object)(object)master == (Object)null)) { int instanceID = ((Object)pickup).GetInstanceID(); int instanceID2 = ((Object)master).GetInstanceID(); long key = (long)(((ulong)(uint)instanceID << 32) | (uint)instanceID2); if (!_localPickupInteractionDiagnosticState.TryGetValue(key, out var value) || value != interactionSuppressed) { _localPickupInteractionDiagnosticState[key] = interactionSuppressed; string[] obj = new string[12] { "ISF_C20_LOCAL_PICKUP_GATE pickup=", instanceID.ToString(CultureInfo.InvariantCulture), " localMaster=masterNetId=", null, null, null, null, null, null, null, null, null }; NetworkInstanceId netId = ((NetworkBehaviour)master).netId; obj[3] = ((NetworkInstanceId)(ref netId)).Value.ToString(CultureInfo.InvariantCulture); obj[4] = " localCollected="; obj[5] = collected.ToString().ToLowerInvariant(); obj[6] = " visualSuppressed="; obj[7] = _gates.ContainsKey(instanceID).ToString().ToLowerInvariant(); obj[8] = " interactionSuppressed="; obj[9] = interactionSuppressed.ToString().ToLowerInvariant(); obj[10] = " action=interactability-state reason="; obj[11] = (interactionSuppressed ? "local-collector-already-collected" : "local-participant-not-collected"); LogInfo(string.Concat(obj)); } } } private static bool TryGetFiniteCameraPosition(Camera camera, out Vector3 cameraPosition) { //IL_0001: 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_0013: Unknown result type (might be due to invalid IL or missing references) cameraPosition = default(Vector3); try { cameraPosition = ((Component)camera).transform.position; return MarkerPresentationPolicy.AreCoordinatesFinite(cameraPosition.x, cameraPosition.y, cameraPosition.z); } catch { return false; } } private static bool TryResolveOrdinaryMarkerTarget(GenericPickupController pickup, out Vector3 worldPosition, out string invalidReason) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004d: 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_0070: Unknown result type (might be due to invalid IL or missing references) worldPosition = default(Vector3); invalidReason = string.Empty; if ((Object)(object)pickup == (Object)null) { invalidReason = "destroyed-or-missing"; return false; } try { if ((Object)(object)((Component)pickup).gameObject == (Object)null || !((Component)pickup).gameObject.activeInHierarchy) { invalidReason = "inactive-or-removed"; return false; } if (PickupCatalog.GetPickupDef(pickup.pickup.pickupIndex) == null) { invalidReason = "pickup-def-unresolved"; return false; } worldPosition = ((Component)pickup).transform.position; invalidReason = MarkerPresentationPolicy.ValidateWorldPosition(worldPosition.x, worldPosition.y, worldPosition.z); return string.IsNullOrEmpty(invalidReason); } catch { invalidReason = "target-resolution-failed"; return false; } } private static bool TryResolveCommandMarkerTarget(PickupPickerController picker, out Vector3 worldPosition, out string invalidReason) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) worldPosition = default(Vector3); invalidReason = string.Empty; if ((Object)(object)picker == (Object)null) { invalidReason = "destroyed-or-missing"; return false; } try { if ((Object)(object)((Component)picker).gameObject == (Object)null || !((Component)picker).gameObject.activeInHierarchy) { invalidReason = "inactive-or-removed"; return false; } worldPosition = ((Component)picker).transform.position; invalidReason = MarkerPresentationPolicy.ValidateWorldPosition(worldPosition.x, worldPosition.y, worldPosition.z); return string.IsNullOrEmpty(invalidReason); } catch { invalidReason = "target-resolution-failed"; return false; } } private static bool TryResolvePresentationDistance(Vector3 cameraPosition, Vector3 worldPosition, out int roundedDistanceMeters, out string invalidReason) { //IL_000a: 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) roundedDistanceMeters = 0; invalidReason = string.Empty; float num = Vector3.Distance(cameraPosition, worldPosition); invalidReason = MarkerPresentationPolicy.ValidatePresentationDistance(num); if (!string.IsNullOrEmpty(invalidReason)) { return false; } roundedDistanceMeters = Mathf.Max(0, Mathf.RoundToInt(num)); return true; } private void RemoveOrdinaryMarkerNow(PersonalPickupMarker marker, string reason) { _markers.Remove(marker); _markerRegistry.Remove((PersonalMarkerKind)0, marker.InstanceId); _ordinaryRenderLogged.Remove(marker.InstanceId); ReleaseGate(marker.InstanceId); LogOrdinaryCleanup(marker.InstanceId, reason); } private void RemoveCommandMarkerNow(PersonalCommandMarker marker, string reason) { _commandMarkers.Remove(marker); _markerRegistry.Remove((PersonalMarkerKind)1, marker.InstanceId); _commandShareabilityDiagnosticState.Remove(marker.InstanceId); LogCommandCleanup(marker.InstanceId, reason); } private void LogOrdinaryCleanup(int instanceId, string reason) { LogInfo("ISF_MARKER_CLEANUP ordinary pickupInstanceId=" + instanceId.ToString(CultureInfo.InvariantCulture) + " reason=" + reason); } private static Sprite? ResolvePickupIcon(GenericPickupController pickup) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) try { return PickupCatalog.GetPickupDef(pickup.pickup.pickupIndex)?.iconSprite; } catch { return null; } } private unsafe static string PickupSemanticKey(GenericPickupController pickup) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_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) try { PickupIndex pickupIndex = pickup.pickup.pickupIndex; PickupDef pickupDef = PickupCatalog.GetPickupDef(pickupIndex); if (pickupDef != null && !string.IsNullOrWhiteSpace(pickupDef.nameToken)) { return "PICKUP:" + pickupDef.nameToken; } return "PICKUP_INDEX:" + ((object)(*(PickupIndex*)(&pickupIndex))/*cast due to .constrained prefix*/).ToString(); } catch { return "PICKUP_INSTANCE:" + ((Object)pickup).GetInstanceID().ToString(CultureInfo.InvariantCulture); } } private static string PickupLabel(GenericPickupController pickup, MarkerLanguage language) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) try { PickupDef pickupDef = PickupCatalog.GetPickupDef(pickup.pickup.pickupIndex); if (pickupDef != null && !string.IsNullOrEmpty(pickupDef.nameToken)) { string text = Language.GetString(pickupDef.nameToken); if (!string.IsNullOrWhiteSpace(text) && !string.Equals(text, pickupDef.nameToken, StringComparison.Ordinal)) { return text; } } } catch { } return MarkerTextLocalization.FallbackSharedPickup(language); } private MarkerRuntimeMetadata ResolveCommandMarkerMetadata(PickupPickerController picker, MarkerLanguage language, out string optionSource, out int resolvedOptionCount, out bool sourceDisagreement, out CommandShareabilityDecision shareability) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004e: 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_0066: 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_011e: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Unknown result type (might be due to invalid IL or missing references) //IL_014f: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Unknown result type (might be due to invalid IL or missing references) //IL_0173: Invalid comparison between Unknown and I4 //IL_01f3: Unknown result type (might be due to invalid IL or missing references) //IL_01e4: Unknown result type (might be due to invalid IL or missing references) //IL_017e: Unknown result type (might be due to invalid IL or missing references) //IL_01f8: Unknown result type (might be due to invalid IL or missing references) //IL_0200: Unknown result type (might be due to invalid IL or missing references) //IL_020b: Unknown result type (might be due to invalid IL or missing references) //IL_0220: Unknown result type (might be due to invalid IL or missing references) //IL_0195: Unknown result type (might be due to invalid IL or missing references) //IL_019d: 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_01bd: Unknown result type (might be due to invalid IL or missing references) //IL_0190: Unknown result type (might be due to invalid IL or missing references) optionSource = "unresolved"; resolvedOptionCount = 0; sourceDisagreement = false; shareability = CommandShareabilityPolicy.Evaluate((IEnumerable)Array.Empty()); if (!_upstream.TryGetCommandChoicePickupIndexes(picker, out PickupIndex[] pickupIndexes, out optionSource, out bool exactSource, out sourceDisagreement) || pickupIndexes.Length == 0) { CommandClassPresentation val = MarkerClassPolicy.ResolveCommandClassForReadablePresentation((IEnumerable)Array.Empty(), language); return new MarkerRuntimeMetadata(((CommandClassPresentation)(ref val)).Kind, MarkerClassPolicy.DiagnosticClassName(((CommandClassPresentation)(ref val)).Kind), ((CommandClassPresentation)(ref val)).Label, Color.white, exactClass: false); } resolvedOptionCount = pickupIndexes.Length; List list = new List(pickupIndexes.Length); List list2 = new List(pickupIndexes.Length); PickupIndex[] array = pickupIndexes; for (int i = 0; i < array.Length; i++) { PickupDef pickupDef = PickupCatalog.GetPickupDef(array[i]); if (pickupDef == null) { list.Add(UnknownPickupMetadata()); list2.Add(null); } else { list.Add(ResolvePickupMarkerMetadata(pickupDef)); list2.Add(_upstream.TryIsShareable(pickupDef, out var shareable) ? new bool?(shareable) : ((bool?)null)); } } shareability = (exactSource ? CommandShareabilityPolicy.Evaluate((IEnumerable)list2) : CommandShareabilityPolicy.Evaluate((IEnumerable)Array.Empty())); CommandClassPresentation classPresentation = MarkerClassPolicy.ResolveCommandClassForReadablePresentation(list.Select((MarkerRuntimeMetadata x) => x.Kind), language); if (!((CommandClassPresentation)(ref classPresentation)).ExactClass) { Color textColor = (((int)((CommandClassPresentation)(ref classPresentation)).Kind == 9 && list.Count > 0) ? list[0].TextColor : Color.white); return new MarkerRuntimeMetadata(((CommandClassPresentation)(ref classPresentation)).Kind, MarkerClassPolicy.DiagnosticClassName(((CommandClassPresentation)(ref classPresentation)).Kind), ((CommandClassPresentation)(ref classPresentation)).Label, textColor, exactClass: false); } MarkerRuntimeMetadata[] array2 = list.Where((MarkerRuntimeMetadata x) => x.Kind == ((CommandClassPresentation)(ref classPresentation)).Kind).ToArray(); Color textColor2 = ((array2.Length != 0) ? array2[0].TextColor : Color.white); return new MarkerRuntimeMetadata(((CommandClassPresentation)(ref classPresentation)).Kind, MarkerClassPolicy.DiagnosticClassName(((CommandClassPresentation)(ref classPresentation)).Kind), ((CommandClassPresentation)(ref classPresentation)).Label, textColor2, exactSource); } private static MarkerRuntimeMetadata ResolvePickupMarkerMetadata(PickupIndex pickupIndex) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) try { PickupDef pickupDef = PickupCatalog.GetPickupDef(pickupIndex); return (pickupDef != null) ? ResolvePickupMarkerMetadata(pickupDef) : UnknownPickupMetadata(); } catch { return UnknownPickupMetadata(); } } private static MarkerRuntimeMetadata ResolvePickupMarkerMetadata(PickupDef def) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Invalid comparison between Unknown and I4 //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_004a: 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_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_0063: Invalid comparison between Unknown and I4 //IL_0013: Unknown result type (might be due to invalid IL or missing references) try { bool flag = (int)def.equipmentIndex != -1; bool flag2 = false; if (flag) { EquipmentDef equipmentDef = EquipmentCatalog.GetEquipmentDef(def.equipmentIndex); flag2 = (Object)(object)equipmentDef != (Object)null && equipmentDef.isLunar; } MarkerClassKind val = MarkerClassPolicy.Classify(((object)Unsafe.As(ref def.itemTier)/*cast due to .constrained prefix*/).ToString(), flag, flag2); return new MarkerRuntimeMetadata(val, MarkerClassPolicy.DiagnosticClassName(val), string.Empty, SanitizeMarkerColor(def.baseColor), (int)val > 0); } catch { return UnknownPickupMetadata(); } } private static MarkerRuntimeMetadata UnknownPickupMetadata() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) return new MarkerRuntimeMetadata((MarkerClassKind)0, MarkerClassPolicy.DiagnosticClassName((MarkerClassKind)0), string.Empty, Color.white, exactClass: false); } private static Color SanitizeMarkerColor(Color color) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_000d: 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_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) if (float.IsNaN(color.r) || float.IsInfinity(color.r) || float.IsNaN(color.g) || float.IsInfinity(color.g) || float.IsNaN(color.b) || float.IsInfinity(color.b) || color.a <= 0.01f) { return Color.white; } color.a = 1f; return color; } private static string ColorEvidence(Color color) { //IL_0005: 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) return "#" + ColorUtility.ToHtmlStringRGB(SanitizeMarkerColor(color)); } private static MarkerLanguage CurrentMarkerLanguage() { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: 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) try { return MarkerTextLocalization.ResolveLanguage(Language.currentLanguageName); } catch { return (MarkerLanguage)0; } } private void LogCommandCleanup(int instanceId, string reason) { LogInfo("ISF_COMMAND_MARKER cleanup pickerInstanceId=" + instanceId.ToString(CultureInfo.InvariantCulture) + " reason=" + reason); } private Camera? GetPresentationCamera() { float unscaledTime = Time.unscaledTime; if ((Object)(object)_presentationCamera != (Object)null && (Object)(object)((Component)_presentationCamera).gameObject != (Object)null && ((Component)_presentationCamera).gameObject.activeInHierarchy && unscaledTime < _nextPresentationCameraRefresh) { return _presentationCamera; } _nextPresentationCameraRefresh = unscaledTime + 2f; try { _presentationCamera = Camera.main; } catch { _presentationCamera = null; } return _presentationCamera; } private void MaybeEmitPerformanceSummary(int markerCount) { if (_config.DiagnosticLogging.Value) { float unscaledTime = Time.unscaledTime; if (!(unscaledTime < _nextPerformanceSummary)) { _nextPerformanceSummary = unscaledTime + 5f; EmitPerformanceSummary("periodic", markerCount, force: false); } } } private void EmitPerformanceSummary(string reason, int markerCount, bool force) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) if (_config.DiagnosticLogging.Value || force) { MarkerRuntimePerformanceSnapshot val = _performance.Snapshot(); _log.LogInfo((object)("[ItemShareFix] ISF_MARKER_PERF_SUMMARY reason=" + reason + " markers=" + markerCount.ToString(CultureInfo.InvariantCulture) + " updates=" + ((MarkerRuntimePerformanceSnapshot)(ref val)).UnityUpdateCalls.ToString(CultureInfo.InvariantCulture) + " renderFrames=" + ((MarkerRuntimePerformanceSnapshot)(ref val)).RenderFrameCalls.ToString(CultureInfo.InvariantCulture) + " fullSolves=" + ((MarkerRuntimePerformanceSnapshot)(ref val)).FullPlacementSolves.ToString(CultureInfo.InvariantCulture) + " singleFast=" + ((MarkerRuntimePerformanceSnapshot)(ref val)).SingleMarkerFastPathCalls.ToString(CultureInfo.InvariantCulture) + " globalHudDiscovery=" + ((MarkerRuntimePerformanceSnapshot)(ref val)).GlobalHudDiscoveries.ToString(CultureInfo.InvariantCulture) + " tmpMeasures=" + ((MarkerRuntimePerformanceSnapshot)(ref val)).TmpPreferredMeasurements.ToString(CultureInfo.InvariantCulture) + " uiWrites=" + ((MarkerRuntimePerformanceSnapshot)(ref val)).UiLayoutWrites.ToString(CultureInfo.InvariantCulture) + " diagnostics=" + ((MarkerRuntimePerformanceSnapshot)(ref val)).DiagnosticRecords.ToString(CultureInfo.InvariantCulture) + " heavyMsTotal=" + ((MarkerRuntimePerformanceSnapshot)(ref val)).HeavySolveMilliseconds.ToString("F3", CultureInfo.InvariantCulture) + " heavyMsMax=" + ((MarkerRuntimePerformanceSnapshot)(ref val)).MaxHeavySolveMilliseconds.ToString("F3", CultureInfo.InvariantCulture))); } } private void LogInfo(string message) { if (_config.DiagnosticLogging.Value) { _performance.RecordDiagnosticRecord(); _log.LogInfo((object)("[ItemShareFix] " + message)); } } private static int CurrentStageToken() { Run instance = Run.instance; if ((Object)(object)instance == (Object)null) { return -1; } object member = ParticipantIdentityResolver.GetMember(instance, "stageClearCount"); try { return (member != null) ? Convert.ToInt32(member, CultureInfo.InvariantCulture) : 0; } catch { return 0; } } } internal sealed class CompatibilityResult { public bool Supported { get; set; } public string Reason { get; set; } = string.Empty; public Assembly? ItemShareAssembly { get; set; } public Assembly? PickupShareApiAssembly { get; set; } public MethodInfo? DisconnectMethod { get; set; } } internal static class CompatibilityGuard { internal const string ExpectedItemShareSha256 = "48C25FE558CB095B2AC73836BE0563EBFDCD1C481AF9263D9D3740618F160F38"; internal const string ExpectedPickupShareApiSha256 = "5EF4AC9457DB29BDA76C5DB110914EA14720ADE65DC6D5E48359B3DF8DED7F1D"; public static CompatibilityResult Probe(ManualLogSource log) { try { Assembly assembly = AppDomain.CurrentDomain.GetAssemblies().FirstOrDefault((Assembly x) => string.Equals(x.GetName().Name, "ItemShare", StringComparison.Ordinal)); if (assembly == null) { return Fail("ItemShare assembly is not loaded."); } if (assembly.GetName().Version?.ToString() != "1.7.1.0") { return Fail("Unsupported ItemShare assembly version: " + assembly.GetName().Version); } string text = HashAssembly(assembly); if (!string.Equals(text, "48C25FE558CB095B2AC73836BE0563EBFDCD1C481AF9263D9D3740618F160F38", StringComparison.OrdinalIgnoreCase)) { return Fail("ItemShare.dll SHA-256 mismatch: " + text); } Assembly assembly2 = AppDomain.CurrentDomain.GetAssemblies().FirstOrDefault((Assembly x) => string.Equals(x.GetName().Name, "PickupShareApi", StringComparison.Ordinal)); if (assembly2 == null) { return Fail("PickupShareApi assembly is not loaded."); } if (assembly2.GetName().Version?.ToString() != "1.0.0.0") { return Fail("Unsupported PickupShareApi assembly version: " + assembly2.GetName().Version); } string text2 = HashAssembly(assembly2); if (!string.Equals(text2, "5EF4AC9457DB29BDA76C5DB110914EA14720ADE65DC6D5E48359B3DF8DED7F1D", StringComparison.OrdinalIgnoreCase)) { return Fail("PickupShareApi.dll SHA-256 mismatch: " + text2); } Type type = assembly2.GetType("PickupShare.PickupShareApi", throwOnError: false); object obj = type?.GetProperty("ApiVersion", BindingFlags.Static | BindingFlags.Public)?.GetValue(null); if (obj == null) { obj = type?.GetField("ApiVersion", BindingFlags.Static | BindingFlags.Public)?.GetValue(null); } if (Convert.ToInt32(obj, CultureInfo.InvariantCulture) != 1) { return Fail("PickupShareApi contract is not ApiVersion 1."); } Type type2 = assembly.GetType("ItemShare.ItemSharePlugin", throwOnError: false); Type type3 = assembly.GetType("ItemShare.ClientPickMirror", throwOnError: false); Type type4 = assembly.GetType("ItemShare.ItemShareStateProvider", throwOnError: false); Type type5 = assembly2.GetType("PickupShare.PickupClassifier", throwOnError: false); if (type2 == null || type3 == null || type4 == null || type5 == null) { return Fail("Required exact ItemShare 1.7.1 / PickupShareApi 1.0.0 types are missing."); } string[] array = new string[7] { "Claims", "Distributed", "Choices", "_mode", "_hideCollectedOrbs", "_shareToDead", "_shareCommandPicks" }; foreach (string text3 in array) { if (type2.GetField(text3, BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic) == null) { return Fail("Required ItemShare field missing: " + text3); } } (string, int, Type)[] array2 = new(string, int, Type)[11] { ("OnAttemptGrant", 3, typeof(void)), ("GrantIndividual", 5, typeof(void)), ("GrantInstant", 5, typeof(void)), ("GiveDirect", 3, typeof(bool)), ("IsDown", 1, typeof(bool)), ("OnPickupSelected", 3, typeof(void)), ("IsShareable", 1, typeof(bool)), ("BroadcastOrbState", 2, typeof(void)), ("ApplyOrbVisibility", 2, typeof(void)), ("LocalPlayersHaveTaken", 1, typeof(bool)), ("RefreshOrbVisibility", 0, typeof(void)) }; for (int num = 0; num < array2.Length; num++) { (string Name, int ParameterCount, Type ReturnType) shape = array2[num]; if ((from x in type2.GetMethods(BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic) where string.Equals(x.Name, shape.Name, StringComparison.Ordinal) && x.GetParameters().Length == shape.ParameterCount && x.ReturnType == shape.ReturnType select x).ToArray().Length != 1) { return Fail("Required ItemShare method shape mismatch: " + shape.Name + "/" + shape.ParameterCount + " -> " + shape.ReturnType.Name); } } if (!HasExactOriginalDelegateHookShape(type2.GetMethods(BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic).Single((MethodInfo x) => string.Equals(x.Name, "OnAttemptGrant", StringComparison.Ordinal) && x.GetParameters().Length == 3 && x.ReturnType == typeof(void)), typeof(GenericPickupController), typeof(CharacterBody))) { return Fail("ItemShare OnAttemptGrant exact orig/self/body delegate shape mismatch."); } if (!HasExactOriginalDelegateHookShape(type2.GetMethods(BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic).Single((MethodInfo x) => string.Equals(x.Name, "OnPickupSelected", StringComparison.Ordinal) && x.GetParameters().Length == 3 && x.ReturnType == typeof(void)), typeof(PickupPickerController), typeof(int))) { return Fail("ItemShare OnPickupSelected exact orig/self/choiceIndex delegate shape mismatch."); } if (type4.GetMethods(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic).SingleOrDefault((MethodInfo x) => string.Equals(x.Name, "TransferOrbState", StringComparison.Ordinal) && x.GetParameters().Length == 2 && x.ReturnType == typeof(bool)) == null) { return Fail("ItemShare provider TransferOrbState(int,int)->bool private shape missing."); } array = new string[2] { "Orbs", "Cubes" }; foreach (string text4 in array) { if (type3.GetField(text4, BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic) == null) { return Fail("ItemShare ClientPickMirror." + text4 + " private shape missing."); } } MethodInfo method = type5.GetMethod("IsCommandCube", BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic, null, new Type[1] { typeof(PickupPickerController) }, null); if (method == null || method.ReturnType != typeof(bool)) { return Fail("PickupShareApi PickupClassifier.IsCommandCube(PickupPickerController)->bool shape missing."); } MethodInfo methodInfo = type?.GetMethod("HasPickerState", BindingFlags.Static | BindingFlags.Public, null, new Type[1] { typeof(int) }, null); if (methodInfo == null || methodInfo.ReturnType != typeof(bool)) { return Fail("PickupShareApi HasPickerState(int)->bool public shape missing."); } if (typeof(PickupPickerController).GetField("options", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic) == null) { return Fail("RoR2 PickupPickerController.options exact choice-data field missing."); } FieldInfo fieldInfo = typeof(PickupPickerController).GetNestedType("Option", BindingFlags.Public | BindingFlags.NonPublic)?.GetField("pickup", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); if (fieldInfo == null || fieldInfo.FieldType != typeof(UniquePickup)) { return Fail("RoR2 PickupPickerController.Option.pickup : UniquePickup exact field missing."); } PropertyInfo property = typeof(UniquePickup).GetProperty("isTempItem", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); if (property == null || property.PropertyType != typeof(bool) || property.GetIndexParameters().Length != 0) { return Fail("RoR2 UniquePickup.isTempItem : bool exact property missing."); } object obj2 = type?.GetProperty("HasProvider", BindingFlags.Static | BindingFlags.Public)?.GetValue(null); string text5 = type?.GetProperty("ProviderName", BindingFlags.Static | BindingFlags.Public)?.GetValue(null)?.ToString(); if (!(obj2 is bool) || !(bool)obj2) { return Fail("PickupShareApi has no registered provider; ItemShare must remain the sole provider."); } if (string.IsNullOrEmpty(text5) || !text5.StartsWith("ItemShare", StringComparison.Ordinal)) { return Fail("PickupShareApi provider is not ItemShare: " + (text5 ?? "")); } Assembly assembly3 = typeof(Run).Assembly; if (!HasStableNetworkUserIdShape(assembly3, out string reason)) { return Fail("Stable NetworkUserId identity shape unsupported: " + reason); } Type type6 = assembly3.GetType("RoR2.LocalUserManager", throwOnError: false); if (type6 == null) { return Fail("RoR2.LocalUserManager type missing."); } if ((MemberInfo?)(((object)type6.GetProperty("readOnlyLocalUsersList", BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic)) ?? ((object)type6.GetField("readOnlyLocalUsersList", BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic))) == null) { return Fail("RoR2.LocalUserManager.readOnlyLocalUsersList shape missing; personal visibility cannot safely resolve local identity."); } MethodInfo methodInfo2 = FindDisconnectMethod(assembly3); if (methodInfo2 == null) { return Fail("No supported network-destroy observation callback shape was found (NetworkUser/PlayerCharacterMasterController OnNetworkDestroy). DisconnectCleanup must fail closed."); } log.LogInfo((object)("[ItemShareFix] compatibility guard PASS: exact ItemShare 1.7.1 + PickupShareApi 1.0.0 / API 1 + Command picker shapes; disconnect candidate hook=" + methodInfo2.DeclaringType?.FullName + "." + methodInfo2.Name)); return new CompatibilityResult { Supported = true, Reason = "Exact baseline and private shapes verified.", ItemShareAssembly = assembly, PickupShareApiAssembly = assembly2, DisconnectMethod = methodInfo2 }; } catch (Exception ex) { return Fail("Compatibility probe exception: " + ex); } } private static bool HasExactOriginalDelegateHookShape(MethodInfo hookMethod, Type selfType, Type payloadType) { ParameterInfo[] parameters = hookMethod.GetParameters(); if (parameters.Length != 3 || parameters[1].ParameterType != selfType || parameters[2].ParameterType != payloadType) { return false; } Type parameterType = parameters[0].ParameterType; if (!typeof(Delegate).IsAssignableFrom(parameterType)) { return false; } MethodInfo method = parameterType.GetMethod("Invoke", BindingFlags.Instance | BindingFlags.Public); if (method == null || method.ReturnType != typeof(void)) { return false; } ParameterInfo[] parameters2 = method.GetParameters(); if (parameters2.Length == 2 && parameters2[0].ParameterType == selfType) { return parameters2[1].ParameterType == payloadType; } return false; } private static bool HasStableNetworkUserIdShape(Assembly ror2Assembly, out string reason) { reason = string.Empty; Type type = ror2Assembly.GetType("RoR2.NetworkUser", throwOnError: false); Type type2 = ror2Assembly.GetType("RoR2.NetworkUserId", throwOnError: false); Type platformIdType = ror2Assembly.GetType("RoR2.PlatformID", throwOnError: false); if (type == null || type2 == null || platformIdType == null) { reason = "NetworkUser/NetworkUserId/PlatformID type missing"; return false; } PropertyInfo property = type.GetProperty("id", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); FieldInfo field = type.GetField("id", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); if (((property != null) ? property.PropertyType : field?.FieldType) != type2) { reason = "NetworkUser.id is missing or not RoR2.NetworkUserId"; return false; } if ((from x in type2.GetMembers(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic) where (x is FieldInfo fieldInfo && fieldInfo.FieldType == platformIdType) || (x is PropertyInfo propertyInfo && propertyInfo.GetIndexParameters().Length == 0 && propertyInfo.PropertyType == platformIdType) select x).ToArray().Length == 0) { reason = "NetworkUserId has no PlatformID member"; return false; } if ((from x in type2.GetMembers(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic) where (x is FieldInfo fieldInfo && fieldInfo.FieldType == typeof(byte)) || (x is PropertyInfo propertyInfo && propertyInfo.GetIndexParameters().Length == 0 && propertyInfo.PropertyType == typeof(byte)) select x).ToArray().Length == 0) { reason = "NetworkUserId has no byte player-controller slot member"; return false; } PropertyInfo? property2 = platformIdType.GetProperty("value", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); FieldInfo field2 = platformIdType.GetField("value", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); if (property2 == null && field2 == null) { reason = "PlatformID.value missing"; return false; } return true; } private static MethodInfo? FindDisconnectMethod(Assembly ror2Assembly) { string[] array = new string[2] { "RoR2.NetworkUser", "RoR2.PlayerCharacterMasterController" }; foreach (string name in array) { MethodInfo methodInfo = ror2Assembly.GetType(name, throwOnError: false)?.GetMethod("OnNetworkDestroy", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); if (methodInfo != null && methodInfo.GetParameters().Length == 0) { return methodInfo; } } return null; } private static string HashAssembly(Assembly assembly) { string location = assembly.Location; if (string.IsNullOrEmpty(location) || !File.Exists(location)) { throw new InvalidOperationException("Assembly has no hashable on-disk location: " + assembly.FullName); } using FileStream inputStream = File.OpenRead(location); using SHA256 sHA = SHA256.Create(); return BitConverter.ToString(sHA.ComputeHash(inputStream)).Replace("-", string.Empty); } private static CompatibilityResult Fail(string reason) { return new CompatibilityResult { Supported = false, Reason = reason }; } } [BepInPlugin("com.itemsharefix", "ItemShareFix", "1.0.0")] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] public sealed class ItemShareFixPlugin : BaseUnityPlugin { public const string PluginGuid = "com.itemsharefix"; public const string PluginName = "ItemShareFix"; public const string PluginVersion = "1.0.0"; private Harmony? _harmony; private PluginConfig? _config; private ServerCoordinator? _server; private ClientPresentationCoordinator? _presentation; private bool _active; private int _riskOfOptionsLocalizationWarmupFrames; private void Awake() { //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Expected O, but got Unknown _config = new PluginConfig(((BaseUnityPlugin)this).Config); if (!_config.Enabled.Value) { ((BaseUnityPlugin)this).Logger.LogInfo((object)"[ItemShareFix] disabled by configuration."); return; } CompatibilityResult compatibilityResult = CompatibilityGuard.Probe(((BaseUnityPlugin)this).Logger); if (!compatibilityResult.Supported) { ((BaseUnityPlugin)this).Logger.LogError((object)("[ItemShareFix] FAIL-CLOSED: " + compatibilityResult.Reason)); ((Behaviour)this).enabled = false; return; } try { if (RemoteOperationProbe.TryVerifyRuntimeShape(out string evidence)) { ((BaseUnityPlugin)this).Logger.LogInfo((object)("[ItemShareFix] Remote Operation runtime shape PASS: " + evidence)); } else { ((BaseUnityPlugin)this).Logger.LogWarning((object)("[ItemShareFix] Remote Operation runtime shape unavailable; Support Drone classification will fail closed: " + evidence)); } UpstreamBridge upstream = new UpstreamBridge(compatibilityResult.ItemShareAssembly, compatibilityResult.PickupShareApiAssembly, ((BaseUnityPlugin)this).Logger); _server = new ServerCoordinator(_config, upstream, ((BaseUnityPlugin)this).Logger); _presentation = new ClientPresentationCoordinator(_config, upstream, ((BaseUnityPlugin)this).Logger); _harmony = new Harmony("com.itemsharefix"); RuntimePatches.Install(_harmony, compatibilityResult, _server, _presentation); _active = true; ((BaseUnityPlugin)this).Logger.LogInfo((object)"[ItemShareFix] world-space marker clustering active: adaptive LOD, Detailed default / Compact optional presentation, HUD/modal suppression enabled. Gameplay/share ownership remains unchanged."); } catch (Exception ex) { ((BaseUnityPlugin)this).Logger.LogError((object)("[ItemShareFix] initialization failed closed: " + ex)); try { Harmony? harmony = _harmony; if (harmony != null) { harmony.UnpatchSelf(); } } catch { } _presentation?.RestoreAll(); _active = false; ((Behaviour)this).enabled = false; } } private void FixedUpdate() { if (_active && _config != null) { if (!_config.Enabled.Value) { _presentation?.RestoreAll(); return; } _server?.Tick(); _presentation?.Tick(); } } private void Update() { if (_config != null) { if (_riskOfOptionsLocalizationWarmupFrames < 3) { _riskOfOptionsLocalizationWarmupFrames++; } if (_riskOfOptionsLocalizationWarmupFrames >= 3) { OptionalRiskOfOptionsIntegration.TryRegister(_config, ((BaseUnityPlugin)this).Logger); OptionalRiskOfOptionsIntegration.TryRefreshLocalization(((BaseUnityPlugin)this).Logger); } } if (_active && _presentation != null) { _presentation.RecordUnityUpdate(); _presentation.RenderFrame(); } } private void OnDestroy() { _active = false; try { _presentation?.Dispose(); } catch { } try { Harmony? harmony = _harmony; if (harmony != null) { harmony.UnpatchSelf(); } } catch { } } } internal sealed class LocalHudPresentationProbe { private sealed class MessageHudCandidate { public RectTransform Root { get; } public TMP_Text[] Texts { get; } public Selectable[] Selectables { get; } public Vector3[] Corners { get; } = (Vector3[])(object)new Vector3[4]; public MessageHudCandidate(RectTransform root) { Root = root; Texts = ((Component)root).GetComponentsInChildren(true); Selectables = ((Component)root).GetComponentsInChildren(true); } } internal static readonly string[] BlockingModalTypeNames = new string[3] { "RoR2.UI.PauseScreenController", "RoR2.UI.SimpleDialogBox", "RoR2.UI.PickupPickerPanel" }; private static readonly string[] MessageHudTypeNames = new string[3] { "RoR2.UI.ChatBox", "RoR2.UI.ChatBoxController", "RoR2.UI.HUDChat" }; private readonly Type[] _blockingModalTypes; private readonly Type[] _messageHudTypes; private readonly Type? _hudType; private readonly MarkerRuntimePerformanceCounters _performance; private readonly List _blockingModalComponents = new List(); private readonly HashSet _blockingModalIds = new HashSet(); private readonly List _messageHudRoots = new List(); private readonly HashSet _messageRootIds = new HashSet(); private float _nextBlockingDiscovery; private float _nextMessageDiscovery; private bool _blockingLifecycleInvalidated = true; private bool _messageLifecycleInvalidated = true; private bool _lastPauseSignal; public LocalHudPresentationProbe(MarkerRuntimePerformanceCounters performance) { _performance = performance ?? throw new ArgumentNullException("performance"); Assembly assembly = typeof(Run).Assembly; _blockingModalTypes = ResolveComponentTypes(assembly, BlockingModalTypeNames); _messageHudTypes = ResolveComponentTypes(assembly, MessageHudTypeNames); Type type = assembly.GetType("RoR2.UI.HUD", throwOnError: false); _hudType = ((type != null && typeof(Component).IsAssignableFrom(type)) ? type : null); } public void InvalidateLifecycle() { _blockingLifecycleInvalidated = true; _messageLifecycleInvalidated = true; _nextBlockingDiscovery = 0f; _nextMessageDiscovery = 0f; _blockingModalComponents.Clear(); _blockingModalIds.Clear(); _messageHudRoots.Clear(); _messageRootIds.Clear(); } public void ObserveBlockingModalLifecycle(Component? component) { //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) if ((Object)(object)component == (Object)null || (Object)(object)component.gameObject == (Object)null) { return; } bool num = IsKnownBlockingModalType(((object)component).GetType()); Scene scene = component.gameObject.scene; bool flag = ((Scene)(ref scene)).IsValid(); if (BlockingModalLifecyclePolicy.ShouldSeedObservedCandidate(num, flag)) { int instanceID = ((Object)component).GetInstanceID(); if (BlockingModalLifecyclePolicy.ShouldAddObservedInstance(_blockingModalIds.Contains(instanceID))) { _blockingModalIds.Add(instanceID); _blockingModalComponents.Add(component); } _blockingLifecycleInvalidated = false; _nextBlockingDiscovery = Time.unscaledTime + 5f; } } public bool TryGetBlockingModal(out string reason) { RefreshBlockingModalCandidates(); for (int i = 0; i < _blockingModalComponents.Count; i++) { Component val = _blockingModalComponents[i]; if (IsLiveActiveComponent(val)) { string name = ((object)val).GetType().Name; reason = ((name.IndexOf("Pause", StringComparison.OrdinalIgnoreCase) >= 0) ? "pause-menu" : ((name.IndexOf("PickupPickerPanel", StringComparison.OrdinalIgnoreCase) >= 0) ? "command-picker-modal" : "blocking-modal")); return true; } } reason = string.Empty; return false; } public bool TryGetVisibleMessageHudRect(out MarkerHudRect rect) { //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) RefreshMessageHudCandidates(); bool flag = false; float num = float.PositiveInfinity; float num2 = float.NegativeInfinity; float num3 = float.PositiveInfinity; float num4 = float.NegativeInfinity; for (int i = 0; i < _messageHudRoots.Count; i++) { MessageHudCandidate messageHudCandidate = _messageHudRoots[i]; RectTransform root = messageHudCandidate.Root; if (!((Object)(object)root == (Object)null) && !((Object)(object)((Component)root).gameObject == (Object)null) && ((Component)root).gameObject.activeInHierarchy) { Scene scene = ((Component)root).gameObject.scene; if (((Scene)(ref scene)).IsValid() && HasVisibleMessageContent(messageHudCandidate) && TryBuildScreenRect(root, messageHudCandidate.Corners, out var rect2)) { flag = true; num = Mathf.Min(num, ((MarkerHudRect)(ref rect2)).Left); num2 = Mathf.Max(num2, ((MarkerHudRect)(ref rect2)).Right); num3 = Mathf.Min(num3, ((MarkerHudRect)(ref rect2)).Bottom); num4 = Mathf.Max(num4, ((MarkerHudRect)(ref rect2)).Top); } } } if (!flag) { rect = default(MarkerHudRect); return false; } rect = FromEdges(num, num2, num3, num4); if (((MarkerHudRect)(ref rect)).Width > 1f) { return ((MarkerHudRect)(ref rect)).Height > 1f; } return false; } private void RefreshBlockingModalCandidates() { //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) bool flag = PruneBlockingModalCandidates(); bool flag2 = Time.timeScale <= 0.001f; bool flag3 = flag2 != _lastPauseSignal; _lastPauseSignal = flag2; flag3 = flag3 || flag; float unscaledTime = Time.unscaledTime; if (!MarkerFramePipelinePolicy.ShouldRunGlobalUiDiscovery(_blockingLifecycleInvalidated, flag3, _blockingModalComponents.Count == 0, unscaledTime, _nextBlockingDiscovery)) { return; } _blockingLifecycleInvalidated = false; _nextBlockingDiscovery = unscaledTime + 5f; _blockingModalComponents.Clear(); _blockingModalIds.Clear(); _performance.RecordGlobalHudDiscovery(); for (int i = 0; i < _blockingModalTypes.Length; i++) { Type type = _blockingModalTypes[i]; try { Object[] array = Resources.FindObjectsOfTypeAll(type); foreach (Object obj in array) { Component val = (Component)(object)((obj is Component) ? obj : null); if (val != null && (Object)(object)val.gameObject != (Object)null) { Scene scene = val.gameObject.scene; if (((Scene)(ref scene)).IsValid()) { AddBlockingModalCandidate(val); } } } } catch { } } } private void RefreshMessageHudCandidates() { //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_0140: Unknown result type (might be due to invalid IL or missing references) //IL_0145: Unknown result type (might be due to invalid IL or missing references) bool flag = PruneMessageHudCandidates(); float unscaledTime = Time.unscaledTime; if (!MarkerFramePipelinePolicy.ShouldRunGlobalUiDiscovery(_messageLifecycleInvalidated, flag, _messageHudRoots.Count == 0, unscaledTime, _nextMessageDiscovery)) { return; } _messageLifecycleInvalidated = false; _nextMessageDiscovery = unscaledTime + 8f; _messageHudRoots.Clear(); _messageRootIds.Clear(); _performance.RecordGlobalHudDiscovery(); Scene scene; for (int i = 0; i < _messageHudTypes.Length; i++) { Type type = _messageHudTypes[i]; try { Object[] array = Resources.FindObjectsOfTypeAll(type); foreach (Object obj in array) { Component val = (Component)(object)((obj is Component) ? obj : null); if (val != null && !((Object)(object)val.gameObject == (Object)null)) { scene = val.gameObject.scene; if (((Scene)(ref scene)).IsValid()) { Transform transform = val.transform; AddMessageRoot((RectTransform?)(object)((transform is RectTransform) ? transform : null)); } } } } catch { } } if (_messageHudRoots.Count > 0 || _hudType == null) { return; } try { Object[] array = Resources.FindObjectsOfTypeAll(_hudType); foreach (Object obj3 in array) { Component val2 = (Component)(object)((obj3 is Component) ? obj3 : null); if (val2 == null || (Object)(object)val2.gameObject == (Object)null) { continue; } scene = val2.gameObject.scene; if (!((Scene)(ref scene)).IsValid()) { continue; } RectTransform[] componentsInChildren = val2.GetComponentsInChildren(true); foreach (RectTransform root in componentsInChildren) { if (LooksLikeMessageHud(root)) { AddMessageRoot(root); } } } } catch { } } private void AddBlockingModalCandidate(Component component) { //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) if ((Object)(object)component == (Object)null || (Object)(object)component.gameObject == (Object)null) { return; } Scene scene = component.gameObject.scene; if (((Scene)(ref scene)).IsValid()) { int instanceID = ((Object)component).GetInstanceID(); if (_blockingModalIds.Add(instanceID)) { _blockingModalComponents.Add(component); } } } private bool IsKnownBlockingModalType(Type type) { for (int i = 0; i < _blockingModalTypes.Length; i++) { Type type2 = _blockingModalTypes[i]; if (type2 == type || type2.IsAssignableFrom(type)) { return true; } } return false; } private void AddMessageRoot(RectTransform? root) { //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) if ((Object)(object)root == (Object)null || (Object)(object)((Component)root).gameObject == (Object)null) { return; } Scene scene = ((Component)root).gameObject.scene; if (!((Scene)(ref scene)).IsValid()) { return; } int instanceID = ((Object)root).GetInstanceID(); if (!_messageRootIds.Add(instanceID)) { return; } try { _messageHudRoots.Add(new MessageHudCandidate(root)); } catch { } } private bool PruneBlockingModalCandidates() { bool result = false; for (int num = _blockingModalComponents.Count - 1; num >= 0; num--) { Component val = _blockingModalComponents[num]; if (!((Object)(object)val != (Object)null) || !((Object)(object)val.gameObject != (Object)null)) { try { if (val != null) { _blockingModalIds.Remove(((Object)val).GetInstanceID()); } } catch { } _blockingModalComponents.RemoveAt(num); result = true; } } return result; } private bool PruneMessageHudCandidates() { bool result = false; for (int num = _messageHudRoots.Count - 1; num >= 0; num--) { RectTransform root = _messageHudRoots[num].Root; if (!((Object)(object)root != (Object)null) || !((Object)(object)((Component)root).gameObject != (Object)null)) { _messageHudRoots.RemoveAt(num); result = true; } } return result; } private static Type[] ResolveComponentTypes(Assembly assembly, IEnumerable names) { List list = new List(); foreach (string name in names) { Type type = assembly.GetType(name, throwOnError: false); if (type != null && typeof(Component).IsAssignableFrom(type)) { list.Add(type); } } return list.ToArray(); } private static bool LooksLikeMessageHud(RectTransform root) { if ((Object)(object)root == (Object)null) { return false; } string text = (((Object)((Component)root).gameObject).name ?? string.Empty).Replace(" ", string.Empty).Replace("_", string.Empty).ToLowerInvariant(); if (text.Contains("chatbox") || text.Contains("chatfeed") || text.Contains("messagefeed") || text.Contains("chatlog")) { return true; } Component[] components = ((Component)root).GetComponents(); foreach (Component val in components) { if (!((Object)(object)val == (Object)null)) { string text2 = ((object)val).GetType().Name.ToLowerInvariant(); if (text2.Contains("chatbox") || text2.Contains("chatfeed")) { return true; } } } return false; } private static bool IsLiveActiveComponent(Component? component) { //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) if (!((Object)(object)component == (Object)null) && !((Object)(object)component.gameObject == (Object)null)) { Scene scene = component.gameObject.scene; if (((Scene)(ref scene)).IsValid() && component.gameObject.activeInHierarchy) { Behaviour val = (Behaviour)(object)((component is Behaviour) ? component : null); if (val != null && !val.enabled) { return false; } return EffectiveCanvasGroupAlpha(component.transform) > 0.04f; } } return false; } private static bool HasVisibleMessageContent(MessageHudCandidate candidate) { //IL_005e: Unknown result type (might be due to invalid IL or missing references) float num = EffectiveCanvasGroupAlpha((Transform)(object)candidate.Root); if (num <= 0.04f) { return false; } for (int i = 0; i < candidate.Texts.Length; i++) { TMP_Text val = candidate.Texts[i]; if (!((Object)(object)val == (Object)null) && !((Object)(object)((Component)val).gameObject == (Object)null) && ((Component)val).gameObject.activeInHierarchy && ((Behaviour)val).enabled && !string.IsNullOrWhiteSpace(val.text)) { float num2 = num * ((Graphic)val).color.a; try { num2 *= ((Graphic)val).canvasRenderer.GetAlpha(); } catch { } if (num2 > 0.04f) { return true; } } } for (int j = 0; j < candidate.Selectables.Length; j++) { Selectable val2 = candidate.Selectables[j]; if (!((Object)(object)val2 == (Object)null) && !((Object)(object)((Component)val2).gameObject == (Object)null) && ((Component)val2).gameObject.activeInHierarchy && ((object)val2).GetType().Name.IndexOf("InputField", StringComparison.OrdinalIgnoreCase) >= 0 && ((UIBehaviour)val2).IsActive()) { return true; } } return false; } private static float EffectiveCanvasGroupAlpha(Transform transform) { float num = 1f; Transform val = transform; while ((Object)(object)val != (Object)null) { CanvasGroup component = ((Component)val).GetComponent(); if ((Object)(object)component != (Object)null) { num *= Mathf.Clamp01(component.alpha); } val = val.parent; } return num; } private static bool TryBuildScreenRect(RectTransform root, Vector3[] corners, out MarkerHudRect rect) { //IL_0001: 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_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0078: 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_0097: 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_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_0177: Unknown result type (might be due to invalid IL or missing references) //IL_017c: Unknown result type (might be due to invalid IL or missing references) rect = default(MarkerHudRect); try { root.GetWorldCorners(corners); } catch { return false; } Canvas componentInParent = ((Component)root).GetComponentInParent(); Camera val = (((Object)(object)componentInParent != (Object)null && (int)componentInParent.renderMode != 0) ? componentInParent.worldCamera : null); float num = float.PositiveInfinity; float num2 = float.NegativeInfinity; float num3 = float.PositiveInfinity; float num4 = float.NegativeInfinity; for (int i = 0; i < corners.Length; i++) { Vector2 val2 = RectTransformUtility.WorldToScreenPoint(val, corners[i]); if (!IsFinite(val2.x) || !IsFinite(val2.y)) { return false; } num = Mathf.Min(num, val2.x); num2 = Mathf.Max(num2, val2.x); num3 = Mathf.Min(num3, val2.y); num4 = Mathf.Max(num4, val2.y); } if (num2 - num < 8f || num4 - num3 < 8f) { return false; } float num5 = Mathf.Max(8f, Mathf.Min((float)Screen.width / 1920f, (float)Screen.height / 1080f) * 12f); num = Mathf.Clamp(num - num5, 0f, (float)Screen.width); num2 = Mathf.Clamp(num2 + num5, 0f, (float)Screen.width); num3 = Mathf.Clamp(num3 - num5, 0f, (float)Screen.height); num4 = Mathf.Clamp(num4 + num5, 0f, (float)Screen.height); rect = FromEdges(num, num2, num3, num4); if (((MarkerHudRect)(ref rect)).Width > 1f) { return ((MarkerHudRect)(ref rect)).Height > 1f; } return false; } private static MarkerHudRect FromEdges(float left, float right, float bottom, float top) { //IL_002c: Unknown result type (might be due to invalid IL or missing references) return new MarkerHudRect((left + right) * 0.5f, (bottom + top) * 0.5f, Math.Max(0f, right - left), Math.Max(0f, top - bottom)); } private static bool IsFinite(float value) { if (!float.IsNaN(value)) { return !float.IsInfinity(value); } return false; } } internal readonly struct MarkerOptionLocalizedText { public string Name { get; } public string Description { get; } public MarkerOptionLocalizedText(string name, string description) { Name = name; Description = description; } } internal static class MarkerRiskOfOptionsLocalization { public static readonly string[] SupportedLanguages = A("en", "fr", "it", "de", "es", "ja", "ko", "pt-BR", "ru", "zh-CN", "tr"); public static readonly string[] VisibleOptionKeys = A("PersonalMarkersEnabled", "MarkerPresentationMode", "ShareTemporaryItems", "ShowMarkerDistance", "MarkerScale", "MarkerOpacity", "MarkerBackgroundOpacity", "ShowMarkerCategoryDiamond", "MarkerDetailRows", "MarkerCategorySortOrder", "MarkerCompactShowCount", "EnableOffscreenIndicators", "ShowOffscreenDistance", "ShowOffscreenTotalCount", "OffscreenIndicatorScale", "OffscreenIndicatorOpacity", "OffscreenEdgePadding", "Common", "Uncommon", "Legendary", "Boss", "Lunar", "Void", "Equipment", "Command", "Neutral", "OffscreenIndicator"); private static readonly Dictionary OptionNames = new Dictionary(StringComparer.Ordinal) { ["PersonalMarkersEnabled"] = A("Enable markers", "Enable markers", "Enable markers", "Enable markers", "Enable markers", "Enable markers", "Enable markers", "Enable markers", "Enable markers", "Enable markers", "Enable markers"), ["MarkerPresentationMode"] = A("Marker mode", "Mode des marqueurs", "Modalità indicatori", "Markierungsmodus", "Modo de marcadores", "マーカーモード", "마커 모드", "Modo dos marcadores", "Режим меток", "标记模式", "İşaretçi modu"), ["ShareTemporaryItems"] = A("Share temporary items", "Share temporary items", "Share temporary items", "Share temporary items", "Share temporary items", "Share temporary items", "Share temporary items", "Share temporary items", "Раздавать временные предметы", "Share temporary items", "Share temporary items"), ["ShowMarkerDistance"] = A("Show distance", "Afficher la distance", "Mostra distanza", "Entfernung anzeigen", "Mostrar distancia", "距離を表示", "거리 표시", "Mostrar distância", "Показывать расстояние", "显示距离", "Mesafeyi göster"), ["MarkerScale"] = A("Marker scale", "Échelle des marqueurs", "Scala indicatori", "Markierungsgröße", "Escala de marcadores", "マーカーサイズ", "마커 크기", "Escala dos marcadores", "Масштаб меток", "标记缩放", "İşaretçi ölçeği"), ["MarkerOpacity"] = A("Marker opacity", "Opacité des marqueurs", "Opacità indicatori", "Markierungsdeckkraft", "Opacidad de marcadores", "マーカー不透明度", "마커 불투명도", "Opacidade dos marcadores", "Прозрачность меток", "标记不透明度", "İşaretçi opaklığı"), ["MarkerBackgroundOpacity"] = A("Background opacity", "Opacité du fond", "Opacità sfondo", "Hintergrunddeckkraft", "Opacidad del fondo", "背景の不透明度", "배경 불투명도", "Opacidade do fundo", "Прозрачность фона", "背景不透明度", "Arka plan opaklığı"), ["ShowMarkerCategoryDiamond"] = A("Category diamonds", "Losanges de catégorie", "Diamanti categoria", "Kategorie-Rauten", "Diamantes de categoría", "カテゴリーダイヤ", "카테고리 다이아몬드", "Diamantes de categoria", "Ромбы категорий", "类别菱形", "Kategori elmasları"), ["MarkerDetailRows"] = A("Detailed item rows", "Lignes d’objets détaillées", "Righe oggetti dettagliate", "Detaillierte Gegenstandszeilen", "Filas de objetos detalladas", "詳細アイテム行", "상세 아이템 행", "Linhas detalhadas de itens", "Строки предметов", "详细物品行", "Ayrıntılı eşya satırları"), ["MarkerCategorySortOrder"] = A("Category sort", "Tri des catégories", "Ordine categorie", "Kategoriereihenfolge", "Orden de categorías", "カテゴリー順", "카테고리 정렬", "Ordem das categorias", "Сортировка категорий", "类别排序", "Kategori sırası"), ["MarkerCompactShowCount"] = A("Compact counts", "Comptes compacts", "Conteggi compatti", "Kompakte Anzahlen", "Conteos compactos", "コンパクト個数", "컴팩트 개수", "Contagens compactas", "Счётчики Compact", "紧凑计数", "Kompakt sayılar"), ["EnableOffscreenIndicators"] = A("Off-screen indicators", "Indicateurs hors écran", "Indicatori fuori schermo", "Offscreen-Anzeigen", "Indicadores fuera de pantalla", "画面外インジケーター", "화면 밖 표시기", "Indicadores fora da tela", "Заэкранные указатели", "屏外指示器", "Ekran dışı göstergeler"), ["ShowOffscreenDistance"] = A("Off-screen distance", "Distance hors écran", "Distanza fuori schermo", "Offscreen-Entfernung", "Distancia fuera de pantalla", "画面外距離", "화면 밖 거리", "Distância fora da tela", "Заэкранное расстояние", "屏外距离", "Ekran dışı mesafe"), ["ShowOffscreenTotalCount"] = A("Off-screen total", "Total hors écran", "Totale fuori schermo", "Offscreen-Gesamtzahl", "Total fuera de pantalla", "画面外合計", "화면 밖 총계", "Total fora da tela", "Заэкранное количество", "屏外总数", "Ekran dışı toplam"), ["OffscreenIndicatorScale"] = A("Off-screen scale", "Échelle hors écran", "Scala fuori schermo", "Offscreen-Größe", "Escala fuera de pantalla", "画面外サイズ", "화면 밖 크기", "Escala fora da tela", "Масштаб заэкранных", "屏外缩放", "Ekran dışı ölçek"), ["OffscreenIndicatorOpacity"] = A("Off-screen opacity", "Opacité hors écran", "Opacità fuori schermo", "Offscreen-Deckkraft", "Opacidad fuera de pantalla", "画面外不透明度", "화면 밖 불투명도", "Opacidade fora da tela", "Прозрачность заэкранных", "屏外不透明度", "Ekran dışı opaklık"), ["OffscreenEdgePadding"] = A("Edge padding", "Marge du bord", "Margine bordo", "Randabstand", "Margen del borde", "端の余白", "가장자리 여백", "Margem da borda", "Отступ от края", "边缘间距", "Kenar boşluğu"), ["Common"] = A("Common color", "Couleur commune", "Colore comune", "Gewöhnlich-Farbe", "Color común", "コモン色", "일반 색상", "Cor comum", "Цвет обычных", "普通颜色", "Yaygın renk"), ["Uncommon"] = A("Uncommon color", "Couleur inhabituelle", "Colore non comune", "Ungewöhnlich-Farbe", "Color poco común", "アンコモン色", "고급 색상", "Cor incomum", "Цвет необычных", "罕见颜色", "Sıradışı renk"), ["Legendary"] = A("Legendary color", "Couleur légendaire", "Colore leggendario", "Legendär-Farbe", "Color legendario", "レジェンダリー色", "전설 색상", "Cor lendária", "Цвет легендарных", "传奇颜色", "Efsanevi renk"), ["Boss"] = A("Boss color", "Couleur boss", "Colore boss", "Boss-Farbe", "Color de jefe", "ボス色", "보스 색상", "Cor de chefe", "Цвет боссовых", "首领颜色", "Boss rengi"), ["Lunar"] = A("Lunar color", "Couleur lunaire", "Colore lunare", "Lunar-Farbe", "Color lunar", "ルナ色", "루나 색상", "Cor lunar", "Цвет лунных", "月球颜色", "Ay rengi"), ["Void"] = A("Void color", "Couleur du Vide", "Colore Vuoto", "Leeren-Farbe", "Color del Vacío", "ヴォイド色", "공허 색상", "Cor do Vazio", "Цвет Бездны", "虚空颜色", "Hiçlik rengi"), ["Equipment"] = A("Equipment color", "Couleur équipement", "Colore equipaggiamento", "Ausrüstungsfarbe", "Color de equipo", "装備色", "장비 색상", "Cor de equipamento", "Цвет снаряжения", "装备颜色", "Ekipman rengi"), ["Command"] = A("Command color", "Couleur Commande", "Colore Comando", "Command-Farbe", "Color de Comando", "コマンド色", "지휘 색상", "Cor de Comando", "Цвет Command", "命令颜色", "Komut rengi"), ["Neutral"] = A("Neutral color", "Couleur neutre", "Colore neutro", "Neutral-Farbe", "Color neutro", "ニュートラル色", "중립 색상", "Cor neutra", "Нейтральный цвет", "中性颜色", "Nötr renk"), ["OffscreenIndicator"] = A("Off-screen arrow color", "Couleur flèche hors écran", "Colore freccia fuori schermo", "Offscreen-Pfeilfarbe", "Color de flecha fuera de pantalla", "画面外矢印色", "화면 밖 화살표 색상", "Cor da seta fora da tela", "Цвет заэкранной стрелки", "屏外箭头颜色", "Ekran dışı ok rengi") }; private static readonly string[] MarkerCategoryNames = A("Markers", "Marqueurs", "Indicatori", "Markierungen", "Marcadores", "マーカー", "마커", "Marcadores", "Метки", "标记", "İşaretçiler"); private static readonly string[] GeneralCategoryNames = A("General", "General", "General", "General", "General", "General", "General", "General", "Общие", "General", "General"); private static readonly string[] MarkerColorCategoryNames = A("Marker Colors", "Couleurs des marqueurs", "Colori indicatori", "Markierungsfarben", "Colores de marcadores", "マーカー色", "마커 색상", "Cores dos marcadores", "Цвета меток", "标记颜色", "İşaretçi renkleri"); private static readonly Dictionary OptionDescriptions = new Dictionary(StringComparer.Ordinal) { ["PersonalMarkersEnabled"] = A("Enable ItemShareFix automatic pickup and Command markers. Disable this to keep ItemShareFix fixes active without showing ItemShareFix markers.", "Enable ItemShareFix automatic pickup and Command markers. Disable this to keep ItemShareFix fixes active without showing ItemShareFix markers.", "Enable ItemShareFix automatic pickup and Command markers. Disable this to keep ItemShareFix fixes active without showing ItemShareFix markers.", "Enable ItemShareFix automatic pickup and Command markers. Disable this to keep ItemShareFix fixes active without showing ItemShareFix markers.", "Enable ItemShareFix automatic pickup and Command markers. Disable this to keep ItemShareFix fixes active without showing ItemShareFix markers.", "Enable ItemShareFix automatic pickup and Command markers. Disable this to keep ItemShareFix fixes active without showing ItemShareFix markers.", "Enable ItemShareFix automatic pickup and Command markers. Disable this to keep ItemShareFix fixes active without showing ItemShareFix markers.", "Enable ItemShareFix automatic pickup and Command markers. Disable this to keep ItemShareFix fixes active without showing ItemShareFix markers.", "Enable ItemShareFix automatic pickup and Command markers. Disable this to keep ItemShareFix fixes active without showing ItemShareFix markers.", "Enable ItemShareFix automatic pickup and Command markers. Disable this to keep ItemShareFix fixes active without showing ItemShareFix markers.", "Enable ItemShareFix automatic pickup and Command markers. Disable this to keep ItemShareFix fixes active without showing ItemShareFix markers."), ["ShareTemporaryItems"] = A("Share temporary item pickups through ItemShare. Disable this to give temporary pickups vanilla first-come-first-served behavior instead of ItemShare distribution.", "Share temporary item pickups through ItemShare. Disable this to give temporary pickups vanilla first-come-first-served behavior instead of ItemShare distribution.", "Share temporary item pickups through ItemShare. Disable this to give temporary pickups vanilla first-come-first-served behavior instead of ItemShare distribution.", "Share temporary item pickups through ItemShare. Disable this to give temporary pickups vanilla first-come-first-served behavior instead of ItemShare distribution.", "Share temporary item pickups through ItemShare. Disable this to give temporary pickups vanilla first-come-first-served behavior instead of ItemShare distribution.", "Share temporary item pickups through ItemShare. Disable this to give temporary pickups vanilla first-come-first-served behavior instead of ItemShare distribution.", "Share temporary item pickups through ItemShare. Disable this to give temporary pickups vanilla first-come-first-served behavior instead of ItemShare distribution.", "Share temporary item pickups through ItemShare. Disable this to give temporary pickups vanilla first-come-first-served behavior instead of ItemShare distribution.", "Раздавать временные предметы через ItemShare. Если выключено, временные предметы получают ванильное поведение: предмет достаётся первому подобравшему игроку без распределения ItemShare.", "Share temporary item pickups through ItemShare. Disable this to give temporary pickups vanilla first-come-first-served behavior instead of ItemShare distribution.", "Share temporary item pickups through ItemShare. Disable this to give temporary pickups vanilla first-come-first-served behavior instead of ItemShare distribution."), ["MarkerPresentationMode"] = A("Choose Detailed exact-item rows or Compact category-diamond summaries.", "Choisit les lignes d’objets exactes en mode Détaillé ou les résumés par losanges en mode Compact.", "Sceglie righe oggetto esatte in Dettagliato o riepiloghi a diamanti in Compatto.", "Wählt exakte Gegenstandszeilen in Detailliert oder Kategorie-Rauten in Kompakt.", "Elige filas de objetos exactos en Detallado o resúmenes de diamantes en Compacto.", "詳細では正確なアイテム行、コンパクトではカテゴリーダイヤの要約を表示します。", "상세에서는 정확한 아이템 행을, 컴팩트에서는 카테고리 다이아몬드 요약을 표시합니다.", "Escolhe linhas exatas de itens em Detalhado ou resumos por diamantes em Compacto.", "Выбирает точные строки предметов в подробном режиме или сводку ромбами категорий в компактном.", "详细模式显示精确物品行,紧凑模式显示类别菱形摘要。", "Ayrıntılı modda tam eşya satırlarını, Kompakt modda kategori elması özetlerini seçer."), ["ShowMarkerDistance"] = A("Show the world distance under in-FOV marker content.", "Affiche la distance sous le contenu des marqueurs visibles.", "Mostra la distanza sotto il contenuto dei marker visibili.", "Zeigt die Weltdistanz unter sichtbaren Markierungen.", "Muestra la distancia bajo el contenido de marcadores visibles.", "画面内マーカーの内容の下に距離を表示します。", "화면 안 마커 내용 아래에 거리를 표시합니다.", "Mostra a distância abaixo do conteúdo dos marcadores visíveis.", "Показывает расстояние под содержимым метки в поле зрения.", "在视野内标记内容下方显示世界距离。", "Görüş içindeki işaretçi içeriğinin altında dünya mesafesini gösterir."), ["MarkerScale"] = A("Scale marker UI only; world membership and clustering are unchanged.", "Ajuste uniquement l’échelle de l’interface des marqueurs sans modifier le regroupement.", "Ridimensiona solo l’interfaccia dei marker senza cambiare il raggruppamento.", "Skaliert nur die Marker-UI; Weltzuordnung und Cluster bleiben unverändert.", "Escala solo la interfaz de marcadores; no cambia la agrupación.", "マーカーUIのみを拡大縮小し、ワールド所属やクラスタは変更しません。", "마커 UI만 크기 조절하며 월드 멤버십과 클러스터링은 바뀌지 않습니다.", "Ajusta apenas a interface dos marcadores; associação e agrupamento não mudam.", "Меняет только масштаб интерфейса меток, не затрагивая состав и кластеризацию.", "仅缩放标记界面,不改变世界成员关系或聚类。", "Yalnızca işaretçi arayüzünü ölçekler; dünya üyeliği ve kümeler değişmez."), ["MarkerOpacity"] = A("Set the opacity of on-screen world markers.", "Règle l’opacité des marqueurs du monde à l’écran.", "Imposta l’opacità dei marker del mondo sullo schermo.", "Legt die Deckkraft der sichtbaren Weltmarkierungen fest.", "Ajusta la opacidad de los marcadores del mundo en pantalla.", "画面内ワールドマーカーの不透明度を設定します。", "화면 내 월드 마커의 불투명도를 설정합니다.", "Define a opacidade dos marcadores do mundo na tela.", "Задаёт непрозрачность экранных мировых меток.", "设置屏幕内世界标记的不透明度。", "Ekrandaki dünya işaretçilerinin opaklığını ayarlar."), ["MarkerBackgroundOpacity"] = A("Set marker card background opacity; zero keeps the transparent HUD style.", "Règle l’opacité du fond des cartes; zéro conserve le style transparent.", "Imposta l’opacità dello sfondo; zero mantiene lo stile trasparente.", "Legt die Karten-Hintergrunddeckkraft fest; null behält den transparenten Stil.", "Ajusta la opacidad del fondo; cero mantiene el estilo transparente.", "マーカーカード背景の不透明度を設定し、0で透明スタイルを維持します。", "마커 카드 배경 불투명도를 설정하며 0은 투명 스타일을 유지합니다.", "Define a opacidade do fundo; zero mantém o estilo transparente.", "Задаёт непрозрачность фона карточки; ноль сохраняет прозрачный стиль.", "设置标记卡片背景不透明度;0 保持透明样式。", "Kart arka plan opaklığını ayarlar; sıfır saydam HUD stilini korur."), ["ShowMarkerCategoryDiamond"] = A("Show or hide category diamonds without changing marker text or membership.", "Affiche ou masque les losanges sans modifier le texte ni l’appartenance.", "Mostra o nasconde i diamanti senza cambiare testo o appartenenza.", "Blendet Kategorie-Rauten ein/aus, ohne Text oder Zugehörigkeit zu ändern.", "Muestra u oculta diamantes sin cambiar texto ni pertenencia.", "テキストや所属を変えずにカテゴリーダイヤを表示・非表示にします。", "텍스트나 멤버십을 바꾸지 않고 카테고리 다이아몬드를 표시하거나 숨깁니다.", "Mostra ou oculta diamantes sem alterar texto ou associação.", "Показывает или скрывает ромбы категорий, не меняя текст и состав метки.", "显示或隐藏类别菱形,不改变文本或成员关系。", "Metin veya üyeliği değiştirmeden kategori elmaslarını gösterir ya da gizler."), ["MarkerDetailRows"] = A("Limit visible distinct item types in ordinary Detailed markers before the localized overflow row.", "Limite les types d’objets distincts visibles avant la ligne de débordement localisée.", "Limita i tipi di oggetti distinti visibili prima della riga di overflow localizzata.", "Begrenzt sichtbare unterschiedliche Gegenstandstypen vor der lokalisierten Überlaufzeile.", "Limita los tipos de objetos distintos visibles antes de la fila de desbordamiento localizada.", "通常の詳細マーカーで表示する異なるアイテム種類数を、ローカライズ済み省略行の前まで制限します。", "일반 상세 마커에서 현지화된 초과 행 전까지 표시할 서로 다른 아이템 종류 수를 제한합니다.", "Limita os tipos distintos visíveis antes da linha localizada de excedentes.", "Ограничивает число видимых различных типов предметов до локализованной строки переполнения.", "限制普通详细标记中可见的不同物品类型数量,超出部分显示本地化省略行。", "Normal Ayrıntılı işaretçilerde yerelleştirilmiş taşma satırından önce görünen farklı eşya türlerini sınırlar."), ["MarkerCategorySortOrder"] = A("Choose category display order; LowToHigh is the exact reverse of HighToLow.", "Choisit l’ordre des catégories; Faible→Élevé inverse exactement Élevé→Faible.", "Sceglie l’ordine categorie; Basso→Alto è l’esatto inverso di Alto→Basso.", "Wählt die Kategorienreihenfolge; Niedrig→Hoch ist die exakte Umkehrung.", "Elige el orden de categorías; Bajo→Alto es el inverso exacto de Alto→Bajo.", "カテゴリ表示順を選びます。低→高は高→低の完全な逆順です。", "카테고리 표시 순서를 선택합니다. 낮음→높음은 높음→낮음의 정확한 역순입니다.", "Escolhe a ordem das categorias; Baixo→Alto é o inverso exato de Alto→Baixo.", "Выбирает порядок категорий; «от низкого к высокому» — точный обратный порядок.", "选择类别显示顺序;从低到高是从高到低的完全反序。", "Kategori sırasını seçer; Düşükten yükseğe, Yüksekten düşüğün tam tersidir."), ["MarkerCompactShowCount"] = A("Show each category subtotal beside its Compact diamond; no overall total is added.", "Affiche le sous-total de chaque catégorie près de son losange Compact, sans total général.", "Mostra il subtotale di ogni categoria accanto al diamante Compatto, senza totale generale.", "Zeigt jede Kategorie-Zwischensumme an ihrer Kompakt-Raute ohne Gesamtsumme.", "Muestra el subtotal de cada categoría junto a su diamante Compacto, sin total general.", "各コンパクトダイヤの横にカテゴリ小計を表示し、全体合計は追加しません。", "각 컴팩트 다이아몬드 옆에 카테고리 소계를 표시하며 전체 합계는 추가하지 않습니다.", "Mostra o subtotal de cada categoria junto ao diamante Compacto, sem total geral.", "Показывает счётчик каждой категории возле её ромба Compact без общего total.", "在每个紧凑类别菱形旁显示小计,不添加总计。", "Her Kompakt kategori elmasının yanında ara toplamı gösterir; genel toplam eklemez."), ["EnableOffscreenIndicators"] = A("Show one restrained directional arrow per occupied broad off-screen direction.", "Affiche une flèche directionnelle limitée par grande direction hors écran occupée.", "Mostra una freccia direzionale contenuta per ogni ampia direzione fuori schermo occupata.", "Zeigt einen zurückhaltenden Richtungspfeil pro belegter grober Offscreen-Richtung.", "Muestra una flecha direccional contenida por cada dirección amplia fuera de pantalla ocupada.", "占有されている大まかな画面外方向ごとに、抑制された矢印を1つ表示します。", "점유된 넓은 화면 밖 방향마다 절제된 방향 화살표 하나를 표시합니다.", "Mostra uma seta direcional discreta por direção ampla ocupada fora da tela.", "Показывает по одной сдержанной стрелке на занятое широкое заэкранное направление.", "每个有内容的宽泛屏外方向显示一个克制的方向箭头。", "Dolu her geniş ekran dışı yön için tek, ölçülü bir yön oku gösterir."), ["ShowOffscreenDistance"] = A("Show the nearest represented pending distance on each off-screen arrow.", "Affiche sur chaque flèche la distance du pending représenté le plus proche.", "Mostra su ogni freccia la distanza pending rappresentata più vicina.", "Zeigt an jedem Pfeil die nächste repräsentierte ausstehende Entfernung.", "Muestra en cada flecha la distancia pendiente representada más cercana.", "各画面外矢印に、代表される保留対象の最短距離を表示します。", "각 화면 밖 화살표에 대표된 보류 대상 중 가장 가까운 거리를 표시합니다.", "Mostra em cada seta a menor distância pendente representada.", "Показывает на каждой стрелке ближайшее расстояние среди представленных pending-целей.", "在每个屏外箭头上显示所代表待处理目标中的最近距离。", "Her ekran dışı okta temsil edilen en yakın bekleyen mesafeyi gösterir."), ["ShowOffscreenTotalCount"] = A("Optionally show the represented sector total once on each off-screen arrow.", "Affiche facultativement une fois le total du secteur représenté sur chaque flèche.", "Mostra facoltativamente una volta il totale del settore rappresentato su ogni freccia.", "Zeigt optional einmal die repräsentierte Sektorsumme an jedem Pfeil.", "Muestra opcionalmente una vez el total del sector representado en cada flecha.", "各画面外矢印に、そのセクターの代表合計数を任意で1回表示します。", "각 화면 밖 화살표에 대표 섹터 총수를 선택적으로 한 번 표시합니다.", "Mostra opcionalmente uma vez o total do setor representado em cada seta.", "Опционально показывает один общий счётчик представленного сектора на каждой стрелке.", "可选地在每个屏外箭头上仅显示一次所代表扇区的总数。", "Her ekran dışı okta temsil edilen sektör toplamını isteğe bağlı olarak bir kez gösterir."), ["OffscreenIndicatorScale"] = A("Scale off-screen directional arrows only; directional ownership is unchanged.", "Ajuste uniquement l’échelle des flèches hors écran sans changer leur propriété directionnelle.", "Ridimensiona solo le frecce fuori schermo senza cambiarne la proprietà direzionale.", "Skaliert nur Offscreen-Pfeile; die Richtungszuordnung bleibt unverändert.", "Escala solo las flechas fuera de pantalla; la propiedad direccional no cambia.", "画面外方向矢印のみを拡大縮小し、方向所有は変更しません。", "화면 밖 방향 화살표만 크기 조절하며 방향 소유권은 바뀌지 않습니다.", "Ajusta apenas as setas fora da tela; a associação direcional não muda.", "Меняет только масштаб заэкранных стрелок, не затрагивая directional ownership.", "仅缩放屏外方向箭头,不改变方向归属。", "Yalnızca ekran dışı yön oklarını ölçekler; yön sahipliği değişmez."), ["OffscreenIndicatorOpacity"] = A("Set the opacity of off-screen directional arrows.", "Règle l’opacité des flèches directionnelles hors écran.", "Imposta l’opacità delle frecce direzionali fuori schermo.", "Legt die Deckkraft der Offscreen-Richtungspfeile fest.", "Ajusta la opacidad de las flechas direccionales fuera de pantalla.", "画面外方向矢印の不透明度を設定します。", "화면 밖 방향 화살표의 불투명도를 설정합니다.", "Define a opacidade das setas direcionais fora da tela.", "Задаёт непрозрачность заэкранных направляющих стрелок.", "设置屏外方向箭头的不透明度。", "Ekran dışı yön oklarının opaklığını ayarlar."), ["OffscreenEdgePadding"] = A("Keep off-screen arrows this many pixels away from the screen edge.", "Maintient les flèches hors écran à cette distance en pixels du bord.", "Mantiene le frecce fuori schermo a questa distanza in pixel dal bordo.", "Hält Offscreen-Pfeile um diese Pixelzahl vom Bildschirmrand entfernt.", "Mantiene las flechas fuera de pantalla a esta distancia en píxeles del borde.", "画面外矢印を画面端から指定ピクセル分内側に保ちます。", "화면 밖 화살표를 화면 가장자리에서 지정 픽셀만큼 안쪽에 유지합니다.", "Mantém as setas fora da tela a esta distância em pixels da borda.", "Держит заэкранные стрелки на указанном расстоянии в пикселях от края экрана.", "使屏外箭头与屏幕边缘保持指定像素距离。", "Ekran dışı okları ekran kenarından bu kadar piksel uzakta tutar."), ["Common"] = A("Set the color used for common/white item markers.", "Définit la couleur utilisée pour les marqueurs d’objets communs/blancs.", "Imposta il colore usato per marker oggetti comuni/bianchi.", "Legt die Farbe für gewöhnliche/weiße Gegenstandsmarker fest.", "Ajusta el color usado para marcadores de objetos comunes/blancos.", "コモン/白アイテムのマーカーに使用する色を設定します。", "일반/흰색 아이템 마커에 사용할 색상을 설정합니다.", "Define a cor usada para marcadores de itens comuns/brancos.", "Задаёт цвет для метки обычных/белых предметов.", "设置用于普通/白色物品标记的颜色。", "yaygın/beyaz eşya işaretçileri için kullanılan rengi ayarlar."), ["Uncommon"] = A("Set the color used for uncommon/green item markers.", "Définit la couleur utilisée pour les marqueurs d’objets inhabituels/verts.", "Imposta il colore usato per marker oggetti non comuni/verdi.", "Legt die Farbe für ungewöhnliche/grüne Gegenstandsmarker fest.", "Ajusta el color usado para marcadores de objetos poco comunes/verdes.", "アンコモン/緑アイテムのマーカーに使用する色を設定します。", "고급/초록 아이템 마커에 사용할 색상을 설정합니다.", "Define a cor usada para marcadores de itens incomuns/verdes.", "Задаёт цвет для метки необычных/зелёных предметов.", "设置用于罕见/绿色物品标记的颜色。", "sıradışı/yeşil eşya işaretçileri için kullanılan rengi ayarlar."), ["Legendary"] = A("Set the color used for legendary/red item markers.", "Définit la couleur utilisée pour les marqueurs d’objets légendaires/rouges.", "Imposta il colore usato per marker oggetti leggendari/rossi.", "Legt die Farbe für legendäre/rote Gegenstandsmarker fest.", "Ajusta el color usado para marcadores de objetos legendarios/rojos.", "レジェンダリー/赤アイテムのマーカーに使用する色を設定します。", "전설/빨간 아이템 마커에 사용할 색상을 설정합니다.", "Define a cor usada para marcadores de itens lendários/vermelhos.", "Задаёт цвет для метки легендарных/красных предметов.", "设置用于传奇/红色物品标记的颜色。", "efsanevi/kırmızı eşya işaretçileri için kullanılan rengi ayarlar."), ["Boss"] = A("Set the color used for boss item markers.", "Définit la couleur utilisée pour les marqueurs d’objets de boss.", "Imposta il colore usato per marker oggetti boss.", "Legt die Farbe für Boss-Gegenstandsmarker fest.", "Ajusta el color usado para marcadores de objetos de jefe.", "ボスアイテムのマーカーに使用する色を設定します。", "보스 아이템 마커에 사용할 색상을 설정합니다.", "Define a cor usada para marcadores de itens de chefe.", "Задаёт цвет для метки боссовых предметов.", "设置用于首领物品标记的颜色。", "boss eşyası işaretçileri için kullanılan rengi ayarlar."), ["Lunar"] = A("Set the color used for lunar and lunar-equipment markers.", "Définit la couleur utilisée pour les marqueurs lunaires et d’équipement lunaire.", "Imposta il colore usato per marker lunari e equipaggiamento lunare.", "Legt die Farbe für Lunar- und Lunar-Ausrüstungsmarker fest.", "Ajusta el color usado para marcadores lunares y de equipo lunar.", "ルナおよびルナ装備マーカーに使用する色を設定します。", "루나 및 루나 장비 마커에 사용할 색상을 설정합니다.", "Define a cor usada para marcadores lunares e de equipamento lunar.", "Задаёт цвет для метки лунных предметов и лунного снаряжения.", "设置用于月球物品和月球装备标记的颜色。", "ay ve ay ekipmanı işaretçileri için kullanılan rengi ayarlar."), ["Void"] = A("Set the color used for Void item markers.", "Définit la couleur utilisée pour les marqueurs d’objets du Vide.", "Imposta il colore usato per marker oggetti del Vuoto.", "Legt die Farbe für Leeren-Gegenstandsmarker fest.", "Ajusta el color usado para marcadores de objetos del Vacío.", "ヴォイドアイテムのマーカーに使用する色を設定します。", "공허 아이템 마커에 사용할 색상을 설정합니다.", "Define a cor usada para marcadores de itens do Vazio.", "Задаёт цвет для метки предметов Бездны.", "设置用于虚空物品标记的颜色。", "Hiçlik eşyası işaretçileri için kullanılan rengi ayarlar."), ["Equipment"] = A("Set the color used for equipment markers.", "Définit la couleur utilisée pour les marqueurs d’équipement.", "Imposta il colore usato per marker equipaggiamento.", "Legt die Farbe für Ausrüstungsmarker fest.", "Ajusta el color usado para marcadores de equipo.", "装備マーカーに使用する色を設定します。", "장비 마커에 사용할 색상을 설정합니다.", "Define a cor usada para marcadores de equipamento.", "Задаёт цвет для метки снаряжения.", "设置用于装备标记的颜色。", "ekipman işaretçileri için kullanılan rengi ayarlar."), ["Command"] = A("Set the color used for Artifact of Command unresolved-choice markers.", "Définit la couleur utilisée pour les marqueurs de choix non résolus de l’Artéfact de Commande.", "Imposta il colore usato per marker di scelta irrisolta dell’Artefatto del Comando.", "Legt die Farbe für Marker für ungelöste Artefakt-des-Kommandos-Auswahlen fest.", "Ajusta el color usado para marcadores de elección sin resolver del Artefacto de Comando.", "コマンドのアーティファクト未解決選択マーカーに使用する色を設定します。", "지휘의 유물 미결 선택 마커에 사용할 색상을 설정합니다.", "Define a cor usada para marcadores de escolha não resolvida do Artefato do Comando.", "Задаёт цвет для метки незавершённого выбора Артефакта Command.", "设置用于命令神器未解决选择标记的颜色。", "Komut Eseri çözülmemiş seçim işaretçileri için kullanılan rengi ayarlar."), ["Neutral"] = A("Set the color used for mixed, unknown, and other markers.", "Définit la couleur utilisée pour les marqueurs mixtes, inconnus et autres.", "Imposta il colore usato per marker misti, sconosciuti e altri.", "Legt die Farbe für gemischte, unbekannte und sonstige Marker fest.", "Ajusta el color usado para marcadores mixtos, desconocidos y otros.", "混合・不明・その他のマーカーに使用する色を設定します。", "혼합/알 수 없음/기타 마커에 사용할 색상을 설정합니다.", "Define a cor usada para marcadores mistos, desconhecidos e outros.", "Задаёт цвет для смешанные, неизвестные и прочие метки.", "设置用于混合、未知及其他标记的颜色。", "karışık, bilinmeyen ve diğer işaretçiler için kullanılan rengi ayarlar."), ["OffscreenIndicator"] = A("Set the color used for off-screen directional arrows.", "Définit la couleur utilisée pour les flèches directionnelles hors écran.", "Imposta il colore usato per frecce direzionali fuori schermo.", "Legt die Farbe für Offscreen-Richtungspfeile fest.", "Ajusta el color usado para flechas direccionales fuera de pantalla.", "画面外方向矢印に使用する色を設定します。", "화면 밖 방향 화살표에 사용할 색상을 설정합니다.", "Define a cor usada para setas direcionais fora da tela.", "Задаёт цвет для заэкранные направляющие стрелки.", "设置用于屏外方向箭头的颜色。", "ekran dışı yön okları için kullanılan rengi ayarlar.") }; private static readonly string[][] PresentationChoices = new string[2][] { A("Detailed", "Détaillé", "Dettagliato", "Detailliert", "Detallado", "詳細", "상세", "Detalhado", "Подробный", "详细", "Ayrıntılı"), A("Compact", "Compact", "Compatto", "Kompakt", "Compacto", "コンパクト", "컴팩트", "Compacto", "Компактный", "紧凑", "Kompakt") }; private static readonly string[][] SortOrderChoices = new string[2][] { A("High to low", "Élevé vers faible", "Alto → basso", "Hoch nach niedrig", "Alto a bajo", "高→低", "높음→낮음", "Alto para baixo", "От высокого к низкому", "从高到低", "Yüksekten düşüğe"), A("Low to high", "Faible vers élevé", "Basso → alto", "Niedrig nach hoch", "Bajo a alto", "低→高", "낮음→높음", "Baixo para alto", "От низкого к высокому", "从低到高", "Düşükten yükseğe") }; public static MarkerOptionLocalizedText Resolve(ConfigEntryBase entry) { return ResolveForLanguage(entry.Definition.Key, ResolveLanguageIndex()); } public static string ResolveCategory(ConfigEntryBase entry) { if (!string.Equals(entry.Definition.Key, "ShareTemporaryItems", StringComparison.Ordinal)) { return ResolveCategoryForLanguage(entry.Definition.Section, ResolveLanguageIndex()); } return GeneralCategoryNames[NormalizeLanguageIndex(ResolveLanguageIndex())]; } internal static string ResolveCategoryForLanguage(string section, int languageIndex) { int num = NormalizeLanguageIndex(languageIndex); if (!string.Equals(section, "Marker Colors", StringComparison.Ordinal)) { return MarkerCategoryNames[num]; } return MarkerColorCategoryNames[num]; } internal static string CurrentLanguageKey() { return NormalizeLanguageKey(Language.currentLanguageName); } internal static MarkerOptionLocalizedText ResolveForLanguage(string key, int languageIndex) { int num = NormalizeLanguageIndex(languageIndex); if (!OptionNames.TryGetValue(key, out string[] value)) { value = A(key, key, key, key, key, key, key, key, key, key, key); } if (!OptionDescriptions.TryGetValue(key, out string[] value2)) { value2 = A("ItemShareFix marker option.", "Option de marqueur ItemShareFix.", "Opzione marker ItemShareFix.", "ItemShareFix-Markeroption.", "Opción de marcador ItemShareFix.", "ItemShareFix マーカー設定。", "ItemShareFix 마커 옵션.", "Opção de marcador ItemShareFix.", "Параметр меток ItemShareFix.", "ItemShareFix 标记选项。", "ItemShareFix işaretçi seçeneği."); } return new MarkerOptionLocalizedText(value[num], value2[num]); } public static string[] PresentationModeChoices() { return ChoiceForLanguage(PresentationChoices, ResolveLanguageIndex()); } public static string[] SortChoices() { return ChoiceForLanguage(SortOrderChoices, ResolveLanguageIndex()); } private static string[] ChoiceForLanguage(string[][] table, int languageIndex) { int num = NormalizeLanguageIndex(languageIndex); string[] array = new string[table.Length]; for (int i = 0; i < table.Length; i++) { array[i] = table[i][num]; } return array; } private static int NormalizeLanguageIndex(int index) { if (index < 0 || index >= SupportedLanguages.Length) { return 0; } return index; } private static int ResolveLanguageIndex() { return ResolveLanguageIndexForName(Language.currentLanguageName); } internal static int ResolveLanguageIndexForName(string? raw) { string text = NormalizeLanguageKey(raw); if (text.Contains("french") || text.StartsWith("fr")) { return 1; } if (text.Contains("italian") || text.StartsWith("it")) { return 2; } if (text.Contains("german") || text.StartsWith("de")) { return 3; } if (text.Contains("spanish") || text.StartsWith("es")) { return 4; } if (text.Contains("japanese") || text.StartsWith("ja")) { return 5; } if (text.Contains("korean") || text.StartsWith("ko")) { return 6; } if (text.Contains("portuguese") || text.StartsWith("pt")) { return 7; } if (text.Contains("russian") || text.StartsWith("ru")) { return 8; } if (text.Contains("chinese") || text.StartsWith("zh")) { return 9; } if (text.Contains("turkish") || text.StartsWith("tr")) { return 10; } return 0; } private static string NormalizeLanguageKey(string? raw) { return (raw ?? string.Empty).Trim().ToLowerInvariant(); } private static string[] A(params string[] values) { return values; } } internal readonly struct MarkerRenderInput { public PersonalMarkerIdentity Identity { get; } public Vector3 WorldPosition { get; } public int DistanceMeters { get; } public string Label { get; } public string ItemSemanticKey { get; } public string ClassName { get; } public MarkerClassKind Kind { get; } public Color NativeColor { get; } public Sprite? NativeIcon { get; } public MarkerLifetimeKind Lifetime { get; } public long StableKey { get { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0009: 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_0018: Unknown result type (might be due to invalid IL or missing references) PersonalMarkerIdentity identity = Identity; long num = (long)((PersonalMarkerIdentity)(ref identity)).Kind << 32; identity = Identity; return num | (uint)((PersonalMarkerIdentity)(ref identity)).InstanceId; } } public MarkerRenderInput(PersonalMarkerIdentity identity, Vector3 worldPosition, int distanceMeters, string label, string itemSemanticKey, string className, MarkerClassKind kind, Color nativeColor, Sprite? nativeIcon = null, MarkerLifetimeKind lifetime = (MarkerLifetimeKind)0) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0009: 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_004b: 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_0053: 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_0063: Unknown result type (might be due to invalid IL or missing references) Identity = identity; WorldPosition = worldPosition; DistanceMeters = distanceMeters; Label = label ?? string.Empty; ItemSemanticKey = itemSemanticKey ?? string.Empty; ClassName = className ?? "UNKNOWN"; Kind = kind; NativeColor = nativeColor; NativeIcon = nativeIcon; Lifetime = lifetime; } } internal readonly struct MarkerRenderDiagnostic { public MarkerRenderInput Input { get; } public long ClusterKey { get; } public string MemberFingerprint { get; } public int ClusterTotal { get; } public string SemanticText { get; } public MarkerHudPlacement Placement { get; } public MarkerHudVisualFootprint Footprint { get; } public float LabelPreferredWidth { get; } public bool UsedMeasurementFallback { get; } public MarkerHudProjection SourceProjection { get; } public int ClusterHiddenCount => Math.Max(0, ClusterTotal - 1); public int StackSlot { get { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) MarkerHudPlacement placement = Placement; return ((MarkerHudPlacement)(ref placement)).StackSlot; } } public MarkerRenderDiagnostic(MarkerRenderInput input, long clusterKey, string memberFingerprint, int clusterTotal, string semanticText, MarkerHudPlacement placement, MarkerHudVisualFootprint footprint, float labelPreferredWidth, bool usedMeasurementFallback, MarkerHudProjection sourceProjection) { //IL_003e: 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) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) Input = input; ClusterKey = clusterKey; MemberFingerprint = memberFingerprint ?? string.Empty; ClusterTotal = Math.Max(0, clusterTotal); SemanticText = semanticText ?? string.Empty; Placement = placement; Footprint = footprint; LabelPreferredWidth = labelPreferredWidth; UsedMeasurementFallback = usedMeasurementFallback; SourceProjection = sourceProjection; } } public enum MarkerIndicatorShape { AnchorDiamond, DirectionArrow } public sealed class MarkerIndicatorGraphic : MaskableGraphic { private MarkerIndicatorShape _shape; public MarkerIndicatorShape Shape { get { return _shape; } set { if (_shape != value) { _shape = value; ((Graphic)this).SetVerticesDirty(); } } } protected override void OnPopulateMesh(VertexHelper vh) { //IL_0007: 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) //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_0034: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: 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_0051: 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_006d: Unknown result type (might be due to invalid IL or missing references) vh.Clear(); Rect pixelAdjustedRect = ((Graphic)this).GetPixelAdjustedRect(); float num = ((Rect)(ref pixelAdjustedRect)).width * 0.5f; float num2 = ((Rect)(ref pixelAdjustedRect)).height * 0.5f; Color32 color = Color32.op_Implicit(((Graphic)this).color); if (_shape == MarkerIndicatorShape.AnchorDiamond) { AddVertex(vh, 0f, num2, color); AddVertex(vh, num, 0f, color); AddVertex(vh, 0f, 0f - num2, color); AddVertex(vh, 0f - num, 0f, color); vh.AddTriangle(0, 1, 2); vh.AddTriangle(0, 2, 3); return; } AddVertex(vh, 0f, num2, color); AddVertex(vh, num, (0f - num2) * 0.12f, color); AddVertex(vh, num * 0.28f, (0f - num2) * 0.12f, color); AddVertex(vh, num * 0.28f, 0f - num2, color); AddVertex(vh, (0f - num) * 0.28f, 0f - num2, color); AddVertex(vh, (0f - num) * 0.28f, (0f - num2) * 0.12f, color); AddVertex(vh, 0f - num, (0f - num2) * 0.12f, color); vh.AddTriangle(0, 1, 2); vh.AddTriangle(0, 2, 5); vh.AddTriangle(0, 5, 6); vh.AddTriangle(2, 3, 4); vh.AddTriangle(2, 4, 5); } private static void AddVertex(VertexHelper vh, float x, float y, Color32 color) { //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_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) vh.AddVert(new Vector3(x, y, 0f), color, Vector4.op_Implicit(Vector2.zero)); } } public sealed class MarkerAssociationCueGraphic : MaskableGraphic { protected override void OnPopulateMesh(VertexHelper vh) { //IL_0007: 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) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //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) vh.Clear(); Rect pixelAdjustedRect = ((Graphic)this).GetPixelAdjustedRect(); Color32 val = Color32.op_Implicit(((Graphic)this).color); vh.AddVert(new Vector3(((Rect)(ref pixelAdjustedRect)).xMin, ((Rect)(ref pixelAdjustedRect)).yMin, 0f), val, Vector4.op_Implicit(Vector2.zero)); vh.AddVert(new Vector3(((Rect)(ref pixelAdjustedRect)).xMax, ((Rect)(ref pixelAdjustedRect)).yMin, 0f), val, Vector4.op_Implicit(Vector2.zero)); vh.AddVert(new Vector3(((Rect)(ref pixelAdjustedRect)).xMax, ((Rect)(ref pixelAdjustedRect)).yMax, 0f), val, Vector4.op_Implicit(Vector2.zero)); vh.AddVert(new Vector3(((Rect)(ref pixelAdjustedRect)).xMin, ((Rect)(ref pixelAdjustedRect)).yMax, 0f), val, Vector4.op_Implicit(Vector2.zero)); vh.AddTriangle(0, 1, 2); vh.AddTriangle(0, 2, 3); } } public sealed class MarkerLifetimeIndicatorGraphic : MaskableGraphic { public const string AssetSourceToken = "local-maskablegraphic-clock"; private const int RingSegments = 20; protected override void OnPopulateMesh(VertexHelper vh) { //IL_0007: 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) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0089: 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_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_00a9: 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_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_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0105: 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_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_0172: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_0194: Unknown result type (might be due to invalid IL or missing references) //IL_019c: Unknown result type (might be due to invalid IL or missing references) //IL_01a1: Unknown result type (might be due to invalid IL or missing references) //IL_01a6: Unknown result type (might be due to invalid IL or missing references) //IL_01ad: 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) //IL_01bd: Unknown result type (might be due to invalid IL or missing references) //IL_01c2: Unknown result type (might be due to invalid IL or missing references) //IL_01c7: Unknown result type (might be due to invalid IL or missing references) //IL_01ce: Unknown result type (might be due to invalid IL or missing references) //IL_01d3: Unknown result type (might be due to invalid IL or missing references) //IL_01d8: Unknown result type (might be due to invalid IL or missing references) vh.Clear(); Rect pixelAdjustedRect = ((Graphic)this).GetPixelAdjustedRect(); float num = Mathf.Max(1f, Mathf.Min(((Rect)(ref pixelAdjustedRect)).width, ((Rect)(ref pixelAdjustedRect)).height) * 0.46f); float num2 = Mathf.Max(1f, num * 0.16f); float num3 = Mathf.Max(0.5f, num - num2); Vector2 center = ((Rect)(ref pixelAdjustedRect)).center; Color32 tint = Color32.op_Implicit(((Graphic)this).color); for (int i = 0; i < 20; i++) { float num4 = (float)i * (MathF.PI / 10f); float num5 = (float)(i + 1) * (MathF.PI / 10f); Vector2 b = center + new Vector2(Mathf.Cos(num4), Mathf.Sin(num4)) * num; Vector2 c = center + new Vector2(Mathf.Cos(num5), Mathf.Sin(num5)) * num; Vector2 a = center + new Vector2(Mathf.Cos(num4), Mathf.Sin(num4)) * num3; Vector2 d = center + new Vector2(Mathf.Cos(num5), Mathf.Sin(num5)) * num3; AddQuad(vh, a, b, c, d, tint); } float thickness = Mathf.Max(1f, num * 0.13f); AddHand(vh, center, new Vector2(0f, num * 0.55f), thickness, tint); AddHand(vh, center, new Vector2(num * 0.42f, (0f - num) * 0.18f), thickness, tint); float num6 = Mathf.Max(1f, num * 0.16f); AddQuad(vh, center + new Vector2(0f - num6, 0f - num6), center + new Vector2(num6, 0f - num6), center + new Vector2(num6, num6), center + new Vector2(0f - num6, num6), tint); } private static void AddHand(VertexHelper vh, Vector2 start, Vector2 delta, float thickness, Color32 tint) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0024: 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_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_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_003f: 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) //IL_0045: 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_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_004d: 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_005f: Unknown result type (might be due to invalid IL or missing references) float magnitude = ((Vector2)(ref delta)).magnitude; if (!(magnitude <= 0.001f)) { Vector2 val = new Vector2(0f - delta.y, delta.x) / magnitude * (thickness * 0.5f); AddQuad(vh, start - val, start + val, start + delta + val, start + delta - val, tint); } } private static void AddQuad(VertexHelper vh, Vector2 a, Vector2 b, Vector2 c, Vector2 d, Color32 tint) { //IL_0008: 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_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_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_0030: 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_0041: 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_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005e: 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_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_0080: 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_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_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) int currentVertCount = vh.currentVertCount; vh.AddVert(new Vector3(a.x, a.y, 0f), tint, Vector4.op_Implicit(Vector2.zero)); vh.AddVert(new Vector3(b.x, b.y, 0f), tint, Vector4.op_Implicit(Vector2.zero)); vh.AddVert(new Vector3(c.x, c.y, 0f), tint, Vector4.op_Implicit(Vector2.zero)); vh.AddVert(new Vector3(d.x, d.y, 0f), tint, Vector4.op_Implicit(Vector2.zero)); vh.AddTriangle(currentVertCount, currentVertCount + 1, currentVertCount + 2); vh.AddTriangle(currentVertCount, currentVertCount + 2, currentVertCount + 3); } } internal sealed class NativeHudMarkerRenderer : IDisposable { private sealed class BadgeView { public GameObject Root { get; } public MarkerIndicatorGraphic Diamond { get; } public MarkerLifetimeIndicatorGraphic Clock { get; } public TextMeshProUGUI Count { get; } public BadgeView(GameObject root, MarkerIndicatorGraphic diamond, MarkerLifetimeIndicatorGraphic clock, TextMeshProUGUI count) { Root = root; Diamond = diamond; Clock = clock; Count = count; } } private sealed class ItemIconView { public GameObject Root { get; } public Image Image { get; } public ItemIconView(GameObject root, Image image) { Root = root; Image = image; } } private sealed class LifetimeIndicatorView { public GameObject Root { get; } public MarkerIndicatorGraphic Diamond { get; } public MarkerLifetimeIndicatorGraphic Clock { get; } public TextMeshProUGUI Count { get; } public LifetimeIndicatorView(GameObject root, MarkerIndicatorGraphic diamond, MarkerLifetimeIndicatorGraphic clock, TextMeshProUGUI count) { Root = root; Diamond = diamond; Clock = clock; Count = count; } } private sealed class MarkerView { public GameObject Root { get; } public RectTransform Rect { get; } public CanvasGroup Group { get; } public Image Background { get; } public MarkerIndicatorGraphic Indicator { get; } public MarkerAssociationCueGraphic AssociationCue { get; } public TextMeshProUGUI Label { get; } public List Badges { get; } = new List(11); public List ItemIcons { get; } = new List(12); public List RowLifetimeIndicators { get; } = new List(12); public LifetimeIndicatorView? SummaryLifetimeIndicator { get; set; } public bool HasMeasurement { get; set; } public MarkerMeasurementCacheKey MeasurementKey { get; set; } public VisualMeasurement CachedMeasurement { get; set; } public int AppliedTypographyRevision { get; set; } = int.MinValue; public int AppliedFontSize { get; set; } = -1; public bool MeasurementFallbackLogged { get; set; } public int LastMeasuredCompactBadgeCount { get; set; } = -1; public int LastMeasuredDetailedRowDiamondCount { get; set; } = -1; public int LastMeasuredLifetimeLayoutSignature { get; set; } = int.MinValue; public bool HasPresentationPlan { get; set; } public MarkerSemanticCluster? PresentationPlanCluster { get; set; } public MarkerClusterPresentationPlan? CachedPresentationPlan { get; set; } public MarkerPresentationMode PresentationPlanMode { get; set; } public bool PresentationPlanShowDistance { get; set; } public int PresentationPlanDetailRows { get; set; } = -1; public int PresentationPlanDistanceMeters { get; set; } = -1; public bool PresentationPlanExpanded { get; set; } public MarkerLanguage PresentationPlanLanguage { get; set; } public MarkerClusterPresentationPlan? AppliedBadgePlan { get; set; } public bool HasLayout { get; set; } public bool HasSolvedProjection { get; set; } public MarkerHudProjection LastSolvedProjection { get; set; } public bool HasPlacement { get; set; } public MarkerHudPlacement LastPlacement { get; set; } public bool HasRelativePlacement { get; set; } public MarkerRelativePlacement RelativePlacement { get; set; } public bool HasAppliedPosition { get; set; } public Vector2 LastAppliedPosition { get; set; } public bool HasAppliedRotation { get; set; } public float LastAppliedRotationDegrees { get; set; } public MarkerIndicatorShape LastAppliedShape { get; set; } = (MarkerIndicatorShape)(-1); public bool HasColor { get; set; } public Color32 LastColor { get; set; } public bool DiagnosticDirty { get; set; } = true; public bool LastDiagnosticMeasurementFallback { get; set; } public int LastDiagnosticClusterTotal { get; set; } = int.MinValue; public string LastMemberFingerprint { get; set; } = string.Empty; public bool HasAssociationCueVector { get; set; } public Vector2 LastAssociationCueVector { get; set; } public MarkerView(GameObject root, RectTransform rect, CanvasGroup group, Image background, MarkerIndicatorGraphic indicator, MarkerAssociationCueGraphic associationCue, TextMeshProUGUI label) { Root = root; Rect = rect; Group = group; Background = background; Indicator = indicator; AssociationCue = associationCue; Label = label; } } private readonly struct ClusterFrame { public long PresentationKey { get; } public bool Directional { get; } public MarkerSemanticCluster Cluster { get; } public MarkerRenderInput Representative { get; } public Vector3 WorldAnchor { get; } public int DistanceMeters { get; } public MarkerHudProjection Projection { get; } public MarkerClusterPresentationPlan Plan { get; } public Color MainColor { get; } public VisualMeasurement Measurement { get; } public MarkerView View { get; } public ClusterFrame(long presentationKey, bool directional, MarkerSemanticCluster cluster, MarkerRenderInput representative, Vector3 worldAnchor, int distanceMeters, MarkerHudProjection projection, MarkerClusterPresentationPlan plan, Color mainColor, VisualMeasurement measurement, MarkerView view) { //IL_001e: 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_002e: 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_003e: 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) PresentationKey = presentationKey; Directional = directional; Cluster = cluster; Representative = representative; WorldAnchor = worldAnchor; DistanceMeters = distanceMeters; Projection = projection; Plan = plan; MainColor = mainColor; Measurement = measurement; View = view; } } private readonly struct VisualMeasurement { public MarkerHudVisualFootprint Footprint { get; } public float LabelPreferredWidth { get; } public bool UsedFallback { get; } public bool MeasurementChanged { get; } public string RenderedText { get; } public VisualMeasurement(MarkerHudVisualFootprint footprint, float labelPreferredWidth, bool usedFallback, bool measurementChanged, string renderedText) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) Footprint = footprint; LabelPreferredWidth = labelPreferredWidth; UsedFallback = usedFallback; MeasurementChanged = measurementChanged; RenderedText = renderedText ?? string.Empty; } public VisualMeasurement AsCacheHit() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) return new VisualMeasurement(Footprint, LabelPreferredWidth, UsedFallback, measurementChanged: false, RenderedText); } } private readonly ManualLogSource _log; private readonly MarkerRuntimePerformanceCounters _performance; private readonly MarkerWorldClusterTracker _semanticTracker = new MarkerWorldClusterTracker(); private readonly MarkerDenseAreaSummaryTracker _denseTracker = new MarkerDenseAreaSummaryTracker(); private readonly MarkerFovPresentationHysteresisPolicy _fovTracker = new MarkerFovPresentationHysteresisPolicy(); private readonly MarkerAdaptiveLodTracker _lodTracker = new MarkerAdaptiveLodTracker(); private readonly Dictionary _inputByStableKey = new Dictionary(96); private readonly Dictionary _views = new Dictionary(96); private readonly List _worldMembers = new List(96); private readonly List _clusterFrames = new List(96); private readonly List _expansionCandidates = new List(96); private readonly List _placementCandidates = new List(96); private readonly List _orderedPlacementBuffer = new List(96); private readonly List _occupiedPlacementBuffer = new List(96); private readonly List _placementResultBuffer = new List(96); private readonly List _directionalInputs = new List(96); private readonly Dictionary _denseNodeByKey = new Dictionary(96); private readonly HashSet _activeWorldPresentationKeys = new HashSet(); private readonly Dictionary _placementByKey = new Dictionary(96); private readonly Dictionary _placementRankByKey = new Dictionary(96); private readonly HashSet _activeClusterKeys = new HashSet(); private readonly List _staleKeys = new List(96); private readonly List _cachedDynamicHudZones = new List(2); private GameObject? _canvasObject; private Canvas? _canvas; private RectTransform? _canvasRect; private TMP_FontAsset? _nativeFont; private Material? _nativeFontMaterial; private bool _typographyResolved; private int _typographyRevision; private bool _indicatorSourceLogged; private bool _presentationSuppressed; private bool _placementCacheValid; private int _cachedScreenWidth = -1; private int _cachedScreenHeight = -1; private float _nextMultiMarkerMotionSolve; private double _nextSemanticSolveAt; private bool _hasSemanticInputSignature; private ulong _semanticInputSignature; private MarkerPresentationSettings _presentationSettings = new MarkerPresentationSettings((MarkerPresentationMode)0, true, 1f, 5); private MarkerVisualConfigSnapshot _visualSettings = new MarkerVisualConfigSnapshot(1f, 0f, offscreenEnabled: true, showOffscreenDistance: true, showOffscreenTotalCount: false, 1f, 1f, 36f, PluginConfig.DefaultCommonColor, PluginConfig.DefaultUncommonColor, PluginConfig.DefaultLegendaryColor, PluginConfig.DefaultBossColor, PluginConfig.DefaultLunarColor, PluginConfig.DefaultVoidColor, PluginConfig.DefaultEquipmentColor, PluginConfig.DefaultCommandColor, PluginConfig.DefaultNeutralColor, PluginConfig.DefaultOffscreenColor); public NativeHudMarkerRenderer(ManualLogSource log, MarkerRuntimePerformanceCounters performance) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Expected O, but got Unknown //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Expected O, but got Unknown //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Expected O, but got Unknown //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Expected O, but got Unknown //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_014c: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_015b: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_0165: Unknown result type (might be due to invalid IL or missing references) //IL_016a: Unknown result type (might be due to invalid IL or missing references) //IL_016f: Unknown result type (might be due to invalid IL or missing references) _log = log; _performance = performance ?? throw new ArgumentNullException("performance"); } public void InvalidatePresentationSettings(MarkerPresentationSettings settings, MarkerVisualConfigSnapshot visualSettings) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: 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_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) _presentationSettings = settings; _visualSettings = visualSettings; _placementCacheValid = false; foreach (MarkerView value in _views.Values) { value.HasMeasurement = false; value.HasLayout = false; value.HasPresentationPlan = false; value.DiagnosticDirty = true; } _log.LogInfo((object)("ISF_MARKER_PRESENTATION_CONFIG mode=" + ((object)((MarkerPresentationSettings)(ref settings)).Mode/*cast due to .constrained prefix*/).ToString() + " distance=" + ((MarkerPresentationSettings)(ref settings)).ShowDistance + " scale=" + ((MarkerPresentationSettings)(ref settings)).Scale.ToString("F2", CultureInfo.InvariantCulture) + " detailRows=" + ((MarkerPresentationSettings)(ref settings)).DetailRows + " categorySort=" + ((object)((MarkerPresentationSettings)(ref settings)).CategorySortOrder/*cast due to .constrained prefix*/).ToString() + " categorySummary=" + ((MarkerPresentationSettings)(ref settings)).UseCategorySummaryPresentation + " compactMixed=" + ((object)((MarkerPresentationSettings)(ref settings)).CompactMixedStyle/*cast due to .constrained prefix*/).ToString() + " compactCount=" + ((MarkerPresentationSettings)(ref settings)).CompactShowCount + " offscreen=" + visualSettings.OffscreenEnabled + " membershipUnchanged=true physicalClusters=" + _semanticTracker.Clusters.Count + " denseNodes=" + _denseTracker.Nodes.Count)); } public void Render(Camera camera, IReadOnlyList inputs, MarkerPresentationSettings settings, MarkerVisualConfigSnapshot visualSettings, MarkerLanguage language, Action diagnosticSink, IReadOnlyList? dynamicHudZones = null) { //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: 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_014b: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) //IL_01e5: Unknown result type (might be due to invalid IL or missing references) //IL_031a: Unknown result type (might be due to invalid IL or missing references) //IL_0443: Unknown result type (might be due to invalid IL or missing references) //IL_0448: Unknown result type (might be due to invalid IL or missing references) //IL_0352: Unknown result type (might be due to invalid IL or missing references) //IL_0359: Unknown result type (might be due to invalid IL or missing references) //IL_0562: Unknown result type (might be due to invalid IL or missing references) //IL_0569: Unknown result type (might be due to invalid IL or missing references) //IL_05a3: Unknown result type (might be due to invalid IL or missing references) //IL_05aa: Unknown result type (might be due to invalid IL or missing references) //IL_05af: Unknown result type (might be due to invalid IL or missing references) //IL_05cf: Unknown result type (might be due to invalid IL or missing references) //IL_0480: Unknown result type (might be due to invalid IL or missing references) //IL_0487: Unknown result type (might be due to invalid IL or missing references) //IL_03c2: Unknown result type (might be due to invalid IL or missing references) //IL_03d2: Unknown result type (might be due to invalid IL or missing references) //IL_03d7: Unknown result type (might be due to invalid IL or missing references) //IL_04b2: Unknown result type (might be due to invalid IL or missing references) //IL_04c2: Unknown result type (might be due to invalid IL or missing references) //IL_04c7: Unknown result type (might be due to invalid IL or missing references) //IL_06e3: Unknown result type (might be due to invalid IL or missing references) //IL_06f0: Unknown result type (might be due to invalid IL or missing references) //IL_0717: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)camera == (Object)null) { throw new ArgumentNullException("camera"); } if (inputs == null) { throw new ArgumentNullException("inputs"); } if (diagnosticSink == null) { throw new ArgumentNullException("diagnosticSink"); } if (_presentationSuppressed) { return; } if (Screen.width <= 0 || Screen.height <= 0) { Clear(); return; } EnsureCanvas(); if ((Object)(object)_canvas == (Object)null || (Object)(object)_canvasRect == (Object)null) { return; } if (!((Behaviour)_canvas).enabled) { ((Behaviour)_canvas).enabled = true; } if (!_typographyResolved) { ResolveNativeTypography(); } if (!SettingsEqual(_presentationSettings, settings) || !VisualSettingsEqual(_visualSettings, visualSettings)) { InvalidatePresentationSettings(settings, visualSettings); } bool flag = _cachedScreenWidth != Screen.width || _cachedScreenHeight != Screen.height; if (flag) { _cachedScreenWidth = Screen.width; _cachedScreenHeight = Screen.height; _placementCacheValid = false; } bool flag2 = DynamicHudZonesChanged(dynamicHudZones); if (flag2) { _placementCacheValid = false; } _inputByStableKey.Clear(); ulong num = ComputeSemanticInputSignature(inputs); for (int i = 0; i < inputs.Count && i < 96; i++) { MarkerRenderInput value = inputs[i]; if (IsFinite(value.WorldPosition.x) && IsFinite(value.WorldPosition.y) && IsFinite(value.WorldPosition.z)) { _inputByStableKey[value.StableKey] = value; } } double num2 = Time.unscaledTime; bool flag3 = !_hasSemanticInputSignature || num != _semanticInputSignature; bool num3 = flag3 || num2 >= _nextSemanticSolveAt || _semanticTracker.Clusters.Count == 0; bool flag4 = false; if (num3) { BuildWorldMembers(language); MarkerSemanticUpdate val = _semanticTracker.Update((IReadOnlyList)_worldMembers, num2); MarkerDenseAreaUpdate val2 = _denseTracker.Update(_semanticTracker.Clusters, num2); flag4 = val2.MembershipChanged; _semanticInputSignature = num; _hasSemanticInputSignature = true; _nextSemanticSolveAt = num2 + 0.2; EmitSemanticLifecycle(val); EmitDenseLifecycle(val2); if (val.MembershipChanged || flag4 || flag3) { _placementCacheValid = false; } } ClassifyPresentationNodes(camera); BuildExpansionCandidates(camera); long? num4 = _lodTracker.Update((IReadOnlyList)_expansionCandidates, num2); _clusterFrames.Clear(); _placementCandidates.Clear(); _placementByKey.Clear(); _activeClusterKeys.Clear(); bool structuralInvalidated = flag || flag2 || flag3 || flag4; bool projectionInvalidated = false; IReadOnlyList nodes = _denseTracker.Nodes; for (int j = 0; j < nodes.Count; j++) { MarkerDenseAreaPresentationNode val3 = nodes[j]; if (_activeWorldPresentationKeys.Contains(val3.StableKey) && TryBuildCurrentClusterFrame(camera, val3, num4.HasValue && num4.Value == val3.StableKey, language, out var frame)) { if (frame.Measurement.MeasurementChanged) { structuralInvalidated = true; } if (!frame.View.HasSolvedProjection || MarkerFramePipelinePolicy.ProjectionMateriallyChanged(frame.View.LastSolvedProjection, frame.Projection)) { projectionInvalidated = true; } if (!string.Equals(frame.View.LastMemberFingerprint, val3.MemberFingerprint, StringComparison.Ordinal)) { frame.View.LastMemberFingerprint = val3.MemberFingerprint; frame.View.DiagnosticDirty = true; structuralInvalidated = true; } _clusterFrames.Add(frame); _placementCandidates.Add(new MarkerHudPlacementCandidate(frame.PresentationKey, frame.Projection, frame.Measurement.Footprint)); _activeClusterKeys.Add(frame.PresentationKey); } } if (_visualSettings.OffscreenEnabled && _directionalInputs.Count > 0) { IReadOnlyList readOnlyList = MarkerDirectionalAggregationPolicy.Aggregate((IReadOnlyList)_directionalInputs); for (int k = 0; k < readOnlyList.Count; k++) { if (TryBuildDirectionalFrame(readOnlyList[k], language, out var frame2)) { if (frame2.Measurement.MeasurementChanged) { structuralInvalidated = true; } if (!frame2.View.HasSolvedProjection || MarkerFramePipelinePolicy.ProjectionMateriallyChanged(frame2.View.LastSolvedProjection, frame2.Projection)) { projectionInvalidated = true; } _clusterFrames.Add(frame2); _placementCandidates.Add(new MarkerHudPlacementCandidate(frame2.PresentationKey, frame2.Projection, frame2.Measurement.Footprint)); _activeClusterKeys.Add(frame2.PresentationKey); } } } if (_clusterFrames.Count != _views.Count) { structuralInvalidated = true; } ResolveCurrentPlacements(structuralInvalidated, projectionInvalidated); for (int l = 0; l < _clusterFrames.Count; l++) { ClusterFrame clusterFrame = _clusterFrames[l]; if (_placementByKey.TryGetValue(clusterFrame.PresentationKey, out var value2)) { bool fastFollow = clusterFrame.View.HasSolvedProjection && MarkerProjectionRelativePlacementPolicy.RequiresFastFollow(clusterFrame.View.LastSolvedProjection, clusterFrame.Projection, (float)Screen.width, (float)Screen.height); ApplyView(clusterFrame.View, clusterFrame.Cluster, clusterFrame.Representative, clusterFrame.Plan, clusterFrame.MainColor, clusterFrame.Projection, value2, clusterFrame.Measurement, fastFollow, clusterFrame.Directional); clusterFrame.View.LastSolvedProjection = clusterFrame.Projection; clusterFrame.View.HasSolvedProjection = true; if (clusterFrame.View.LastDiagnosticClusterTotal != clusterFrame.Cluster.TotalCount) { clusterFrame.View.LastDiagnosticClusterTotal = clusterFrame.Cluster.TotalCount; clusterFrame.View.DiagnosticDirty = true; } if (clusterFrame.View.LastDiagnosticMeasurementFallback != clusterFrame.Measurement.UsedFallback) { clusterFrame.View.LastDiagnosticMeasurementFallback = clusterFrame.Measurement.UsedFallback; clusterFrame.View.DiagnosticDirty = true; } if (clusterFrame.View.DiagnosticDirty) { clusterFrame.View.DiagnosticDirty = false; diagnosticSink(new MarkerRenderDiagnostic(clusterFrame.Representative, clusterFrame.PresentationKey, clusterFrame.Directional ? ("DIRECTION:" + clusterFrame.PresentationKey) : clusterFrame.Cluster.MemberFingerprint, clusterFrame.Cluster.TotalCount, clusterFrame.Plan.Text, value2, clusterFrame.Measurement.Footprint, clusterFrame.Measurement.LabelPreferredWidth, clusterFrame.Measurement.UsedFallback, clusterFrame.Projection)); } } } _staleKeys.Clear(); foreach (long key in _views.Keys) { if (!_activeClusterKeys.Contains(key)) { _staleKeys.Add(key); } } if (_staleKeys.Count > 0) { _placementCacheValid = false; } for (int m = 0; m < _staleKeys.Count; m++) { RemoveView(_staleKeys[m]); } _staleKeys.Clear(); foreach (long key2 in _placementRankByKey.Keys) { if (!_activeClusterKeys.Contains(key2)) { _staleKeys.Add(key2); } } for (int n = 0; n < _staleKeys.Count; n++) { _placementRankByKey.Remove(_staleKeys[n]); } } private void EmitDenseLifecycle(MarkerDenseAreaUpdate update) { if (!update.MembershipChanged) { return; } int num = 0; for (int i = 0; i < update.Nodes.Count; i++) { if (update.Nodes[i].IsDenseSummary) { num++; } } _log.LogInfo((object)("ISF_MARKER_DENSE nodes=" + update.Nodes.Count + " summaries=" + num + " merge=" + 12f.ToString("F2", CultureInfo.InvariantCulture) + " split=" + 16f.ToString("F2", CultureInfo.InvariantCulture) + " dwell=" + 0.35.ToString("F2", CultureInfo.InvariantCulture) + " membershipChanged=true cameraIndependent=true")); } private void BuildWorldMembers(MarkerLanguage language) { //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0043: 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_0062: 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_007f: 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_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) _worldMembers.Clear(); foreach (KeyValuePair item in _inputByStableKey) { MarkerRenderInput value = item.Value; List worldMembers = _worldMembers; long stableKey = value.StableKey; PersonalMarkerIdentity identity = value.Identity; worldMembers.Add(new MarkerWorldMember(stableKey, ((PersonalMarkerIdentity)(ref identity)).Kind, new MarkerWorldPoint(value.WorldPosition.x, value.WorldPosition.y, value.WorldPosition.z), value.ItemSemanticKey, MarkerPresentationPolicy.NormalizeLabel(value.Label, MarkerTextLocalization.FallbackPickup(language)), value.Kind, value.Lifetime)); } } private void ClassifyPresentationNodes(Camera camera) { //IL_0080: 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_0096: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Invalid comparison between Unknown and I4 //IL_0199: Unknown result type (might be due to invalid IL or missing references) _directionalInputs.Clear(); _denseNodeByKey.Clear(); _activeWorldPresentationKeys.Clear(); IReadOnlyList nodes = _denseTracker.Nodes; float num = (float)Screen.width * 0.5f; float num2 = (float)Screen.height * 0.5f; for (int i = 0; i < nodes.Count; i++) { MarkerDenseAreaPresentationNode val = nodes[i]; _denseNodeByKey[val.StableKey] = val; if (!TryCurrentWorldAnchor(val.PresentationCluster, out var anchor) || !TryProject(camera, anchor, out var projection)) { continue; } Vector3 val2 = anchor - ((Component)camera).transform.position; float magnitude = ((Vector3)(ref val2)).magnitude; if (!IsFinite(magnitude) || magnitude < 0f) { continue; } float num3 = Vector3.Angle(((Component)camera).transform.forward, val2); bool flag = (int)((MarkerHudProjection)(ref projection)).Mode == 0; if (_fovTracker.Update(val.StableKey, num3, flag)) { _activeWorldPresentationKeys.Add(val.StableKey); } else if (_visualSettings.OffscreenEnabled) { float num4 = ((MarkerHudProjection)(ref projection)).DirectionX; float num5 = ((MarkerHudProjection)(ref projection)).DirectionY; if (Math.Abs(num4) < 0.0001f && Math.Abs(num5) < 0.0001f) { num4 = (((MarkerHudProjection)(ref projection)).X - num) / Math.Max(1f, num); num5 = (((MarkerHudProjection)(ref projection)).Y - num2) / Math.Max(1f, num2); } _directionalInputs.Add(new MarkerDirectionalInput(val.StableKey, num4, num5, magnitude, val.TotalCount)); } } _fovTracker.Prune((IEnumerable)_denseNodeByKey.Keys); } private void BuildExpansionCandidates(Camera camera) { //IL_00a4: 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) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) _expansionCandidates.Clear(); IReadOnlyList nodes = _denseTracker.Nodes; float num = Mathf.Min((float)Screen.width / 1920f, (float)Screen.height / 1080f); if (!IsFinite(num) || num <= 0f) { num = 1f; } float num2 = (float)Screen.width * 0.5f; float num3 = (float)Screen.height * 0.5f; for (int i = 0; i < nodes.Count; i++) { MarkerDenseAreaPresentationNode val = nodes[i]; if (!_activeWorldPresentationKeys.Contains(val.StableKey)) { continue; } MarkerSemanticCluster presentationCluster = val.PresentationCluster; if (TryCurrentWorldAnchor(presentationCluster, out var anchor) && TryProject(camera, anchor, out var projection)) { float num4 = Vector3.Distance(((Component)camera).transform.position, anchor); if (IsFinite(num4) && !(num4 < 0f)) { float num5 = ((MarkerHudProjection)(ref projection)).X - num2; float num6 = ((MarkerHudProjection)(ref projection)).Y - num3; float num7 = Mathf.Sqrt(num5 * num5 + num6 * num6) / num; _expansionCandidates.Add(new MarkerExpansionCandidate(val.StableKey, presentationCluster.TotalCount, num4, num7)); } } } } private bool TryBuildCurrentClusterFrame(Camera camera, MarkerDenseAreaPresentationNode node, bool expanded, MarkerLanguage language, out ClusterFrame frame) { //IL_001d: 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_0034: 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_008d: 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_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: 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) frame = default(ClusterFrame); MarkerSemanticCluster presentationCluster = node.PresentationCluster; if (!TryCurrentWorldAnchor(presentationCluster, out var anchor)) { return false; } if (!TryProject(camera, anchor, out var projection)) { return false; } float num = Vector3.Distance(((Component)camera).transform.position, anchor); if (!IsFinite(num) || num < 0f) { return false; } int distanceMeters = Mathf.Max(0, Mathf.RoundToInt(num)); if (!TryRepresentative(presentationCluster, out var representative)) { return false; } MarkerView orCreateView = GetOrCreateView(node.StableKey); MarkerClusterPresentationPlan orBuildPresentationPlan = GetOrBuildPresentationPlan(orCreateView, presentationCluster, distanceMeters, expanded, language); VisualMeasurement orMeasureVisualFootprint = GetOrMeasureVisualFootprint(orCreateView, presentationCluster, orBuildPresentationPlan, _presentationSettings); Color mainColor = ResolveMainColor(presentationCluster, representative, orBuildPresentationPlan.NeutralMainSemantic); frame = new ClusterFrame(node.StableKey, directional: false, presentationCluster, representative, anchor, distanceMeters, projection, orBuildPresentationPlan, mainColor, orMeasureVisualFootprint, orCreateView); return true; } private bool TryBuildDirectionalFrame(MarkerDirectionalSectorSummary sector, MarkerLanguage language, out ClusterFrame frame) { //IL_004c: 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_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Unknown result type (might be due to invalid IL or missing references) frame = default(ClusterFrame); if (!_denseNodeByKey.TryGetValue(((MarkerDirectionalSectorSummary)(ref sector)).NearestPresentationKey, out MarkerDenseAreaPresentationNode value)) { return false; } MarkerSemanticCluster presentationCluster = value.PresentationCluster; if (!TryRepresentative(presentationCluster, out var representative)) { return false; } MarkerHudProjection projection = BuildDirectionalProjection(((MarkerDirectionalSectorSummary)(ref sector)).DirectionX, ((MarkerDirectionalSectorSummary)(ref sector)).DirectionY, _visualSettings.OffscreenEdgePadding); if (!((MarkerHudProjection)(ref projection)).Valid) { return false; } int num = Mathf.Max(0, Mathf.RoundToInt(((MarkerDirectionalSectorSummary)(ref sector)).NearestDistanceMeters)); MarkerView orCreateView = GetOrCreateView(((MarkerDirectionalSectorSummary)(ref sector)).PresentationKey); bool flag = ((MarkerDirectionalSectorSummary)(ref sector)).RepresentedNodeCount == 1; MarkerClusterPresentationPlan plan = MarkerClusterPresentationPolicy.BuildOffscreen(num, ((MarkerDirectionalSectorSummary)(ref sector)).TotalCount, _visualSettings.ShowOffscreenDistance, _visualSettings.ShowOffscreenTotalCount, language, (MarkerLifetimeKind)((!flag) ? 3 : ((int)presentationCluster.LifetimeSummary)), flag ? presentationCluster.TemporaryPhysicalMemberCount : 0, flag ? presentationCluster.MixedLifetimeMemberCount : 0, (!flag) ? 1 : presentationCluster.UnknownLifetimeMemberCount); MarkerPresentationSettings settings = default(MarkerPresentationSettings); ((MarkerPresentationSettings)(ref settings))..ctor((MarkerPresentationMode)1, false, _visualSettings.OffscreenScale, 1); VisualMeasurement orMeasureVisualFootprint = GetOrMeasureVisualFootprint(orCreateView, presentationCluster, plan, settings); MarkerWorldPoint worldAnchor = presentationCluster.WorldAnchor; float x = ((MarkerWorldPoint)(ref worldAnchor)).X; worldAnchor = presentationCluster.WorldAnchor; float y = ((MarkerWorldPoint)(ref worldAnchor)).Y; worldAnchor = presentationCluster.WorldAnchor; Vector3 worldAnchor2 = default(Vector3); ((Vector3)(ref worldAnchor2))..ctor(x, y, ((MarkerWorldPoint)(ref worldAnchor)).Z); frame = new ClusterFrame(((MarkerDirectionalSectorSummary)(ref sector)).PresentationKey, directional: true, presentationCluster, representative, worldAnchor2, num, projection, plan, _visualSettings.OffscreenColor, orMeasureVisualFootprint, orCreateView); return true; } private static MarkerHudProjection BuildDirectionalProjection(float directionX, float directionY, float edgePadding) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_004d: 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_00a1: 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_005c: Unknown result type (might be due to invalid IL or missing references) if (!IsFinite(directionX) || !IsFinite(directionY)) { return default(MarkerHudProjection); } MarkerHudProjection result = MarkerHudNavigationPolicy.ResolveProjection(0.5f + directionX * 2f, 0.5f + directionY * 2f, 1f, directionX, directionY, 1f, (float)Screen.width, (float)Screen.height); if (!((MarkerHudProjection)(ref result)).Valid) { return result; } float num = MarkerVisualSettingsPolicy.ClampOffscreenEdgePadding(edgePadding); float num2 = Mathf.Clamp(((MarkerHudProjection)(ref result)).X, num, Math.Max(num, (float)Screen.width - num)); float num3 = Mathf.Clamp(((MarkerHudProjection)(ref result)).Y, num, Math.Max(num, (float)Screen.height - num)); return new MarkerHudProjection(true, (MarkerHudMode)1, ((MarkerHudProjection)(ref result)).Edge, num2, num3, directionX, directionY, ((MarkerHudProjection)(ref result)).ArrowRotationDegrees); } private MarkerClusterPresentationPlan GetOrBuildPresentationPlan(MarkerView view, MarkerSemanticCluster cluster, int distanceMeters, bool expanded, MarkerLanguage language) { //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_0024: 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_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) int num = (((MarkerPresentationSettings)(ref _presentationSettings)).ShowDistance ? distanceMeters : (-1)); if (view.HasPresentationPlan && view.PresentationPlanCluster == cluster && view.PresentationPlanMode == ((MarkerPresentationSettings)(ref _presentationSettings)).Mode && view.PresentationPlanShowDistance == ((MarkerPresentationSettings)(ref _presentationSettings)).ShowDistance && view.PresentationPlanDetailRows == ((MarkerPresentationSettings)(ref _presentationSettings)).DetailRows && view.PresentationPlanDistanceMeters == num && view.PresentationPlanExpanded == expanded && view.PresentationPlanLanguage == language && view.CachedPresentationPlan != null) { return view.CachedPresentationPlan; } MarkerClusterPresentationPlan val = MarkerClusterPresentationPolicy.Build(cluster, _presentationSettings, distanceMeters, expanded, language); view.HasPresentationPlan = true; view.PresentationPlanCluster = cluster; view.CachedPresentationPlan = val; view.PresentationPlanMode = ((MarkerPresentationSettings)(ref _presentationSettings)).Mode; view.PresentationPlanShowDistance = ((MarkerPresentationSettings)(ref _presentationSettings)).ShowDistance; view.PresentationPlanDetailRows = ((MarkerPresentationSettings)(ref _presentationSettings)).DetailRows; view.PresentationPlanDistanceMeters = num; view.PresentationPlanExpanded = expanded; view.PresentationPlanLanguage = language; return val; } private void ResolveCurrentPlacements(bool structuralInvalidated, bool projectionInvalidated) { //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_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_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_02be: Unknown result type (might be due to invalid IL or missing references) //IL_02c3: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_03ad: Unknown result type (might be due to invalid IL or missing references) //IL_03bd: Unknown result type (might be due to invalid IL or missing references) //IL_03c9: Unknown result type (might be due to invalid IL or missing references) //IL_03ce: Unknown result type (might be due to invalid IL or missing references) //IL_03d3: Unknown result type (might be due to invalid IL or missing references) //IL_03e2: Unknown result type (might be due to invalid IL or missing references) //IL_02f5: Unknown result type (might be due to invalid IL or missing references) //IL_02fa: Unknown result type (might be due to invalid IL or missing references) //IL_0309: Unknown result type (might be due to invalid IL or missing references) //IL_01e6: Unknown result type (might be due to invalid IL or missing references) //IL_01f6: Unknown result type (might be due to invalid IL or missing references) //IL_0202: Unknown result type (might be due to invalid IL or missing references) //IL_0207: Unknown result type (might be due to invalid IL or missing references) //IL_020c: Unknown result type (might be due to invalid IL or missing references) //IL_020f: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_0197: Unknown result type (might be due to invalid IL or missing references) //IL_019b: Unknown result type (might be due to invalid IL or missing references) //IL_01a2: Unknown result type (might be due to invalid IL or missing references) //IL_01a7: Unknown result type (might be due to invalid IL or missing references) //IL_01ab: Unknown result type (might be due to invalid IL or missing references) //IL_01b9: Unknown result type (might be due to invalid IL or missing references) //IL_01be: Unknown result type (might be due to invalid IL or missing references) //IL_01c2: Unknown result type (might be due to invalid IL or missing references) //IL_01c9: Unknown result type (might be due to invalid IL or missing references) //IL_01ce: Unknown result type (might be due to invalid IL or missing references) //IL_01d2: Unknown result type (might be due to invalid IL or missing references) //IL_0359: Unknown result type (might be due to invalid IL or missing references) //IL_035e: Unknown result type (might be due to invalid IL or missing references) if (_clusterFrames.Count == 0) { _placementCacheValid = false; return; } if (_clusterFrames.Count == 1) { _performance.RecordSingleMarkerFastPath(); ClusterFrame clusterFrame = _clusterFrames[0]; MarkerHudPlacement val; if (_placementCacheValid && clusterFrame.View.HasRelativePlacement && !structuralInvalidated) { val = MarkerProjectionRelativePlacementPolicy.Apply(clusterFrame.PresentationKey, clusterFrame.Projection, clusterFrame.Measurement.Footprint, clusterFrame.View.RelativePlacement); if (!PlacementStillValid(val)) { val = MarkerHudNavigationPolicy.ResolveSinglePlacement(_placementCandidates[0], (float)Screen.width, (float)Screen.height, (IReadOnlyList)_cachedDynamicHudZones); StoreSolvedPlacement(clusterFrame.View, clusterFrame.Projection, val); } } else { val = MarkerHudNavigationPolicy.ResolveSinglePlacement(_placementCandidates[0], (float)Screen.width, (float)Screen.height, (IReadOnlyList)_cachedDynamicHudZones); StoreSolvedPlacement(clusterFrame.View, clusterFrame.Projection, val); } _placementByKey[clusterFrame.PresentationKey] = val; _placementRankByKey[clusterFrame.PresentationKey] = 0; _placementCacheValid = true; return; } float unscaledTime = Time.unscaledTime; bool flag = false; if (_placementCacheValid && !structuralInvalidated) { for (int num = 0; num < _clusterFrames.Count; num++) { ClusterFrame clusterFrame2 = _clusterFrames[num]; if (!clusterFrame2.View.HasRelativePlacement) { flag = true; break; } if (clusterFrame2.View.HasSolvedProjection) { MarkerHudProjection val2 = clusterFrame2.View.LastSolvedProjection; MarkerHudMode mode = ((MarkerHudProjection)(ref val2)).Mode; val2 = clusterFrame2.Projection; if (mode == ((MarkerHudProjection)(ref val2)).Mode) { val2 = clusterFrame2.View.LastSolvedProjection; MarkerHudEdge edge = ((MarkerHudProjection)(ref val2)).Edge; val2 = clusterFrame2.Projection; if (edge == ((MarkerHudProjection)(ref val2)).Edge) { goto IL_01dd; } } flag = true; break; } goto IL_01dd; IL_01dd: MarkerHudPlacement placement = MarkerProjectionRelativePlacementPolicy.Apply(clusterFrame2.PresentationKey, clusterFrame2.Projection, clusterFrame2.Measurement.Footprint, clusterFrame2.View.RelativePlacement); if (!PlacementStillValid(placement)) { flag = true; break; } } } if (MarkerFramePipelinePolicy.ShouldRunMultiMarkerSolve(_placementCacheValid, structuralInvalidated || flag, projectionInvalidated, unscaledTime, _nextMultiMarkerMotionSolve)) { long timestamp = Stopwatch.GetTimestamp(); MarkerHudNavigationPolicy.ResolvePlacementsBufferedStable((IReadOnlyList)_placementCandidates, (float)Screen.width, (float)Screen.height, (IReadOnlyList)_cachedDynamicHudZones, (IReadOnlyDictionary)_placementRankByKey, _orderedPlacementBuffer, _occupiedPlacementBuffer, _placementResultBuffer); _performance.RecordFullPlacementSolve(Stopwatch.GetTimestamp() - timestamp); _nextMultiMarkerMotionSolve = unscaledTime + 1f / 30f; for (int i = 0; i < _orderedPlacementBuffer.Count; i++) { Dictionary placementRankByKey = _placementRankByKey; MarkerHudPlacementCandidate val3 = _orderedPlacementBuffer[i]; placementRankByKey[((MarkerHudPlacementCandidate)(ref val3)).StableKey] = i; } for (int j = 0; j < _placementResultBuffer.Count; j++) { MarkerHudPlacement value = _placementResultBuffer[j]; _placementByKey[((MarkerHudPlacement)(ref value)).StableKey] = value; } for (int k = 0; k < _clusterFrames.Count; k++) { ClusterFrame clusterFrame3 = _clusterFrames[k]; if (_placementByKey.TryGetValue(clusterFrame3.PresentationKey, out var value2)) { StoreSolvedPlacement(clusterFrame3.View, clusterFrame3.Projection, value2); } } _placementCacheValid = true; return; } for (int l = 0; l < _clusterFrames.Count; l++) { ClusterFrame clusterFrame4 = _clusterFrames[l]; if (clusterFrame4.View.HasRelativePlacement) { MarkerHudPlacement value3 = MarkerProjectionRelativePlacementPolicy.Apply(clusterFrame4.PresentationKey, clusterFrame4.Projection, clusterFrame4.Measurement.Footprint, clusterFrame4.View.RelativePlacement); _placementByKey[clusterFrame4.PresentationKey] = value3; } } } private void StoreSolvedPlacement(MarkerView view, MarkerHudProjection projection, MarkerHudPlacement placement) { //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_001e: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) if (!view.HasPlacement || PlacementDiagnosticStateChanged(view.LastPlacement, placement)) { view.DiagnosticDirty = true; } view.LastPlacement = placement; view.HasPlacement = true; view.RelativePlacement = MarkerProjectionRelativePlacementPolicy.Capture(projection, placement); view.HasRelativePlacement = true; } private bool PlacementStillValid(MarkerHudPlacement placement) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0044: 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) MarkerHudRect finalRect = ((MarkerHudPlacement)(ref placement)).FinalRect; if (((MarkerHudRect)(ref finalRect)).Left < 0f || ((MarkerHudRect)(ref finalRect)).Right > (float)Screen.width || ((MarkerHudRect)(ref finalRect)).Bottom < 0f || ((MarkerHudRect)(ref finalRect)).Top > (float)Screen.height) { return false; } if (MarkerHudNavigationPolicy.IntersectsReservedHud(finalRect, (float)Screen.width, (float)Screen.height)) { return false; } if (MarkerHudNavigationPolicy.IntersectsDynamicHud(finalRect, (IEnumerable)_cachedDynamicHudZones, (float)Screen.width, (float)Screen.height)) { return false; } return true; } private bool TryCurrentWorldAnchor(MarkerSemanticCluster cluster, out Vector3 anchor) { //IL_0001: 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_006a: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: 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) anchor = default(Vector3); if (cluster.MemberStableKeys.Count == 0) { return false; } double num = 0.0; double num2 = 0.0; double num3 = 0.0; int num4 = 0; for (int i = 0; i < cluster.MemberStableKeys.Count; i++) { if (_inputByStableKey.TryGetValue(cluster.MemberStableKeys[i], out var value)) { num += (double)value.WorldPosition.x; num2 += (double)value.WorldPosition.y; num3 += (double)value.WorldPosition.z; num4++; } } if (num4 <= 0) { return false; } anchor = new Vector3((float)(num / (double)num4), (float)(num2 / (double)num4), (float)(num3 / (double)num4)); if (IsFinite(anchor.x) && IsFinite(anchor.y)) { return IsFinite(anchor.z); } return false; } private static bool TryProject(Camera camera, Vector3 worldAnchor, out MarkerHudProjection projection) { //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_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_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_004d: 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) projection = default(MarkerHudProjection); try { Vector3 val = camera.WorldToViewportPoint(worldAnchor); Vector3 val2 = ((Component)camera).transform.InverseTransformPoint(worldAnchor); projection = MarkerHudNavigationPolicy.ResolveProjection(val.x, val.y, val.z, val2.x, val2.y, val2.z, (float)Screen.width, (float)Screen.height); return ((MarkerHudProjection)(ref projection)).Valid; } catch { return false; } } private bool TryRepresentative(MarkerSemanticCluster cluster, out MarkerRenderInput representative) { for (int i = 0; i < cluster.MemberStableKeys.Count; i++) { if (_inputByStableKey.TryGetValue(cluster.MemberStableKeys[i], out representative)) { return true; } } representative = default(MarkerRenderInput); return false; } private Color ResolveMainColor(MarkerSemanticCluster cluster, MarkerRenderInput representative, bool neutral) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) if (neutral || cluster.IsMixedCategory) { return SanitizeColor(_visualSettings.NeutralColor); } return ResolveConfiguredCategoryColor(cluster.HomogeneousCategory); } private Color ResolveCategoryColor(MarkerSemanticCluster cluster, MarkerSemanticCategory category) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) return ResolveConfiguredCategoryColor(category); } private Color ResolveConfiguredCategoryColor(MarkerSemanticCategory category) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Expected I4, but got Unknown //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) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_0092: 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_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) switch ((int)category) { case 0: return SanitizeColor(_visualSettings.CommonColor); case 1: return SanitizeColor(_visualSettings.UncommonColor); case 2: return SanitizeColor(_visualSettings.LegendaryColor); case 3: return SanitizeColor(_visualSettings.BossColor); case 4: case 7: return SanitizeColor(_visualSettings.LunarColor); case 5: return SanitizeColor(_visualSettings.VoidColor); case 6: return SanitizeColor(_visualSettings.EquipmentColor); case 10: return SanitizeColor(_visualSettings.CommandColor); default: return SanitizeColor(_visualSettings.NeutralColor); } } private VisualMeasurement GetOrMeasureVisualFootprint(MarkerView view, MarkerSemanticCluster cluster, MarkerClusterPresentationPlan plan, MarkerPresentationSettings settings) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Invalid comparison between Unknown and I4 //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0245: Unknown result type (might be due to invalid IL or missing references) //IL_024a: Unknown result type (might be due to invalid IL or missing references) //IL_0250: Unknown result type (might be due to invalid IL or missing references) //IL_025d: Unknown result type (might be due to invalid IL or missing references) //IL_0262: Unknown result type (might be due to invalid IL or missing references) //IL_0264: Unknown result type (might be due to invalid IL or missing references) //IL_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_005d: Unknown result type (might be due to invalid IL or missing references) //IL_027c: Unknown result type (might be due to invalid IL or missing references) //IL_0293: Unknown result type (might be due to invalid IL or missing references) //IL_0298: Unknown result type (might be due to invalid IL or missing references) //IL_02de: Unknown result type (might be due to invalid IL or missing references) //IL_02e3: Unknown result type (might be due to invalid IL or missing references) //IL_02bc: Unknown result type (might be due to invalid IL or missing references) //IL_02a0: Unknown result type (might be due to invalid IL or missing references) //IL_02b1: Unknown result type (might be due to invalid IL or missing references) //IL_02b6: Unknown result type (might be due to invalid IL or missing references) //IL_0319: Unknown result type (might be due to invalid IL or missing references) //IL_0328: Unknown result type (might be due to invalid IL or missing references) //IL_02c4: Unknown result type (might be due to invalid IL or missing references) //IL_02ca: Invalid comparison between Unknown and I4 //IL_02d4: Unknown result type (might be due to invalid IL or missing references) //IL_02d6: Unknown result type (might be due to invalid IL or missing references) //IL_02db: Unknown result type (might be due to invalid IL or missing references) //IL_02f7: Unknown result type (might be due to invalid IL or missing references) //IL_0302: Unknown result type (might be due to invalid IL or missing references) //IL_0307: 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_0315: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: 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_013f: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) int num = MarkerPresentationPolicy.BuildScaledNativeHudFontSize(Screen.height, ((MarkerPresentationSettings)(ref settings)).Scale); EnsureTypography(view, num); int num2 = (((int)((MarkerPresentationSettings)(ref settings)).Mode == 1 && plan.ShowCompactCategoryDiamonds) ? plan.CategoryEntries.Count : 0); int num3 = (((int)((MarkerPresentationSettings)(ref settings)).Mode == 0 && plan.ShowDetailedCategoryRowDiamonds) ? plan.CategoryEntries.Count : 0); int num4 = (((int)((MarkerPresentationSettings)(ref settings)).Mode == 0) ? plan.DetailedItemRows.Count : 0); int num5 = LifetimeLayoutSignature(plan, num2, num3, num4); float num6 = ((num4 > 0) ? MarkerClusterPresentationPolicy.BuildDetailedItemLabelWidthLimit((float)Screen.width, (float)Screen.height, ((MarkerPresentationSettings)(ref settings)).Scale) : float.PositiveInfinity); string text = BuildRenderedText(view.Label, cluster, plan, num6); TextOverflowModes val = (TextOverflowModes)(num4 > 0); if (((TMP_Text)view.Label).overflowMode != val) { ((TMP_Text)view.Label).overflowMode = val; view.HasMeasurement = false; } MarkerMeasurementCacheKey val2 = default(MarkerMeasurementCacheKey); ((MarkerMeasurementCacheKey)(ref val2))..ctor(text, InstanceIdentity((Object?)(object)((TMP_Text)view.Label).font), InstanceIdentity((Object?)(object)((TMP_Text)view.Label).fontSharedMaterial), num, Screen.width, Screen.height, _typographyRevision); if (view.LastMeasuredCompactBadgeCount == num2 && view.LastMeasuredDetailedRowDiamondCount == num3 && view.LastMeasuredLifetimeLayoutSignature == num5 && MarkerRuntimeHotPathPolicy.CanReuseMeasurement(view.HasMeasurement, view.MeasurementKey, val2)) { return view.CachedMeasurement.AsCacheHit(); } if (!string.Equals(((TMP_Text)view.Label).text, text, StringComparison.Ordinal)) { ((TMP_Text)view.Label).text = text; } float num7 = float.NaN; float num8 = float.NaN; bool usedFallback = false; try { _performance.RecordTmpPreferredMeasurement(); Vector2 preferredValues = ((TMP_Text)view.Label).GetPreferredValues(text); num7 = preferredValues.x; num8 = preferredValues.y; if (num4 > 0 && IsFinite(num7) && num7 > num6) { num7 = num6; } if (!IsFinite(num7) || num7 <= 0f || !IsFinite(num8) || num8 <= 0f) { usedFallback = true; } } catch (Exception ex) { usedFallback = true; if (!view.MeasurementFallbackLogged) { view.MeasurementFallbackLogged = true; _log.LogDebug((object)("[ItemShareFix] TMP preferred-size unavailable; conservative footprint used: " + ex.GetType().Name)); } } MarkerHudVisualFootprint val3 = MarkerHudNavigationPolicy.BuildMeasuredVisualFootprint(num7, num8, (float)Screen.width, (float)Screen.height, ((MarkerPresentationSettings)(ref settings)).Scale); if (num2 > 0) { val3 = EnsureCompactMetadataRowFootprint(val3, plan, num, ((MarkerPresentationSettings)(ref settings)).Scale, num7); val3 = ExtendFootprintForCompactBadges(val3, plan, num, ((MarkerPresentationSettings)(ref settings)).Scale); } else if (num3 > 0) { val3 = ExtendFootprintForDetailedRowDiamonds(val3, num3, num, ((MarkerPresentationSettings)(ref settings)).Scale, HasDetailedCategoryLifetimeIndicator(plan), MaxDetailedCategoryLifetimeCountCharacters(plan)); } else if (num4 > 0) { val3 = ExtendFootprintForDetailedItemIcons(val3, num4, num, ((MarkerPresentationSettings)(ref settings)).Scale, HasDetailedItemLifetimeIndicator(plan)); } else if ((int)((MarkerPresentationSettings)(ref settings)).Mode == 0 && (int)plan.CountRenderSource == 3 && !plan.ShowMainDiamond) { val3 = CollapseDetailedFootprintWithoutDiamondGutter(val3); } MarkerLifetimeIndicatorSpec lifetimeIndicator = plan.LifetimeIndicator; if (((MarkerLifetimeIndicatorSpec)(ref lifetimeIndicator)).Visible && num2 == 0 && num3 == 0 && num4 == 0) { MarkerHudVisualFootprint footprint = val3; float scale = ((MarkerPresentationSettings)(ref settings)).Scale; lifetimeIndicator = plan.LifetimeIndicator; val3 = ExtendFootprintForSummaryLifetimeIndicator(footprint, num, scale, ((MarkerLifetimeIndicatorSpec)(ref lifetimeIndicator)).ShowCount); } VisualMeasurement visualMeasurement = new VisualMeasurement(val3, num7, usedFallback, measurementChanged: true, text); view.MeasurementKey = val2; view.CachedMeasurement = visualMeasurement; view.LastMeasuredCompactBadgeCount = num2; view.LastMeasuredDetailedRowDiamondCount = num3; view.LastMeasuredLifetimeLayoutSignature = num5; view.HasMeasurement = true; return visualMeasurement; } private static float CompactTextBandHeight(string text, int fontSize, float indicatorSize) { if (string.IsNullOrEmpty(text)) { return 0f; } float num = Math.Max(indicatorSize * 0.72f, (float)fontSize * 1.18f); return (float)Math.Max(1, CountPresentationLines(text)) * num; } private static int LifetimeLayoutSignature(MarkerClusterPresentationPlan plan, int compactBadgeCount, int detailedRowDiamondCount, int detailedItemRowCount) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_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_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Expected I4, but got Unknown //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_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_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Expected I4, but got Unknown MarkerLifetimeIndicatorSpec lifetimeIndicator = plan.LifetimeIndicator; int num = (((MarkerLifetimeIndicatorSpec)(ref lifetimeIndicator)).Visible ? 17 : 3); int num2 = num * 31; lifetimeIndicator = plan.LifetimeIndicator; int num3; if (!((MarkerLifetimeIndicatorSpec)(ref lifetimeIndicator)).ShowCount) { num3 = 0; } else { lifetimeIndicator = plan.LifetimeIndicator; num3 = ((MarkerLifetimeIndicatorSpec)(ref lifetimeIndicator)).TemporaryCount + 1; } num = num2 + num3; num = num * 31 + compactBadgeCount; num = num * 31 + detailedRowDiamondCount; num = num * 31 + detailedItemRowCount; for (int i = 0; i < plan.DetailedItemRows.Count; i++) { int num4 = num * 31; MarkerDetailedItemRow val = plan.DetailedItemRows[i]; num = num4 + ((MarkerDetailedItemRow)(ref val)).GlyphKind + 1; } for (int j = 0; j < plan.CategoryEntries.Count; j++) { MarkerCompactCategoryBadge val2 = plan.CategoryEntries[j]; num = num * 31 + ((MarkerCompactCategoryBadge)(ref val2)).GlyphKind + 1; num = num * 31 + ((MarkerCompactCategoryBadge)(ref val2)).Count; } return num; } private static bool HasDetailedItemLifetimeIndicator(MarkerClusterPresentationPlan plan) { return plan.DetailedItemRows.Count > 0; } private static bool HasDetailedCategoryLifetimeIndicator(MarkerClusterPresentationPlan plan) { return false; } private static int MaxDetailedCategoryLifetimeCountCharacters(MarkerClusterPresentationPlan plan) { return 0; } private static float LifetimeIndicatorSize(int fontSize, float markerScale) { float num = Mathf.Min((float)Screen.width / 1920f, (float)Screen.height / 1080f) * MarkerClusterPresentationPolicy.ClampMarkerScale(markerScale); if (!IsFinite(num) || num <= 0f) { num = 1f; } return Mathf.Max(10f * num, (float)fontSize * 0.66f); } private static float LifetimeCountWidth(int fontSize, int characters) { return (float)Math.Max(0, characters) * Math.Max(4f, (float)fontSize * 0.48f); } private static float CompactMetadataRowHeight(string text, int fontSize, float indicatorSize, float markerScale, bool showLifetimeIndicator) { float num = Mathf.Min((float)Screen.width / 1920f, (float)Screen.height / 1080f) * MarkerClusterPresentationPolicy.ClampMarkerScale(markerScale); if (!IsFinite(num) || num <= 0f) { num = 1f; } float val = CompactTextBandHeight(text, fontSize, indicatorSize); float val2 = (showLifetimeIndicator ? (LifetimeIndicatorSize(fontSize, markerScale) + 4f * num) : 0f); return Math.Max(val, val2); } private static float CompactMetadataDistanceWidth(string text, float preferredWidth, MarkerHudVisualFootprint footprint) { if (string.IsNullOrEmpty(text)) { return 0f; } if (IsFinite(preferredWidth) && preferredWidth > 0f) { return Math.Min(((MarkerHudVisualFootprint)(ref footprint)).LabelWidth, preferredWidth); } return ((MarkerHudVisualFootprint)(ref footprint)).LabelWidth; } private static float CompactMetadataGap(MarkerHudVisualFootprint footprint) { return Math.Max(3f, ((MarkerHudVisualFootprint)(ref footprint)).Gap * 0.55f); } private static float CompactMetadataGroupWidth(MarkerClusterPresentationPlan plan, MarkerHudVisualFootprint footprint, int fontSize, float markerScale, float preferredDistanceWidth) { //IL_0008: 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) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0041: 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_007f: Unknown result type (might be due to invalid IL or missing references) float num = CompactMetadataDistanceWidth(plan.Text, preferredDistanceWidth, footprint); MarkerLifetimeIndicatorSpec lifetimeIndicator = plan.LifetimeIndicator; if (!((MarkerLifetimeIndicatorSpec)(ref lifetimeIndicator)).Visible) { return num; } float num2 = LifetimeIndicatorSize(fontSize, markerScale); lifetimeIndicator = plan.LifetimeIndicator; float num3; if (!((MarkerLifetimeIndicatorSpec)(ref lifetimeIndicator)).ShowCount) { num3 = 0f; } else { lifetimeIndicator = plan.LifetimeIndicator; num3 = LifetimeCountWidth(fontSize, ((MarkerLifetimeIndicatorSpec)(ref lifetimeIndicator)).CountText.Length); } float num4 = num3; return num2 + ((num4 > 0f) ? (3f + num4) : 0f) + ((num > 0f) ? (CompactMetadataGap(footprint) + num) : 0f); } private static MarkerHudVisualFootprint EnsureCompactMetadataRowFootprint(MarkerHudVisualFootprint footprint, MarkerClusterPresentationPlan plan, int fontSize, float markerScale, float preferredDistanceWidth) { //IL_004b: 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_0060: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) float num = Mathf.Min((float)Screen.width / 1920f, (float)Screen.height / 1080f) * MarkerClusterPresentationPolicy.ClampMarkerScale(markerScale); if (!IsFinite(num) || num <= 0f) { num = 1f; } string text = plan.Text; float indicatorSize = ((MarkerHudVisualFootprint)(ref footprint)).IndicatorSize; MarkerLifetimeIndicatorSpec lifetimeIndicator = plan.LifetimeIndicator; float num2 = CompactMetadataRowHeight(text, fontSize, indicatorSize, markerScale, ((MarkerLifetimeIndicatorSpec)(ref lifetimeIndicator)).Visible); float num3 = CompactMetadataGroupWidth(plan, footprint, fontSize, markerScale, preferredDistanceWidth); float num4 = Math.Max(((MarkerHudVisualFootprint)(ref footprint)).Width, ((MarkerHudVisualFootprint)(ref footprint)).PaddingX * 2f + num3); float num5 = Math.Max(((MarkerHudVisualFootprint)(ref footprint)).Height, num2 + 8f * num); return new MarkerHudVisualFootprint(num4, num5, ((MarkerHudVisualFootprint)(ref footprint)).IndicatorSize, ((MarkerHudVisualFootprint)(ref footprint)).LabelWidth, ((MarkerHudVisualFootprint)(ref footprint)).PaddingX, ((MarkerHudVisualFootprint)(ref footprint)).Gap); } private static int CompactDisplayedGlyphCount(int logicalCount) { return Math.Max(1, Math.Min(11, Math.Max(0, logicalCount))); } private static int CompactDisplayedGlyphCount(MarkerCompactCategoryBadge group) { return 1; } private static void CompactGlyphGroupExtent(MarkerCompactCategoryBadge group, int fontSize, float markerScale, float indicatorSize, bool showCount, out float width, out float height) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) MarkerCompactCellGeometry val = MarkerCategorySummaryPolicy.BuildCompactCellGeometry((float)Screen.width, (float)Screen.height, markerScale, indicatorSize, (float)fontSize, false); MarkerCompactLayoutSlot[] array = MarkerCategorySummaryPolicy.BuildCompactLayout(CompactDisplayedGlyphCount(group)); int num = 1; int num2 = 0; for (int i = 0; i < array.Length; i++) { if (((MarkerCompactLayoutSlot)(ref array[i])).RowSize > num) { num = ((MarkerCompactLayoutSlot)(ref array[i])).RowSize; } if (((MarkerCompactLayoutSlot)(ref array[i])).Row > num2) { num2 = ((MarkerCompactLayoutSlot)(ref array[i])).Row; } } float num3 = Math.Max(4f, ((MarkerCompactCellGeometry)(ref val)).BadgeSize * 0.22f); width = (float)num * ((MarkerCompactCellGeometry)(ref val)).BadgeSize + (float)Math.Max(0, num - 1) * num3; height = (float)(num2 + 1) * ((MarkerCompactCellGeometry)(ref val)).VerticalStride; if (showCount) { height += Math.Max(8f, (float)fontSize * 0.82f); } } private static float CompactMetadataBottomPadding(float markerScale) { float num = Mathf.Min((float)Screen.width / 1920f, (float)Screen.height / 1080f) * MarkerClusterPresentationPolicy.ClampMarkerScale(markerScale); if (!IsFinite(num) || num <= 0f) { num = 1f; } return 2f * num; } private static float CompactGroupBottomExtent(MarkerCompactCategoryBadge group, int fontSize, float markerScale, float indicatorSize, bool showCount) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) MarkerCompactCellGeometry val = MarkerCategorySummaryPolicy.BuildCompactCellGeometry((float)Screen.width, (float)Screen.height, markerScale, indicatorSize, (float)fontSize, false); if (!showCount) { return ((MarkerCompactCellGeometry)(ref val)).BadgeSize * 0.5f; } CompactGlyphGroupExtent(group, fontSize, markerScale, indicatorSize, showCount: true, out var _, out var height); float num = Mathf.Min((float)Screen.width / 1920f, (float)Screen.height / 1080f) * MarkerClusterPresentationPolicy.ClampMarkerScale(markerScale); if (!IsFinite(num) || num <= 0f) { num = 1f; } float num2 = (float)fontSize * 1.1f; float num3 = (0f - height) * 0.5f + Math.Max(4f * num, (float)fontSize * 0.28f); return Math.Max(((MarkerCompactCellGeometry)(ref val)).BadgeSize * 0.5f, 0f - num3 + num2 * 0.5f); } private static float CompactGroupHalfWidth(int fontSize, float markerScale, float indicatorSize, bool showCount) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) MarkerCompactCellGeometry val = MarkerCategorySummaryPolicy.BuildCompactCellGeometry((float)Screen.width, (float)Screen.height, markerScale, indicatorSize, (float)fontSize, false); if (!showCount) { return ((MarkerCompactCellGeometry)(ref val)).BadgeSize * 0.5f; } float num = Mathf.Min((float)Screen.width / 1920f, (float)Screen.height / 1080f) * MarkerClusterPresentationPolicy.ClampMarkerScale(markerScale); if (!IsFinite(num) || num <= 0f) { num = 1f; } float val2 = Math.Max(24f * num, (float)fontSize * 2.2f); return Math.Max(((MarkerCompactCellGeometry)(ref val)).BadgeSize, val2) * 0.5f; } private static MarkerHudVisualFootprint ExtendFootprintForCompactBadges(MarkerHudVisualFootprint footprint, MarkerClusterPresentationPlan plan, int fontSize, float markerScale) { //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_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_018b: Unknown result type (might be due to invalid IL or missing references) //IL_01d8: Unknown result type (might be due to invalid IL or missing references) //IL_0374: Unknown result type (might be due to invalid IL or missing references) int num = Math.Min(plan.CompactBadges.Count, 22); if (num <= 0) { return footprint; } int[] array = new int[num]; int[] array2 = new int[num]; int[] array3 = new int[11]; int num2 = 0; bool flag = false; MarkerSemanticCategory val = (MarkerSemanticCategory)9; for (int i = 0; i < num; i++) { MarkerCompactCategoryBadge val2 = plan.CompactBadges[i]; if (!flag || ((MarkerCompactCategoryBadge)(ref val2)).Category != val) { val = ((MarkerCompactCategoryBadge)(ref val2)).Category; flag = true; num2++; } int num3 = (array[i] = num2 - 1); if (num3 >= 0 && num3 < array3.Length) { array2[i] = array3[num3]; array3[num3]++; } } num2 = Math.Min(num2, 11); MarkerCompactCellGeometry val3 = MarkerCategorySummaryPolicy.BuildCompactCellGeometry((float)Screen.width, (float)Screen.height, markerScale, ((MarkerHudVisualFootprint)(ref footprint)).IndicatorSize, (float)fontSize, false); MarkerCompactLayoutSlot[] array4 = MarkerCategorySummaryPolicy.BuildCompactLayout(num2); float num4 = MarkerCategorySummaryPolicy.BuildCompactCategoryCenterHorizontalStride((float)Screen.width, (float)Screen.height, markerScale, ((MarkerHudVisualFootprint)(ref footprint)).IndicatorSize, (float)fontSize, num2); float num5 = MarkerCategorySummaryPolicy.BuildCompactCategoryCenterVerticalStride((float)Screen.width, (float)Screen.height, markerScale, ((MarkerHudVisualFootprint)(ref footprint)).IndicatorSize, (float)fontSize); float num6 = MarkerCategorySummaryPolicy.BuildCompactLifetimeGroupGap((float)Screen.width, (float)Screen.height, markerScale, ((MarkerHudVisualFootprint)(ref footprint)).IndicatorSize, (float)fontSize); float num7 = float.PositiveInfinity; float num8 = float.NegativeInfinity; float num9 = ((MarkerCompactCellGeometry)(ref val3)).BadgeSize * 0.5f; float num10 = CompactGroupHalfWidth(fontSize, markerScale, ((MarkerHudVisualFootprint)(ref footprint)).IndicatorSize, plan.RenderCategorySubcounts); for (int j = 0; j < num; j++) { int num11 = array[j]; if (num11 >= 0 && num11 < num2) { MarkerCompactLayoutSlot val4 = array4[num11]; float num12 = MarkerCategorySummaryPolicy.BuildCompactLifetimeGroupOffsetX(val4, array2[j], array3[num11], ((MarkerCompactCellGeometry)(ref val3)).BadgeSize, num6); float num13 = ((MarkerCompactLayoutSlot)(ref val4)).XUnits * num4 + num12; num7 = Math.Min(num7, num13 - num10); num8 = Math.Max(num8, num13 + num10); float num14 = CompactGroupBottomExtent(plan.CompactBadges[j], fontSize, markerScale, ((MarkerHudVisualFootprint)(ref footprint)).IndicatorSize, plan.RenderCategorySubcounts); if (num14 > num9) { num9 = num14; } } } int num15 = 0; for (int k = 0; k < array4.Length; k++) { if (((MarkerCompactLayoutSlot)(ref array4[k])).Row + 1 > num15) { num15 = ((MarkerCompactLayoutSlot)(ref array4[k])).Row + 1; } } float num16 = ((MarkerCompactCellGeometry)(ref val3)).BadgeSize * 0.5f + num9 + (float)Math.Max(0, num15 - 1) * num5; float num17 = CompactMetadataRowHeight(plan.Text, fontSize, ((MarkerHudVisualFootprint)(ref footprint)).IndicatorSize, markerScale, showLifetimeIndicator: false); float num18 = (string.IsNullOrEmpty(plan.Text) ? 0f : MarkerCategorySummaryPolicy.BuildDetailedCategoryDistanceGap((float)Screen.width, (float)Screen.height, markerScale, ((MarkerHudVisualFootprint)(ref footprint)).IndicatorSize, (float)fontSize)); float num19 = Mathf.Min((float)Screen.width / 1920f, (float)Screen.height / 1080f) * MarkerClusterPresentationPolicy.ClampMarkerScale(markerScale); if (!IsFinite(num19) || num19 <= 0f) { num19 = 1f; } float num20 = CompactMetadataBottomPadding(markerScale); float num21 = ((MarkerHudVisualFootprint)(ref footprint)).Width; if (!float.IsPositiveInfinity(num7) && !float.IsNegativeInfinity(num8)) { num21 = Math.Max(num21, ((MarkerHudVisualFootprint)(ref footprint)).PaddingX * 2f + Math.Max(0f, num8 - num7)); } float val5 = num20 + num17 + num18 + num16 + 4f * num19; return new MarkerHudVisualFootprint(num21, Math.Max(1f, val5), ((MarkerHudVisualFootprint)(ref footprint)).IndicatorSize, ((MarkerHudVisualFootprint)(ref footprint)).LabelWidth, ((MarkerHudVisualFootprint)(ref footprint)).PaddingX, ((MarkerHudVisualFootprint)(ref footprint)).Gap); } private static MarkerHudVisualFootprint ExtendFootprintForDetailedItemIcons(MarkerHudVisualFootprint footprint, int rowCount, int fontSize, float markerScale, bool showLifetimeIndicator) { //IL_010c: Unknown result type (might be due to invalid IL or missing references) float num = Mathf.Min((float)Screen.width / 1920f, (float)Screen.height / 1080f) * MarkerClusterPresentationPolicy.ClampMarkerScale(markerScale); if (!IsFinite(num) || num <= 0f) { num = 1f; } float num2 = Mathf.Max(12f * num, (float)fontSize * 0.82f); float num3 = (showLifetimeIndicator ? LifetimeIndicatorSize(fontSize, markerScale) : 0f); float num4 = (showLifetimeIndicator ? (((MarkerHudVisualFootprint)(ref footprint)).Gap * 0.55f + num3) : 0f); float val = ((MarkerHudVisualFootprint)(ref footprint)).PaddingX * 2f + num2 + num4 + ((MarkerHudVisualFootprint)(ref footprint)).Gap + ((MarkerHudVisualFootprint)(ref footprint)).LabelWidth; float num5 = Math.Max((float)fontSize * 1.18f, Math.Max(num2, num3) + 2f * num); float val2 = (float)Math.Max(1, rowCount) * num5 + 8f * num; return new MarkerHudVisualFootprint(Math.Max(((MarkerHudVisualFootprint)(ref footprint)).Width, val), Math.Max(((MarkerHudVisualFootprint)(ref footprint)).Height, val2), ((MarkerHudVisualFootprint)(ref footprint)).IndicatorSize, ((MarkerHudVisualFootprint)(ref footprint)).LabelWidth, ((MarkerHudVisualFootprint)(ref footprint)).PaddingX, ((MarkerHudVisualFootprint)(ref footprint)).Gap); } private static MarkerHudVisualFootprint ExtendFootprintForDetailedRowDiamonds(MarkerHudVisualFootprint footprint, int rowCount, int fontSize, float markerScale, bool showLifetimeIndicator, int maxLifetimeCountCharacters) { //IL_0111: Unknown result type (might be due to invalid IL or missing references) float num = Mathf.Min((float)Screen.width / 1920f, (float)Screen.height / 1080f) * MarkerClusterPresentationPolicy.ClampMarkerScale(markerScale); if (!IsFinite(num) || num <= 0f) { num = 1f; } float num2 = MarkerCategorySummaryPolicy.BuildCategoryGlyphSize((float)Screen.width, (float)Screen.height, markerScale, ((MarkerHudVisualFootprint)(ref footprint)).IndicatorSize, (float)fontSize); float num3 = Math.Max(((MarkerHudVisualFootprint)(ref footprint)).IndicatorSize, num2); if (showLifetimeIndicator) { num3 += ((MarkerHudVisualFootprint)(ref footprint)).Gap * 0.55f + LifetimeIndicatorSize(fontSize, markerScale); if (maxLifetimeCountCharacters > 0) { num3 += 3f * num + LifetimeCountWidth(fontSize, maxLifetimeCountCharacters); } } float num4 = ((MarkerHudVisualFootprint)(ref footprint)).PaddingX * 2f + num3 + ((MarkerHudVisualFootprint)(ref footprint)).Gap + ((MarkerHudVisualFootprint)(ref footprint)).LabelWidth; float num5 = Math.Max((float)fontSize * 1.18f, num2 + 2f * num); float num6 = Math.Max(val2: (float)Math.Max(1, rowCount) * num5 + 8f * num, val1: ((MarkerHudVisualFootprint)(ref footprint)).Height); return new MarkerHudVisualFootprint(num4, num6, ((MarkerHudVisualFootprint)(ref footprint)).IndicatorSize, ((MarkerHudVisualFootprint)(ref footprint)).LabelWidth, ((MarkerHudVisualFootprint)(ref footprint)).PaddingX, ((MarkerHudVisualFootprint)(ref footprint)).Gap); } private static MarkerHudVisualFootprint ExtendFootprintForSummaryLifetimeIndicator(MarkerHudVisualFootprint footprint, int fontSize, float markerScale, bool showCount) { //IL_0092: Unknown result type (might be due to invalid IL or missing references) float num = Mathf.Min((float)Screen.width / 1920f, (float)Screen.height / 1080f) * MarkerClusterPresentationPolicy.ClampMarkerScale(markerScale); if (!IsFinite(num) || num <= 0f) { num = 1f; } float num2 = ((MarkerHudVisualFootprint)(ref footprint)).Gap * 0.55f + LifetimeIndicatorSize(fontSize, markerScale); if (showCount) { num2 += 3f * num + LifetimeCountWidth(fontSize, 4); } return new MarkerHudVisualFootprint(((MarkerHudVisualFootprint)(ref footprint)).Width + num2, ((MarkerHudVisualFootprint)(ref footprint)).Height, ((MarkerHudVisualFootprint)(ref footprint)).IndicatorSize, ((MarkerHudVisualFootprint)(ref footprint)).LabelWidth, ((MarkerHudVisualFootprint)(ref footprint)).PaddingX, ((MarkerHudVisualFootprint)(ref footprint)).Gap); } private static MarkerHudVisualFootprint CollapseDetailedFootprintWithoutDiamondGutter(MarkerHudVisualFootprint footprint) { //IL_0038: Unknown result type (might be due to invalid IL or missing references) return new MarkerHudVisualFootprint(((MarkerHudVisualFootprint)(ref footprint)).PaddingX * 2f + ((MarkerHudVisualFootprint)(ref footprint)).LabelWidth, ((MarkerHudVisualFootprint)(ref footprint)).Height, ((MarkerHudVisualFootprint)(ref footprint)).IndicatorSize, ((MarkerHudVisualFootprint)(ref footprint)).LabelWidth, ((MarkerHudVisualFootprint)(ref footprint)).PaddingX, ((MarkerHudVisualFootprint)(ref footprint)).Gap); } private void ApplyView(MarkerView view, MarkerSemanticCluster cluster, MarkerRenderInput representative, MarkerClusterPresentationPlan plan, Color mainColor, MarkerHudProjection sourceProjection, MarkerHudPlacement placement, VisualMeasurement measurement, bool fastFollow, bool directional) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0017: 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_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0061: 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_006c: 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_008b: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: 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_010f: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: 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_01b5: Unknown result type (might be due to invalid IL or missing references) //IL_01b9: Unknown result type (might be due to invalid IL or missing references) //IL_01c8: Unknown result type (might be due to invalid IL or missing references) //IL_01ff: Unknown result type (might be due to invalid IL or missing references) //IL_0243: Unknown result type (might be due to invalid IL or missing references) //IL_0230: Unknown result type (might be due to invalid IL or missing references) //IL_02ce: Unknown result type (might be due to invalid IL or missing references) //IL_02d3: Unknown result type (might be due to invalid IL or missing references) //IL_031c: Unknown result type (might be due to invalid IL or missing references) //IL_033e: Unknown result type (might be due to invalid IL or missing references) //IL_0349: Unknown result type (might be due to invalid IL or missing references) //IL_035e: Unknown result type (might be due to invalid IL or missing references) //IL_0369: Unknown result type (might be due to invalid IL or missing references) //IL_0373: Unknown result type (might be due to invalid IL or missing references) //IL_0393: Unknown result type (might be due to invalid IL or missing references) //IL_03a8: Unknown result type (might be due to invalid IL or missing references) //IL_03bd: Unknown result type (might be due to invalid IL or missing references) //IL_03d6: Unknown result type (might be due to invalid IL or missing references) //IL_041c: Unknown result type (might be due to invalid IL or missing references) //IL_043f: Unknown result type (might be due to invalid IL or missing references) //IL_0455: Unknown result type (might be due to invalid IL or missing references) //IL_046b: Unknown result type (might be due to invalid IL or missing references) //IL_05cc: Unknown result type (might be due to invalid IL or missing references) //IL_04b0: Unknown result type (might be due to invalid IL or missing references) //IL_04b5: Unknown result type (might be due to invalid IL or missing references) //IL_04d3: Unknown result type (might be due to invalid IL or missing references) //IL_04dd: Unknown result type (might be due to invalid IL or missing references) //IL_04fb: Unknown result type (might be due to invalid IL or missing references) //IL_0500: Unknown result type (might be due to invalid IL or missing references) //IL_06e7: Unknown result type (might be due to invalid IL or missing references) //IL_0548: Unknown result type (might be due to invalid IL or missing references) //IL_0582: Unknown result type (might be due to invalid IL or missing references) //IL_0896: Unknown result type (might be due to invalid IL or missing references) //IL_081f: Unknown result type (might be due to invalid IL or missing references) //IL_0824: Unknown result type (might be due to invalid IL or missing references) //IL_07c5: Unknown result type (might be due to invalid IL or missing references) //IL_067e: Unknown result type (might be due to invalid IL or missing references) //IL_0683: Unknown result type (might be due to invalid IL or missing references) //IL_0888: Unknown result type (might be due to invalid IL or missing references) //IL_084d: Unknown result type (might be due to invalid IL or missing references) //IL_0852: Unknown result type (might be due to invalid IL or missing references) //IL_06ac: Unknown result type (might be due to invalid IL or missing references) //IL_06b1: Unknown result type (might be due to invalid IL or missing references) //IL_0975: Unknown result type (might be due to invalid IL or missing references) //IL_096e: Unknown result type (might be due to invalid IL or missing references) //IL_09c8: Unknown result type (might be due to invalid IL or missing references) //IL_09f1: Unknown result type (might be due to invalid IL or missing references) //IL_0a87: Unknown result type (might be due to invalid IL or missing references) //IL_0a92: Unknown result type (might be due to invalid IL or missing references) //IL_0a0f: Unknown result type (might be due to invalid IL or missing references) //IL_0ab3: Unknown result type (might be due to invalid IL or missing references) //IL_0ac4: Unknown result type (might be due to invalid IL or missing references) //IL_0b0c: Unknown result type (might be due to invalid IL or missing references) //IL_0b0e: Unknown result type (might be due to invalid IL or missing references) //IL_0a5b: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_canvasRect == (Object)null) { return; } MarkerHudVisualFootprint footprint = measurement.Footprint; Color32 val = Color32.op_Implicit(SanitizeColor(mainColor)); if (!view.HasColor || !((object)view.LastColor/*cast due to .constrained prefix*/).Equals((object?)val)) { view.LastColor = val; view.HasColor = true; ((Graphic)view.Indicator).color = Color32.op_Implicit(val); Color32 val2 = val; val2.a = Math.Min((byte)150, val.a); ((Graphic)view.AssociationCue).color = Color32.op_Implicit(val2); ((Graphic)view.Label).color = ((plan.DetailedItemRows.Count > 0 || plan.ShowDetailedCategoryRowDiamonds || plan.ShowCompactCategoryDiamonds) ? SanitizeColor(_visualSettings.NeutralColor) : Color32.op_Implicit(val)); } Color val3 = ((plan.DetailedItemRows.Count > 0 || plan.ShowDetailedCategoryRowDiamonds || plan.ShowCompactCategoryDiamonds) ? SanitizeColor(_visualSettings.NeutralColor) : Color32.op_Implicit(val)); Color color = ((Graphic)view.Label).color; if (!((Color)(ref color)).Equals(val3)) { ((Graphic)view.Label).color = val3; } float num = (directional ? _visualSettings.OffscreenOpacity : _visualSettings.MarkerOpacity); if (Math.Abs(view.Group.alpha - num) > 0.0001f) { view.Group.alpha = num; } float num2 = (directional ? 0f : _visualSettings.MarkerBackgroundOpacity); Color val4 = default(Color); ((Color)(ref val4))..ctor(0.02f, 0.03f, 0.05f, num2); color = ((Graphic)view.Background).color; if (!((Color)(ref color)).Equals(val4)) { ((Graphic)view.Background).color = val4; } string renderedText = measurement.RenderedText; if (!string.Equals(((TMP_Text)view.Label).text, renderedText, StringComparison.Ordinal)) { ((TMP_Text)view.Label).text = renderedText; } UpdateDetailedItemIcons(view, cluster, plan, footprint); bool flag = !view.HasLayout || measurement.MeasurementChanged; if (view.AppliedBadgePlan != plan || flag) { UpdateCategoryBadges(view, cluster, plan, footprint); view.AppliedBadgePlan = plan; } UpdateLifetimeIndicators(view, cluster, plan, footprint, measurement, directional ? _visualSettings.OffscreenScale : ((MarkerPresentationSettings)(ref _presentationSettings)).Scale); bool flag2 = plan.ShowCompactCategoryDiamonds && plan.CategoryEntries.Count > 0; bool flag3 = plan.ShowDetailedCategoryRowDiamonds && plan.CategoryEntries.Count > 0; bool flag4 = plan.DetailedItemRows.Count > 0 && HasDetailedItemLifetimeIndicator(plan); bool flag5 = flag3 && HasDetailedCategoryLifetimeIndicator(plan); MarkerLifetimeIndicatorSpec lifetimeIndicator = plan.LifetimeIndicator; bool flag6 = ((MarkerLifetimeIndicatorSpec)(ref lifetimeIndicator)).Visible && !flag2 && plan.DetailedItemRows.Count == 0 && !flag3; if (flag) { view.HasLayout = true; view.Rect.sizeDelta = new Vector2(((MarkerHudVisualFootprint)(ref footprint)).Width, ((MarkerHudVisualFootprint)(ref footprint)).Height); _performance.RecordUiLayoutWrite(1); RectTransform rectTransform = ((Graphic)view.Background).rectTransform; rectTransform.anchorMin = Vector2.zero; rectTransform.anchorMax = Vector2.one; rectTransform.pivot = new Vector2(0.5f, 0.5f); rectTransform.offsetMin = Vector2.zero; rectTransform.offsetMax = Vector2.zero; RectTransform rectTransform2 = ((Graphic)view.Indicator).rectTransform; rectTransform2.anchorMin = new Vector2(0.5f, 0.5f); rectTransform2.anchorMax = new Vector2(0.5f, 0.5f); rectTransform2.pivot = new Vector2(0.5f, 0.5f); rectTransform2.sizeDelta = new Vector2(((MarkerHudVisualFootprint)(ref footprint)).IndicatorSize, ((MarkerHudVisualFootprint)(ref footprint)).IndicatorSize); rectTransform2.anchoredPosition = new Vector2((0f - ((MarkerHudVisualFootprint)(ref footprint)).Width) * 0.5f + ((MarkerHudVisualFootprint)(ref footprint)).PaddingX + ((MarkerHudVisualFootprint)(ref footprint)).IndicatorSize * 0.5f, flag2 ? (((MarkerHudVisualFootprint)(ref footprint)).IndicatorSize * 0.28f) : 0f); RectTransform rectTransform3 = ((TMP_Text)view.Label).rectTransform; rectTransform3.anchorMin = new Vector2(0.5f, 0.5f); rectTransform3.anchorMax = new Vector2(0.5f, 0.5f); rectTransform3.pivot = new Vector2(0.5f, 0.5f); if (flag2) { int fontSize = MarkerPresentationPolicy.BuildScaledNativeHudFontSize(Screen.height, ((MarkerPresentationSettings)(ref _presentationSettings)).Scale); string text = plan.Text; float indicatorSize = ((MarkerHudVisualFootprint)(ref footprint)).IndicatorSize; float scale = ((MarkerPresentationSettings)(ref _presentationSettings)).Scale; lifetimeIndicator = plan.LifetimeIndicator; float num3 = CompactMetadataRowHeight(text, fontSize, indicatorSize, scale, ((MarkerLifetimeIndicatorSpec)(ref lifetimeIndicator)).Visible); float num4 = CompactMetadataDistanceWidth(plan.Text, measurement.LabelPreferredWidth, footprint); float num5 = CompactMetadataGroupWidth(plan, footprint, fontSize, ((MarkerPresentationSettings)(ref _presentationSettings)).Scale, measurement.LabelPreferredWidth); lifetimeIndicator = plan.LifetimeIndicator; float num6 = ((((MarkerLifetimeIndicatorSpec)(ref lifetimeIndicator)).Visible && num4 > 0f) ? (num5 * 0.5f - num4 * 0.5f) : 0f); rectTransform3.sizeDelta = new Vector2(Math.Max(1f, num4), Math.Max(1f, num3)); float num7 = CompactMetadataBottomPadding(((MarkerPresentationSettings)(ref _presentationSettings)).Scale); rectTransform3.anchoredPosition = new Vector2(num6, (0f - ((MarkerHudVisualFootprint)(ref footprint)).Height) * 0.5f + num3 * 0.5f + num7); ((TMP_Text)view.Label).alignment = (TextAlignmentOptions)514; } else { bool num8 = plan.ShowMainDiamond || flag3; bool flag7 = plan.DetailedItemRows.Count > 0; rectTransform3.sizeDelta = new Vector2(((MarkerHudVisualFootprint)(ref footprint)).LabelWidth, ((MarkerHudVisualFootprint)(ref footprint)).Height); if (num8) { float num9 = (0f - ((MarkerHudVisualFootprint)(ref footprint)).Width) * 0.5f + ((MarkerHudVisualFootprint)(ref footprint)).PaddingX + ((MarkerHudVisualFootprint)(ref footprint)).IndicatorSize; if (flag5 || flag6) { float num10 = LifetimeIndicatorSize(MarkerPresentationPolicy.BuildScaledNativeHudFontSize(Screen.height, ((MarkerPresentationSettings)(ref _presentationSettings)).Scale), ((MarkerPresentationSettings)(ref _presentationSettings)).Scale); num9 += ((MarkerHudVisualFootprint)(ref footprint)).Gap * 0.55f + num10; if (flag5) { int num11 = MaxDetailedCategoryLifetimeCountCharacters(plan); if (num11 > 0) { num9 += 3f + LifetimeCountWidth(MarkerPresentationPolicy.BuildScaledNativeHudFontSize(Screen.height, ((MarkerPresentationSettings)(ref _presentationSettings)).Scale), num11); } } else { lifetimeIndicator = plan.LifetimeIndicator; if (((MarkerLifetimeIndicatorSpec)(ref lifetimeIndicator)).ShowCount) { float num12 = num9; int fontSize2 = MarkerPresentationPolicy.BuildScaledNativeHudFontSize(Screen.height, ((MarkerPresentationSettings)(ref _presentationSettings)).Scale); lifetimeIndicator = plan.LifetimeIndicator; num9 = num12 + (3f + LifetimeCountWidth(fontSize2, ((MarkerLifetimeIndicatorSpec)(ref lifetimeIndicator)).CountText.Length)); } } } rectTransform3.anchoredPosition = new Vector2(num9 + ((MarkerHudVisualFootprint)(ref footprint)).Gap + ((MarkerHudVisualFootprint)(ref footprint)).LabelWidth * 0.5f, 0f); } else if (flag7) { float num13 = Mathf.Max(12f * Mathf.Min((float)Screen.width / 1920f, (float)Screen.height / 1080f) * ((MarkerPresentationSettings)(ref _presentationSettings)).Scale, (float)MarkerPresentationPolicy.BuildScaledNativeHudFontSize(Screen.height, ((MarkerPresentationSettings)(ref _presentationSettings)).Scale) * 0.82f); float num14 = (0f - ((MarkerHudVisualFootprint)(ref footprint)).Width) * 0.5f + ((MarkerHudVisualFootprint)(ref footprint)).PaddingX + num13; if (flag4) { num14 += ((MarkerHudVisualFootprint)(ref footprint)).Gap * 0.55f + LifetimeIndicatorSize(MarkerPresentationPolicy.BuildScaledNativeHudFontSize(Screen.height, ((MarkerPresentationSettings)(ref _presentationSettings)).Scale), ((MarkerPresentationSettings)(ref _presentationSettings)).Scale); } rectTransform3.anchoredPosition = new Vector2(num14 + ((MarkerHudVisualFootprint)(ref footprint)).Gap + ((MarkerHudVisualFootprint)(ref footprint)).LabelWidth * 0.5f, 0f); } else if (flag6) { float num15 = LifetimeIndicatorSize(MarkerPresentationPolicy.BuildScaledNativeHudFontSize(Screen.height, ((MarkerPresentationSettings)(ref _presentationSettings)).Scale), ((MarkerPresentationSettings)(ref _presentationSettings)).Scale); float num16 = (0f - ((MarkerHudVisualFootprint)(ref footprint)).Width) * 0.5f + ((MarkerHudVisualFootprint)(ref footprint)).PaddingX + num15; lifetimeIndicator = plan.LifetimeIndicator; if (((MarkerLifetimeIndicatorSpec)(ref lifetimeIndicator)).ShowCount) { float num17 = num16; int fontSize3 = MarkerPresentationPolicy.BuildScaledNativeHudFontSize(Screen.height, ((MarkerPresentationSettings)(ref _presentationSettings)).Scale); lifetimeIndicator = plan.LifetimeIndicator; num16 = num17 + (3f + LifetimeCountWidth(fontSize3, ((MarkerLifetimeIndicatorSpec)(ref lifetimeIndicator)).CountText.Length)); } rectTransform3.anchoredPosition = new Vector2(num16 + ((MarkerHudVisualFootprint)(ref footprint)).Gap + ((MarkerHudVisualFootprint)(ref footprint)).LabelWidth * 0.5f, 0f); } else { rectTransform3.anchoredPosition = Vector2.zero; } ((TMP_Text)view.Label).alignment = (TextAlignmentOptions)513; } _performance.RecordUiLayoutWrite(10); } RectTransform rectTransform4 = ((Graphic)view.Indicator).rectTransform; bool flag8 = directional || plan.ShowMainDiamond; if (((Behaviour)view.Indicator).enabled != flag8) { ((Behaviour)view.Indicator).enabled = flag8; } MarkerIndicatorShape markerIndicatorShape = (directional ? MarkerIndicatorShape.DirectionArrow : MarkerIndicatorShape.AnchorDiamond); if (view.LastAppliedShape != markerIndicatorShape) { view.LastAppliedShape = markerIndicatorShape; view.Indicator.Shape = markerIndicatorShape; } float num18 = (directional ? ((MarkerHudPlacement)(ref placement)).ArrowRotationDegrees : 0f); if (MarkerFramePipelinePolicy.ShouldWriteRotation(view.HasAppliedRotation, view.LastAppliedRotationDegrees, num18)) { view.HasAppliedRotation = true; view.LastAppliedRotationDegrees = num18; ((Transform)rectTransform4).localRotation = ((num18 == 0f) ? Quaternion.identity : Quaternion.Euler(0f, 0f, num18)); _performance.RecordUiLayoutWrite(1); } float num19 = ((MarkerHudPlacement)(ref placement)).X - (float)Screen.width * 0.5f; float num20 = ((MarkerHudPlacement)(ref placement)).Y - (float)Screen.height * 0.5f; float num21 = ((!fastFollow && view.HasAppliedPosition) ? MarkerPlacementStabilityPolicy.SmoothCoordinate(view.LastAppliedPosition.x, num19, Time.unscaledDeltaTime) : num19); float num22 = ((!fastFollow && view.HasAppliedPosition) ? MarkerPlacementStabilityPolicy.SmoothCoordinate(view.LastAppliedPosition.y, num20, Time.unscaledDeltaTime) : num20); if (!directional && (int)((MarkerHudPlacement)(ref placement)).Mode == 0 && ((MarkerHudProjection)(ref sourceProjection)).Valid && !((MarkerHudPlacement)(ref placement)).HudRelocated && !((MarkerHudPlacement)(ref placement)).MessageHudRelocated) { float num23 = ((MarkerHudProjection)(ref sourceProjection)).X - (float)Screen.width * 0.5f; float num24 = ((MarkerHudProjection)(ref sourceProjection)).Y - (float)Screen.height * 0.5f; float maxOnScreenAnchorDisplacement = MarkerHudNavigationPolicy.GetMaxOnScreenAnchorDisplacement(footprint, (float)Screen.width, (float)Screen.height); MarkerPlacementStabilityPolicy.ClampDisplacementFromAnchor(num23, num24, num21, num22, maxOnScreenAnchorDisplacement, ref num21, ref num22); } if (MarkerFramePipelinePolicy.ShouldWriteScreenPosition(view.HasAppliedPosition, view.LastAppliedPosition.x, view.LastAppliedPosition.y, num21, num22)) { view.HasAppliedPosition = true; view.LastAppliedPosition = new Vector2(num21, num22); view.Rect.anchoredPosition = view.LastAppliedPosition; _performance.RecordUiLayoutWrite(1); } if (directional) { view.HasAssociationCueVector = false; if (((Component)view.AssociationCue).gameObject.activeSelf) { ((Component)view.AssociationCue).gameObject.SetActive(false); } } else { ApplyAssociationCue(view, sourceProjection, placement, num21, num22); } if (!view.Root.activeSelf) { view.Root.SetActive(true); } } private string BuildRenderedText(TextMeshProUGUI label, MarkerSemanticCluster cluster, MarkerClusterPresentationPlan plan, float detailedItemWidthLimit) { //IL_00ac: 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_00b5: 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_00bf: 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_009a: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) if (plan.DetailedItemRows.Count == 0 && !plan.ShowDetailedCategoryRowDiamonds) { return plan.Text; } string[] array = (plan.Text ?? string.Empty).Split('\n'); int num = ((plan.DetailedItemRows.Count > 0) ? plan.DetailedItemRows.Count : plan.CategoryEntries.Count); for (int i = 0; i < array.Length && i < num; i++) { Color value; if (plan.DetailedItemRows.Count > 0) { MarkerDetailedItemRow row = plan.DetailedItemRows[i]; array[i] = BuildBoundedDetailedItemLine(label, ((MarkerDetailedItemRow)(ref row)).DisplayLabel, ((MarkerDetailedItemRow)(ref row)).Count, detailedItemWidthLimit); value = ResolveOrdinaryItemRowColor(cluster, row); } else { MarkerCompactCategoryBadge val = plan.CategoryEntries[i]; value = ResolveConfiguredCategoryColor(((MarkerCompactCategoryBadge)(ref val)).Category); } array[i] = "" + array[i] + ""; } return string.Join("\n", array); } private string BuildBoundedDetailedItemLine(TextMeshProUGUI label, string displayLabel, int count, float maxWidth) { string text = displayLabel ?? string.Empty; string text2 = " ×" + Math.Max(0, count).ToString(CultureInfo.InvariantCulture); string text3 = text + text2; if (!IsFinite(maxWidth) || maxWidth <= 0f) { return text3; } if (PreferredTextWidth(label, text3) <= maxWidth) { return text3; } if (PreferredTextWidth(label, "…" + text2) > maxWidth) { return text2.TrimStart(); } int num = 0; int num2 = text.Length; string text4 = string.Empty; while (num <= num2) { int num3 = num + (num2 - num) / 2; string text5 = text.Substring(0, num3).TrimEnd(); string text6 = text5 + "…" + text2; if (PreferredTextWidth(label, text6) <= maxWidth) { text4 = text5; num = num3 + 1; } else { num2 = num3 - 1; } } return text4 + "…" + text2; } private float PreferredTextWidth(TextMeshProUGUI label, string text) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) try { _performance.RecordTmpPreferredMeasurement(); float x = ((TMP_Text)label).GetPreferredValues(text).x; return (IsFinite(x) && x > 0f) ? x : float.PositiveInfinity; } catch { return float.PositiveInfinity; } } private Color ResolveOrdinaryItemRowColor(MarkerSemanticCluster cluster, MarkerDetailedItemRow row) { //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_0037: 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_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < cluster.MemberStableKeys.Count; i++) { if (_inputByStableKey.TryGetValue(cluster.MemberStableKeys[i], out var value) && string.Equals(value.ItemSemanticKey, ((MarkerDetailedItemRow)(ref row)).ItemIdentity, StringComparison.Ordinal) && value.Lifetime == ((MarkerDetailedItemRow)(ref row)).Lifetime) { return SanitizeColor(value.NativeColor); } } return ResolveConfiguredCategoryColor(((MarkerDetailedItemRow)(ref row)).Category); } private static string ColorHex(Color value) { //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_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) Color32 val = Color32.op_Implicit(SanitizeColor(value)); return val.r.ToString("X2") + val.g.ToString("X2") + val.b.ToString("X2") + val.a.ToString("X2"); } private void UpdateDetailedItemIcons(MarkerView view, MarkerSemanticCluster cluster, MarkerClusterPresentationPlan plan, MarkerHudVisualFootprint footprint) { //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0176: Unknown result type (might be due to invalid IL or missing references) //IL_017d: Unknown result type (might be due to invalid IL or missing references) //IL_017f: Unknown result type (might be due to invalid IL or missing references) //IL_0180: Unknown result type (might be due to invalid IL or missing references) //IL_0187: Unknown result type (might be due to invalid IL or missing references) //IL_0191: Unknown result type (might be due to invalid IL or missing references) //IL_01a6: Unknown result type (might be due to invalid IL or missing references) int count = plan.DetailedItemRows.Count; EnsureItemIconCapacity(view, count); float num = Mathf.Min((float)Screen.width / 1920f, (float)Screen.height / 1080f) * ((MarkerPresentationSettings)(ref _presentationSettings)).Scale; if (!IsFinite(num) || num <= 0f) { num = 1f; } int num2 = MarkerPresentationPolicy.BuildScaledNativeHudFontSize(Screen.height, ((MarkerPresentationSettings)(ref _presentationSettings)).Scale); float num3 = Mathf.Max(12f * num, (float)num2 * 0.82f); float num4 = Math.Max((float)num2 * 1.18f, num3 + 2f * num); int val = CountPresentationLines(plan.Text); float num5 = (float)(Math.Max(1, val) - 1) * num4 * 0.5f; float num6 = (0f - ((MarkerHudVisualFootprint)(ref footprint)).Width) * 0.5f + ((MarkerHudVisualFootprint)(ref footprint)).PaddingX + num3 * 0.5f; Vector2 val2 = default(Vector2); for (int i = 0; i < view.ItemIcons.Count; i++) { ItemIconView itemIconView = view.ItemIcons[i]; if (i >= count || !TryResolveOrdinaryItemIcon(cluster, plan.DetailedItemRows[i], out Sprite sprite) || (Object)(object)sprite == (Object)null) { if (itemIconView.Root.activeSelf) { itemIconView.Root.SetActive(false); } continue; } itemIconView.Image.sprite = sprite; itemIconView.Image.preserveAspect = true; RectTransform rectTransform = ((Graphic)itemIconView.Image).rectTransform; ((Vector2)(ref val2))..ctor(0.5f, 0.5f); rectTransform.pivot = val2; Vector2 anchorMin = (rectTransform.anchorMax = val2); rectTransform.anchorMin = anchorMin; rectTransform.sizeDelta = new Vector2(num3, num3); rectTransform.anchoredPosition = new Vector2(num6, num5 - (float)i * num4); if (!itemIconView.Root.activeSelf) { itemIconView.Root.SetActive(true); } } } private bool TryResolveOrdinaryItemIcon(MarkerSemanticCluster cluster, MarkerDetailedItemRow row, out Sprite? sprite) { //IL_0037: 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) for (int i = 0; i < cluster.MemberStableKeys.Count; i++) { if (_inputByStableKey.TryGetValue(cluster.MemberStableKeys[i], out var value) && string.Equals(value.ItemSemanticKey, ((MarkerDetailedItemRow)(ref row)).ItemIdentity, StringComparison.Ordinal) && value.Lifetime == ((MarkerDetailedItemRow)(ref row)).Lifetime) { sprite = value.NativeIcon; return (Object)(object)sprite != (Object)null; } } sprite = null; return false; } private void EnsureItemIconCapacity(MarkerView view, int count) { //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Expected O, but got Unknown //IL_0082: Unknown result type (might be due to invalid IL or missing references) int num = Math.Min(count, 12); while (view.ItemIcons.Count < num) { GameObject val = new GameObject("DetailedItemIcon." + view.ItemIcons.Count, new Type[2] { typeof(RectTransform), typeof(Image) }); val.layer = ResolveUiLayer(); val.transform.SetParent(view.Root.transform, false); Image component = val.GetComponent(); ((Graphic)component).raycastTarget = false; ((Graphic)component).color = Color.white; view.ItemIcons.Add(new ItemIconView(val, component)); } } private void UpdateLifetimeIndicators(MarkerView view, MarkerSemanticCluster cluster, MarkerClusterPresentationPlan plan, MarkerHudVisualFootprint footprint, VisualMeasurement measurement, float markerScale) { //IL_0018: 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_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) if (plan.DetailedItemRows.Count > 0) { HideSummaryLifetimeIndicator(view); UpdateDetailedItemLifetimeIndicators(view, cluster, plan, footprint, markerScale); return; } if ((plan.ShowDetailedCategoryRowDiamonds || plan.ShowCompactCategoryDiamonds) && plan.CategoryEntries.Count > 0) { HideRowLifetimeIndicators(view); HideSummaryLifetimeIndicator(view); return; } HideRowLifetimeIndicators(view); MarkerLifetimeIndicatorSpec lifetimeIndicator = plan.LifetimeIndicator; if (!((MarkerLifetimeIndicatorSpec)(ref lifetimeIndicator)).Visible) { HideSummaryLifetimeIndicator(view); return; } LifetimeIndicatorView orCreateSummaryLifetimeIndicator = GetOrCreateSummaryLifetimeIndicator(view); float num = LifetimeIndicatorSize(MarkerPresentationPolicy.BuildScaledNativeHudFontSize(Screen.height, markerScale), markerScale); lifetimeIndicator = plan.LifetimeIndicator; string countText = ((MarkerLifetimeIndicatorSpec)(ref lifetimeIndicator)).CountText; float x = (0f - ((MarkerHudVisualFootprint)(ref footprint)).Width) * 0.5f + ((MarkerHudVisualFootprint)(ref footprint)).PaddingX + (plan.ShowMainDiamond ? (((MarkerHudVisualFootprint)(ref footprint)).IndicatorSize + ((MarkerHudVisualFootprint)(ref footprint)).Gap * 0.55f) : 0f) + num * 0.5f; ConfigureLifetimeIndicator(orCreateSummaryLifetimeIndicator, x, 0f, num, countText, markerScale, (MarkerPresentationGlyphKind)1, SanitizeColor(_visualSettings.NeutralColor)); } private void UpdateDetailedItemLifetimeIndicators(MarkerView view, MarkerSemanticCluster cluster, MarkerClusterPresentationPlan plan, MarkerHudVisualFootprint footprint, float markerScale) { //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_0151: 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_015a: Unknown result type (might be due to invalid IL or missing references) EnsureRowLifetimeIndicatorCapacity(view, plan.DetailedItemRows.Count); int num = MarkerPresentationPolicy.BuildScaledNativeHudFontSize(Screen.height, markerScale); float num2 = Mathf.Min((float)Screen.width / 1920f, (float)Screen.height / 1080f) * MarkerClusterPresentationPolicy.ClampMarkerScale(markerScale); if (!IsFinite(num2) || num2 <= 0f) { num2 = 1f; } float num3 = Mathf.Max(12f * num2, (float)num * 0.82f); float num4 = LifetimeIndicatorSize(num, markerScale); float num5 = Math.Max((float)num * 1.18f, Math.Max(num3, num4) + 2f * num2); int val = CountPresentationLines(plan.Text); float num6 = (float)(Math.Max(1, val) - 1) * num5 * 0.5f; float x = (0f - ((MarkerHudVisualFootprint)(ref footprint)).Width) * 0.5f + ((MarkerHudVisualFootprint)(ref footprint)).PaddingX + num3 + ((MarkerHudVisualFootprint)(ref footprint)).Gap * 0.55f + num4 * 0.5f; for (int i = 0; i < view.RowLifetimeIndicators.Count; i++) { LifetimeIndicatorView lifetimeIndicatorView = view.RowLifetimeIndicators[i]; if (i >= plan.DetailedItemRows.Count) { if (lifetimeIndicatorView.Root.activeSelf) { lifetimeIndicatorView.Root.SetActive(false); } } else { MarkerDetailedItemRow row = plan.DetailedItemRows[i]; ConfigureLifetimeIndicator(lifetimeIndicatorView, x, num6 - (float)i * num5, num4, string.Empty, markerScale, ((MarkerDetailedItemRow)(ref row)).GlyphKind, ResolveOrdinaryItemRowColor(cluster, row)); } } } private void EnsureRowLifetimeIndicatorCapacity(MarkerView view, int count) { int num = Math.Min(count, 12); while (view.RowLifetimeIndicators.Count < num) { view.RowLifetimeIndicators.Add(CreateLifetimeIndicatorView(view.Root.transform, "RowLifetimeIndicator." + view.RowLifetimeIndicators.Count)); } } private LifetimeIndicatorView GetOrCreateSummaryLifetimeIndicator(MarkerView view) { if (view.SummaryLifetimeIndicator != null) { return view.SummaryLifetimeIndicator; } view.SummaryLifetimeIndicator = CreateLifetimeIndicatorView(view.Root.transform, "SummaryLifetimeIndicator"); return view.SummaryLifetimeIndicator; } private LifetimeIndicatorView CreateLifetimeIndicatorView(Transform parent, string name) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Expected O, but got Unknown //IL_0039: 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_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: 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_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_014c: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Unknown result type (might be due to invalid IL or missing references) //IL_018b: Unknown result type (might be due to invalid IL or missing references) //IL_0190: Unknown result type (might be due to invalid IL or missing references) //IL_01a5: Unknown result type (might be due to invalid IL or missing references) //IL_01d3: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject(name, new Type[1] { typeof(RectTransform) }); val.layer = ResolveUiLayer(); val.transform.SetParent(parent, false); RectTransform component = val.GetComponent(); component.anchorMin = Vector2.zero; component.anchorMax = Vector2.one; component.pivot = new Vector2(0.5f, 0.5f); component.offsetMin = Vector2.zero; component.offsetMax = Vector2.zero; GameObject val2 = new GameObject("Diamond", new Type[3] { typeof(RectTransform), typeof(MarkerIndicatorGraphic), typeof(Outline) }) { layer = ResolveUiLayer() }; val2.transform.SetParent(val.transform, false); MarkerIndicatorGraphic component2 = val2.GetComponent(); component2.Shape = MarkerIndicatorShape.AnchorDiamond; ((Graphic)component2).raycastTarget = false; Outline component3 = val2.GetComponent(); ((Shadow)component3).effectColor = Color32.op_Implicit(new Color32((byte)4, (byte)6, (byte)10, (byte)238)); ((Shadow)component3).effectDistance = new Vector2(1f, -1f); ((Shadow)component3).useGraphicAlpha = true; GameObject val3 = new GameObject("Clock", new Type[3] { typeof(RectTransform), typeof(MarkerLifetimeIndicatorGraphic), typeof(Outline) }) { layer = ResolveUiLayer() }; val3.transform.SetParent(val.transform, false); MarkerLifetimeIndicatorGraphic component4 = val3.GetComponent(); ((Graphic)component4).raycastTarget = false; Outline component5 = val3.GetComponent(); ((Shadow)component5).effectColor = Color32.op_Implicit(new Color32((byte)4, (byte)6, (byte)10, (byte)238)); ((Shadow)component5).effectDistance = new Vector2(1f, -1f); ((Shadow)component5).useGraphicAlpha = true; TextMeshProUGUI val4 = CreateText(val.transform, "Count"); ((TMP_Text)val4).alignment = (TextAlignmentOptions)513; ((Graphic)val4).color = Color.white; return new LifetimeIndicatorView(val, component2, component4, val4); } private void ConfigureLifetimeIndicator(LifetimeIndicatorView view, float x, float y, float indicatorSize, string countText, float markerScale, MarkerPresentationGlyphKind glyphKind, Color glyphColor) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Invalid comparison between Unknown and I4 //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_0075: 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_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: 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_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: 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_0169: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Unknown result type (might be due to invalid IL or missing references) //IL_0172: Unknown result type (might be due to invalid IL or missing references) //IL_0173: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_0190: Unknown result type (might be due to invalid IL or missing references) //IL_01b4: Unknown result type (might be due to invalid IL or missing references) Color val = SanitizeColor(glyphColor); bool flag = (int)glyphKind == 1; if (((Component)view.Clock).gameObject.activeSelf != flag) { ((Component)view.Clock).gameObject.SetActive(flag); } if (((Component)view.Diamond).gameObject.activeSelf == flag) { ((Component)view.Diamond).gameObject.SetActive(!flag); } MaskableGraphic val2 = (MaskableGraphic)(flag ? ((object)view.Clock) : ((object)view.Diamond)); Color color = ((Graphic)val2).color; if (!((Color)(ref color)).Equals(val)) { ((Graphic)val2).color = val; } RectTransform rectTransform = ((Graphic)val2).rectTransform; Vector2 val3 = default(Vector2); ((Vector2)(ref val3))..ctor(0.5f, 0.5f); rectTransform.pivot = val3; Vector2 anchorMin = (rectTransform.anchorMax = val3); rectTransform.anchorMin = anchorMin; rectTransform.sizeDelta = new Vector2(indicatorSize, indicatorSize); rectTransform.anchoredPosition = new Vector2(x, y); if (!string.Equals(((TMP_Text)view.Count).text, countText, StringComparison.Ordinal)) { ((TMP_Text)view.Count).text = countText; } bool flag2 = !string.IsNullOrEmpty(countText); if (((Behaviour)view.Count).enabled != flag2) { ((Behaviour)view.Count).enabled = flag2; } if (flag2) { EnsureLifetimeTypography(view.Count, markerScale); int num = MarkerPresentationPolicy.BuildScaledNativeHudFontSize(Screen.height, markerScale); float num2 = LifetimeCountWidth(num, countText.Length); RectTransform rectTransform2 = ((TMP_Text)view.Count).rectTransform; ((Vector2)(ref val3))..ctor(0.5f, 0.5f); rectTransform2.pivot = val3; anchorMin = (rectTransform2.anchorMax = val3); rectTransform2.anchorMin = anchorMin; rectTransform2.sizeDelta = new Vector2(num2, indicatorSize + (float)num * 0.35f); rectTransform2.anchoredPosition = new Vector2(x + indicatorSize * 0.5f + 3f + num2 * 0.5f, y); } if (!view.Root.activeSelf) { view.Root.SetActive(true); } } private static void HideRowLifetimeIndicators(MarkerView view) { for (int i = 0; i < view.RowLifetimeIndicators.Count; i++) { if (view.RowLifetimeIndicators[i].Root.activeSelf) { view.RowLifetimeIndicators[i].Root.SetActive(false); } } } private static void HideSummaryLifetimeIndicator(MarkerView view) { if (view.SummaryLifetimeIndicator != null && view.SummaryLifetimeIndicator.Root.activeSelf) { view.SummaryLifetimeIndicator.Root.SetActive(false); } } private void UpdateCategoryBadges(MarkerView view, MarkerSemanticCluster cluster, MarkerClusterPresentationPlan plan, MarkerHudVisualFootprint footprint) { //IL_0018: 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 (plan.ShowDetailedCategoryRowDiamonds) { UpdateDetailedCategoryRowDiamonds(view, cluster, plan, footprint); } else { UpdateCompactBadges(view, cluster, plan, footprint); } } private void UpdateDetailedCategoryRowDiamonds(MarkerView view, MarkerSemanticCluster cluster, MarkerClusterPresentationPlan plan, MarkerHudVisualFootprint footprint) { //IL_0138: Unknown result type (might be due to invalid IL or missing references) //IL_013d: 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_014c: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) int count = plan.CategoryEntries.Count; EnsureBadgeCapacity(view, count); float num = Mathf.Min((float)Screen.width / 1920f, (float)Screen.height / 1080f) * ((MarkerPresentationSettings)(ref _presentationSettings)).Scale; if (!IsFinite(num) || num <= 0f) { num = 1f; } int num2 = MarkerPresentationPolicy.BuildScaledNativeHudFontSize(Screen.height, ((MarkerPresentationSettings)(ref _presentationSettings)).Scale); float num3 = MarkerCategorySummaryPolicy.BuildCategoryGlyphSize((float)Screen.width, (float)Screen.height, ((MarkerPresentationSettings)(ref _presentationSettings)).Scale, ((MarkerHudVisualFootprint)(ref footprint)).IndicatorSize, (float)num2); float num4 = Math.Max((float)num2 * 1.18f, num3 + 2f * num); int val = CountPresentationLines(plan.Text); float num5 = (float)(Math.Max(1, val) - 1) * num4 * 0.5f; float x = (0f - ((MarkerHudVisualFootprint)(ref footprint)).Width) * 0.5f + ((MarkerHudVisualFootprint)(ref footprint)).PaddingX + ((MarkerHudVisualFootprint)(ref footprint)).IndicatorSize * 0.5f; for (int i = 0; i < view.Badges.Count; i++) { BadgeView badgeView = view.Badges[i]; if (i >= count) { if (badgeView.Root.activeSelf) { badgeView.Root.SetActive(false); } continue; } MarkerCompactCategoryBadge val2 = plan.CategoryEntries[i]; ConfigureCategoryGlyph(badgeView, ((MarkerCompactCategoryBadge)(ref val2)).GlyphKind, ResolveCategoryColor(cluster, ((MarkerCompactCategoryBadge)(ref val2)).Category), num3, x, num5 - (float)i * num4); if (!string.IsNullOrEmpty(((TMP_Text)badgeView.Count).text)) { ((TMP_Text)badgeView.Count).text = string.Empty; } if (((Behaviour)badgeView.Count).enabled) { ((Behaviour)badgeView.Count).enabled = false; } if (!badgeView.Root.activeSelf) { badgeView.Root.SetActive(true); } } } private static int CountPresentationLines(string text) { if (string.IsNullOrEmpty(text)) { return 0; } int num = 1; for (int i = 0; i < text.Length; i++) { if (text[i] == '\n') { num++; } } return num; } private void UpdateCompactBadges(MarkerView view, MarkerSemanticCluster cluster, MarkerClusterPresentationPlan plan, MarkerHudVisualFootprint footprint) { //IL_002e: 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_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_0266: Unknown result type (might be due to invalid IL or missing references) //IL_0330: Unknown result type (might be due to invalid IL or missing references) //IL_0335: 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_035a: Unknown result type (might be due to invalid IL or missing references) //IL_039a: Unknown result type (might be due to invalid IL or missing references) //IL_043f: Unknown result type (might be due to invalid IL or missing references) //IL_0444: Unknown result type (might be due to invalid IL or missing references) //IL_0470: Unknown result type (might be due to invalid IL or missing references) //IL_0479: Unknown result type (might be due to invalid IL or missing references) //IL_047e: Unknown result type (might be due to invalid IL or missing references) //IL_0524: Unknown result type (might be due to invalid IL or missing references) //IL_0563: Unknown result type (might be due to invalid IL or missing references) //IL_056a: Unknown result type (might be due to invalid IL or missing references) //IL_056c: Unknown result type (might be due to invalid IL or missing references) //IL_056d: Unknown result type (might be due to invalid IL or missing references) //IL_0574: Unknown result type (might be due to invalid IL or missing references) //IL_0599: Unknown result type (might be due to invalid IL or missing references) //IL_05c6: Unknown result type (might be due to invalid IL or missing references) int num = (plan.ShowCompactCategoryDiamonds ? Math.Min(plan.CompactBadges.Count, 22) : 0); int num2 = 0; for (int i = 0; i < num; i++) { num2 += CompactDisplayedGlyphCount(plan.CompactBadges[i]); } EnsureBadgeCapacity(view, num2); int num3 = MarkerPresentationPolicy.BuildScaledNativeHudFontSize(Screen.height, ((MarkerPresentationSettings)(ref _presentationSettings)).Scale); MarkerCompactCellGeometry val = MarkerCategorySummaryPolicy.BuildCompactCellGeometry((float)Screen.width, (float)Screen.height, ((MarkerPresentationSettings)(ref _presentationSettings)).Scale, ((MarkerHudVisualFootprint)(ref footprint)).IndicatorSize, (float)num3, false); float num4 = Mathf.Min((float)Screen.width / 1920f, (float)Screen.height / 1080f) * ((MarkerPresentationSettings)(ref _presentationSettings)).Scale; if (!IsFinite(num4) || num4 <= 0f) { num4 = 1f; } int[] array = new int[num]; int[] array2 = new int[num]; int[] array3 = new int[11]; int num5 = 0; bool flag = false; MarkerSemanticCategory val2 = (MarkerSemanticCategory)9; for (int j = 0; j < num; j++) { MarkerCompactCategoryBadge val3 = plan.CompactBadges[j]; if (!flag || ((MarkerCompactCategoryBadge)(ref val3)).Category != val2) { val2 = ((MarkerCompactCategoryBadge)(ref val3)).Category; flag = true; num5++; } int num6 = (array[j] = num5 - 1); if (num6 >= 0 && num6 < array3.Length) { array2[j] = array3[num6]; array3[num6]++; } } num5 = Math.Min(num5, 11); MarkerCompactLayoutSlot[] array4 = MarkerCategorySummaryPolicy.BuildCompactLayout(num5); float num7 = MarkerCategorySummaryPolicy.BuildCompactCategoryCenterHorizontalStride((float)Screen.width, (float)Screen.height, ((MarkerPresentationSettings)(ref _presentationSettings)).Scale, ((MarkerHudVisualFootprint)(ref footprint)).IndicatorSize, (float)num3, num5); float num8 = MarkerCategorySummaryPolicy.BuildCompactCategoryCenterVerticalStride((float)Screen.width, (float)Screen.height, ((MarkerPresentationSettings)(ref _presentationSettings)).Scale, ((MarkerHudVisualFootprint)(ref footprint)).IndicatorSize, (float)num3); float num9 = MarkerCategorySummaryPolicy.BuildCompactLifetimeGroupGap((float)Screen.width, (float)Screen.height, ((MarkerPresentationSettings)(ref _presentationSettings)).Scale, ((MarkerHudVisualFootprint)(ref footprint)).IndicatorSize, (float)num3); float num10 = CompactMetadataRowHeight(plan.Text, num3, ((MarkerHudVisualFootprint)(ref footprint)).IndicatorSize, ((MarkerPresentationSettings)(ref _presentationSettings)).Scale, showLifetimeIndicator: false); float num11 = (string.IsNullOrEmpty(plan.Text) ? 0f : MarkerCategorySummaryPolicy.BuildDetailedCategoryDistanceGap((float)Screen.width, (float)Screen.height, ((MarkerPresentationSettings)(ref _presentationSettings)).Scale, ((MarkerHudVisualFootprint)(ref footprint)).IndicatorSize, (float)num3)); float num12 = ((MarkerCompactCellGeometry)(ref val)).BadgeSize * 0.5f; for (int k = 0; k < num; k++) { float num13 = CompactGroupBottomExtent(plan.CompactBadges[k], num3, ((MarkerPresentationSettings)(ref _presentationSettings)).Scale, ((MarkerHudVisualFootprint)(ref footprint)).IndicatorSize, plan.RenderCategorySubcounts); if (num13 > num12) { num12 = num13; } } int num14 = 0; for (int l = 0; l < array4.Length; l++) { if (((MarkerCompactLayoutSlot)(ref array4[l])).Row + 1 > num14) { num14 = ((MarkerCompactLayoutSlot)(ref array4[l])).Row + 1; } } float num15 = (float)Math.Max(0, num14 - 1) * num8 * 0.5f; float num16 = CompactMetadataBottomPadding(((MarkerPresentationSettings)(ref _presentationSettings)).Scale); float num17 = (0f - ((MarkerHudVisualFootprint)(ref footprint)).Height) * 0.5f + num16 + num10 + num11; int num18 = 0; Vector2 val7 = default(Vector2); for (int m = 0; m < num; m++) { MarkerCompactCategoryBadge val4 = plan.CompactBadges[m]; int num19 = array[m]; if (num19 < 0 || num19 >= num5) { continue; } MarkerCompactLayoutSlot val5 = array4[num19]; float num20 = MarkerCategorySummaryPolicy.BuildCompactLifetimeGroupOffsetX(val5, array2[m], array3[num19], ((MarkerCompactCellGeometry)(ref val)).BadgeSize, num9); float num21 = ((MarkerCompactLayoutSlot)(ref val5)).XUnits * num7 + num20; float num22 = num17 + num12 + num15 + ((MarkerCompactLayoutSlot)(ref val5)).YUnits * num8; MarkerCompactLayoutSlot[] array5 = MarkerCategorySummaryPolicy.BuildCompactLayout(CompactDisplayedGlyphCount(val4)); int num23 = 0; for (int n = 0; n < array5.Length; n++) { if (((MarkerCompactLayoutSlot)(ref array5[n])).Row + 1 > num23) { num23 = ((MarkerCompactLayoutSlot)(ref array5[n])).Row + 1; } } float num24 = Math.Max(4f, ((MarkerCompactCellGeometry)(ref val)).BadgeSize * 0.22f); float num25 = ((MarkerCompactCellGeometry)(ref val)).BadgeSize + num24; float num26 = (float)(Math.Max(1, num23) - 1) * ((MarkerCompactCellGeometry)(ref val)).VerticalStride * 0.5f; int num27 = 0; while (num27 < array5.Length) { BadgeView badgeView = view.Badges[num18]; MarkerCompactLayoutSlot val6 = array5[num27]; float x = num21 + ((MarkerCompactLayoutSlot)(ref val6)).XUnits * num25; float y = num22 + num26 + ((MarkerCompactLayoutSlot)(ref val6)).YUnits * ((MarkerCompactCellGeometry)(ref val)).VerticalStride; ConfigureCategoryGlyph(badgeView, ((MarkerCompactCategoryBadge)(ref val4)).GlyphKind, ResolveCategoryColor(cluster, ((MarkerCompactCategoryBadge)(ref val4)).Category), ((MarkerCompactCellGeometry)(ref val)).BadgeSize, x, y); bool flag2 = num27 == 0 && plan.RenderCategorySubcounts; string text = (flag2 ? ("×" + ((MarkerCompactCategoryBadge)(ref val4)).Count.ToString(CultureInfo.InvariantCulture)) : string.Empty); if (!string.Equals(((TMP_Text)badgeView.Count).text, text, StringComparison.Ordinal)) { ((TMP_Text)badgeView.Count).text = text; } if (((Behaviour)badgeView.Count).enabled != flag2) { ((Behaviour)badgeView.Count).enabled = flag2; } if (flag2) { EnsureBadgeTypography(badgeView.Count); CompactGlyphGroupExtent(val4, num3, ((MarkerPresentationSettings)(ref _presentationSettings)).Scale, ((MarkerHudVisualFootprint)(ref footprint)).IndicatorSize, showCount: true, out var _, out var height); RectTransform rectTransform = ((TMP_Text)badgeView.Count).rectTransform; ((Vector2)(ref val7))..ctor(0.5f, 0.5f); rectTransform.pivot = val7; Vector2 anchorMin = (rectTransform.anchorMax = val7); rectTransform.anchorMin = anchorMin; rectTransform.sizeDelta = new Vector2(Math.Max(24f * num4, (float)num3 * 2.2f), (float)num3 * 1.1f); rectTransform.anchoredPosition = new Vector2(num21, num22 - height * 0.5f + Math.Max(4f * num4, (float)num3 * 0.28f)); } if (!badgeView.Root.activeSelf) { badgeView.Root.SetActive(true); } num27++; num18++; } } for (int num28 = num18; num28 < view.Badges.Count; num28++) { if (view.Badges[num28].Root.activeSelf) { view.Badges[num28].Root.SetActive(false); } } } private static void ConfigureCategoryGlyph(BadgeView badge, MarkerPresentationGlyphKind glyphKind, Color color, float size, float x, float y) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Invalid comparison between Unknown and I4 //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006b: 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_009b: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_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_00ad: 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_0074: Unknown result type (might be due to invalid IL or missing references) bool flag = (int)glyphKind == 1; if (((Component)badge.Clock).gameObject.activeSelf != flag) { ((Component)badge.Clock).gameObject.SetActive(flag); } if (((Component)badge.Diamond).gameObject.activeSelf == flag) { ((Component)badge.Diamond).gameObject.SetActive(!flag); } MaskableGraphic val = (MaskableGraphic)(flag ? ((object)badge.Clock) : ((object)badge.Diamond)); Color color2 = ((Graphic)val).color; if (!((Color)(ref color2)).Equals(color)) { ((Graphic)val).color = color; } RectTransform rectTransform = ((Graphic)val).rectTransform; Vector2 val2 = default(Vector2); ((Vector2)(ref val2))..ctor(0.5f, 0.5f); rectTransform.pivot = val2; Vector2 anchorMin = (rectTransform.anchorMax = val2); rectTransform.anchorMin = anchorMin; rectTransform.sizeDelta = new Vector2(size, size); rectTransform.anchoredPosition = new Vector2(x, y); } private void EnsureBadgeCapacity(MarkerView view, int count) { //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Expected O, but got Unknown //IL_0070: 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_0090: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_0141: 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_0193: Unknown result type (might be due to invalid IL or missing references) //IL_01a5: Unknown result type (might be due to invalid IL or missing references) //IL_01b5: Unknown result type (might be due to invalid IL or missing references) //IL_01c5: Unknown result type (might be due to invalid IL or missing references) //IL_01ca: Unknown result type (might be due to invalid IL or missing references) //IL_01df: Unknown result type (might be due to invalid IL or missing references) //IL_0216: Unknown result type (might be due to invalid IL or missing references) int num = Math.Min(count, 242); while (view.Badges.Count < num) { GameObject val = new GameObject("CategoryBadge." + view.Badges.Count, new Type[1] { typeof(RectTransform) }); val.layer = ResolveUiLayer(); val.transform.SetParent(view.Root.transform, false); RectTransform component = val.GetComponent(); component.anchorMin = Vector2.zero; component.anchorMax = Vector2.one; component.pivot = new Vector2(0.5f, 0.5f); component.offsetMin = Vector2.zero; component.offsetMax = Vector2.zero; GameObject val2 = new GameObject("Diamond", new Type[3] { typeof(RectTransform), typeof(MarkerIndicatorGraphic), typeof(Outline) }) { layer = ResolveUiLayer() }; val2.transform.SetParent(val.transform, false); MarkerIndicatorGraphic component2 = val2.GetComponent(); component2.Shape = MarkerIndicatorShape.AnchorDiamond; ((Graphic)component2).raycastTarget = false; Outline component3 = val2.GetComponent(); ((Shadow)component3).effectColor = Color32.op_Implicit(new Color32((byte)4, (byte)6, (byte)10, (byte)238)); ((Shadow)component3).effectDistance = new Vector2(1f, -1f); ((Shadow)component3).useGraphicAlpha = true; GameObject val3 = new GameObject("Clock", new Type[3] { typeof(RectTransform), typeof(MarkerLifetimeIndicatorGraphic), typeof(Outline) }) { layer = ResolveUiLayer() }; val3.transform.SetParent(val.transform, false); MarkerLifetimeIndicatorGraphic component4 = val3.GetComponent(); ((Graphic)component4).raycastTarget = false; Outline component5 = val3.GetComponent(); ((Shadow)component5).effectColor = Color32.op_Implicit(new Color32((byte)4, (byte)6, (byte)10, (byte)238)); ((Shadow)component5).effectDistance = new Vector2(1f, -1f); ((Shadow)component5).useGraphicAlpha = true; val3.SetActive(false); TextMeshProUGUI val4 = CreateText(val.transform, "Count"); ((TMP_Text)val4).alignment = (TextAlignmentOptions)514; ((Graphic)val4).color = Color.white; view.Badges.Add(new BadgeView(val, component2, component4, val4)); } } private void EnsureBadgeTypography(TextMeshProUGUI text) { int num = Math.Max(12, (int)Math.Round((float)MarkerPresentationPolicy.BuildScaledNativeHudFontSize(Screen.height, ((MarkerPresentationSettings)(ref _presentationSettings)).Scale) * 0.78f)); if ((Object)(object)_nativeFont != (Object)null && (Object)(object)((TMP_Text)text).font != (Object)(object)_nativeFont) { ((TMP_Text)text).font = _nativeFont; } if ((Object)(object)_nativeFontMaterial != (Object)null && (Object)(object)((TMP_Text)text).fontSharedMaterial != (Object)(object)_nativeFontMaterial) { ((TMP_Text)text).fontSharedMaterial = _nativeFontMaterial; } if (Math.Abs(((TMP_Text)text).fontSize - (float)num) > 0.01f) { ((TMP_Text)text).fontSize = num; } } private void EnsureLifetimeTypography(TextMeshProUGUI text, float markerScale) { int num = Math.Max(11, (int)Math.Round((float)MarkerPresentationPolicy.BuildScaledNativeHudFontSize(Screen.height, markerScale) * 0.72f)); if ((Object)(object)_nativeFont != (Object)null && (Object)(object)((TMP_Text)text).font != (Object)(object)_nativeFont) { ((TMP_Text)text).font = _nativeFont; } if ((Object)(object)_nativeFontMaterial != (Object)null && (Object)(object)((TMP_Text)text).fontSharedMaterial != (Object)(object)_nativeFontMaterial) { ((TMP_Text)text).fontSharedMaterial = _nativeFontMaterial; } if (Math.Abs(((TMP_Text)text).fontSize - (float)num) > 0.01f) { ((TMP_Text)text).fontSize = num; } } private void EmitSemanticLifecycle(MarkerSemanticUpdate update) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < update.LifecycleEvents.Count; i++) { MarkerSemanticLifecycleEvent val = update.LifecycleEvents[i]; MarkerSemanticCluster cluster = ((MarkerSemanticLifecycleEvent)(ref val)).Cluster; _log.LogInfo((object)("ISF_MARKER_SEMANTIC event=" + LifecycleToken(((MarkerSemanticLifecycleEvent)(ref val)).Kind) + " clusterKey=" + cluster.StableKey + " members=" + cluster.TotalCount + " fingerprint=" + cluster.MemberFingerprint + " anchor=" + ((object)cluster.WorldAnchor/*cast due to .constrained prefix*/).ToString() + " composition=" + CompositionToken(cluster) + " items=" + ItemRowsToken(cluster) + " reason=" + ((MarkerSemanticLifecycleEvent)(ref val)).Reason)); } } private static string LifecycleToken(MarkerSemanticLifecycleKind kind) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Expected I4, but got Unknown return (int)kind switch { 0 => "CREATED", 1 => "MEMBERSHIP_CHANGED", 2 => "MERGED", 3 => "SPLIT", 4 => "COMPOSITION_CHANGED", _ => "REMOVED", }; } private static string CompositionToken(MarkerSemanticCluster cluster) { //IL_0022: 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_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_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) string text = string.Empty; for (int i = 0; i < cluster.Composition.Count; i++) { if (i > 0) { text += ","; } string text2 = text; MarkerCategoryCount val = cluster.Composition[i]; string? text3 = ((object)((MarkerCategoryCount)(ref val)).Category/*cast due to .constrained prefix*/).ToString(); val = cluster.Composition[i]; text = text2 + text3 + ":" + ((MarkerCategoryCount)(ref val)).Count; } return text; } private static string ItemRowsToken(MarkerSemanticCluster cluster) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) string text = string.Empty; for (int i = 0; i < cluster.ItemRows.Count; i++) { if (i > 0) { text += ";"; } MarkerItemAggregate val = cluster.ItemRows[i]; text = text + ((MarkerItemAggregate)(ref val)).ItemIdentity + "|" + ((object)((MarkerItemAggregate)(ref val)).Category/*cast due to .constrained prefix*/).ToString() + "|" + ((MarkerItemAggregate)(ref val)).Count + "|" + ((MarkerItemAggregate)(ref val)).LocalizedName; } return text; } public void SetPresentationSuppressed(bool suppressed) { if (_presentationSuppressed != suppressed) { _presentationSuppressed = suppressed; _placementCacheValid = false; if ((Object)(object)_canvas != (Object)null && ((Behaviour)_canvas).enabled == suppressed) { ((Behaviour)_canvas).enabled = !suppressed; } } } public void Clear() { _staleKeys.Clear(); foreach (long key in _views.Keys) { _staleKeys.Add(key); } for (int i = 0; i < _staleKeys.Count; i++) { RemoveView(_staleKeys[i]); } _placementRankByKey.Clear(); _activeClusterKeys.Clear(); _semanticTracker.Clear(); _denseTracker.Clear(); _fovTracker.Clear(); _lodTracker.Clear(); _directionalInputs.Clear(); _denseNodeByKey.Clear(); _activeWorldPresentationKeys.Clear(); _inputByStableKey.Clear(); _worldMembers.Clear(); _clusterFrames.Clear(); _expansionCandidates.Clear(); _placementCacheValid = false; _hasSemanticInputSignature = false; _semanticInputSignature = 0uL; _nextSemanticSolveAt = 0.0; } public void Dispose() { Clear(); if ((Object)(object)_canvasObject != (Object)null) { Object.Destroy((Object)(object)_canvasObject); } _canvasObject = null; _canvas = null; _canvasRect = null; _nativeFont = null; _nativeFontMaterial = null; _typographyResolved = false; _typographyRevision = 0; _indicatorSourceLogged = false; _presentationSuppressed = false; _cachedScreenWidth = -1; _cachedScreenHeight = -1; _cachedDynamicHudZones.Clear(); } private void EnsureCanvas() { //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Expected O, but got Unknown //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)_canvasObject != (Object)null) || !((Object)(object)_canvas != (Object)null) || !((Object)(object)_canvasRect != (Object)null)) { _canvasObject = new GameObject("ItemShareFix.NativeHudMarkerCanvas", new Type[3] { typeof(RectTransform), typeof(Canvas), typeof(CanvasScaler) }); _canvasObject.layer = ResolveUiLayer(); Object.DontDestroyOnLoad((Object)(object)_canvasObject); _canvas = _canvasObject.GetComponent(); _canvas.renderMode = (RenderMode)0; _canvas.overrideSorting = true; _canvas.sortingOrder = 95; _canvas.pixelPerfect = false; ((Behaviour)_canvas).enabled = !_presentationSuppressed; CanvasScaler component = _canvasObject.GetComponent(); component.uiScaleMode = (ScaleMode)0; component.scaleFactor = 1f; _canvasRect = _canvasObject.GetComponent(); _canvasRect.anchorMin = Vector2.zero; _canvasRect.anchorMax = Vector2.one; _canvasRect.pivot = new Vector2(0.5f, 0.5f); _canvasRect.offsetMin = Vector2.zero; _canvasRect.offsetMax = Vector2.zero; if (!_indicatorSourceLogged) { _indicatorSourceLogged = true; _log.LogInfo((object)("[ItemShareFix] indicator asset source=" + MarkerPresentationPolicy.IndicatorAssetSourceToken + " family=" + MarkerPresentationPolicy.IndicatorVisualFamilyToken + " semantic=world-space-cluster adaptiveLod=true style=ISF_ROR2_HUD_NATIVE_V5_C16")); } } } private MarkerView GetOrCreateView(long clusterKey) { //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Expected O, but got Unknown //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_0098: 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_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Unknown result type (might be due to invalid IL or missing references) //IL_0165: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_01a9: Unknown result type (might be due to invalid IL or missing references) //IL_01ae: Unknown result type (might be due to invalid IL or missing references) //IL_01b9: Unknown result type (might be due to invalid IL or missing references) //IL_0219: Unknown result type (might be due to invalid IL or missing references) //IL_021e: Unknown result type (might be due to invalid IL or missing references) //IL_0229: Unknown result type (might be due to invalid IL or missing references) //IL_023b: 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_025f: 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) if (_views.TryGetValue(clusterKey, out MarkerView value) && (Object)(object)value.Root != (Object)null) { return value; } GameObject val = new GameObject("ISF.SemanticCluster." + clusterKey, new Type[2] { typeof(RectTransform), typeof(CanvasGroup) }); val.layer = ResolveUiLayer(); val.transform.SetParent((Transform)(object)_canvasRect, false); RectTransform component = val.GetComponent(); Vector2 val2 = default(Vector2); ((Vector2)(ref val2))..ctor(0.5f, 0.5f); component.pivot = val2; Vector2 anchorMin = (component.anchorMax = val2); component.anchorMin = anchorMin; component.sizeDelta = new Vector2(320f, 58f); CanvasGroup component2 = val.GetComponent(); component2.alpha = 1f; component2.interactable = false; component2.blocksRaycasts = false; GameObject val4 = new GameObject("Background", new Type[2] { typeof(RectTransform), typeof(Image) }) { layer = ResolveUiLayer() }; val4.transform.SetParent(val.transform, false); Image component3 = val4.GetComponent(); ((Graphic)component3).raycastTarget = false; ((Graphic)component3).color = new Color(0.02f, 0.03f, 0.05f, 0f); RectTransform rectTransform = ((Graphic)component3).rectTransform; rectTransform.anchorMin = Vector2.zero; rectTransform.anchorMax = Vector2.one; rectTransform.offsetMin = Vector2.zero; rectTransform.offsetMax = Vector2.zero; GameObject val5 = new GameObject("AssociationCue", new Type[2] { typeof(RectTransform), typeof(MarkerAssociationCueGraphic) }) { layer = ResolveUiLayer() }; val5.transform.SetParent(val.transform, false); MarkerAssociationCueGraphic component4 = val5.GetComponent(); ((Graphic)component4).raycastTarget = false; ((Component)component4).gameObject.SetActive(false); GameObject val6 = new GameObject("IndicatorGraphic", new Type[3] { typeof(RectTransform), typeof(MarkerIndicatorGraphic), typeof(Outline) }) { layer = ResolveUiLayer() }; val6.transform.SetParent(val.transform, false); MarkerIndicatorGraphic component5 = val6.GetComponent(); ((Graphic)component5).raycastTarget = false; Outline component6 = val6.GetComponent(); ((Shadow)component6).effectColor = Color32.op_Implicit(new Color32((byte)4, (byte)6, (byte)10, (byte)238)); ((Shadow)component6).effectDistance = new Vector2(1.35f, -1.35f); ((Shadow)component6).useGraphicAlpha = true; MarkerView markerView = new MarkerView(val, component, component2, component3, component5, component4, CreateText(val.transform, "SemanticLabel")); _views[clusterKey] = markerView; _placementCacheValid = false; return markerView; } private TextMeshProUGUI CreateText(Transform parent, string name) { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject(name, new Type[2] { typeof(RectTransform), typeof(TextMeshProUGUI) }) { layer = ResolveUiLayer() }; val.transform.SetParent(parent, false); TextMeshProUGUI component = val.GetComponent(); ((Graphic)component).raycastTarget = false; ((TMP_Text)component).richText = true; ((TMP_Text)component).enableWordWrapping = false; ((TMP_Text)component).enableAutoSizing = false; ((TMP_Text)component).overflowMode = (TextOverflowModes)0; ((TMP_Text)component).alignment = (TextAlignmentOptions)513; ((TMP_Text)component).fontStyle = (FontStyles)1; ((TMP_Text)component).outlineWidth = 0.14f; ((TMP_Text)component).outlineColor = new Color32((byte)4, (byte)6, (byte)10, (byte)238); ((Graphic)component).color = Color.white; return component; } private void ApplyAssociationCue(MarkerView view, MarkerHudProjection sourceProjection, MarkerHudPlacement placement, float appliedAnchoredX, float appliedAnchoredY) { //IL_0009: 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_0026: 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_0067: 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_013d: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_0166: Unknown result type (might be due to invalid IL or missing references) //IL_018a: Unknown result type (might be due to invalid IL or missing references) //IL_01ab: 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_01b4: Unknown result type (might be due to invalid IL or missing references) //IL_01b5: Unknown result type (might be due to invalid IL or missing references) //IL_01bc: Unknown result type (might be due to invalid IL or missing references) //IL_01d2: Unknown result type (might be due to invalid IL or missing references) //IL_01e4: Unknown result type (might be due to invalid IL or missing references) //IL_0205: Unknown result type (might be due to invalid IL or missing references) MarkerAssociationCueGraphic associationCue = view.AssociationCue; if ((int)((MarkerHudPlacement)(ref placement)).Mode != 0 || !((MarkerHudProjection)(ref sourceProjection)).Valid || !(MarkerHudNavigationPolicy.OnScreenAnchorDisplacement(sourceProjection, new MarkerHudPlacement(((MarkerHudPlacement)(ref placement)).StableKey, ((MarkerHudPlacement)(ref placement)).Mode, ((MarkerHudPlacement)(ref placement)).Edge, appliedAnchoredX + (float)Screen.width * 0.5f, appliedAnchoredY + (float)Screen.height * 0.5f, ((MarkerHudPlacement)(ref placement)).ArrowRotationDegrees, ((MarkerHudPlacement)(ref placement)).LaneSlot, ((MarkerHudPlacement)(ref placement)).RailSlot, ((MarkerHudPlacement)(ref placement)).FinalRect, ((MarkerHudPlacement)(ref placement)).HudRelocated, ((MarkerHudPlacement)(ref placement)).CollisionRelocated, ((MarkerHudPlacement)(ref placement)).MessageHudRelocated)) > 12f)) { view.HasAssociationCueVector = false; if (((Component)associationCue).gameObject.activeSelf) { ((Component)associationCue).gameObject.SetActive(false); } return; } float num = ((MarkerHudProjection)(ref sourceProjection)).X - (float)Screen.width * 0.5f; float num2 = ((MarkerHudProjection)(ref sourceProjection)).Y - (float)Screen.height * 0.5f; float num3 = num - appliedAnchoredX; float num4 = num2 - appliedAnchoredY; float num5 = Mathf.Sqrt(num3 * num3 + num4 * num4); if (!IsFinite(num5) || num5 <= 1f) { view.HasAssociationCueVector = false; if (((Component)associationCue).gameObject.activeSelf) { ((Component)associationCue).gameObject.SetActive(false); } return; } Vector2 val = default(Vector2); ((Vector2)(ref val))..ctor(num3, num4); if (!view.HasAssociationCueVector || Math.Abs(view.LastAssociationCueVector.x - val.x) > 0.5f || Math.Abs(view.LastAssociationCueVector.y - val.y) > 0.5f) { view.HasAssociationCueVector = true; view.LastAssociationCueVector = val; RectTransform rectTransform = ((Graphic)associationCue).rectTransform; Vector2 val2 = default(Vector2); ((Vector2)(ref val2))..ctor(0.5f, 0.5f); rectTransform.pivot = val2; Vector2 anchorMin = (rectTransform.anchorMax = val2); rectTransform.anchorMin = anchorMin; rectTransform.anchoredPosition = new Vector2(num3 * 0.5f, num4 * 0.5f); rectTransform.sizeDelta = new Vector2(num5, 1.5f); ((Transform)rectTransform).localRotation = Quaternion.Euler(0f, 0f, Mathf.Atan2(num4, num3) * 57.29578f); ((Component)associationCue).transform.SetAsFirstSibling(); _performance.RecordUiLayoutWrite(6); } if (!((Component)associationCue).gameObject.activeSelf) { ((Component)associationCue).gameObject.SetActive(true); } } private void EnsureTypography(MarkerView view, int fontSize) { //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) if (MarkerRuntimeHotPathPolicy.ShouldApplyTypography(view.AppliedTypographyRevision, view.AppliedFontSize, _typographyRevision, fontSize)) { TextMeshProUGUI label = view.Label; if ((Object)(object)_nativeFont != (Object)null && (Object)(object)((TMP_Text)label).font != (Object)(object)_nativeFont) { ((TMP_Text)label).font = _nativeFont; } if ((Object)(object)_nativeFontMaterial != (Object)null && (Object)(object)((TMP_Text)label).fontSharedMaterial != (Object)(object)_nativeFontMaterial) { ((TMP_Text)label).fontSharedMaterial = _nativeFontMaterial; } if (Math.Abs(((TMP_Text)label).fontSize - (float)fontSize) > 0.01f) { ((TMP_Text)label).fontSize = fontSize; } if (Math.Abs(((TMP_Text)label).outlineWidth - 0.14f) > 0.001f) { ((TMP_Text)label).outlineWidth = 0.14f; } Color32 val = default(Color32); ((Color32)(ref val))..ctor((byte)4, (byte)6, (byte)10, (byte)238); if (!((object)((TMP_Text)label).outlineColor/*cast due to .constrained prefix*/).Equals((object?)val)) { ((TMP_Text)label).outlineColor = val; } view.AppliedTypographyRevision = _typographyRevision; view.AppliedFontSize = fontSize; view.HasMeasurement = false; } } private static int InstanceIdentity(Object? value) { try { return (value != (Object)null) ? value.GetInstanceID() : 0; } catch { return 0; } } private void ResolveNativeTypography() { //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) _typographyResolved = true; _typographyRevision = ((_typographyRevision == int.MaxValue) ? 1 : (_typographyRevision + 1)); TextMeshProUGUI val = null; int num = int.MinValue; try { TextMeshProUGUI[] array = Resources.FindObjectsOfTypeAll(); foreach (TextMeshProUGUI val2 in array) { if ((Object)(object)val2 == (Object)null || (Object)(object)((TMP_Text)val2).font == (Object)null || (Object)(object)((Component)val2).gameObject == (Object)null || ((Object)(object)_canvasObject != (Object)null && ((TMP_Text)val2).transform.IsChildOf(_canvasObject.transform))) { continue; } Scene scene = ((Component)val2).gameObject.scene; if (((Scene)(ref scene)).IsValid()) { string text = (((Object)((Component)val2).gameObject).name ?? string.Empty).ToLowerInvariant(); int num2 = (((Component)val2).gameObject.activeInHierarchy ? 4 : 0); if (text.Contains("ping")) { num2 += 12; } if (text.Contains("objective")) { num2 += 9; } if (text.Contains("hud")) { num2 += 7; } if (text.Contains("money") || text.Contains("level")) { num2 += 5; } if (num2 > num) { num = num2; val = val2; } } } } catch (Exception ex) { _log.LogDebug((object)("[ItemShareFix] HUD typography scan failed; TMP default will be used: " + ex.GetType().Name)); } if ((Object)(object)val != (Object)null) { _nativeFont = ((TMP_Text)val).font; _nativeFontMaterial = ((TMP_Text)val).fontSharedMaterial; _log.LogInfo((object)("[ItemShareFix] native HUD typography source=" + ((Object)((Component)val).gameObject).name + " style=ISF_ROR2_HUD_NATIVE_V5_C16")); } else { try { _nativeFont = TMP_Settings.defaultFontAsset; } catch { _nativeFont = null; } _nativeFontMaterial = null; _log.LogInfo((object)"[ItemShareFix] native HUD typography source=TMP-default style=ISF_ROR2_HUD_NATIVE_V5_C16"); } foreach (MarkerView value in _views.Values) { value.AppliedTypographyRevision = int.MinValue; value.HasMeasurement = false; } } private static ulong ComputeSemanticInputSignature(IReadOnlyList inputs) { //IL_002a: Unknown result type (might be due to invalid IL or missing references) ulong num = 0uL; ulong num2 = 0uL; int num3 = Math.Min(inputs.Count, 96); for (int i = 0; i < num3; i++) { MarkerRenderInput markerRenderInput = inputs[i]; ulong num4 = Mix64((ulong)markerRenderInput.StableKey ^ ((ulong)markerRenderInput.Kind << 48) ^ StableStringHash(markerRenderInput.ItemSemanticKey)); num ^= num4; num2 += num4 * 1099511628211L; } return Mix64(num ^ num2 ^ (uint)num3); } private static ulong StableStringHash(string value) { ulong num = 14695981039346656037uL; if (value == null) { return num; } foreach (char c in value) { num ^= (byte)(c & 0xFF); num *= 1099511628211L; num ^= (byte)((int)c >> 8); num *= 1099511628211L; } return num; } private static ulong Mix64(ulong x) { x ^= x >> 30; x *= 13787848793156543929uL; x ^= x >> 27; x *= 10723151780598845931uL; x ^= x >> 31; return x; } private static bool SettingsEqual(MarkerPresentationSettings left, MarkerPresentationSettings right) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) if (((MarkerPresentationSettings)(ref left)).Mode == ((MarkerPresentationSettings)(ref right)).Mode && ((MarkerPresentationSettings)(ref left)).ShowDistance == ((MarkerPresentationSettings)(ref right)).ShowDistance && Math.Abs(((MarkerPresentationSettings)(ref left)).Scale - ((MarkerPresentationSettings)(ref right)).Scale) <= 0.0001f && ((MarkerPresentationSettings)(ref left)).DetailRows == ((MarkerPresentationSettings)(ref right)).DetailRows && ((MarkerPresentationSettings)(ref left)).ShowCategoryDiamond == ((MarkerPresentationSettings)(ref right)).ShowCategoryDiamond && ((MarkerPresentationSettings)(ref left)).ShowTierComposition == ((MarkerPresentationSettings)(ref right)).ShowTierComposition && ((MarkerPresentationSettings)(ref left)).CompactShowCount == ((MarkerPresentationSettings)(ref right)).CompactShowCount && ((MarkerPresentationSettings)(ref left)).CompactMixedStyle == ((MarkerPresentationSettings)(ref right)).CompactMixedStyle && ((MarkerPresentationSettings)(ref left)).CategorySortOrder == ((MarkerPresentationSettings)(ref right)).CategorySortOrder) { return ((MarkerPresentationSettings)(ref left)).UseCategorySummaryPresentation == ((MarkerPresentationSettings)(ref right)).UseCategorySummaryPresentation; } return false; } private static bool VisualSettingsEqual(MarkerVisualConfigSnapshot left, MarkerVisualConfigSnapshot right) { //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_0155: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_016d: Unknown result type (might be due to invalid IL or missing references) //IL_0172: Unknown result type (might be due to invalid IL or missing references) //IL_0177: Unknown result type (might be due to invalid IL or missing references) //IL_0185: Unknown result type (might be due to invalid IL or missing references) //IL_018a: Unknown result type (might be due to invalid IL or missing references) //IL_018f: Unknown result type (might be due to invalid IL or missing references) //IL_019d: Unknown result type (might be due to invalid IL or missing references) //IL_01a2: Unknown result type (might be due to invalid IL or missing references) //IL_01a7: Unknown result type (might be due to invalid IL or missing references) //IL_01b5: Unknown result type (might be due to invalid IL or missing references) //IL_01ba: 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) if (Math.Abs(left.MarkerOpacity - right.MarkerOpacity) <= 0.0001f && Math.Abs(left.MarkerBackgroundOpacity - right.MarkerBackgroundOpacity) <= 0.0001f && left.OffscreenEnabled == right.OffscreenEnabled && left.ShowOffscreenDistance == right.ShowOffscreenDistance && left.ShowOffscreenTotalCount == right.ShowOffscreenTotalCount && Math.Abs(left.OffscreenScale - right.OffscreenScale) <= 0.0001f && Math.Abs(left.OffscreenOpacity - right.OffscreenOpacity) <= 0.0001f && Math.Abs(left.OffscreenEdgePadding - right.OffscreenEdgePadding) <= 0.0001f) { Color val = left.CommonColor; if (((Color)(ref val)).Equals(right.CommonColor)) { val = left.UncommonColor; if (((Color)(ref val)).Equals(right.UncommonColor)) { val = left.LegendaryColor; if (((Color)(ref val)).Equals(right.LegendaryColor)) { val = left.BossColor; if (((Color)(ref val)).Equals(right.BossColor)) { val = left.LunarColor; if (((Color)(ref val)).Equals(right.LunarColor)) { val = left.VoidColor; if (((Color)(ref val)).Equals(right.VoidColor)) { val = left.EquipmentColor; if (((Color)(ref val)).Equals(right.EquipmentColor)) { val = left.CommandColor; if (((Color)(ref val)).Equals(right.CommandColor)) { val = left.NeutralColor; if (((Color)(ref val)).Equals(right.NeutralColor)) { val = left.OffscreenColor; return ((Color)(ref val)).Equals(right.OffscreenColor); } } } } } } } } } } return false; } private static bool PlacementDiagnosticStateChanged(MarkerHudPlacement previous, MarkerHudPlacement current) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) if (((MarkerHudPlacement)(ref previous)).Mode == ((MarkerHudPlacement)(ref current)).Mode && ((MarkerHudPlacement)(ref previous)).Edge == ((MarkerHudPlacement)(ref current)).Edge && ((MarkerHudPlacement)(ref previous)).LaneSlot == ((MarkerHudPlacement)(ref current)).LaneSlot && ((MarkerHudPlacement)(ref previous)).RailSlot == ((MarkerHudPlacement)(ref current)).RailSlot && ((MarkerHudPlacement)(ref previous)).HudRelocated == ((MarkerHudPlacement)(ref current)).HudRelocated && ((MarkerHudPlacement)(ref previous)).MessageHudRelocated == ((MarkerHudPlacement)(ref current)).MessageHudRelocated) { return ((MarkerHudPlacement)(ref previous)).CollisionRelocated != ((MarkerHudPlacement)(ref current)).CollisionRelocated; } return true; } private bool DynamicHudZonesChanged(IReadOnlyList? zones) { //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_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) int num = zones?.Count ?? 0; if (_cachedDynamicHudZones.Count != num) { CopyDynamicHudZones(zones); return true; } for (int i = 0; i < num; i++) { MarkerHudExclusionZone val = _cachedDynamicHudZones[i]; MarkerHudExclusionZone val2 = zones[i]; if (!string.Equals(((MarkerHudExclusionZone)(ref val)).Token, ((MarkerHudExclusionZone)(ref val2)).Token, StringComparison.Ordinal) || Math.Abs(((MarkerHudExclusionZone)(ref val)).Left - ((MarkerHudExclusionZone)(ref val2)).Left) > 0.75f || Math.Abs(((MarkerHudExclusionZone)(ref val)).Right - ((MarkerHudExclusionZone)(ref val2)).Right) > 0.75f || Math.Abs(((MarkerHudExclusionZone)(ref val)).Bottom - ((MarkerHudExclusionZone)(ref val2)).Bottom) > 0.75f || Math.Abs(((MarkerHudExclusionZone)(ref val)).Top - ((MarkerHudExclusionZone)(ref val2)).Top) > 0.75f) { CopyDynamicHudZones(zones); return true; } } return false; } private void CopyDynamicHudZones(IReadOnlyList? zones) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) _cachedDynamicHudZones.Clear(); if (zones != null) { for (int i = 0; i < zones.Count; i++) { _cachedDynamicHudZones.Add(zones[i]); } } } private void RemoveView(long clusterKey) { if (_views.TryGetValue(clusterKey, out MarkerView value)) { if ((Object)(object)value.Root != (Object)null) { Object.Destroy((Object)(object)value.Root); } _views.Remove(clusterKey); _placementCacheValid = false; } } private static int ResolveUiLayer() { int num = LayerMask.NameToLayer("UI"); if (num < 0) { return 5; } return num; } private static Color SanitizeColor(Color color) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_000d: 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_0027: 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_0040: 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_0071: 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_005e: 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_007e: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) if (!IsFinite(color.r) || !IsFinite(color.g) || !IsFinite(color.b) || !IsFinite(color.a)) { return Color.white; } if (Mathf.Max(color.r, Mathf.Max(color.g, color.b)) < 0.22f) { color = Color.Lerp(color, Color.white, 0.55f); } color.a = Mathf.Clamp((color.a <= 0.05f) ? 1f : color.a, 0.82f, 1f); return color; } private static bool IsFinite(float value) { if (!float.IsNaN(value)) { return !float.IsInfinity(value); } return false; } } internal static class OptionalRiskOfOptionsIntegration { private sealed class RegisteredOptionBinding { public Assembly Assembly { get; } public object Option { get; } public ConfigEntryBase Entry { get; } public RegisteredOptionBinding(Assembly assembly, object option, ConfigEntryBase entry) { Assembly = assembly; Option = option; Entry = entry; } } public const string PluginGuid = "com.rune580.riskofoptions"; public const string RuntimeAssemblyName = "RiskOfOptions"; public const string StrategyToken = "REFLECTION_SOFT_BINDING_CANONICAL_CONFIGENTRY"; public const int CurrentMarkerOptionCount = 27; private static readonly object RegistrationLock = new object(); private static readonly List RegisteredOptions = new List(27); private static bool _registrationAttempted; private static bool _registrationComplete; private static bool _absenceLogged; private static string _appliedLanguageKey = string.Empty; public static void TryRegister(PluginConfig config, ManualLogSource log) { if (config == null) { throw new ArgumentNullException("config"); } if (log == null) { throw new ArgumentNullException("log"); } lock (RegistrationLock) { if (_registrationComplete || _registrationAttempted) { return; } try { Assembly assembly = AppDomain.CurrentDomain.GetAssemblies().FirstOrDefault((Assembly x) => string.Equals(x.GetName().Name, "RiskOfOptions", StringComparison.Ordinal)); if (assembly == null) { if (!_absenceLogged) { _absenceLogged = true; log.LogInfo((object)"[ItemShareFix] ISF_RISKOFOPTIONS_MARKER_UI absent strategy=REFLECTION_SOFT_BINDING_CANONICAL_CONFIGENTRY canonicalConfig=True hardDependency=False deferredRetry=True"); } return; } _registrationAttempted = true; Type type = assembly.GetType("RiskOfOptions.ModSettingsManager", throwOnError: false); if (type == null) { log.LogWarning((object)("[ItemShareFix] ISF_RISKOFOPTIONS_MARKER_UI registered=0/" + 27 + " failure=ModSettingsManagerUnavailable canonicalConfig=True hardDependency=False")); return; } int num = 27; int num2 = 0; num2 += (RegisterOption(assembly, type, "RiskOfOptions.Options.CheckBoxOption", (ConfigEntryBase)(object)config.PersonalMarkersEnabled, log) ? 1 : 0); num2 += (RegisterOption(assembly, type, "RiskOfOptions.Options.ChoiceOption", (ConfigEntryBase)(object)config.MarkerPresentationMode, log) ? 1 : 0); num2 += (RegisterOption(assembly, type, "RiskOfOptions.Options.CheckBoxOption", (ConfigEntryBase)(object)config.ShareTemporaryItems, log) ? 1 : 0); num2 += (RegisterOption(assembly, type, "RiskOfOptions.Options.CheckBoxOption", (ConfigEntryBase)(object)config.ShowMarkerDistance, log) ? 1 : 0); num2 += (RegisterOption(assembly, type, "RiskOfOptions.Options.StepSliderOption", (ConfigEntryBase)(object)config.MarkerScale, log, 0.75f, 1.25f, 0.05f) ? 1 : 0); num2 += (RegisterOption(assembly, type, "RiskOfOptions.Options.StepSliderOption", (ConfigEntryBase)(object)config.MarkerOpacity, log, 0f, 1f, 0.05f) ? 1 : 0); num2 += (RegisterOption(assembly, type, "RiskOfOptions.Options.StepSliderOption", (ConfigEntryBase)(object)config.MarkerBackgroundOpacity, log, 0f, 1f, 0.05f) ? 1 : 0); num2 += (RegisterOption(assembly, type, "RiskOfOptions.Options.CheckBoxOption", (ConfigEntryBase)(object)config.ShowMarkerCategoryDiamond, log) ? 1 : 0); num2 += (RegisterOption(assembly, type, "RiskOfOptions.Options.StepSliderOption", (ConfigEntryBase)(object)config.MarkerDetailRows, log, 1f, 12f, 1f) ? 1 : 0); num2 += (RegisterOption(assembly, type, "RiskOfOptions.Options.ChoiceOption", (ConfigEntryBase)(object)config.MarkerCategorySortOrder, log) ? 1 : 0); num2 += (RegisterOption(assembly, type, "RiskOfOptions.Options.CheckBoxOption", (ConfigEntryBase)(object)config.MarkerCompactShowCount, log) ? 1 : 0); num2 += (RegisterOption(assembly, type, "RiskOfOptions.Options.CheckBoxOption", (ConfigEntryBase)(object)config.EnableOffscreenIndicators, log) ? 1 : 0); num2 += (RegisterOption(assembly, type, "RiskOfOptions.Options.CheckBoxOption", (ConfigEntryBase)(object)config.ShowOffscreenDistance, log) ? 1 : 0); num2 += (RegisterOption(assembly, type, "RiskOfOptions.Options.CheckBoxOption", (ConfigEntryBase)(object)config.ShowOffscreenTotalCount, log) ? 1 : 0); num2 += (RegisterOption(assembly, type, "RiskOfOptions.Options.StepSliderOption", (ConfigEntryBase)(object)config.OffscreenIndicatorScale, log, 0.75f, 1.25f, 0.05f) ? 1 : 0); num2 += (RegisterOption(assembly, type, "RiskOfOptions.Options.StepSliderOption", (ConfigEntryBase)(object)config.OffscreenIndicatorOpacity, log, 0f, 1f, 0.05f) ? 1 : 0); num2 += (RegisterOption(assembly, type, "RiskOfOptions.Options.StepSliderOption", (ConfigEntryBase)(object)config.OffscreenEdgePadding, log, 12f, 160f, 2f) ? 1 : 0); num2 += (RegisterOption(assembly, type, "RiskOfOptions.Options.ColorOption", (ConfigEntryBase)(object)config.CommonMarkerColor, log) ? 1 : 0); num2 += (RegisterOption(assembly, type, "RiskOfOptions.Options.ColorOption", (ConfigEntryBase)(object)config.UncommonMarkerColor, log) ? 1 : 0); num2 += (RegisterOption(assembly, type, "RiskOfOptions.Options.ColorOption", (ConfigEntryBase)(object)config.LegendaryMarkerColor, log) ? 1 : 0); num2 += (RegisterOption(assembly, type, "RiskOfOptions.Options.ColorOption", (ConfigEntryBase)(object)config.BossMarkerColor, log) ? 1 : 0); num2 += (RegisterOption(assembly, type, "RiskOfOptions.Options.ColorOption", (ConfigEntryBase)(object)config.LunarMarkerColor, log) ? 1 : 0); num2 += (RegisterOption(assembly, type, "RiskOfOptions.Options.ColorOption", (ConfigEntryBase)(object)config.VoidMarkerColor, log) ? 1 : 0); num2 += (RegisterOption(assembly, type, "RiskOfOptions.Options.ColorOption", (ConfigEntryBase)(object)config.EquipmentMarkerColor, log) ? 1 : 0); num2 += (RegisterOption(assembly, type, "RiskOfOptions.Options.ColorOption", (ConfigEntryBase)(object)config.CommandMarkerColor, log) ? 1 : 0); num2 += (RegisterOption(assembly, type, "RiskOfOptions.Options.ColorOption", (ConfigEntryBase)(object)config.NeutralMarkerColor, log) ? 1 : 0); num2 += (RegisterOption(assembly, type, "RiskOfOptions.Options.ColorOption", (ConfigEntryBase)(object)config.OffscreenIndicatorColor, log) ? 1 : 0); if (num2 == num) { _registrationComplete = true; _appliedLanguageKey = MarkerRiskOfOptionsLocalization.CurrentLanguageKey(); log.LogInfo((object)("[ItemShareFix] ISF_RISKOFOPTIONS_MARKER_UI registered=" + num2 + "/" + num + " strategy=REFLECTION_SOFT_BINDING_CANONICAL_CONFIGENTRY canonicalConfig=True hardDependency=False duplicateProtection=True language=" + _appliedLanguageKey)); } else { log.LogWarning((object)("[ItemShareFix] ISF_RISKOFOPTIONS_MARKER_UI registered=" + num2 + "/" + num + " failure=ApiShapeMismatch strategy=REFLECTION_SOFT_BINDING_CANONICAL_CONFIGENTRY canonicalConfig=True hardDependency=False")); } } catch (Exception ex) { log.LogWarning((object)("[ItemShareFix] ISF_RISKOFOPTIONS_MARKER_UI registered=0/" + 27 + " failure=" + ex.GetType().Name + " canonicalConfig=True hardDependency=False")); } } } public static void TryRefreshLocalization(ManualLogSource log) { if (log == null) { throw new ArgumentNullException("log"); } lock (RegistrationLock) { if (!_registrationComplete || RegisteredOptions.Count == 0) { return; } string text = MarkerRiskOfOptionsLocalization.CurrentLanguageKey(); if (!string.Equals(text, _appliedLanguageKey, StringComparison.Ordinal)) { int num = 0; for (int i = 0; i < RegisteredOptions.Count; i++) { RegisteredOptionBinding registeredOptionBinding = RegisteredOptions[i]; MarkerOptionLocalizedText localized = MarkerRiskOfOptionsLocalization.Resolve(registeredOptionBinding.Entry); ApplyRegisteredLanguageTokens(registeredOptionBinding.Assembly, registeredOptionBinding.Option, registeredOptionBinding.Entry, localized); ApplyRegisteredCategory(registeredOptionBinding.Option, registeredOptionBinding.Entry); num++; } _appliedLanguageKey = text; log.LogInfo((object)("[ItemShareFix] ISF_RISKOFOPTIONS_MARKER_UI localizationRefresh=" + num + "/" + RegisteredOptions.Count + " language=" + text + " lifecycle=postAwakeTokenRefresh")); } } } private static bool RegisterOption(Assembly assembly, Type managerType, string optionTypeName, ConfigEntryBase entry, ManualLogSource log, float? min = null, float? max = null, float? increment = null) { Type type = assembly.GetType(optionTypeName, throwOnError: false); if (type == null) { return false; } MarkerOptionLocalizedText localized = MarkerRiskOfOptionsLocalization.Resolve(entry); string category = MarkerRiskOfOptionsLocalization.ResolveCategory(entry); object option = CreateLocalizedOption(type, entry, localized, category, min, max, increment); if (option == null) { log.LogDebug((object)("[ItemShareFix] Risk Of Options typed config constructor not matched for " + optionTypeName + ".")); return false; } MethodInfo methodInfo = (from x in managerType.GetMethods(BindingFlags.Static | BindingFlags.Public) where string.Equals(x.Name, "AddOption", StringComparison.Ordinal) select x).FirstOrDefault(delegate(MethodInfo x) { ParameterInfo[] parameters = x.GetParameters(); return parameters.Length == 3 && parameters[0].ParameterType.IsInstanceOfType(option) && parameters[1].ParameterType == typeof(string) && parameters[2].ParameterType == typeof(string); }); if (methodInfo == null) { log.LogDebug((object)("[ItemShareFix] Risk Of Options canonical AddOption overload not matched for " + optionTypeName + ".")); return false; } methodInfo.Invoke(null, new object[3] { option, "com.itemsharefix", "ItemShareFix" }); ApplyRegisteredLanguageTokens(assembly, option, entry, localized); ApplyRegisteredCategory(option, entry); RegisteredOptions.Add(new RegisteredOptionBinding(assembly, option, entry)); return true; } private static object? CreateLocalizedOption(Type optionType, ConfigEntryBase entry, MarkerOptionLocalizedText localized, string category, float? min, float? max, float? increment) { ConstructorInfo constructorInfo = (from x in optionType.GetConstructors(BindingFlags.Instance | BindingFlags.Public).Where(delegate(ConstructorInfo x) { ParameterInfo[] parameters2 = x.GetParameters(); return parameters2.Length == 2 && parameters2[0].ParameterType.IsInstanceOfType(entry) && parameters2[1].ParameterType != typeof(bool) && IsRiskOfOptionsConfigType(parameters2[1].ParameterType); }) orderby x.MetadataToken select x).FirstOrDefault(); if (constructorInfo == null) { return null; } ParameterInfo[] parameters = constructorInfo.GetParameters(); object obj; try { obj = Activator.CreateInstance(parameters[1].ParameterType); } catch { return null; } if (obj == null) { return null; } ApplyNumericBounds(obj, min, max, increment); ApplyLocalizedOptionConfig(obj, localized, category); try { return constructorInfo.Invoke(new object[2] { entry, obj }); } catch { return null; } } private static bool IsRiskOfOptionsConfigType(Type type) { Type type2 = type; while (type2 != null) { if (string.Equals(type2.FullName, "RiskOfOptions.OptionConfigs.BaseOptionConfig", StringComparison.Ordinal)) { return true; } type2 = type2.BaseType; } return false; } private static void ApplyLocalizedOptionConfig(object config, MarkerOptionLocalizedText localized, string category) { SetTextMember(config, new string[2] { "name", "Name" }, localized.Name); SetTextMember(config, new string[2] { "description", "Description" }, localized.Description); SetTextMember(config, new string[4] { "category", "Category", "categoryName", "CategoryName" }, category); } private static void ApplyRegisteredCategory(object option, ConfigEntryBase entry) { string value = MarkerRiskOfOptionsLocalization.ResolveCategory(entry); SetTextMember(option, new string[4] { "category", "Category", "categoryName", "CategoryName" }, value); Type type = option.GetType(); while (type != null) { object obj = (type.GetField("_config", BindingFlags.Instance | BindingFlags.NonPublic) ?? type.GetField("config", BindingFlags.Instance | BindingFlags.NonPublic))?.GetValue(option); if (obj != null) { SetTextMember(obj, new string[4] { "category", "Category", "categoryName", "CategoryName" }, value); } type = type.BaseType; } } private static void ApplyRegisteredLanguageTokens(Assembly assembly, object option, ConfigEntryBase entry, MarkerOptionLocalizedText localized) { Type type = assembly.GetType("RiskOfOptions.Lib.LanguageApi", throwOnError: false); if (type == null) { return; } MethodInfo methodInfo = type.GetMethods(BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic).FirstOrDefault(delegate(MethodInfo x) { if (!string.Equals(x.Name, "Add", StringComparison.Ordinal)) { return false; } ParameterInfo[] parameters = x.GetParameters(); return parameters.Length == 2 && parameters[0].ParameterType == typeof(string) && parameters[1].ParameterType == typeof(string); }); if (methodInfo == null) { return; } Type type2 = option.GetType(); MethodInfo method = type2.GetMethod("GetNameToken", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); MethodInfo method2 = type2.GetMethod("GetDescriptionToken", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); if (method?.Invoke(option, null) is string text && !string.IsNullOrEmpty(text)) { methodInfo.Invoke(null, new object[2] { text, localized.Name }); } if (method2?.Invoke(option, null) is string text2 && !string.IsNullOrEmpty(text2)) { methodInfo.Invoke(null, new object[2] { text2, localized.Description }); } string[] array = null; if (string.Equals(entry.Definition.Key, "MarkerPresentationMode", StringComparison.Ordinal)) { array = MarkerRiskOfOptionsLocalization.PresentationModeChoices(); } else if (string.Equals(entry.Definition.Key, "MarkerCategorySortOrder", StringComparison.Ordinal)) { array = MarkerRiskOfOptionsLocalization.SortChoices(); } if (array == null) { return; } FieldInfo fieldInfo = null; Type type3 = type2; while (type3 != null && fieldInfo == null) { fieldInfo = type3.GetField("_nameTokens", BindingFlags.Instance | BindingFlags.NonPublic); type3 = type3.BaseType; } if (!(fieldInfo?.GetValue(option) is string[] array2) || array2.Length != array.Length) { return; } for (int num = 0; num < array2.Length; num++) { if (!string.IsNullOrEmpty(array2[num])) { methodInfo.Invoke(null, new object[2] { array2[num], array[num] }); } } } private static void SetTextMember(object target, string[] names, string value) { Type type = target.GetType(); foreach (string name in names) { PropertyInfo property = type.GetProperty(name, BindingFlags.Instance | BindingFlags.Public); if (property != null && property.CanWrite && property.PropertyType == typeof(string)) { property.SetValue(target, value); break; } FieldInfo field = type.GetField(name, BindingFlags.Instance | BindingFlags.Public); if (field != null && field.FieldType == typeof(string)) { field.SetValue(target, value); break; } } } private static void ApplyNumericBounds(object config, float? min, float? max, float? increment) { if (min.HasValue) { SetNumericMember(config, new string[4] { "min", "Min", "minimum", "Minimum" }, min.Value); } if (max.HasValue) { SetNumericMember(config, new string[4] { "max", "Max", "maximum", "Maximum" }, max.Value); } if (increment.HasValue) { SetNumericMember(config, new string[4] { "increment", "Increment", "step", "Step" }, increment.Value); } } private static void SetNumericMember(object target, string[] names, float value) { Type type = target.GetType(); foreach (string name in names) { PropertyInfo property = type.GetProperty(name, BindingFlags.Instance | BindingFlags.Public); if (property != null && property.CanWrite && TryConvertNumeric(value, property.PropertyType, out object converted)) { property.SetValue(target, converted); break; } FieldInfo field = type.GetField(name, BindingFlags.Instance | BindingFlags.Public); if (field != null && TryConvertNumeric(value, field.FieldType, out object converted2)) { field.SetValue(target, converted2); break; } } } private static bool TryConvertNumeric(float value, Type targetType, out object? converted) { if (targetType == typeof(float)) { converted = value; return true; } if (targetType == typeof(double)) { converted = (double)value; return true; } if (targetType == typeof(int)) { converted = (int)Math.Round(value); return true; } converted = null; return false; } } internal sealed class ParticipantSnapshot { public ParticipantKey Key { get; set; } public CharacterMaster? Master { get; set; } public PlayerCharacterMasterController? Controller { get; set; } public ParticipantState State { get; set; } public string Evidence { get; set; } = string.Empty; } internal sealed class ParticipantClassifier { public void Forget(ParticipantKey key) { } public void Reset() { } public bool TrySnapshot(PlayerCharacterMasterController controller, out ParticipantSnapshot snapshot, out string unsupportedEvidence) { //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_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) snapshot = null; unsupportedEvidence = string.Empty; if ((Object)(object)controller == (Object)null || (Object)(object)controller.master == (Object)null) { unsupportedEvidence = "stable identity unsupported: controller/master unavailable"; return false; } CharacterMaster master = controller.master; NetworkInstanceId netId = ((NetworkBehaviour)master).netId; if (((NetworkInstanceId)(ref netId)).Value == 0) { unsupportedEvidence = "stable identity unsupported: master netId is zero"; return false; } if (!ParticipantIdentityResolver.TryResolve(controller, master, out ParticipantKey key, out string evidence)) { unsupportedEvidence = evidence; return false; } if (!TryClassify(controller, master, out ParticipantState state, out string evidence2)) { unsupportedEvidence = evidence2; return false; } snapshot = new ParticipantSnapshot { Key = key, Master = master, Controller = controller, State = state, Evidence = evidence + "; " + evidence2 }; return true; } private static bool TryClassify(PlayerCharacterMasterController controller, CharacterMaster master, out ParticipantState state, out string evidence) { bool flag; try { flag = master.IsDeadAndOutOfLivesServer(); } catch (Exception ex) { state = (ParticipantState)0; evidence = "participant state unsupported: IsDeadAndOutOfLivesServer failed: " + ex.GetType().Name + "; no FULLY_DEAD inference; upstream grants remain authoritative"; return false; } if (!flag) { state = (ParticipantState)0; evidence = "IsDeadAndOutOfLivesServer=false"; return true; } CharacterBody body = master.GetBody(); if (RemoteOperationProbe.HasExactControlledDroneSignal(controller, master, body, out string evidence2)) { state = (ParticipantState)1; evidence = evidence2; return true; } state = (ParticipantState)2; evidence = evidence2 + "; dead/out-of-lives classified FULLY_DEAD fail-closed"; return true; } } internal static class ParticipantIdentityResolver { public static bool TryResolve(PlayerCharacterMasterController controller, CharacterMaster master, out ParticipantKey key, out string evidence) { //IL_000e: 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_0083: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) key = default(ParticipantKey); evidence = string.Empty; NetworkUser val = ((IEnumerable)NetworkUser.readOnlyInstancesList).FirstOrDefault((Func)((NetworkUser x) => (Object)(object)x != (Object)null && x.master == master)); if ((Object)(object)val == (Object)null) { evidence = "stable identity unsupported: no NetworkUser matched authoritative CharacterMaster"; return false; } object member = GetMember(val, "id"); if (member == null) { evidence = "stable identity unsupported: NetworkUser.id unavailable"; return false; } if (!TryFormatStableNetworkUserId(member, out string stableIdentity, out string evidence2)) { evidence = "stable identity unsupported: " + evidence2; return false; } NetworkInstanceId netId = ((NetworkBehaviour)master).netId; uint value = ((NetworkInstanceId)(ref netId)).Value; if (value == 0) { evidence = "stable identity unsupported: authoritative master netId is zero"; return false; } key = new ParticipantKey(new StableUserKey(stableIdentity), "masterNetId=" + value.ToString(CultureInfo.InvariantCulture)); evidence = evidence2 + "; generation=masterNetId:" + value.ToString(CultureInfo.InvariantCulture); return true; } private static bool TryFormatStableNetworkUserId(object boxedNetworkUserId, out string stableIdentity, out string evidence) { stableIdentity = string.Empty; evidence = string.Empty; Type type = boxedNetworkUserId.GetType(); if (!string.Equals(type.FullName, "RoR2.NetworkUserId", StringComparison.Ordinal)) { evidence = "NetworkUser.id runtime type is " + (type.FullName ?? type.Name) + ", expected RoR2.NetworkUserId"; return false; } if (!TryReadTypedMember(boxedNetworkUserId, "platformId", "RoR2.PlatformID", out object value, out string memberName)) { evidence = "RoR2.NetworkUserId has no uniquely proven RoR2.PlatformID identity member"; return false; } if (!TryReadPlayerSlot(boxedNetworkUserId, out byte slot, out string memberName2)) { evidence = "RoR2.NetworkUserId has no uniquely proven byte player-controller slot"; return false; } if (!TryFormatPlatformValue(GetMember(value, "value"), out string text, out string typeName)) { evidence = "RoR2.PlatformID.value is absent/zero or is not a proven UInt64 platform identifier"; return false; } stableIdentity = "NetworkUserId:platformType=" + typeName + ":platform=" + text + ":slot=" + slot.ToString(CultureInfo.InvariantCulture); evidence = "stable identity proven from NetworkUser.id." + memberName + ".value(" + typeName + ") + NetworkUser.id." + memberName2; return true; } private static bool TryReadTypedMember(object owner, string preferredName, string exactTypeFullName, out object? value, out string memberName) { value = null; memberName = string.Empty; MemberInfo memberInfo = GetMemberInfo(owner.GetType(), preferredName); if (memberInfo != null && string.Equals(GetMemberType(memberInfo)?.FullName, exactTypeFullName, StringComparison.Ordinal)) { value = GetMemberValue(owner, memberInfo); if (value != null) { memberName = memberInfo.Name; return true; } } MemberInfo[] array = (from x in owner.GetType().GetMembers(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic) where IsReadableMember(x) && string.Equals(GetMemberType(x)?.FullName, exactTypeFullName, StringComparison.Ordinal) select x).ToArray(); foreach (MemberInfo memberInfo2 in array) { object memberValue = GetMemberValue(owner, memberInfo2); if (memberValue != null) { if (value != null) { return false; } value = memberValue; memberName = memberInfo2.Name; } } return value != null; } private static bool TryReadPlayerSlot(object owner, out byte slot, out string memberName) { slot = 0; memberName = string.Empty; string[] array = new string[2] { "playerControllerId", "subId" }; foreach (string name in array) { MemberInfo memberInfo = GetMemberInfo(owner.GetType(), name); if (!(memberInfo == null) && !(GetMemberType(memberInfo) != typeof(byte)) && GetMemberValue(owner, memberInfo) is byte b) { slot = b; memberName = memberInfo.Name; return true; } } var array2 = (from x in owner.GetType().GetMembers(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic) where IsReadableMember(x) && GetMemberType(x) == typeof(byte) select new { Member = x, Value = GetMemberValue(owner, x) } into x where x.Value is byte select x).ToArray(); if (array2.Length != 1) { return false; } slot = (byte)array2[0].Value; memberName = array2[0].Member.Name; return true; } private static bool TryFormatPlatformValue(object? value, out string text, out string typeName) { text = string.Empty; typeName = string.Empty; if (value is ulong num && num != 0L) { text = num.ToString(CultureInfo.InvariantCulture); typeName = "UInt64"; return true; } return false; } private static MemberInfo? GetMemberInfo(Type type, string name) { PropertyInfo property = type.GetProperty(name, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); if (property != null && property.GetIndexParameters().Length == 0) { return property; } return type.GetField(name, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); } private static Type? GetMemberType(MemberInfo member) { if (member is PropertyInfo propertyInfo) { return propertyInfo.PropertyType; } if (member is FieldInfo fieldInfo) { return fieldInfo.FieldType; } return null; } private static bool IsReadableMember(MemberInfo member) { if (!(member is FieldInfo)) { if (member is PropertyInfo propertyInfo) { return propertyInfo.GetIndexParameters().Length == 0; } return false; } return true; } internal static object? GetMember(object instance, string name) { MemberInfo memberInfo = GetMemberInfo(instance.GetType(), name); if (!(memberInfo == null)) { return GetMemberValue(instance, memberInfo); } return null; } internal static object? GetMemberValue(object instance, MemberInfo member) { try { if (member is PropertyInfo propertyInfo && propertyInfo.GetIndexParameters().Length == 0) { return propertyInfo.GetValue(instance); } if (member is FieldInfo fieldInfo) { return fieldInfo.GetValue(instance); } } catch { } return null; } } internal static class RemoteOperationProbe { private sealed class RuntimeShapeStatus { public bool Compatible { get; set; } public string Evidence { get; set; } = string.Empty; } public const string ExactApiContract = "RoR2.CharacterMaster.GetInRemoteOp() : System.Boolean"; private static readonly Lazy RuntimeShape = new Lazy(InspectRuntimeShape); public static bool TryVerifyRuntimeShape(out string evidence) { RuntimeShapeStatus value = RuntimeShape.Value; evidence = value.Evidence; return value.Compatible; } public static bool HasExactControlledDroneSignal(PlayerCharacterMasterController controller, CharacterMaster master, CharacterBody? body, out string evidence) { if ((Object)(object)controller == (Object)null || (Object)(object)master == (Object)null) { evidence = "RoR2.CharacterMaster.GetInRemoteOp() : System.Boolean; fail-closed: controller/master unavailable"; return false; } if (controller.master != master) { evidence = "RoR2.CharacterMaster.GetInRemoteOp() : System.Boolean; fail-closed: authoritative CharacterMaster ownership mismatch"; return false; } if (!TryVerifyRuntimeShape(out string evidence2)) { evidence = evidence2 + "; fail-closed: exact runtime shape unavailable"; return false; } try { bool inRemoteOp = master.GetInRemoteOp(); bool result = RemoteOperationSignalPolicy.ShouldClassifySupportDrone(true, true, true, inRemoteOp); evidence = "RoR2.CharacterMaster.GetInRemoteOp() : System.Boolean; authoritativeMasterOwnership=ReferenceEquals(controller.master, master); CharacterMaster.GetInRemoteOp()=" + (inRemoteOp ? "true" : "false"); return result; } catch (Exception ex) { evidence = "RoR2.CharacterMaster.GetInRemoteOp() : System.Boolean; fail-closed: invocation threw " + ex.GetType().Name; return RemoteOperationSignalPolicy.ShouldClassifySupportDrone(true, true, false, false); } } private static RuntimeShapeStatus InspectRuntimeShape() { try { MethodInfo method = typeof(CharacterMaster).GetMethod("GetInRemoteOp", BindingFlags.Instance | BindingFlags.Public, null, Type.EmptyTypes, null); bool flag = method != null && !method.IsStatic && !method.ContainsGenericParameters && method.ReturnType == typeof(bool) && method.GetParameters().Length == 0; return new RuntimeShapeStatus { Compatible = flag, Evidence = (flag ? "RoR2.CharacterMaster.GetInRemoteOp() : System.Boolean; runtimeShape=PASS(public instance, zero parameters, Boolean return)" : "RoR2.CharacterMaster.GetInRemoteOp() : System.Boolean; runtimeShape=FAIL(incompatible or missing member)") }; } catch (Exception ex) { return new RuntimeShapeStatus { Compatible = false, Evidence = "RoR2.CharacterMaster.GetInRemoteOp() : System.Boolean; runtimeShape=FAIL(" + ex.GetType().Name + ")" }; } } } internal static class LocalParticipantResolver { public static IReadOnlyList GetLocalMasters() { List list = new List(); Type type = typeof(Run).Assembly.GetType("RoR2.LocalUserManager", throwOnError: false); if (type == null) { return list; } if (!((type.GetProperty("readOnlyLocalUsersList", BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic)?.GetValue(null) ?? type.GetField("readOnlyLocalUsersList", BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic)?.GetValue(null)) is IEnumerable enumerable)) { return list; } foreach (object item in enumerable) { if (item != null) { object? member = ParticipantIdentityResolver.GetMember(item, "cachedMaster"); CharacterMaster val = (CharacterMaster)(((member is CharacterMaster) ? member : null) ?? ((object)/*isinst with value type is only supported in some contexts*/)); if ((Object)(object)val != (Object)null && !list.Contains(val)) { list.Add(val); } } } return list; } public static ParticipantState ClassifyLocal(CharacterMaster master) { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)master == (Object)null) { return LocalParticipantPresentationPolicy.Classify(false, false, false); } CharacterBody val = null; try { val = master.GetBody(); } catch { } PlayerCharacterMasterController val2 = ((IEnumerable)PlayerCharacterMasterController.instances).FirstOrDefault((Func)((PlayerCharacterMasterController x) => (Object)(object)x != (Object)null && x.master == master)); string evidence; bool flag = (Object)(object)val2 != (Object)null && RemoteOperationProbe.HasExactControlledDroneSignal(val2, master, val, out evidence); return LocalParticipantPresentationPolicy.Classify(true, flag, (Object)(object)val != (Object)null); } } internal readonly struct MarkerVisualConfigSnapshot { public float MarkerOpacity { get; } public float MarkerBackgroundOpacity { get; } public bool OffscreenEnabled { get; } public bool ShowOffscreenDistance { get; } public bool ShowOffscreenTotalCount { get; } public float OffscreenScale { get; } public float OffscreenOpacity { get; } public float OffscreenEdgePadding { get; } public Color CommonColor { get; } public Color UncommonColor { get; } public Color LegendaryColor { get; } public Color BossColor { get; } public Color LunarColor { get; } public Color VoidColor { get; } public Color EquipmentColor { get; } public Color CommandColor { get; } public Color NeutralColor { get; } public Color OffscreenColor { get; } public MarkerVisualConfigSnapshot(float markerOpacity, float markerBackgroundOpacity, bool offscreenEnabled, bool showOffscreenDistance, bool showOffscreenTotalCount, float offscreenScale, float offscreenOpacity, float offscreenEdgePadding, Color commonColor, Color uncommonColor, Color legendaryColor, Color bossColor, Color lunarColor, Color voidColor, Color equipmentColor, Color commandColor, Color neutralColor, Color offscreenColor) { //IL_0066: 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_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007e: 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_0086: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: 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_00a8: 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_00b0: Unknown result type (might be due to invalid IL or missing references) MarkerOpacity = MarkerVisualSettingsPolicy.ClampOpacity(markerOpacity, 1f); MarkerBackgroundOpacity = MarkerVisualSettingsPolicy.ClampOpacity(markerBackgroundOpacity, 0f); OffscreenEnabled = offscreenEnabled; ShowOffscreenDistance = showOffscreenDistance; ShowOffscreenTotalCount = showOffscreenTotalCount; OffscreenScale = MarkerVisualSettingsPolicy.ClampOffscreenScale(offscreenScale); OffscreenOpacity = MarkerVisualSettingsPolicy.ClampOpacity(offscreenOpacity, 1f); OffscreenEdgePadding = MarkerVisualSettingsPolicy.ClampOffscreenEdgePadding(offscreenEdgePadding); CommonColor = commonColor; UncommonColor = uncommonColor; LegendaryColor = legendaryColor; BossColor = bossColor; LunarColor = lunarColor; VoidColor = voidColor; EquipmentColor = equipmentColor; CommandColor = commandColor; NeutralColor = neutralColor; OffscreenColor = offscreenColor; } } internal sealed class PluginConfig { public static readonly Color DefaultCommonColor = Color32.op_Implicit(new Color32(byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue)); public static readonly Color DefaultUncommonColor = Color32.op_Implicit(new Color32((byte)119, byte.MaxValue, (byte)17, byte.MaxValue)); public static readonly Color DefaultLegendaryColor = Color32.op_Implicit(new Color32(byte.MaxValue, (byte)63, (byte)63, byte.MaxValue)); public static readonly Color DefaultBossColor = Color32.op_Implicit(new Color32(byte.MaxValue, (byte)224, (byte)64, byte.MaxValue)); public static readonly Color DefaultLunarColor = Color32.op_Implicit(new Color32((byte)112, (byte)187, byte.MaxValue, byte.MaxValue)); public static readonly Color DefaultVoidColor = Color32.op_Implicit(new Color32((byte)215, (byte)92, byte.MaxValue, byte.MaxValue)); public static readonly Color DefaultEquipmentColor = Color32.op_Implicit(new Color32(byte.MaxValue, (byte)138, (byte)35, byte.MaxValue)); public static readonly Color DefaultCommandColor = Color32.op_Implicit(new Color32((byte)89, (byte)209, byte.MaxValue, byte.MaxValue)); public static readonly Color DefaultNeutralColor = Color32.op_Implicit(new Color32(byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue)); public static readonly Color DefaultOffscreenColor = Color32.op_Implicit(new Color32(byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue)); public ConfigEntry Enabled { get; } public ConfigEntry ShareTemporaryItems { get; } public ConfigEntry PersonalPickupVisibilityRepairEnabled { get; } public ConfigEntry PersonalMarkersEnabled { get; } public ConfigEntry DeadPlayerDeferredItemsEnabled { get; } public ConfigEntry DisconnectCleanupEnabled { get; } public ConfigEntry MarkerPresentationMode { get; } public ConfigEntry ShowMarkerDistance { get; } public ConfigEntry MarkerScale { get; } public ConfigEntry MarkerOpacity { get; } public ConfigEntry MarkerBackgroundOpacity { get; } public ConfigEntry ShowMarkerCategoryDiamond { get; } public ConfigEntry ShowMarkerTierComposition { get; } public ConfigEntry MarkerDetailRows { get; } public ConfigEntry MarkerCategorySortOrder { get; } public ConfigEntry MarkerCompactShowCount { get; } public ConfigEntry MarkerCompactMixedStyle { get; } public ConfigEntry EnableOffscreenIndicators { get; } public ConfigEntry ShowOffscreenDistance { get; } public ConfigEntry ShowOffscreenTotalCount { get; } public ConfigEntry OffscreenIndicatorScale { get; } public ConfigEntry OffscreenIndicatorOpacity { get; } public ConfigEntry OffscreenEdgePadding { get; } public ConfigEntry CommonMarkerColor { get; } public ConfigEntry UncommonMarkerColor { get; } public ConfigEntry LegendaryMarkerColor { get; } public ConfigEntry BossMarkerColor { get; } public ConfigEntry LunarMarkerColor { get; } public ConfigEntry VoidMarkerColor { get; } public ConfigEntry EquipmentMarkerColor { get; } public ConfigEntry CommandMarkerColor { get; } public ConfigEntry NeutralMarkerColor { get; } public ConfigEntry OffscreenIndicatorColor { get; } public ConfigEntry DiagnosticLogging { get; } public ConfigEntry DiagnosticLogLevel { get; } public ConfigEntry PresentationSweepSeconds { get; } public ConfigEntry ParticipantSweepSeconds { get; } public ConfigEntry RemoteOperationGraceSeconds { get; } public event EventHandler? MarkerPresentationSettingChanged; public PluginConfig(ConfigFile config) { //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Expected O, but got Unknown //IL_0149: Unknown result type (might be due to invalid IL or missing references) //IL_0153: Expected O, but got Unknown //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_018c: Expected O, but got Unknown //IL_01e8: Unknown result type (might be due to invalid IL or missing references) //IL_01f2: Expected O, but got Unknown //IL_02c9: Unknown result type (might be due to invalid IL or missing references) //IL_02d3: Expected O, but got Unknown //IL_0302: Unknown result type (might be due to invalid IL or missing references) //IL_030c: Expected O, but got Unknown //IL_033b: Unknown result type (might be due to invalid IL or missing references) //IL_0345: Expected O, but got Unknown //IL_0356: Unknown result type (might be due to invalid IL or missing references) //IL_0376: Unknown result type (might be due to invalid IL or missing references) //IL_0396: Unknown result type (might be due to invalid IL or missing references) //IL_03b6: Unknown result type (might be due to invalid IL or missing references) //IL_03d6: Unknown result type (might be due to invalid IL or missing references) //IL_03f6: Unknown result type (might be due to invalid IL or missing references) //IL_0416: Unknown result type (might be due to invalid IL or missing references) //IL_0436: Unknown result type (might be due to invalid IL or missing references) //IL_0456: Unknown result type (might be due to invalid IL or missing references) //IL_0476: Unknown result type (might be due to invalid IL or missing references) Enabled = config.Bind("General", "Enabled", true, "Master switch for ItemShareFix."); ShareTemporaryItems = config.Bind("General", "ShareTemporaryItems", false, "Share temporary item pickups through ItemShare. Fresh configs default to disabled; existing saved values are preserved. Disable this to give temporary pickups vanilla first-come-first-served behavior instead of ItemShare distribution."); PersonalPickupVisibilityRepairEnabled = config.Bind("General", "PersonalPickupVisibilityRepairEnabled", true, "Repair ItemShare 1.7.1 personal ordinary-pickup visibility. The upstream HideCollectedOrbs preference is still respected."); PersonalMarkersEnabled = config.Bind("General", "PersonalMarkersEnabled", true, "Draw local-only automatic markers for shared ordinary pickups and Artifact of Command choices still pending for a local participant."); DeadPlayerDeferredItemsEnabled = config.Bind("General", "DeadPlayerDeferredItemsEnabled", true, "FULLY_DEAD participants do not receive ItemShare's immediate ShareToDead grant; their entitlement is deferred to the next safe restored-player point."); DisconnectCleanupEnabled = config.Bind("General", "DisconnectCleanupEnabled", true, "Cancel ItemShareFix pending/deferred state when a participant disconnects and prevent absence catch-up."); MarkerPresentationMode = config.Bind("Markers", "MarkerPresentationMode", (MarkerPresentationMode)0, "Marker presentation: Detailed (default truthful localized titles/composition) or Compact (minimal diamond presentation)."); ShowMarkerDistance = config.Bind("Markers", "ShowMarkerDistance", true, "Show distance for in-FOV world marker cards."); MarkerScale = config.Bind("Markers", "MarkerScale", 1f, new ConfigDescription("Marker UI scale. Presentation-only; does not rebuild physical or dense world membership.", (AcceptableValueBase)(object)new AcceptableValueRange(0.75f, 1.25f), Array.Empty())); MarkerOpacity = config.Bind("Markers", "MarkerOpacity", 1f, new ConfigDescription("World marker opacity.", (AcceptableValueBase)(object)new AcceptableValueRange(0f, 1f), Array.Empty())); MarkerBackgroundOpacity = config.Bind("Markers", "MarkerBackgroundOpacity", 0f, new ConfigDescription("World marker background opacity. Default 0 preserves the established transparent appearance.", (AcceptableValueBase)(object)new AcceptableValueRange(0f, 1f), Array.Empty())); ShowMarkerCategoryDiamond = config.Bind("Markers", "ShowMarkerCategoryDiamond", true, "Detailed mode: show the tier/category diamond cue."); ShowMarkerTierComposition = config.Bind("Markers", "ShowMarkerTierComposition", true, "Legacy compatibility value retained for existing config files. Grouped category summaries are always truthful and this value no longer changes grouped rows."); MarkerDetailRows = config.Bind("Markers", "MarkerDetailRows", 5, new ConfigDescription("Ordinary Detailed mode: maximum visible distinct item rows before the localized overflow row.", (AcceptableValueBase)(object)new AcceptableValueRange(1, 12), Array.Empty())); MarkerCategorySortOrder = config.Bind("Markers", "MarkerCategorySortOrder", (MarkerCategorySortOrder)0, "Grouped category display order. HighToLow (default) or exact reverse LowToHigh; presentation-only."); MarkerCompactShowCount = config.Bind("Markers", "MarkerCompactShowCount", true, "Compact pyramid: show each represented category subtotal on its own diamond."); MarkerCompactMixedStyle = config.Bind("Markers", "MarkerCompactMixedStyle", (MarkerCompactMixedStyle)2, "Legacy compatibility selector retained for parsing only. Grouped Compact is always CategoryDiamondPyramid and this entry is not exposed in Risk Of Options."); EnableOffscreenIndicators = config.Bind("Markers", "EnableOffscreenIndicators", true, "Show one directional indicator per occupied broad off-screen direction."); ShowOffscreenDistance = config.Bind("Markers", "ShowOffscreenDistance", true, "Show nearest represented pending distance on each off-screen directional indicator."); ShowOffscreenTotalCount = config.Bind("Markers", "ShowOffscreenTotalCount", false, "Optionally show one total count per occupied off-screen direction sector."); OffscreenIndicatorScale = config.Bind("Markers", "OffscreenIndicatorScale", 1f, new ConfigDescription("Off-screen directional indicator scale.", (AcceptableValueBase)(object)new AcceptableValueRange(0.75f, 1.25f), Array.Empty())); OffscreenIndicatorOpacity = config.Bind("Markers", "OffscreenIndicatorOpacity", 1f, new ConfigDescription("Off-screen directional indicator opacity.", (AcceptableValueBase)(object)new AcceptableValueRange(0f, 1f), Array.Empty())); OffscreenEdgePadding = config.Bind("Markers", "OffscreenEdgePadding", 36f, new ConfigDescription("Minimum screen-edge padding for directional indicators.", (AcceptableValueBase)(object)new AcceptableValueRange(12f, 160f), Array.Empty())); CommonMarkerColor = config.Bind("Marker Colors", "Common", DefaultCommonColor, "Common/white marker color."); UncommonMarkerColor = config.Bind("Marker Colors", "Uncommon", DefaultUncommonColor, "Uncommon/green marker color."); LegendaryMarkerColor = config.Bind("Marker Colors", "Legendary", DefaultLegendaryColor, "Legendary/red marker color."); BossMarkerColor = config.Bind("Marker Colors", "Boss", DefaultBossColor, "Boss marker color."); LunarMarkerColor = config.Bind("Marker Colors", "Lunar", DefaultLunarColor, "Lunar marker color. LunarEquipment maps to this same palette entry."); VoidMarkerColor = config.Bind("Marker Colors", "Void", DefaultVoidColor, "Void marker color."); EquipmentMarkerColor = config.Bind("Marker Colors", "Equipment", DefaultEquipmentColor, "Equipment marker color."); CommandMarkerColor = config.Bind("Marker Colors", "Command", DefaultCommandColor, "Artifact of Command / unresolved-choice marker color."); NeutralMarkerColor = config.Bind("Marker Colors", "Neutral", DefaultNeutralColor, "Mixed/unknown/other marker color. Other maps deterministically to Neutral."); OffscreenIndicatorColor = config.Bind("Marker Colors", "OffscreenIndicator", DefaultOffscreenColor, "Independent off-screen directional indicator color."); BindPresentationInvalidation(ShareTemporaryItems); BindPresentationInvalidation(PersonalMarkersEnabled); BindPresentationInvalidation(MarkerPresentationMode); BindPresentationInvalidation(ShowMarkerDistance); BindPresentationInvalidation(MarkerScale); BindPresentationInvalidation(MarkerOpacity); BindPresentationInvalidation(MarkerBackgroundOpacity); BindPresentationInvalidation(ShowMarkerCategoryDiamond); BindPresentationInvalidation(ShowMarkerTierComposition); BindPresentationInvalidation(MarkerDetailRows); BindPresentationInvalidation(MarkerCategorySortOrder); BindPresentationInvalidation(MarkerCompactShowCount); BindPresentationInvalidation(MarkerCompactMixedStyle); BindPresentationInvalidation(EnableOffscreenIndicators); BindPresentationInvalidation(ShowOffscreenDistance); BindPresentationInvalidation(ShowOffscreenTotalCount); BindPresentationInvalidation(OffscreenIndicatorScale); BindPresentationInvalidation(OffscreenIndicatorOpacity); BindPresentationInvalidation(OffscreenEdgePadding); BindPresentationInvalidation(CommonMarkerColor); BindPresentationInvalidation(UncommonMarkerColor); BindPresentationInvalidation(LegendaryMarkerColor); BindPresentationInvalidation(BossMarkerColor); BindPresentationInvalidation(LunarMarkerColor); BindPresentationInvalidation(VoidMarkerColor); BindPresentationInvalidation(EquipmentMarkerColor); BindPresentationInvalidation(CommandMarkerColor); BindPresentationInvalidation(NeutralMarkerColor); BindPresentationInvalidation(OffscreenIndicatorColor); DiagnosticLogging = config.Bind("Diagnostics", "DiagnosticLogging", true, "Enable bounded diagnostic logging for compatibility probes and state transitions."); DiagnosticLogLevel = config.Bind("Diagnostics", "DiagnosticLogLevel", "Info", "Diagnostic level: Error, Warning, Info, Debug."); PresentationSweepSeconds = config.Bind("Diagnostics", "PresentationSweepSeconds", 0.2f, "Bounded ItemShareFix presentation refresh interval. Not a whole-scene scan; only RoR2 InstanceTracker pickups are inspected."); ParticipantSweepSeconds = config.Bind("Diagnostics", "ParticipantSweepSeconds", 0.25f, "Server participant-state refresh interval."); RemoteOperationGraceSeconds = config.Bind("Diagnostics", "RemoteOperationGraceSeconds", 2f, "Reserved compatibility setting. Support Drone state uses exact CharacterMaster.GetInRemoteOp(); no heuristic grace is used."); } public MarkerPresentationSettings MarkerSettingsSnapshot() { //IL_0006: 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_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) return new MarkerPresentationSettings(MarkerPresentationMode.Value, ShowMarkerDistance.Value, MarkerScale.Value, MarkerDetailRows.Value, ShowMarkerCategoryDiamond.Value, ShowMarkerTierComposition.Value, MarkerCompactShowCount.Value, MarkerCompactMixedStyle.Value, MarkerCategorySortOrder.Value); } public MarkerVisualConfigSnapshot MarkerVisualSettingsSnapshot() { //IL_005e: 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_0074: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_008a: 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_00a0: 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_00b6: 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) return new MarkerVisualConfigSnapshot(MarkerOpacity.Value, MarkerBackgroundOpacity.Value, EnableOffscreenIndicators.Value, ShowOffscreenDistance.Value, ShowOffscreenTotalCount.Value, OffscreenIndicatorScale.Value, OffscreenIndicatorOpacity.Value, OffscreenEdgePadding.Value, CommonMarkerColor.Value, UncommonMarkerColor.Value, LegendaryMarkerColor.Value, BossMarkerColor.Value, LunarMarkerColor.Value, VoidMarkerColor.Value, EquipmentMarkerColor.Value, CommandMarkerColor.Value, NeutralMarkerColor.Value, OffscreenIndicatorColor.Value); } private void BindPresentationInvalidation(ConfigEntry entry) { entry.SettingChanged += OnMarkerPresentationSettingChanged; } private void OnMarkerPresentationSettingChanged(object sender, EventArgs args) { this.MarkerPresentationSettingChanged?.Invoke(sender, args); } } internal static class RuntimePatches { private static ServerCoordinator? _server; private static ClientPresentationCoordinator? _presentation; private static FieldInfo? _itemShareClaimsField; private static FieldInfo? _itemShareDistributedField; private static FieldInfo? _itemShareChoicesField; public static void Install(Harmony harmony, CompatibilityResult compatibility, ServerCoordinator server, ClientPresentationCoordinator presentation) { _server = server; _presentation = presentation; Assembly? obj = compatibility.ItemShareAssembly ?? throw new InvalidOperationException("ItemShare assembly missing from compatibility result."); Type type = obj.GetType("ItemShare.ItemSharePlugin", throwOnError: true); Type type2 = obj.GetType("ItemShare.ItemShareStateProvider", throwOnError: true); _itemShareClaimsField = RequiredField(type, "Claims"); _itemShareDistributedField = RequiredField(type, "Distributed"); _itemShareChoicesField = RequiredField(type, "Choices"); Patch(harmony, Required(type, "OnAttemptGrant", 3, typeof(void), isStatic: true), "ItemShareAttemptGrantPrefix"); Patch(harmony, Required(type, "GrantIndividual", 5, typeof(void), isStatic: true), "GrantIndividualPrefix", "DistributionPostfix", "DistributionFinalizer"); Patch(harmony, Required(type, "GrantInstant", 5, typeof(void), isStatic: true), "GrantInstantPrefix", "DistributionPostfix", "DistributionFinalizer"); Patch(harmony, Required(type, "IsDown", 1, typeof(bool), isStatic: true), null, "IsDownPostfix"); Patch(harmony, Required(type, "OnPickupSelected", 3, typeof(void), isStatic: true), "ItemShareCommandSelectionPrefix", "ItemShareCommandSelectionPostfix"); Patch(harmony, Required(type, "GiveDirect", 3, typeof(bool), isStatic: true), "GiveDirectPrefix"); Patch(harmony, Required(type, "LocalPlayersHaveTaken", 1, typeof(bool), isStatic: true), null, "LocalPlayersHaveTakenPostfix"); Patch(harmony, Required(type, "ApplyOrbVisibility", 2, typeof(void), isStatic: true), null, "ApplyOrbVisibilityPostfix"); Patch(harmony, Required(type, "RefreshOrbVisibility", 0, typeof(void), isStatic: true), null, "RefreshVisibilityPostfix"); Patch(harmony, Required(type2, "TransferOrbState", 2, typeof(bool), isStatic: false), null, "TransferOrbStatePostfix"); Patch(harmony, Required(typeof(GenericPickupController), "GetInteractability", 1, typeof(Interactability), isStatic: false), null, "PickupGetInteractabilityPostfix"); if (compatibility.DisconnectMethod != null) { Patch(harmony, compatibility.DisconnectMethod, "NetworkDestroyObservationPrefix"); } InstallBlockingModalLifecyclePatches(harmony); } private static bool ItemShareAttemptGrantPrefix(object[] __args) { //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) if (_server == null || !NetworkServer.active || __args.Length != 3) { return true; } object obj = __args[1]; GenericPickupController val = (GenericPickupController)((obj is GenericPickupController) ? obj : null); if (val == null) { return true; } UniquePickup pickup = val.pickup; bool isTempItem = ((UniquePickup)(ref pickup)).isTempItem; if (!isTempItem) { return true; } int instanceID = ((Object)val).GetInstanceID(); bool flag = ContainsInstanceId(_itemShareClaimsField, instanceID) || ContainsInstanceId(_itemShareDistributedField, instanceID); bool shareTemporaryItemsEnabled = _server.ShareTemporaryItemsEnabled; if (!TemporarySharingPolicy.ShouldUseVanillaBypass(isTempItem, shareTemporaryItemsEnabled, flag)) { _server.LogTemporaryPolicy("ordinary", instanceID, shareTemporaryItemsEnabled, "itemshare", flag ? "existing-upstream-state" : "policy-on"); return true; } InvokeSuppliedOriginal(__args[0], val, __args[2]); _server.LogTemporaryPolicy("ordinary", instanceID, shareTemporaryItemsEnabled, "vanilla-bypass", "preclaim"); return false; } private static bool ItemShareCommandSelectionPrefix(object[] __args, out bool __state) { //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: 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_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) __state = false; if (_server == null || !NetworkServer.active || __args.Length != 3) { return true; } object obj = __args[1]; PickupPickerController val = (PickupPickerController)((obj is PickupPickerController) ? obj : null); if (val == null || !(__args[2] is int num)) { return true; } if (val.options == null || num < 0 || num >= val.options.Length) { return true; } Option val2 = val.options[num]; if (!val2.available) { return true; } UniquePickup pickup = val2.pickup; bool isTempItem = ((UniquePickup)(ref pickup)).isTempItem; if (!isTempItem) { return true; } int instanceID = ((Object)val).GetInstanceID(); bool flag = ContainsInstanceId(_itemShareChoicesField, instanceID); bool shareTemporaryItemsEnabled = _server.ShareTemporaryItemsEnabled; if (!TemporarySharingPolicy.ShouldUseVanillaBypass(isTempItem, shareTemporaryItemsEnabled, flag)) { _server.LogTemporaryPolicy("command", instanceID, shareTemporaryItemsEnabled, "itemshare", flag ? "existing-upstream-state" : "policy-on"); return true; } InvokeSuppliedOriginal(__args[0], val, num); _server.LogTemporaryPolicy("command", instanceID, shareTemporaryItemsEnabled, "vanilla-bypass", "prechoices"); __state = true; return false; } private static void GrantIndividualPrefix(object[] __args, out bool __state) { __state = false; if (_server != null) { _server.BeginDistribution(__args, instant: false); __state = _server.InDistribution; } } private static void GrantInstantPrefix(object[] __args, out bool __state) { __state = false; if (_server != null) { _server.BeginDistribution(__args, instant: true); __state = _server.InDistribution; } } private static void DistributionPostfix(bool __state) { if (__state) { _server?.EndDistribution(successful: true); } } private static Exception? DistributionFinalizer(Exception? __exception, bool __state) { if (__exception != null && __state && _server != null && _server.InDistribution) { _server.EndDistribution(successful: false); } return __exception; } private static void IsDownPostfix(object[] __args, ref bool __result) { if (__result && _server != null) { CharacterMaster val = __args.OfType().FirstOrDefault(); if ((Object)(object)val != (Object)null && _server.ShouldTreatAsActive(val)) { __result = false; } } } private static void ItemShareCommandSelectionPostfix(object[] __args, bool __state) { if (!__state && _server != null) { PickupPickerController val = __args.OfType().FirstOrDefault(); if ((Object)(object)val != (Object)null) { _server.OnItemShareCommandSelectionCompleted(val); } } } private static bool GiveDirectPrefix(object[] __args) { if (_server == null) { return true; } Inventory val = __args.OfType().FirstOrDefault(); if (!((Object)(object)val == (Object)null)) { return !_server.ShouldSuppressImmediateGive(val); } return true; } private static void LocalPlayersHaveTakenPostfix(object[] __args, ref bool __result) { if (_presentation != null) { GenericPickupController val = __args.OfType().FirstOrDefault(); if ((Object)(object)val != (Object)null && _presentation.TryEvaluateLocalCollected(val, out var collectedByAllLocalParticipants)) { __result = collectedByAllLocalParticipants; } } } private static void ApplyOrbVisibilityPostfix(object[] __args) { if (_presentation != null) { GenericPickupController val = __args.OfType().FirstOrDefault(); if ((Object)(object)val != (Object)null) { _presentation.OnUpstreamVisibilityApplied(val); } } } private static void RefreshVisibilityPostfix() { _presentation?.RequestRefresh(); } private static void PickupGetInteractabilityPostfix(GenericPickupController __instance, Interactor __0, ref Interactability __result) { if (_presentation != null && (Object)(object)__instance != (Object)null && (Object)(object)__0 != (Object)null && _presentation.ShouldSuppressLocalPickupInteraction(__instance, __0)) { __result = (Interactability)0; } } private static void TransferOrbStatePostfix(object[] __args, bool __result) { if (!__result || _server == null || __args.Length < 2) { return; } try { int oldInstanceId = Convert.ToInt32(__args[0], CultureInfo.InvariantCulture); int newInstanceId = Convert.ToInt32(__args[1], CultureInfo.InvariantCulture); _server.OnPickupTransferred(oldInstanceId, newInstanceId); _presentation?.RequestRefresh(); } catch { } } private static void NetworkDestroyObservationPrefix(object __instance) { _server?.OnNetworkDestroyObserved(__instance); } private static void InstallBlockingModalLifecyclePatches(Harmony harmony) { Assembly assembly = typeof(Run).Assembly; Type type = assembly.GetType("RoR2.UI.PauseScreenController", throwOnError: false); if (type != null && typeof(Component).IsAssignableFrom(type)) { MethodInfo methodInfo = DeclaredParameterless(type, "Awake"); MethodInfo methodInfo2 = DeclaredParameterless(type, "OnEnable"); if (methodInfo != null) { Patch(harmony, methodInfo, null, "BlockingModalLifecycleObservedPostfix"); } if (methodInfo2 != null) { Patch(harmony, methodInfo2, null, "BlockingModalLifecycleObservedPostfix"); } if (methodInfo == null && methodInfo2 == null) { throw new MissingMethodException(type.FullName, "PauseScreenController open lifecycle (Awake/OnEnable)"); } } Type dialogType = assembly.GetType("RoR2.UI.SimpleDialogBox", throwOnError: false); if (dialogType != null && typeof(Component).IsAssignableFrom(dialogType)) { MethodInfo[] array = (from method in dialogType.GetMethods(BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic) where string.Equals(method.Name, "Create", StringComparison.Ordinal) && dialogType.IsAssignableFrom(method.ReturnType) select method).ToArray(); for (int num = 0; num < array.Length; num++) { Patch(harmony, array[num], null, "BlockingModalFactoryPostfix"); } MethodInfo methodInfo3 = DeclaredParameterless(dialogType, "OnEnable"); if (methodInfo3 != null) { Patch(harmony, methodInfo3, null, "BlockingModalLifecycleObservedPostfix"); } if (array.Length == 0 && methodInfo3 == null) { throw new MissingMethodException(dialogType.FullName, "SimpleDialogBox open lifecycle (Create/OnEnable)"); } } Type type2 = assembly.GetType("RoR2.UI.PickupPickerPanel", throwOnError: false); if (type2 == null || !typeof(Component).IsAssignableFrom(type2)) { throw new TypeLoadException("Required RoR2.UI.PickupPickerPanel target UI type is unavailable."); } MethodInfo methodInfo4 = DeclaredParameterless(type2, "Awake"); MethodInfo methodInfo5 = DeclaredParameterless(type2, "OnEnable"); MethodInfo[] array2 = (from method in type2.GetMethods(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic) where string.Equals(method.Name, "SetPickupOptions", StringComparison.Ordinal) select method).ToArray(); if (methodInfo4 != null) { Patch(harmony, methodInfo4, null, "BlockingModalLifecycleObservedPostfix"); } if (methodInfo5 != null) { Patch(harmony, methodInfo5, null, "BlockingModalLifecycleObservedPostfix"); } for (int num2 = 0; num2 < array2.Length; num2++) { Patch(harmony, array2[num2], null, "BlockingModalLifecycleObservedPostfix"); } if (methodInfo4 == null && methodInfo5 == null && array2.Length == 0) { throw new MissingMethodException(type2.FullName, "PickupPickerPanel open lifecycle/content signal (Awake/OnEnable/SetPickupOptions)"); } } private static MethodInfo? DeclaredParameterless(Type type, string name) { return type.GetMethod(name, BindingFlags.DeclaredOnly | BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic, null, Type.EmptyTypes, null); } private static void BlockingModalLifecycleObservedPostfix(object __instance) { ObserveBlockingModalLifecycle(__instance); } private static void BlockingModalFactoryPostfix(object __result) { ObserveBlockingModalLifecycle(__result); } private static void ObserveBlockingModalLifecycle(object candidate) { Component val = (Component)((candidate is Component) ? candidate : null); if (val != null) { _presentation?.OnBlockingModalLifecycleObserved(val); } } private static bool ContainsInstanceId(FieldInfo? field, int instanceId) { if (field == null) { throw new InvalidOperationException("ItemShare state field was not initialized."); } object obj = field.GetValue(null) ?? throw new InvalidOperationException("ItemShare state field is null: " + field.Name); if (obj is IDictionary dictionary) { return dictionary.Contains(instanceId); } if (obj is IEnumerable enumerable) { foreach (object item in enumerable) { if (item is int num && num == instanceId) { return true; } } return false; } throw new InvalidOperationException("Unsupported ItemShare state collection shape: " + field.Name); } private static void InvokeSuppliedOriginal(object candidate, params object?[] arguments) { ((candidate as Delegate) ?? throw new InvalidOperationException("Required supplied original ItemShare delegate is unavailable.")).DynamicInvoke(arguments); } private static FieldInfo RequiredField(Type type, string name) { return type.GetField(name, BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic) ?? throw new MissingFieldException(type.FullName, name); } private static MethodInfo Required(Type type, string name, int parameterCount, Type returnType, bool isStatic) { BindingFlags bindingAttr = (BindingFlags)(0x30 | (isStatic ? 8 : 4)); MethodInfo[] array = (from method in type.GetMethods(bindingAttr) where string.Equals(method.Name, name, StringComparison.Ordinal) && method.GetParameters().Length == parameterCount && method.ReturnType == returnType select method).ToArray(); if (array.Length != 1) { throw new MissingMethodException(type.FullName, name + "/" + parameterCount + " -> " + returnType.Name); } return array[0]; } private static void Patch(Harmony harmony, MethodBase original, string? prefix = null, string? postfix = null, string? finalizer = null) { Type patchType = typeof(RuntimePatches); harmony.Patch(original, Prefix(prefix), Prefix(postfix), (HarmonyMethod)null, Prefix(finalizer), (HarmonyMethod)null); HarmonyMethod? Prefix(string? name) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown if (name != null) { return new HarmonyMethod(patchType.GetMethod(name, BindingFlags.Static | BindingFlags.NonPublic)); } return null; } } } internal sealed class ServerCoordinator { private sealed class DistributionContext { public SharedPickupKey Pickup; public PickupDef? PickupDef; public object? BoxedUniquePickup; public CharacterMaster? Collector; public bool Instant; } private sealed class DeferredGrantPayload { public PickupDef PickupDef { get; set; } public object BoxedUniquePickup { get; set; } } private sealed class DisconnectCandidate { public float ObservedAt; public bool AuthoritativePresenceAtObservation; public string DestroyedRuntimeType { get; set; } = string.Empty; } private readonly PluginConfig _config; private readonly UpstreamBridge _upstream; private readonly ManualLogSource _log; private readonly ParticipantClassifier _classifier; private readonly ClaimLedger _ledger = new ClaimLedger(); private readonly Dictionary _participants = new Dictionary(); private readonly Dictionary _missingSince = new Dictionary(); private readonly Dictionary _deferredPayloads = new Dictionary(); private readonly Stack _distribution = new Stack(); private readonly Dictionary _pendingTransferRebroadcast = new Dictionary(); private readonly Dictionary _pendingHistoricalMirrorRetry = new Dictionary(); private readonly Dictionary _generationProbes = new Dictionary(); private readonly HashSet _identityDiagnosticLogged = new HashSet(StringComparer.Ordinal); private readonly HashSet _claimEnsureDiagnosticLogged = new HashSet(StringComparer.Ordinal); private readonly Dictionary _disconnectCandidates = new Dictionary(); private readonly HashSet _disconnectGateDiagnosticLogged = new HashSet(StringComparer.Ordinal); private readonly HashSet _itemShareActiveGateDiagnosticLogged = new HashSet(StringComparer.Ordinal); private readonly HashSet _commandRetentionDiagnosticLogged = new HashSet(StringComparer.Ordinal); private readonly HashSet _temporaryPolicyDiagnosticLogged = new HashSet(StringComparer.Ordinal); private float _nextParticipantSweep; private float _lastStageChangeTime; private Run? _runInstance; private int _stage; private int _deferredGrantDepth; public IReadOnlyCollection CurrentParticipants => _participants.Values; public ClaimLedger Ledger => _ledger; public bool InDistribution => _distribution.Count > 0; public bool InDeferredGrant => _deferredGrantDepth > 0; public bool ShareTemporaryItemsEnabled => _config.ShareTemporaryItems.Value; public ServerCoordinator(PluginConfig config, UpstreamBridge upstream, ManualLogSource log) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Expected O, but got Unknown _config = config; _upstream = upstream; _log = log; _classifier = new ParticipantClassifier(); _runInstance = Run.instance; _stage = CurrentStageToken(); _lastStageChangeTime = Time.unscaledTime; } public void LogTemporaryPolicy(string kind, int instanceId, bool shareTemporaryItems, string action, string reason) { if (_config.DiagnosticLogging.Value) { string item = kind + "|" + instanceId.ToString(CultureInfo.InvariantCulture) + "|shareTemporary=" + shareTemporaryItems + "|action=" + action + "|reason=" + reason; if (_temporaryPolicyDiagnosticLogged.Add(item)) { _log.LogInfo((object)("[ItemShareFix] ISF_C21_TEMP_POLICY kind=" + kind + " temporary=true shareTemporary=" + (shareTemporaryItems ? "true" : "false") + " action=" + action + " instance=" + instanceId.ToString(CultureInfo.InvariantCulture) + " reason=" + reason)); } } } public void Tick() { if (!_config.Enabled.Value || !NetworkServer.active) { return; } Run instance = Run.instance; if (instance != _runInstance) { ResetForRunBoundary(instance); } if (!((Object)(object)instance == (Object)null)) { int num = CurrentStageToken(); if (num != _stage) { OnStageTransition(num); } RetryTransferBroadcasts(); RetryHistoricalMirrors(); if (!(Time.unscaledTime < _nextParticipantSweep)) { _nextParticipantSweep = Time.unscaledTime + Math.Max(0.1f, _config.ParticipantSweepSeconds.Value); SweepParticipants(); TryGrantDeferred(); } } } public void BeginDistribution(object[] args, bool instant) { //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) if (_config.Enabled.Value && NetworkServer.active) { GenericPickupController val = args.OfType().FirstOrDefault(); if (!((Object)(object)val == (Object)null) && _upstream.IsShareable(val)) { CharacterBody val2 = args.OfType().FirstOrDefault(); PickupDef pickupDef = args.OfType().FirstOrDefault() ?? PickupCatalog.GetPickupDef(val.pickup.pickupIndex); DistributionContext distributionContext = new DistributionContext { Pickup = new SharedPickupKey(((Object)val).GetInstanceID()), PickupDef = pickupDef, BoxedUniquePickup = val.pickup, Collector = (((Object)(object)val2 != (Object)null) ? val2.master : null), Instant = instant }; _distribution.Push(distributionContext); EnsureClaims(distributionContext); } } } public void EndDistribution(bool successful) { //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_0052: 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_006f: 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_0060: Invalid comparison between Unknown and I4 if (!NetworkServer.active || _distribution.Count == 0) { return; } DistributionContext distributionContext = _distribution.Pop(); if (!successful) { return; } if (distributionContext.Instant) { foreach (ParticipantSnapshot value in _participants.Values) { if (CanUseExactParticipantState(value) && ((int)value.State == 0 || (int)value.State == 1)) { _ledger.MarkCollected(distributionContext.Pickup, value.Key, _stage); } } return; } if ((Object)(object)distributionContext.Collector != (Object)null) { ParticipantSnapshot participantSnapshot = FindParticipant(distributionContext.Collector); if (participantSnapshot != null) { _ledger.MarkCollected(distributionContext.Pickup, participantSnapshot.Key, _stage); } } } public bool ShouldTreatAsActive(CharacterMaster master) { //IL_0044: 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) if (!_config.Enabled.Value || !NetworkServer.active || (Object)(object)master == (Object)null) { return false; } if (!TryResolveFreshItemShareParticipant(master, out ParticipantSnapshot participant, out ParticipantSnapshot freshSnapshot, out string reason)) { LogItemShareActiveGate(participant, freshSnapshot, upstreamOriginalIsDown: true, correctedIsDown: true, reason); return false; } bool flag = ItemShareActiveGatePolicy.ShouldCorrectIsDown(true, true, true, freshSnapshot.State); bool correctedIsDown = ItemShareActiveGatePolicy.CorrectIsDown(true, true, true, freshSnapshot.State); LogItemShareActiveGate(participant, freshSnapshot, upstreamOriginalIsDown: true, correctedIsDown, flag ? "exact-supportdrone-active-override" : "exact-state-remains-down"); return flag; } public unsafe void OnItemShareCommandSelectionCompleted(PickupPickerController picker) { //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Invalid comparison between Unknown and I4 //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_01ba: 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_01db: Unknown result type (might be due to invalid IL or missing references) //IL_01e0: 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_0200: Unknown result type (might be due to invalid IL or missing references) if (!_config.Enabled.Value || !NetworkServer.active || picker == null) { return; } if (!Object.op_Implicit((Object)(object)picker) || !_upstream.IsCommandCube(picker)) { return; } int instanceID = ((Object)picker).GetInstanceID(); bool flag = _upstream.HasPickerProviderState(picker); foreach (PlayerCharacterMasterController instance in PlayerCharacterMasterController.instances) { if ((Object)(object)instance == (Object)null || (Object)(object)instance.master == (Object)null) { continue; } CharacterMaster master = instance.master; ParticipantSnapshot participantSnapshot = FindParticipant(master); if (participantSnapshot == null || !CanUseExactParticipantState(participantSnapshot) || !_classifier.TrySnapshot(instance, out ParticipantSnapshot snapshot, out string _)) { continue; } ParticipantKey key = snapshot.Key; if (((ParticipantKey)(ref key)).Equals(participantSnapshot.Key) && (int)snapshot.State == 1) { bool picked; bool flag2 = _upstream.TryHasCommandPicked(picker, master, out picked); bool flag3 = flag2 && !picked; string[] obj = new string[9] { instanceID.ToString(CultureInfo.InvariantCulture), "|", null, null, null, null, null, null, null }; key = snapshot.Key; obj[2] = ((ParticipantKey)(ref key)).Value; obj[3] = "|provider="; obj[4] = flag.ToString(); obj[5] = "|resolved="; obj[6] = flag2.ToString(); obj[7] = "|picked="; obj[8] = picked.ToString(); string item = string.Concat(obj); if (_commandRetentionDiagnosticLogged.Add(item)) { ManualLogSource log = _log; string[] obj2 = new string[18] { "[ItemShareFix] ISF_C20_COMMAND_RETENTION picker=", instanceID.ToString(CultureInfo.InvariantCulture), " participant=", null, null, null, null, null, null, null, null, null, null, null, null, null, null, null }; key = snapshot.Key; obj2[3] = ((object)(*(ParticipantKey*)(&key))/*cast due to .constrained prefix*/).ToString(); obj2[4] = " generation="; key = snapshot.Key; obj2[5] = SanitizeDiagnosticToken(((ParticipantKey)(ref key)).Generation); obj2[6] = " participantState="; obj2[7] = ((object)snapshot.State/*cast due to .constrained prefix*/).ToString(); obj2[8] = " providerState="; obj2[9] = (flag ? "present" : "missing"); obj2[10] = " choiceStateResolved="; obj2[11] = (flag2 ? "true" : "false"); obj2[12] = " supportDronePending="; obj2[13] = (flag3 ? "true" : "false"); obj2[14] = " pickerObjectAlive="; obj2[15] = ((Object.op_Implicit((Object)(object)picker) && (Object)(object)((Component)picker).gameObject != (Object)null) ? "true" : "false"); obj2[16] = " reason="; obj2[17] = ((flag && flag3) ? "command-retained-for-supportdrone" : "command-retention-not-proven"); log.LogInfo((object)string.Concat(obj2)); } } } } public bool ShouldSuppressImmediateGive(Inventory inventory) { //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: 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_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Invalid comparison between Unknown and I4 //IL_00fe: Unknown result type (might be due to invalid IL or missing references) if (!_config.Enabled.Value || !InDistribution || InDeferredGrant || (Object)(object)inventory == (Object)null) { return false; } ParticipantSnapshot participantSnapshot = _participants.Values.FirstOrDefault((ParticipantSnapshot x) => (Object)(object)x.Master != (Object)null && x.Master.inventory == inventory); if (participantSnapshot == null) { return ImmediateGivePolicy.ShouldSuppress(false, (ParticipantState?)null, _config.DeadPlayerDeferredItemsEnabled.Value, false, false); } DistributionContext distributionContext = _distribution.Peek(); ClaimLedger ledger = _ledger; SharedPickupKey pickup = distributionContext.Pickup; ParticipantKey key = participantSnapshot.Key; bool flag = ledger.IsHistoricallyBlocked(pickup, ((ParticipantKey)(ref key)).StableUser); ParticipantState? val = (CanUseExactParticipantState(participantSnapshot) ? new ParticipantState?(participantSnapshot.State) : ((ParticipantState?)null)); ClaimRecord val2 = default(ClaimRecord); bool flag2 = _ledger.TryGet(distributionContext.Pickup, participantSnapshot.Key, ref val2) && (int)val2.State == 2 && _deferredPayloads.ContainsKey(val2.Key); return ImmediateGivePolicy.ShouldSuppress(HasProvenGenerationIdentity(participantSnapshot), val, _config.DeadPlayerDeferredItemsEnabled.Value, flag, flag2); } public void OnPickupTransferred(int oldInstanceId, int newInstanceId) { //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_009e: 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_00b7: 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_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) if (!_config.Enabled.Value || !NetworkServer.active || oldInstanceId == 0 || newInstanceId == 0 || oldInstanceId == newInstanceId) { return; } try { _ledger.TransferPickup(new SharedPickupKey(oldInstanceId), new SharedPickupKey(newInstanceId)); KeyValuePair[] array = _deferredPayloads.Where>(delegate(KeyValuePair x) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000a: 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) ClaimKey key2 = x.Key; SharedPickupKey pickup = ((ClaimKey)(ref key2)).Pickup; return ((SharedPickupKey)(ref pickup)).Value == oldInstanceId; }).ToArray(); for (int num = 0; num < array.Length; num++) { KeyValuePair keyValuePair = array[num]; _deferredPayloads.Remove(keyValuePair.Key); Dictionary deferredPayloads = _deferredPayloads; SharedPickupKey val = new SharedPickupKey(newInstanceId); ClaimKey key = keyValuePair.Key; deferredPayloads[new ClaimKey(val, ((ClaimKey)(ref key)).Participant)] = keyValuePair.Value; } foreach (ParticipantSnapshot value in _participants.Values) { ReconcileHistoricalBarriers(value); } } catch (Exception ex) { _log.LogError((object)("[ItemShareFix] state transfer failed closed: " + ex)); return; } if (!_upstream.TryBroadcastTransferredOrbState(newInstanceId)) { _pendingTransferRebroadcast[newInstanceId] = Time.unscaledTime + 2f; } } public void OnNetworkDestroyObserved(object instance) { //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) if (!_config.Enabled.Value || !NetworkServer.active || !_config.DisconnectCleanupEnabled.Value || instance == null) { return; } CharacterMaster val = null; PlayerCharacterMasterController val2 = (PlayerCharacterMasterController)((instance is PlayerCharacterMasterController) ? instance : null); if (val2 != null) { val = val2.master; } else { object? member = ParticipantIdentityResolver.GetMember(instance, "master"); val = (CharacterMaster)((member is CharacterMaster) ? member : null); if ((Object)(object)val == (Object)null) { object? member2 = ParticipantIdentityResolver.GetMember(instance, "masterObject"); GameObject val3 = (GameObject)((member2 is GameObject) ? member2 : null); val = (((Object)(object)val3 != (Object)null) ? val3.GetComponent() : null); } } if (!((Object)(object)val == (Object)null)) { ParticipantSnapshot participantSnapshot = FindParticipant(val); if (participantSnapshot != null) { bool flag = IsParticipantAuthoritativelyPresent(participantSnapshot); NetworkDestroyDisposition val4 = DisconnectConfirmationPolicy.EvaluateNetworkDestroy(true, flag); string destroyedRuntimeType = instance.GetType().FullName ?? instance.GetType().Name; _disconnectCandidates[participantSnapshot.Key] = new DisconnectCandidate { ObservedAt = Time.unscaledTime, DestroyedRuntimeType = destroyedRuntimeType, AuthoritativePresenceAtObservation = flag }; LogDisconnectGate(participantSnapshot, "network_destroy_observed", ((int)val4 == 0) ? "ignored_participant_still_authoritative" : "held_for_authoritative_confirmation", destroyedRuntimeType, flag, flag ? "same exact participant generation remains in PlayerCharacterMasterController.instances" : "generic network destroy is not sufficient; authoritative absence sweep must confirm disconnect"); } } } private bool IsParticipantAuthoritativelyPresent(ParticipantSnapshot participant) { if ((Object)(object)participant.Master == (Object)null) { return false; } foreach (PlayerCharacterMasterController instance in PlayerCharacterMasterController.instances) { if (!((Object)(object)instance == (Object)null) && !((Object)(object)instance.master == (Object)null) && instance.master == participant.Master) { return true; } } return false; } private unsafe void LogDisconnectGate(ParticipantSnapshot participant, string eventName, string decision, string destroyedRuntimeType, bool authoritativePresence, string reason) { //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_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) if (_config.DiagnosticLogging.Value) { string[] array = new string[9]; ParticipantKey key = participant.Key; array[0] = ((ParticipantKey)(ref key)).Value; array[1] = "|"; array[2] = eventName; array[3] = "|"; array[4] = decision; array[5] = "|"; array[6] = destroyedRuntimeType; array[7] = "|"; array[8] = authoritativePresence.ToString(); string item = string.Concat(array); if (_disconnectGateDiagnosticLogged.Add(item)) { ManualLogSource log = _log; string[] obj = new string[16] { "[ItemShareFix] ISF_C20_DISCONNECT_GATE event=", SanitizeDiagnosticToken(eventName), " decision=", SanitizeDiagnosticToken(decision), " participant=", null, null, null, null, null, null, null, null, null, null, null }; key = participant.Key; obj[5] = ((object)(*(ParticipantKey*)(&key))/*cast due to .constrained prefix*/).ToString(); obj[6] = " generation="; key = participant.Key; obj[7] = SanitizeDiagnosticToken(((ParticipantKey)(ref key)).Generation); obj[8] = " destroyedType="; obj[9] = SanitizeDiagnosticToken(destroyedRuntimeType); obj[10] = " authoritativePresence="; obj[11] = (authoritativePresence ? "true" : "false"); obj[12] = " participantState="; obj[13] = ((object)participant.State/*cast due to .constrained prefix*/).ToString(); obj[14] = " reason="; obj[15] = SanitizeDiagnosticToken(reason); log.LogInfo((object)string.Concat(obj)); } } } private void EnsureClaims(DistributionContext context) { //IL_0037: 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_0043: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Invalid comparison between Unknown and I4 //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Invalid comparison between Unknown and I4 //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: 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_00c9: 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_00f5: 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) SweepParticipants(); ClaimRecord val = default(ClaimRecord); foreach (ParticipantSnapshot value in _participants.Values) { if (!CanCreateClaims(value)) { continue; } if (!_ledger.TryEnsure(context.Pickup, value.Key, value.State, _stage, ref val)) { MirrorHistoricalBarrier(context.Pickup, value); continue; } if ((int)value.State == 1 && (int)val.State == 0) { string item = ((object)val.Key/*cast due to .constrained prefix*/).ToString() + "|participantState=" + ((object)value.State/*cast due to .constrained prefix*/).ToString() + "|claimState=" + ((object)val.State/*cast due to .constrained prefix*/).ToString(); if (_claimEnsureDiagnosticLogged.Add(item)) { LogClaimState(val, value.State, "ensure", "active-claim-created-or-retained", value.Evidence); } } if ((int)val.State == 2 && context.PickupDef != null && context.BoxedUniquePickup != null) { _deferredPayloads[val.Key] = new DeferredGrantPayload { PickupDef = context.PickupDef, BoxedUniquePickup = context.BoxedUniquePickup }; } } } private unsafe void SweepParticipants() { //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0696: Unknown result type (might be due to invalid IL or missing references) //IL_069b: Unknown result type (might be due to invalid IL or missing references) //IL_06a3: Unknown result type (might be due to invalid IL or missing references) //IL_01cd: Unknown result type (might be due to invalid IL or missing references) //IL_01d3: Invalid comparison between Unknown and I4 //IL_01df: 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_06b4: Unknown result type (might be due to invalid IL or missing references) //IL_01ed: Unknown result type (might be due to invalid IL or missing references) //IL_01f2: 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_0202: Unknown result type (might be due to invalid IL or missing references) //IL_0210: Unknown result type (might be due to invalid IL or missing references) //IL_0265: Unknown result type (might be due to invalid IL or missing references) //IL_026a: Unknown result type (might be due to invalid IL or missing references) //IL_02a1: Unknown result type (might be due to invalid IL or missing references) //IL_02a6: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_06ff: Unknown result type (might be due to invalid IL or missing references) //IL_0755: Unknown result type (might be due to invalid IL or missing references) //IL_0710: Unknown result type (might be due to invalid IL or missing references) //IL_0305: Unknown result type (might be due to invalid IL or missing references) //IL_030a: Unknown result type (might be due to invalid IL or missing references) //IL_0312: Unknown result type (might be due to invalid IL or missing references) //IL_037f: Unknown result type (might be due to invalid IL or missing references) //IL_0396: Unknown result type (might be due to invalid IL or missing references) //IL_03ad: Unknown result type (might be due to invalid IL or missing references) //IL_0359: Unknown result type (might be due to invalid IL or missing references) //IL_0323: Unknown result type (might be due to invalid IL or missing references) //IL_040a: Unknown result type (might be due to invalid IL or missing references) //IL_0425: Unknown result type (might be due to invalid IL or missing references) //IL_0608: Unknown result type (might be due to invalid IL or missing references) //IL_0438: Unknown result type (might be due to invalid IL or missing references) //IL_0443: Unknown result type (might be due to invalid IL or missing references) //IL_03f3: Unknown result type (might be due to invalid IL or missing references) //IL_0459: Unknown result type (might be due to invalid IL or missing references) //IL_0460: Unknown result type (might be due to invalid IL or missing references) //IL_046b: Unknown result type (might be due to invalid IL or missing references) //IL_0482: Unknown result type (might be due to invalid IL or missing references) //IL_0488: Invalid comparison between Unknown and I4 //IL_057a: Unknown result type (might be due to invalid IL or missing references) //IL_0581: Unknown result type (might be due to invalid IL or missing references) //IL_058c: Unknown result type (might be due to invalid IL or missing references) //IL_05a7: Unknown result type (might be due to invalid IL or missing references) //IL_05ad: Invalid comparison between Unknown and I4 //IL_05c0: Unknown result type (might be due to invalid IL or missing references) //IL_05cb: Unknown result type (might be due to invalid IL or missing references) //IL_05dc: Unknown result type (might be due to invalid IL or missing references) //IL_05e7: Unknown result type (might be due to invalid IL or missing references) //IL_05b1: Unknown result type (might be due to invalid IL or missing references) //IL_05b7: Invalid comparison between Unknown and I4 //IL_04db: Unknown result type (might be due to invalid IL or missing references) //IL_04e9: Unknown result type (might be due to invalid IL or missing references) //IL_04ee: Unknown result type (might be due to invalid IL or missing references) //IL_04f2: Unknown result type (might be due to invalid IL or missing references) //IL_04f7: Unknown result type (might be due to invalid IL or missing references) //IL_0513: Unknown result type (might be due to invalid IL or missing references) //IL_0518: Unknown result type (might be due to invalid IL or missing references) //IL_0530: Unknown result type (might be due to invalid IL or missing references) //IL_0545: Unknown result type (might be due to invalid IL or missing references) HashSet seen = new HashSet(); ParticipantKey[] array; foreach (PlayerCharacterMasterController instance in PlayerCharacterMasterController.instances) { if ((Object)(object)instance == (Object)null || (Object)(object)instance.master == (Object)null) { continue; } NetworkInstanceId netId = ((NetworkBehaviour)instance.master).netId; uint value = ((NetworkInstanceId)(ref netId)).Value; GenerationProbeGate val = ((value != 0) ? GetOrCreateGenerationProbe(value) : null); if (!_classifier.TrySnapshot(instance, out ParticipantSnapshot snapshot, out string unsupportedEvidence)) { if (((val != null) ? ((int)val.ObserveUnsupported()) : 0) == 1 && val != null) { ParticipantKey provenParticipant = val.ProvenParticipant; seen.Add(provenParticipant); _missingSince.Remove(provenParticipant); LogProbeFailureOnce("frozen:" + ((ParticipantKey)(ref provenParticipant)).Value, "[ItemShareFix] FAIL-CLOSED transient participant probe: " + unsupportedEvidence + "; generation=" + ((object)(*(ParticipantKey*)(&provenParticipant))/*cast due to .constrained prefix*/).ToString() + "; existing claims/deferred/history preserved and frozen; no new claims or deferred grants until exact recovery; upstream normal grants remain allowed."); } else { string text = ((value != 0) ? ("masterNetId=" + value.ToString(CultureInfo.InvariantCulture)) : ("controllerInstanceId=" + ((Object)instance).GetInstanceID().ToString(CultureInfo.InvariantCulture))); LogProbeFailureOnce("never:" + text, "[ItemShareFix] FAIL-CLOSED never-resolved participant identity/state: " + unsupportedEvidence + "; generationDiagnostic=" + text + "; no ItemShareFix ownership/claims/deferred state created; upstream ItemShare grants remain allowed; exact probe will retry."); } continue; } if (val == null) { LogProbeFailureOnce("resolved-zero:" + ((Object)instance).GetInstanceID().ToString(CultureInfo.InvariantCulture), "[ItemShareFix] FAIL-CLOSED resolved snapshot had no usable master generation; upstream ItemShare remains authoritative."); continue; } bool flag = (int)val.State == 2; if (!val.TryResolve(snapshot.Key)) { ParticipantKey provenParticipant2 = val.ProvenParticipant; val.ObserveUnsupported(); seen.Add(provenParticipant2); _missingSince.Remove(provenParticipant2); LogProbeFailureOnce("identity-mutation:" + ((ParticipantKey)(ref provenParticipant2)).Value, "[ItemShareFix] FAIL-CLOSED stable identity changed inside one master generation; preserving/freeze prior entitlements for " + ((object)(*(ParticipantKey*)(&provenParticipant2))/*cast due to .constrained prefix*/).ToString() + "."); continue; } if (flag) { HashSet identityDiagnosticLogged = _identityDiagnosticLogged; ParticipantKey key = snapshot.Key; identityDiagnosticLogged.Remove("frozen:" + ((ParticipantKey)(ref key)).Value); if (_config.DiagnosticLogging.Value) { ManualLogSource log = _log; key = snapshot.Key; log.LogInfo((object)("[ItemShareFix] participant probe RECOVERED same generation " + ((object)(*(ParticipantKey*)(&key))/*cast due to .constrained prefix*/).ToString() + "; preserved claims/deferred state resumed without recreation.")); } } array = _participants.Keys.Where(delegate(ParticipantKey x) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) StableUserKey stableUser = ((ParticipantKey)(ref x)).StableUser; ParticipantKey key5 = snapshot.Key; return ((StableUserKey)(ref stableUser)).Equals(((ParticipantKey)(ref key5)).StableUser) && !((ParticipantKey)(ref x)).Equals(snapshot.Key); }).ToArray(); foreach (ParticipantKey key2 in array) { if (_participants.TryGetValue(key2, out ParticipantSnapshot value2)) { DisconnectCandidate value3; string destroyedRuntimeType = (_disconnectCandidates.TryGetValue(key2, out value3) ? value3.DestroyedRuntimeType : ""); LogDisconnectGate(value2, "authoritative_participant_replacement", "confirmed_disconnect", destroyedRuntimeType, authoritativePresence: false, "same stable user observed with replacement master generation"); } CancelParticipant(key2, "stable user observed with a replacement connection/master generation"); } seen.Add(snapshot.Key); _missingSince.Remove(snapshot.Key); if (_disconnectCandidates.TryGetValue(snapshot.Key, out DisconnectCandidate value4)) { if (!value4.AuthoritativePresenceAtObservation) { LogDisconnectGate(snapshot, "network_destroy_observed", "ignored_participant_still_authoritative", value4.DestroyedRuntimeType, authoritativePresence: true, "authoritative controller sweep retained same exact participant generation after lifecycle destroy"); } _disconnectCandidates.Remove(snapshot.Key); } bool flag2 = !_participants.ContainsKey(snapshot.Key); if (_participants.TryGetValue(snapshot.Key, out ParticipantSnapshot value5) && value5.State != snapshot.State) { _ledger.TransitionParticipant(snapshot.Key, value5.State, snapshot.State, _stage); if ((int)snapshot.State == 2) { foreach (ClaimRecord item in _ledger.Records.Where(delegate(ClaimRecord x) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_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_0017: 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_002a: Invalid comparison between Unknown and I4 ClaimKey key5 = x.Key; ParticipantKey participant = ((ClaimKey)(ref key5)).Participant; return ((ParticipantKey)(ref participant)).Equals(snapshot.Key) && (int)x.State == 2; })) { if (_deferredPayloads.ContainsKey(item.Key)) { continue; } ClaimKey key3 = item.Key; SharedPickupKey pickup = ((ClaimKey)(ref key3)).Pickup; GenericPickupController val2 = UpstreamBridge.FindPickupByInstanceId(((SharedPickupKey)(ref pickup)).Value); if ((Object)(object)val2 != (Object)null) { PickupDef pickupDef = PickupCatalog.GetPickupDef(val2.pickup.pickupIndex); if (pickupDef != null) { _deferredPayloads[item.Key] = new DeferredGrantPayload { PickupDef = pickupDef, BoxedUniquePickup = val2.pickup }; } } } } LogTransition(snapshot.Key, value5.State, snapshot.State, snapshot.Evidence); if ((int)snapshot.State == 1 || (int)value5.State == 1) { LogParticipantClaimSnapshot(snapshot.Key, snapshot.State, "participant-transition", "state-change", value5.State, snapshot.State, snapshot.Evidence); } } _participants[snapshot.Key] = snapshot; if (flag2) { ReconcileHistoricalBarriers(snapshot); } } if (!_config.DisconnectCleanupEnabled.Value) { return; } array = _participants.Keys.Where((ParticipantKey x) => !seen.Contains(x)).ToArray(); foreach (ParticipantKey key4 in array) { if (!_missingSince.TryGetValue(key4, out var value6)) { _missingSince[key4] = Time.unscaledTime; continue; } bool flag3 = Time.unscaledTime - value6 >= 2f && Time.unscaledTime - _lastStageChangeTime >= 2f; if (DisconnectConfirmationPolicy.ShouldConfirmDisconnect(true, flag3)) { if (_participants.TryGetValue(key4, out ParticipantSnapshot value7)) { DisconnectCandidate value8; bool flag4 = _disconnectCandidates.TryGetValue(key4, out value8); string destroyedRuntimeType2 = (flag4 ? value8.DestroyedRuntimeType : ""); LogDisconnectGate(value7, flag4 ? "network_destroy_observed" : "authoritative_absence_observed", "confirmed_disconnect", destroyedRuntimeType2, authoritativePresence: false, "participant absent from PlayerCharacterMasterController.instances after existing 2s grace"); } CancelParticipant(key4, "participant absent from authoritative controller list"); } } } private bool TryResolveFreshItemShareParticipant(CharacterMaster master, out ParticipantSnapshot? participant, out ParticipantSnapshot? freshSnapshot, out string reason) { //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_00a0: Unknown result type (might be due to invalid IL or missing references) participant = FindParticipant(master); freshSnapshot = null; reason = "participant-not-proven"; if (participant == null) { return false; } if (!CanUseExactParticipantState(participant)) { reason = "generation-not-resolved"; return false; } PlayerCharacterMasterController val = ((IEnumerable)PlayerCharacterMasterController.instances).FirstOrDefault((Func)((PlayerCharacterMasterController x) => (Object)(object)x != (Object)null && (Object)(object)x.master != (Object)null && x.master == master)); if ((Object)(object)val == (Object)null) { reason = "authoritative-controller-absent"; return false; } if (!_classifier.TrySnapshot(val, out ParticipantSnapshot snapshot, out string unsupportedEvidence)) { reason = "fresh-snapshot-unavailable-" + SanitizeDiagnosticToken(unsupportedEvidence); return false; } freshSnapshot = snapshot; ParticipantKey key = snapshot.Key; if (!((ParticipantKey)(ref key)).Equals(participant.Key)) { reason = "generation-mismatch"; return false; } reason = "fresh-exact-participant-state"; return true; } private void LogItemShareActiveGate(ParticipantSnapshot? participant, ParticipantSnapshot? freshSnapshot, bool upstreamOriginalIsDown, bool correctedIsDown, string reason) { //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_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_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) if (_config.DiagnosticLogging.Value) { ParticipantSnapshot participantSnapshot = freshSnapshot ?? participant; object obj; ParticipantKey key; if (participantSnapshot == null) { obj = "unresolved"; } else { key = participantSnapshot.Key; obj = ((ParticipantKey)(ref key)).Value; } string text = (string)obj; object obj2; if (participantSnapshot == null) { obj2 = "unresolved"; } else { key = participantSnapshot.Key; obj2 = SanitizeDiagnosticToken(((ParticipantKey)(ref key)).Generation); } string text2 = (string)obj2; string text3 = ((participantSnapshot != null) ? ((object)participantSnapshot.State/*cast due to .constrained prefix*/).ToString() : "Unresolved"); string item = text + "|state=" + text3 + "|original=" + upstreamOriginalIsDown + "|corrected=" + correctedIsDown + "|distribution=" + InDistribution + "|reason=" + reason; if (_itemShareActiveGateDiagnosticLogged.Add(item)) { _log.LogInfo((object)("[ItemShareFix] ISF_C20_ITEMSHARE_ACTIVE_GATE participant=" + text + " generation=" + text2 + " participantState=" + text3 + " upstreamOriginalIsDown=" + (upstreamOriginalIsDown ? "true" : "false") + " correctedIsDown=" + (correctedIsDown ? "true" : "false") + " inDistribution=" + (InDistribution ? "true" : "false") + " reason=" + SanitizeDiagnosticToken(reason))); } } } private void ReconcileHistoricalBarriers(ParticipantSnapshot participant) { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: 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) if ((Object)(object)participant.Master == (Object)null || !HasProvenGenerationIdentity(participant)) { return; } ClaimLedger ledger = _ledger; ParticipantKey key = participant.Key; foreach (HistoricalClaimRecord item in ledger.HistoricalFor(((ParticipantKey)(ref key)).StableUser)) { HistoricalClaimKey key2 = item.Key; MirrorHistoricalBarrier(((HistoricalClaimKey)(ref key2)).Pickup, participant); } } private unsafe void MirrorHistoricalBarrier(SharedPickupKey pickup, ParticipantSnapshot participant) { //IL_009d: 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_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_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 ((Object)(object)participant.Master == (Object)null) { return; } if (_upstream.TryMirrorHistoricalBarrier(((SharedPickupKey)(ref pickup)).Value, participant.Master, out string evidence)) { if (_config.DiagnosticLogging.Value) { _log.LogInfo((object)("[ItemShareFix] reconnect historical barrier " + ((object)(*(SharedPickupKey*)(&pickup))/*cast due to .constrained prefix*/).ToString() + "/" + ((object)participant.Key/*cast due to .constrained prefix*/).ToString() + ": " + evidence)); } return; } _pendingHistoricalMirrorRetry[new ClaimKey(pickup, participant.Key)] = Time.unscaledTime + 0.25f; if (_config.DiagnosticLogging.Value) { _log.LogWarning((object)("[ItemShareFix] reconnect historical barrier pending " + ((object)(*(SharedPickupKey*)(&pickup))/*cast due to .constrained prefix*/).ToString() + "/" + ((object)participant.Key/*cast due to .constrained prefix*/).ToString() + ": " + evidence)); } } private unsafe void CancelParticipant(ParticipantKey key, string reason) { //IL_0007: 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_0014: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_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_0073: 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_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //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_0179: Unknown result type (might be due to invalid IL or missing references) //IL_01a6: Unknown result type (might be due to invalid IL or missing references) if (_participants.TryGetValue(key, out ParticipantSnapshot value)) { int num; if (!((Object)(object)value.Master != (Object)null)) { num = 0; } else { NetworkInstanceId netId = ((NetworkBehaviour)value.Master).netId; num = (int)((NetworkInstanceId)(ref netId)).Value; } uint num2 = (uint)num; ParticipantState state = value.State; _ledger.TransitionParticipant(key, state, (ParticipantState)3, _stage); value.State = (ParticipantState)3; LogParticipantClaimSnapshot(key, (ParticipantState)3, "participant-disconnect", SanitizeDiagnosticToken(reason), state, (ParticipantState)3, value.Evidence); ClaimKey[] array = _deferredPayloads.Keys.Where(delegate(ClaimKey x) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) ParticipantKey participant = ((ClaimKey)(ref x)).Participant; return ((ParticipantKey)(ref participant)).Equals(key); }).ToArray(); foreach (ClaimKey key2 in array) { _deferredPayloads.Remove(key2); } _participants.Remove(key); _missingSince.Remove(key); _disconnectCandidates.Remove(key); array = _pendingHistoricalMirrorRetry.Keys.Where(delegate(ClaimKey x) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) ParticipantKey participant = ((ClaimKey)(ref x)).Participant; return ((ParticipantKey)(ref participant)).Equals(key); }).ToArray(); foreach (ClaimKey key3 in array) { _pendingHistoricalMirrorRetry.Remove(key3); } if (num2 != 0) { _generationProbes.Remove(num2); } _classifier.Forget(key); if (_config.DiagnosticLogging.Value) { _log.LogInfo((object)("[ItemShareFix] participant DISCONNECTED " + ((object)(*(ParticipantKey*)(&key))/*cast due to .constrained prefix*/).ToString() + " reason=" + reason)); } } } private void TryGrantDeferred() { //IL_0208: Unknown result type (might be due to invalid IL or missing references) //IL_020d: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_017e: Unknown result type (might be due to invalid IL or missing references) //IL_01ce: Unknown result type (might be due to invalid IL or missing references) //IL_01d3: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) if (!_config.DeadPlayerDeferredItemsEnabled.Value || Time.unscaledTime - _lastStageChangeTime < 0.75f) { return; } ParticipantSnapshot[] array = _participants.Values.ToArray(); foreach (ParticipantSnapshot participantSnapshot in array) { if (!CanGrantDeferred(participantSnapshot) || (int)participantSnapshot.State != 0 || (Object)(object)participantSnapshot.Master == (Object)null || (Object)(object)participantSnapshot.Master.inventory == (Object)null || (Object)(object)participantSnapshot.Master.GetBody() == (Object)null) { continue; } foreach (ClaimRecord item in _ledger.DeferredFor(participantSnapshot.Key, _stage)) { if (!_deferredPayloads.TryGetValue(item.Key, out DeferredGrantPayload value)) { continue; } try { _deferredGrantDepth++; if (!_upstream.GiveDeferred(participantSnapshot.Master.inventory, value.PickupDef, value.BoxedUniquePickup)) { _log.LogWarning((object)("[ItemShareFix] deferred grant returned false; entitlement retained " + ((object)item.Key/*cast due to .constrained prefix*/).ToString())); continue; } if (!_ledger.MarkDeferredGranted(item.Key, _stage)) { _deferredPayloads.Remove(item.Key); _log.LogError((object)("[ItemShareFix] deferred grant succeeded but ledger transition failed; payload retired to prevent duplicate grant " + ((object)item.Key/*cast due to .constrained prefix*/).ToString())); continue; } _deferredPayloads.Remove(item.Key); if (_config.DiagnosticLogging.Value) { _log.LogInfo((object)("[ItemShareFix] granted deferred entitlement " + ((object)item.Key/*cast due to .constrained prefix*/).ToString())); } } catch (Exception ex) { _log.LogWarning((object)("[ItemShareFix] deferred grant retained after failure " + ((object)item.Key/*cast due to .constrained prefix*/).ToString() + ": " + ex.GetType().Name + ": " + ex.Message)); } finally { _deferredGrantDepth--; } } } } private GenerationProbeGate GetOrCreateGenerationProbe(uint masterNetId) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Expected O, but got Unknown if (!_generationProbes.TryGetValue(masterNetId, out GenerationProbeGate value)) { value = new GenerationProbeGate(); _generationProbes.Add(masterNetId, value); } return value; } private bool TryGetGenerationProbe(ParticipantSnapshot participant, out GenerationProbeGate probe) { //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) probe = null; if ((Object)(object)participant.Master == (Object)null) { return false; } NetworkInstanceId netId = ((NetworkBehaviour)participant.Master).netId; uint value = ((NetworkInstanceId)(ref netId)).Value; if (value == 0 || !_generationProbes.TryGetValue(value, out GenerationProbeGate value2)) { return false; } probe = value2; return true; } private bool HasProvenGenerationIdentity(ParticipantSnapshot participant) { //IL_0014: 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_001d: Unknown result type (might be due to invalid IL or missing references) if (TryGetGenerationProbe(participant, out GenerationProbeGate probe) && probe.HasProvenParticipant) { ParticipantKey provenParticipant = probe.ProvenParticipant; return ((ParticipantKey)(ref provenParticipant)).Equals(participant.Key); } return false; } private bool CanUseExactParticipantState(ParticipantSnapshot participant) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Invalid comparison between Unknown and I4 //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_001e: Unknown result type (might be due to invalid IL or missing references) if (TryGetGenerationProbe(participant, out GenerationProbeGate probe) && (int)probe.State == 1) { ParticipantKey provenParticipant = probe.ProvenParticipant; return ((ParticipantKey)(ref provenParticipant)).Equals(participant.Key); } return false; } private bool CanCreateClaims(ParticipantSnapshot participant) { //IL_0014: 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_001d: Unknown result type (might be due to invalid IL or missing references) if (TryGetGenerationProbe(participant, out GenerationProbeGate probe) && probe.CanCreateClaims) { ParticipantKey provenParticipant = probe.ProvenParticipant; return ((ParticipantKey)(ref provenParticipant)).Equals(participant.Key); } return false; } private bool CanGrantDeferred(ParticipantSnapshot participant) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0015: 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) if (TryGetGenerationProbe(participant, out GenerationProbeGate probe)) { ParticipantKey provenParticipant = probe.ProvenParticipant; if (((ParticipantKey)(ref provenParticipant)).Equals(participant.Key)) { return probe.CanGrantDeferred(participant.State); } } return false; } private void LogProbeFailureOnce(string diagnosticKey, string message) { if (_identityDiagnosticLogged.Add(diagnosticKey)) { _log.LogError((object)message); } } private ParticipantSnapshot? FindParticipant(CharacterMaster master) { return _participants.Values.FirstOrDefault((ParticipantSnapshot x) => (Object)(object)x.Master != (Object)null && x.Master == master); } private void ResetForRunBoundary(Run? currentRun) { Run runInstance = _runInstance; _runInstance = currentRun; _distribution.Clear(); _ledger.Clear(); _participants.Clear(); _missingSince.Clear(); _deferredPayloads.Clear(); _pendingTransferRebroadcast.Clear(); _pendingHistoricalMirrorRetry.Clear(); _generationProbes.Clear(); _identityDiagnosticLogged.Clear(); _claimEnsureDiagnosticLogged.Clear(); _disconnectCandidates.Clear(); _disconnectGateDiagnosticLogged.Clear(); _itemShareActiveGateDiagnosticLogged.Clear(); _commandRetentionDiagnosticLogged.Clear(); _temporaryPolicyDiagnosticLogged.Clear(); _classifier.Reset(); _deferredGrantDepth = 0; _nextParticipantSweep = 0f; _stage = CurrentStageToken(); _lastStageChangeTime = Time.unscaledTime; if (_config.DiagnosticLogging.Value) { _log.LogInfo((object)("[ItemShareFix] run boundary reset old=" + (((Object)(object)runInstance == (Object)null) ? "" : ((Object)runInstance).GetInstanceID().ToString(CultureInfo.InvariantCulture)) + " new=" + (((Object)(object)currentRun == (Object)null) ? "" : ((Object)currentRun).GetInstanceID().ToString(CultureInfo.InvariantCulture)))); } } private void OnStageTransition(int newStage) { //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_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0058: 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_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Invalid comparison between Unknown and I4 _stage = newStage; _lastStageChangeTime = Time.unscaledTime; _ledger.OnStageTransition(newStage); KeyValuePair[] array = _deferredPayloads.ToArray(); ClaimRecord val = default(ClaimRecord); for (int i = 0; i < array.Length; i++) { KeyValuePair keyValuePair = array[i]; ClaimLedger ledger = _ledger; ClaimKey key = keyValuePair.Key; SharedPickupKey pickup = ((ClaimKey)(ref key)).Pickup; key = keyValuePair.Key; if (!ledger.TryGet(pickup, ((ClaimKey)(ref key)).Participant, ref val) || (int)val.State != 2) { _deferredPayloads.Remove(keyValuePair.Key); } } _pendingTransferRebroadcast.Clear(); _pendingHistoricalMirrorRetry.Clear(); _claimEnsureDiagnosticLogged.Clear(); _temporaryPolicyDiagnosticLogged.Clear(); if (_config.DiagnosticLogging.Value) { _log.LogInfo((object)("[ItemShareFix] stage transition token=" + newStage)); } } private void RetryTransferBroadcasts() { KeyValuePair[] array = _pendingTransferRebroadcast.ToArray(); for (int i = 0; i < array.Length; i++) { KeyValuePair keyValuePair = array[i]; if (_upstream.TryBroadcastTransferredOrbState(keyValuePair.Key) || Time.unscaledTime >= keyValuePair.Value) { _pendingTransferRebroadcast.Remove(keyValuePair.Key); } } } private unsafe void RetryHistoricalMirrors() { //IL_0034: 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_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_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004d: 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_0056: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_006a: 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_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //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_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0193: Unknown result type (might be due to invalid IL or missing references) //IL_0198: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) KeyValuePair[] array = _pendingHistoricalMirrorRetry.ToArray(); for (int i = 0; i < array.Length; i++) { KeyValuePair keyValuePair = array[i]; if (Time.unscaledTime < keyValuePair.Value) { continue; } ClaimLedger ledger = _ledger; ClaimKey key = keyValuePair.Key; SharedPickupKey pickup = ((ClaimKey)(ref key)).Pickup; key = keyValuePair.Key; ParticipantKey participant = ((ClaimKey)(ref key)).Participant; if (ledger.IsHistoricallyBlocked(pickup, ((ParticipantKey)(ref participant)).StableUser)) { Dictionary participants = _participants; key = keyValuePair.Key; if (participants.TryGetValue(((ClaimKey)(ref key)).Participant, out ParticipantSnapshot value) && !((Object)(object)value.Master == (Object)null)) { key = keyValuePair.Key; SharedPickupKey pickup2 = ((ClaimKey)(ref key)).Pickup; if (!((Object)(object)UpstreamBridge.FindPickupByInstanceId(((SharedPickupKey)(ref pickup2)).Value) == (Object)null)) { UpstreamBridge upstream = _upstream; key = keyValuePair.Key; pickup2 = ((ClaimKey)(ref key)).Pickup; if (upstream.TryMirrorHistoricalBarrier(((SharedPickupKey)(ref pickup2)).Value, value.Master, out string evidence)) { _pendingHistoricalMirrorRetry.Remove(keyValuePair.Key); if (_config.DiagnosticLogging.Value) { ManualLogSource log = _log; key = keyValuePair.Key; log.LogInfo((object)("[ItemShareFix] reconnect historical barrier retry PASS " + ((object)(*(ClaimKey*)(&key))/*cast due to .constrained prefix*/).ToString() + ": " + evidence)); } } else { _pendingHistoricalMirrorRetry[keyValuePair.Key] = Time.unscaledTime + 0.25f; if (_config.DiagnosticLogging.Value) { ManualLogSource log2 = _log; key = keyValuePair.Key; log2.LogDebug((object)("[ItemShareFix] reconnect historical barrier retry pending " + ((object)(*(ClaimKey*)(&key))/*cast due to .constrained prefix*/).ToString() + ": " + evidence)); } } continue; } } } _pendingHistoricalMirrorRetry.Remove(keyValuePair.Key); } } private unsafe void LogTransition(ParticipantKey key, ParticipantState from, ParticipantState to, string evidence) { if (_config.DiagnosticLogging.Value) { _log.LogInfo((object)("[ItemShareFix] participant " + ((object)(*(ParticipantKey*)(&key))/*cast due to .constrained prefix*/).ToString() + " " + ((object)(*(ParticipantState*)(&from))/*cast due to .constrained prefix*/).ToString() + " -> " + ((object)(*(ParticipantState*)(&to))/*cast due to .constrained prefix*/).ToString() + " (" + evidence + ")")); } } private void LogParticipantClaimSnapshot(ParticipantKey participant, ParticipantState participantState, string action, string reason, ParticipantState from, ParticipantState to, string participantEvidence) { //IL_0007: 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_0084: 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_0091: Unknown result type (might be due to invalid IL or missing references) if (!_config.DiagnosticLogging.Value) { return; } foreach (ClaimRecord item in _ledger.Records.Where(delegate(ClaimRecord x) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_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_0012: Unknown result type (might be due to invalid IL or missing references) ClaimKey key = x.Key; ParticipantKey participant2 = ((ClaimKey)(ref key)).Participant; return ((ParticipantKey)(ref participant2)).Equals(participant); }).OrderBy(delegate(ClaimRecord x) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_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) ClaimKey key = x.Key; SharedPickupKey pickup = ((ClaimKey)(ref key)).Pickup; return ((SharedPickupKey)(ref pickup)).Value; })) { LogClaimState(item, participantState, action, reason, participantEvidence, from, to); } } private unsafe void LogClaimState(ClaimRecord record, ParticipantState participantState, string action, string reason, string participantEvidence, ParticipantState? from = null, ParticipantState? to = null) { //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_004d: 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) if (_config.DiagnosticLogging.Value) { string text = ((from.HasValue && to.HasValue) ? (" from=" + ((object)from.Value/*cast due to .constrained prefix*/).ToString() + " to=" + ((object)to.Value/*cast due to .constrained prefix*/).ToString()) : string.Empty); ManualLogSource log = _log; string[] obj = new string[15] { "[ItemShareFix] ISF_C20_CLAIM_STATE participant=", null, null, null, null, null, null, null, null, null, null, null, null, null, null }; ClaimKey key = record.Key; obj[1] = ((object)((ClaimKey)(ref key)).Participant/*cast due to .constrained prefix*/).ToString(); obj[2] = " pickup="; key = record.Key; SharedPickupKey pickup = ((ClaimKey)(ref key)).Pickup; obj[3] = ((SharedPickupKey)(ref pickup)).Value.ToString(CultureInfo.InvariantCulture); obj[4] = " participantState="; obj[5] = ((object)(*(ParticipantState*)(&participantState))/*cast due to .constrained prefix*/).ToString(); obj[6] = " claimState="; obj[7] = ((object)record.State/*cast due to .constrained prefix*/).ToString(); obj[8] = " action="; obj[9] = action; obj[10] = " reason="; obj[11] = reason; obj[12] = text; obj[13] = " exactRemoteOp="; obj[14] = ExactRemoteOperationDiagnostic(participantEvidence); log.LogInfo((object)string.Concat(obj)); } } private static string ExactRemoteOperationDiagnostic(string participantEvidence) { if (string.IsNullOrEmpty(participantEvidence)) { return "not-probed"; } int num = participantEvidence.IndexOf("CharacterMaster.GetInRemoteOp()=", StringComparison.Ordinal); if (num < 0) { return "not-probed-classifier-order"; } int num2 = num + "CharacterMaster.GetInRemoteOp()=".Length; if (participantEvidence.IndexOf("true", num2, StringComparison.Ordinal) == num2) { return "true"; } if (participantEvidence.IndexOf("false", num2, StringComparison.Ordinal) == num2) { return "false"; } return "unavailable-fail-closed"; } private static string SanitizeDiagnosticToken(string value) { if (string.IsNullOrWhiteSpace(value)) { return "unspecified"; } return new string(value.Select((char ch) => (!char.IsLetterOrDigit(ch) && ch != '-' && ch != '_' && ch != '.') ? '_' : ch).ToArray()); } private static int CurrentStageToken() { Run instance = Run.instance; if ((Object)(object)instance == (Object)null) { return 0; } object member = ParticipantIdentityResolver.GetMember(instance, "stageClearCount"); try { return (member != null) ? Convert.ToInt32(member, CultureInfo.InvariantCulture) : 0; } catch { return 0; } } } internal sealed class UpstreamBridge { private readonly ManualLogSource _log; private readonly FieldInfo _claimsField; private readonly FieldInfo _choicesField; private readonly FieldInfo _modeField; private readonly FieldInfo _hideCollectedField; private readonly FieldInfo _shareCommandPicksField; private readonly FieldInfo _clientOrbsField; private readonly FieldInfo _clientCubesField; private readonly MethodInfo _clientContainsMethod; private readonly MethodInfo _isCommandCubeMethod; private readonly MethodInfo _hasPickerStateMethod; private readonly FieldInfo _pickerOptionsField; private readonly MethodInfo _isShareableMethod; private readonly MethodInfo _giveDirectMethod; private readonly MethodInfo _broadcastOrbStateMethod; private readonly MethodInfo _applyOrbVisibilityMethod; public bool IsIndividualMode => string.Equals(ReadConfigValue(_modeField)?.ToString(), "Individual", StringComparison.OrdinalIgnoreCase); public bool HideCollectedOrbsEnabled => ReadConfigBool(_hideCollectedField); public bool ShareCommandPicksEnabled => ReadConfigBool(_shareCommandPicksField); public UpstreamBridge(Assembly itemShareAssembly, Assembly pickupShareApiAssembly, ManualLogSource log) { _log = log; Type type = itemShareAssembly.GetType("ItemShare.ItemSharePlugin", throwOnError: true); _claimsField = RequiredField(type, "Claims"); _choicesField = RequiredField(type, "Choices"); _modeField = RequiredField(type, "_mode"); _hideCollectedField = RequiredField(type, "_hideCollectedOrbs"); _shareCommandPicksField = RequiredField(type, "_shareCommandPicks"); _isShareableMethod = RequiredMethod(type, "IsShareable", 1); _giveDirectMethod = RequiredMethod(type, "GiveDirect", 3); _broadcastOrbStateMethod = RequiredMethod(type, "BroadcastOrbState", 2); _applyOrbVisibilityMethod = RequiredMethod(type, "ApplyOrbVisibility", 2); Type type2 = itemShareAssembly.GetType("ItemShare.ClientPickMirror", throwOnError: true); _clientOrbsField = RequiredField(type2, "Orbs"); _clientCubesField = RequiredField(type2, "Cubes"); object obj = _clientOrbsField.GetValue(null) ?? throw new InvalidOperationException("ItemShare ClientPickMirror.Orbs is null."); _clientContainsMethod = obj.GetType().GetMethod("Contains", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic, null, new Type[2] { typeof(uint), typeof(uint) }, null) ?? throw new MissingMethodException(obj.GetType().FullName, "Contains(uint,uint)"); if (_clientContainsMethod.ReturnType != typeof(bool)) { throw new InvalidOperationException("Unexpected ItemShare PickRecord.Contains return type."); } if ((_clientCubesField.GetValue(null) ?? throw new InvalidOperationException("ItemShare ClientPickMirror.Cubes is null.")).GetType() != obj.GetType()) { throw new InvalidOperationException("ItemShare cube/orb mirror record types differ unexpectedly."); } Type type3 = pickupShareApiAssembly.GetType("PickupShare.PickupClassifier", throwOnError: true); _isCommandCubeMethod = RequiredStaticMethod(type3, "IsCommandCube", typeof(bool), typeof(PickupPickerController)); Type type4 = pickupShareApiAssembly.GetType("PickupShare.PickupShareApi", throwOnError: true); _hasPickerStateMethod = RequiredStaticMethod(type4, "HasPickerState", typeof(bool), typeof(int)); _pickerOptionsField = RequiredField(typeof(PickupPickerController), "options"); } public bool IsCommandCube(PickupPickerController picker) { if ((Object)(object)picker == (Object)null) { return false; } try { return (bool)_isCommandCubeMethod.Invoke(null, new object[1] { picker }); } catch (Exception ex) { _log.LogWarning((object)("[ItemShareFix] PickupClassifier.IsCommandCube failed closed: " + ex.GetType().Name + ": " + ex.Message)); return false; } } public bool HasPickerProviderState(PickupPickerController picker) { if ((Object)(object)picker == (Object)null) { return false; } try { return (bool)_hasPickerStateMethod.Invoke(null, new object[1] { ((Object)picker).GetInstanceID() }); } catch (Exception ex) { _log.LogDebug((object)("[ItemShareFix] PickupShareApi.HasPickerState diagnostic query failed: " + ex.GetType().Name)); return false; } } public bool TryHasCommandPicked(PickupPickerController picker, CharacterMaster master, out bool picked) { //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_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) picked = false; if ((Object)(object)picker == (Object)null || (Object)(object)master == (Object)null || !IsIndividualMode || !ShareCommandPicksEnabled || !IsCommandCube(picker)) { return false; } if (NetworkServer.active) { if (!(_choicesField.GetValue(null) is IDictionary dictionary)) { return false; } int instanceID = ((Object)picker).GetInstanceID(); if (!dictionary.Contains(instanceID)) { picked = false; return true; } object obj = dictionary[instanceID]; if (obj == null) { return false; } picked = ServerClaimSetContains(obj, master); return true; } NetworkInstanceId netId = ((NetworkBehaviour)picker).netId; uint value = ((NetworkInstanceId)(ref netId)).Value; netId = ((NetworkBehaviour)master).netId; uint value2 = ((NetworkInstanceId)(ref netId)).Value; if (value == 0 || value2 == 0) { return false; } picked = ClientMirrorContains(_clientCubesField, value, value2); return true; } public bool TryGetCommandChoicePickupIndexes(PickupPickerController picker, out PickupIndex[] pickupIndexes, out string optionSource, out bool exactSource, out bool sourceDisagreement) { //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Invalid comparison between Unknown and I4 //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Invalid comparison between Unknown and I4 //IL_00dd: Unknown result type (might be due to invalid IL or missing references) pickupIndexes = Array.Empty(); optionSource = "unresolved"; exactSource = false; sourceDisagreement = false; if ((Object)(object)picker == (Object)null || !IsCommandCube(picker)) { return false; } try { if (!(_pickerOptionsField.GetValue(picker) is IEnumerable enumerable)) { return false; } List list = new List(); bool flag = false; bool flag2 = false; foreach (object item in enumerable) { if (item != null && TryReadBoolMember(item, "available", out var value) && value && TryReadPickupIndex(item, out var pickupIndex, out var source, out var disagreement) && !(pickupIndex == PickupIndex.none)) { sourceDisagreement |= disagreement; if ((int)source == 1) { flag = true; } if ((int)source == 2) { flag2 = true; } if (!list.Any((PickupIndex x) => x == pickupIndex)) { list.Add(pickupIndex); } } } if (list.Count == 0) { return false; } pickupIndexes = list.ToArray(); exactSource = flag && !flag2; optionSource = ((!flag2) ? "nested-pickup" : (flag ? "nested-pickup+direct-fallback" : "direct-fallback")); return true; } catch (Exception ex) { _log.LogDebug((object)("[ItemShareFix] Command picker option metadata read failed: " + ex.GetType().Name)); return false; } } public bool TryGetCommandChoiceLifetime(PickupPickerController picker, out MarkerLifetimeKind lifetime, out int exactNestedAvailableOptionCount, out int unresolvedAvailableOptionCount) { //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Expected I4, but got Unknown //IL_008a: 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) lifetime = (MarkerLifetimeKind)3; exactNestedAvailableOptionCount = 0; unresolvedAvailableOptionCount = 0; if ((Object)(object)picker == (Object)null || !IsCommandCube(picker)) { return false; } try { if (!(_pickerOptionsField.GetValue(picker) is IEnumerable enumerable)) { return false; } bool flag = false; bool flag2 = false; bool flag3 = false; foreach (object item in enumerable) { if (item == null || !TryReadBoolMember(item, "available", out var value) || !value) { continue; } flag = true; if (!TryReadMember(item, "pickup", out object value2) || !(value2 is UniquePickup val)) { unresolvedAvailableOptionCount++; continue; } exactNestedAvailableOptionCount++; if (((UniquePickup)(ref val)).isTempItem) { flag2 = true; } else { flag3 = true; } } if (!flag) { return false; } if (unresolvedAvailableOptionCount > 0) { lifetime = (MarkerLifetimeKind)3; return true; } lifetime = (MarkerLifetimeKind)(int)MarkerLifetimePolicy.FromExactOptionKinds(flag2, flag3); return exactNestedAvailableOptionCount > 0; } catch (Exception ex) { _log.LogDebug((object)("[ItemShareFix] Command picker exact lifetime metadata read failed: " + ex.GetType().Name)); lifetime = (MarkerLifetimeKind)3; return false; } } private static bool TryReadPickupIndex(object boxedOption, out PickupIndex pickupIndex, out CommandOptionPickupSource source, out bool disagreement) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_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_0082: 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_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_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Expected I4, but got Unknown //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) pickupIndex = PickupIndex.none; source = (CommandOptionPickupSource)0; disagreement = false; bool flag = false; PickupIndex val = PickupIndex.none; if (TryReadMember(boxedOption, "pickup", out object value) && value != null && TryReadMember(value, "pickupIndex", out object value2) && value2 is PickupIndex val2) { flag = true; val = val2; } bool flag2 = false; PickupIndex val3 = PickupIndex.none; if (TryReadMember(boxedOption, "pickupIndex", out object value3) && value3 is PickupIndex val4) { flag2 = true; val3 = val4; } CommandOptionPickupDecision val5 = CommandOptionSourcePolicy.Resolve(flag, val, flag2, val3); if (!val5.HasValue) { return false; } pickupIndex = val5.Value; source = (CommandOptionPickupSource)(int)val5.Source; disagreement = val5.Disagreement; return true; } private static bool TryReadBoolMember(object instance, string name, out bool value) { value = false; if (!TryReadMember(instance, name, out object value2) || !(value2 is bool flag)) { return false; } value = flag; return true; } private static bool TryReadMember(object instance, string name, out object? value) { value = null; Type type = instance.GetType(); FieldInfo field = type.GetField(name, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); if (field != null) { value = field.GetValue(instance); return true; } PropertyInfo property = type.GetProperty(name, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); if (property == null || property.GetIndexParameters().Length != 0) { return false; } value = property.GetValue(instance); return true; } public bool IsShareable(GenericPickupController pickup) { //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) if ((Object)(object)pickup == (Object)null) { return false; } PickupDef pickupDef = PickupCatalog.GetPickupDef(pickup.pickup.pickupIndex); if (pickupDef != null) { return IsShareable(pickupDef); } return false; } public bool IsShareable(PickupDef def) { bool shareable; return TryIsShareable(def, out shareable) && shareable; } public bool TryIsShareable(PickupDef def, out bool shareable) { shareable = false; if (def == null) { return false; } try { if (!(_isShareableMethod.Invoke(null, new object[1] { def }) is bool flag)) { return false; } shareable = flag; return true; } catch (Exception ex) { _log.LogError((object)("[ItemShareFix] ItemShare IsShareable(PickupDef) reflection failed: " + ex)); return false; } } public bool HasCollected(GenericPickupController pickup, CharacterMaster master) { //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_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)pickup == (Object)null || (Object)(object)master == (Object)null) { return false; } if (NetworkServer.active) { return ServerClaimsContains(((Object)pickup).GetInstanceID(), master); } NetworkInstanceId netId = ((NetworkBehaviour)pickup).netId; uint value = ((NetworkInstanceId)(ref netId)).Value; netId = ((NetworkBehaviour)master).netId; uint value2 = ((NetworkInstanceId)(ref netId)).Value; if (value == 0 || value2 == 0) { return false; } return ClientMirrorContains(value, value2); } public void NormalizeUpstreamVisualSubtree(GenericPickupController pickup) { if ((Object)(object)pickup == (Object)null || (Object)(object)pickup.pickupDisplay == (Object)null) { return; } try { _applyOrbVisibilityMethod.Invoke(null, new object[2] { pickup, true }); } catch (Exception ex) { _log.LogDebug((object)("[ItemShareFix] upstream visual normalization failed: " + ex.GetType().Name)); } } public bool GiveDeferred(Inventory inventory, PickupDef pickupDef, object boxedUniquePickup) { object obj = _giveDirectMethod.Invoke(null, new object[3] { inventory, pickupDef, boxedUniquePickup }); bool flag = default(bool); int num; if (obj is bool) { flag = (bool)obj; num = 1; } else { num = 0; } return (byte)((uint)num & (flag ? 1u : 0u)) != 0; } public bool TryMirrorHistoricalBarrier(int pickupInstanceId, CharacterMaster master, out string evidence) { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) evidence = string.Empty; if (NetworkServer.active && !((Object)(object)master == (Object)null)) { NetworkInstanceId netId = ((NetworkBehaviour)master).netId; if (((NetworkInstanceId)(ref netId)).Value != 0) { if (!(_claimsField.GetValue(null) is IDictionary dictionary) || !dictionary.Contains(pickupInstanceId)) { evidence = "ItemShare Claims has no authoritative entry for historical pickup " + pickupInstanceId; return false; } object obj = dictionary[pickupInstanceId]; if (obj == null) { evidence = "ItemShare claim set is null for historical pickup " + pickupInstanceId; return false; } bool flag = ServerClaimSetContains(obj, master); MethodInfo method = obj.GetType().GetMethod("Add", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic, null, new Type[1] { typeof(CharacterMaster) }, null); if (method == null) { evidence = "ItemShare claim set has no Add(CharacterMaster)"; return false; } try { if (!flag) { object obj2 = method.Invoke(obj, new object[1] { master }); if (obj2 is bool && !(bool)obj2 && !ServerClaimSetContains(obj, master)) { evidence = "ItemShare claim set rejected reconnect generation"; return false; } } GenericPickupController val = FindPickupByInstanceId(pickupInstanceId); if (!((Object)(object)val == (Object)null)) { netId = ((NetworkBehaviour)val).netId; if (((NetworkInstanceId)(ref netId)).Value != 0) { _broadcastOrbStateMethod.Invoke(null, new object[2] { val, obj }); evidence = (flag ? "historical barrier already present in ItemShare Claims and was rebroadcast" : "historical barrier mirrored into ItemShare Claims and rebroadcast"); return true; } } evidence = "historical barrier is present server-side; client rebroadcast is pending because pickup/netId is unavailable"; return false; } catch (Exception ex) { evidence = "historical barrier mirror failed: " + ex.GetType().Name + ": " + ex.Message; _log.LogWarning((object)("[ItemShareFix] " + evidence)); return false; } } } evidence = "server/master unavailable"; return false; } public bool TryBroadcastTransferredOrbState(int newInstanceId) { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) if (!NetworkServer.active) { return false; } GenericPickupController val = FindPickupByInstanceId(newInstanceId); if (!((Object)(object)val == (Object)null)) { NetworkInstanceId netId = ((NetworkBehaviour)val).netId; if (((NetworkInstanceId)(ref netId)).Value != 0) { if (!(_claimsField.GetValue(null) is IDictionary dictionary)) { return false; } if (!dictionary.Contains(newInstanceId)) { return true; } object obj = dictionary[newInstanceId]; if (obj == null) { return false; } try { _broadcastOrbStateMethod.Invoke(null, new object[2] { val, obj }); return true; } catch (Exception ex) { _log.LogWarning((object)("[ItemShareFix] transferred-orb state rebroadcast failed: " + ex.GetType().Name + ": " + ex.Message)); return false; } } } return false; } public static GenericPickupController? FindPickupByInstanceId(int instanceId) { foreach (GenericPickupController instances in InstanceTracker.GetInstancesList()) { if ((Object)(object)instances != (Object)null && ((Object)instances).GetInstanceID() == instanceId) { return instances; } } return null; } private bool ServerClaimsContains(int pickupInstanceId, CharacterMaster master) { if (!(_claimsField.GetValue(null) is IDictionary dictionary) || !dictionary.Contains(pickupInstanceId)) { return false; } object obj = dictionary[pickupInstanceId]; if (obj != null) { return ServerClaimSetContains(obj, master); } return false; } private static bool ServerClaimSetContains(object claimSet, CharacterMaster master) { if (!(claimSet is IEnumerable enumerable)) { return false; } foreach (object item in enumerable) { if (item == master) { return true; } } return false; } private bool ClientMirrorContains(uint pickupNetId, uint masterNetId) { return ClientMirrorContains(_clientOrbsField, pickupNetId, masterNetId); } private bool ClientMirrorContains(FieldInfo mirrorField, uint pickupNetId, uint masterNetId) { try { object value = mirrorField.GetValue(null); if (value == null) { return false; } return (bool)_clientContainsMethod.Invoke(value, new object[2] { pickupNetId, masterNetId }); } catch (Exception ex) { _log.LogWarning((object)("[ItemShareFix] client mirror query failed: " + ex.GetType().Name + ": " + ex.Message)); return false; } } private static FieldInfo RequiredField(Type type, string name) { return type.GetField(name, BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic) ?? throw new MissingFieldException(type.FullName, name); } private static MethodInfo RequiredMethod(Type type, string name, int parameterCount) { MethodInfo[] array = (from x in type.GetMethods(BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic) where string.Equals(x.Name, name, StringComparison.Ordinal) && x.GetParameters().Length == parameterCount select x).ToArray(); if (array.Length != 1) { throw new MissingMethodException(type.FullName, name + " with " + parameterCount + " parameters"); } return array[0]; } private static MethodInfo RequiredStaticMethod(Type type, string name, Type returnType, params Type[] parameterTypes) { MethodInfo method = type.GetMethod(name, BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic, null, parameterTypes, null); if (method == null || method.ReturnType != returnType) { throw new MissingMethodException(type.FullName, name); } return method; } private static object? ReadConfigValue(FieldInfo field) { object value = field.GetValue(null); return value?.GetType().GetProperty("Value", BindingFlags.Instance | BindingFlags.Public)?.GetValue(value); } private static bool ReadConfigBool(FieldInfo field) { object obj = ReadConfigValue(field); bool flag = default(bool); int num; if (obj is bool) { flag = (bool)obj; num = 1; } else { num = 0; } return (byte)((uint)num & (flag ? 1u : 0u)) != 0; } } }