Skip to main content

ModParity

A static class in TavernLib, TavernLib.Backend.Auth.

Checks a joining player's mods against the server's parity_required mods, behind the launcher's own pre-join check. Also builds the refusal the client recognises.

Fields​

MemberWhat it is
const int MaxReasonBytes700, the most the refusal's mod list may take, so it fits in one game message.
const string MismatchReasonPrefixMod mismatch: , which starts a mod refusal. JoinRejectionRecorder looks for it on the client.

Methods​

MemberWhat it is
static bool BlocksClaimless(ModHandshake.Entry mod)True for a parity_required mod with a Windows or Android client build: it refuses a player who sent no mod list.
static List<ModParity.RequiredMod> CheckJoin(List<ModHandshake.Entry> serverMods, Dictionary<string, string> clientMods)The server's parity mods with a Windows build that the player lacks or has another version of. With no list, every BlocksClaimless mod.
static string LocalMods(string gameDir)Client: JSON of id to version for the enabled mods installed for client_windows, the list the launcher sends.
static string RefusalReason(List<ModParity.RequiredMod> mismatches)The prefix and a JSON list of the mismatched mods, cut to fit 700 bytes but always naming at least one.