gameServer2/src/server/handlers/lobby.rs
changeset 13444 914f9b970f4d
parent 13427 6f6a866c86a2
child 13445 d3c86ade3d4d
--- a/gameServer2/src/server/handlers/lobby.rs	Wed Jul 04 18:49:51 2018 +0300
+++ b/gameServer2/src/server/handlers/lobby.rs	Fri Jul 06 16:27:25 2018 +0200
@@ -10,6 +10,7 @@
     HWServerMessage::*
 };
 use utils::is_name_illegal;
+use super::common::rnd_reply;
 
 pub fn handle(server: &mut HWServer, client_id: ClientId, message: HWProtocolMessage) {
     use protocol::messages::HWProtocolMessage::*;
@@ -30,7 +31,7 @@
             server.react(client_id, actions);
         },
         Chat(msg) => {
-            let chat_msg = ChatMsg(server.clients[client_id].nick.clone(), msg);
+            let chat_msg = ChatMsg {nick: server.clients[client_id].nick.clone(), msg: msg};
             server.react(client_id, vec![chat_msg.send_all().but_self().action()]);
         },
         JoinRoom(name, password) => {
@@ -57,6 +58,7 @@
             }
             server.react(client_id, actions);
         },
+        Rnd(v) => server.react(client_id, rnd_reply(v)),
         List => warn!("Deprecated LIST message received"),
         _ => warn!("Incorrect command in lobby state"),
     }