Table of Contents

Class WarfareModule

Namespace
Uncreated.Warfare
Assembly
Uncreated.Warfare.dll
public sealed class WarfareModule
Inheritance
WarfareModule
Inherited Members

Fields

Season

The current season.

public static readonly int Season

Field Value

int

Properties

Configuration

System Config.yml. Stores information not directly related to gameplay.

public IConfiguration Configuration { get; }

Property Value

IConfiguration

EventDispatcher

Static instance of the event dispatcher singleton for harmony patches to access it.

public static EventDispatcher EventDispatcher { get; }

Property Value

EventDispatcher

Remarks

Do not use unless in a patch.

FileProvider

Handles tracking file changing and configuration for any files in Servers/[Server ID]/Warfare/.

public PhysicalFileProvider FileProvider { get; }

Property Value

PhysicalFileProvider

GlobalLogger

A global logger that can be used from patches mainly.

public ILogger GlobalLogger { get; }

Property Value

ILogger

HomeDirectory

A path to the top-level 'Warfare' folder.

public string HomeDirectory { get; }

Property Value

string

IsActive

If Uncreated.Warfare is loaded as a module instead of as a library.

public static bool IsActive { get; }

Property Value

bool

ScopedProvider

Game-specific service provider. If a game is not active, this will throw an error.

public ILifetimeScope ScopedProvider { get; }

Property Value

ILifetimeScope

Exceptions

InvalidOperationException

ServiceProvider

Global service provider. Gamemodes have their own scoped service providers and should be used instead.

public IContainer ServiceProvider { get; }

Property Value

IContainer

Singleton

Static instance of this module singleton for harmony patches to access it.

public static WarfareModule Singleton { get; }

Property Value

WarfareModule

Remarks

Do not use unless in a patch.

UnloadToken

Token that will cancel when the module shuts down.

public CancellationToken UnloadToken { get; }

Property Value

CancellationToken

Methods

CreateActivitySource()

public static ActivitySource CreateActivitySource()

Returns

ActivitySource

GetActiveLayout()

Get the active layout.

public Layout GetActiveLayout()

Returns

Layout

Exceptions

InvalidOperationException

There is not an active layout.

IsLayoutActive()

Check if there is an active layout.

public bool IsLayoutActive()

Returns

bool

ShutdownAsync(string, CancellationToken)

public UniTask ShutdownAsync(string reason, CancellationToken token = default)

Parameters

reason string
token CancellationToken

Returns

UniTask

Events

LayoutStarted

public event Action? LayoutStarted

Event Type

Action