Mark InvalidAlias Message as to be done

This commit is contained in:
Songtronix 2019-07-05 14:16:08 +02:00
parent bf82f5925d
commit ed0d842e57
5 changed files with 3 additions and 5 deletions

1
.gitignore vendored
View File

@ -31,6 +31,5 @@
# Veloren # Veloren
*.rar *.rar
*.log *.log
*.ron
run.sh run.sh
screenshots screenshots

View File

@ -7,7 +7,7 @@ pub enum Error {
ServerTimeout, ServerTimeout,
ServerShutdown, ServerShutdown,
TooManyPlayers, TooManyPlayers,
InvalidAlias, //TODO: InvalidAlias,
Other(String), Other(String),
} }

View File

@ -366,7 +366,7 @@ impl Client {
match msg { match msg {
ServerMsg::Error(e) => match e { ServerMsg::Error(e) => match e {
ServerError::TooManyPlayers => return Err(Error::ServerWentMad), ServerError::TooManyPlayers => return Err(Error::ServerWentMad),
ServerError::InvalidAlias => return Err(Error::InvalidAlias), //TODO: ServerError::InvalidAlias => return Err(Error::InvalidAlias),
}, },
ServerMsg::Shutdown => return Err(Error::ServerShutdown), ServerMsg::Shutdown => return Err(Error::ServerShutdown),
ServerMsg::InitialSync { .. } => return Err(Error::ServerWentMad), ServerMsg::InitialSync { .. } => return Err(Error::ServerWentMad),

View File

@ -19,7 +19,6 @@ impl Player {
pub fn is_valid(&self) -> bool { pub fn is_valid(&self) -> bool {
self.alias.chars().all(|c| c.is_alphanumeric() || c == '_') self.alias.chars().all(|c| c.is_alphanumeric() || c == '_')
&& self.alias.len() <= MAX_ALIAS_LEN && self.alias.len() <= MAX_ALIAS_LEN
// TODO: Check view distance here based on server config too
} }
} }

View File

@ -49,5 +49,5 @@ pub enum ServerMsg {
#[derive(Debug, Clone, Serialize, Deserialize)] #[derive(Debug, Clone, Serialize, Deserialize)]
pub enum ServerError { pub enum ServerError {
TooManyPlayers, TooManyPlayers,
InvalidAlias, //TODO: InvalidAlias,
} }