Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions LobbyCompatibility/Features/LobbyHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ public static class LobbyHelper
public static LobbyDistanceFilter? LatestLobbyRequestDistanceFilter;
private static List<PluginInfoRecord>? _clientPlugins;
public static LobbyDiff LatestLobbyDiff { get; private set; } = new(new List<PluginDiff>());
public static IEnumerable<KeyValuePair<string, string>>? LatestLobbyData { get; internal set; }
private static Dictionary<ulong, LobbyDiff> LobbyDiffCache { get; } = new();

/// <summary>
Expand Down
2 changes: 2 additions & 0 deletions LobbyCompatibility/Patches/LobbyDataIsJoinablePostfix.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
6 changes: 3 additions & 3 deletions LobbyCompatibility/Patches/SetLoadingScreenPrefix.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using LobbyCompatibility.Behaviours;
using LobbyCompatibility.Features;
using Steamworks;
using Steamworks.Data;

namespace LobbyCompatibility.Patches;

Expand All @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
}