107 &protocol_version.to_string() |
110 &protocol_version.to_string() |
108 ]), |
111 ]), |
109 &HWServerMessage::Bye(msg) |
112 &HWServerMessage::Bye(msg) |
110 => construct_message(&["BYE", &msg]), |
113 => construct_message(&["BYE", &msg]), |
111 &HWServerMessage::Nick(nick) |
114 &HWServerMessage::Nick(nick) |
112 => construct_message(&["NICK", &nick]), |
115 => construct_message(&["NICK", &nick]), |
113 &HWServerMessage::LobbyLeft(msg) |
116 &HWServerMessage::LobbyLeft(nick) |
114 => construct_message(&["LOBBY_LEFT", &msg]), |
117 => construct_message(&["LOBBY_LEFT", &nick]), |
115 &HWServerMessage::LobbyJoined(msg) |
118 &HWServerMessage::LobbyJoined(nicks) |
116 => { |
119 => { |
117 let mut v = vec!["LOBBY:JOINED"]; |
120 let mut v = vec!["LOBBY:JOINED"]; |
118 v.extend_from_slice(msg); |
121 v.extend_from_slice(nicks); |
119 construct_message(&v) |
122 construct_message(&v) |
120 }, |
123 }, |
|
124 &HWServerMessage::ClientFlags(flags, nicks) |
|
125 => { |
|
126 let mut v = vec!["CLIENT_FLAGS"]; |
|
127 v.push(flags); |
|
128 v.extend_from_slice(nicks); |
|
129 construct_message(&v) |
|
130 }, |
|
131 &HWServerMessage::ChatMsg(nick, msg) |
|
132 => construct_message(&["CHAT", &nick, &msg]), |
|
133 &HWServerMessage::Warning(msg) |
|
134 => construct_message(&["WARNING", &msg]), |
121 _ => construct_message(&["ERROR", "UNIMPLEMENTED"]), |
135 _ => construct_message(&["ERROR", "UNIMPLEMENTED"]), |
122 } |
136 } |
123 } |
137 } |
124 } |
138 } |