Table of Contents

Class PlayerChatRequested

Namespace
Uncreated.Warfare.Events.Models.Players
Assembly
Uncreated.Warfare.dll

Invoked when a player tries to send a chat message.

[EventModel(EventSynchronizationContext.PerPlayer)]
public class PlayerChatRequested : CancellablePlayerEvent, IPlayerEvent, ICancellable
Inheritance
PlayerChatRequested
Implements
Inherited Members

Properties

AllowRichText

If rich text should be allowed.

public required bool AllowRichText { get; set; }

Property Value

bool

ChatMode

The broadcast mode.

public required EChatMode ChatMode { get; set; }

Property Value

EChatMode

Exceptions

ArgumentOutOfRangeException

HasAdminChatPermissions

If the caller has permission to bypass checks for chat.

public required bool HasAdminChatPermissions { get; init; }

Property Value

bool

IconUrlOverride

Custom icon to use instead of the player's profile picture.

public required string? IconUrlOverride { get; set; }

Property Value

string

Remarks

null = the sender's profile picture.

IsUnityMessage

If the message came from an event hook.

public required bool IsUnityMessage { get; init; }

Property Value

bool

MessageColor

The color of the message.

public required Color MessageColor { get; set; }

Property Value

Color

OriginalText

The original text the player sent.

public required string OriginalText { get; init; }

Property Value

string

PlayerName

The player's names to be formatted into the message for each player.

public required PlayerNames PlayerName { get; set; }

Property Value

PlayerNames

Prefix

The text that will be sent in front of the message.

public required string Prefix { get; set; }

Property Value

string

ShouldReplicate

If the chat message should be sent out instead of just ignored.

public required bool ShouldReplicate { get; set; }

Property Value

bool

Remarks

Note this is not the same as cancelling the event because PlayerChatSent will still get dispatched.

TargetPlayers

Getter for a list of all players the message should be sent to.

public required Func<PlayerChatRequested, IEnumerable<WarfarePlayer>> TargetPlayers { get; set; }

Property Value

Func<PlayerChatRequested, IEnumerable<WarfarePlayer>>

Text

The text that will be sent to everyone else.

public required string Text { get; set; }

Property Value

string