summaryrefslogtreecommitdiff
path: root/src/components
diff options
context:
space:
mode:
authortroido <troido@protonmail.com>2020-04-16 10:54:23 +0200
committertroido <troido@protonmail.com>2020-04-16 10:54:23 +0200
commit905c6b649521296bba609db5b5c9a39008d34325 (patch)
tree8d253de507b3663399e23819bf8b4a222e7b64a5 /src/components
parent43bde225ebbadd0b917ca87f3164a50455a2b588 (diff)
add visit whitelist to homeportal, save and dedup its data even though it is loaded from template
Diffstat (limited to 'src/components')
-rw-r--r--src/components/interactable.rs2
-rw-r--r--src/components/mod.rs10
2 files changed, 8 insertions, 4 deletions
diff --git a/src/components/interactable.rs b/src/components/interactable.rs
index 3432f33..f1f0508 100644
--- a/src/components/interactable.rs
+++ b/src/components/interactable.rs
@@ -65,7 +65,7 @@ impl Interactable {
}
Visit(_) => {
if let Some(txt) = arg {
- txt.starts_with("visit")
+ txt.starts_with("visit ") || txt.starts_with("disallow ") || txt.starts_with("allow ") || txt.starts_with("whitelist")
} else {
false
}
diff --git a/src/components/mod.rs b/src/components/mod.rs
index ae50edc..176f97a 100644
--- a/src/components/mod.rs
+++ b/src/components/mod.rs
@@ -29,7 +29,7 @@ pub use ear::{
Ear
};
-use std::collections::HashMap;
+use std::collections::{HashMap, HashSet};
use specs::{
DenseVecStorage,
@@ -229,9 +229,13 @@ pub struct Build {
#[derive(Component, Debug, Clone)]
pub struct Whitelist{
- pub allowed: HashMap<String, PlayerId>
+ pub allowed: HashMap<String, HashSet<PlayerId>>
}
-
+#[derive(Component, Debug, Clone)]
+pub struct Dedup {
+ pub id: String,
+ pub priority: i64
+}