Skip to content

LoginDeferral

Namespace Mc.Scripting.Events · Kind class (sealed)

public sealed class LoginDeferral : IDisposable, IPluginResource

A login held by a plugin (see PlayerPreLoginEvent.Defer). Completing it is thread-safe and happens once.

Member Description
bool IsCompleted { get; } Whether the deferral was already completed.
static Component UnloadDenyMessage { get; set; } What a player sees when the plugin holding his login unloaded before it answered (the safe default: a check that never finished is not a pass).
public bool IsCompleted { get; }

Whether the deferral was already completed.

public static Component UnloadDenyMessage { get; set; }

What a player sees when the plugin holding his login unloaded before it answered (the safe default: a check that never finished is not a pass).

Member Description
void Allow() Lets the login continue.
void Deny(Component? reason = null) Refuses the login.
void Dispose() The plugin unloaded with the deferral pending: the login is refused with LoginDeferral.UnloadDenyMessage.
public void Allow()

Lets the login continue. Callable from any thread.

public void Deny(Component? reason = null)

Refuses the login. Callable from any thread.

Parameters

Name Type Description
reason Component? = null Shown on the disconnect screen (a generic message when null).
public void Dispose()

The plugin unloaded with the deferral pending: the login is refused with LoginDeferral.UnloadDenyMessage. A check that never answered (a ban list lookup) must not turn into a pass; the player just reconnects. Complete the deferral yourself with LoginDeferral.Allow to decide otherwise.

Component · IPluginResource