Moongate.Server.Core
0.5.0
Prefix Reserved
See the version list below for details.
dotnet add package Moongate.Server.Core --version 0.5.0
NuGet\Install-Package Moongate.Server.Core -Version 0.5.0
<PackageReference Include="Moongate.Server.Core" Version="0.5.0" />
<PackageVersion Include="Moongate.Server.Core" Version="0.5.0" />
<PackageReference Include="Moongate.Server.Core" />
paket add Moongate.Server.Core --version 0.5.0
#r "nuget: Moongate.Server.Core, 0.5.0"
#:package Moongate.Server.Core@0.5.0
#addin nuget:?package=Moongate.Server.Core&version=0.5.0
#tool nuget:?package=Moongate.Server.Core&version=0.5.0

Moongate.Server.Core
Plugin-facing server contracts, events, registries, and dependency injection extensions for Moongate.
Installation
Requires .NET 10. Use the package version available in your configured NuGet feed.
dotnet add package Moongate.Server.Core
Features
- Plugin contracts, metadata, and registration APIs.
- Server lifecycle events and an event bus integrated with DryIoc.
- Registrations for server services, packet handlers, and commands.
- Contracts and data types for transport connections, sessions, the game loop, timers, world saves, and diagnostics.
Example
Register the event bus and subscribe to a lifecycle event. This example publishes the event manually to demonstrate the bus; it does not start a Moongate server.
using DryIoc;
using Moongate.Server.Core.Data.Events;
using Moongate.Server.Core.Extensions;
using Moongate.Server.Core.Interfaces.Events;
using var container = new Container();
container.RegisterMoongateEventBus();
var bus = container.Resolve<IMoongateEventBus>();
using var subscription = bus.Subscribe<MoongateStartedEvent>((_, cancellationToken) =>
{
Console.WriteLine("Started");
return Task.CompletedTask;
});
await bus.PublishAsync(new MoongateStartedEvent());
Dependencies and scope
This package depends on Moongate.Core, Moongate.Api, Moongate.Network, and Moongate.Network.Packets. DryIoc is available through the dependency graph.
The executable host and implementations of server runtime services are provided by Moongate.Server, which is not distributed as part of this library package. Referencing this package does not start the host, listener, timers, or game loop.
Connections and game coordination
IConnectionService tracks transport connections independently of game sessions. Its
TryGet returns only live connections whose admission is still open. DisconnectAsync
closes admission immediately and joins both the close request and actual transport
completion. Closing connections remain in Count and membership snapshots until
cleanup finishes. Stop is terminal and reports cleanup failures. The three-argument
TryGet overload also captures an owner-requested disconnect signal atomically with the
connection; the sender uses that stable signal to classify intentionally interrupted writes.
Remote closure or a send failure that closes its own transport does not complete it.
INetworkService owns listeners and raises synchronous ConnectionAccepted,
DataReceived, and ConnectionClosed events. Receive memory is borrowed until the
callback returns: decode or copy it before posting work elsewhere. A close notification
precedes full transport cleanup; never synchronously wait for that cleanup in the callback.
NetworkListenerOptions supplies endpoints and an optional per-connection pipeline factory.
IGameServerService coordinates game sessions and packet dispatch above that boundary.
IPacketSendService sends through the connection registry without requiring a game session.
The executable host provides these implementations and their startup order.
Compatibility
NetworkSession now accepts INetworkConnection, and its nullable Client property
returns that interface. ISessionService.GetOrCreate also accepts INetworkConnection.
These are binary API changes: rebuild consumers and plugins. Passing an existing
MoongateTcpClient remains source-compatible. Implementations of ISessionService
must update their method signature. Replace session.NetworkSession.Client.Dispose()
with the owning connection/sender service's DisconnectAsync(session.SessionId).
Implementations of INetworkService must implement the three new events. Session detach
only clears the reference; it does not close the transport. Endpoint strings remain
snapshotted after detach, and missing local endpoint metadata remains null.
See the migration guide for composition and shutdown examples.
Runtime guides
See packets and handlers, game loop and timers and world saves for registration, threading, completion and shutdown examples.
License and source
Licensed under AGPL-3.0-or-later. See the source repository and license.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Moongate.Api (>= 0.5.0)
- Moongate.Core (>= 0.5.0)
- Moongate.Network (>= 0.5.0)
- Moongate.Network.Packets (>= 0.5.0)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Moongate.Server.Core:
| Package | Downloads |
|---|---|
|
Moongate.Scripting
Embedded Lua scripting for Moongate: attribute-bound modules, loop-affine execution, timer-driven coroutines, and editor definitions. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.19.0 | 0 | 10/16/2026 |
| 0.18.0 | 0 | 10/16/2026 |
| 0.17.0 | 103 | 10/14/2026 |
| 0.16.0 | 114 | 10/9/2026 |
| 0.15.0 | 96 | 10/7/2026 |
| 0.14.0 | 104 | 10/4/2026 |
| 0.13.0 | 103 | 10/3/2026 |
| 0.12.0 | 97 | 10/2/2026 |
| 0.11.0 | 108 | 9/30/2026 |
| 0.10.0 | 111 | 9/30/2026 |
| 0.9.0 | 115 | 9/27/2026 |
| 0.8.0 | 123 | 9/26/2026 |
| 0.7.0 | 106 | 9/24/2026 |
| 0.6.0 | 104 | 9/21/2026 |
| 0.5.0 | 111 | 9/20/2026 |
| 0.4.1 | 108 | 9/20/2026 |
| 0.4.0 | 119 | 9/19/2026 |
| 0.3.0 | 98 | 9/18/2026 |