Table of Contents

Class ModerationEntry

Namespace
Uncreated.Warfare.Moderation
Assembly
Uncreated.Warfare.dll

Base class for a moderation record for a player. All punishments and commendations derive from this.

[JsonConverter(typeof(ModerationEntryConverter))]
public abstract class ModerationEntry : IModerationEntry
Inheritance
ModerationEntry
Implements
Derived
Inherited Members

Fields

MaxEntry

public static readonly ModerationEntryType MaxEntry

Field Value

ModerationEntryType

Properties

Actors

Other related players, including admins.

[JsonPropertyName("actors")]
public RelatedActor[] Actors { get; set; }

Property Value

RelatedActor[]

DiscordMessageId

Message ID of the offense or report message, if applicable, otherwise 0.

[JsonPropertyName("discord_message_id")]
public ulong DiscordMessageId { get; set; }

Property Value

ulong

Evidence

URL's to video/photo evidence.

[JsonPropertyName("evidence")]
public Evidence[] Evidence { get; set; }

Property Value

Evidence[]

Id

Unique ID to all types of entries.

[JsonPropertyName("id")]
public uint Id { get; set; }

Property Value

uint

IsAppealable

[JsonIgnore]
public virtual bool IsAppealable { get; }

Property Value

bool

IsLegacy

If the entry was from before the moderation rewrite.

[JsonPropertyName("is_legacy")]
public bool IsLegacy { get; set; }

Property Value

bool

LegacyId

Unique legacy ID to only this type of entry. Only will exist when IsLegacy is true.

[JsonPropertyName("legacy_id")]
public uint? LegacyId { get; set; }

Property Value

uint?

Message

Short message about the player.

[JsonPropertyName("message")]
public string? Message { get; set; }

Property Value

string

PendingReputation

If this entry's reputation change has been applied.

[JsonPropertyName("pending_reputation")]
public double PendingReputation { get; set; }

Property Value

double

Player

Steam64 ID for the target player.

[JsonPropertyName("target_steam_64")]
public ulong Player { get; set; }

Property Value

ulong

RelatedEntries

Related moderation entries to this one.

[JsonIgnore]
public ModerationEntry?[]? RelatedEntries { get; set; }

Property Value

ModerationEntry[]

RelatedEntryKeys

The keys of related moderation entries.

[JsonPropertyName("related_entries")]
public uint[] RelatedEntryKeys { get; set; }

Property Value

uint[]

RelevantLogsBegin

Start time of ActionLogs relevant to this entry.

[JsonPropertyName("relevant_logs_begin_utc")]
public DateTimeOffset? RelevantLogsBegin { get; set; }

Property Value

DateTimeOffset?

RelevantLogsEnd

End time of ActionLogs relevant to this entry.

[JsonPropertyName("relevant_logs_end_utc")]
public DateTimeOffset? RelevantLogsEnd { get; set; }

Property Value

DateTimeOffset?

Removed

If the moderation entry was removed.

[JsonPropertyName("is_removed")]
public bool Removed { get; set; }

Property Value

bool

RemovedBy

Who removed the moderation entry.

[JsonPropertyName("removing_actor")]
[JsonConverter(typeof(ActorConverter))]
public IModerationActor? RemovedBy { get; set; }

Property Value

IModerationActor

RemovedMessage

Why the moderation entry was removed.

[JsonPropertyName("removed_message")]
public string? RemovedMessage { get; set; }

Property Value

string

RemovedTimestamp

When the moderation entry was removed.

[JsonPropertyName("removed_timestamp_utc")]
public DateTimeOffset? RemovedTimestamp { get; set; }

Property Value

DateTimeOffset?

Reputation

Effect this entry has on the player's reputation. Negative for punishments, positive for commendations.

[JsonPropertyName("reputation")]
public double Reputation { get; set; }

Property Value

double

ResolvedTimestamp

When the entry was finished, i.e. when a punishment was handed out. null if the entry is still in progress.

[JsonPropertyName("resolved_utc")]
public DateTimeOffset? ResolvedTimestamp { get; set; }

Property Value

DateTimeOffset?

StartedTimestamp

When the entry was started, i.e. when an offense was reported.

[JsonPropertyName("started_utc")]
public DateTimeOffset StartedTimestamp { get; set; }

Property Value

DateTimeOffset

Methods

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

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

Parameters

db DatabaseInterface
workingList List<string>
formatter IFormatProvider
token CancellationToken

Returns

Task

GetDisplayMessage()

public virtual string? GetDisplayMessage()

Returns

string

GetDisplayName()

public virtual string GetDisplayName()

Returns

string

GetIcon()

public virtual Guid? GetIcon()

Returns

Guid?

Read(ByteReader)

public static ModerationEntry Read(ByteReader reader)

Parameters

reader ByteReader

Returns

ModerationEntry

ReadIntl(ByteReader, ushort)

protected virtual void ReadIntl(ByteReader reader, ushort version)

Parameters

reader ByteReader
version ushort

ReadProperty(ref Utf8JsonReader, string, JsonSerializerOptions)

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

Parameters

reader Utf8JsonReader
propertyName string
options JsonSerializerOptions

Returns

bool

TryGetActor(string, out RelatedActor)

public bool TryGetActor(string role, out RelatedActor actor)

Parameters

role string
actor RelatedActor

Returns

bool

TryGetDisplayActor(out RelatedActor)

public virtual bool TryGetDisplayActor(out RelatedActor actor)

Parameters

actor RelatedActor

Returns

bool

TryGetPrimaryAdmin(out RelatedActor)

public bool TryGetPrimaryAdmin(out RelatedActor actor)

Parameters

actor RelatedActor

Returns

bool

Write(ByteWriter, ModerationEntry)

public static void Write(ByteWriter writer, ModerationEntry entry)

Parameters

writer ByteWriter
entry ModerationEntry

Write(Utf8JsonWriter, JsonSerializerOptions)

public virtual void Write(Utf8JsonWriter writer, JsonSerializerOptions options)

Parameters

writer Utf8JsonWriter
options JsonSerializerOptions

WriteIntl(ByteWriter)

protected virtual void WriteIntl(ByteWriter writer)

Parameters

writer ByteWriter