Add provider-owned Eve navigation receipts
This commit is contained in:
parent
fe0dddf282
commit
0c486796ab
9 changed files with 205 additions and 6 deletions
|
|
@ -14,5 +14,12 @@ export interface EveCommandReceipt {
|
|||
}[];
|
||||
issuedAtUtc?: string;
|
||||
sourceVersion: number;
|
||||
navigation?: {
|
||||
verseId: string;
|
||||
providerId?: string;
|
||||
surfaceId: string;
|
||||
surfaceKind?: string;
|
||||
rendezvousEndpoints?: string[];
|
||||
};
|
||||
[k: string]: any;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -622,6 +622,35 @@ export declare const eveContractSchemas: {
|
|||
readonly type: "integer";
|
||||
readonly minimum: 0;
|
||||
};
|
||||
readonly navigation: {
|
||||
readonly type: "object";
|
||||
readonly required: readonly ["verseId", "surfaceId"];
|
||||
readonly properties: {
|
||||
readonly verseId: {
|
||||
readonly type: "string";
|
||||
readonly minLength: 1;
|
||||
};
|
||||
readonly providerId: {
|
||||
readonly type: "string";
|
||||
};
|
||||
readonly surfaceId: {
|
||||
readonly type: "string";
|
||||
readonly minLength: 1;
|
||||
};
|
||||
readonly surfaceKind: {
|
||||
readonly type: "string";
|
||||
};
|
||||
readonly rendezvousEndpoints: {
|
||||
readonly type: "array";
|
||||
readonly items: {
|
||||
readonly type: "string";
|
||||
readonly minLength: 1;
|
||||
};
|
||||
readonly uniqueItems: true;
|
||||
};
|
||||
};
|
||||
readonly additionalProperties: false;
|
||||
};
|
||||
};
|
||||
readonly additionalProperties: true;
|
||||
};
|
||||
|
|
|
|||
32
packages/eve-contracts/dist/generated/schemas.js
vendored
32
packages/eve-contracts/dist/generated/schemas.js
vendored
|
|
@ -745,6 +745,38 @@ export const eveContractSchemas = {
|
|||
"sourceVersion": {
|
||||
"type": "integer",
|
||||
"minimum": 0
|
||||
},
|
||||
"navigation": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"verseId",
|
||||
"surfaceId"
|
||||
],
|
||||
"properties": {
|
||||
"verseId": {
|
||||
"type": "string",
|
||||
"minLength": 1
|
||||
},
|
||||
"providerId": {
|
||||
"type": "string"
|
||||
},
|
||||
"surfaceId": {
|
||||
"type": "string",
|
||||
"minLength": 1
|
||||
},
|
||||
"surfaceKind": {
|
||||
"type": "string"
|
||||
},
|
||||
"rendezvousEndpoints": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string",
|
||||
"minLength": 1
|
||||
},
|
||||
"uniqueItems": true
|
||||
}
|
||||
},
|
||||
"additionalProperties": false
|
||||
}
|
||||
},
|
||||
"additionalProperties": true
|
||||
|
|
|
|||
|
|
@ -16,5 +16,12 @@ diagnostics?: {
|
|||
}[]
|
||||
issuedAtUtc?: string
|
||||
sourceVersion: number
|
||||
navigation?: {
|
||||
verseId: string
|
||||
providerId?: string
|
||||
surfaceId: string
|
||||
surfaceKind?: string
|
||||
rendezvousEndpoints?: string[]
|
||||
}
|
||||
[k: string]: any
|
||||
}
|
||||
|
|
|
|||
|
|
@ -745,6 +745,38 @@ export const eveContractSchemas = {
|
|||
"sourceVersion": {
|
||||
"type": "integer",
|
||||
"minimum": 0
|
||||
},
|
||||
"navigation": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"verseId",
|
||||
"surfaceId"
|
||||
],
|
||||
"properties": {
|
||||
"verseId": {
|
||||
"type": "string",
|
||||
"minLength": 1
|
||||
},
|
||||
"providerId": {
|
||||
"type": "string"
|
||||
},
|
||||
"surfaceId": {
|
||||
"type": "string",
|
||||
"minLength": 1
|
||||
},
|
||||
"surfaceKind": {
|
||||
"type": "string"
|
||||
},
|
||||
"rendezvousEndpoints": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string",
|
||||
"minLength": 1
|
||||
},
|
||||
"uniqueItems": true
|
||||
}
|
||||
},
|
||||
"additionalProperties": false
|
||||
}
|
||||
},
|
||||
"additionalProperties": true
|
||||
|
|
|
|||
|
|
@ -364,8 +364,9 @@ namespace GameCult.Eve.Surface
|
|||
string surfaceId,
|
||||
string message,
|
||||
string issuedAtUtc,
|
||||
long sourceVersion)
|
||||
: this(SchemaId, receiptId, commandId, command, state, ownerRepo, authority, providerId, surfaceId, message, issuedAtUtc, sourceVersion)
|
||||
long sourceVersion,
|
||||
EveSurfaceNavigationTarget? navigation = null)
|
||||
: this(SchemaId, receiptId, commandId, command, state, ownerRepo, authority, providerId, surfaceId, message, issuedAtUtc, sourceVersion, navigation)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -382,7 +383,8 @@ namespace GameCult.Eve.Surface
|
|||
string surfaceId,
|
||||
string message,
|
||||
string issuedAtUtc,
|
||||
long sourceVersion)
|
||||
long sourceVersion,
|
||||
EveSurfaceNavigationTarget? navigation = null)
|
||||
{
|
||||
Schema = string.IsNullOrWhiteSpace(schema) ? SchemaId : schema;
|
||||
ReceiptId = receiptId ?? "";
|
||||
|
|
@ -396,6 +398,7 @@ namespace GameCult.Eve.Surface
|
|||
Message = message ?? "";
|
||||
IssuedAtUtc = issuedAtUtc ?? "";
|
||||
SourceVersion = sourceVersion;
|
||||
Navigation = navigation;
|
||||
}
|
||||
|
||||
[Key(0)] public string Schema { get; }
|
||||
|
|
@ -410,7 +413,31 @@ namespace GameCult.Eve.Surface
|
|||
[Key(9)] public string Message { get; }
|
||||
[Key(10)] public string IssuedAtUtc { get; }
|
||||
[Key(11)] public long SourceVersion { get; }
|
||||
[Key(12)] public EveSurfaceNavigationTarget? Navigation { get; }
|
||||
}
|
||||
|
||||
[MessagePackObject]
|
||||
public sealed class EveSurfaceNavigationTarget
|
||||
{
|
||||
[SerializationConstructor]
|
||||
public EveSurfaceNavigationTarget(
|
||||
string verseId,
|
||||
string providerId,
|
||||
string surfaceId,
|
||||
string surfaceKind,
|
||||
string[]? rendezvousEndpoints = null)
|
||||
{
|
||||
VerseId = verseId ?? "";
|
||||
ProviderId = providerId ?? "";
|
||||
SurfaceId = surfaceId ?? "";
|
||||
SurfaceKind = surfaceKind ?? "";
|
||||
RendezvousEndpoints = rendezvousEndpoints ?? Array.Empty<string>();
|
||||
}
|
||||
|
||||
[Key(0)] public string VerseId { get; }
|
||||
[Key(1)] public string ProviderId { get; }
|
||||
[Key(2)] public string SurfaceId { get; }
|
||||
[Key(3)] public string SurfaceKind { get; }
|
||||
[Key(4)] public string[] RendezvousEndpoints { get; }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "org.gamecult.eve.surface",
|
||||
"displayName": "Eve Surface Contract",
|
||||
"version": "0.3.0",
|
||||
"version": "0.3.1",
|
||||
"unity": "2021.3",
|
||||
"description": "Renderer-neutral C# contracts and builders for gamecult.eve.surface.v1 documents.",
|
||||
"dependencies": {
|
||||
|
|
|
|||
|
|
@ -68,6 +68,38 @@
|
|||
"sourceVersion": {
|
||||
"type": "integer",
|
||||
"minimum": 0
|
||||
},
|
||||
"navigation": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"verseId",
|
||||
"surfaceId"
|
||||
],
|
||||
"properties": {
|
||||
"verseId": {
|
||||
"type": "string",
|
||||
"minLength": 1
|
||||
},
|
||||
"providerId": {
|
||||
"type": "string"
|
||||
},
|
||||
"surfaceId": {
|
||||
"type": "string",
|
||||
"minLength": 1
|
||||
},
|
||||
"surfaceKind": {
|
||||
"type": "string"
|
||||
},
|
||||
"rendezvousEndpoints": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string",
|
||||
"minLength": 1
|
||||
},
|
||||
"uniqueItems": true
|
||||
}
|
||||
},
|
||||
"additionalProperties": false
|
||||
}
|
||||
},
|
||||
"additionalProperties": true
|
||||
|
|
|
|||
|
|
@ -169,6 +169,40 @@ public sealed class EveSurfaceSerializationCompatibilityTests
|
|||
});
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void CommandReceiptCarriesRendererNeutralNavigationTarget()
|
||||
{
|
||||
var document = new EveCommandReceiptDocument(
|
||||
"receipt:launch",
|
||||
"launch",
|
||||
"aetheria.hangar.launch",
|
||||
"accepted",
|
||||
"Aetheria",
|
||||
"commander-daemon",
|
||||
"aetheria.daemon",
|
||||
"aetheria.hangar",
|
||||
"",
|
||||
"2026-08-17T20:00:00Z",
|
||||
42,
|
||||
new EveSurfaceNavigationTarget(
|
||||
"gamecult.aetheria",
|
||||
"aetheria.daemon",
|
||||
"aetheria.pilot",
|
||||
"interactive-world",
|
||||
new[] { "cultnet+tcp://odin.gamecult.example:3076" }));
|
||||
|
||||
var bytes = MessagePackSerializer.Serialize(document, Options);
|
||||
var reader = new MessagePackReader(bytes);
|
||||
var restored = MessagePackSerializer.Deserialize<EveCommandReceiptDocument>(bytes, Options);
|
||||
|
||||
Assert.That(reader.ReadArrayHeader(), Is.EqualTo(13));
|
||||
Assert.That(restored.Navigation, Is.Not.Null);
|
||||
Assert.That(restored.Navigation!.VerseId, Is.EqualTo("gamecult.aetheria"));
|
||||
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" }));
|
||||
}
|
||||
|
||||
private static EveSurfaceDocument CreateCurrentDocument() => new(
|
||||
"current-provider",
|
||||
"current-kind",
|
||||
|
|
@ -265,4 +299,3 @@ public sealed class EveSurfaceSerializationCompatibilityTests
|
|||
return buffer.WrittenSpan.ToArray();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue