3 #[mt_derive(to = "clt", repr = "u8", tag = "reason")]
15 Custom { custom: String },
16 Shutdown { custom: String, reconnect: bool },
17 Crash { custom: String, reconnect: bool },
21 pub fn reconnect(&self) -> bool {
25 Shutdown { reconnect, .. } | Crash { reconnect, .. } => *reconnect,
31 impl fmt::Display for KickReason {
32 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
36 WrongPasswd => write!(f, "wrong password"),
37 UnexpectedData => write!(f, "unexpected data"),
38 SrvIsSingleplayer => write!(f, "server is singleplayer"),
39 UnsupportedVersion => write!(f, "unsupported client version"),
40 BadNameChars => write!(f, "disallowed character(s) in player name"),
41 BadName => write!(f, "disallowed player name"),
42 TooManyClts => write!(f, "too many clients"),
43 EmptyPasswd => write!(f, "empty password"),
44 AlreadyConnected => write!(f, "another client is already connected with the same name"),
45 SrvErr => write!(f, "unsupported client version"),
46 Custom { custom } => write!(f, "{custom}"),
47 Shutdown { custom, .. } => {
48 if custom.is_empty() {
49 write!(f, "server shutdown")
51 write!(f, "server shutdown: {custom}")
54 Crash { custom, .. } => {
55 if custom.is_empty() {
56 write!(f, "server crash")
58 write!(f, "server crash: {custom}")
65 #[mt_derive(to = "clt", repr = "u32", enumset)]
72 #[mt_derive(to = "clt", repr = "u64", enumset)]
73 pub enum CsmRestrictionFlag {