aboutsummaryrefslogtreecommitdiffstats
path: root/mumd/src/state
diff options
context:
space:
mode:
authorRubens Brandao <git@rubens.io>2021-03-28 20:58:16 +0200
committerRubens Brandao <git@rubens.io>2021-03-28 20:58:16 +0200
commit4b12f3e87ed12ed5b070f23d73f8288cd5b109fd (patch)
tree1f0ebc6d0a0af9f657badcc6eebe1d158ac6f83d /mumd/src/state
parent8501432530f19cb2be86815697c82abbe4482275 (diff)
downloadmum-4b12f3e87ed12ed5b070f23d73f8288cd5b109fd.tar.gz
Finish the password implementation
Diffstat (limited to 'mumd/src/state')
-rw-r--r--mumd/src/state/server.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/mumd/src/state/server.rs b/mumd/src/state/server.rs
index 8a256b6..c9f8a69 100644
--- a/mumd/src/state/server.rs
+++ b/mumd/src/state/server.rs
@@ -14,6 +14,7 @@ pub struct Server {
pub welcome_text: Option<String>,
username: Option<String>,
+ password: Option<String>,
session_id: Option<u32>,
muted: bool,
deafened: bool,
@@ -28,6 +29,7 @@ impl Server {
users: HashMap::new(),
welcome_text: None,
username: None,
+ password: None,
session_id: None,
muted: false,
deafened: false,
@@ -114,6 +116,14 @@ impl Server {
&mut self.username
}
+ pub fn password(&self) -> Option<&str> {
+ self.password.as_deref()
+ }
+
+ pub fn password_mut(&mut self) -> &mut Option<String> {
+ &mut self.password
+ }
+
pub fn muted(&self) -> bool {
self.muted
}