4 Commits

Author SHA1 Message Date
2db81d21bc update sed codegen
All checks were successful
continuous-integration/drone/push Build is passing
2025-08-13 18:22:58 -07:00
e252921e91 validator: submission and mapfix release endpoints (#11)
All checks were successful
continuous-integration/drone/push Build is passing
These endpoints proxy the creation and updation of maps_extended entries, while also updating the relevant submission / mapfix status.

Reviewed-on: #11
Co-authored-by: Rhys Lloyd <krakow20@gmail.com>
Co-committed-by: Rhys Lloyd <krakow20@gmail.com>
2025-08-14 00:49:29 +00:00
eb8d873290 fix maps.Thumbnail
All checks were successful
continuous-integration/drone/push Build is passing
2025-08-06 17:50:02 -07:00
69aa45ffe6 Cut Down Maps Fields (#5)
All checks were successful
continuous-integration/drone/push Build is passing
Remove fields from MapResponse and other structs that will not be used in embedded contexts.

Reviewed-on: #5
Co-authored-by: Rhys Lloyd <krakow20@gmail.com>
Co-committed-by: Rhys Lloyd <krakow20@gmail.com>
2025-08-07 00:39:45 +00:00
3 changed files with 15 additions and 8 deletions

View File

@@ -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 {
}
}

View File

@@ -12,7 +12,8 @@ do
--tonic_out=$module \
$f
#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/ 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"

View File

@@ -2,6 +2,8 @@ syntax = "proto3";
option go_package = "git.itzana.me/strafesnet/go-grpc/validator";
import "maps_extended.proto";
package validator;
service ValidatorMapfixService {
@@ -14,6 +16,7 @@ service ValidatorMapfixService {
rpc SetStatusValidated(MapfixID) returns (NullResponse);
rpc SetStatusFailed(MapfixID) returns (NullResponse);
rpc SetStatusUploaded(MapfixID) returns (NullResponse);
rpc SetStatusReleased(MapfixReleaseRequest) returns (NullResponse);
}
service ValidatorSubmissionService {
@@ -26,6 +29,7 @@ service ValidatorSubmissionService {
rpc SetStatusValidated(SubmissionID) returns (NullResponse);
rpc SetStatusFailed(SubmissionID) returns (NullResponse);
rpc SetStatusUploaded(StatusUploadedRequest) returns (NullResponse);
rpc SetStatusReleased(maps_extended.MapCreate) returns (NullResponse);
}
message MapfixID { uint64 ID = 1; }
@@ -89,6 +93,12 @@ message StatusUploadedRequest {
uint64 UploadedAssetID = 2;
}
message MapfixReleaseRequest {
uint64 ID = 1;
uint64 AssetVersion = 2;
uint32 Modes = 3;
}
message NullResponse {}
// Operations