Class CharacterEditLock
- Namespace
- FishMMO.ControlPanel.Services
- Assembly
- FishMMO-ControlPanel.dll
Whether a character's stored row may be written from the panel.
public sealed class CharacterEditLock
- Inheritance
-
CharacterEditLock
- Inherited Members
Remarks
A live character's row is not authoritative. Its state lives in the owning scene server's memory, and the persistence pass writes that memory over the row — name included. So an edit made here while a server holds the lease is not merely racy, it is reliably lost on the next save.
The lease is the test, not the online flag: a server that crashed leaves
session_state = Online behind, and waiting for that to be cleaned up by hand
would lock the character out of the editor forever. An expired lease is no lease.
Properties
Editable
Whether the panel may write to this row.
public bool Editable { get; init; }
Property Value
LeaseExpiresUtc
When the lease lapses, when one is held.
public DateTime? LeaseExpiresUtc { get; init; }
Property Value
Message
Human-readable explanation, shown to the operator as-is.
public string Message { get; init; }
Property Value
OwnerServerId
The scene server holding the lease, when one does.
public long OwnerServerId { get; init; }
Property Value
Reason
Why not: offline, lease or deleted.
public string Reason { get; init; }
Property Value
Methods
For(CharacterAdminData)
Computes the lock for a character.
public static CharacterEditLock For(CharacterAdminData character)
Parameters
characterCharacterAdminData