using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using System.Threading.Tasks; using BepInEx; using BepInEx.Configuration; using BepInEx.Core.Logging.Interpolation; using BepInEx.Logging; using BepInEx.NET.Common; using BepInExResoniteShim; using Elements.Assets; using Elements.Core; using FrooxEngine; using FrooxEngine.UIX; using HarmonyLib; using Renderite.Shared; using SkyFrost.Base; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(/*Could not decode attribute arguments.*/)] [assembly: IgnoresAccessChecksTo("Awwdio")] [assembly: IgnoresAccessChecksTo("Elements.Assets")] [assembly: IgnoresAccessChecksTo("Elements.Core")] [assembly: IgnoresAccessChecksTo("FrooxEngine")] [assembly: IgnoresAccessChecksTo("Renderite.Shared")] [assembly: IgnoresAccessChecksTo("SkyFrost.Base")] [assembly: IgnoresAccessChecksTo("SkyFrost.Base.Models")] [assembly: TargetFramework(".NETCoreApp,Version=v10.0", FrameworkDisplayName = ".NET 10.0")] [assembly: AssemblyCompany("SessionTabOverhaul")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("2.2.2.0")] [assembly: AssemblyInformationalVersion("2.2.2+0aa010758f00dd377e53a281c3963c75d0621d6f")] [assembly: AssemblyProduct("SessionTabOverhaul")] [assembly: AssemblyTitle("SessionTabOverhaul")] [assembly: AssemblyMetadata("RepositoryUrl", "https://github.com/Gyztor/BepisSessionTabOverhaul")] [assembly: SecurityPermission((SecurityAction)8, SkipVerification = true)] [assembly: AssemblyVersion("2.2.2.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace SessionTabOverhaul { [HarmonyPatch(typeof(SessionControlDialog))] internal static class SessionControlDialogPatches { private static readonly float2 rectOffset = new float2(4f, 4f); [HarmonyPostfix] [HarmonyPatch("GenerateUi")] private static void GenerateUiPostfix(SessionControlDialog __instance, Tab tab) { //IL_0000: 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_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_006f: 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_008c: 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_009a: 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_00b8: 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_00f7: Unknown result type (might be due to invalid IL or missing references) if ((int)tab != 0) { return; } Enumerator enumerator = __instance._accessLevelRadios.GetEnumerator(); try { while (enumerator.MoveNext()) { Slot parent = ((Component)enumerator.Current).Slot.Parent.Parent.Parent; LayoutElement component = ((ContainerWorker)(object)parent).GetComponent((Predicate)null, false); Sync preferredHeight = component.PreferredHeight; ((SyncField)(object)preferredHeight).Value = ((SyncField)(object)preferredHeight).Value + 8f; Sync minHeight = component.MinHeight; ((SyncField)(object)minHeight).Value = ((SyncField)(object)minHeight).Value + 8f; Enumerator enumerator2 = parent.Children.GetEnumerator(); try { while (enumerator2.MoveNext()) { RectTransform component2 = ((ContainerWorker)(object)enumerator2.Current).GetComponent((Predicate)null, false); Sync offsetMin = component2.OffsetMin; float2 value = ((SyncField)(object)offsetMin).Value; ((SyncField)(object)offsetMin).Value = (ref value) + (ref rectOffset); Sync offsetMax = component2.OffsetMax; value = ((SyncField)(object)offsetMax).Value; ((SyncField)(object)offsetMax).Value = (ref value) - (ref rectOffset); } } finally { ((System.IDisposable)enumerator2/*cast due to .constrained prefix*/).Dispose(); } ((SyncField)(object)((ContainerWorker)(object)parent).AttachComponent(true, (Action)null).Tint).Value = (((parent.ChildIndex & 1) == 0) ? SessionTabOverhaul.FirstRowColor.Value : SessionTabOverhaul.SecondRowColor.Value); } } finally { ((System.IDisposable)enumerator/*cast due to .constrained prefix*/).Dispose(); } } [HarmonyPostfix] [HarmonyPatch("OnAttach")] private static void OnAttachPostfix(SessionControlDialog __instance) { //IL_001d: 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) RectTransform component = ((ContainerWorker)(object)((Component)__instance).Slot).GetComponent((Predicate)null, false); ((SyncField)(object)component.OffsetMin).Value = new float2(16f, 16f); ((SyncField)(object)component.OffsetMax).Value = new float2(-16f, -16f); } } [HarmonyPatch(typeof(SessionPermissionController))] internal static class SessionPermissionControllerPatches { [HarmonyPostfix] [HarmonyPatch("Create")] private static void CreatePostfix(SessionPermissionController __result) { //IL_0032: 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) ((SyncField)(object)((ContainerWorker)(object)((Component)__result).Slot).AttachComponent(true, (Action)null).Tint).Value = (((((Component)__result).Slot.ChildIndex & 1) == 0) ? SessionTabOverhaul.FirstRowColor.Value : SessionTabOverhaul.SecondRowColor.Value); Sync minHeight = ((ContainerWorker)(object)((Component)__result).Slot).GetComponent((Predicate)null, false).MinHeight; ((SyncField)(object)minHeight).Value = ((SyncField)(object)minHeight).Value + 8f; HorizontalLayout componentInChildren = ((Component)__result).Slot.GetComponentInChildren((Predicate)null, false, false); ((SyncField)(object)((DirectionalLayout)componentInChildren).PaddingBottom).Value = 4f; ((SyncField)(object)((DirectionalLayout)componentInChildren).PaddingRight).Value = 4f; ((SyncField)(object)((DirectionalLayout)componentInChildren).PaddingLeft).Value = 4f; ((SyncField)(object)((DirectionalLayout)componentInChildren).PaddingTop).Value = 4f; } [HarmonyPostfix] [HarmonyPatch("OnCommonUpdate")] private static void OnCommonUpdatePostfix(SessionPermissionController __instance) { //IL_0032: 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) ((SyncField)(object)((ContainerWorker)(object)((Component)__instance).Slot).GetComponent((Predicate)null, false).Tint).Value = (((((Component)__instance).Slot.ChildIndex & 1) == 0) ? SessionTabOverhaul.FirstRowColor.Value : SessionTabOverhaul.SecondRowColor.Value); } } [ResonitePlugin("net.NepuShiro.SessionTabOverhaul", "SessionTabOverhaul", "2.2.2", "SessionTabOverhaul", "https://github.com/Gyztor/BepisSessionTabOverhaul")] [BepInDependency(/*Could not decode attribute arguments.*/)] public class SessionTabOverhaul : BasePlugin { internal static ManualLogSource Log; internal static ConfigEntry ColorHostName; internal static ConfigEntry ColorLocalUserName; internal static ConfigEntry HideAllBadges; internal static ConfigEntry HideCustomBadges; internal static ConfigEntry HidePatreonBadge; internal static ConfigEntry ShowParentUserCheckbox; internal static ConfigEntry ShowBringButton; internal static ConfigEntry ShowDeviceLabel; internal static ConfigEntry ShowFPSOrQueuedMessages; internal static ConfigEntry ShowSteamButton; internal static ConfigEntry ShowVoiceMode; internal static ConfigEntry ShowAudioWaveform; internal static ConfigEntry LocalUserColor; internal static ConfigEntry FirstRowColor; internal static ConfigEntry SecondRowColor; [field: CompilerGenerated] internal static bool SpritesInjected { [CompilerGenerated] get; [CompilerGenerated] set; } public override void Load() { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Expected O, but got Unknown //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Expected O, but got Unknown //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Expected O, but got Unknown //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Expected O, but got Unknown //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Expected O, but got Unknown //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Expected O, but got Unknown //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Expected O, but got Unknown //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Expected O, but got Unknown //IL_017f: Unknown result type (might be due to invalid IL or missing references) //IL_0189: Expected O, but got Unknown //IL_01aa: Unknown result type (might be due to invalid IL or missing references) //IL_01b4: Expected O, but got Unknown //IL_01d5: Unknown result type (might be due to invalid IL or missing references) //IL_01df: Expected O, but got Unknown //IL_0200: Unknown result type (might be due to invalid IL or missing references) //IL_020a: Expected O, but got Unknown //IL_021f: Unknown result type (might be due to invalid IL or missing references) //IL_022f: Unknown result type (might be due to invalid IL or missing references) //IL_0239: Expected O, but got Unknown //IL_0259: Unknown result type (might be due to invalid IL or missing references) //IL_0269: Unknown result type (might be due to invalid IL or missing references) //IL_0273: Expected O, but got Unknown //IL_0293: Unknown result type (might be due to invalid IL or missing references) //IL_02a3: Unknown result type (might be due to invalid IL or missing references) //IL_02ad: Expected O, but got Unknown //IL_02d9: Unknown result type (might be due to invalid IL or missing references) //IL_02df: Expected O, but got Unknown Log = ((BasePlugin)this).Log; ColorHostName = ((BasePlugin)this).Config.Bind("Usernames", "Color Host Name", true, new ConfigDescription("Color the Host's username like the host icon.", (AcceptableValueBase)null, System.Array.Empty())); ColorLocalUserName = ((BasePlugin)this).Config.Bind("Usernames", "Color Local Username", true, new ConfigDescription("Colors the Local Users's username.", (AcceptableValueBase)null, System.Array.Empty())); HideAllBadges = ((BasePlugin)this).Config.Bind("Badges", "Hide All Badges", false, new ConfigDescription("Hide all Badges in the Session Users list.", (AcceptableValueBase)null, System.Array.Empty())); HideCustomBadges = ((BasePlugin)this).Config.Bind("Badges", "Hide Custom Badges", false, new ConfigDescription("Hide Custom Badges in the Session Users list.", (AcceptableValueBase)null, System.Array.Empty())); HidePatreonBadge = ((BasePlugin)this).Config.Bind("Badges", "Hide Patreon Badge", false, new ConfigDescription("Hides the Patreon badge in the Session Users list.", (AcceptableValueBase)null, System.Array.Empty())); ShowParentUserCheckbox = ((BasePlugin)this).Config.Bind("User Manipulation", "Show Parent User Checkbox", true, new ConfigDescription("Show the Parent User checkbox in the Session Users list.", (AcceptableValueBase)null, System.Array.Empty())); ShowBringButton = ((BasePlugin)this).Config.Bind("User Manipulation", "Show Bring Button", true, new ConfigDescription("Show the Bring button in the Session Users list.", (AcceptableValueBase)null, System.Array.Empty())); ShowDeviceLabel = ((BasePlugin)this).Config.Bind("User Info", "Show Device Label", true, new ConfigDescription("Show the Device label in the Session Users list", (AcceptableValueBase)null, System.Array.Empty())); ShowFPSOrQueuedMessages = ((BasePlugin)this).Config.Bind("User Info", "Show FPS Or Queued", true, new ConfigDescription("Show the FPS / Queued messages in the Session Users list.", (AcceptableValueBase)null, System.Array.Empty())); ShowSteamButton = ((BasePlugin)this).Config.Bind("User Info", "Show Steam Button", false, new ConfigDescription("Show the Steam button in the Session Users list.", (AcceptableValueBase)null, System.Array.Empty())); ShowVoiceMode = ((BasePlugin)this).Config.Bind("User Info", "Show Voice Mode", true, new ConfigDescription("Colors the Local Users's username.", (AcceptableValueBase)null, System.Array.Empty())); ShowAudioWaveform = ((BasePlugin)this).Config.Bind("User Info", "Show Audio Waveform", false, new ConfigDescription("Shows the Audio Output Waveform behind the user badges.", (AcceptableValueBase)null, System.Array.Empty())); LocalUserColor = ((BasePlugin)this).Config.Bind("Usernames", "Local User Color", Hero.PURPLE, new ConfigDescription("The Color the Local Username should be set to.", (AcceptableValueBase)null, System.Array.Empty())); FirstRowColor = ((BasePlugin)this).Config.Bind("Row Colors", "First Row Color", new colorX(0f, 0.85f, (ColorProfile)1), new ConfigDescription("Background color of the first row in the Session user lists.", (AcceptableValueBase)null, System.Array.Empty())); SecondRowColor = ((BasePlugin)this).Config.Bind("Row Colors", "Second Row Color", new colorX(1f, 0.15f, (ColorProfile)1), new ConfigDescription("Background color of the second row in the Session user lists.", (AcceptableValueBase)null, System.Array.Empty())); try { ((BasePlugin)this).HarmonyInstance.PatchAll(); Log.LogInfo((object)"SessionTabOverhaul Loaded!"); } catch (System.Exception ex) { ManualLogSource log = Log; bool flag = default(bool); BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(36, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("SessionTabOverhaul failed to patch: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(ex); } log.LogError(val); } } } internal class SessionUserControllerExtraData { [field: CompilerGenerated] public Text? BadgesLabel { [CompilerGenerated] get; [CompilerGenerated] set; } [field: CompilerGenerated] public Button? JumpButton { [CompilerGenerated] get; [CompilerGenerated] set; } [field: CompilerGenerated] public Button? BringButton { [CompilerGenerated] get; [CompilerGenerated] set; } [field: CompilerGenerated] public Checkbox? ParentUserCheckbox { [CompilerGenerated] get; [CompilerGenerated] set; } [field: CompilerGenerated] public Text? DeviceLabel { [CompilerGenerated] get; [CompilerGenerated] set; } [field: CompilerGenerated] public Text? FPSOrQueuedMessagesLabel { [CompilerGenerated] get; [CompilerGenerated] set; } [field: CompilerGenerated] public Image? RowBackgroundImage { [CompilerGenerated] get; [CompilerGenerated] set; } [field: CompilerGenerated] public Text? VoiceModeLabel { [CompilerGenerated] get; [CompilerGenerated] set; } [field: CompilerGenerated] public ValueTag? WaveformGraphTag { [CompilerGenerated] get; [CompilerGenerated] set; } [field: CompilerGenerated] public ValueTag? WaveformGraphOffset { [CompilerGenerated] get; [CompilerGenerated] set; } [field: CompilerGenerated] public LineGraphMesh? WaveformLineGraphMesh { [CompilerGenerated] get; [CompilerGenerated] set; } [field: CompilerGenerated] public WeakReference? WorldSpaceVolumeMeter { [CompilerGenerated] get; [CompilerGenerated] set; } } [HarmonyPatch(typeof(SessionUserController))] internal static class SessionUserControllerPatches { [CompilerGenerated] private sealed class <>c__DisplayClass14_0 { [StructLayout((LayoutKind)3)] private struct <b__2>d : IAsyncStateMachine { public int <>1__state; public AsyncTaskMethodBuilder <>t__builder; public <>c__DisplayClass14_0 <>4__this; private TaskAwaiter> <>u__1; private void MoveNext() { //IL_0061: 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_006d: 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_0036: 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) int num = <>1__state; <>c__DisplayClass14_0 <>c__DisplayClass14_ = <>4__this; try { TaskAwaiter> val; if (num != 0) { val = ((SkyFrostInterface)((Worker)<>c__DisplayClass14_.controller).Cloud).Users.GetUserCached(<>c__DisplayClass14_.user.UserID).GetAwaiter(); if (!val.IsCompleted) { num = (<>1__state = 0); <>u__1 = val; ((AsyncTaskMethodBuilder)(ref <>t__builder)).AwaitUnsafeOnCompleted>, <b__2>d>(ref val, ref this); return; } } else { val = <>u__1; <>u__1 = default(TaskAwaiter>); num = (<>1__state = -1); } CloudResult result = val.GetResult(); if (((CloudResult)result).IsOK) { <>c__DisplayClass14_.controller.SetCloudData(result.Entity); } } catch (System.Exception exception) { <>1__state = -2; ((AsyncTaskMethodBuilder)(ref <>t__builder)).SetException(exception); return; } <>1__state = -2; ((AsyncTaskMethodBuilder)(ref <>t__builder)).SetResult(); } [DebuggerHidden] private void SetStateMachine(IAsyncStateMachine stateMachine) { ((AsyncTaskMethodBuilder)(ref <>t__builder)).SetStateMachine(stateMachine); } } public SessionUserController controller; public User user; public SessionUserControllerExtraData extraData; public Action <>9__4; public Action <>9__5; internal void b__3(IButton _, ButtonEventData _) { if (!((ComponentBase)(object)controller).IsDestroyed) { ((SyncField)(object)controller._slider.Target.Value).Value = 1f; } } internal void b__0(IButton _, ButtonEventData _) { //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: Expected O, but got Unknown //IL_003c: Expected O, but got Unknown if (((Worker)controller).World != Userspace.UserspaceWorld) { return; } World world = ((Worker)user).World; Action obj = <>9__4; if (obj == null) { Action val = delegate { //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) if (user.Root != null) { UserRoot root = ((Worker)user).World.LocalUser.Root; if (root != null) { root.JumpToPoint(user.Root.HeadPosition, 1.5f); } Checkbox? parentUserCheckbox = extraData.ParentUserCheckbox; if (parentUserCheckbox != null && ((SyncField)(object)parentUserCheckbox.State).Value && root != null) { ((Component)root).Slot.SetParent(((Component)user.Root).Slot.Parent, true); } object obj2; if (root == null) { obj2 = null; } else { LocomotionController registeredComponent = root.GetRegisteredComponent((Predicate)null); obj2 = ((registeredComponent != null) ? registeredComponent.ActiveModule : null); } object obj3 = ((obj2 is IPhysicalLocomotion) ? obj2 : null); CharacterController val3 = ((obj3 != null) ? ((IPhysicalLocomotion)obj3).CharacterController : null); if (val3 != null) { val3.LinearVelocity = float3.Zero; } } }; Action val2 = val; <>9__4 = val; obj = val2; } world.RunSynchronously(obj, false, (IUpdatable)null, false); } internal void b__4() { //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) if (user.Root != null) { UserRoot root = ((Worker)user).World.LocalUser.Root; if (root != null) { root.JumpToPoint(user.Root.HeadPosition, 1.5f); } Checkbox? parentUserCheckbox = extraData.ParentUserCheckbox; if (parentUserCheckbox != null && ((SyncField)(object)parentUserCheckbox.State).Value && root != null) { ((Component)root).Slot.SetParent(((Component)user.Root).Slot.Parent, true); } object obj; if (root == null) { obj = null; } else { LocomotionController registeredComponent = root.GetRegisteredComponent((Predicate)null); obj = ((registeredComponent != null) ? registeredComponent.ActiveModule : null); } object obj2 = ((obj is IPhysicalLocomotion) ? obj : null); CharacterController val = ((obj2 != null) ? ((IPhysicalLocomotion)obj2).CharacterController : null); if (val != null) { val.LinearVelocity = float3.Zero; } } } internal void b__1(IButton _, ButtonEventData _) { //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: Expected O, but got Unknown //IL_003c: Expected O, but got Unknown if (((Worker)controller).World != Userspace.UserspaceWorld) { return; } World world = ((Worker)user).World; Action obj = <>9__5; if (obj == null) { Action val = delegate { //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Expected O, but got Unknown //IL_00d9: Unknown result type (might be due to invalid IL or missing references) <>c__DisplayClass14_1 CS$<>8__locals16 = new <>c__DisplayClass14_1 { CS$<>8__locals1 = this }; if (((Worker)user).World.LocalUser.Root != null) { CS$<>8__locals16.root = user.Root; UserRoot obj2 = CS$<>8__locals16.root; object obj3; if (obj2 == null) { obj3 = null; } else { LocomotionController registeredComponent = obj2.GetRegisteredComponent((Predicate)null); obj3 = ((registeredComponent != null) ? registeredComponent.ActiveModule : null); } object obj4 = ((obj3 is IPhysicalLocomotion) ? obj3 : null); CS$<>8__locals16.charControl = ((obj4 != null) ? ((IPhysicalLocomotion)obj4).CharacterController : null); if (CS$<>8__locals16.charControl != null && ((SyncField)(object)CS$<>8__locals16.charControl.LinearDamping).Value != 3.4028235E+38f) { CS$<>8__locals16.oldval = ((SyncField)(object)CS$<>8__locals16.charControl.LinearDamping).Value; ((SyncField)(object)CS$<>8__locals16.charControl.LinearDamping).Value = 3.4028235E+38f; UserRoot obj5 = CS$<>8__locals16.root; if (obj5 != null) { Slot slot = ((Component)obj5).Slot; if (slot != null) { slot.RunInUpdates(15, (Action)delegate { //IL_0026: Unknown result type (might be due to invalid IL or missing references) UserRoot obj6 = CS$<>8__locals16.root; if (obj6 != null) { obj6.JumpToPoint(((Worker)CS$<>8__locals16.CS$<>8__locals1.user).World.LocalUser.Root.HeadPosition, 1.5f); } Checkbox? parentUserCheckbox = CS$<>8__locals16.CS$<>8__locals1.extraData.ParentUserCheckbox; if (parentUserCheckbox != null && ((SyncField)(object)parentUserCheckbox.State).Value) { UserRoot obj7 = CS$<>8__locals16.root; if (obj7 != null) { ((Component)obj7).Slot.SetParent(((Component)((Worker)CS$<>8__locals16.CS$<>8__locals1.user).World.LocalUser.Root).Slot.Parent, true); } } ((SyncField)(object)CS$<>8__locals16.charControl.LinearDamping).Value = CS$<>8__locals16.oldval; }); } } } } }; Action val2 = val; <>9__5 = val; obj = val2; } world.RunSynchronously(obj, false, (IUpdatable)null, false); } internal void b__5() { //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Expected O, but got Unknown //IL_00d9: Unknown result type (might be due to invalid IL or missing references) <>c__DisplayClass14_1 CS$<>8__locals16 = new <>c__DisplayClass14_1 { CS$<>8__locals1 = this }; if (((Worker)user).World.LocalUser.Root == null) { return; } CS$<>8__locals16.root = user.Root; UserRoot obj = CS$<>8__locals16.root; object obj2; if (obj == null) { obj2 = null; } else { LocomotionController registeredComponent = obj.GetRegisteredComponent((Predicate)null); obj2 = ((registeredComponent != null) ? registeredComponent.ActiveModule : null); } object obj3 = ((obj2 is IPhysicalLocomotion) ? obj2 : null); CS$<>8__locals16.charControl = ((obj3 != null) ? ((IPhysicalLocomotion)obj3).CharacterController : null); if (CS$<>8__locals16.charControl == null || ((SyncField)(object)CS$<>8__locals16.charControl.LinearDamping).Value == 3.4028235E+38f) { return; } CS$<>8__locals16.oldval = ((SyncField)(object)CS$<>8__locals16.charControl.LinearDamping).Value; ((SyncField)(object)CS$<>8__locals16.charControl.LinearDamping).Value = 3.4028235E+38f; UserRoot obj4 = CS$<>8__locals16.root; if (obj4 == null) { return; } Slot slot = ((Component)obj4).Slot; if (slot == null) { return; } slot.RunInUpdates(15, (Action)delegate { //IL_0026: Unknown result type (might be due to invalid IL or missing references) UserRoot obj5 = CS$<>8__locals16.root; if (obj5 != null) { obj5.JumpToPoint(((Worker)CS$<>8__locals16.CS$<>8__locals1.user).World.LocalUser.Root.HeadPosition, 1.5f); } Checkbox? parentUserCheckbox = CS$<>8__locals16.CS$<>8__locals1.extraData.ParentUserCheckbox; if (parentUserCheckbox != null && ((SyncField)(object)parentUserCheckbox.State).Value) { UserRoot obj6 = CS$<>8__locals16.root; if (obj6 != null) { ((Component)obj6).Slot.SetParent(((Component)((Worker)CS$<>8__locals16.CS$<>8__locals1.user).World.LocalUser.Root).Slot.Parent, true); } } ((SyncField)(object)CS$<>8__locals16.charControl.LinearDamping).Value = CS$<>8__locals16.oldval; }); } [AsyncStateMachine(typeof(<b__2>d))] internal System.Threading.Tasks.Task b__2() { //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) <b__2>d <b__2>d = default(<b__2>d); <b__2>d.<>t__builder = AsyncTaskMethodBuilder.Create(); <b__2>d.<>4__this = this; <b__2>d.<>1__state = -1; ((AsyncTaskMethodBuilder)(ref <b__2>d.<>t__builder)).Start<<b__2>d>(ref <b__2>d); return ((AsyncTaskMethodBuilder)(ref <b__2>d.<>t__builder)).Task; } } [CompilerGenerated] private sealed class <>c__DisplayClass14_1 { public UserRoot root; public CharacterController charControl; public float oldval; public <>c__DisplayClass14_0 CS$<>8__locals1; internal void b__6() { //IL_0026: Unknown result type (might be due to invalid IL or missing references) UserRoot obj = root; if (obj != null) { obj.JumpToPoint(((Worker)CS$<>8__locals1.user).World.LocalUser.Root.HeadPosition, 1.5f); } Checkbox? parentUserCheckbox = CS$<>8__locals1.extraData.ParentUserCheckbox; if (parentUserCheckbox != null && ((SyncField)(object)parentUserCheckbox.State).Value) { UserRoot obj2 = root; if (obj2 != null) { ((Component)obj2).Slot.SetParent(((Component)((Worker)CS$<>8__locals1.user).World.LocalUser.Root).Slot.Parent, true); } } ((SyncField)(object)charControl.LinearDamping).Value = oldval; } } private const string headless = "headless"; private const string headlessSprite = ""; private const string screen = "screen"; private const string screenSprite = ""; private const string vr = "vr"; private const string vrSprite = ""; private const string muteSprite = ""; private const string whisperSprite = ""; private const string normalSprite = ""; private const string shoutSprite = ""; private const string broadcastSprite = ""; private static readonly colorX HostColor = new colorX(1f, 0.678f, 0.169f, 1f, (ColorProfile)1); private static colorX? _initialColor; private static readonly ConditionalWeakTable controllerExtraData = new ConditionalWeakTable(); [HarmonyPrefix] [HarmonyPatch("Create")] private static bool CreatePrefix(out SessionUserController __result, User user, UIBuilder ui) { //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: 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_014f: Unknown result type (might be due to invalid IL or missing references) //IL_0285: Unknown result type (might be due to invalid IL or missing references) //IL_028a: Unknown result type (might be due to invalid IL or missing references) //IL_02a5: Unknown result type (might be due to invalid IL or missing references) //IL_02aa: Unknown result type (might be due to invalid IL or missing references) //IL_01d7: Unknown result type (might be due to invalid IL or missing references) //IL_01dc: Unknown result type (might be due to invalid IL or missing references) //IL_0218: Unknown result type (might be due to invalid IL or missing references) //IL_021d: Unknown result type (might be due to invalid IL or missing references) //IL_0226: Unknown result type (might be due to invalid IL or missing references) //IL_02cd: 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_02d4: Unknown result type (might be due to invalid IL or missing references) //IL_030e: Unknown result type (might be due to invalid IL or missing references) //IL_034b: Unknown result type (might be due to invalid IL or missing references) //IL_05bc: Unknown result type (might be due to invalid IL or missing references) //IL_05f3: Unknown result type (might be due to invalid IL or missing references) //IL_0603: Unknown result type (might be due to invalid IL or missing references) //IL_0613: Unknown result type (might be due to invalid IL or missing references) //IL_0622: Unknown result type (might be due to invalid IL or missing references) //IL_0517: Unknown result type (might be due to invalid IL or missing references) //IL_051c: Unknown result type (might be due to invalid IL or missing references) //IL_06fb: Unknown result type (might be due to invalid IL or missing references) //IL_0700: Unknown result type (might be due to invalid IL or missing references) //IL_070f: Unknown result type (might be due to invalid IL or missing references) //IL_0719: Expected O, but got Unknown //IL_0759: Unknown result type (might be due to invalid IL or missing references) //IL_075e: Unknown result type (might be due to invalid IL or missing references) //IL_077d: Unknown result type (might be due to invalid IL or missing references) //IL_0787: Expected O, but got Unknown //IL_0658: Unknown result type (might be due to invalid IL or missing references) //IL_065d: Unknown result type (might be due to invalid IL or missing references) //IL_0679: Unknown result type (might be due to invalid IL or missing references) //IL_068c: Unknown result type (might be due to invalid IL or missing references) //IL_0696: Expected O, but got Unknown //IL_079f: Unknown result type (might be due to invalid IL or missing references) //IL_07a4: Unknown result type (might be due to invalid IL or missing references) //IL_07c3: Unknown result type (might be due to invalid IL or missing references) //IL_07cd: Expected O, but got Unknown //IL_08ca: Unknown result type (might be due to invalid IL or missing references) //IL_08cf: Unknown result type (might be due to invalid IL or missing references) //IL_08de: Unknown result type (might be due to invalid IL or missing references) //IL_08e8: Expected O, but got Unknown //IL_0911: Unknown result type (might be due to invalid IL or missing references) //IL_0916: Unknown result type (might be due to invalid IL or missing references) //IL_0925: Unknown result type (might be due to invalid IL or missing references) //IL_092f: Expected O, but got Unknown //IL_0958: Unknown result type (might be due to invalid IL or missing references) //IL_095d: Unknown result type (might be due to invalid IL or missing references) //IL_096c: Unknown result type (might be due to invalid IL or missing references) //IL_0976: Expected O, but got Unknown //IL_098f: Unknown result type (might be due to invalid IL or missing references) //IL_0994: Unknown result type (might be due to invalid IL or missing references) //IL_09a3: Unknown result type (might be due to invalid IL or missing references) //IL_09ad: Expected O, but got Unknown //IL_0810: Unknown result type (might be due to invalid IL or missing references) //IL_0815: Unknown result type (might be due to invalid IL or missing references) //IL_09db: Unknown result type (might be due to invalid IL or missing references) //IL_09fd: Unknown result type (might be due to invalid IL or missing references) //IL_0a03: Invalid comparison between Unknown and I4 //IL_088d: Unknown result type (might be due to invalid IL or missing references) //IL_0897: Expected O, but got Unknown //IL_0a1b: Unknown result type (might be due to invalid IL or missing references) //IL_0a21: Invalid comparison between Unknown and I4 <>c__DisplayClass14_0 CS$<>8__locals87 = new <>c__DisplayClass14_0(); CS$<>8__locals87.user = user; ui.Style.MinHeight = SessionUserController.HEIGHT + 8; HorizontalLayout val = ui.HorizontalLayout(4f, 4f, (Alignment?)(Alignment)4); ((SyncField)(object)((DirectionalLayout)val).ForceExpandHeight).Value = false; ((SyncField)(object)((DirectionalLayout)val).ForceExpandWidth).Value = false; CS$<>8__locals87.controller = ((ContainerWorker)(object)((Component)val).Slot).AttachComponent(true, (Action)null); CS$<>8__locals87.controller._cachedUserName = CS$<>8__locals87.user.UserName; CS$<>8__locals87.controller.TargetUser = CS$<>8__locals87.user; CS$<>8__locals87.extraData = controllerExtraData.GetOrCreateValue(CS$<>8__locals87.controller); FontCollection badgeFontCollection = CS$<>8__locals87.controller.GetBadgeFontCollection(); CS$<>8__locals87.extraData.RowBackgroundImage = ((ContainerWorker)(object)((Component)val).Slot).AttachComponent(true, (Action)null); ((SyncField)(object)CS$<>8__locals87.extraData.RowBackgroundImage.Tint).Value = (((((Component)val).Slot.ChildIndex & 1) == 0) ? SessionTabOverhaul.FirstRowColor.Value : SessionTabOverhaul.SecondRowColor.Value); LocaleString val2; if (SessionTabOverhaul.ShowFPSOrQueuedMessages.Value) { ui.Style.MinHeight = SessionUserController.HEIGHT; ui.Style.MinWidth = 2.5f * (float)SessionUserController.HEIGHT; ui.Panel(); SessionUserControllerExtraData sessionUserControllerExtraData = CS$<>8__locals87.extraData; val2 = LocaleString.op_Implicit(GetUserFPSOrQueuedMessages(CS$<>8__locals87.user)); sessionUserControllerExtraData.FPSOrQueuedMessagesLabel = ui.Text(ref val2, true, (Alignment?)(Alignment)4, true, (string)null); ((SyncRef>)(object)CS$<>8__locals87.extraData.FPSOrQueuedMessagesLabel.Font).Target = (IAssetProvider)(object)badgeFontCollection; ui.NestOut(); } colorX val3; if (SessionTabOverhaul.ShowDeviceLabel.Value) { ui.Style.MinWidth = 1.5f * (float)SessionUserController.HEIGHT; ui.Style.MinHeight = 0.8f * (float)SessionUserController.HEIGHT; ui.Panel(); SessionUserControllerExtraData sessionUserControllerExtraData2 = CS$<>8__locals87.extraData; val2 = LocaleString.op_Implicit(GetUserDevice(CS$<>8__locals87.user)); sessionUserControllerExtraData2.DeviceLabel = ui.Text(ref val2, true, (Alignment?)(Alignment)4, true, (string)null); ((SyncRef>)(object)CS$<>8__locals87.extraData.DeviceLabel.Font).Target = (IAssetProvider)(object)badgeFontCollection; Sync color = CS$<>8__locals87.extraData.DeviceLabel.Color; val3 = colorX.Red; ((SyncField)(object)color).Value = ((colorX)(ref val3)).SetValue(0.7f); ui.NestOut(); } ui.Style.MinWidth = -1f; ui.Style.FlexibleWidth = 1f; ui.Style.MinHeight = SessionUserController.HEIGHT; ui.Panel(); SyncRef name = CS$<>8__locals87.controller._name; val2 = LocaleString.op_Implicit(CS$<>8__locals87.controller._cachedUserName); name.Target = ui.Text(ref val2, true, (Alignment?)(Alignment)3, true, (string)null); val3 = _initialColor.GetValueOrDefault(); if (!_initialColor.HasValue) { val3 = ((SyncField)(object)CS$<>8__locals87.controller._name.Target.Color).Value; _initialColor = val3; } if (CS$<>8__locals87.user.IsHost && SessionTabOverhaul.ColorHostName.Value) { ((SyncField)(object)CS$<>8__locals87.controller._name.Target.Color).Value = HostColor; } if (CS$<>8__locals87.user.IsLocalUser && SessionTabOverhaul.ColorLocalUserName.Value) { ((SyncField)(object)CS$<>8__locals87.controller._name.Target.Color).Value = SessionTabOverhaul.LocalUserColor.Value; } if (CS$<>8__locals87.user.UserID != null) { UIExtensions.SetupAction(((ContainerWorker)(object)((Component)CS$<>8__locals87.controller._name.Target).Slot).AttachComponent