ConnectX.Client 2025.850.119

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

ConnectX

中文 README

CodeFactor Grade GitHub Maintenance GitHub commit activity GitHub closed pull requests GitHub repo size DotNet Version GitHub Actions Workflow Status

A cross-platform Minecraft P2P online multi-player library in C#, developed using high-performance sockets for excellent forwarding performance, with P2P powered by the Zerotier SDK.

Proudly powered by another of our open-source projects: Hive.Framework

Demo Screenshot

Architecture

ConnectX drawio ConnectX dark drawio

Status

Function Status
Server: Log Room Ops Info to local DB :white_check_mark:
Server: Client/Room management :white_check_mark:
Server: Relay Server management :white_check_mark:
Relay: Relay Server impl based on Hive :white_check_mark:
Relay: Ultra low latency relay impl :white_check_mark:
Client: ZT based P2P connection :white_check_mark:
Client: ZT based Relay connection :white_check_mark:
Client: ConnectX based Relay connection :white_check_mark:
Dual Stack Socket Support :white_check_mark:

Quick Start!

We are using the MSDI(Microsoft.Extensions.DependencyInjection) as our DI container. The best practice is to use .NET Generic Host for you program.

First, add the following method for the Server Config. ConnectXServerIp will be the Backend address for the ConnectX.Server.

private static IClientSettingProvider GetConnectXSettings()
{
    var serverIp = IPAddress.None;

    try
    {
        var ips = Dns.GetHostAddresses(ConnectXServerIp);
        var ipv4Addresses = ips
            .Where(ip => ip.AddressFamily == AddressFamily.InterNetwork)
            .Where(ip => !ip.IsLocalIpAddress())
            .ToArray();

        if (ipv4Addresses.Length > 0)
            serverIp = ipv4Addresses[0];
    }
    catch (Exception ex)
    {
        Log.Logger.Error(ex, "Failed to resolve ConnectX server IP.");
    }

    return new DefaultClientSettingProvider
    {
        ServerAddress = serverIp,
        ServerPort = ConnectXServerPort,
        JoinP2PNetwork = true
    };
}

Then, just add one more line to complete the setup!

private static void ConfigureServices(IServiceCollection services)
{
    // ...
+   services.UseConnectX(GetConnectXSettings);
    // ...
}

How to use?

Inject IServerLinkHolder and Client into the VM where you want to manage the room instances.

Connect to the server

await _serverLinkHolder.ConnectAsync(CancellationToken.None);

Perform room actions

Please make sure that before you perform any room operations, you need to make sure you already connected to the ConnectX server!

await TaskHelper.WaitUntilAsync(() => _serverLinkHolder is { IsConnected: true, IsSignedIn: true });
var message = new CreateGroup
{
    UserId = _serverLinkHolder.UserId,
    RoomName = createRoomRecord.RoomName,
    RoomDescription = createRoomRecord.RoomDescription,
    RoomPassword = createRoomRecord.RoomPassword,
    IsPrivate = createRoomRecord.IsPrivateRoom,
    MaxUserCount = 3
};

var (groupInfo, status, err) = await _multiPlayerClient.CreateGroupAsync(message, CancellationToken.None);

if (groupInfo == null || status != GroupCreationStatus.Succeeded || !string.IsNullOrEmpty(err))
{
    // Error process
    return;
}

_multiPlayerClient.OnGroupStateChanged += MultiPlayerClientOnGroupStateChanged;

// Other actions

License

MIT. This means that you can modify or use our code for any purpose, however, copyright notice and permission notice shall be included in all copies or substantial portions of your software.

Stats

Alt

Disclaimer

ConnectX is not affiliated with Mojang or any part of its software.

Hall of Shame

Here, we'll list all programs using our code without obeying the MIT License.

Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  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

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
2025.850.119 170 4/29/2025
2025.806.132452720 192 8/6/2025
2025.713.35858996 99 7/13/2025
2025.712.45423493 62 7/12/2025
2025.614.231724530 148 6/14/2025
2025.612.231522603 287 6/12/2025
2025.611.183002713 289 6/11/2025
2025.530.42723750 130 5/30/2025
2025.526.70521515 143 5/26/2025
2025.526.61727463 143 5/26/2025
2025.526.60647815 143 5/26/2025
2025.526.55656195 146 5/26/2025
2025.524.174933473 70 5/24/2025
2025.524.62544164 67 5/24/2025
2025.524.61934553 78 5/24/2025
2025.524.53734910 72 5/24/2025
2025.515.31426316 229 5/15/2025
2025.515.14357365 222 5/15/2025
2025.515.11633678 226 5/15/2025
2025.515.10910716 223 5/15/2025
2025.515.4914277 223 5/15/2025
2025.515.3018147 221 5/15/2025
2025.515.1622518 226 5/15/2025
2025.515.658374 225 5/15/2025
2025.514.210047483 232 5/14/2025
2025.514.205744343 223 5/14/2025
2025.514.191738692 266 5/14/2025
2025.513.213348035 230 5/13/2025
2025.513.184611144 225 5/13/2025
2025.512.45809718 198 5/12/2025
2025.512.4654608 189 5/12/2025
2025.511.65611453 150 5/11/2025
2025.511.43943733 160 5/11/2025
2025.511.40253037 144 5/11/2025
2025.511.35721927 141 5/11/2025
2025.511.2727287 134 5/11/2025
2025.510.24437962 75 5/10/2025
2025.510.13045325 76 5/10/2025
2025.510.11846700 80 5/10/2025
2025.510.10318847 72 5/10/2025
2025.510.1522785 88 5/10/2025
2025.508.174945363 144 5/8/2025
2025.508.174915876 141 5/8/2025
2025.508.161531317 151 5/8/2025
2025.508.43107555 153 5/8/2025
2025.508.41546853 154 5/8/2025
2025.508.30649794 152 5/8/2025
2025.507.185431993 148 5/7/2025
2025.507.52226112 142 5/7/2025
2025.507.51901075 144 5/7/2025
2025.507.44621914 146 5/7/2025
2025.507.41504749 146 5/7/2025
2025.507.40524417 149 5/7/2025
2025.507.40344141 149 5/7/2025