diff --git a/ReleaseConsumerProject/Assets/Tests/PlayMode/GameCult.EveUnity.GenericClient.PlayModeTests.asmdef b/ReleaseConsumerProject/Assets/Tests/PlayMode/GameCult.EveUnity.GenericClient.PlayModeTests.asmdef index d387468..e7db487 100644 --- a/ReleaseConsumerProject/Assets/Tests/PlayMode/GameCult.EveUnity.GenericClient.PlayModeTests.asmdef +++ b/ReleaseConsumerProject/Assets/Tests/PlayMode/GameCult.EveUnity.GenericClient.PlayModeTests.asmdef @@ -16,6 +16,7 @@ "GameCult.Caching.dll", "GameCult.Caching.MessagePack.dll", "GameCult.Mesh.dll", + "GameCult.Mesh.Quic.Native.dll", "GameCult.Networking.dll" ], "autoReferenced": false, diff --git a/ReleaseConsumerProject/Assets/Tests/PlayMode/GenericWorldCaptureTests.cs b/ReleaseConsumerProject/Assets/Tests/PlayMode/GenericWorldCaptureTests.cs index 91c7643..950713e 100644 --- a/ReleaseConsumerProject/Assets/Tests/PlayMode/GenericWorldCaptureTests.cs +++ b/ReleaseConsumerProject/Assets/Tests/PlayMode/GenericWorldCaptureTests.cs @@ -3,6 +3,8 @@ using System.Collections; using System.Collections.Generic; using System.IO; using System.Linq; +using System.Threading; +using System.Threading.Tasks; using GameCult.Caching; using GameCult.Caching.MessagePack; using GameCult.Eve.Surface; @@ -10,6 +12,7 @@ using GameCult.Eve.UnityUIToolkit; using GameCult.Eve.UnityScene; using GameCult.Eve.UnityScene.Fields; using GameCult.Mesh; +using GameCult.Mesh.Quic.Native; using NUnit.Framework; using UnityEngine; using UnityEngine.Rendering; @@ -305,6 +308,18 @@ namespace GameCult.EveUnity.GenericClient.PlayModeTests Assert.That(provider.Selection.VerseId, Is.Not.Empty); Assert.That(provider.Selection.ProviderId, Is.Not.Empty); Assert.That(provider.Selection.SurfaceId, Is.Not.Empty); + var quicProof = ReceiveAdvertisedRealtimeFrameAsync( + rendezvousEndpoint, + provider.Selection.VerseId); + var quicDeadline = Time.realtimeSinceStartup + 15f; + while (!quicProof.IsCompleted && Time.realtimeSinceStartup < quicDeadline) + yield return new WaitForSecondsRealtime(0.05f); + if (!quicProof.IsCompleted) + throw new TimeoutException("Timed out receiving advertised CultMesh QUIC state in Unity."); + var quicFrame = quicProof.GetAwaiter().GetResult(); + Assert.That(quicFrame.Delivery, Is.EqualTo(CultMeshRealtimeDelivery.LatestOnly)); + Assert.That(quicFrame.BodyId, Is.Not.Empty); + Assert.That(quicFrame.SchemaId, Is.Not.Empty); Assert.That(provider.CurrentAssetBodyTransportKind, Is.Null, "Publishing the provider catalog eagerly transferred an asset bundle."); host = root.AddComponent(); @@ -1166,6 +1181,23 @@ namespace GameCult.EveUnity.GenericClient.PlayModeTests } } + private static async Task ReceiveAdvertisedRealtimeFrameAsync( + string rendezvousEndpoint, + string verseId) + { + using var timeout = new CancellationTokenSource(TimeSpan.FromSeconds(15)); + using var client = new CultMeshClient(new CultMeshClientOptions + { + RendezvousEndpoints = new[] { rendezvousEndpoint }, + RealtimeConnectors = new ICultMeshRealtimeTransportConnector[] + { + new CultMeshNativeQuicRealtimeTransportConnector() + } + }); + using var session = await client.ConnectRealtimeAsync(verseId, timeout.Token); + return await session.ReceiveAsync(timeout.Token); + } + private static void WriteWitnessFacts( string witnessProfile, string gameplayScenario, diff --git a/ReleaseConsumerProject/Packages/manifest.json b/ReleaseConsumerProject/Packages/manifest.json index 5cc8b3e..8cfc7c7 100644 --- a/ReleaseConsumerProject/Packages/manifest.json +++ b/ReleaseConsumerProject/Packages/manifest.json @@ -6,7 +6,7 @@ "com.unity.modules.physics": "1.0.0", "com.unity.modules.uielements": "1.0.0", "com.unity.render-pipelines.universal": "17.4.0", - "org.gamecult.cultlib": "https://github.com/GameCult/CultLib.git?path=/unity/org.gamecult.cultlib#cultlib-unity-v1.0.36", + "org.gamecult.cultlib": "https://github.com/GameCult/CultLib.git?path=/unity/org.gamecult.cultlib#cultlib-unity-v1.0.38", "org.gamecult.eve.plugin-fields": "https://github.com/GameCult/EvePlugins.git?path=/plugins/eve-plugin-fields/unity/org.gamecult.eve.plugin-fields#eve-plugin-fields-unity-v0.2.3", "org.gamecult.eve.surface": "https://github.com/GameCult/EveUnity.git?path=/packages/org.gamecult.eve.surface#eveunity-surface-v0.2.4", "org.gamecult.eve.unity-scene": "https://github.com/GameCult/EveUnity.git?path=/packages/org.gamecult.eve.unity-scene#eveunity-scene-v0.3.97", diff --git a/ReleaseConsumerProject/Packages/packages-lock.json b/ReleaseConsumerProject/Packages/packages-lock.json index 14c707a..20ab53d 100644 --- a/ReleaseConsumerProject/Packages/packages-lock.json +++ b/ReleaseConsumerProject/Packages/packages-lock.json @@ -119,11 +119,11 @@ } }, "org.gamecult.cultlib": { - "version": "https://github.com/GameCult/CultLib.git?path=/unity/org.gamecult.cultlib#cultlib-unity-v1.0.36", + "version": "https://github.com/GameCult/CultLib.git?path=/unity/org.gamecult.cultlib#cultlib-unity-v1.0.38", "depth": 0, "source": "git", "dependencies": {}, - "hash": "1d126f4a35d0189224b5acea2f2891ef7663519a" + "hash": "c6cf04a342a013afab52063a9b5445a3683700d4" }, "org.gamecult.eve.plugin-fields": { "version": "https://github.com/GameCult/EvePlugins.git?path=/plugins/eve-plugin-fields/unity/org.gamecult.eve.plugin-fields#eve-plugin-fields-unity-v0.2.3", diff --git a/TestProject/Assets/Tests/PlayMode/GameCult.EveUnity.GenericClient.PlayModeTests.asmdef b/TestProject/Assets/Tests/PlayMode/GameCult.EveUnity.GenericClient.PlayModeTests.asmdef index d387468..e7db487 100644 --- a/TestProject/Assets/Tests/PlayMode/GameCult.EveUnity.GenericClient.PlayModeTests.asmdef +++ b/TestProject/Assets/Tests/PlayMode/GameCult.EveUnity.GenericClient.PlayModeTests.asmdef @@ -16,6 +16,7 @@ "GameCult.Caching.dll", "GameCult.Caching.MessagePack.dll", "GameCult.Mesh.dll", + "GameCult.Mesh.Quic.Native.dll", "GameCult.Networking.dll" ], "autoReferenced": false, diff --git a/TestProject/Assets/Tests/PlayMode/GenericWorldCaptureTests.cs b/TestProject/Assets/Tests/PlayMode/GenericWorldCaptureTests.cs index 91c7643..950713e 100644 --- a/TestProject/Assets/Tests/PlayMode/GenericWorldCaptureTests.cs +++ b/TestProject/Assets/Tests/PlayMode/GenericWorldCaptureTests.cs @@ -3,6 +3,8 @@ using System.Collections; using System.Collections.Generic; using System.IO; using System.Linq; +using System.Threading; +using System.Threading.Tasks; using GameCult.Caching; using GameCult.Caching.MessagePack; using GameCult.Eve.Surface; @@ -10,6 +12,7 @@ using GameCult.Eve.UnityUIToolkit; using GameCult.Eve.UnityScene; using GameCult.Eve.UnityScene.Fields; using GameCult.Mesh; +using GameCult.Mesh.Quic.Native; using NUnit.Framework; using UnityEngine; using UnityEngine.Rendering; @@ -305,6 +308,18 @@ namespace GameCult.EveUnity.GenericClient.PlayModeTests Assert.That(provider.Selection.VerseId, Is.Not.Empty); Assert.That(provider.Selection.ProviderId, Is.Not.Empty); Assert.That(provider.Selection.SurfaceId, Is.Not.Empty); + var quicProof = ReceiveAdvertisedRealtimeFrameAsync( + rendezvousEndpoint, + provider.Selection.VerseId); + var quicDeadline = Time.realtimeSinceStartup + 15f; + while (!quicProof.IsCompleted && Time.realtimeSinceStartup < quicDeadline) + yield return new WaitForSecondsRealtime(0.05f); + if (!quicProof.IsCompleted) + throw new TimeoutException("Timed out receiving advertised CultMesh QUIC state in Unity."); + var quicFrame = quicProof.GetAwaiter().GetResult(); + Assert.That(quicFrame.Delivery, Is.EqualTo(CultMeshRealtimeDelivery.LatestOnly)); + Assert.That(quicFrame.BodyId, Is.Not.Empty); + Assert.That(quicFrame.SchemaId, Is.Not.Empty); Assert.That(provider.CurrentAssetBodyTransportKind, Is.Null, "Publishing the provider catalog eagerly transferred an asset bundle."); host = root.AddComponent(); @@ -1166,6 +1181,23 @@ namespace GameCult.EveUnity.GenericClient.PlayModeTests } } + private static async Task ReceiveAdvertisedRealtimeFrameAsync( + string rendezvousEndpoint, + string verseId) + { + using var timeout = new CancellationTokenSource(TimeSpan.FromSeconds(15)); + using var client = new CultMeshClient(new CultMeshClientOptions + { + RendezvousEndpoints = new[] { rendezvousEndpoint }, + RealtimeConnectors = new ICultMeshRealtimeTransportConnector[] + { + new CultMeshNativeQuicRealtimeTransportConnector() + } + }); + using var session = await client.ConnectRealtimeAsync(verseId, timeout.Token); + return await session.ReceiveAsync(timeout.Token); + } + private static void WriteWitnessFacts( string witnessProfile, string gameplayScenario, diff --git a/scripts/run-aetheria-daemon-world-witness.ps1 b/scripts/run-aetheria-daemon-world-witness.ps1 index 50ac7ac..ab0a40e 100644 --- a/scripts/run-aetheria-daemon-world-witness.ps1 +++ b/scripts/run-aetheria-daemon-world-witness.ps1 @@ -20,7 +20,7 @@ $ErrorActionPreference = "Stop" $expectedEveUnityCommit = "44e338bd9eb4997f2235f7aa711b79bc5d5c12ff" $expectedEveFieldsCommit = "c5a4a75c1b727499b16c2dae1895f29e2a9f72f0" $expectedEveUnityUiToolkitCommit = "4d0cbe0185bdc4fc65eb63503a7c5cb578539669" -$expectedCultLibCommit = "1d126f4a35d0189224b5acea2f2891ef7663519a" +$expectedCultLibCommit = "c6cf04a342a013afab52063a9b5445a3683700d4" $repoRoot = Split-Path -Parent $PSScriptRoot $projectRoot = $ClientProject $outputRoot = if ([IO.Path]::IsPathRooted($OutputDirectory)) { $OutputDirectory } else { Join-Path $repoRoot $OutputDirectory }