implement blocked in interactive
This commit is contained in:
parent
cad29af4bb
commit
420dbaa022
10
src/main.rs
10
src/main.rs
@ -301,6 +301,7 @@ fn interactive() -> Result<(), Box<dyn std::error::Error>>{
|
|||||||
let mut allowed_set=get_allowed_set()?;
|
let mut allowed_set=get_allowed_set()?;
|
||||||
let mut allowed_map=get_allowed_map()?;
|
let mut allowed_map=get_allowed_map()?;
|
||||||
let mut replace_map=get_replace_map()?;
|
let mut replace_map=get_replace_map()?;
|
||||||
|
let mut blocked = get_blocked()?;
|
||||||
|
|
||||||
for entry in std::fs::read_dir("maps/unprocessed")? {
|
for entry in std::fs::read_dir("maps/unprocessed")? {
|
||||||
let file_thing=entry?;
|
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") {
|
if let Some(rbx_dom_weak::types::Variant::String(source)) = script.properties.get("Source") {
|
||||||
let source_action=if check_source_illegal_keywords(source) {
|
let source_action=if check_source_illegal_keywords(source) {
|
||||||
ScriptAction::Flag//script triggers flagging -> Flag
|
ScriptAction::Flag//script triggers flagging -> Flag
|
||||||
|
} else if blocked.contains(source) {
|
||||||
|
ScriptAction::Block//script is blocked -> Block
|
||||||
} else if allowed_set.contains(source) {
|
} else if allowed_set.contains(source) {
|
||||||
ScriptAction::Pass//script is allowed -> Pass
|
ScriptAction::Pass//script is allowed -> Pass
|
||||||
}else if let Some(replace_id)=replace_map.get(source) {
|
}else if let Some(replace_id)=replace_map.get(source) {
|
||||||
@ -373,7 +376,12 @@ fn interactive() -> Result<(), Box<dyn std::error::Error>>{
|
|||||||
ret
|
ret
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
ScriptActionParseResult::Block => ScriptAction::Block,
|
ScriptActionParseResult::Block => {
|
||||||
|
blocked.insert(source.clone());
|
||||||
|
std::fs::write(format!("scripts/blocked/{}.lua",id),source)?;
|
||||||
|
id+=1;
|
||||||
|
ScriptAction::Block
|
||||||
|
},
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user