Colyseus.MonoGame
0.18.4
dotnet add package Colyseus.MonoGame --version 0.18.4
NuGet\Install-Package Colyseus.MonoGame -Version 0.18.4
<PackageReference Include="Colyseus.MonoGame" Version="0.18.4" />
<PackageVersion Include="Colyseus.MonoGame" Version="0.18.4" />
<PackageReference Include="Colyseus.MonoGame" />
paket add Colyseus.MonoGame --version 0.18.4
#r "nuget: Colyseus.MonoGame, 0.18.4"
#:package Colyseus.MonoGame@0.18.4
#addin nuget:?package=Colyseus.MonoGame&version=0.18.4
#tool nuget:?package=Colyseus.MonoGame&version=0.18.4
<div align="center"> <a href="https://colyseus.io/"> <img src="https://github.com/colyseus/colyseus/blob/master/media/logo.svg?raw=true" width="40%" /> </a> <h3>Colyseus Multiplayer SDK for MonoGame</h3> </div>
MonoGame integration for Colyseus — provides a GameComponent that automatically dispatches WebSocket events on the game loop.
Installation
dotnet add package Colyseus.MonoGame
This installs the core Colyseus SDK as a dependency.
Setup
Register the ColyseusGameComponent in your game's Initialize() method:
using Colyseus.MonoGame;
protected override void Initialize()
{
Components.Add(new ColyseusGameComponent(this));
base.Initialize();
}
This single line handles all WebSocket event dispatching on the game thread — no manual polling needed.
Quick Example
using Microsoft.Xna.Framework;
using Colyseus;
using Colyseus.Schema;
using Colyseus.MonoGame;
public class Game1 : Game
{
Client client;
Room<MyRoomState> room;
protected override void Initialize()
{
Components.Add(new ColyseusGameComponent(this));
base.Initialize();
}
protected override async void LoadContent()
{
client = new Client("ws://localhost:2567");
room = await client.JoinOrCreate<MyRoomState>("my_room");
var callbacks = Callbacks.Get(room);
callbacks.OnAdd(state => state.players, (sessionId, player) => {
System.Diagnostics.Debug.WriteLine($"Player joined: {sessionId}");
});
room.Send("move", new { x = 10f, y = 20f });
room.OnMessage<string>("chat", (message) => {
System.Diagnostics.Debug.WriteLine("Chat: " + message);
});
}
protected override void OnExiting(object sender, EventArgs args)
{
if (room != null) room.Leave();
base.OnExiting(sender, args);
}
}
Documentation
See the full documentation at https://docs.colyseus.io/getting-started/monogame
License
MIT
| Product | Versions 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 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
- Colyseus (>= 0.18.0 && < 0.19.0)
- Colyseus.NativeWebSocket (>= 2.0.7)
- MonoGame.Framework.DesktopGL (>= 3.8.2.1105)
-
net8.0
- Colyseus (>= 0.18.0 && < 0.19.0)
- Colyseus.NativeWebSocket (>= 2.0.7)
- MonoGame.Framework.DesktopGL (>= 3.8.2.1105)
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 |
|---|---|---|
| 0.18.4 | 36 | 9/1/2026 |
| 0.18.3 | 81 | 8/29/2026 |
| 0.18.2 | 83 | 8/28/2026 |
| 0.18.1 | 99 | 8/25/2026 |
| 0.18.0 | 88 | 8/25/2026 |
| 0.17.20 | 94 | 8/13/2026 |
| 0.17.19 | 96 | 8/7/2026 |
| 0.17.18 | 99 | 8/6/2026 |
| 0.17.17 | 129 | 6/14/2026 |
| 0.17.16 | 146 | 3/24/2026 |
| 0.17.15 | 116 | 3/24/2026 |
| 0.17.14 | 115 | 3/24/2026 |
| 0.17.12 | 113 | 3/23/2026 |
| 0.17.11 | 119 | 3/23/2026 |