BSGameLib.Server 1.0.4-preview

This is a prerelease version of BSGameLib.Server.
dotnet add package BSGameLib.Server --version 1.0.4-preview
                    
NuGet\Install-Package BSGameLib.Server -Version 1.0.4-preview
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="BSGameLib.Server" Version="1.0.4-preview" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="BSGameLib.Server" Version="1.0.4-preview" />
                    
Directory.Packages.props
<PackageReference Include="BSGameLib.Server" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add BSGameLib.Server --version 1.0.4-preview
                    
#r "nuget: BSGameLib.Server, 1.0.4-preview"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package BSGameLib.Server@1.0.4-preview
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=BSGameLib.Server&version=1.0.4-preview&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=BSGameLib.Server&version=1.0.4-preview&prerelease
                    
Install as a Cake Tool

BSGameLib.Server

A dedicated game server host on Microsoft.Extensions.Hosting. Write your game's server logic, packet handlers and services; the host finds them in your assemblies, puts them in dependency injection, listens over QUIC and runs your game loop.

  • Runs as a console app, a systemd service or a Windows service.
  • Registers your IGameServer, packet handlers and packets, chat commands, repositories, IServiceBootstrappers and anything marked IInjectedDependency, from your assemblies and any plugin assembly beside the executable. [DoNotRegister] keeps a type or assembly out.
  • A fixed-step game loop, sixty times a second, that logs a failing tick and keeps going.
  • Sessions and connections (AddSessionManagement), and broadcast helpers on IListenSocket.
  • A self-signed QUIC certificate, generated once and kept, so clients that pin it keep trusting it.
  • Any logging provider: override ConfigureHost to add one.
using BSGameLib.Networking;
using BSGameLib.Server;
using Microsoft.Extensions.DependencyInjection;

public class ChatPacket : IDataPacket
{
  public string Message { get; set; }
}

public class MyGameServer : IGameServer
{
  public void Start() { }
  public void Stop() { }
  public void Update(TimeSpan elapsed) { /* sixty times a second */ }
}

// Found and registered automatically; its constructor's parameters come from DI.
public class ChatHandler(IListenSocket socket) : IDataPacketHandler<ChatPacket>
{
  public void Handle(INetConnection connection, ChatPacket packet) =>
    socket.SendReliableToAllBut(connection, packet);
}

public class Bootstrapper : IServiceBootstrapper
{
  public void Configure(IServiceCollection services) => services.AddSessionManagement<Guid>();
}

public static class Program
{
  public static void Main()
  {
    using var host = new ServerHost(new ServerSettings("MyGame"));
    host.Run();
  }
}

Documentation: https://docs.burningstormstudios.com/

Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.4-preview 51 11/9/2026