Skip to content

Commit

Permalink
Fixed additional LAN exception
Browse files Browse the repository at this point in the history
  • Loading branch information
1A3Dev committed Nov 4, 2024
1 parent e8c5020 commit 450e538
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
3 changes: 2 additions & 1 deletion LobbyCompatibility/Behaviours/ModdedLobbySlot.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ internal void Setup(LobbySlot lobbySlot)
_lobbySlot = lobbySlot;

// Get the "diff" of the lobby
_lobbyDiff = LobbyHelper.GetLobbyDiff(_lobbySlot.thisLobby);
if (_lobbyDiff == null || !GameNetworkManager.Instance || !GameNetworkManager.Instance.disableSteam)
_lobbyDiff = LobbyHelper.GetLobbyDiff(_lobbySlot.thisLobby);

// Find player count text (could be moved/removed in a future update, but unlikely)
var playerCount = _lobbySlot.playerCount;
Expand Down
9 changes: 6 additions & 3 deletions LobbyCompatibility/Features/LobbyHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,13 @@ internal static LobbyDiff GetLobbyDiff(Lobby? lobby, string? lobbyPluginString)
internal static string GetLobbyPlugins(Lobby lobby)
{
var lobbyPluginStrings = new List<string>();
var i = 0;

do lobbyPluginStrings.Insert(i, lobby.GetData($"{LobbyMetadata.Plugins}{i}"));
while (lobbyPluginStrings[i++].Contains("@"));
if (GameNetworkManager.Instance && !GameNetworkManager.Instance.disableSteam)
{
var i = 0;
do lobbyPluginStrings.Insert(i, lobby.GetData($"{LobbyMetadata.Plugins}{i}"));
while (lobbyPluginStrings[i++].Contains("@"));
}

return lobbyPluginStrings
.Join(delimiter: string.Empty)
Expand Down

0 comments on commit 450e538

Please sign in to comment.