Table of Contents

Class Punishment

Namespace
Uncreated.Warfare.Moderation.Punishments
Assembly
Uncreated.Warfare.dll
[JsonConverter(typeof(ModerationEntryConverter))]
public abstract class Punishment : ModerationEntry, IModerationEntry
Inheritance
Punishment
Implements
Derived
Inherited Members

Properties

AppealKeys

Keys for all related appeals.

[JsonPropertyName("appeals")]
public uint[] AppealKeys { get; set; }

Property Value

uint[]

Appeals

All related appeals.

[JsonPropertyName("appeals_detail")]
public Appeal?[]? Appeals { get; set; }

Property Value

Appeal[]

PresetLevel

Level of preset (indexed from 1).

[JsonPropertyName("preset_level")]
public int PresetLevel { get; set; }

Property Value

int

PresetType

Type of preset.

[JsonPropertyName("preset_type")]
[JsonConverter(typeof(JsonStringEnumConverter))]
public PresetType PresetType { get; set; }

Property Value

PresetType

ReportKeys

Keys for all related reports.

[JsonPropertyName("reports")]
public uint[] ReportKeys { get; set; }

Property Value

uint[]

Reports

All related reports.

[JsonPropertyName("reports_detail")]
public Report?[]? Reports { get; set; }

Property Value

Report[]

Methods

AddExtraInfo(DatabaseInterface, List<string>, IFormatProvider, CancellationToken)

public override Task AddExtraInfo(DatabaseInterface db, List<string> workingList, IFormatProvider formatter, CancellationToken token = default)

Parameters

db DatabaseInterface
workingList List<string>
formatter IFormatProvider
token CancellationToken

Returns

Task

ReadIntl(ByteReader, ushort)

protected override void ReadIntl(ByteReader reader, ushort version)

Parameters

reader ByteReader
version ushort

ReadProperty(ref Utf8JsonReader, string, JsonSerializerOptions)

public override bool ReadProperty(ref Utf8JsonReader reader, string propertyName, JsonSerializerOptions options)

Parameters

reader Utf8JsonReader
propertyName string
options JsonSerializerOptions

Returns

bool

TryFindAppeal(out Appeal, bool)

Try to find a resolved appeal with a state matching the value for state in Appeals.

public bool TryFindAppeal(out Appeal appeal, bool state = true)

Parameters

appeal Appeal

The first matching appeal found.

state bool

Which state to look for, defaults to accepted.

Returns

bool

true if an appeal is found.

Write(Utf8JsonWriter, JsonSerializerOptions)

public override void Write(Utf8JsonWriter writer, JsonSerializerOptions options)

Parameters

writer Utf8JsonWriter
options JsonSerializerOptions

WriteIntl(ByteWriter)

protected override void WriteIntl(ByteWriter writer)

Parameters

writer ByteWriter