SharpGameService.Core 1.1.0

dotnet add package SharpGameService.Core --version 1.1.0
                    
NuGet\Install-Package SharpGameService.Core -Version 1.1.0
                    
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="SharpGameService.Core" Version="1.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="SharpGameService.Core" Version="1.1.0" />
                    
Directory.Packages.props
<PackageReference Include="SharpGameService.Core" />
                    
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 SharpGameService.Core --version 1.1.0
                    
#r "nuget: SharpGameService.Core, 1.1.0"
                    
#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.
#addin nuget:?package=SharpGameService.Core&version=1.1.0
                    
Install SharpGameService.Core as a Cake Addin
#tool nuget:?package=SharpGameService.Core&version=1.1.0
                    
Install SharpGameService.Core as a Cake Tool

SharpGameService Core

This contains the core library for SharpGameService, a C# library made to help you create game servers, include the hosting the game logic itself.

Glossary

  • House - A house represents a collection of rooms, which are the games that are being played. Each house can have multiple rooms, and each room can have multiple players.
  • Room - A room represents a single game instance. Each room can have multiple players, and each player will send and receive messages to and from the room. A room is where the game logic will happen.

Usage

To use the library you will need to implement the following interfaces to handle your own game and service logic:

  • BaseRoom - Inheriting from this will allow you to have the connection and messaging in SharpGameService.Core along with implementing your own server side game logic.
  • A Hosted Service, you will need to inherit from something like BackgroundService or IHostedService and this will be the core to firing up the server, handling the auto processing and shutting it down.

Along with the implementation of the above, in your host setup and build you will need to add the following:

builder.Services.AddSharpGameService<YourHostedService, YourRoom>(); - This will add the hosted service and the room to the DI container with default options (you are able to setup options using a lamda function). and after builder.Build().

app.UseSharpGameService(webSocketConfig); - This will add the middleware to the pipeline, this is required for the WebSocket connections to be handled.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  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 (1)

Showing the top 1 NuGet packages that depend on SharpGameService.Core:

Package Downloads
SharpGameService.Extensions

The extensions to the SharpGameService

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.1.0 144 4/22/2025
1.0.2 149 4/21/2025
1.0.1 234 4/20/2025