Skip to main content

ModHandshake

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

The server's mod snapshot for the auth port's ping, mods_list and the join's parity check, cached for 5 seconds.

Fields​

3 private and internal fields
MemberWhat it is
private static ValueTuple<string, DateTime, ValueTuple<string, List<ModHandshake.Entry>, List<UntrackedMod>>> _cacheThe last snapshot with its game folder and the time it was built.
private static readonly object CacheLockLock around the snapshot cache.
private const int CacheTtlSecondsHow long a mod snapshot is reused before Mods/ is read again (5 seconds).

Methods​

MemberWhat it is
static ValueTuple<string, List<ModHandshake.Entry>, List<UntrackedMod>> Snapshot(string gameDir)The enabled mods installed for server, sorted by id, the enabled untracked mods, and a hash of both.
2 private and internal methods
MemberWhat it is
private static ValueTuple<string, List<ModHandshake.Entry>, List<UntrackedMod>> BuildSnapshot(string gameDir)Scans Mods/ and builds the mod hash, the list of enabled server mods, and the untracked mods.
private static string UntrackedStamp(string gameDir, UntrackedMod mod)Returns the last write time, in Unix seconds, of an untracked mod, or ? if it can't be read.