banner
Rating
Voted0

LobbyCompatibility

1
Mod version:1
Game version:1.2.0
The mod has been successfully tested for the absence of viruses
1649.29K15.33K

Report mod

  • image
modalImage

About This Mod

Lobby compatibility

Build Latest Version of Thunderstore NuGet Version Download


This mod is designed to improve the compatibility and navigation of vanilla and mod lobbies.


For players

Lobby scanner.

This mod will tell you whether a particular lobby is incompatible with installed mods, and which mods you need to upgrade, downgrade, download, or delete to join this lobby.


In the lower left corner of each lobby, an icon will appear in the lobby browser, hovering over which you will be able to see additional information (e.g. incompatibility, what mode causes incompatibility, etc.).


Hover over the Lobby Compatibility icon.


Click the icon to see detailed information about the list of modes, the scroll bar will show all modes necessary to connect to this server. Note that this will only work on servers where this mode works.


Lobby Compatibility Modal


If you attempt to connect to a server (public or private) with incompatible or missing modes, an error will be displayed informing you that the required mode is missing.


Failed to connect to the lobby due to incompatible or missing mods


Leaderboards.

This mod adds a separate mod leaderboard to make it easier to compare with friends. The goal is to separate vanilla and mod leaders so that mod (which may be simpler or more complicated than vanilla) does not mix with vanilla.


For developers.

To use this, you need to add a reference to the TeamBMX.LobbyCompatibility package to your .csproj file. You can use the following code:


<ItemGroup>

    <PackageReference Include="TeamBMX.LobbyCompatibility" Version="1.*" PrivateAssets="all" />

</ItemGroup>

You can also add links using the IDE interface: In Visual Studio 2022, click the Project pull-down menu, and then select Manage NuGet Packages; in Visual Studio 2022, click TeamBMX. LobbyCompatibility, and you can add it from there.


Usage

Attributes.

Add [LobbyCompatibility(CompatibilityLevel, VersionStrictness)] on top of the plugin class:


// .

[BepInPlugin(PluginInfo.PLUGIN_GUID, PluginInfo.PLUGIN_NAME, PluginInfo.PLUGIN_VERSION)]


[LobbyCompatibility(CompatibilityLevel = CompatibilityLevel.Everyone, VersionStrictness = VersionStrictness.Minor)].

MyPlugin : BaseUnityPlugin class.

{

  // .

}

The following enumerated types are used


Compatibility Level

For customers only.

The mode only affects clients.

VersionStrictness does not apply.

Server only.

The mod affects only the server and can indirectly affect the client, even if the client does not install it.

The mod is only required on the server; VersionStrictness is only applied if the mod is installed on the client.

For everyone.

Mods affect both the client and the server and add functionality that must be installed on both.

Modes must be installed on the server and client. Version control depends on VersionStrictness.

Client options.

Not all clients need to install the mod, but if it is installed, it must be installed on the server. Typically used for mods that add additional (optional) functionality to the client if it is installed on the server.

The Mod must be installed on the server. Version control depends on VersionStrictness.

VersionStrictness.

No

No version control (x.x.x.x)

Major.

Must be the same major version (1.x.x)

Minor

The minor and major versions must be the same (1.1.x)

Patch

Patch, minor and major versions must be the same (1.1.1)

Method.

Another way to support software dependencies is to use the PluginHelper.RegisterPlugin method:


public static void RegisterPlugin(string guid, Version version, CompatibilityLevel compatibilityLevel, VersionStrictness versionStrictness)

Important.


This method must be called in the Awake method of the plugin's main class. Obtaining and using lobby differentials

If you want to use the difference between the lobby (the difference between the lobby and the modes installed on the client), you can use LobbyCompatibility.Features.LobbyHelper.GetLobbyDiff(Lobby lobby) as follows


GetLobbyDiff(Lobby lobby) using LobbyCompatibility.Features.LobbyHelper;

Steamworks.Data;


/* . */


// No data is returned because the lobby does not exist.

Lobby lobby = new();

LobbyDiff lobbyDiff = LobbyHelper.GetLobbyDiff(lobby);

In the future, if you want to check if a certain mod has been uploaded to the lobby, you can do the following


if (lobbyDiff.PluginDiffs.Any(diff => diff.GUID == «example.guid» && diff.ServerVersion . = null)))))

{

  /* Code */

}

diff.ServerVersion . = null Used to check if the mod is installed on the lobby/server.

Similar Mods/Addons

Game Version *

1.2.0 (BMX-LobbyCompatibility-1.2.0.zip)