implement blocked in interactive

This commit is contained in:
Quaternions 2023-09-12 16:56:07 -07:00
parent cad29af4bb
commit 420dbaa022

View File

@ -301,6 +301,7 @@ fn interactive() -> Result<(), Box<dyn std::error::Error>>{
let mut allowed_set=get_allowed_set()?;
let mut allowed_map=get_allowed_map()?;
let mut replace_map=get_replace_map()?;
let mut blocked = get_blocked()?;
for entry in std::fs::read_dir("maps/unprocessed")? {
let file_thing=entry?;
@ -320,6 +321,8 @@ fn interactive() -> Result<(), Box<dyn std::error::Error>>{
if let Some(rbx_dom_weak::types::Variant::String(source)) = script.properties.get("Source") {
let source_action=if check_source_illegal_keywords(source) {
ScriptAction::Flag//script triggers flagging -> Flag
} else if blocked.contains(source) {
ScriptAction::Block//script is blocked -> Block
} else if allowed_set.contains(source) {
ScriptAction::Pass//script is allowed -> Pass
}else if let Some(replace_id)=replace_map.get(source) {
@ -373,7 +376,12 @@ fn interactive() -> Result<(), Box<dyn std::error::Error>>{
ret
}
},
ScriptActionParseResult::Block => ScriptAction::Block,
ScriptActionParseResult::Block => {
blocked.insert(source.clone());
std::fs::write(format!("scripts/blocked/{}.lua",id),source)?;
id+=1;
ScriptAction::Block
},
}
};