diff --git a/LobbyCompatibility/Features/LobbyHelper.cs b/LobbyCompatibility/Features/LobbyHelper.cs index fc26bdf..0e24abe 100644 --- a/LobbyCompatibility/Features/LobbyHelper.cs +++ b/LobbyCompatibility/Features/LobbyHelper.cs @@ -21,6 +21,7 @@ public static class LobbyHelper public static LobbyDistanceFilter? LatestLobbyRequestDistanceFilter; private static List? _clientPlugins; public static LobbyDiff LatestLobbyDiff { get; private set; } = new(new List()); + public static IEnumerable>? LatestLobbyData { get; internal set; } private static Dictionary LobbyDiffCache { get; } = new(); /// diff --git a/LobbyCompatibility/Patches/LobbyDataIsJoinablePostfix.cs b/LobbyCompatibility/Patches/LobbyDataIsJoinablePostfix.cs index bb34233..19192f7 100644 --- a/LobbyCompatibility/Patches/LobbyDataIsJoinablePostfix.cs +++ b/LobbyCompatibility/Patches/LobbyDataIsJoinablePostfix.cs @@ -20,6 +20,8 @@ internal static class LobbyDataIsJoinablePostfix [HarmonyPostfix] private static bool Postfix(bool isJoinable, ref Lobby lobby) { + LobbyHelper.LatestLobbyData = lobby.Data; + // If original result was false, return false -- if lobby is modded through our mod, it will be Joinable || JoinableModded if (!isJoinable) return false; diff --git a/LobbyCompatibility/Patches/SetLoadingScreenPrefix.cs b/LobbyCompatibility/Patches/SetLoadingScreenPrefix.cs index c72efcf..0427e92 100644 --- a/LobbyCompatibility/Patches/SetLoadingScreenPrefix.cs +++ b/LobbyCompatibility/Patches/SetLoadingScreenPrefix.cs @@ -2,6 +2,7 @@ using LobbyCompatibility.Behaviours; using LobbyCompatibility.Features; using Steamworks; +using Steamworks.Data; namespace LobbyCompatibility.Patches; @@ -24,9 +25,8 @@ private static bool Prefix(bool isLoading, RoomEnter result, MenuManager __insta if (result != RoomEnter.Error) return true; - LobbyCompatibilityPlugin.Logger?.LogDebug("Error while joining! Logging Diff..."); - LobbyCompatibilityPlugin.Logger?.LogDebug( - LobbyHelper.LatestLobbyDiff.PluginDiffs.Join(converter: diff => diff.GetDisplayText())); + LobbyCompatibilityPlugin.Logger?.LogDebug(LobbyHelper.LatestLobbyData.Join()); + LobbyCompatibilityPlugin.Logger?.LogDebug(PluginHelper.GetAllPluginInfo().CalculateCompatibilityLevel(lobbyData: LobbyHelper.LatestLobbyData).Join()); if (!string.IsNullOrEmpty(GameNetworkManager.Instance.disconnectionReasonMessage)) return true; diff --git a/LobbyCompatibility/Patches/SteamMatchmakingOnLobbyCreatedPostfix.cs b/LobbyCompatibility/Patches/SteamMatchmakingOnLobbyCreatedPostfix.cs index 46ea4c7..bd5e6ea 100644 --- a/LobbyCompatibility/Patches/SteamMatchmakingOnLobbyCreatedPostfix.cs +++ b/LobbyCompatibility/Patches/SteamMatchmakingOnLobbyCreatedPostfix.cs @@ -58,5 +58,8 @@ private static void Postfix(Result result, ref Lobby lobby) if (lobby.GetData(LobbyMetadata.Tag) == "none") lobby.SetData(LobbyMetadata.Tag, "modded"); } + + // Log Lobby Data + LobbyCompatibilityPlugin.Logger?.LogDebug(lobby.Data.Join()); } } \ No newline at end of file