5 Commits

Author SHA1 Message Date
6f57d86997 copy colors to mapfixes
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2025-06-07 16:46:11 -07:00
2a768d4ff7 remove irrelevant items, add Submitting 2025-06-07 16:46:01 -07:00
af09834589 fix up ids 2025-06-07 16:45:28 -07:00
78c4cae02b Update web/src/app/submissions/[submissionId]/(styles)/page/reviewStatus.scss 2025-06-07 16:40:43 -07:00
e3439d71f2 Update web/src/app/submissions/[submissionId]/(styles)/page/reviewStatus.scss 2025-06-07 16:40:43 -07:00
9 changed files with 65 additions and 294 deletions

129
Cargo.lock generated
View File

@@ -54,56 +54,6 @@ dependencies = [
"libc",
]
[[package]]
name = "anstream"
version = "0.6.19"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "301af1932e46185686725e0fad2f8f2aa7da69dd70bf6ecc44d6b703844a3933"
dependencies = [
"anstyle",
"anstyle-parse",
"anstyle-query",
"anstyle-wincon",
"colorchoice",
"is_terminal_polyfill",
"utf8parse",
]
[[package]]
name = "anstyle"
version = "1.0.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "862ed96ca487e809f1c8e5a8447f6ee2cf102f846893800b20cebdf541fc6bbd"
[[package]]
name = "anstyle-parse"
version = "0.2.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4e7644824f0aa2c7b9384579234ef10eb7efb6a0deb83f9630a49594dd9c15c2"
dependencies = [
"utf8parse",
]
[[package]]
name = "anstyle-query"
version = "1.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6c8bdeb6047d8983be085bab0ba1472e6dc604e7041dbf6fcd5e71523014fae9"
dependencies = [
"windows-sys 0.59.0",
]
[[package]]
name = "anstyle-wincon"
version = "3.0.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "403f75924867bb1033c59fbf0797484329750cfbe3c4325cd33127941fabc882"
dependencies = [
"anstyle",
"once_cell_polyfill",
"windows-sys 0.59.0",
]
[[package]]
name = "arrayref"
version = "0.3.9"
@@ -284,61 +234,6 @@ dependencies = [
"windows-link",
]
[[package]]
name = "clap"
version = "4.5.39"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fd60e63e9be68e5fb56422e397cf9baddded06dae1d2e523401542383bc72a9f"
dependencies = [
"clap_builder",
"clap_derive",
]
[[package]]
name = "clap_builder"
version = "4.5.39"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "89cc6392a1f72bbeb820d71f32108f61fdaf18bc526e1d23954168a67759ef51"
dependencies = [
"anstream",
"anstyle",
"clap_lex",
"strsim",
]
[[package]]
name = "clap_derive"
version = "4.5.32"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "09176aae279615badda0765c0c0b3f6ed53f4709118af73cf4655d85d1530cd7"
dependencies = [
"heck",
"proc-macro2",
"quote",
"syn",
]
[[package]]
name = "clap_lex"
version = "0.7.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f46ad14479a25103f283c0f10005961cf086d8dc42205bb44c46ac563475dca6"
[[package]]
name = "cli"
version = "0.1.0"
dependencies = [
"clap",
"maps-validation",
"rbx_binary",
]
[[package]]
name = "colorchoice"
version = "1.0.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b05b61dc5112cbb17e4b6cd61790d9845d13888356391624cbe7e41efeac1e75"
[[package]]
name = "const-oid"
version = "0.9.6"
@@ -1002,12 +897,6 @@ dependencies = [
"serde",
]
[[package]]
name = "is_terminal_polyfill"
version = "1.70.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf"
[[package]]
name = "itoa"
version = "1.0.15"
@@ -1249,12 +1138,6 @@ version = "1.21.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d"
[[package]]
name = "once_cell_polyfill"
version = "1.70.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a4895175b425cb1f87721b59f0f286c2092bd4af812243672510e1ac53e2e0ad"
[[package]]
name = "openssl"
version = "0.10.73"
@@ -2018,12 +1901,6 @@ version = "1.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3"
[[package]]
name = "strsim"
version = "0.11.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f"
[[package]]
name = "submissions-api"
version = "0.7.2"
@@ -2396,12 +2273,6 @@ version = "1.0.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be"
[[package]]
name = "utf8parse"
version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821"
[[package]]
name = "vcpkg"
version = "0.2.15"

View File

@@ -2,6 +2,5 @@
members = [
"validation",
"validation/api",
"validation/cli",
]
resolver = "2"

View File

@@ -1,9 +0,0 @@
[package]
name = "cli"
version = "0.1.0"
edition = "2024"
[dependencies]
clap = { version = "4.5.39", features = ["derive"] }
maps-validation = { path = ".." }
rbx_binary = "1.0.0"

View File

@@ -1,73 +0,0 @@
use clap::{Args,Parser,Subcommand};
use std::path::{Path,PathBuf};
#[derive(Parser)]
#[command(author,version,about,long_about=None)]
#[command(propagate_version=true)]
struct Cli{
#[command(subcommand)]
command:Commands,
}
#[derive(Subcommand)]
enum Commands{
Check(CheckCommand),
}
#[derive(Args)]
struct CheckCommand{
files:Vec<PathBuf>,
}
fn main(){
let cli=Cli::parse();
match cli.command{
Commands::Check(command)=>command.run().unwrap(),
}
}
#[allow(dead_code)]
#[derive(Debug)]
enum CheckError{
Io(std::io::Error),
Binary(maps_validation::rbx_util::ReadDomError),
CheckDom(maps_validation::rbx_util::GetRootInstanceError),
}
fn check(path:&Path)->Result<(),CheckError>{
let name=path.file_name().unwrap_or_default().to_str().unwrap_or_default();
let file=std::fs::read(path).map_err(CheckError::Io)?;
let dom=maps_validation::rbx_util::read_dom(file.as_slice()).map_err(CheckError::Binary)?;
let check=maps_validation::message_handler::MessageHandler::check_dom(&dom).map_err(CheckError::CheckDom)?;
match check.result(){
Ok(_map_info)=>(),//println!("good {}",map_info.display_name),
Err(Ok(check_list))=>println!("bad {name} Error: {}",check_list.summary()),
Err(Err(e))=>println!("ugly {name} Error: {e}"),
}
Ok(())
}
impl CheckCommand{
fn run(self)->Result<(),()>{
let mut handles=Vec::new();
for path in self.files{
if path.is_file(){
handles.push(std::thread::spawn(move||{
if let Err(e)=check(path.as_path()){
let name=path.file_name().unwrap_or_default().to_str().unwrap_or_default();
println!("ugly {name} Error: {e:?}");
}
}));
}
}
for handle in handles{
handle.join().unwrap();
}
Ok(())
}
}

View File

@@ -371,7 +371,6 @@ impl<ID:Copy+Eq+std::hash::Hash,T> SetDifferenceCheckContextAtLeastOne<ID,T>{
}
/// Info lifted out of a fully compliant map
#[derive(Debug)]
pub struct MapInfoOwned{
pub display_name:String,
pub creator:String,
@@ -383,7 +382,7 @@ struct Exists;
struct Absent;
/// The result of every map check.
pub struct MapCheck<'a>{
struct MapCheck<'a>{
// === METADATA CHECKS ===
// The root must be of class Model
model_class:StringCheck<'a,(),&'static str>,
@@ -512,7 +511,7 @@ impl<'a> ModelInfo<'a>{
}
impl MapCheck<'_>{
pub fn result(self)->Result<MapInfoOwned,Result<MapCheckList,serde_json::Error>>{
fn result(self)->Result<MapInfoOwned,Result<MapCheckList,serde_json::Error>>{
match self{
MapCheck{
model_class:StringCheck(Ok(())),
@@ -587,10 +586,10 @@ impl<D:std::fmt::Display> std::fmt::Display for Duplicates<D>{
}
#[derive(serde::Serialize)]
pub struct CheckSummary{
struct CheckSummary{
name:&'static str,
summary:String,
pub passed:bool,
passed:bool,
details:serde_json::Value,
}
impl CheckSummary{
@@ -781,18 +780,17 @@ impl MapCheck<'_>{
}
#[derive(serde::Serialize)]
pub struct MapCheckList{
pub checks:Box<[CheckSummary;16]>,
struct MapCheckList{
checks:Box<[CheckSummary;16]>,
}
impl MapCheckList{
pub fn summary(&self)->String{
fn summary(&self)->String{
Separated::new("; ",||self.checks.iter().filter_map(|check|
(!check.passed).then_some(check.summary.as_str())
)).to_string()
}
}
#[derive(Debug)]
pub struct Summary{
pub summary:String,
pub json:serde_json::Value,
@@ -826,7 +824,14 @@ impl crate::message_handler::MessageHandler{
// decode dom (slow!)
let dom=maybe_gzip.read_with(read_dom,read_dom).map_err(Error::ModelFileDecode)?;
let map_check=Self::check_dom(&dom).map_err(Error::GetRootInstance)?;
// extract the root instance
let model_instance=get_root_instance(&dom).map_err(Error::GetRootInstance)?;
// extract information from the model
let model_info=get_model_info(&dom,model_instance);
// convert the model information into a structured report
let map_check=model_info.check();
// check the report, generate an error message if it fails the check
let status=match map_check.result(){
@@ -840,16 +845,4 @@ impl crate::message_handler::MessageHandler{
Ok(CheckReportAndVersion{status,version})
}
pub fn check_dom(dom:&rbx_dom_weak::WeakDom)->Result<MapCheck,GetRootInstanceError>{
// extract the root instance
let model_instance=get_root_instance(&dom)?;
// extract information from the model
let model_info=get_model_info(&dom,model_instance);
// convert the model information into a structured report
let map_check=model_info.check();
Ok(map_check)
}
}

View File

@@ -1,16 +0,0 @@
pub mod rbx_util;
pub mod message_handler;
pub mod nats_types;
pub mod types;
pub mod download;
pub mod check;
pub mod check_mapfix;
pub mod check_submission;
pub mod create;
pub mod create_mapfix;
pub mod create_submission;
pub mod upload_mapfix;
pub mod upload_submission;
pub mod validator;
pub mod validate_mapfix;
pub mod validate_submission;

View File

@@ -40,7 +40,6 @@ fn find_first_child_name_and_class<'a>(dom:&'a rbx_dom_weak::WeakDom,instance:&r
instance.children().iter().filter_map(|&r|dom.get_by_ref(r)).find(|inst|inst.name==name&&inst.class==class)
}
#[derive(Debug)]
pub enum GameID{
Bhop=1,
Surf=2,

View File

@@ -1,13 +1,13 @@
$UnderConstruction: "0";
$Submitted: "1";
$ChangesRequested: "2";
$Accepted: "3";
$Validating: "4";
$Validated: "5";
$Uploading: "6";
$Uploaded: "7";
$Rejected: "8";
$Released: "9";
$Submitting: "1";
$Submitted: "2";
$ChangesRequested: "3";
$Accepted: "4";
$Validating: "5";
$Validated: "6";
$Uploading: "7";
$Uploaded: "8";
$Rejected: "9";
.review-status {
border-radius: 5px;
@@ -17,62 +17,62 @@ $Released: "9";
font-weight: bold;
}
&[data-review-status="#{$Released}"] {
background-color: orange;
p {
color: white;
}
}
&[data-review-status="#{$Rejected}"] {
background-color: orange;
background-color: rgb(255, 0, 0);
p {
color: white;
}
}
&[data-review-status="#{$Uploading}"] {
background-color: orange;
background-color: rgb(255, 165, 0);
p {
color: white;
}
}
&[data-review-status="#{$Uploaded}"] {
background-color: orange;
background-color: rgb(0, 150, 0);
p {
color: white;
}
}
&[data-review-status="#{$Validated}"] {
background-color: orange;
background-color: rgb(0, 255, 0);
p {
color: white;
}
}
&[data-review-status="#{$Validating}"] {
background-color: orange;
background-color: rgb(255, 165, 0);
p {
color: white;
}
}
&[data-review-status="#{$Accepted}"] {
background-color: rgb(2, 162, 2);
background-color: rgb(0, 150, 0);
p {
color: white;
}
}
&[data-review-status="#{$ChangesRequested}"] {
background-color: orange;
background-color: rgb(255, 125, 0);
p {
color: white;
}
}
&[data-review-status="#{$Submitted}"] {
background-color: orange;
background-color: rgb(255, 165, 0);
p {
color: white;
}
}
&[data-review-status="#{$Submitting}"] {
background-color: rgb(255, 165, 0);
p {
color: white;
}
}
&[data-review-status="#{$UnderConstruction}"] {
background-color: orange;
background-color: rgb(0, 150, 255);
p {
color: white;
}

View File

@@ -1,13 +1,14 @@
$UnderConstruction: "0";
$Submitted: "1";
$ChangesRequested: "2";
$Accepted: "3";
$Validating: "4";
$Validated: "5";
$Uploading: "6";
$Uploaded: "7";
$Rejected: "8";
$Released: "9";
$Submitting: "1";
$Submitted: "2";
$ChangesRequested: "3";
$Accepted: "4";
$Validating: "5";
$Validated: "6";
$Uploading: "7";
$Uploaded: "8";
$Rejected: "9";
$Released: "10";
.review-status {
border-radius: 5px;
@@ -18,61 +19,67 @@ $Released: "9";
}
&[data-review-status="#{$Released}"] {
background-color: orange;
background-color: rgb(255, 165, 0);
p {
color: white;
}
}
&[data-review-status="#{$Rejected}"] {
background-color: orange;
background-color: rgb(255, 0, 0);
p {
color: white;
}
}
&[data-review-status="#{$Uploading}"] {
background-color: orange;
background-color: rgb(255, 165, 0);
p {
color: white;
}
}
&[data-review-status="#{$Uploaded}"] {
background-color: orange;
background-color: rgb(0, 150, 0);
p {
color: white;
}
}
&[data-review-status="#{$Validated}"] {
background-color: orange;
background-color: rgb(0, 255, 0);
p {
color: white;
}
}
&[data-review-status="#{$Validating}"] {
background-color: orange;
background-color: rgb(255, 165, 0);
p {
color: white;
}
}
&[data-review-status="#{$Accepted}"] {
background-color: rgb(2, 162, 2);
background-color: rgb(0, 150, 0);
p {
color: white;
}
}
&[data-review-status="#{$ChangesRequested}"] {
background-color: orange;
background-color: rgb(255, 125, 0);
p {
color: white;
}
}
&[data-review-status="#{$Submitted}"] {
background-color: orange;
background-color: rgb(255, 165, 0);
p {
color: white;
}
}
&[data-review-status="#{$Submitting}"] {
background-color: rgb(255, 165, 0);
p {
color: white;
}
}
&[data-review-status="#{$UnderConstruction}"] {
background-color: orange;
background-color: rgb(0, 150, 255);
p {
color: white;
}