mirror of
https://github.com/Empostor/Empostor.git
synced 2026-10-20 01:46:07 +00:00
21 lines
711 B
C#
21 lines
711 B
C#
using System.Runtime.CompilerServices;
|
|
using Empostor.Api.Net;
|
|
|
|
namespace Empostor.Server.Service.Reactor
|
|
{
|
|
|
|
public static class ReactorModExtensions
|
|
{
|
|
private static readonly ConditionalWeakTable<IHazelConnection, ReactorModInfo> Table = new();
|
|
|
|
public static ReactorModInfo? GetReactorMods(this IClient client)
|
|
=> client.Connection?.GetReactorMods();
|
|
|
|
public static ReactorModInfo? GetReactorMods(this IHazelConnection connection)
|
|
=> Table.TryGetValue(connection, out var info) ? info : null;
|
|
|
|
internal static void SetReactorMods(this IHazelConnection connection, ReactorModInfo info)
|
|
=> Table.AddOrUpdate(connection, info);
|
|
}
|
|
}
|