Bind Eve navigation to an authority runtime
This commit is contained in:
parent
e7b09f755d
commit
351f70245b
8 changed files with 26 additions and 6 deletions
|
|
@ -16,6 +16,7 @@ export interface EveCommandReceipt {
|
|||
sourceVersion: number;
|
||||
navigation?: {
|
||||
verseId: string;
|
||||
authorityRuntimeId?: string;
|
||||
providerId?: string;
|
||||
surfaceId: string;
|
||||
surfaceKind?: string;
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ issuedAtUtc?: string
|
|||
sourceVersion: number
|
||||
navigation?: {
|
||||
verseId: string
|
||||
authorityRuntimeId?: string
|
||||
providerId?: string
|
||||
surfaceId: string
|
||||
surfaceKind?: string
|
||||
|
|
|
|||
|
|
@ -757,6 +757,10 @@ export const eveContractSchemas = {
|
|||
"type": "string",
|
||||
"minLength": 1
|
||||
},
|
||||
"authorityRuntimeId": {
|
||||
"type": "string",
|
||||
"minLength": 1
|
||||
},
|
||||
"providerId": {
|
||||
"type": "string"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Description>Portable Eve surface and provider contracts.</Description>
|
||||
<PackageId>GameCult.Eve.Surface</PackageId>
|
||||
<Version>0.3.2</Version>
|
||||
<Version>0.3.3</Version>
|
||||
<Authors>GameCult</Authors>
|
||||
<PackageLicenseExpression>MPL-2.0</PackageLicenseExpression>
|
||||
<PackageProjectUrl>https://github.com/GameCult/Eve</PackageProjectUrl>
|
||||
|
|
|
|||
|
|
@ -546,8 +546,9 @@ namespace GameCult.Eve.Surface
|
|||
{
|
||||
if (navigation == null) { writer.WriteNil(); return; }
|
||||
|
||||
writer.WriteMapHeader(5);
|
||||
writer.WriteMapHeader(6);
|
||||
Write(ref writer, "verseId", navigation.VerseId);
|
||||
Write(ref writer, "authorityRuntimeId", navigation.AuthorityRuntimeId);
|
||||
Write(ref writer, "providerId", navigation.ProviderId);
|
||||
Write(ref writer, "surfaceId", navigation.SurfaceId);
|
||||
Write(ref writer, "surfaceKind", navigation.SurfaceKind);
|
||||
|
|
@ -571,6 +572,7 @@ namespace GameCult.Eve.Surface
|
|||
try
|
||||
{
|
||||
var verseId = "";
|
||||
var authorityRuntimeId = "";
|
||||
var providerId = "";
|
||||
var surfaceId = "";
|
||||
var surfaceKind = "";
|
||||
|
|
@ -581,6 +583,7 @@ namespace GameCult.Eve.Surface
|
|||
switch (reader.ReadString())
|
||||
{
|
||||
case "verseId": verseId = ReadString(ref reader); break;
|
||||
case "authorityRuntimeId": authorityRuntimeId = ReadString(ref reader); break;
|
||||
case "providerId": providerId = ReadString(ref reader); break;
|
||||
case "surfaceId": surfaceId = ReadString(ref reader); break;
|
||||
case "surfaceKind": surfaceKind = ReadString(ref reader); break;
|
||||
|
|
@ -588,7 +591,8 @@ namespace GameCult.Eve.Surface
|
|||
default: reader.Skip(); break;
|
||||
}
|
||||
}
|
||||
return new EveSurfaceNavigationTarget(verseId, providerId, surfaceId, surfaceKind, endpoints);
|
||||
return new EveSurfaceNavigationTarget(
|
||||
verseId, providerId, surfaceId, surfaceKind, endpoints, authorityRuntimeId);
|
||||
}
|
||||
finally { reader.Depth--; }
|
||||
}
|
||||
|
|
@ -626,9 +630,11 @@ namespace GameCult.Eve.Surface
|
|||
string providerId,
|
||||
string surfaceId,
|
||||
string surfaceKind,
|
||||
string[]? rendezvousEndpoints = null)
|
||||
string[]? rendezvousEndpoints = null,
|
||||
string authorityRuntimeId = "")
|
||||
{
|
||||
VerseId = verseId ?? "";
|
||||
AuthorityRuntimeId = authorityRuntimeId ?? "";
|
||||
ProviderId = providerId ?? "";
|
||||
SurfaceId = surfaceId ?? "";
|
||||
SurfaceKind = surfaceKind ?? "";
|
||||
|
|
@ -640,5 +646,6 @@ namespace GameCult.Eve.Surface
|
|||
[Key(2)] public string SurfaceId { get; }
|
||||
[Key(3)] public string SurfaceKind { get; }
|
||||
[Key(4)] public string[] RendezvousEndpoints { get; }
|
||||
[Key(5)] public string AuthorityRuntimeId { get; }
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "org.gamecult.eve.surface",
|
||||
"displayName": "Eve Surface Contract",
|
||||
"version": "0.3.2",
|
||||
"version": "0.3.3",
|
||||
"unity": "2021.3",
|
||||
"description": "Renderer-neutral C# contracts and builders for gamecult.eve.surface.v1 documents.",
|
||||
"dependencies": {
|
||||
|
|
|
|||
|
|
@ -80,6 +80,10 @@
|
|||
"type": "string",
|
||||
"minLength": 1
|
||||
},
|
||||
"authorityRuntimeId": {
|
||||
"type": "string",
|
||||
"minLength": 1
|
||||
},
|
||||
"providerId": {
|
||||
"type": "string"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -208,7 +208,8 @@ public sealed class EveSurfaceSerializationCompatibilityTests
|
|||
"aetheria.daemon",
|
||||
"aetheria.pilot",
|
||||
"interactive-world",
|
||||
new[] { "cultnet+tcp://odin.gamecult.example:3076" }));
|
||||
new[] { "cultnet+tcp://odin.gamecult.example:3076" },
|
||||
"commander-daemon"));
|
||||
|
||||
var bytes = MessagePackSerializer.Serialize(document, Options);
|
||||
var reader = new MessagePackReader(bytes);
|
||||
|
|
@ -220,6 +221,7 @@ public sealed class EveSurfaceSerializationCompatibilityTests
|
|||
Assert.That(wireJson.RootElement.GetProperty("navigation").ValueKind, Is.EqualTo(JsonValueKind.Object));
|
||||
Assert.That(restored.Navigation, Is.Not.Null);
|
||||
Assert.That(restored.Navigation!.VerseId, Is.EqualTo("gamecult.aetheria"));
|
||||
Assert.That(restored.Navigation.AuthorityRuntimeId, Is.EqualTo("commander-daemon"));
|
||||
Assert.That(restored.Navigation.SurfaceId, Is.EqualTo("aetheria.pilot"));
|
||||
Assert.That(restored.Navigation.SurfaceKind, Is.EqualTo("interactive-world"));
|
||||
Assert.That(restored.Navigation.RendezvousEndpoints, Is.EqualTo(new[] { "cultnet+tcp://odin.gamecult.example:3076" }));
|
||||
|
|
@ -260,6 +262,7 @@ public sealed class EveSurfaceSerializationCompatibilityTests
|
|||
Assert.That(restored.CommandId, Is.EqualTo("legacy-command"));
|
||||
Assert.That(restored.Navigation, Is.Not.Null);
|
||||
Assert.That(restored.Navigation!.SurfaceId, Is.EqualTo("aetheria.pilot"));
|
||||
Assert.That(restored.Navigation.AuthorityRuntimeId, Is.Empty);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue