Compare commits
7 Commits
0773cba6c7
...
sessions
| Author | SHA1 | Date | |
|---|---|---|---|
|
a18a5c423b
|
|||
|
a3a63a8475
|
|||
|
149ee727ca
|
|||
|
8a5f33b1b4
|
|||
|
62ffc6a365
|
|||
|
1969f9e2fe
|
|||
|
55c8dfd379
|
@@ -1,11 +0,0 @@
|
|||||||
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; }
|
|
||||||
10
maps.proto
10
maps.proto
@@ -24,19 +24,22 @@ message IdMessage {
|
|||||||
message MapResponse {
|
message MapResponse {
|
||||||
int64 ID = 1;
|
int64 ID = 1;
|
||||||
string DisplayName = 2;
|
string DisplayName = 2;
|
||||||
|
string Creator = 3;
|
||||||
int32 GameID = 4;
|
int32 GameID = 4;
|
||||||
uint64 Thumbnail = 6;
|
int64 Date = 5;
|
||||||
}
|
}
|
||||||
|
|
||||||
message MapRequest {
|
message MapRequest {
|
||||||
int64 ID = 1;
|
int64 ID = 1;
|
||||||
optional string DisplayName = 2;
|
optional string DisplayName = 2;
|
||||||
|
optional string Creator = 3;
|
||||||
optional int32 GameID = 4;
|
optional int32 GameID = 4;
|
||||||
optional uint64 Thumbnail = 6;
|
optional int64 Date = 5;
|
||||||
}
|
}
|
||||||
|
|
||||||
message MapFilter {
|
message MapFilter {
|
||||||
optional string DisplayName = 2;
|
optional string DisplayName = 2;
|
||||||
|
optional string Creator = 3;
|
||||||
optional int32 GameID = 4;
|
optional int32 GameID = 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -55,4 +58,5 @@ message Pagination {
|
|||||||
}
|
}
|
||||||
|
|
||||||
message NullResponse {
|
message NullResponse {
|
||||||
}
|
|
||||||
|
}
|
||||||
@@ -11,12 +11,8 @@ do
|
|||||||
--prost_out=$module \
|
--prost_out=$module \
|
||||||
--tonic_out=$module \
|
--tonic_out=$module \
|
||||||
$f
|
$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
|
#I couldn't figure out how to configure protoc to do this
|
||||||
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/, PartialEq, ::prost::Message)\]/, PartialEq, ::prost::Message, 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 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 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"
|
sed -i "s/ pub time_id:/ #\[serde(rename = \"TimeID\")\]\n pub time_id:/g" "$module/$name.rs"
|
||||||
|
|||||||
67
sessions.proto
Normal file
67
sessions.proto
Normal file
@@ -0,0 +1,67 @@
|
|||||||
|
syntax = "proto3";
|
||||||
|
|
||||||
|
option go_package = "git.itzana.me/strafesnet/go-grpc/sessions";
|
||||||
|
|
||||||
|
package sessions;
|
||||||
|
|
||||||
|
service SessionsService {
|
||||||
|
rpc Create(SessionCreate) returns (SessionId);
|
||||||
|
rpc List(ListRequest) returns (SessionList);
|
||||||
|
rpc Aggregate(SessionFilter) returns (SessionAggregate);
|
||||||
|
}
|
||||||
|
|
||||||
|
message SessionIdList { repeated int64 ID = 1; }
|
||||||
|
|
||||||
|
message SessionId { int64 ID = 1; }
|
||||||
|
|
||||||
|
message SessionResponse {
|
||||||
|
int64 ID = 1;
|
||||||
|
uint64 UserID = 2;
|
||||||
|
uint64 MapID = 3;
|
||||||
|
int64 Date = 4;
|
||||||
|
uint32 Duration = 5;
|
||||||
|
uint32 Attempts = 6;
|
||||||
|
uint32 GameID = 7;
|
||||||
|
uint32 StyleID = 8;
|
||||||
|
}
|
||||||
|
|
||||||
|
message SessionCreate {
|
||||||
|
uint64 UserID = 1;
|
||||||
|
uint64 MapID = 2;
|
||||||
|
int64 Date = 3;
|
||||||
|
uint32 Duration = 4;
|
||||||
|
uint32 Attempts = 5;
|
||||||
|
uint32 GameID = 6;
|
||||||
|
uint32 StyleID = 7;
|
||||||
|
}
|
||||||
|
|
||||||
|
enum SessionSort {
|
||||||
|
SessionSortDateDescending = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
message SessionFilter {
|
||||||
|
optional uint64 UserID = 1;
|
||||||
|
optional uint64 MapID = 2;
|
||||||
|
optional uint32 GameID = 3;
|
||||||
|
optional uint32 StyleID = 4;
|
||||||
|
}
|
||||||
|
|
||||||
|
message SessionList { repeated SessionResponse Sessions = 1; }
|
||||||
|
|
||||||
|
message ListRequest {
|
||||||
|
SessionFilter Filter = 1;
|
||||||
|
Pagination Page = 2;
|
||||||
|
Sort SessionSort = 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
message Pagination {
|
||||||
|
uint32 Size = 1;
|
||||||
|
uint32 Number = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
message SessionAggregate {
|
||||||
|
uint64 Duration = 1;
|
||||||
|
uint64 Attempts = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
message NullResponse {}
|
||||||
@@ -28,6 +28,7 @@ message TimeRequest {
|
|||||||
optional int32 StyleID = 6;
|
optional int32 StyleID = 6;
|
||||||
optional int32 ModeID = 7;
|
optional int32 ModeID = 7;
|
||||||
optional int32 GameID = 8;
|
optional int32 GameID = 8;
|
||||||
|
optional uint32 Attempt = 9;
|
||||||
}
|
}
|
||||||
|
|
||||||
message TimeFilter {
|
message TimeFilter {
|
||||||
@@ -51,6 +52,9 @@ message TimeResponse {
|
|||||||
int32 StyleID = 7;
|
int32 StyleID = 7;
|
||||||
int32 ModeID = 8;
|
int32 ModeID = 8;
|
||||||
int32 GameID = 9;
|
int32 GameID = 9;
|
||||||
|
// How many times did the player leave the start zone
|
||||||
|
// during their full play history of the map
|
||||||
|
uint32 Attempt = 10;
|
||||||
}
|
}
|
||||||
|
|
||||||
message IdMessage {
|
message IdMessage {
|
||||||
@@ -100,4 +104,4 @@ message Pagination {
|
|||||||
|
|
||||||
message NullResponse {
|
message NullResponse {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,8 +2,6 @@ syntax = "proto3";
|
|||||||
|
|
||||||
option go_package = "git.itzana.me/strafesnet/go-grpc/validator";
|
option go_package = "git.itzana.me/strafesnet/go-grpc/validator";
|
||||||
|
|
||||||
import "maps_extended.proto";
|
|
||||||
|
|
||||||
package validator;
|
package validator;
|
||||||
|
|
||||||
service ValidatorMapfixService {
|
service ValidatorMapfixService {
|
||||||
@@ -14,11 +12,8 @@ service ValidatorMapfixService {
|
|||||||
rpc SetStatusSubmitted(SubmittedRequest) returns (NullResponse);
|
rpc SetStatusSubmitted(SubmittedRequest) returns (NullResponse);
|
||||||
rpc SetStatusRequestChanges(MapfixID) returns (NullResponse);
|
rpc SetStatusRequestChanges(MapfixID) returns (NullResponse);
|
||||||
rpc SetStatusValidated(MapfixID) returns (NullResponse);
|
rpc SetStatusValidated(MapfixID) returns (NullResponse);
|
||||||
rpc SetStatusNotValidated(MapfixID) returns (NullResponse);
|
rpc SetStatusFailed(MapfixID) returns (NullResponse);
|
||||||
rpc SetStatusUploaded(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 {
|
service ValidatorSubmissionService {
|
||||||
@@ -29,10 +24,8 @@ service ValidatorSubmissionService {
|
|||||||
rpc SetStatusSubmitted(SubmittedRequest) returns (NullResponse);
|
rpc SetStatusSubmitted(SubmittedRequest) returns (NullResponse);
|
||||||
rpc SetStatusRequestChanges(SubmissionID) returns (NullResponse);
|
rpc SetStatusRequestChanges(SubmissionID) returns (NullResponse);
|
||||||
rpc SetStatusValidated(SubmissionID) returns (NullResponse);
|
rpc SetStatusValidated(SubmissionID) returns (NullResponse);
|
||||||
rpc SetStatusNotValidated(SubmissionID) returns (NullResponse);
|
rpc SetStatusFailed(SubmissionID) returns (NullResponse);
|
||||||
rpc SetStatusUploaded(StatusUploadedRequest) returns (NullResponse);
|
rpc SetStatusUploaded(StatusUploadedRequest) returns (NullResponse);
|
||||||
rpc SetStatusNotUploaded(SubmissionID) returns (NullResponse);
|
|
||||||
rpc SetStatusReleased(SubmissionReleaseRequest) returns (NullResponse);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
message MapfixID { uint64 ID = 1; }
|
message MapfixID { uint64 ID = 1; }
|
||||||
@@ -96,31 +89,13 @@ message StatusUploadedRequest {
|
|||||||
uint64 UploadedAssetID = 2;
|
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 {}
|
message NullResponse {}
|
||||||
|
|
||||||
// Operations
|
// Operations
|
||||||
service ValidatorOperationService {
|
service ValidatorOperationService {
|
||||||
rpc Success(OperationSuccessRequest) returns (NullResponse);
|
|
||||||
rpc Fail(OperationFailRequest) returns (NullResponse);
|
rpc Fail(OperationFailRequest) returns (NullResponse);
|
||||||
}
|
}
|
||||||
|
|
||||||
message OperationSuccessRequest {
|
|
||||||
uint32 OperationID = 1;
|
|
||||||
string Path = 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
message OperationFailRequest {
|
message OperationFailRequest {
|
||||||
uint32 OperationID = 1;
|
uint32 OperationID = 1;
|
||||||
string StatusMessage = 2;
|
string StatusMessage = 2;
|
||||||
|
|||||||
Reference in New Issue
Block a user