Table of Contents

Class DutyService

Namespace
Uncreated.Warfare.Players.Permissions
Assembly
Uncreated.Warfare.dll
[GenerateRpcSource]
[RpcGeneratedProxyType(TypeSetupMethodName = "__ModularRpcsGeneratedSetupStaticGeneratedProxy")]
public class DutyService : IAsyncEventListener<PlayerLeft>
Inheritance
DutyService
Implements
Inherited Members

Constructors

DutyService(SignInstancer, TranslationInjection<DutyCommandTranslations>, ChatService, ILogger<DutyService>, UserPermissionStore, IConfiguration, IPlayerService, DutyUI, ZoneStore)

public DutyService(SignInstancer signs, TranslationInjection<DutyCommandTranslations> translations, ChatService chatService, ILogger<DutyService> logger, UserPermissionStore permissionStore, IConfiguration configuration, IPlayerService playerService, DutyUI dutyUi, ZoneStore zoneStore)

Parameters

signs SignInstancer
translations TranslationInjection<DutyCommandTranslations>
chatService ChatService
logger ILogger<DutyService>
permissionStore UserPermissionStore
configuration IConfiguration
playerService IPlayerService
dutyUi DutyUI
zoneStore ZoneStore

Fields

PermissionFreecam

public static readonly PermissionLeaf PermissionFreecam

Field Value

PermissionLeaf

PermissionWorkzone

public static readonly PermissionLeaf PermissionWorkzone

Field Value

PermissionLeaf

Properties

AdminOffDuty

public string AdminOffDuty { get; }

Property Value

string

AdminOnDuty

public string AdminOnDuty { get; }

Property Value

string

Owner

public string Owner { get; }

Property Value

string

StaffOffDuty

public string StaffOffDuty { get; }

Property Value

string

StaffOnDuty

public string StaffOnDuty { get; }

Property Value

string

TrialOffDuty

public string TrialOffDuty { get; }

Property Value

string

TrialOnDuty

public string TrialOnDuty { get; }

Property Value

string

Methods

CheckDutyStateAsync(CSteamID, bool, CancellationToken)

public Task<(DutyLevel Level, bool IsOnDuty)> CheckDutyStateAsync(CSteamID player, bool validatePermissions, CancellationToken token = default)

Parameters

player CSteamID
validatePermissions bool
token CancellationToken

Returns

Task<(DutyLevel Level, bool IsOnDuty)>

SendDutyChanged(ulong, DutyLevel, bool)

[RpcSend]
protected RpcTask SendDutyChanged(ulong steam64, DutyLevel level, bool isOnDuty)

Parameters

steam64 ulong
level DutyLevel
isOnDuty bool

Returns

RpcTask

SetDutyStateAsync(CSteamID, bool, CancellationToken)

Sets the player's duty state to whatever it isn't currently.

[RpcReceive]
public Task<bool> SetDutyStateAsync(CSteamID steam64, bool isOnDuty, CancellationToken token = default)

Parameters

steam64 CSteamID
isOnDuty bool
token CancellationToken

Returns

Task<bool>

true if the player's duty state was set, otherwise false because they are already in the requested duty state or are not staff.

ToggleDutyStateAsync(CSteamID, CancellationToken)

Switch the player's duty state to whatever it isn't currently.

[RpcReceive]
public Task<bool> ToggleDutyStateAsync(CSteamID player, CancellationToken token = default)

Parameters

player CSteamID
token CancellationToken

Returns

Task<bool>

true if the player's duty state was toggled, otherwise false because the player is not staff.