69 #[derive(Debug)] |
69 #[derive(Debug)] |
70 pub enum HWServerMessage { |
70 pub enum HWServerMessage { |
71 Ping, |
71 Ping, |
72 Pong, |
72 Pong, |
73 Bye(String), |
73 Bye(String), |
|
74 |
74 Nick(String), |
75 Nick(String), |
75 Proto(u16), |
76 Proto(u16), |
|
77 AskPassword(String), |
|
78 |
76 ServerAuth(String), |
79 ServerAuth(String), |
77 LobbyLeft(String, String), |
80 LobbyLeft(String, String), |
78 LobbyJoined(Vec<String>), |
81 LobbyJoined(Vec<String>), |
79 ChatMsg { nick: String, msg: String }, |
82 ChatMsg { nick: String, msg: String }, |
80 ClientFlags(String, Vec<String>), |
83 ClientFlags(String, Vec<String>), |
280 protocol_version |
283 protocol_version |
281 ], |
284 ], |
282 Bye(msg) => msg!["BYE", msg], |
285 Bye(msg) => msg!["BYE", msg], |
283 Nick(nick) => msg!["NICK", nick], |
286 Nick(nick) => msg!["NICK", nick], |
284 Proto(proto) => msg!["PROTO", proto], |
287 Proto(proto) => msg!["PROTO", proto], |
|
288 AskPassword(salt) => msg!["ASKPASSWORD", salt], |
285 ServerAuth(hash) => msg!["SERVER_AUTH", hash], |
289 ServerAuth(hash) => msg!["SERVER_AUTH", hash], |
286 LobbyLeft(nick, msg) => msg!["LOBBY:LEFT", nick, msg], |
290 LobbyLeft(nick, msg) => msg!["LOBBY:LEFT", nick, msg], |
287 LobbyJoined(nicks) => construct_message(&["LOBBY:JOINED"], &nicks), |
291 LobbyJoined(nicks) => construct_message(&["LOBBY:JOINED"], &nicks), |
288 ClientFlags(flags, nicks) => construct_message(&["CLIENT_FLAGS", flags], &nicks), |
292 ClientFlags(flags, nicks) => construct_message(&["CLIENT_FLAGS", flags], &nicks), |
289 Rooms(info) => construct_message(&["ROOMS"], &info), |
293 Rooms(info) => construct_message(&["ROOMS"], &info), |