v6: Replace palace.proto/export.proto with net model
This commit is contained in:
parent
4ded313998
commit
375c99e313
@ -73,6 +73,11 @@
|
||||
"resolved": "2.14.1",
|
||||
"contentHash": "lQKvtaTDOXnoVJ20ibTuSIOf2i0uO0MPbDhd1jm238I+U/2ZnRENj0cktKZhtchBMtCUSRQ5v4xBCUbKNmyVMw=="
|
||||
},
|
||||
"MessagePack.Annotations": {
|
||||
"type": "Transitive",
|
||||
"resolved": "2.5.140",
|
||||
"contentHash": "JE3vwluOrsJ4t3hnfXzIxJUh6lhx6M/KR8Sark/HOUw1DJ5UKu5JsAnnuaQngg6poFkRx1lzHSLTkxHNJO7+uQ=="
|
||||
},
|
||||
"Microsoft.Data.Sqlite.Core": {
|
||||
"type": "Transitive",
|
||||
"resolved": "7.0.13",
|
||||
@ -273,7 +278,10 @@
|
||||
"type": "Project"
|
||||
},
|
||||
"pal.common": {
|
||||
"type": "Project"
|
||||
"type": "Project",
|
||||
"dependencies": {
|
||||
"MessagePack.Annotations": "[2.5.140, )"
|
||||
}
|
||||
}
|
||||
},
|
||||
"net7.0-windows7.0/win-x64": {
|
||||
|
@ -1,4 +1,4 @@
|
||||
namespace Pal.Common.Net.Models;
|
||||
namespace Pal.Common.Net.Models.Account;
|
||||
|
||||
public sealed class CreateAccountError
|
||||
{
|
@ -1,4 +1,4 @@
|
||||
namespace Pal.Common.Net.Models;
|
||||
namespace Pal.Common.Net.Models.Account;
|
||||
|
||||
public sealed class CreateAccountReply
|
||||
{
|
@ -1,6 +1,6 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Pal.Common.Net.Models;
|
||||
namespace Pal.Common.Net.Models.Account;
|
||||
|
||||
public sealed class CreateAccountRequest
|
||||
{
|
@ -1,4 +1,4 @@
|
||||
namespace Pal.Common.Net.Models;
|
||||
namespace Pal.Common.Net.Models.Account;
|
||||
|
||||
public sealed class LoginError
|
||||
{
|
@ -1,4 +1,4 @@
|
||||
namespace Pal.Common.Net.Models;
|
||||
namespace Pal.Common.Net.Models.Account;
|
||||
|
||||
public sealed class LoginReply
|
||||
{
|
@ -1,6 +1,6 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Pal.Common.Net.Models;
|
||||
namespace Pal.Common.Net.Models.Account;
|
||||
|
||||
public sealed class LoginRequest
|
||||
{
|
@ -1,4 +1,4 @@
|
||||
namespace Pal.Common.Net.Models;
|
||||
namespace Pal.Common.Net.Models.Account;
|
||||
|
||||
public sealed class Version
|
||||
{
|
13
Pal.Common/Net/Models/Export/ExportFloor.cs
Normal file
13
Pal.Common/Net/Models/Export/ExportFloor.cs
Normal file
@ -0,0 +1,13 @@
|
||||
using MessagePack;
|
||||
|
||||
namespace Pal.Common.Net.Models.Export;
|
||||
|
||||
[MessagePackObject]
|
||||
public sealed class ExportFloor
|
||||
{
|
||||
[Key(0)]
|
||||
public required ETerritoryType TerritoryType { get; init; }
|
||||
|
||||
[Key(1)]
|
||||
public required List<ExportObject> Objects { get; init; }
|
||||
}
|
20
Pal.Common/Net/Models/Export/ExportObject.cs
Normal file
20
Pal.Common/Net/Models/Export/ExportObject.cs
Normal file
@ -0,0 +1,20 @@
|
||||
using MessagePack;
|
||||
using Pal.Common.Net.Models.Palace;
|
||||
|
||||
namespace Pal.Common.Net.Models.Export;
|
||||
|
||||
[MessagePackObject]
|
||||
public sealed class ExportObject
|
||||
{
|
||||
[Key(0)]
|
||||
public required EObjectType Type { get; init; }
|
||||
|
||||
[Key(1)]
|
||||
public required float X { get; set; }
|
||||
|
||||
[Key(2)]
|
||||
public required float Y { get; set; }
|
||||
|
||||
[Key(3)]
|
||||
public required float Z { get; set; }
|
||||
}
|
6
Pal.Common/Net/Models/Export/ExportRequest.cs
Normal file
6
Pal.Common/Net/Models/Export/ExportRequest.cs
Normal file
@ -0,0 +1,6 @@
|
||||
namespace Pal.Common.Net.Models.Export;
|
||||
|
||||
public sealed class ExportRequest
|
||||
{
|
||||
public required string ServerUrl { get; init; }
|
||||
}
|
22
Pal.Common/Net/Models/Export/ExportRoot.cs
Normal file
22
Pal.Common/Net/Models/Export/ExportRoot.cs
Normal file
@ -0,0 +1,22 @@
|
||||
using MessagePack;
|
||||
|
||||
namespace Pal.Common.Net.Models.Export;
|
||||
|
||||
[MessagePackObject]
|
||||
public sealed class ExportRoot
|
||||
{
|
||||
[Key(0)]
|
||||
public required Guid ExportId { get; init; }
|
||||
|
||||
[Key(1)]
|
||||
public required int ExportVersion { get; init; }
|
||||
|
||||
[Key(2)]
|
||||
public required string ServerUrl { get; init; }
|
||||
|
||||
[Key(3)]
|
||||
public required DateTime CreatedAt { get; init; }
|
||||
|
||||
[Key(4)]
|
||||
public required List<ExportFloor> Floors { get; init; }
|
||||
}
|
6
Pal.Common/Net/Models/Palace/DownloadFloorsError.cs
Normal file
6
Pal.Common/Net/Models/Palace/DownloadFloorsError.cs
Normal file
@ -0,0 +1,6 @@
|
||||
namespace Pal.Common.Net.Models.Palace;
|
||||
|
||||
public sealed class DownloadFloorsError
|
||||
{
|
||||
|
||||
}
|
7
Pal.Common/Net/Models/Palace/DownloadFloorsReply.cs
Normal file
7
Pal.Common/Net/Models/Palace/DownloadFloorsReply.cs
Normal file
@ -0,0 +1,7 @@
|
||||
|
||||
namespace Pal.Common.Net.Models.Palace;
|
||||
|
||||
public sealed class DownloadFloorsReply
|
||||
{
|
||||
public required List<PalaceObject> Objects { get; init; }
|
||||
}
|
10
Pal.Common/Net/Models/Palace/EObjectType.cs
Normal file
10
Pal.Common/Net/Models/Palace/EObjectType.cs
Normal file
@ -0,0 +1,10 @@
|
||||
namespace Pal.Common.Net.Models.Palace;
|
||||
|
||||
public enum EObjectType : int
|
||||
{
|
||||
Unknown = 0,
|
||||
Trap = 1,
|
||||
Hoard = 2,
|
||||
|
||||
Debug_NotSynchronized = 3,
|
||||
}
|
6
Pal.Common/Net/Models/Palace/MarkObjectsSeenError.cs
Normal file
6
Pal.Common/Net/Models/Palace/MarkObjectsSeenError.cs
Normal file
@ -0,0 +1,6 @@
|
||||
|
||||
namespace Pal.Common.Net.Models.Palace;
|
||||
|
||||
public sealed class MarkObjectsSeenError
|
||||
{
|
||||
}
|
5
Pal.Common/Net/Models/Palace/MarkObjectsSeenReply.cs
Normal file
5
Pal.Common/Net/Models/Palace/MarkObjectsSeenReply.cs
Normal file
@ -0,0 +1,5 @@
|
||||
namespace Pal.Common.Net.Models.Palace;
|
||||
|
||||
public sealed class MarkObjectsSeenReply
|
||||
{
|
||||
}
|
7
Pal.Common/Net/Models/Palace/MarkObjectsSeenRequest.cs
Normal file
7
Pal.Common/Net/Models/Palace/MarkObjectsSeenRequest.cs
Normal file
@ -0,0 +1,7 @@
|
||||
namespace Pal.Common.Net.Models.Palace;
|
||||
|
||||
public sealed class MarkObjectsSeenRequest
|
||||
{
|
||||
public required ETerritoryType TerritoryType { get; init; }
|
||||
public required List<Guid> NetworkIds { get; init; }
|
||||
}
|
12
Pal.Common/Net/Models/Palace/PalaceObject.cs
Normal file
12
Pal.Common/Net/Models/Palace/PalaceObject.cs
Normal file
@ -0,0 +1,12 @@
|
||||
namespace Pal.Common.Net.Models.Palace;
|
||||
|
||||
public sealed class PalaceObject
|
||||
{
|
||||
public required EObjectType Type { get; init; }
|
||||
|
||||
public required float X { get; init; }
|
||||
public required float Y { get; init; }
|
||||
public required float Z { get; init; }
|
||||
|
||||
public Guid NetworkId { get; init; }
|
||||
}
|
5
Pal.Common/Net/Models/Palace/StatisticsError.cs
Normal file
5
Pal.Common/Net/Models/Palace/StatisticsError.cs
Normal file
@ -0,0 +1,5 @@
|
||||
namespace Pal.Common.Net.Models.Palace;
|
||||
|
||||
public sealed class StatisticsError
|
||||
{
|
||||
}
|
13
Pal.Common/Net/Models/Palace/StatisticsReply.cs
Normal file
13
Pal.Common/Net/Models/Palace/StatisticsReply.cs
Normal file
@ -0,0 +1,13 @@
|
||||
namespace Pal.Common.Net.Models.Palace;
|
||||
|
||||
public sealed class StatisticsReply
|
||||
{
|
||||
public required List<FloorStatistics> Floors { get; init; }
|
||||
|
||||
public sealed class FloorStatistics
|
||||
{
|
||||
public required ETerritoryType TerritoryType { get; init; }
|
||||
public required uint TrapCount { get; init; }
|
||||
public required uint HoardCount { get; init; }
|
||||
}
|
||||
}
|
5
Pal.Common/Net/Models/Palace/UploadFloorsError.cs
Normal file
5
Pal.Common/Net/Models/Palace/UploadFloorsError.cs
Normal file
@ -0,0 +1,5 @@
|
||||
namespace Pal.Common.Net.Models.Palace;
|
||||
|
||||
public sealed class UploadFloorsError
|
||||
{
|
||||
}
|
6
Pal.Common/Net/Models/Palace/UploadFloorsReply.cs
Normal file
6
Pal.Common/Net/Models/Palace/UploadFloorsReply.cs
Normal file
@ -0,0 +1,6 @@
|
||||
namespace Pal.Common.Net.Models.Palace;
|
||||
|
||||
public sealed class UploadFloorsReply
|
||||
{
|
||||
public required List<PalaceObject> Objects { get; init; }
|
||||
}
|
7
Pal.Common/Net/Models/Palace/UploadFloorsRequest.cs
Normal file
7
Pal.Common/Net/Models/Palace/UploadFloorsRequest.cs
Normal file
@ -0,0 +1,7 @@
|
||||
namespace Pal.Common.Net.Models.Palace;
|
||||
|
||||
public sealed class UploadFloorsRequest
|
||||
{
|
||||
public required ETerritoryType TerritoryType { get; init; }
|
||||
public required List<PalaceObject> Objects { get; init; }
|
||||
}
|
@ -9,4 +9,8 @@
|
||||
<PathMap Condition="$(SolutionDir) != ''">$(SolutionDir)=X:\</PathMap>
|
||||
<RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="MessagePack.Annotations" Version="2.5.140" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
@ -1,58 +0,0 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package export;
|
||||
|
||||
import "google/protobuf/timestamp.proto";
|
||||
|
||||
service ExportService {
|
||||
rpc Export(ExportRequest) returns (ExportReply);
|
||||
}
|
||||
|
||||
message ExportRequest {
|
||||
string serverUrl = 1;
|
||||
}
|
||||
|
||||
|
||||
message ExportReply {
|
||||
bool success = 1;
|
||||
ExportRoot data = 2;
|
||||
ExportError error = 3;
|
||||
}
|
||||
|
||||
enum ExportError {
|
||||
EXPORT_ERROR_NONE = 0;
|
||||
EXPORT_ERROR_UNKNOWN = 1;
|
||||
}
|
||||
|
||||
message ExportRoot {
|
||||
string exportId = 1;
|
||||
|
||||
// Only increases if the export format changes, in case of backwards-incompatible changes.
|
||||
int32 exportVersion = 2;
|
||||
|
||||
string serverUrl = 3;
|
||||
|
||||
// Server MAY decide not to send any markers older than this.
|
||||
google.protobuf.Timestamp createdAt = 4;
|
||||
|
||||
repeated ExportFloor floors = 5;
|
||||
}
|
||||
|
||||
message ExportFloor {
|
||||
uint32 territoryType = 1;
|
||||
repeated ExportObject objects = 2;
|
||||
}
|
||||
|
||||
message ExportObject {
|
||||
ExportObjectType type = 1;
|
||||
float x = 2;
|
||||
float y = 3;
|
||||
float z = 4;
|
||||
//string networkId = 5;
|
||||
}
|
||||
|
||||
enum ExportObjectType {
|
||||
EXPORT_OBJECT_TYPE_UNKNOWN = 0;
|
||||
EXPORT_OBJECT_TYPE_TRAP = 1;
|
||||
EXPORT_OBJECT_TYPE_HOARD = 2;
|
||||
}
|
@ -1,72 +0,0 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package palace;
|
||||
|
||||
service PalaceService {
|
||||
rpc DownloadFloors(DownloadFloorsRequest) returns (DownloadFloorsReply);
|
||||
rpc UploadFloors(UploadFloorsRequest) returns (UploadFloorsReply);
|
||||
rpc MarkObjectsSeen(MarkObjectsSeenRequest) returns (MarkObjectsSeenReply);
|
||||
rpc FetchStatistics(StatisticsRequest) returns (StatisticsReply);
|
||||
}
|
||||
|
||||
message DownloadFloorsRequest {
|
||||
uint32 territoryType = 1;
|
||||
}
|
||||
|
||||
message DownloadFloorsReply {
|
||||
bool success = 1;
|
||||
repeated PalaceObject objects = 2;
|
||||
}
|
||||
|
||||
message UploadFloorsRequest {
|
||||
uint32 territoryType = 1;
|
||||
repeated PalaceObject objects = 2;
|
||||
}
|
||||
|
||||
message UploadFloorsReply {
|
||||
bool success = 1;
|
||||
repeated PalaceObject objects = 2;
|
||||
}
|
||||
|
||||
message StatisticsRequest {
|
||||
}
|
||||
|
||||
message StatisticsReply {
|
||||
bool success = 1;
|
||||
repeated FloorStatistics floorStatistics = 2;
|
||||
}
|
||||
|
||||
message FloorStatistics {
|
||||
uint32 territoryType = 1;
|
||||
uint32 trapCount = 2;
|
||||
uint32 hoardCount = 3;
|
||||
}
|
||||
|
||||
message PalaceObject {
|
||||
ObjectType type = 1;
|
||||
float x = 2;
|
||||
float y = 3;
|
||||
float z = 4;
|
||||
|
||||
// Ignored for uploaded markers.
|
||||
string networkId = 5;
|
||||
}
|
||||
|
||||
message MarkObjectsSeenRequest {
|
||||
uint32 territoryType = 1;
|
||||
repeated string networkIds = 2;
|
||||
}
|
||||
|
||||
message MarkObjectsSeenReply {
|
||||
bool success = 1;
|
||||
}
|
||||
|
||||
enum ObjectType {
|
||||
OBJECT_TYPE_UNKNOWN = 0;
|
||||
OBJECT_TYPE_TRAP = 1;
|
||||
OBJECT_TYPE_HOARD = 2;
|
||||
|
||||
// Objects only really used for debugging, may not return any objects at any point in time.
|
||||
// Semi-Permanent: Not saved locally, but saved on the server.
|
||||
reserved 3;
|
||||
}
|
@ -1,6 +1,13 @@
|
||||
{
|
||||
"version": 1,
|
||||
"dependencies": {
|
||||
"net7.0": {}
|
||||
"net7.0": {
|
||||
"MessagePack.Annotations": {
|
||||
"type": "Direct",
|
||||
"requested": "[2.5.140, )",
|
||||
"resolved": "2.5.140",
|
||||
"contentHash": "JE3vwluOrsJ4t3hnfXzIxJUh6lhx6M/KR8Sark/HOUw1DJ5UKu5JsAnnuaQngg6poFkRx1lzHSLTkxHNJO7+uQ=="
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
2
Server
2
Server
@ -1 +1 @@
|
||||
Subproject commit ad12f4fa2b89fbdd8bab4c10e379a6557c644873
|
||||
Subproject commit 7b0513278b97a7a45113ef33c74e84e92fedf900
|
Loading…
Reference in New Issue
Block a user