Table of Contents

Class WarfarePlayer

Namespace
Uncreated.Warfare.Players
Assembly
Uncreated.Warfare.dll
[CannotApplyEqualityOperator]
public class WarfarePlayer : IPlayer, ITranslationArgument, ICommandUser, IModerationActor, IComponentContainer<IPlayerComponent>, IComponentContainer, IEquatable<IPlayer>, IEquatable<WarfarePlayer>, ISpotter, ITransformObject
Inheritance
WarfarePlayer
Implements
Inherited Members
Extension Methods

Fields

FormatCharacterName

public static readonly SpecialFormat FormatCharacterName

Field Value

SpecialFormat

FormatColoredCharacterName

public static readonly SpecialFormat FormatColoredCharacterName

Field Value

SpecialFormat

FormatColoredDisplayOrCharacterName

public static readonly SpecialFormat FormatColoredDisplayOrCharacterName

Field Value

SpecialFormat

FormatColoredDisplayOrNickName

public static readonly SpecialFormat FormatColoredDisplayOrNickName

Field Value

SpecialFormat

FormatColoredDisplayOrPlayerName

public static readonly SpecialFormat FormatColoredDisplayOrPlayerName

Field Value

SpecialFormat

FormatColoredNickName

public static readonly SpecialFormat FormatColoredNickName

Field Value

SpecialFormat

FormatColoredPlayerName

public static readonly SpecialFormat FormatColoredPlayerName

Field Value

SpecialFormat

FormatColoredSteam64

public static readonly SpecialFormat FormatColoredSteam64

Field Value

SpecialFormat

FormatDisplayOrCharacterName

public static readonly SpecialFormat FormatDisplayOrCharacterName

Field Value

SpecialFormat

FormatDisplayOrNickName

public static readonly SpecialFormat FormatDisplayOrNickName

Field Value

SpecialFormat

FormatDisplayOrPlayerName

public static readonly SpecialFormat FormatDisplayOrPlayerName

Field Value

SpecialFormat

FormatNickName

public static readonly SpecialFormat FormatNickName

Field Value

SpecialFormat

FormatPlayerName

public static readonly SpecialFormat FormatPlayerName

Field Value

SpecialFormat

FormatSteam64

public static readonly SpecialFormat FormatSteam64

Field Value

SpecialFormat

Properties

CachedPoints

public ref PlayerPoints CachedPoints { get; }

Property Value

PlayerPoints

CachedReputation

public double CachedReputation { get; }

Property Value

double

CanInfluenceObjective

public bool CanInfluenceObjective { get; }

Property Value

bool

Components

List of auto-added components.

public IReadOnlyList<IPlayerComponent> Components { get; }

Property Value

IReadOnlyList<IPlayerComponent>

Connection

public ITransportConnection Connection { get; }

Property Value

ITransportConnection

CurrentSession

public SessionRecord CurrentSession { get; }

Property Value

SessionRecord

Data

Generic data persisting over the player's lifetime.

public ConcurrentDictionary<string, object?> Data { get; }

Property Value

ConcurrentDictionary<string, object>

DisconnectToken

A CancellationToken that cancels after the player leaves.

public CancellationToken DisconnectToken { get; }

Property Value

CancellationToken

DutyLevel

The player's current staff level. This will be correct even when off duty.

public DutyLevel DutyLevel { get; }

Property Value

DutyLevel

Remarks

This should not be used for permission checks, instead proper permissions should be created for instances like that.

GroupId

The Steam64 ID of the group the player's in.

public CSteamID GroupId { get; }

Property Value

CSteamID

IsConnecting

If the player's PlayerJoined event is still invoking.

public bool IsConnecting { get; }

Property Value

bool

IsDisconnected

If the player this object represents is currently offline. Set to true after the leave event is fired.

public bool IsDisconnected { get; }

Property Value

bool

IsDisconnecting

If the player this object represents is currently in the process of disconnecting.

public bool IsDisconnecting { get; }

Property Value

bool

IsFirstTimePlaying

public bool IsFirstTimePlaying { get; }

Property Value

bool

IsOnDuty

If the player is currently on duty.

public bool IsOnDuty { get; }

Property Value

bool

Remarks

This should not be used for permission checks, instead proper permissions should be created for instances like that.

IsOnline

If the player this object represents is currently online. Set to false after the leave event is fired.

public bool IsOnline { get; }

Property Value

bool

IsTesting

If this player was created for unit tests.

public bool IsTesting { get; }

Property Value

bool

JoinTime

public DateTime JoinTime { get; }

Property Value

DateTime

Locale

public WarfarePlayerLocale Locale { get; }

Property Value

WarfarePlayerLocale

Names

Structure including all variations of the player's names.

public ref PlayerNames Names { get; }

Property Value

PlayerNames

Position

The world position of the object.

public Vector3 Position { get; set; }

Property Value

Vector3

Exceptions

GameThreadException

Not on main thread.

NotSupportedException

Not able to set position.

Save

public BinaryPlayerSave Save { get; }

Property Value

BinaryPlayerSave

Steam64

public ref readonly CSteamID Steam64 { get; }

Property Value

CSteamID

SteamFriends

List of steam IDs of this player's friends, if theyre public.

public ulong[] SteamFriends { get; }

Property Value

ulong[]

Remarks

Private profiles will just have an empty array here.

SteamPlayer

public SteamPlayer SteamPlayer { get; }

Property Value

SteamPlayer

SteamSummary

public PlayerSummary SteamSummary { get; }

Property Value

PlayerSummary

Team

The team to show spotted effects to.

public Team Team { get; }

Property Value

Team

Transform

public Transform Transform { get; }

Property Value

Transform

UnturnedPlayer

public Player UnturnedPlayer { get; }

Property Value

Player

Yaw

public float Yaw { get; }

Property Value

float

Methods

Component(Type)

Get the given component type from a list of components.

[Pure]
public object Component(Type t)

Parameters

t Type

Returns

object

Remarks

Always returns a value or throws an exception.

Exceptions

ComponentNotFoundException

Component not found.

ComponentOrNull(Type)

Get the given component type from a list of components.

[Pure]
public object? ComponentOrNull(Type t)

Parameters

t Type

Returns

object

ComponentOrNull<TComponentType>()

Get the given component type from a list of components.

[Pure]
public TComponentType? ComponentOrNull<TComponentType>() where TComponentType : class, IPlayerComponent

Returns

TComponentType

Type Parameters

TComponentType

Component<TComponentType>()

Get the given component type from a list of components.

[Pure]
public TComponentType Component<TComponentType>() where TComponentType : class, IPlayerComponent

Returns

TComponentType

Type Parameters

TComponentType

Remarks

Always returns a value or throws an exception.

Exceptions

ComponentNotFoundException

Component not found.

Equals(Player?)

public bool Equals(Player? other)

Parameters

other Player

Returns

bool

Equals(SteamPlayer?)

public bool Equals(SteamPlayer? other)

Parameters

other SteamPlayer

Returns

bool

Equals(SteamPlayerID?)

public bool Equals(SteamPlayerID? other)

Parameters

other SteamPlayerID

Returns

bool

Equals(CSteamID)

public bool Equals(CSteamID steam64)

Parameters

steam64 CSteamID

Returns

bool

Equals(object?)

Determines whether the specified object is equal to the current object.

public override bool Equals(object? obj)

Parameters

obj object

The object to compare with the current object.

Returns

bool

true if the specified object is equal to the current object; otherwise, false.

Equals(ulong)

public bool Equals(ulong steam64)

Parameters

steam64 ulong

Returns

bool

Equals(IPlayer?)

Indicates whether the current object is equal to another object of the same type.

public bool Equals(IPlayer? other)

Parameters

other IPlayer

An object to compare with this object.

Returns

bool

true if the current object is equal to the other parameter; otherwise, false.

Equals(WarfarePlayer?)

Indicates whether the current object is equal to another object of the same type.

public bool Equals(WarfarePlayer? other)

Parameters

other WarfarePlayer

An object to compare with this object.

Returns

bool

true if the current object is equal to the other parameter; otherwise, false.

GetHashCode()

Serves as the default hash function.

public override int GetHashCode()

Returns

int

A hash code for the current object.

GetModalHandle()

public ModalHandle GetModalHandle()

Returns

ModalHandle

GetModerationActor()

Create an IModerationActor for this command actor.

public IModerationActor GetModerationActor()

Returns

IModerationActor

Exceptions

NotSupportedException

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

A string that represents the current object.