Table of Contents

Class AccountCreationSystem

Namespace
FishMMO.Server.Implementation.LoginServer
Assembly
FishMMO.Server.dll

Handles player account creation requests asynchronously with rate limiting and DoS protection. Stateless logic container - all mutable state stored in RuntimeDataContainers. Network thread acts as ultra-fast reactive UDP gate with zero blocking operations.

[CreateAssetMenu(fileName = "AccountCreationSystem", menuName = "FishMMO/Server/LoginServer/Account Creation System", order = 1)]
[RequiresDataContainer(typeof(AsyncWorkerData))]
[RequiresDataContainer(typeof(AccountCreationSystemRuntimeData))]
[RequiresDataContainer(typeof(AccountCreationSystemMappingData))]
[RequiresDataContainer(typeof(AccountCreationSystemMainThreadQueueData))]
public class AccountCreationSystem : ServerBehaviour, IServerBehaviour<INetworkManagerWrapper, ServerManager, NetworkConnection, IServerBehaviour>, IServerComponent<INetworkManagerWrapper, ServerManager, NetworkConnection, IServerBehaviour>, IAccountCreationSystem<NetworkConnection>, IServerBehaviour, IServerComponent
Inheritance
Object
ScriptableObject
AccountCreationSystem
Implements
IServerBehaviour<INetworkManagerWrapper, ServerManager, NetworkConnection, IServerBehaviour>
IServerComponent<INetworkManagerWrapper, ServerManager, NetworkConnection, IServerBehaviour>
IAccountCreationSystem<NetworkConnection>
Inherited Members
ScriptableObject.SetDirty()
ScriptableObject.CreateInstance<T>()
Object.GetEntityId()
Object.GetInstanceID()
Object.GetHashCode()
Object.InstantiateAsync<T>(T)
Object.InstantiateAsync<T>(T, Transform)
Object.InstantiateAsync<T>(T, Vector3, Quaternion)
Object.InstantiateAsync<T>(T, Transform, Vector3, Quaternion)
Object.Instantiate(Object, Vector3, Quaternion)
Object.Instantiate(Object, Vector3, Quaternion, Transform)
Object.Instantiate(Object)
Object.Instantiate(Object, Scene)
Object.Instantiate<T>(T, InstantiateParameters)
Object.Instantiate<T>(T, Vector3, Quaternion, InstantiateParameters)
Object.Instantiate(Object, Transform)
Object.Instantiate<T>(T)
Object.Instantiate<T>(T, Vector3, Quaternion)
Object.Instantiate<T>(T, Vector3, Quaternion, Transform)
Object.Instantiate<T>(T, Transform)
Object.Destroy(Object)
Object.DestroyImmediate(Object)
Object.DontDestroyOnLoad(Object)
Object.DestroyObject(Object)
Object.FindObjectsOfType<T>()
Object.FindObjectsByType<T>(FindObjectsSortMode)
Object.FindObjectsByType<T>(FindObjectsInactive, FindObjectsSortMode)
Object.FindObjectOfType<T>()
Object.FindFirstObjectByType<T>()
Object.FindAnyObjectByType<T>()
Object.FindFirstObjectByType<T>(FindObjectsInactive)
Object.FindAnyObjectByType<T>(FindObjectsInactive)
Object.FindObjectsByType<T>()
Object.FindObjectsByType<T>(FindObjectsInactive)
Object.ToString()
Object.name
Object.hideFlags

Properties

PendingRequestCount

Gets the current number of pending account creation requests in the async queue.

public int PendingRequestCount { get; }

Property Value

int

SmtpService

Injectable SMTP service. When set externally (e.g. by LoginServerSystem during initialization), this instance is used instead of lazy-constructing from config. Set to null to revert to lazy construction.

public ISmtpService SmtpService { get; set; }

Property Value

ISmtpService

TotalProcessed

Gets the total number of successfully processed account creation requests.

public long TotalProcessed { get; }

Property Value

long

TotalRejected

Gets the total number of rejected account creation requests.

public long TotalRejected { get; }

Property Value

long

TotpMasterKey

AES-256 master key for encrypting TOTP secrets at rest in the database. Set by LoginServerSystem on startup. Must match ServerAuthenticator.TotpMasterKey.

public byte[] TotpMasterKey { get; set; }

Property Value

byte[]

Methods

InitializeOnce()

Initializes the account creation system and registers network/connection handlers.

public override ServerComponentInitializationStatus InitializeOnce()

Returns

ServerComponentInitializationStatus

OnDeinitialize()

Cleans up the account creation system and unregisters handlers.

public override void OnDeinitialize()

OnRemoteConnectionStopped(NetworkConnection)

Removes cached connection-IP mapping when a connection closes.

protected override void OnRemoteConnectionStopped(NetworkConnection conn)

Parameters

conn NetworkConnection

OnUpdate(float)

Drains the main-thread response queue each frame and performs periodic maintenance. All network operations from async workers are marshalled through this queue to ensure they execute on the main Unity thread.

protected override void OnUpdate(float deltaTime)

Parameters

deltaTime float

Time elapsed since last frame.

TryEnqueueAccountCreation(AccountCreationRequest<NetworkConnection>)

Public API expected by IAccountCreationSystem<TConnection>. Returns true only when the request is accepted.

public bool TryEnqueueAccountCreation(AccountCreationRequest<NetworkConnection> request)

Parameters

request AccountCreationRequest<NetworkConnection>

Account creation request containing encrypted credentials.

Returns

bool