diff --git a/validation/.gitignore b/validation/.gitignore new file mode 100644 index 0000000..ea8c4bf --- /dev/null +++ b/validation/.gitignore @@ -0,0 +1 @@ +/target diff --git a/validation/Cargo.lock b/validation/Cargo.lock new file mode 100644 index 0000000..c3d3b87 --- /dev/null +++ b/validation/Cargo.lock @@ -0,0 +1,16 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "bitflags" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" + +[[package]] +name = "maps-valication" +version = "0.1.0" +dependencies = [ + "bitflags", +] diff --git a/validation/Cargo.toml b/validation/Cargo.toml new file mode 100644 index 0000000..7d0e0a0 --- /dev/null +++ b/validation/Cargo.toml @@ -0,0 +1,7 @@ +[package] +name = "maps-valication" +version = "0.1.0" +edition = "2021" + +[dependencies] +bitflags = "2.6.0" diff --git a/validation/src/main.rs b/validation/src/main.rs new file mode 100644 index 0000000..18f1198 --- /dev/null +++ b/validation/src/main.rs @@ -0,0 +1,6 @@ +mod types; +mod maptest; +mod staging; + +fn main(){ +} diff --git a/validation/src/maptest.rs b/validation/src/maptest.rs new file mode 100644 index 0000000..c8747e1 --- /dev/null +++ b/validation/src/maptest.rs @@ -0,0 +1,35 @@ +use crate::types::Games; + +enum Status{ + Accepted, + Rejected,//map council will not request changes, submit a new map + ChangesRequested,//map council requests changes + Submitted,//Submitted by owner for review by map council + UnderConstruction,//default state upon map creation +} + +enum MaptestType{ + // mapfixes change an existing map on staging game, so they know what map_id they upload to. + Mapfix{ + //maps database entry id + map_id:u64, + }, + // map submissions create a new map entry in the staging map database when they are accepted. + Submission{ + games:Games, + creator:String, + display_name:String, + }, +} + +struct Map{ + //maptest database entry id + id:u64, + date:u64, + // int64 UserID who created the submission + // this user is allowed to change any data at any time, except for mapfix target map id + owner:u64, + model_id:u64,// asset id of the most recently submitted model + maptest_type:MaptestType, + status:Status, +} diff --git a/validation/src/staging.rs b/validation/src/staging.rs new file mode 100644 index 0000000..1177cfe --- /dev/null +++ b/validation/src/staging.rs @@ -0,0 +1,25 @@ +use crate::types::Games; + +// This data structure just exists to remember the hash of the model file as it's uploaded +// so that the hash can be checked later to see if the file is changed +struct AssetVersion{ + //roblox asset id + asset_id:u64, + //hash of map file before upload + hash:u128, +} + +struct Git; + +struct Map{ + id:u64,//database entry + date:u64, + games:Games, + creator:String, + display_name:String, + //the staging model is created at the same time as the maps database entry + staging:AssetVersion, + //the main model does not exist before the submission is published for the first time + main:Option, + changelog:Git,//An entire git repo, ideally the xml of the roblox map +} diff --git a/validation/src/types.rs b/validation/src/types.rs new file mode 100644 index 0000000..006fa30 --- /dev/null +++ b/validation/src/types.rs @@ -0,0 +1,8 @@ +bitflags::bitflags!{ + #[derive(Clone,Copy,Debug,Default)] + pub struct Games:u32{ + const Bhop=1<<0; + const Surf=2<<0; + const FlyTrials=5<<0; + } +}