From: Geoffrey Allott Date: Sun, 14 Mar 2021 22:24:49 +0000 (+0000) Subject: remove "dealer" user X-Git-Url: https://git.pointlesshacks.com/?a=commitdiff_plain;h=02a1195973b49ded653b645f5237b724493e8ae2;p=pokerwave.git remove "dealer" user --- diff --git a/src/game/chatroom.rs b/src/game/chatroom.rs index ea19346..4b10a5a 100644 --- a/src/game/chatroom.rs +++ b/src/game/chatroom.rs @@ -1,7 +1,7 @@ use std::collections::HashSet; use crate::game::{Action, ActionError, DealerAction}; -use crate::username::{Username, DEALER}; +use crate::username::Username; use crate::util::timestamp::Timestamp; use super::ValidatedUserAction; @@ -91,14 +91,7 @@ impl Game for Chatroom { } } - fn next_dealer_action(&self, timestamp: Timestamp) -> DealerAction { - match self.messages.len() { - n if n % 10 == 0 => DealerAction::TakeAction(ValidatedUserAction(UserAction { - timestamp, - username: DEALER, - action: Action::Message { message: format!("{} messages posted so far", n) }, - })), - _ => DealerAction::WaitForPlayer, - } + fn next_dealer_action(&self, _: Timestamp) -> DealerAction { + DealerAction::Leave } } diff --git a/src/username.rs b/src/username.rs index b505c74..9bc9e5d 100644 --- a/src/username.rs +++ b/src/username.rs @@ -22,9 +22,6 @@ impl Username { } } -pub const DEALER: Username = - Username { username: [b'd', b'e', b'a', b'l', b'e', b'r', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] }; - impl Display for Username { fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { match self.as_str() {