summaryrefslogtreecommitdiff
path: root/src/to_clt/status.rs
diff options
context:
space:
mode:
authorLizzy Fleckenstein <eliasfleckenstein@web.de>2023-02-10 13:50:58 +0100
committerLizzy Fleckenstein <eliasfleckenstein@web.de>2023-02-10 13:50:58 +0100
commit3ed5bfd5ac9f12f323bcdb36f8fb840855d02634 (patch)
tree82e2ed862a6de7c832a49ec37e0075dcb3bfdf78 /src/to_clt/status.rs
parent800bb04e808aa2881719857e5027d251afc047ac (diff)
downloadmt_ser-3ed5bfd5ac9f12f323bcdb36f8fb840855d02634.tar.xz
Implement UTF-8 decode and move packets to different crate
Diffstat (limited to 'src/to_clt/status.rs')
-rw-r--r--src/to_clt/status.rs80
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,
-}