Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
d00f082
RTT and Reliability abstraction and more general improvements.
diamondpixel Dec 16, 2025
4b99c35
Update editorconfig with default values (#21)
Extremelyd1 Dec 19, 2025
bbc4f97
Bump actions/upload-artifact from 5 to 6 (#18)
dependabot[bot] Dec 19, 2025
4ffaa5f
Bump Hamunii.BepInEx.AutoPlugin from 2.0.1 to 2.1.0 (#15)
dependabot[bot] Dec 19, 2025
37726b4
Resolve various issues with dependencies and the modding template (#22)
Extremelyd1 Dec 19, 2025
36c41df
Merge branch 'main' into steam-p2p
diamondpixel Dec 20, 2025
40544b7
Re-formatted with projects .editorconfig
diamondpixel Dec 21, 2025
a4e1695
feat: fix server-side transport capabilities, lazy-init managers
diamondpixel Dec 24, 2025
cd93b02
HolePunch rough
diamondpixel Dec 24, 2025
b5a225b
Added HolePunch and MasterServer
diamondpixel Dec 24, 2025
c1d96a5
feat: implement comprehensive multiplayer networking, matchmaking, an…
diamondpixel Dec 26, 2025
8760d6a
Merged steam-p2p into HolePunch
diamondpixel Dec 28, 2025
6e409e5
feat: Fixed Steam's rich presence and added invite command.
diamondpixel Dec 29, 2025
0507ce6
Added missing XML comments.
diamondpixel Dec 29, 2025
abd84ba
Some small fixes
diamondpixel Dec 30, 2025
504c0fc
Reverted to Using mod version
diamondpixel Dec 30, 2025
bdff80e
Some more fixes.
diamondpixel Dec 30, 2025
15b4825
Some more fixes.
diamondpixel Dec 30, 2025
49c86b4
Merge remote-tracking branch 'origin/HolePunch' into HolePunch
diamondpixel Dec 30, 2025
69cff7f
Added Visibility option on MMS
diamondpixel Dec 30, 2025
d82a3bf
Applied requested fixes and ported Steam optimisations from future PR.
diamondpixel Dec 31, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions MMS/MMS.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="JetBrains.Annotations" Version="2025.2.4" />
</ItemGroup>
</Project>
58 changes: 58 additions & 0 deletions MMS/Models/Lobby.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
using System.Collections.Concurrent;
using System.Net.WebSockets;

namespace MMS.Models;

/// <summary>
/// Client waiting for NAT hole-punch.
/// </summary>
public record PendingClient(string ClientIp, int ClientPort, DateTime RequestedAt);

/// <summary>
/// Game lobby. ConnectionData serves as both identifier and connection info.
/// Steam: ConnectionData = Steam lobby ID. Matchmaking: ConnectionData = IP:Port.
/// </summary>
public class Lobby(
string connectionData,
string hostToken,
string lobbyCode,
string lobbyName,
string lobbyType = "matchmaking",
string? hostLanIp = null,
bool isPublic = true
) {
/// <summary>Connection data: Steam lobby ID for Steam, IP:Port for matchmaking.</summary>
public string ConnectionData { get; } = connectionData;

/// <summary>Secret token for host authentication.</summary>
public string HostToken { get; } = hostToken;

/// <summary>Human-readable 6-character invite code.</summary>
public string LobbyCode { get; } = lobbyCode;

/// <summary>Display name of the lobby.</summary>
public string LobbyName { get; } = lobbyName;

/// <summary>Lobby type: "steam" or "matchmaking".</summary>
public string LobbyType { get; } = lobbyType;

/// <summary>Optional LAN IP for local network discovery.</summary>
public string? HostLanIp { get; } = hostLanIp;

/// <summary>Whether the lobby should appear in public browser listings.</summary>
public bool IsPublic { get; } = isPublic;

/// <summary>Timestamp of the last heartbeat from the host.</summary>
public DateTime LastHeartbeat { get; set; } = DateTime.UtcNow;

/// <summary>Queue of clients waiting for NAT hole-punch.</summary>
public ConcurrentQueue<PendingClient> PendingClients { get; } = new();

/// <summary>True if no heartbeat received in the last 60 seconds.</summary>
public bool IsDead => DateTime.UtcNow - LastHeartbeat > TimeSpan.FromSeconds(60);

/// <summary>
/// WebSocket connection from the host for push notifications.
/// </summary>
public WebSocket? HostWebSocket { get; set; }
}
Loading