From 420dbaa0223bac304925847151bd850f1f5f8dea Mon Sep 17 00:00:00 2001 From: Quaternions Date: Tue, 12 Sep 2023 16:56:07 -0700 Subject: [PATCH] implement blocked in interactive --- src/main.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index d4497ec..be9e4f6 100644 --- a/src/main.rs +++ b/src/main.rs @@ -301,6 +301,7 @@ fn interactive() -> Result<(), Box>{ 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>{ 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>{ ret } }, - ScriptActionParseResult::Block => ScriptAction::Block, + ScriptActionParseResult::Block => { + blocked.insert(source.clone()); + std::fs::write(format!("scripts/blocked/{}.lua",id),source)?; + id+=1; + ScriptAction::Block + }, } };