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.Versioning; using BOMBANANA.Library.Reflection; using BepInEx; using BepInEx.Core.Logging.Interpolation; using BepInEx.Logging; using BepInEx.Unity.IL2CPP; using HarmonyLib; using Il2CppInterop.Runtime; using Il2CppInterop.Runtime.InteropTypes.Arrays; using Microsoft.CodeAnalysis; using Steamworks; using Unity.Netcode; using Unity.Netcode.Transports.UTP; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")] [assembly: AssemblyCompany("SteamBypass-1.0.0")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("SteamBypass-1.0.0")] [assembly: AssemblyTitle("SteamBypass-1.0.0")] [assembly: AssemblyVersion("1.0.0.0")] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace SteamBypass { [BepInPlugin("steambypass", "Steam Bypass", "1.0.0")] public sealed class SteamBypassMod : BasePlugin { public static ManualLogSource LogSource; internal static bool Verbose; public override void Load() { //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Expected O, but got Unknown //IL_061a: Unknown result type (might be due to invalid IL or missing references) //IL_0621: Expected O, but got Unknown //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Expected O, but got Unknown LogSource = ((BasePlugin)this).Log; Verbose = Environment.GetEnvironmentVariable("STEAMBYPASS_VERBOSE") == "1"; ManualLogSource logSource = LogSource; bool flag = default(bool); BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(32, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("SteamBypass: loading... verbose="); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(Verbose); } logSource.LogInfo(val); Harmony harmony = new Harmony("steambypass"); int num = 0; num += PatchMethod(harmony, "SteamManager", "Awake", 0, "AwakePrefix", "skip SteamClient.Init"); num += PatchMethod(harmony, "SteamManager", "Update", 0, "UpdatePrefix", "skip RunCallbacks"); num += PatchMethod(harmony, "SteamManager", "OnApplicationQuit", 0, "OnApplicationQuitPrefix", "skip SteamClient.Cleanup"); num += PatchMethod(harmony, "GameNetworkManager", "IsSteamClientReady", 0, "IsSteamClientReadyPrefix", "always true"); num += PatchMethod(harmony, "GameNetworkManager", "IsSteamClientReadyAndOnline", 0, "IsSteamClientReadyAndOnlinePrefix", "always true"); num += PatchMethod(harmony, "GameNetworkManager", "TryGetLocalSteamId", 1, "TryGetLocalSteamIdPrefix", "force fake local SteamId"); num += PatchMethod(harmony, "GameNetworkManager", "GetLocalSteamName", 0, "GetLocalSteamNamePrefix", "force fake local Steam name"); num += PatchMethod(harmony, "LobbyHandler", "CanLobbyBeStarted", 0, "CanLobbyBeStartedPrefix", "always true (host-authoritative)"); num += PatchMethod(harmony, "LobbyHandler", "CheckPlayersState", 1, "CheckPlayersStatePrefix", "always true (mission-start gate)"); num += PatchMethod(harmony, "LobbySubUI", "IsLobbyReadyForSetup", 1, "IsLobbyReadyForSetupPrefix", "always true (client UI gate)"); num += PatchMethod(harmony, "GameNetworkManager", "IsRelayNetworkReady", 0, "IsRelayNetworkReadyPrefix", "true when Steam faked (host/lobby-entry relay gate)"); num += PatchMethod(harmony, "GameNetworkManager", "IsRelayNetworkUnavailable", 0, "IsRelayNetworkUnavailablePrefix", "false when Steam faked (host/lobby-entry relay gate)"); if (Verbose) { num += PatchMethod(harmony, "GameNetworkManager", "IsRelayNetworkReady", 0, "IsRelayNetworkReadyPostfix", "DEBUG: IsRelayNetworkReady result"); } if (Verbose) { num += PatchMethod(harmony, "GameNetworkManager", "IsRelayNetworkUnavailable", 0, "IsRelayNetworkUnavailablePostfix", "DEBUG: IsRelayNetworkUnavailable result"); } num += PatchMethod(harmony, "GameNetworkManager", "CleanupFailedHostStartup", 0, "CleanupFailedHostStartupPrefix", "DEBUG: host startup failed marker"); num += PatchMethod(harmony, "GameNetworkManager", "LogBugOnce", 2, "LogBugOncePrefix", "DEBUG: network error reporter"); if (Verbose) { num += PatchMethod(harmony, "MenuSubUI", "Button_HostAsync", 0, "ButtonHostAsyncPrefix", "DEBUG: Play clicked"); num += PatchMethod(harmony, "GameNetworkManager", "IsSteamClientReadyAndOnline", 0, "IsSteamClientReadyAndOnlinePostfix", "DEBUG: gate result"); } num += PatchMethod(harmony, "GameManager", "HostLobby", 0, "HostLobbyForcePrefix", "DEBUG: force Host() (bypass inlined CanStartHost gate)"); num += PatchMethod(harmony, "MenuLoadingUI", "ShowLoadingOverlay", 1, "MenuLoadingShowOverlayPostfix", "hide endless loading when offline host live"); num += PatchMethod(harmony, "GameNetworkManager", "get_CanStartHost", 0, "CanStartHostPrefix", "force true (host gate — property getter, inlined/unused)"); if (Verbose) { num += PatchMethod(harmony, "GameNetworkManager", "IsAlreadyInLobby", 1, "IsAlreadyInLobbyPrefix", "DEBUG: IsAlreadyInLobby gate"); } if (Verbose) { num += PatchMethod(harmony, "GameNetworkManager", "PrepareForHostAsync", 0, "PrepareForHostAsyncPrefix", "DEBUG: PrepareForHostAsync entered"); } if (Verbose) { num += PatchMethod(harmony, "NetworkManager", "StartHost", 0, "StartHostPrefix", "DEBUG: StartHost entered"); } if (Verbose) { num += PatchMethod(harmony, "NetworkManager", "StartHost", 0, "StartHostPostfix", "DEBUG: StartHost result"); } if (Verbose) { num += PatchMethod(harmony, "NetworkManager", "StartServer", 0, "StartServerPostfix", "DEBUG: StartServer result + transport used"); } if (Verbose) { num += PatchMethod(harmony, "UnityTransport", "StartServer", 0, "UnityTransportStartServerPrefix", "NETCODE: UTP.StartServer entered + state DIAG"); num += PatchMethodPostfix(harmony, "UnityTransport", "StartServer", 0, "UnityTransportStartServerPostfix", "NETCODE: UTP.StartServer result"); num += PatchMethodFinalizer(harmony, "UnityTransport", "StartServer", 0, "UnityTransportStartServerFinalizer", "NETCODE: UTP.StartServer exception"); num += PatchMethodPostfix(harmony, "NetworkManager", "CanStart", 1, "CanStartPostfix", "NETCODE: CanStart gate result"); num += PatchMethod(harmony, "NetworkManager", "Initialize", 1, "InitializePrefix", "NETCODE: Initialize(server) entered + transport"); } num += PatchMethodPostfix(harmony, "NetworkManager", "HostServerInitialize", 0, "HostServerInitializePostfix", "NETCODE: HostServerInitialize done (assign PlayerPrefab)"); num += PatchMethodPostfix(harmony, "NetworkManager", "Initialize", 1, "InitializePostfix", "NETCODE: Initialize(server) postfix (assign PlayerPrefab)"); num += PatchMethod(harmony, "NetworkManager", "Shutdown", 0, "ShutdownPrefix", "DIAG21: log every NGO shutdown + stack"); if (Verbose) { num += PatchMethod(harmony, "GameNetworkManager", "Host", 0, "HostPrefix", "DEBUG: Host entered"); } if (Verbose) { num += PatchMethod(harmony, "GameNetworkManager", "Host", 0, "HostPostfix", "DEBUG: Host finished"); } if (Verbose) { num += PatchMethod(harmony, "GameNetworkManager", "EnsureRelayNetworkAccessUsableAsync", 1, "EnsureRelayNetworkAccessUsableAsyncPrefix", "DEBUG: relay gate entered"); } num += PatchMethod(harmony, "LobbySubUI", "ApplyLocalPlayerControls", 0, "ApplyLocalPlayerControlsPostfix", "force startButton enabled"); num += PatchMethod(harmony, "GameNetworkManager", "ConfigureLobbyMetadata", 1, "ConfigureLobbyMetadataPrefix", "no-op (offline local host, no Steam lobby)"); num += PatchMethod(harmony, "LobbyHandler", "Create", 0, "LobbyHandlerCreatePrefix", "DEBUG: LobbyHandler.Create entered (full chain, builds lobby UI)"); num += PatchMethod(harmony, "GameNetworkManager", "JoinHostPlayer", 0, "JoinHostPlayerPrefix", "no-op (offline local host, no Steam lobby)"); num += PatchMethodPostfix(harmony, "LobbySubUI", "ApplyHostOnlyButtonStates", 0, "ApplyHostOnlyButtonStatesPostfix", "LEVELS: raise demo level cap to all 7"); num += PatchMethod(harmony, "LobbyHandler", "SetSelectedLevelServerRpc", 2, "SetSelectedLevelServerRpcPrefix", "LEVELS: widen level index range 0..6"); LogSource.LogInfo((object)((num == 0) ? "SteamBypass: no hooks patched" : $"SteamBypass: {num} hooks patched")); try { SteamPatches.EnsurePlayerPrefabAssigned(); } catch (Exception ex) { ManualLogSource logSource2 = LogSource; BepInExWarningLogInterpolatedStringHandler val2 = new BepInExWarningLogInterpolatedStringHandler(49, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("SteamBypass: EnsurePlayerPrefabAssigned() threw: "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(ex.Message); } logSource2.LogWarning(val2); } } private static int PatchMethod(Harmony harmony, string typeName, string methodName, int paramCount, string prefixName, string description) { //IL_020e: Unknown result type (might be due to invalid IL or missing references) //IL_0215: Expected O, but got Unknown //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Expected O, but got Unknown //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Expected O, but got Unknown //IL_0184: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Expected O, but got Unknown //IL_019d: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Expected O, but got Unknown //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Expected O, but got Unknown bool flag = default(bool); try { Type type = TypeResolver.Default.Resolve(typeName); if (type == null) { ManualLogSource logSource = LogSource; BepInExWarningLogInterpolatedStringHandler val = new BepInExWarningLogInterpolatedStringHandler(42, 2, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("SteamBypass: type '"); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(typeName); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("' not found — "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(methodName); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" skipped."); } logSource.LogWarning(val); return 0; } MethodInfo methodInfo = type.GetMethods(BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic).FirstOrDefault((MethodInfo m) => m.Name == methodName && m.GetParameters().Length == paramCount); if (methodInfo == null) { ManualLogSource logSource2 = LogSource; BepInExWarningLogInterpolatedStringHandler val = new BepInExWarningLogInterpolatedStringHandler(44, 3, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("SteamBypass: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(typeName); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("."); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(methodName); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("("); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(paramCount); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" params) not found — skipped."); } logSource2.LogWarning(val); return 0; } MethodInfo method = typeof(SteamPatches).GetMethod(prefixName, BindingFlags.Static | BindingFlags.Public); if (method == null) { ManualLogSource logSource3 = LogSource; BepInExWarningLogInterpolatedStringHandler val = new BepInExWarningLogInterpolatedStringHandler(40, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("SteamBypass: prefix method '"); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(prefixName); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("' not found."); } logSource3.LogWarning(val); return 0; } harmony.Patch((MethodBase)methodInfo, new HarmonyMethod(method), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); ManualLogSource logSource4 = LogSource; BepInExInfoLogInterpolatedStringHandler val2 = new BepInExInfoLogInterpolatedStringHandler(26, 3, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("SteamBypass: patched "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(typeName); ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("."); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(methodInfo.Name); ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral(" ("); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(description); ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral(")."); } logSource4.LogInfo(val2); return 1; } catch (Exception ex) { ManualLogSource logSource5 = LogSource; BepInExErrorLogInterpolatedStringHandler val3 = new BepInExErrorLogInterpolatedStringHandler(32, 3, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val3).AppendLiteral("SteamBypass: failed to patch "); ((BepInExLogInterpolatedStringHandler)val3).AppendFormatted(typeName); ((BepInExLogInterpolatedStringHandler)val3).AppendLiteral("."); ((BepInExLogInterpolatedStringHandler)val3).AppendFormatted(methodName); ((BepInExLogInterpolatedStringHandler)val3).AppendLiteral(": "); ((BepInExLogInterpolatedStringHandler)val3).AppendFormatted(ex); } logSource5.LogError(val3); return 0; } } private static int PatchMethodPostfix(Harmony harmony, string typeName, string methodName, int paramCount, string postfixName, string description) { //IL_020e: Unknown result type (might be due to invalid IL or missing references) //IL_0215: Expected O, but got Unknown //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Expected O, but got Unknown //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Expected O, but got Unknown //IL_0185: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Expected O, but got Unknown //IL_019d: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Expected O, but got Unknown //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Expected O, but got Unknown bool flag = default(bool); try { Type type = TypeResolver.Default.Resolve(typeName); if (type == null) { ManualLogSource logSource = LogSource; BepInExWarningLogInterpolatedStringHandler val = new BepInExWarningLogInterpolatedStringHandler(50, 2, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("SteamBypass: type '"); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(typeName); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("' not found — "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(methodName); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" postfix skipped."); } logSource.LogWarning(val); return 0; } MethodInfo methodInfo = type.GetMethods(BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic).FirstOrDefault((MethodInfo m) => m.Name == methodName && m.GetParameters().Length == paramCount); if (methodInfo == null) { ManualLogSource logSource2 = LogSource; BepInExWarningLogInterpolatedStringHandler val = new BepInExWarningLogInterpolatedStringHandler(52, 3, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("SteamBypass: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(typeName); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("."); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(methodName); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("("); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(paramCount); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" params) not found — postfix skipped."); } logSource2.LogWarning(val); return 0; } MethodInfo method = typeof(SteamPatches).GetMethod(postfixName, BindingFlags.Static | BindingFlags.Public); if (method == null) { ManualLogSource logSource3 = LogSource; BepInExWarningLogInterpolatedStringHandler val = new BepInExWarningLogInterpolatedStringHandler(41, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("SteamBypass: postfix method '"); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(postfixName); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("' not found."); } logSource3.LogWarning(val); return 0; } harmony.Patch((MethodBase)methodInfo, (HarmonyMethod)null, new HarmonyMethod(method), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); ManualLogSource logSource4 = LogSource; BepInExInfoLogInterpolatedStringHandler val2 = new BepInExInfoLogInterpolatedStringHandler(34, 3, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("SteamBypass: patched "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(typeName); ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("."); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(methodInfo.Name); ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral(" postfix ("); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(description); ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral(")."); } logSource4.LogInfo(val2); return 1; } catch (Exception ex) { ManualLogSource logSource5 = LogSource; BepInExErrorLogInterpolatedStringHandler val3 = new BepInExErrorLogInterpolatedStringHandler(40, 3, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val3).AppendLiteral("SteamBypass: failed to patch "); ((BepInExLogInterpolatedStringHandler)val3).AppendFormatted(typeName); ((BepInExLogInterpolatedStringHandler)val3).AppendLiteral("."); ((BepInExLogInterpolatedStringHandler)val3).AppendFormatted(methodName); ((BepInExLogInterpolatedStringHandler)val3).AppendLiteral(" postfix: "); ((BepInExLogInterpolatedStringHandler)val3).AppendFormatted(ex); } logSource5.LogError(val3); return 0; } } private static int PatchMethodFinalizer(Harmony harmony, string typeName, string methodName, int paramCount, string finalizerName, string description) { //IL_020e: Unknown result type (might be due to invalid IL or missing references) //IL_0215: Expected O, but got Unknown //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Expected O, but got Unknown //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Expected O, but got Unknown //IL_0187: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Expected O, but got Unknown //IL_019d: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Expected O, but got Unknown //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Expected O, but got Unknown bool flag = default(bool); try { Type type = TypeResolver.Default.Resolve(typeName); if (type == null) { ManualLogSource logSource = LogSource; BepInExWarningLogInterpolatedStringHandler val = new BepInExWarningLogInterpolatedStringHandler(52, 2, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("SteamBypass: type '"); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(typeName); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("' not found — "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(methodName); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" finalizer skipped."); } logSource.LogWarning(val); return 0; } MethodInfo methodInfo = type.GetMethods(BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic).FirstOrDefault((MethodInfo m) => m.Name == methodName && m.GetParameters().Length == paramCount); if (methodInfo == null) { ManualLogSource logSource2 = LogSource; BepInExWarningLogInterpolatedStringHandler val = new BepInExWarningLogInterpolatedStringHandler(54, 3, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("SteamBypass: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(typeName); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("."); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(methodName); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("("); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(paramCount); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" params) not found — finalizer skipped."); } logSource2.LogWarning(val); return 0; } MethodInfo method = typeof(SteamPatches).GetMethod(finalizerName, BindingFlags.Static | BindingFlags.Public); if (method == null) { ManualLogSource logSource3 = LogSource; BepInExWarningLogInterpolatedStringHandler val = new BepInExWarningLogInterpolatedStringHandler(43, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("SteamBypass: finalizer method '"); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(finalizerName); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("' not found."); } logSource3.LogWarning(val); return 0; } harmony.Patch((MethodBase)methodInfo, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, new HarmonyMethod(method), (HarmonyMethod)null); ManualLogSource logSource4 = LogSource; BepInExInfoLogInterpolatedStringHandler val2 = new BepInExInfoLogInterpolatedStringHandler(36, 3, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("SteamBypass: patched "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(typeName); ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("."); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(methodInfo.Name); ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral(" finalizer ("); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(description); ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral(")."); } logSource4.LogInfo(val2); return 1; } catch (Exception ex) { ManualLogSource logSource5 = LogSource; BepInExErrorLogInterpolatedStringHandler val3 = new BepInExErrorLogInterpolatedStringHandler(42, 3, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val3).AppendLiteral("SteamBypass: failed to patch "); ((BepInExLogInterpolatedStringHandler)val3).AppendFormatted(typeName); ((BepInExLogInterpolatedStringHandler)val3).AppendLiteral("."); ((BepInExLogInterpolatedStringHandler)val3).AppendFormatted(methodName); ((BepInExLogInterpolatedStringHandler)val3).AppendLiteral(" finalizer: "); ((BepInExLogInterpolatedStringHandler)val3).AppendFormatted(ex); } logSource5.LogError(val3); return 0; } } } public static class SteamPatches { internal static bool _steamSuccessfullyInitialized; internal static object _installedTransport; internal const ulong FakeSteamId = 76561197960265728uL; private static bool _playerPrefabRetryStarted = false; private static int _playerPrefabRetryAttemptsLeft = 0; private static int _playerPrefabRetryFrameCounter = 0; private const int PlayerPrefabRetryFramesBetweenAttempts = 15; private static readonly List<(int framesLeft, Action act)> _mainThreadDelayed = new List<(int, Action)>(); private static bool _uiDrivenThisSession = false; private static Type _nmTypeCache; private static PropertyInfo _nmSingletonCache; private static PropertyInfo _nmListeningCache; internal const int MaxLevelIndex = 6; public static bool AwakePrefix(object __instance) { //IL_018c: Unknown result type (might be due to invalid IL or missing references) //IL_0193: Expected O, but got Unknown try { Type type = __instance.GetType(); uint num = 0u; PropertyInfo property = type.GetProperty("AppId", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); if (property != null) { num = (uint)property.GetValue(__instance); } if (InitAndSetup(480u)) { SteamBypassMod.LogSource.LogInfo((object)"SteamBypass: SteamClient.Init(480/Spacewar) succeeded — using real Steam relay."); return false; } if (num != 0 && InitAndSetup(num)) { SteamBypassMod.LogSource.LogInfo((object)"SteamBypass: SteamClient.Init(real appid) succeeded — using real Steam."); return false; } _steamSuccessfullyInitialized = false; SetField(type, __instance, "IsSteamReady", true); SetField(type, __instance, "hasSteamInitialized", true); SetField(type, __instance, "restartThroughSteamPending", false); SetField(type, __instance, "restartNotificationShown", true); SetField(type, __instance, "steamInitFailedNotificationPending", false); SetField(type, __instance, "steamInitFailedNotificationShown", true); SetStaticField(type, "_Steam_k__BackingField", __instance); FireOnSteamInitialize(type, __instance); SteamBypassMod.LogSource.LogInfo((object)"SteamBypass: SteamClient.Init failed (Spacewar + real) — faking ready state."); return false; bool InitAndSetup(uint id) { //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Expected O, but got Unknown try { SteamClient.Init(id, false); _steamSuccessfullyInitialized = true; SetField(type, __instance, "IsSteamReady", true); SetField(type, __instance, "hasSteamInitialized", true); SetStaticField(type, "_Steam_k__BackingField", __instance); FireOnSteamInitialize(type, __instance); return true; } catch (Exception ex2) { ManualLogSource logSource2 = SteamBypassMod.LogSource; bool flag2 = default(bool); BepInExWarningLogInterpolatedStringHandler val2 = new BepInExWarningLogInterpolatedStringHandler(42, 3, ref flag2); if (flag2) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("SteamBypass: SteamClient.Init("); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(id); ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral(") failed: "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(ex2.GetType().Name); ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral(": "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(ex2.Message); } logSource2.LogWarning(val2); return false; } } } catch (Exception ex) { ManualLogSource logSource = SteamBypassMod.LogSource; bool flag = default(bool); BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(32, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("SteamBypass: AwakePrefix error: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(ex); } logSource.LogError(val); return true; } } public static bool UpdatePrefix() { if (!_steamSuccessfullyInitialized && _mainThreadDelayed.Count == 0 && !_playerPrefabRetryStarted) { return false; } try { ProcessMainThreadScheduledActions(); } catch { } return _steamSuccessfullyInitialized; } public static bool OnApplicationQuitPrefix() { return _steamSuccessfullyInitialized; } public static bool IsSteamClientReadyPrefix(ref bool __result) { if (_steamSuccessfullyInitialized) { return true; } __result = true; return false; } public static bool IsSteamClientReadyAndOnlinePrefix(ref bool __result) { if (_steamSuccessfullyInitialized) { return true; } __result = true; return false; } public static bool EnsurePlayerPrefabAssigned() { //IL_01c3: Unknown result type (might be due to invalid IL or missing references) //IL_01ca: Expected O, but got Unknown //IL_0221: Unknown result type (might be due to invalid IL or missing references) //IL_0228: Expected O, but got Unknown //IL_026f: Unknown result type (might be due to invalid IL or missing references) //IL_0276: Expected O, but got Unknown bool flag = default(bool); try { Type type = TypeResolver.Default.Resolve("NetworkManager"); if (type == null) { SteamBypassMod.LogSource.LogInfo((object)"[EnsurePlayerPrefabAssigned] NetworkManager type not found yet."); return false; } object obj = type.GetProperty("Singleton", BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic)?.GetValue(null); if (obj == null) { SteamBypassMod.LogSource.LogInfo((object)"[EnsurePlayerPrefabAssigned] NetworkManager.Singleton is null (not initialized yet)."); return false; } object obj2 = obj.GetType().GetProperty("NetworkConfig", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic)?.GetValue(obj); if (obj2 == null) { SteamBypassMod.LogSource.LogInfo((object)"[EnsurePlayerPrefabAssigned] NetworkConfig is null."); return false; } PropertyInfo property = obj2.GetType().GetProperty("PlayerPrefab", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); if (property == null) { SteamBypassMod.LogSource.LogInfo((object)"[EnsurePlayerPrefabAssigned] PlayerPrefab property not found."); return false; } if (property.GetValue(obj2) != null) { SteamBypassMod.LogSource.LogInfo((object)"[EnsurePlayerPrefabAssigned] PlayerPrefab already set."); return true; } SteamBypassMod.LogSource.LogInfo((object)"[EnsurePlayerPrefabAssigned] PlayerPrefab is NULL — attempting to create fallback."); Type type2 = Type.GetType("UnityEngine.GameObject, UnityEngine.CoreModule") ?? Type.GetType("UnityEngine.GameObject"); object obj3 = null; if (type2 != null) { try { obj3 = Activator.CreateInstance(type2, "PlayerPrefab-Auto"); MethodInfo methodInfo = type2.GetMethods(BindingFlags.Instance | BindingFlags.Public).FirstOrDefault((MethodInfo m) => m.Name == "AddComponent" && m.IsGenericMethodDefinition); Type type3 = TypeResolver.Default.Resolve("NetworkObject"); if (methodInfo != null && type3 != null && obj3 != null) { methodInfo.MakeGenericMethod(type3).Invoke(obj3, null); } } catch (Exception ex) { ManualLogSource logSource = SteamBypassMod.LogSource; BepInExWarningLogInterpolatedStringHandler val = new BepInExWarningLogInterpolatedStringHandler(66, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("[EnsurePlayerPrefabAssigned] fallback GameObject creation failed: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(ex.Message); } logSource.LogWarning(val); } } if (obj3 != null) { try { property.SetValue(obj2, obj3); SteamBypassMod.LogSource.LogInfo((object)"[EnsurePlayerPrefabAssigned] PlayerPrefab fallback assigned to NetworkConfig."); return true; } catch (Exception ex2) { ManualLogSource logSource2 = SteamBypassMod.LogSource; BepInExWarningLogInterpolatedStringHandler val = new BepInExWarningLogInterpolatedStringHandler(60, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("[EnsurePlayerPrefabAssigned] failed to assign PlayerPrefab: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(ex2.Message); } logSource2.LogWarning(val); } } else { SteamBypassMod.LogSource.LogWarning((object)"[EnsurePlayerPrefabAssigned] Could not create fallback GameObject."); } return false; } catch (Exception ex3) { ManualLogSource logSource3 = SteamBypassMod.LogSource; BepInExErrorLogInterpolatedStringHandler val2 = new BepInExErrorLogInterpolatedStringHandler(36, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("[EnsurePlayerPrefabAssigned] error: "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(ex3); } logSource3.LogError(val2); return false; } } private static void StartPlayerPrefabRetryBackground() { if (!_playerPrefabRetryStarted) { _playerPrefabRetryStarted = true; _playerPrefabRetryAttemptsLeft = 20; _playerPrefabRetryFrameCounter = 0; SteamBypassMod.LogSource.LogInfo((object)"[EnsurePlayerPrefabAssigned] PlayerPrefab retry scheduled on main thread."); } } internal static void ScheduleOnMainThread(int framesDelay, Action act) { if (act == null) { return; } lock (_mainThreadDelayed) { _mainThreadDelayed.Add((framesDelay, act)); } } internal static string ReadCount(object coll) { //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Expected O, but got Unknown if (coll == null) { return "NULL"; } try { if (coll is IEnumerable enumerable && !(coll is string)) { int num = 0; foreach (object item in enumerable) { _ = item; num++; if (num > 64) { break; } } return num.ToString(); } Type type = coll.GetType(); PropertyInfo property = type.GetProperty("Count", BindingFlags.Instance | BindingFlags.Public); if (property != null) { return property.GetValue(coll)?.ToString() ?? "?"; } ManualLogSource logSource = SteamBypassMod.LogSource; bool flag = default(bool); BepInExWarningLogInterpolatedStringHandler val = new BepInExWarningLogInterpolatedStringHandler(60, 3, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("[DIAG21] ReadCount: no count member on "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(type.Name); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("; props=["); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(string.Join(",", (from pp in type.GetProperties(BindingFlags.Instance | BindingFlags.Public) select pp.Name).Take(12))); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("] methods=["); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(string.Join(",", from mm in type.GetMethods(BindingFlags.Instance | BindingFlags.Public) where mm.Name.ToLower().Contains("count") select mm.Name)); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("]"); } logSource.LogWarning(val); return "?"; } catch (Exception ex) { return "err:" + ex.Message; } } internal static void DumpSessionState(string tag) { //IL_01eb: Unknown result type (might be due to invalid IL or missing references) //IL_01f2: Expected O, but got Unknown //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Expected O, but got Unknown bool flag = default(bool); try { string text = "?"; string text2 = "?"; string text3 = "?"; string text4 = "?"; string text5 = "?"; Type type = TypeResolver.Default.Resolve("NetworkManager"); object obj = type?.GetProperty("Singleton", BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic)?.GetValue(null); if (obj != null) { flag = ReadBool(type, "IsListening", obj); text = flag.ToString(); flag = ReadBool(type, "IsServer", obj); text2 = flag.ToString(); } object lobbyHandler = GetLobbyHandler(); if (lobbyHandler == null) { text3 = "NULL"; } else { text3 = (((Object)((lobbyHandler is Object) ? lobbyHandler : null) == (Object)null) ? "DESTROYED" : "alive"); try { text4 = ReadCount(lobbyHandler.GetType().GetField("Players", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic)?.GetValue(lobbyHandler)); } catch (Exception ex) { text4 = "err:" + ex.Message; } } try { Type type2 = TypeResolver.Default.Resolve("GameNetworkManager"); object obj2 = ResolveStaticMember(type2, "Singleton"); object obj3 = (type2?.GetField("PlayerStates", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic))?.GetValue(obj2); if (obj3 != null) { text5 = ReadCount(obj3); } } catch { } ManualLogSource logSource = SteamBypassMod.LogSource; BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(85, 6, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("[DIAG21] session@"); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(tag); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(": IsListening="); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(text); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" IsServer="); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(text2); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" Handler="); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(text3); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" Players.Count="); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(text4); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" PlayerStates.Count="); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(text5); } logSource.LogInfo(val); } catch (Exception ex2) { ManualLogSource logSource2 = SteamBypassMod.LogSource; BepInExWarningLogInterpolatedStringHandler val2 = new BepInExWarningLogInterpolatedStringHandler(24, 2, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("[DIAG21] dump failed @"); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(tag); ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral(": "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(ex2.Message); } logSource2.LogWarning(val2); } } private static bool ReadBool(Type t, string name, object inst) { try { PropertyInfo property = t.GetProperty(name, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); if (property != null) { return Convert.ToBoolean(property.GetValue(inst)); } FieldInfo field = t.GetField(name, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); if (field != null) { return Convert.ToBoolean(field.GetValue(inst)); } } catch { } return false; } internal static object ResolveStaticMember(Type t, string name) { try { return t?.GetProperty(name, BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic)?.GetValue(null) ?? t?.GetField(name, BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic)?.GetValue(null); } catch { return null; } } internal static void SessionWatcherTick(string tag) { //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Expected O, but got Unknown if (_uiDrivenThisSession) { return; } try { DumpSessionState("watcher@" + tag); if (!IsOfflineHostSessionLive()) { return; } if (GetLobbyHandler() == null) { SteamBypassMod.LogSource.LogInfo((object)"[OfflineHost] session live but no Handler — forcing registration now (Create+JoinHostPlayer)."); LegacyForceRegister(); if (GetLobbyHandler() == null) { return; } } _uiDrivenThisSession = true; DumpSessionState("at-settle"); SteamBypassMod.LogSource.LogInfo((object)"[OfflineHost] host session settled — driving UI once (hide overlay + State->Lobby)."); TryHideLoadingOverlay(); SwitchGameState("Lobby"); } catch (Exception ex) { ManualLogSource logSource = SteamBypassMod.LogSource; bool flag = default(bool); BepInExWarningLogInterpolatedStringHandler val = new BepInExWarningLogInterpolatedStringHandler(36, 2, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("[OfflineHost] watcher tick "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(tag); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" failed: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(ex.Message); } logSource.LogWarning(val); } } internal static void LegacyForceRegister() { //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Expected O, but got Unknown try { MethodInfo methodInfo = TypeResolver.Default.Resolve("LobbyHandler")?.GetMethod("Create", BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic); if (methodInfo != null && GetLobbyHandler() == null) { if (methodInfo.IsStatic) { methodInfo.Invoke(null, null); } else { object lobbyHandler = GetLobbyHandler(); if (lobbyHandler != null) { methodInfo.Invoke(lobbyHandler, null); } } } Type type = TypeResolver.Default.Resolve("GameNetworkManager"); object obj = ResolveStaticMember(type, "Singleton"); (type?.GetMethod("JoinHostPlayer", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic, null, Type.EmptyTypes, null))?.Invoke(obj, null); SteamBypassMod.LogSource.LogWarning((object)"[OfflineHost] LegacyForceRegister done (JoinHostPlayer invoked)."); } catch (Exception ex) { ManualLogSource logSource = SteamBypassMod.LogSource; bool flag = default(bool); BepInExWarningLogInterpolatedStringHandler val = new BepInExWarningLogInterpolatedStringHandler(42, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("[OfflineHost] LegacyForceRegister failed: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(ex.Message); } logSource.LogWarning(val); } } private static void ProcessMainThreadScheduledActions() { //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Expected O, but got Unknown //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Expected O, but got Unknown //IL_01a8: Unknown result type (might be due to invalid IL or missing references) //IL_01af: Expected O, but got Unknown bool flag2 = default(bool); try { if (_mainThreadDelayed.Count > 0) { lock (_mainThreadDelayed) { bool flag = default(bool); for (int num = _mainThreadDelayed.Count - 1; num >= 0; num--) { (int, Action) tuple = _mainThreadDelayed[num]; if (tuple.Item1 > 0) { _mainThreadDelayed[num] = (tuple.Item1 - 1, tuple.Item2); } else { _mainThreadDelayed.RemoveAt(num); try { tuple.Item2(); } catch (Exception ex) { ManualLogSource logSource = SteamBypassMod.LogSource; BepInExWarningLogInterpolatedStringHandler val = new BepInExWarningLogInterpolatedStringHandler(33, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("[MainThreadQueue] action failed: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(ex.Message); } logSource.LogWarning(val); } } } } } if (!_playerPrefabRetryStarted) { return; } if (_playerPrefabRetryAttemptsLeft <= 0) { _playerPrefabRetryStarted = false; return; } _playerPrefabRetryFrameCounter++; if (_playerPrefabRetryFrameCounter < 15) { return; } _playerPrefabRetryFrameCounter = 0; try { if (EnsurePlayerPrefabAssigned()) { SteamBypassMod.LogSource.LogInfo((object)"[EnsurePlayerPrefabAssigned] assignment succeeded on scheduled attempt."); _playerPrefabRetryAttemptsLeft = 0; _playerPrefabRetryStarted = false; return; } } catch (Exception ex2) { ManualLogSource logSource2 = SteamBypassMod.LogSource; BepInExWarningLogInterpolatedStringHandler val = new BepInExWarningLogInterpolatedStringHandler(54, 1, ref flag2); if (flag2) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("[EnsurePlayerPrefabAssigned] scheduled attempt threw: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(ex2.Message); } logSource2.LogWarning(val); } _playerPrefabRetryAttemptsLeft--; if (_playerPrefabRetryAttemptsLeft <= 0) { SteamBypassMod.LogSource.LogWarning((object)"[EnsurePlayerPrefabAssigned] scheduled retry attempts exhausted."); _playerPrefabRetryStarted = false; } } catch (Exception ex3) { ManualLogSource logSource3 = SteamBypassMod.LogSource; BepInExWarningLogInterpolatedStringHandler val = new BepInExWarningLogInterpolatedStringHandler(70, 1, ref flag2); if (flag2) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("[EnsurePlayerPrefabAssigned] ProcessMainThreadScheduledActions error: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(ex3.Message); } logSource3.LogWarning(val); _playerPrefabRetryStarted = false; } } public static bool CanLobbyBeStartedPrefix(ref bool __result) { __result = true; return false; } public static bool CheckPlayersStatePrefix(object targetState, ref bool __result) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Expected O, but got Unknown try { __result = true; return false; } catch (Exception ex) { ManualLogSource logSource = SteamBypassMod.LogSource; bool flag = default(bool); BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(44, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("SteamBypass: CheckPlayersStatePrefix error: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(ex); } logSource.LogError(val); return true; } } public static bool IsLobbyReadyForSetupPrefix(ulong localClientId, ref bool __result) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Expected O, but got Unknown try { __result = true; return false; } catch (Exception ex) { ManualLogSource logSource = SteamBypassMod.LogSource; bool flag = default(bool); BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(47, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("SteamBypass: IsLobbyReadyForSetupPrefix error: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(ex); } logSource.LogError(val); return true; } } public static bool IsRelayNetworkReadyPrefix(ref bool __result) { if (_steamSuccessfullyInitialized) { return true; } __result = true; return false; } public static bool IsRelayNetworkUnavailablePrefix(ref bool __result) { if (_steamSuccessfullyInitialized) { return true; } __result = false; return false; } public static void IsRelayNetworkReadyPostfix(ref bool __result) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Expected O, but got Unknown if (SteamBypassMod.Verbose) { ManualLogSource logSource = SteamBypassMod.LogSource; bool flag = default(bool); BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(44, 2, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("[DEBUG] IsRelayNetworkReady = "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(__result); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" (steamReal="); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(_steamSuccessfullyInitialized); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(")."); } logSource.LogInfo(val); } } public static void IsRelayNetworkUnavailablePostfix(ref bool __result) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Expected O, but got Unknown if (SteamBypassMod.Verbose) { ManualLogSource logSource = SteamBypassMod.LogSource; bool flag = default(bool); BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(50, 2, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("[DEBUG] IsRelayNetworkUnavailable = "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(__result); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" (steamReal="); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(_steamSuccessfullyInitialized); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(")."); } logSource.LogInfo(val); } } public static bool CleanupFailedHostStartupPrefix() { if (_steamSuccessfullyInitialized) { SteamBypassMod.LogSource.LogInfo((object)"[STEAM-REAL] CleanupFailedHostStartup — real Steam: original cleanup allowed to run."); return true; } SteamBypassMod.LogSource.LogInfo((object)"[DEBUG] GameNetworkManager.CleanupFailedHostStartup() called — host startup FAILED — ORIGINAL SKIPPED (protecting live offline host session)."); return false; } public static void MenuLoadingShowOverlayPostfix(object __instance, bool force) { //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Expected O, but got Unknown if (_steamSuccessfullyInitialized || !force) { return; } try { if (IsOfflineHostSessionLive()) { __instance.GetType().GetMethod("SetOverlaysHidden", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic, null, new Type[1] { typeof(bool) }, null)?.Invoke(__instance, new object[1] { false }); SteamBypassMod.LogSource.LogInfo((object)"[OfflineHost] overlays hidden right after ShowLoadingOverlay(true) — offline host session is live."); } } catch (Exception ex) { ManualLogSource logSource = SteamBypassMod.LogSource; bool flag = default(bool); BepInExWarningLogInterpolatedStringHandler val = new BepInExWarningLogInterpolatedStringHandler(39, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("[OfflineHost] overlay suppress failed: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(ex.Message); } logSource.LogWarning(val); } } private static void WarmNetworkManagerCache() { if (!(_nmTypeCache != null)) { _nmTypeCache = TypeResolver.Default.Resolve("NetworkManager"); if (!(_nmTypeCache == null)) { _nmSingletonCache = _nmTypeCache.GetProperty("Singleton", BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic); _nmListeningCache = _nmTypeCache.GetProperty("IsListening", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); } } } internal static bool IsOfflineHostSessionLive() { try { WarmNetworkManagerCache(); object obj = _nmSingletonCache?.GetValue(null); if (obj == null) { return false; } return _nmListeningCache?.GetValue(obj) as bool? == true; } catch { return false; } } internal static void TryHideLoadingOverlay() { //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Expected O, but got Unknown //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Expected O, but got Unknown bool flag = default(bool); try { Type type = TypeResolver.Default.Resolve("MenuLoadingUI"); if (type == null) { SteamBypassMod.LogSource.LogWarning((object)"[OfflineHost] MenuLoadingUI type not found — cannot hide loading overlay."); return; } Il2CppReferenceArray val = Object.FindObjectsOfType(Il2CppType.From(type), true); if (val == null || ((Il2CppArrayBase)(object)val).Length == 0) { SteamBypassMod.LogSource.LogInfo((object)"[OfflineHost] no MenuLoadingUI instance in scene — nothing to hide."); return; } Type type2 = ((object)((Il2CppArrayBase)(object)val)[0]).GetType(); string[] array = new string[1] { "SetOverlaysHidden" }; foreach (string text in array) { MethodInfo method = type2.GetMethod(text, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic, null, new Type[1] { typeof(bool) }, null); if (method != null) { method.Invoke(((Il2CppArrayBase)(object)val)[0], new object[1] { false }); ManualLogSource logSource = SteamBypassMod.LogSource; BepInExInfoLogInterpolatedStringHandler val2 = new BepInExInfoLogInterpolatedStringHandler(44, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("[OfflineHost] MenuLoadingUI."); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(text); ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("(false) invoked."); } logSource.LogInfo(val2); } } } catch (Exception ex) { ManualLogSource logSource2 = SteamBypassMod.LogSource; BepInExWarningLogInterpolatedStringHandler val3 = new BepInExWarningLogInterpolatedStringHandler(43, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val3).AppendLiteral("[OfflineHost] hide loading overlay failed: "); ((BepInExLogInterpolatedStringHandler)val3).AppendFormatted(ex.Message); } logSource2.LogWarning(val3); } } internal static object GetLobbyHandler() { try { Type type = TypeResolver.Default.Resolve("LobbyHandler"); if (type == null) { return null; } FieldInfo field = type.GetField("Handler", BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic); if (field != null) { return field.GetValue(null); } return type.GetProperty("Handler", BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic)?.GetValue(null); } catch { return null; } } internal static void SwitchGameState(string targetName) { //IL_020c: Unknown result type (might be due to invalid IL or missing references) //IL_0213: Expected O, but got Unknown //IL_03dd: Unknown result type (might be due to invalid IL or missing references) //IL_03e4: Expected O, but got Unknown //IL_0419: Unknown result type (might be due to invalid IL or missing references) //IL_0420: Expected O, but got Unknown //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Expected O, but got Unknown //IL_0388: Unknown result type (might be due to invalid IL or missing references) //IL_038f: Expected O, but got Unknown //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Expected O, but got Unknown //IL_0320: Unknown result type (might be due to invalid IL or missing references) //IL_0327: Expected O, but got Unknown //IL_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_01d2: Expected O, but got Unknown //IL_0175: Unknown result type (might be due to invalid IL or missing references) //IL_017c: Expected O, but got Unknown bool flag = default(bool); try { Type type = TypeResolver.Default.Resolve("GameManager"); Type type2 = TypeResolver.Default.Resolve("GameState"); if (type == null || type2 == null) { ManualLogSource logSource = SteamBypassMod.LogSource; BepInExWarningLogInterpolatedStringHandler val = new BepInExWarningLogInterpolatedStringHandler(61, 2, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("[StateSwitch] type resolve failed (GameManager="); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(type != null); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(", GameState="); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(type2 != null); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(")."); } logSource.LogWarning(val); return; } object obj = Resolve(type, null, "Singleton", BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic); if (obj == null) { SteamBypassMod.LogSource.LogWarning((object)"[StateSwitch] GameManager.Singleton not found as property nor field."); return; } object obj2 = Enum.Parse(type2, targetName, ignoreCase: true); PropertyInfo property = type.GetProperty("State", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); object obj3 = property?.GetValue(obj); if (obj3 == null) { obj3 = Resolve(type, obj, "_state", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); } if (object.Equals(obj3, obj2)) { ManualLogSource logSource2 = SteamBypassMod.LogSource; BepInExInfoLogInterpolatedStringHandler val2 = new BepInExInfoLogInterpolatedStringHandler(31, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("[StateSwitch] already "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(obj2); ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral(" — no-op."); } logSource2.LogInfo(val2); return; } if (property != null) { try { property.SetValue(obj, obj2); object value = property.GetValue(obj); if (object.Equals(value, obj2)) { ManualLogSource logSource3 = SteamBypassMod.LogSource; BepInExInfoLogInterpolatedStringHandler val2 = new BepInExInfoLogInterpolatedStringHandler(77, 2, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("[StateSwitch] State "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(obj3); ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral(" -> "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(obj2); ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral(" via property setter (OnStateChanged fired natively)."); } logSource3.LogInfo(val2); return; } ManualLogSource logSource4 = SteamBypassMod.LogSource; BepInExWarningLogInterpolatedStringHandler val = new BepInExWarningLogInterpolatedStringHandler(76, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("[StateSwitch] setter ran but State still "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(value); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" — falling back to manual dispatch."); } logSource4.LogWarning(val); } catch (Exception ex) { ManualLogSource logSource5 = SteamBypassMod.LogSource; BepInExWarningLogInterpolatedStringHandler val = new BepInExWarningLogInterpolatedStringHandler(63, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("[StateSwitch] setter threw: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(ex.Message); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" — falling back to manual dispatch."); } logSource5.LogWarning(val); } } PropertyInfo property2 = type.GetProperty("_state", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); FieldInfo field = type.GetField("_state", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); if (property2 != null) { property2.SetValue(obj, obj2); } else { if (!(field != null)) { SteamBypassMod.LogSource.LogWarning((object)"[StateSwitch] _state member not found — cannot switch."); return; } field.SetValue(obj, obj2); } try { object obj4 = Resolve(type, obj, "OnStateChanged", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); if (obj4 != null) { int num = 0; if (obj4 is Delegate obj5) { Delegate[] invocationList = obj5.GetInvocationList(); foreach (Delegate obj6 in invocationList) { obj6.Method.Invoke(obj6.Target, new object[2] { obj3, obj2 }); num++; } } ManualLogSource logSource6 = SteamBypassMod.LogSource; BepInExInfoLogInterpolatedStringHandler val2 = new BepInExInfoLogInterpolatedStringHandler(83, 3, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("[StateSwitch] State "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(obj3); ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral(" -> "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(obj2); ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral(" via _state write + manual OnStateChanged ("); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(num); ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral(" subscriber(s))."); } logSource6.LogInfo(val2); } else { ManualLogSource logSource7 = SteamBypassMod.LogSource; BepInExInfoLogInterpolatedStringHandler val2 = new BepInExInfoLogInterpolatedStringHandler(70, 2, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("[StateSwitch] State "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(obj3); ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral(" -> "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(obj2); ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral(" via _state write (OnStateChanged empty/null)."); } logSource7.LogInfo(val2); } } catch (Exception ex2) { ManualLogSource logSource8 = SteamBypassMod.LogSource; BepInExWarningLogInterpolatedStringHandler val = new BepInExWarningLogInterpolatedStringHandler(53, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("[StateSwitch] OnStateChanged manual dispatch failed: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(ex2.Message); } logSource8.LogWarning(val); } } catch (Exception ex3) { ManualLogSource logSource9 = SteamBypassMod.LogSource; BepInExWarningLogInterpolatedStringHandler val = new BepInExWarningLogInterpolatedStringHandler(22, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("[StateSwitch] failed: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(ex3.Message); } logSource9.LogWarning(val); } static object Resolve(Type t, object inst, string name, BindingFlags bf) { PropertyInfo property3 = t.GetProperty(name, bf); if (property3 != null) { try { return (inst == null) ? property3.GetValue(null) : property3.GetValue(inst); } catch { } } FieldInfo field2 = t.GetField(name, bf); if (!(field2 == null)) { if (inst != null) { return field2.GetValue(inst); } return field2.GetValue(null); } return null; } } public static void LogBugOncePrefix(string keyword, string detail) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Expected O, but got Unknown if (SteamBypassMod.Verbose) { ManualLogSource logSource = SteamBypassMod.LogSource; bool flag = default(bool); BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(59, 2, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("[DEBUG] GameNetworkManager.LogBugOnce: keyword='"); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(keyword); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("' detail='"); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(detail); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("'"); } logSource.LogInfo(val); } } public static void StartHostPostfix(ref bool __result) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Expected O, but got Unknown if (SteamBypassMod.Verbose) { ManualLogSource logSource = SteamBypassMod.LogSource; bool flag = default(bool); BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(45, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("[DEBUG] NetworkManager.StartHost() returned "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(__result); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("."); } logSource.LogInfo(val); } } public static void ShutdownPrefix() { //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Expected O, but got Unknown //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Expected O, but got Unknown bool flag = default(bool); try { if (!SteamBypassMod.Verbose) { return; } StackFrame[] frames = new StackTrace(1, fNeedFileInfo: false).GetFrames(); List list = new List(); if (frames != null) { StackFrame[] array = frames; for (int i = 0; i < array.Length; i++) { MethodBase methodBase = array[i]?.GetMethod(); if (!(methodBase == null)) { list.Add(methodBase.DeclaringType?.Name + "." + methodBase.Name); if (list.Count >= 8) { break; } } } } if (SteamBypassMod.Verbose) { DumpSessionState("at-Shutdown-entry"); } ManualLogSource logSource = SteamBypassMod.LogSource; BepInExWarningLogInterpolatedStringHandler val = new BepInExWarningLogInterpolatedStringHandler(47, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("[DIAG21] NetworkManager.Shutdown() called by: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted((list.Count > 0) ? string.Join(" <- ", list) : ""); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("."); } logSource.LogWarning(val); } catch (Exception ex) { ManualLogSource logSource2 = SteamBypassMod.LogSource; BepInExWarningLogInterpolatedStringHandler val = new BepInExWarningLogInterpolatedStringHandler(31, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("[DIAG21] Shutdown diag failed: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(ex.Message); } logSource2.LogWarning(val); } } public static void StartServerPostfix(ref bool __result) { //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Expected O, but got Unknown //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Expected O, but got Unknown bool flag = default(bool); try { object obj = (TypeResolver.Default.Resolve("NetworkManager")?.GetProperty("Singleton", BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic))?.GetValue(null); object obj2 = obj?.GetType().GetProperty("NetworkConfig")?.GetValue(obj); object obj3 = obj2?.GetType().GetProperty("NetworkTransport")?.GetValue(obj2); ManualLogSource logSource = SteamBypassMod.LogSource; BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(67, 2, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("[DEBUG] NetworkManager.StartServer() returned "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(__result); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" | transport used = "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted((obj3 == null) ? "NULL" : obj3.GetType().Name); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("."); } logSource.LogInfo(val); } catch (Exception ex) { ManualLogSource logSource2 = SteamBypassMod.LogSource; BepInExErrorLogInterpolatedStringHandler val2 = new BepInExErrorLogInterpolatedStringHandler(34, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("[DEBUG] StartServerPostfix error: "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(ex); } logSource2.LogError(val2); } } public static void UnityTransportStartServerPrefix(object __instance) { //IL_01ba: Unknown result type (might be due to invalid IL or missing references) //IL_01c1: Expected O, but got Unknown //IL_0149: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Expected O, but got Unknown SteamBypassMod.LogSource.LogInfo((object)"[NETCODE] UnityTransport.StartServer() entered."); bool flag = default(bool); try { Type type = __instance.GetType(); object obj = type.GetField("ConnectionData", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic)?.GetValue(__instance); string text = null; object obj2 = null; if (obj != null) { Type type2 = obj.GetType(); text = (type2.GetField("Address")?.GetValue(obj) as string) ?? (type2.GetProperty("Address")?.GetValue(obj) as string); obj2 = type2.GetField("Port")?.GetValue(obj) ?? type2.GetProperty("Port")?.GetValue(obj); } object obj3 = type.GetField("m_ProtocolType", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic)?.GetValue(__instance); object obj4 = type.GetField("m_ServerListenAddresses", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic)?.GetValue(__instance); string text2 = "(none)"; if (obj4 != null) { text2 = ((!(obj4 is ICollection collection)) ? obj4.ToString() : $"count={collection.Count}"); } ManualLogSource logSource = SteamBypassMod.LogSource; BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(68, 4, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("[NETCODE] UTP state: Address="); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(text); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" Port="); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(obj2); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" Protocol="); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(obj3); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" ServerListenAddresses="); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(text2); } logSource.LogInfo(val); } catch (Exception ex) { ManualLogSource logSource2 = SteamBypassMod.LogSource; BepInExErrorLogInterpolatedStringHandler val2 = new BepInExErrorLogInterpolatedStringHandler(54, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("[NETCODE] UnityTransportStartServerPrefix DIAG error: "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(ex); } logSource2.LogError(val2); } } public static void UnityTransportStartServerPostfix(ref bool __result) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Expected O, but got Unknown ManualLogSource logSource = SteamBypassMod.LogSource; bool flag = default(bool); BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(49, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("[NETCODE] UnityTransport.StartServer() returned "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(__result); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("."); } logSource.LogInfo(val); } public static Exception UnityTransportStartServerFinalizer(Exception __exception) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Expected O, but got Unknown if (__exception != null) { ManualLogSource logSource = SteamBypassMod.LogSource; bool flag = default(bool); BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(48, 2, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("[NETCODE] UnityTransport.StartServer() THREW: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(__exception.GetType().Name); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(": "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(__exception.Message); } logSource.LogError(val); } else { SteamBypassMod.LogSource.LogInfo((object)"[NETCODE] UnityTransport.StartServer() finished (no exception)."); } return __exception; } public static void CanStartPostfix(object __instance, object __0, ref bool __result) { //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Expected O, but got Unknown //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Expected O, but got Unknown bool flag = default(bool); try { Type type = __instance.GetType(); object obj = type.GetProperty("IsListening")?.GetValue(__instance); object obj2 = type.GetProperty("NetworkConfig")?.GetValue(__instance); Type obj3 = obj2?.GetType(); object obj4 = obj3?.GetProperty("PlayerPrefab")?.GetValue(obj2); object obj5 = obj3?.GetProperty("ConnectionApproval")?.GetValue(obj2); ManualLogSource logSource = SteamBypassMod.LogSource; BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(94, 6, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("[NETCODE] CanStart("); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(__0); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(") returned "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(__result); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" | IsListening="); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(obj); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" NetworkConfig="); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted((obj2 == null) ? "NULL" : "ok"); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" PlayerPrefab="); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted((obj4 == null) ? "NULL" : "set"); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" ConnectionApproval="); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(obj5); } logSource.LogInfo(val); } catch (Exception ex) { ManualLogSource logSource2 = SteamBypassMod.LogSource; BepInExErrorLogInterpolatedStringHandler val2 = new BepInExErrorLogInterpolatedStringHandler(33, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("[NETCODE] CanStartPostfix error: "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(ex); } logSource2.LogError(val2); } } public static void HostServerInitializePrefix() { SteamBypassMod.LogSource.LogInfo((object)"[NETCODE] NetworkManager.HostServerInitialize() entered."); } public static void HostServerInitializePostfix() { //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Expected O, but got Unknown SteamBypassMod.LogSource.LogInfo((object)"[NETCODE] NetworkManager.HostServerInitialize() done."); try { SteamBypassMod.LogSource.LogInfo((object)"[EnsurePlayerPrefabAssigned] HostServerInitializePostfix attempting assignment."); if (!EnsurePlayerPrefabAssigned()) { SteamBypassMod.LogSource.LogInfo((object)"[EnsurePlayerPrefabAssigned] HostServerInitializePostfix: immediate attempt failed, starting retry background."); StartPlayerPrefabRetryBackground(); } else { SteamBypassMod.LogSource.LogInfo((object)"[EnsurePlayerPrefabAssigned] HostServerInitializePostfix: assignment succeeded."); } } catch (Exception ex) { ManualLogSource logSource = SteamBypassMod.LogSource; bool flag = default(bool); BepInExWarningLogInterpolatedStringHandler val = new BepInExWarningLogInterpolatedStringHandler(64, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("[EnsurePlayerPrefabAssigned] HostServerInitializePostfix error: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(ex.Message); } logSource.LogWarning(val); } } public static void InitializePrefix(object __instance, bool server) { //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Expected O, but got Unknown //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Expected O, but got Unknown bool flag = default(bool); try { object obj = __instance.GetType().GetProperty("NetworkConfig")?.GetValue(__instance); object obj2 = obj?.GetType().GetProperty("NetworkTransport")?.GetValue(obj); ManualLogSource logSource = SteamBypassMod.LogSource; BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(65, 2, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("[NETCODE] NetworkManager.Initialize(server="); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(server); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(") entered | transport="); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted((obj2 == null) ? "NULL" : obj2.GetType().Name); } logSource.LogInfo(val); } catch (Exception ex) { ManualLogSource logSource2 = SteamBypassMod.LogSource; BepInExErrorLogInterpolatedStringHandler val2 = new BepInExErrorLogInterpolatedStringHandler(34, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("[NETCODE] InitializePrefix error: "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(ex); } logSource2.LogError(val2); } } public static void InitializePostfix(object __instance, bool server) { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Expected O, but got Unknown try { if (!EnsurePlayerPrefabAssigned()) { StartPlayerPrefabRetryBackground(); } } catch (Exception ex) { ManualLogSource logSource = SteamBypassMod.LogSource; bool flag = default(bool); BepInExWarningLogInterpolatedStringHandler val = new BepInExWarningLogInterpolatedStringHandler(55, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("[EnsurePlayerPrefabAssigned] InitializePostfix failed: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(ex.Message); } logSource.LogWarning(val); } } public static void ButtonHostAsyncPrefix() { SteamBypassMod.LogSource.LogInfo((object)"[DEBUG] Play clicked -> MenuSubUI.Button_HostAsync entered."); } public static void IsSteamClientReadyAndOnlinePostfix(ref bool __result) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Expected O, but got Unknown ManualLogSource logSource = SteamBypassMod.LogSource; bool flag = default(bool); BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(52, 2, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("[DEBUG] IsSteamClientReadyAndOnline = "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(__result); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" (steamReal="); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(_steamSuccessfullyInitialized); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(")."); } logSource.LogInfo(val); } public static bool HostLobbyForcePrefix() { //IL_01b4: Unknown result type (might be due to invalid IL or missing references) //IL_01bb: Expected O, but got Unknown //IL_0329: Unknown result type (might be due to invalid IL or missing references) //IL_0330: Expected O, but got Unknown //IL_044e: Unknown result type (might be due to invalid IL or missing references) //IL_0455: Expected O, but got Unknown //IL_061f: Unknown result type (might be due to invalid IL or missing references) //IL_0626: Expected O, but got Unknown //IL_07c1: Unknown result type (might be due to invalid IL or missing references) //IL_07c8: Expected O, but got Unknown //IL_07fd: Unknown result type (might be due to invalid IL or missing references) //IL_0804: Expected O, but got Unknown //IL_02ce: Unknown result type (might be due to invalid IL or missing references) //IL_02d5: Expected O, but got Unknown //IL_072d: Unknown result type (might be due to invalid IL or missing references) //IL_0734: Expected O, but got Unknown //IL_078c: Unknown result type (might be due to invalid IL or missing references) //IL_0793: Expected O, but got Unknown //IL_040d: Unknown result type (might be due to invalid IL or missing references) //IL_0414: Expected O, but got Unknown //IL_059d: Unknown result type (might be due to invalid IL or missing references) //IL_05a4: Expected O, but got Unknown if (_steamSuccessfullyInitialized) { SteamBypassMod.LogSource.LogInfo((object)"[STEAM-REAL] real Steam active — passing through native GameManager.HostLobby() (FacepunchTransport + Steam lobby + invites)."); return true; } SteamBypassMod.LogSource.LogInfo((object)"[DEBUG] GameManager.HostLobby() entered — bypassing inlined CanStartHost gate, calling Host() directly."); if (IsOfflineHostSessionLive() && GetLobbyHandler() != null) { SteamBypassMod.LogSource.LogInfo((object)"[DEBUG] HostLobbyForcePrefix: session already live — switching state to Lobby only (no chain re-run)."); TryHideLoadingOverlay(); SwitchGameState("Lobby"); return false; } bool flag = default(bool); try { Type type = TypeResolver.Default.Resolve("GameNetworkManager"); if (type == null) { SteamBypassMod.LogSource.LogWarning((object)"[DEBUG] HostLobbyForcePrefix: GameNetworkManager type not found."); return false; } object obj = null; PropertyInfo property = type.GetProperty("Singleton", BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic); if (property != null) { obj = property.GetValue(null); } else { FieldInfo field = type.GetField("Singleton", BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic); if (field == null) { SteamBypassMod.LogSource.LogWarning((object)"[DEBUG] HostLobbyForcePrefix: Singleton field/property not found."); return false; } obj = field.GetValue(null); } if (obj == null) { SteamBypassMod.LogSource.LogWarning((object)"[DEBUG] HostLobbyForcePrefix: GameNetworkManager.Singleton is null — cannot start host."); return false; } try { Type type2 = TypeResolver.Default.Resolve("NetworkManager"); object obj2 = null; if (type2 != null) { obj2 = type2.GetProperty("Singleton", BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic)?.GetValue(null); } if (obj2 == null) { object obj3 = type.GetProperty("gameObject", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic)?.GetValue(obj); if (obj3 != null) { obj2 = obj3.GetType().GetMethod("GetComponent", BindingFlags.Instance | BindingFlags.Public, null, new Type[1] { typeof(Type) }, null)?.Invoke(obj3, new object[1] { type2 }); } } InstallLocalTransport(obj2); } catch (Exception ex) { ManualLogSource logSource = SteamBypassMod.LogSource; BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(55, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("[DEBUG] HostLobbyForcePrefix: transport install error: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(ex); } logSource.LogError(val); } Type type3 = TypeResolver.Default.Resolve("GameNetworkManager"); if (type3 == null) { SteamBypassMod.LogSource.LogError((object)"[DEBUG] HostLobbyForcePrefix: GameNetworkManager type not found — cannot start host."); return false; } object obj4 = null; PropertyInfo property2 = type3.GetProperty("Singleton", BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic); obj4 = ((!(property2 != null)) ? type3.GetField("Singleton", BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic)?.GetValue(null) : property2.GetValue(null)); if (obj4 == null) { SteamBypassMod.LogSource.LogError((object)"[DEBUG] HostLobbyForcePrefix: GameNetworkManager.Singleton is null — cannot start host."); return false; } MethodInfo method = type3.GetMethod("Host", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic, null, Type.EmptyTypes, null); if (method == null) { SteamBypassMod.LogSource.LogError((object)"[DEBUG] HostLobbyForcePrefix: GameNetworkManager.Host() method not found."); return false; } try { object obj5 = type3.GetProperty("Transport", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic)?.GetValue(obj4); ManualLogSource logSource2 = SteamBypassMod.LogSource; BepInExInfoLogInterpolatedStringHandler val2 = new BepInExInfoLogInterpolatedStringHandler(140, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("[DEBUG] HostLobbyForcePrefix: GameNetworkManager.Transport = "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(obj5?.GetType().Name ?? "null"); ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral(" (typed Facepunch — UTP lives on NetworkConfig, session kept alive explicitly)."); } logSource2.LogInfo(val2); } catch (Exception ex2) { ManualLogSource logSource3 = SteamBypassMod.LogSource; BepInExWarningLogInterpolatedStringHandler val3 = new BepInExWarningLogInterpolatedStringHandler(53, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val3).AppendLiteral("[DEBUG] HostLobbyForcePrefix: Transport diag failed: "); ((BepInExLogInterpolatedStringHandler)val3).AppendFormatted(ex2.Message); } logSource3.LogWarning(val3); } try { Type type4 = TypeResolver.Default.Resolve("NetworkManager"); object obj6 = ResolveStaticMember(type4, "Singleton"); if (obj6 == null) { SteamBypassMod.LogSource.LogWarning((object)"[NETCODE] NetworkManager.Singleton is null — cannot explicitly start server."); } else { (type4?.GetMethod("Initialize", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic, null, new Type[1] { typeof(bool) }, null))?.Invoke(obj6, new object[1] { true }); object obj7 = (type4?.GetMethod("StartServer", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic, null, Type.EmptyTypes, null))?.Invoke(obj6, null); ManualLogSource logSource4 = SteamBypassMod.LogSource; BepInExInfoLogInterpolatedStringHandler val2 = new BepInExInfoLogInterpolatedStringHandler(64, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("[NETCODE] explicit Initialize(true)+StartServer() done, result="); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(obj7); ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("."); } logSource4.LogInfo(val2); } } catch (Exception ex3) { ManualLogSource logSource5 = SteamBypassMod.LogSource; BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(40, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("[NETCODE] explicit server start failed: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(ex3.Message); } logSource5.LogError(val); } SteamBypassMod.LogSource.LogInfo((object)"[DEBUG] HostLobbyForcePrefix: invoking GameNetworkManager.Singleton.Host() (full chain)..."); method.Invoke(obj4, null); SteamBypassMod.LogSource.LogInfo((object)"[DEBUG] HostLobbyForcePrefix: GameNetworkManager.Singleton.Host() invoked (async chain started)."); try { FieldInfo field2 = type3.GetField("hostLobbyCreateSucceeded", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); FieldInfo? field3 = type3.GetField("isJoiningLobby", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); object obj8 = field2?.GetValue(obj4); object obj9 = field3?.GetValue(obj4); Type type5 = TypeResolver.Default.Resolve("LobbyHandler"); object obj10 = type5?.GetField("Handler", BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic)?.GetValue(null) ?? type5?.GetProperty("Handler", BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic)?.GetValue(null); Type type6 = TypeResolver.Default.Resolve("NetworkManager"); object obj11 = (type6?.GetProperty("Singleton", BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic))?.GetValue(null); object obj12 = (type6?.GetProperty("IsListening", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic))?.GetValue(obj11); ManualLogSource logSource6 = SteamBypassMod.LogSource; BepInExInfoLogInterpolatedStringHandler val2 = new BepInExInfoLogInterpolatedStringHandler(119, 4, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("[DEBUG] Post-Join states: hostLobbyCreateSucceeded="); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(obj8); ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral(" isJoiningLobby="); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(obj9); ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral(" LobbyHandler.Handler="); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted((obj10 == null) ? "NULL" : "live"); ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral(" | NetworkManager.IsListening="); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(obj12); } logSource6.LogInfo(val2); } catch (Exception ex4) { ManualLogSource logSource7 = SteamBypassMod.LogSource; BepInExWarningLogInterpolatedStringHandler val3 = new BepInExWarningLogInterpolatedStringHandler(59, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val3).AppendLiteral("[DEBUG] HostLobbyForcePrefix: post-join state read failed: "); ((BepInExLogInterpolatedStringHandler)val3).AppendFormatted(ex4.Message); } logSource7.LogWarning(val3); } try { PropertyInfo property3 = type3.GetProperty("IsHost", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); bool? flag2 = property3?.GetValue(obj4) as bool?; flag = false; if (flag2 == flag) { SteamBypassMod.LogSource.LogInfo((object)"[DEBUG] HostLobbyForcePrefix: IsHost=false after JoinHostPlayer, attempting to set IsHost=true reflectively."); BepInExInfoLogInterpolatedStringHandler val2; if (property3 != null && property3.CanWrite) { property3.SetValue(obj4, true); } else { string[] array = new string[4] { "IsHost", "_isHost", "isHost", "k__BackingField" }; foreach (string text in array) { FieldInfo field4 = type3.GetField(text, BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic); if (field4 != null) { field4.SetValue(obj4, true); ManualLogSource logSource8 = SteamBypassMod.LogSource; val2 = new BepInExInfoLogInterpolatedStringHandler(47, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("[DEBUG] HostLobbyForcePrefix: wrote field "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(text); ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("=true"); } logSource8.LogInfo(val2); break; } } } object obj13 = property3?.GetValue(obj4); ManualLogSource logSource9 = SteamBypassMod.LogSource; val2 = new BepInExInfoLogInterpolatedStringHandler(46, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("[DEBUG] HostLobbyForcePrefix: Post-fix IsHost="); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(obj13); } logSource9.LogInfo(val2); } } catch (Exception ex5) { ManualLogSource logSource10 = SteamBypassMod.LogSource; BepInExWarningLogInterpolatedStringHandler val3 = new BepInExWarningLogInterpolatedStringHandler(65, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val3).AppendLiteral("[DEBUG] HostLobbyForcePrefix: failed to set IsHost reflectively: "); ((BepInExLogInterpolatedStringHandler)val3).AppendFormatted(ex5.Message); } logSource10.LogWarning(val3); } } catch (Exception ex6) { ManualLogSource logSource11 = SteamBypassMod.LogSource; BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(41, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("[DEBUG] HostLobbyForcePrefix: exception: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(ex6); } logSource11.LogError(val); } _uiDrivenThisSession = false; ScheduleOnMainThread(30, delegate { SessionWatcherTick("w30"); }); ScheduleOnMainThread(60, delegate { SessionWatcherTick("w60"); }); ScheduleOnMainThread(120, delegate { SessionWatcherTick("w120"); }); ScheduleOnMainThread(330, delegate { DumpSessionState("t+5.5s"); if (!_uiDrivenThisSession) { SteamBypassMod.LogSource.LogWarning((object)"[OfflineHost] session did not fully settle by t+5.5s — forcing registration + UI switch as last resort."); LegacyForceRegister(); TryHideLoadingOverlay(); SwitchGameState("Lobby"); } }); return false; } private static void InstallLocalTransport(object networkManager) { //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Expected O, but got Unknown //IL_04fa: Unknown result type (might be due to invalid IL or missing references) //IL_0501: Expected O, but got Unknown //IL_0536: Unknown result type (might be due to invalid IL or missing references) //IL_053d: Expected O, but got Unknown //IL_0632: Unknown result type (might be due to invalid IL or missing references) //IL_0639: Expected O, but got Unknown //IL_0336: Unknown result type (might be due to invalid IL or missing references) //IL_033d: Expected O, but got Unknown if (networkManager == null) { SteamBypassMod.LogSource.LogWarning((object)"[LocalTransport] NetworkManager is null — cannot install local transport."); return; } bool flag = default(bool); try { Type type = networkManager.GetType(); PropertyInfo property = type.GetProperty("NetworkConfig", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); if (property == null) { SteamBypassMod.LogSource.LogWarning((object)"[LocalTransport] NetworkConfig property not found."); return; } object value = property.GetValue(networkManager); if (value == null) { SteamBypassMod.LogSource.LogWarning((object)"[LocalTransport] NetworkConfig is null."); return; } try { object obj = value.GetType().GetProperty("NetworkTransport", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic)?.GetValue(value); if (obj != null) { obj.GetType().GetMethod("Shutdown", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic, null, Type.EmptyTypes, null)?.Invoke(obj, null); SteamBypassMod.LogSource.LogInfo((object)"[LocalTransport] Shut down previous NetworkTransport before installing UTP."); } } catch (Exception ex) { ManualLogSource logSource = SteamBypassMod.LogSource; BepInExWarningLogInterpolatedStringHandler val = new BepInExWarningLogInterpolatedStringHandler(63, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("[LocalTransport] previous transport Shutdown failed (ignored): "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(ex.Message); } logSource.LogWarning(val); } object obj2 = type.GetProperty("gameObject", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic)?.GetValue(networkManager); if (obj2 == null) { SteamBypassMod.LogSource.LogWarning((object)"[LocalTransport] gameObject is null."); return; } Type typeFromHandle = typeof(UnityTransport); MethodInfo methodInfo = obj2.GetType().GetMethods(BindingFlags.Instance | BindingFlags.Public).FirstOrDefault((MethodInfo m) => m.Name == "AddComponent" && m.IsGenericMethodDefinition); if (methodInfo == null) { SteamBypassMod.LogSource.LogWarning((object)"[LocalTransport] AddComponent() generic not found on GameObject."); return; } object obj3 = methodInfo.MakeGenericMethod(typeFromHandle).Invoke(obj2, null); if (obj3 == null) { SteamBypassMod.LogSource.LogWarning((object)"[LocalTransport] AddComponent() returned null."); return; } MethodInfo method = typeFromHandle.GetMethod("SetConnectionData", BindingFlags.Instance | BindingFlags.Public, null, new Type[3] { typeof(string), typeof(ushort), typeof(string) }, null); if (method != null) { method.Invoke(obj3, new object[3] { "127.0.0.1", (ushort)7770, "127.0.0.1" }); SteamBypassMod.LogSource.LogInfo((object)"[LocalTransport] SetConnectionData(127.0.0.1:7770) invoked (void)."); } else { SteamBypassMod.LogSource.LogWarning((object)"[LocalTransport] SetConnectionData(string,ushort,string) not found."); } try { FieldInfo field = typeFromHandle.GetField("ConnectionData", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); PropertyInfo property2 = typeFromHandle.GetProperty("ConnectionData", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); object obj4 = field?.GetValue(obj3) ?? property2?.GetValue(obj3); if (obj4 != null) { Type type2 = obj4.GetType(); string text = (type2.GetField("Address")?.GetValue(obj4) as string) ?? (type2.GetProperty("Address")?.GetValue(obj4) as string); object obj5 = type2.GetField("Port")?.GetValue(obj4) ?? type2.GetProperty("Port")?.GetValue(obj4); ManualLogSource logSource2 = SteamBypassMod.LogSource; BepInExInfoLogInterpolatedStringHandler val2 = new BepInExInfoLogInterpolatedStringHandler(72, 2, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("[LocalTransport] ConnectionData after SetConnectionData: Address="); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(text); ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral(" Port="); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(obj5); ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("."); } logSource2.LogInfo(val2); } else { SteamBypassMod.LogSource.LogWarning((object)"[LocalTransport] ConnectionData is null after SetConnectionData. Attempting fallback construction."); Type type3 = field?.FieldType ?? property2?.PropertyType; if (type3 != null) { try { object obj6 = Activator.CreateInstance(type3); if ((object)type3.GetField("Address") == null) { type3.GetProperty("Address"); } if ((object)type3.GetField("Port") == null) { type3.GetProperty("Port"); } PropertyInfo property3 = type3.GetProperty("Address"); if (property3 != null && property3.CanWrite) { property3.SetValue(obj6, "127.0.0.1"); } else { type3.GetField("Address")?.SetValue(obj6, "127.0.0.1"); } PropertyInfo property4 = type3.GetProperty("Port"); if (property4 != null && property4.CanWrite) { property4.SetValue(obj6, (ushort)7770); } else { type3.GetField("Port")?.SetValue(obj6, (ushort)7770); } if (field != null) { field.SetValue(obj3, obj6); } else if (property2 != null && property2.CanWrite) { property2.SetValue(obj3, obj6); } SteamBypassMod.LogSource.LogInfo((object)"[LocalTransport] Fallback ConnectionData constructed and assigned."); } catch (Exception ex2) { ManualLogSource logSource3 = SteamBypassMod.LogSource; BepInExWarningLogInterpolatedStringHandler val = new BepInExWarningLogInterpolatedStringHandler(49, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("[LocalTransport] fallback ConnectionData failed: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(ex2.Message); } logSource3.LogWarning(val); } } } } catch (Exception ex3) { ManualLogSource logSource4 = SteamBypassMod.LogSource; BepInExWarningLogInterpolatedStringHandler val = new BepInExWarningLogInterpolatedStringHandler(45, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("[LocalTransport] read ConnectionData failed: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(ex3.Message); } logSource4.LogWarning(val); } FieldInfo field2 = typeFromHandle.GetField("m_ProtocolType", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); if (field2 != null) { Type nestedType = typeof(UnityTransport).GetNestedType("ProtocolType", BindingFlags.Public | BindingFlags.NonPublic); if (nestedType != null) { field2.SetValue(obj3, Enum.ToObject(nestedType, 0)); } } PropertyInfo property5 = value.GetType().GetProperty("NetworkTransport", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); if (property5 == null) { SteamBypassMod.LogSource.LogWarning((object)"[LocalTransport] NetworkConfig.NetworkTransport property not found."); return; } property5.SetValue(value, obj3); _installedTransport = obj3; SteamBypassMod.LogSource.LogInfo((object)"[LocalTransport] SetupHostApproval called."); SetupHostApproval(networkManager); SteamBypassMod.LogSource.LogInfo((object)"[LocalTransport] Installed UnityTransport (localhost:7770) as NetworkConfig.NetworkTransport."); SteamBypassMod.LogSource.LogInfo((object)"[LocalTransport] listening on port 7770 (localhost UTP)."); } catch (Exception ex4) { ManualLogSource logSource5 = SteamBypassMod.LogSource; BepInExErrorLogInterpolatedStringHandler val3 = new BepInExErrorLogInterpolatedStringHandler(46, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val3).AppendLiteral("[LocalTransport] InstallLocalTransport error: "); ((BepInExLogInterpolatedStringHandler)val3).AppendFormatted(ex4); } logSource5.LogError(val3); } } public static void ApprovalStub(ConnectionApprovalRequest req, ConnectionApprovalResponse res) { res.Approved = true; } private static void SetupHostApproval(object networkManager) { //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Expected O, but got Unknown try { object obj = networkManager.GetType().GetProperty("NetworkConfig", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic)?.GetValue(networkManager); Type type = obj?.GetType(); if (obj == null) { SteamBypassMod.LogSource.LogWarning((object)"[NETCODE] SetupHostApproval: NetworkConfig is null — cannot configure approval."); return; } PropertyInfo property = type.GetProperty("ConnectionApproval", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); if (property != null) { property.SetValue(obj, false); SteamBypassMod.LogSource.LogInfo((object)"[NETCODE] SetupHostApproval: ConnectionApproval DISABLED on NetworkConfig (local host auto-approve)."); } else { SteamBypassMod.LogSource.LogWarning((object)"[NETCODE] SetupHostApproval: ConnectionApproval property not found on NetworkConfig."); } } catch (Exception ex) { ManualLogSource logSource = SteamBypassMod.LogSource; bool flag = default(bool); BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(38, 2, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("[NETCODE] SetupHostApproval FAILED: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(ex.GetType().FullName); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(": "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(ex.Message); } logSource.LogError(val); } } public static void HostPrefix() { SteamBypassMod.LogSource.LogInfo((object)"[DEBUG] GameNetworkManager.Host() entered."); } public static void HostPostfix() { SteamBypassMod.LogSource.LogInfo((object)"[DEBUG] GameNetworkManager.Host() finished (async path completed)."); } public static void EnsureRelayNetworkAccessUsableAsyncPrefix(float timeoutSeconds) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Expected O, but got Unknown ManualLogSource logSource = SteamBypassMod.LogSource; bool flag = default(bool); BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(75, 2, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("[DEBUG] EnsureRelayNetworkAccessUsableAsync(timeout="); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(timeoutSeconds); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(") entered (steamReal="); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(_steamSuccessfullyInitialized); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(")."); } logSource.LogInfo(val); } public static void HostLobbyPostfix() { SteamBypassMod.LogSource.LogInfo((object)"[DEBUG] GameManager.HostLobby() finished (reached end / called Host)."); } public static bool CanStartHostPrefix(ref bool __result) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Expected O, but got Unknown ManualLogSource logSource = SteamBypassMod.LogSource; bool flag = default(bool); BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(76, 2, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("[DEBUG] GameNetworkManager.get_CanStartHost = "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(__result); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" (steamReal="); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(_steamSuccessfullyInitialized); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(") -> forcing true."); } logSource.LogInfo(val); if (_steamSuccessfullyInitialized) { return true; } __result = true; return false; } public static void IsAlreadyInLobbyPrefix(ref bool __result) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Expected O, but got Unknown ManualLogSource logSource = SteamBypassMod.LogSource; bool flag = default(bool); BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(47, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("[DEBUG] GameNetworkManager.IsAlreadyInLobby = "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(__result); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("."); } logSource.LogInfo(val); } public static void PrepareForHostAsyncPrefix() { SteamBypassMod.LogSource.LogInfo((object)"[DEBUG] GameNetworkManager.PrepareForHostAsync() entered."); } public static void StartHostPrefix() { //IL_02b0: Unknown result type (might be due to invalid IL or missing references) //IL_02b7: Expected O, but got Unknown //IL_02e7: Unknown result type (might be due to invalid IL or missing references) //IL_02ee: Expected O, but got Unknown //IL_05bb: Unknown result type (might be due to invalid IL or missing references) //IL_05c2: Expected O, but got Unknown //IL_061f: Unknown result type (might be due to invalid IL or missing references) //IL_0626: Expected O, but got Unknown //IL_066a: Unknown result type (might be due to invalid IL or missing references) //IL_0671: Expected O, but got Unknown //IL_06a1: Unknown result type (might be due to invalid IL or missing references) //IL_06a8: Expected O, but got Unknown //IL_03f9: Unknown result type (might be due to invalid IL or missing references) //IL_0400: Expected O, but got Unknown //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Expected O, but got Unknown //IL_0473: Unknown result type (might be due to invalid IL or missing references) //IL_047a: Expected O, but got Unknown //IL_025a: Unknown result type (might be due to invalid IL or missing references) //IL_0261: Expected O, but got Unknown SteamBypassMod.LogSource.LogInfo((object)"[DEBUG] NetworkManager.StartHost() entered."); bool flag = default(bool); try { object obj = (TypeResolver.Default.Resolve("NetworkManager")?.GetProperty("Singleton", BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic))?.GetValue(null); if (obj == null) { SteamBypassMod.LogSource.LogInfo((object)"[DEBUG] StartHostPrefix DIAG: NetworkManager.Singleton == NULL (StartHost would operate on a different instance!)."); } else { Type type = obj.GetType(); object obj2 = type.GetProperty("IsServer")?.GetValue(obj); object obj3 = type.GetProperty("IsClient")?.GetValue(obj); object obj4 = type.GetProperty("IsListening")?.GetValue(obj); object obj5 = type.GetProperty("NetworkConfig")?.GetValue(obj); object obj6 = obj5?.GetType().GetProperty("NetworkTransport")?.GetValue(obj5); ManualLogSource logSource = SteamBypassMod.LogSource; BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(109, 5, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("[DEBUG] StartHostPrefix DIAG: Singleton!=null | IsServer="); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(obj2); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" IsClient="); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(obj3); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" IsListening="); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(obj4); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" | NetworkConfig="); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted((obj5 == null) ? "NULL" : "ok"); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" Transport="); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted((obj6 == null) ? "NULL" : obj6.GetType().Name); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("."); } logSource.LogInfo(val); try { Type type2 = TypeResolver.Default.Resolve("GameNetworkManager"); object obj7 = type2?.GetProperty("Singleton", BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic)?.GetValue(null) ?? type2?.GetField("Singleton", BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic)?.GetValue(null); if (obj7 == null) { SteamBypassMod.LogSource.LogInfo((object)"[DEBUG] StartHostPrefix DIAG: GameNetworkManager.Singleton == NULL."); } else { object obj8 = type2.GetField("Transport", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic)?.GetValue(obj7) ?? type2.GetProperty("Transport", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic)?.GetValue(obj7); ManualLogSource logSource2 = SteamBypassMod.LogSource; val = new BepInExInfoLogInterpolatedStringHandler(163, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("[DEBUG] StartHostPrefix DIAG: GameNetworkManager.Transport = "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted((obj8 == null) ? "NULL" : obj8.GetType().Name); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" (expected UTP if our defensive set worked; Facepunch = Host() uses private field, not NetworkConfig)."); } logSource2.LogInfo(val); } } catch (Exception ex) { ManualLogSource logSource3 = SteamBypassMod.LogSource; BepInExErrorLogInterpolatedStringHandler val2 = new BepInExErrorLogInterpolatedStringHandler(67, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("[DEBUG] StartHostPrefix DIAG (GameNetworkManager.Transport) error: "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(ex); } logSource3.LogError(val2); } } } catch (Exception ex2) { ManualLogSource logSource4 = SteamBypassMod.LogSource; BepInExErrorLogInterpolatedStringHandler val2 = new BepInExErrorLogInterpolatedStringHandler(36, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("[DEBUG] StartHostPrefix DIAG error: "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(ex2); } logSource4.LogError(val2); } try { if (_installedTransport == null) { SteamBypassMod.LogSource.LogWarning((object)"[DEBUG] StartHostPrefix: no installed UTP cached — cannot re-apply transport."); return; } Type type3 = TypeResolver.Default.Resolve("NetworkManager"); if (type3 == null) { SteamBypassMod.LogSource.LogWarning((object)"[DEBUG] StartHostPrefix: NetworkManager type not found."); return; } object obj9 = type3.GetProperty("Singleton", BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic)?.GetValue(null); if (obj9 == null) { SteamBypassMod.LogSource.LogWarning((object)"[DEBUG] StartHostPrefix: NetworkManager.Singleton is null."); return; } object obj10 = obj9.GetType().GetProperty("NetworkConfig", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic)?.GetValue(obj9); if (obj10 == null) { SteamBypassMod.LogSource.LogWarning((object)"[DEBUG] StartHostPrefix: NetworkConfig is null."); return; } PropertyInfo? property = obj10.GetType().GetProperty("NetworkTransport", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); object obj11 = property?.GetValue(obj10); ManualLogSource logSource5 = SteamBypassMod.LogSource; BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(52, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("[DEBUG] StartHostPrefix: NetworkTransport BEFORE = "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(obj11?.GetType().Name ?? "null"); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("."); } logSource5.LogInfo(val); property?.SetValue(obj10, _installedTransport); object obj12 = property?.GetValue(obj10); ManualLogSource logSource6 = SteamBypassMod.LogSource; val = new BepInExInfoLogInterpolatedStringHandler(68, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("[DEBUG] StartHostPrefix: NetworkTransport AFTER = "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(obj12?.GetType().Name ?? "null"); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" (re-applied UTP)."); } logSource6.LogInfo(val); try { PropertyInfo property2 = obj10.GetType().GetProperty("PlayerPrefab", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); if (property2?.GetValue(obj10) == null) { SteamBypassMod.LogSource.LogInfo((object)"[DEBUG] StartHostPrefix: PlayerPrefab is NULL — creating fallback prefab."); Type type4 = Type.GetType("UnityEngine.GameObject, UnityEngine.CoreModule") ?? Type.GetType("UnityEngine.GameObject"); object obj13 = null; if (type4 != null) { try { obj13 = Activator.CreateInstance(type4, "PlayerPrefab-Auto"); MethodInfo methodInfo = type4.GetMethods(BindingFlags.Instance | BindingFlags.Public).FirstOrDefault((MethodInfo m) => m.Name == "AddComponent" && m.IsGenericMethodDefinition); Type type5 = TypeResolver.Default.Resolve("NetworkObject"); if (methodInfo != null && type5 != null && obj13 != null) { methodInfo.MakeGenericMethod(type5).Invoke(obj13, null); } } catch (Exception ex3) { ManualLogSource logSource7 = SteamBypassMod.LogSource; BepInExWarningLogInterpolatedStringHandler val3 = new BepInExWarningLogInterpolatedStringHandler(62, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val3).AppendLiteral("[DEBUG] StartHostPrefix: fallback GameObject creation failed: "); ((BepInExLogInterpolatedStringHandler)val3).AppendFormatted(ex3.Message); } logSource7.LogWarning(val3); } } if (obj13 == null || !(property2 != null)) { return; } try { property2.SetValue(obj10, obj13); SteamBypassMod.LogSource.LogInfo((object)"[DEBUG] StartHostPrefix: PlayerPrefab fallback assigned to NetworkConfig."); return; } catch (Exception ex4) { ManualLogSource logSource8 = SteamBypassMod.LogSource; BepInExWarningLogInterpolatedStringHandler val3 = new BepInExWarningLogInterpolatedStringHandler(56, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val3).AppendLiteral("[DEBUG] StartHostPrefix: failed to assign PlayerPrefab: "); ((BepInExLogInterpolatedStringHandler)val3).AppendFormatted(ex4.Message); } logSource8.LogWarning(val3); return; } } SteamBypassMod.LogSource.LogInfo((object)"[DEBUG] StartHostPrefix: PlayerPrefab already set."); } catch (Exception ex5) { ManualLogSource logSource9 = SteamBypassMod.LogSource; BepInExWarningLogInterpolatedStringHandler val3 = new BepInExWarningLogInterpolatedStringHandler(59, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val3).AppendLiteral("[DEBUG] StartHostPrefix: PlayerPrefab fallback try failed: "); ((BepInExLogInterpolatedStringHandler)val3).AppendFormatted(ex5); } logSource9.LogWarning(val3); } } catch (Exception ex6) { ManualLogSource logSource10 = SteamBypassMod.LogSource; BepInExErrorLogInterpolatedStringHandler val2 = new BepInExErrorLogInterpolatedStringHandler(51, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("[DEBUG] StartHostPrefix: re-apply transport error: "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(ex6); } logSource10.LogError(val2); } } public static void ApplyLocalPlayerControlsPostfix(object __instance) { //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Expected O, but got Unknown try { Type type = __instance.GetType(); object obj = type.GetProperty("startButton", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic)?.GetValue(__instance); if (obj == null) { obj = type.GetField("startButton", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic)?.GetValue(__instance); } obj?.GetType().GetMethod("SetEnabled", BindingFlags.Instance | BindingFlags.Public, null, new Type[1] { typeof(bool) }, null)?.Invoke(obj, new object[1] { true }); } catch (Exception ex) { ManualLogSource logSource = SteamBypassMod.LogSource; bool flag = default(bool); BepInExWarningLogInterpolatedStringHandler val = new BepInExWarningLogInterpolatedStringHandler(46, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("SteamBypass: ApplyLocalPlayerControlsPostfix: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(ex); } logSource.LogWarning(val); } } public static bool TryGetLocalSteamIdPrefix(ref ulong steamId, ref bool __result) { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Expected O, but got Unknown if (_steamSuccessfullyInitialized) { return true; } steamId = 76561197960265728uL; __result = true; ManualLogSource logSource = SteamBypassMod.LogSource; bool flag = default(bool); BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(43, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("[DEBUG] TryGetLocalSteamId forced fake id="); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(76561197960265728uL); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("."); } logSource.LogInfo(val); return false; } public static bool GetLocalSteamNamePrefix(ref string __result) { if (_steamSuccessfullyInitialized) { return true; } __result = "BombanaPlayer"; SteamBypassMod.LogSource.LogInfo((object)"[DEBUG] GetLocalSteamName forced fake name."); return false; } private static void SetField(Type type, object instance, string name, object value) { PropertyInfo property = type.GetProperty(name, BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic); if (property != null && property.CanWrite) { property.SetValue(instance, value); } else { type.GetField(name, BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic)?.SetValue(instance, value); } } private static void SetStaticField(Type type, string name, object value) { PropertyInfo property = type.GetProperty(name, BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic); if (property != null && property.CanWrite) { property.SetValue(null, value); } else { type.GetField(name, BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic)?.SetValue(null, value); } } private static void FireOnSteamInitialize(Type type, object instance) { //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Expected O, but got Unknown try { PropertyInfo property = type.GetProperty("OnSteamInitialize", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); if (property == null) { return; } object value = property.GetValue(instance); if (value != null) { if (value is Delegate obj) { obj.DynamicInvoke(); } else { value.GetType().GetMethod("Invoke", BindingFlags.Instance | BindingFlags.Public)?.Invoke(value, null); } } } catch (Exception ex) { ManualLogSource logSource = SteamBypassMod.LogSource; bool flag = default(bool); BepInExWarningLogInterpolatedStringHandler val = new BepInExWarningLogInterpolatedStringHandler(45, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("SteamBypass: FireOnSteamInitialize fallback: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(ex); } logSource.LogWarning(val); } } public static bool ConfigureLobbyMetadataPrefix(object lobby) { if (_steamSuccessfullyInitialized) { return true; } SteamBypassMod.LogSource.LogInfo((object)"[OfflineHost] ConfigureLobbyMetadata skipped (no Steam lobby)."); return false; } public static void LobbyHandlerCreatePrefix() { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Expected O, but got Unknown SteamBypassMod.LogSource.LogInfo((object)"[DEBUG] LobbyHandler.Create() called — lobby UI building."); if (_steamSuccessfullyInitialized) { return; } try { EnsurePlayerPrefabAssigned(); } catch (Exception ex) { ManualLogSource logSource = SteamBypassMod.LogSource; bool flag = default(bool); BepInExWarningLogInterpolatedStringHandler val = new BepInExWarningLogInterpolatedStringHandler(48, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("[OfflineHost] CreatePrefix prefab check failed: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(ex.Message); } logSource.LogWarning(val); } } public static bool JoinHostPlayerPrefix() { //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Expected O, but got Unknown if (_steamSuccessfullyInitialized) { return true; } SteamBypassMod.LogSource.LogInfo((object)"[OfflineHost] JoinHostPlayer: offline path — ensuring PlayerPrefab then allowing original to run."); try { EnsurePlayerPrefabAssigned(); } catch (Exception ex) { ManualLogSource logSource = SteamBypassMod.LogSource; bool flag = default(bool); BepInExWarningLogInterpolatedStringHandler val = new BepInExWarningLogInterpolatedStringHandler(64, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("[OfflineHost] JoinHostPlayer EnsurePlayerPrefabAssigned failed: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(ex.Message); } logSource.LogWarning(val); } return true; } public static void ApplyHostOnlyButtonStatesPostfix(object __instance) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Expected O, but got Unknown try { UnlockLevels(__instance); } catch (Exception ex) { ManualLogSource logSource = SteamBypassMod.LogSource; bool flag = default(bool); BepInExWarningLogInterpolatedStringHandler val = new BepInExWarningLogInterpolatedStringHandler(24, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("[LEVELS] unlock failed: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(ex.Message); } logSource.LogWarning(val); } } internal static void UnlockLevels(object lobbySubUi) { //IL_0167: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Expected O, but got Unknown //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Expected O, but got Unknown //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Expected O, but got Unknown if (lobbySubUi == null) { return; } Type type = lobbySubUi.GetType(); bool flag = false; string[] array = new string[2] { "levelMaximumIndex", "campaignMaxLevelIndex" }; bool flag2 = default(bool); foreach (string text in array) { int num = ReadIntMember(type, lobbySubUi, text, -999); switch (num) { case -999: { ManualLogSource logSource2 = SteamBypassMod.LogSource; BepInExWarningLogInterpolatedStringHandler val2 = new BepInExWarningLogInterpolatedStringHandler(33, 2, ref flag2); if (flag2) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("[LEVELS] member '"); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(text); ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("' not found on "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(type.Name); ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("."); } logSource2.LogWarning(val2); break; } case 0: case 1: case 2: case 3: case 4: case 5: { WriteIntMember(type, lobbySubUi, text, 6); flag = true; ManualLogSource logSource = SteamBypassMod.LogSource; BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(16, 3, ref flag2); if (flag2) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("[LEVELS] "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(text); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(": "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(num); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" -> "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(6); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("."); } logSource.LogInfo(val); break; } } } if (!flag) { return; } try { type.GetMethod("ApplyLevelSelectorVisibility", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic)?.Invoke(lobbySubUi, null); SteamBypassMod.LogSource.LogInfo((object)"[LEVELS] ApplyLevelSelectorVisibility re-applied — selector visible for all levels."); } catch (Exception ex) { ManualLogSource logSource3 = SteamBypassMod.LogSource; BepInExWarningLogInterpolatedStringHandler val2 = new BepInExWarningLogInterpolatedStringHandler(31, 1, ref flag2); if (flag2) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("[LEVELS] re-visibility failed: "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(ex.Message); } logSource3.LogWarning(val2); } } internal static int ReadIntMember(Type t, object instance, string name, int fallback) { try { PropertyInfo property = t.GetProperty(name, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); if (property != null) { return Convert.ToInt32(property.GetValue(instance)); } FieldInfo field = t.GetField(name, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); return (field == null) ? fallback : Convert.ToInt32(field.GetValue(instance)); } catch { return fallback; } } internal static void WriteIntMember(Type t, object instance, string name, int value) { PropertyInfo property = t.GetProperty(name, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); if (property != null && property.CanWrite) { property.SetValue(instance, value); } else { t.GetField(name, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic)?.SetValue(instance, value); } } public static void SetSelectedLevelServerRpcPrefix(ref int levelIndex) { //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Expected O, but got Unknown if (levelIndex < 10000 && (levelIndex < 0 || levelIndex > 6)) { int num = Math.Max(0, Math.Min(6, levelIndex)); ManualLogSource logSource = SteamBypassMod.LogSource; bool flag = default(bool); BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(70, 2, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("[LEVELS] SetSelectedLevelServerRpc: index "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(levelIndex); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" out of range — clamped to "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(num); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("."); } logSource.LogInfo(val); levelIndex = num; } } } } namespace System.Runtime.CompilerServices { [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 NullableAttribute(byte b) { } } [AttributeUsage(AttributeTargets.Class | AttributeTargets.Constructor | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Field, AllowMultiple = false, Inherited = false)] internal sealed class NullableContextAttribute : Attribute { public NullableContextAttribute(byte b) { } } [AttributeUsage(AttributeTargets.Class | AttributeTargets.Constructor | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Field, AllowMultiple = true, Inherited = false)] internal sealed class NullablePublicOnlyAttribute : Attribute { public NullablePublicOnlyAttribute(byte b) { } } }