Compare commits
13 Commits
sessions
...
83ebab1cc6
| Author | SHA1 | Date | |
|---|---|---|---|
| 83ebab1cc6 | |||
|
0773cba6c7
|
|||
|
63ad706dd9
|
|||
|
8dce6ee1ba
|
|||
|
9a7a123284
|
|||
|
e7913b7950
|
|||
|
6210d5dac9
|
|||
|
80201e09fd
|
|||
|
4e6ed67dda
|
|||
|
1ed8ffbc3c
|
|||
| e252921e91 | |||
|
eb8d873290
|
|||
| 69aa45ffe6 |
11
bot_analyzer.proto
Normal file
11
bot_analyzer.proto
Normal file
@@ -0,0 +1,11 @@
|
||||
syntax = "proto3";
|
||||
|
||||
option go_package = "git.itzana.me/strafesnet/go-grpc/bot_analyzer";
|
||||
|
||||
package bot_analyzer;
|
||||
|
||||
service BotAnalyzer { rpc Analyze(DownloadUrl) returns (AnalysisResponse); }
|
||||
|
||||
message DownloadUrl { string Url = 1; }
|
||||
|
||||
message AnalysisResponse { string Analysis = 1; }
|
||||
81
mapfixes.proto
Normal file
81
mapfixes.proto
Normal file
@@ -0,0 +1,81 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package mapfixes;
|
||||
|
||||
option go_package = "git.itzana.me/strafesnet/go-grpc/mapfixes";
|
||||
|
||||
service MapfixesService {
|
||||
rpc Get(MapfixId) returns (MapfixResponse);
|
||||
rpc GetList(MapfixIdList) returns (MapfixList);
|
||||
rpc List(ListRequest) returns (MapfixList);
|
||||
}
|
||||
|
||||
message MapfixIdList {
|
||||
repeated int64 ID = 1;
|
||||
}
|
||||
|
||||
message MapfixId {
|
||||
int64 ID = 1;
|
||||
}
|
||||
|
||||
enum MapfixStatus {
|
||||
// Phase: Creation
|
||||
MapfixStatusUnderConstruction = 0;
|
||||
MapfixStatusChangesRequested = 1;
|
||||
|
||||
// Phase: Review
|
||||
MapfixStatusSubmitting = 2;
|
||||
MapfixStatusSubmitted = 3;
|
||||
|
||||
// Phase: Testing
|
||||
MapfixStatusAcceptedUnvalidated = 4; // pending script review, can re-trigger validation
|
||||
MapfixStatusValidating = 5;
|
||||
MapfixStatusValidated = 6;
|
||||
MapfixStatusUploading = 7;
|
||||
MapfixStatusUploaded = 8; // uploaded to the group, but pending release
|
||||
MapfixStatusReleasing = 11;
|
||||
|
||||
// Phase: Final MapfixStatus
|
||||
MapfixStatusRejected = 9;
|
||||
MapfixStatusReleased = 10;
|
||||
}
|
||||
|
||||
message MapfixResponse {
|
||||
int64 ID = 1;
|
||||
string DisplayName = 2;
|
||||
string Creator = 3;
|
||||
uint32 GameID = 4;
|
||||
int64 CreatedAt = 5;
|
||||
int64 UpdatedAt = 6;
|
||||
uint64 Submitter = 7;
|
||||
uint64 AssetID = 8;
|
||||
uint64 AssetVersion = 9;
|
||||
uint64 ValidatedAssetID = 10;
|
||||
uint64 ValidatedAssetVersion = 11;
|
||||
uint64 UploadedAssetID = 12;
|
||||
MapfixStatus StatusID = 13;
|
||||
}
|
||||
|
||||
message MapfixFilter {
|
||||
optional MapfixStatus StatusID = 1;
|
||||
optional string DisplayName = 2;
|
||||
optional string Creator = 3;
|
||||
optional uint32 GameID = 4;
|
||||
optional uint64 Submitter = 5;
|
||||
}
|
||||
|
||||
message MapfixList {
|
||||
repeated MapfixResponse Mapfixes = 1;
|
||||
}
|
||||
|
||||
message ListRequest {
|
||||
MapfixFilter Filter = 1;
|
||||
Pagination Page = 2;
|
||||
}
|
||||
|
||||
message Pagination {
|
||||
uint32 Size = 1;
|
||||
uint32 Number = 2;
|
||||
}
|
||||
|
||||
message NullResponse {}
|
||||
10
maps.proto
10
maps.proto
@@ -24,22 +24,19 @@ message IdMessage {
|
||||
message MapResponse {
|
||||
int64 ID = 1;
|
||||
string DisplayName = 2;
|
||||
string Creator = 3;
|
||||
int32 GameID = 4;
|
||||
int64 Date = 5;
|
||||
uint64 Thumbnail = 6;
|
||||
}
|
||||
|
||||
message MapRequest {
|
||||
int64 ID = 1;
|
||||
optional string DisplayName = 2;
|
||||
optional string Creator = 3;
|
||||
optional int32 GameID = 4;
|
||||
optional int64 Date = 5;
|
||||
optional uint64 Thumbnail = 6;
|
||||
}
|
||||
|
||||
message MapFilter {
|
||||
optional string DisplayName = 2;
|
||||
optional string Creator = 3;
|
||||
optional int32 GameID = 4;
|
||||
}
|
||||
|
||||
@@ -58,5 +55,4 @@ message Pagination {
|
||||
}
|
||||
|
||||
message NullResponse {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,8 +11,12 @@ do
|
||||
--prost_out=$module \
|
||||
--tonic_out=$module \
|
||||
$f
|
||||
# prost codegen is wrong!
|
||||
sed -i "s/tonic::codec::ProstCodec/tonic_prost::ProstCodec/g" "$module/$name.tonic.rs"
|
||||
#I couldn't figure out how to configure protoc to do this
|
||||
sed -i "s/, PartialEq, ::prost::Message)\]/, PartialEq, ::prost::Message, serde::Serialize, serde::Deserialize)\]\n#\[serde(rename_all = \"PascalCase\")\]/g" "$module/$name.rs"
|
||||
sed -i "s/#\[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)\]/#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]\n#\[derive(serde::Serialize, serde::Deserialize)\]\n#\[serde(rename_all = \"PascalCase\")\]/g" "$module/$name.rs"
|
||||
sed -i "s/#\[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)\]/#\[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)\]\n#\[derive(serde::Serialize, serde::Deserialize)\]\n#\[serde(rename_all = \"PascalCase\")\]/g" "$module/$name.rs"
|
||||
sed -i "s/#\[derive(Clone, PartialEq, ::prost::Message)\]/#\[derive(Clone, PartialEq, ::prost::Message)\]\n#\[derive(serde::Serialize, serde::Deserialize)\]\n#\[serde(rename_all = \"PascalCase\")\]/g" "$module/$name.rs"
|
||||
sed -i "s/ pub id:/ #\[serde(rename = \"ID\")\]\n pub id:/g" "$module/$name.rs"
|
||||
sed -i "s/ pub map_id:/ #\[serde(rename = \"MapID\")\]\n pub map_id:/g" "$module/$name.rs"
|
||||
sed -i "s/ pub time_id:/ #\[serde(rename = \"TimeID\")\]\n pub time_id:/g" "$module/$name.rs"
|
||||
|
||||
80
submissions.proto
Normal file
80
submissions.proto
Normal file
@@ -0,0 +1,80 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package submissions;
|
||||
|
||||
option go_package = "git.itzana.me/strafesnet/go-grpc/submissions";
|
||||
|
||||
service SubmissionsService {
|
||||
rpc Get(SubmissionId) returns (SubmissionResponse);
|
||||
rpc GetList(SubmissionIdList) returns (SubmissionList);
|
||||
rpc List(ListRequest) returns (SubmissionList);
|
||||
}
|
||||
|
||||
message SubmissionIdList {
|
||||
repeated int64 ID = 1;
|
||||
}
|
||||
|
||||
message SubmissionId {
|
||||
int64 ID = 1;
|
||||
}
|
||||
|
||||
enum SubmissionStatus {
|
||||
// Phase: Creation
|
||||
SubmissionStatusUnderConstruction = 0;
|
||||
SubmissionStatusChangesRequested = 1;
|
||||
|
||||
// Phase: Review
|
||||
SubmissionStatusSubmitting = 2;
|
||||
SubmissionStatusSubmitted = 3;
|
||||
|
||||
// Phase: Testing
|
||||
SubmissionStatusAcceptedUnvalidated = 4; // pending script review, can re-trigger validation
|
||||
SubmissionStatusValidating = 5;
|
||||
SubmissionStatusValidated = 6;
|
||||
SubmissionStatusUploading = 7;
|
||||
SubmissionStatusUploaded = 8; // uploaded to the group, but pending release
|
||||
|
||||
// Phase: Final SubmissionStatus
|
||||
SubmissionStatusRejected = 9;
|
||||
SubmissionStatusReleased = 10;
|
||||
}
|
||||
|
||||
message SubmissionResponse {
|
||||
int64 ID = 1;
|
||||
string DisplayName = 2;
|
||||
string Creator = 3;
|
||||
uint32 GameID = 4;
|
||||
int64 CreatedAt = 7;
|
||||
int64 UpdatedAt = 8;
|
||||
uint64 Submitter = 9;
|
||||
uint64 AssetID = 10;
|
||||
uint64 AssetVersion = 11;
|
||||
uint64 ValidatedAssetID = 12;
|
||||
uint64 ValidatedAssetVersion = 13;
|
||||
uint64 UploadedAssetID = 14;
|
||||
SubmissionStatus StatusID = 15;
|
||||
}
|
||||
|
||||
message SubmissionFilter {
|
||||
optional SubmissionStatus StatusID = 1;
|
||||
optional string DisplayName = 2;
|
||||
optional string Creator = 3;
|
||||
optional uint32 GameID = 4;
|
||||
optional uint64 Submitter = 5;
|
||||
}
|
||||
|
||||
message SubmissionList {
|
||||
repeated SubmissionResponse Submissions = 1;
|
||||
}
|
||||
|
||||
message ListRequest {
|
||||
SubmissionFilter Filter = 1;
|
||||
Pagination Page = 2;
|
||||
}
|
||||
|
||||
message Pagination {
|
||||
uint32 Size = 1;
|
||||
uint32 Number = 2;
|
||||
}
|
||||
|
||||
message NullResponse {}
|
||||
@@ -2,6 +2,8 @@ syntax = "proto3";
|
||||
|
||||
option go_package = "git.itzana.me/strafesnet/go-grpc/validator";
|
||||
|
||||
import "maps_extended.proto";
|
||||
|
||||
package validator;
|
||||
|
||||
service ValidatorMapfixService {
|
||||
@@ -12,8 +14,11 @@ service ValidatorMapfixService {
|
||||
rpc SetStatusSubmitted(SubmittedRequest) returns (NullResponse);
|
||||
rpc SetStatusRequestChanges(MapfixID) returns (NullResponse);
|
||||
rpc SetStatusValidated(MapfixID) returns (NullResponse);
|
||||
rpc SetStatusFailed(MapfixID) returns (NullResponse);
|
||||
rpc SetStatusNotValidated(MapfixID) returns (NullResponse);
|
||||
rpc SetStatusUploaded(MapfixID) returns (NullResponse);
|
||||
rpc SetStatusNotUploaded(MapfixID) returns (NullResponse);
|
||||
rpc SetStatusReleased(MapfixReleaseRequest) returns (NullResponse);
|
||||
rpc SetStatusNotReleased(MapfixID) returns (NullResponse);
|
||||
}
|
||||
|
||||
service ValidatorSubmissionService {
|
||||
@@ -24,8 +29,10 @@ service ValidatorSubmissionService {
|
||||
rpc SetStatusSubmitted(SubmittedRequest) returns (NullResponse);
|
||||
rpc SetStatusRequestChanges(SubmissionID) returns (NullResponse);
|
||||
rpc SetStatusValidated(SubmissionID) returns (NullResponse);
|
||||
rpc SetStatusFailed(SubmissionID) returns (NullResponse);
|
||||
rpc SetStatusNotValidated(SubmissionID) returns (NullResponse);
|
||||
rpc SetStatusUploaded(StatusUploadedRequest) returns (NullResponse);
|
||||
rpc SetStatusNotUploaded(SubmissionID) returns (NullResponse);
|
||||
rpc SetStatusReleased(SubmissionReleaseRequest) returns (NullResponse);
|
||||
}
|
||||
|
||||
message MapfixID { uint64 ID = 1; }
|
||||
@@ -89,13 +96,31 @@ message StatusUploadedRequest {
|
||||
uint64 UploadedAssetID = 2;
|
||||
}
|
||||
|
||||
message MapfixReleaseRequest {
|
||||
uint64 MapfixID = 1;
|
||||
uint64 TargetAssetID = 2;
|
||||
uint64 AssetVersion = 3;
|
||||
uint32 Modes = 4;
|
||||
}
|
||||
|
||||
message SubmissionReleaseRequest {
|
||||
uint64 SubmissionID = 1;
|
||||
maps_extended.MapCreate MapCreate = 2;
|
||||
}
|
||||
|
||||
message NullResponse {}
|
||||
|
||||
// Operations
|
||||
service ValidatorOperationService {
|
||||
rpc Success(OperationSuccessRequest) returns (NullResponse);
|
||||
rpc Fail(OperationFailRequest) returns (NullResponse);
|
||||
}
|
||||
|
||||
message OperationSuccessRequest {
|
||||
uint32 OperationID = 1;
|
||||
string Path = 2;
|
||||
}
|
||||
|
||||
message OperationFailRequest {
|
||||
uint32 OperationID = 1;
|
||||
string StatusMessage = 2;
|
||||
|
||||
Reference in New Issue
Block a user