diff options
author | Lizzy Fleckenstein <eliasfleckenstein@web.de> | 2023-02-14 16:17:20 +0100 |
---|---|---|
committer | Lizzy Fleckenstein <eliasfleckenstein@web.de> | 2023-02-14 16:17:20 +0100 |
commit | 6c1870c9405a80cb9f08e7fbb2db0b504522e1b2 (patch) | |
tree | d8db061bf9ae2ad6e67013e9cb378bca51303f55 /src/to_clt/status.rs | |
parent | 3cb97b94d3e3d83fbbbefde9c0a40cdd27ea5416 (diff) | |
download | mt_net-6c1870c9405a80cb9f08e7fbb2db0b504522e1b2.tar.xz |
Implement NodeMeta and add Inventory stub
Diffstat (limited to 'src/to_clt/status.rs')
-rw-r--r-- | src/to_clt/status.rs | 80 |
1 files changed, 0 insertions, 80 deletions
diff --git a/src/to_clt/status.rs b/src/to_clt/status.rs deleted file mode 100644 index 54adb45..0000000 --- a/src/to_clt/status.rs +++ /dev/null @@ -1,80 +0,0 @@ -use super::*; - -#[mt_derive(to = "clt", repr = "u8", tag = "reason")] -pub enum KickReason { - WrongPasswd, - UnexpectedData, - SrvIsSingleplayer, - UnsupportedVersion, - BadNameChars, - BadName, - TooManyClts, - EmptyPasswd, - AlreadyConnected, - SrvErr, - Custom { custom: String }, - Shutdown { custom: String, reconnect: bool }, - Crash { custom: String, reconnect: bool }, -} - -impl KickReason { - pub fn reconnect(&self) -> bool { - use KickReason::*; - - match self { - Shutdown { reconnect, .. } | Crash { reconnect, .. } => *reconnect, - _ => false, - } - } -} - -impl fmt::Display for KickReason { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - use KickReason::*; - - match self { - WrongPasswd => write!(f, "wrong password"), - UnexpectedData => write!(f, "unexpected data"), - SrvIsSingleplayer => write!(f, "server is singleplayer"), - UnsupportedVersion => write!(f, "unsupported client version"), - BadNameChars => write!(f, "disallowed character(s) in player name"), - BadName => write!(f, "disallowed player name"), - TooManyClts => write!(f, "too many clients"), - EmptyPasswd => write!(f, "empty password"), - AlreadyConnected => write!(f, "another client is already connected with the same name"), - SrvErr => write!(f, "unsupported client version"), - Custom { custom } => write!(f, "{custom}"), - Shutdown { custom, .. } => { - if custom.is_empty() { - write!(f, "server shutdown") - } else { - write!(f, "server shutdown: {custom}") - } - } - Crash { custom, .. } => { - if custom.is_empty() { - write!(f, "server crash") - } else { - write!(f, "server crash: {custom}") - } - } - } - } -} - -#[mt_derive(to = "clt", repr = "u32", enumset)] -pub enum AuthMethod { - LegacyPasswd, - Srp, - FirstSrp, -} - -#[mt_derive(to = "clt", repr = "u64", enumset)] -pub enum CsmRestrictionFlag { - NoCsms, - NoChatMsgs, - NoItemDefs, - NoNodeDefs, - LimitMapRange, - NoPlayerList, -} |