This commit is contained in:
Quaternions 2024-12-02 21:09:59 -08:00
parent 895a3f1249
commit 92fe223d96
4 changed files with 52 additions and 0 deletions

2
validation/Cargo.lock generated
View File

@ -1182,6 +1182,8 @@ dependencies = [
"rbx_binary", "rbx_binary",
"rbx_dom_weak", "rbx_dom_weak",
"rbx_xml", "rbx_xml",
"serde",
"serde_json",
"sqlx", "sqlx",
"tokio", "tokio",
] ]

View File

@ -10,5 +10,7 @@ rbx_asset = { version = "0.2.3", registry = "strafesnet" }
rbx_binary = { version = "0.7.4", registry = "strafesnet"} rbx_binary = { version = "0.7.4", registry = "strafesnet"}
rbx_dom_weak = { version = "2.9.0", registry = "strafesnet"} rbx_dom_weak = { version = "2.9.0", registry = "strafesnet"}
rbx_xml = { version = "0.13.3", registry = "strafesnet"} rbx_xml = { version = "0.13.3", registry = "strafesnet"}
serde = { version = "1.0.215", features = ["derive"] }
serde_json = "1.0.133"
sqlx = "0.8.2" sqlx = "0.8.2"
tokio = { version = "1.41.1", features = ["macros", "rt-multi-thread", "fs"] } tokio = { version = "1.41.1", features = ["macros", "rt-multi-thread", "fs"] }

View File

@ -1,3 +1,4 @@
mod nats_types;
mod publisher; mod publisher;
mod validator; mod validator;

View File

@ -0,0 +1,47 @@
// These represent the information needed in the nats message
// to perform the operation, not necessarily the over-the-wire format
// Requests are sent from maps-service to validator
// Responses are sent from validator to maps-service
#[derive(serde::Deserialize)]
pub struct ValidateRequest{
// submission_id is passed back in the response message
pub submission_id:u64,
pub model_id:u64,
pub model_version:u64,
}
pub struct ValidateResponse{
pub submission_id:u64,
// model id will be changed if scripts were replaced
pub model_id:u64,
pub model_version:u64,
}
// an invalidate is sent instead if validation fails
pub struct InvalidateResponse{
pub submission_id:u64,
}
// Create a new map
pub struct PublishNewRequest{
pub submission_id:u64,
pub model_id:u64,
pub model_version:u64,
pub creator:String,
pub display_name:String,
//games:HashSet<GameID>,
}
pub struct PublishFixRequest{
pub submission_id:u64,
pub model_id:u64,
pub model_version:u64,
pub target_asset_id:u64,
}
pub struct PublishResponse{
pub submission_id:u64,
pub success:bool,
}