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
| Member | What it is |
|---|
private static ValueTuple<string, DateTime, ValueTuple<string, List<ModHandshake.Entry>, List<UntrackedMod>>> _cache | The last snapshot with its game folder and the time it was built. |
private static readonly object CacheLock | Lock around the snapshot cache. |
private const int CacheTtlSeconds | How long a mod snapshot is reused before Mods/ is read again (5 seconds). |
Methods
| Member | What 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
| Member | What 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. |