ConnectX.Client 2025.850.119

There is a newer version of this package available.
See the version list below for details.
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.910.132801533 0 9/10/2025
2025.850.119 177 4/29/2025
2025.831.61233369 116 8/31/2025
2025.831.53209476 116 8/31/2025
2025.827.151142857 176 8/27/2025
2025.806.132452720 205 8/6/2025
2025.713.35858996 103 7/13/2025
2025.712.45423493 66 7/12/2025
2025.614.231724530 150 6/14/2025
2025.612.231522603 290 6/12/2025
2025.611.183002713 291 6/11/2025
2025.530.42723750 132 5/30/2025
2025.526.70521515 145 5/26/2025
2025.526.61727463 145 5/26/2025
2025.526.60647815 145 5/26/2025
2025.526.55656195 148 5/26/2025
2025.524.174933473 72 5/24/2025
2025.524.62544164 70 5/24/2025
2025.524.61934553 81 5/24/2025
2025.524.53734910 74 5/24/2025
2025.515.31426316 231 5/15/2025
2025.515.14357365 224 5/15/2025
2025.515.11633678 228 5/15/2025
2025.515.10910716 225 5/15/2025
2025.515.4914277 225 5/15/2025
2025.515.3018147 223 5/15/2025
2025.515.1622518 228 5/15/2025
2025.515.658374 227 5/15/2025
2025.514.210047483 234 5/14/2025
2025.514.205744343 226 5/14/2025
2025.514.191738692 269 5/14/2025
2025.513.213348035 233 5/13/2025
2025.513.184611144 227 5/13/2025
2025.512.45809718 200 5/12/2025
2025.512.4654608 191 5/12/2025
2025.511.65611453 152 5/11/2025
2025.511.43943733 162 5/11/2025
2025.511.40253037 146 5/11/2025
2025.511.35721927 143 5/11/2025
2025.511.2727287 137 5/11/2025
2025.510.24437962 77 5/10/2025
2025.510.13045325 79 5/10/2025
2025.510.11846700 82 5/10/2025
2025.510.10318847 74 5/10/2025
2025.510.1522785 90 5/10/2025
2025.508.174945363 146 5/8/2025
2025.508.174915876 143 5/8/2025
2025.508.161531317 153 5/8/2025
2025.508.43107555 155 5/8/2025
2025.508.41546853 156 5/8/2025
2025.508.30649794 154 5/8/2025
2025.507.185431993 150 5/7/2025
2025.507.52226112 145 5/7/2025
2025.507.51901075 146 5/7/2025
2025.507.44621914 148 5/7/2025
2025.507.41504749 148 5/7/2025
2025.507.40524417 151 5/7/2025
2025.507.40344141 151 5/7/2025