LoginDeferral
Namespace Mc.Scripting.Events · Kind class (sealed)
public sealed class LoginDeferral : IDisposable, IPluginResourceA login held by a plugin (see PlayerPreLoginEvent.Defer). Completing it is thread-safe and happens once.
Properties
Section titled “Properties”| 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). |
IsCompleted
Section titled “IsCompleted”public bool IsCompleted { get; }Whether the deferral was already completed.
UnloadDenyMessage
Section titled “UnloadDenyMessage”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).
Methods
Section titled “Methods”| 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). |
Dispose
Section titled “Dispose”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.