* Rejig LogStringHandler * Fix session logs * Fix properly * comments * IAsType support * Fix mind logs * Fix mind logging AGAIN --------- Co-authored-by: PJB3005 <pieterjan.briers+git@gmail.com>
35 lines
911 B
C#
35 lines
911 B
C#
using System.Text.Json;
|
|
using System.Text.Json.Serialization;
|
|
|
|
namespace Content.Server.Administration.Logs.Converters;
|
|
|
|
public interface IAdminLogConverter
|
|
{
|
|
void Init(IDependencyCollection dependencies);
|
|
|
|
/// <summary>
|
|
/// Called after all converters have been added to the <see cref="JsonSerializerOptions"/>.
|
|
/// </summary>
|
|
void Init2(JsonSerializerOptions options)
|
|
{
|
|
}
|
|
}
|
|
|
|
public abstract class AdminLogConverter<T> : JsonConverter<T>, IAdminLogConverter
|
|
{
|
|
public virtual void Init(IDependencyCollection dependencies)
|
|
{
|
|
}
|
|
|
|
public virtual void Init2(JsonSerializerOptions options)
|
|
{
|
|
}
|
|
|
|
public override T Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
|
{
|
|
throw new NotSupportedException();
|
|
}
|
|
|
|
public abstract override void Write(Utf8JsonWriter writer, T value, JsonSerializerOptions options);
|
|
}
|