Skip to content

Commit 6bc59cd

Browse files
mikhail-dclclaude
andcommitted
refactor: scope UPM package to Transport/Package, drop "Shared" suffix
Unity's git dependency now points at src/DCLPulse.Transport/Package, so the csproj, bin/obj and the server-only WebTransport framing sit outside the package path instead of being imported as assets. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
1 parent efe9287 commit 6bc59cd

25 files changed

Lines changed: 13 additions & 15 deletions

docs/webtransport-integration-plan.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
Pulse speaks **ENet/UDP only** today. Native (Unity) clients can use it, but **browsers cannot open raw UDP/ENet sockets** — the only way a browser reaches a UDP-based game server is **WebTransport** (HTTP/3 over QUIC). To let the Decentraland **web explorer** connect to Pulse, we add WebTransport as a *second, coexisting* transport **alongside** ENet — not a replacement. ENet remains the path for native clients; WebTransport unlocks the browser.
66

7-
Groundwork is already on branch `feat/webtransport`: shared transport contracts were extracted into the new `src/DCLPulse.Transport.Shared` project (`PacketMode`, `DisconnectReason`, `ENetChannel`, and the ENet managed binding `ENet.cs`).
7+
Groundwork is already on branch `feat/webtransport`: shared transport contracts were extracted into the new `src/DCLPulse.Transport` project (`PacketMode`, `DisconnectReason`, `ENetChannel`, and the ENet managed binding `ENet.cs`).
88

99
**Decisions (confirmed):**
1010
- Primary audience: **browser clients** (drives the TLS/cert strategy below).
@@ -81,7 +81,7 @@ WebTransport mandates TLS over QUIC. Browsers validate two ways: a **CA-signed c
8181

8282
## 2. Reliability model & how it affects Pulse
8383

84-
WebTransport offers two primitives; map `PacketMode` ([`PacketMode.cs`](src/DCLPulse.Transport.Shared/Runtime/PacketMode.cs)) onto them:
84+
WebTransport offers two primitives; map `PacketMode` ([`PacketMode.cs`](src/DCLPulse.Transport/Package/Runtime/PacketMode.cs)) onto them:
8585

8686
| `PacketMode` | ENet today | WebTransport mapping | Notes |
8787
|---|---|---|---|
@@ -141,7 +141,7 @@ Existing transport metrics ([`PulseMetrics.Transport.cs`](src/DCLPulse/Metrics/P
141141
## 4. Code layout, config, and wiring
142142

143143
- **`WebTransportHostedService`** in `src/DCLPulse/Transport/` next to `ENetHostedService`, implementing `ITransport` ([`ITransport.cs`](src/DCLPulse/Transport/ITransport.cs)). Its loop mirrors ENet: `wt_host_service` drain → on Connect `TryAllocate` + `PreAuthAdmission.TryAdmit` + `OnPeerConnected`; on data parse `ClientMessage` (`CorruptedPacketLimiter.RecordCorruption` on failure) + `OnDataReceived`; on Disconnect `MarkPending` + `OnPeerDisconnected` + hardening `Release`; outgoing drain maps `PacketMode` → stream/datagram.
144-
- **Channel-semantics helper** (stream length-framing + datagram seq/dedup) in `DCLPulse.Transport.Shared` (a `WebTransport/` subfolder) so it's unit-testable in isolation. Keep `PacketMode`/`DisconnectReason` where they are; leave `ENet.cs` in place (don't refactor ENet to avoid churn).
144+
- **Channel-semantics helper** (stream length-framing + datagram seq/dedup) in `DCLPulse.Transport` (a `WebTransport/` subfolder) so it's unit-testable in isolation. Keep `PacketMode`/`DisconnectReason` where they are; leave `ENet.cs` in place (don't refactor ENet to avoid churn).
145145
- **Package reference**: simplest is to add the `Decentraland.RustWebTransport` `PackageReference` directly to `DCLPulse.csproj` (or a dedicated `src/DCLWebTransport` project the way `DCLAuth` holds the RustEthereum reference). Prefer adding it to the project that owns `WebTransportHostedService`.
146146
- **Config**: a `WebTransport` section in `appsettings*.json` (`Enabled`, `Port`, `CertPath`/`KeyPath` or ACME settings, `MaxDatagramBytes`, send-queue bounds), overridable via Docker env (`WebTransport__Enabled`, …) like the existing `Peers__ResyncWithDelta`. Both transports start independently; either can be disabled.
147147

src/DCLPulse.Transport.Shared/DCLPulse.Transport.Shared.csproj.meta

Lines changed: 0 additions & 7 deletions
This file was deleted.

src/DCLPulse.Transport.Shared/DCLPulse.Transport.Shared.csproj renamed to src/DCLPulse.Transport/DCLPulse.Transport.csproj

File renamed without changes.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
2+
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=package/@EntryIndexedValue">True</s:Boolean>
3+
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=package_005Cruntime/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>
File renamed without changes.

src/DCLPulse.Transport.Shared/Runtime/DCLPulse.Transport.Shared.asmdef renamed to src/DCLPulse.Transport/Package/Runtime/DCLPulse.Transport.asmdef

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "DCLPulse.Transport.Shared",
2+
"name": "DCLPulse.Transport",
33
"rootNamespace": "Pulse.Transport",
44
"references": [],
55
"includePlatforms": [],

src/DCLPulse.Transport.Shared/Runtime/DCLPulse.Transport.Shared.asmdef.meta renamed to src/DCLPulse.Transport/Package/Runtime/DCLPulse.Transport.asmdef.meta

File renamed without changes.

src/DCLPulse.Transport.Shared/Runtime/DisconnectReason.cs renamed to src/DCLPulse.Transport/Package/Runtime/DisconnectReason.cs

File renamed without changes.

src/DCLPulse.Transport.Shared/Runtime/DisconnectReason.cs.meta renamed to src/DCLPulse.Transport/Package/Runtime/DisconnectReason.cs.meta

File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)