gameServer2/src/server/handlers/inroom.rs
changeset 13449 914f9b970f4d
parent 13448 2501428303a2
child 13450 d3c86ade3d4d
--- a/gameServer2/src/server/handlers/inroom.rs	Wed Jul 04 18:49:51 2018 +0300
+++ b/gameServer2/src/server/handlers/inroom.rs	Fri Jul 06 16:27:25 2018 +0200
@@ -13,6 +13,7 @@
 use utils::is_name_illegal;
 use std::mem::swap;
 use base64::{encode, decode};
+use super::common::rnd_reply;
 
 #[derive(Clone)]
 struct ByMsg<'a> {
@@ -79,7 +80,7 @@
         Chat(msg) => {
             let actions = {
                 let c = &mut server.clients[client_id];
-                let chat_msg = ChatMsg(c.nick.clone(), msg);
+                let chat_msg = ChatMsg {nick: c.nick.clone(), msg: msg};
                 if let Some(room_id) = c.room_id {
                     vec![chat_msg.send_all().in_room(room_id).but_self().action()]
                 } else {
@@ -287,7 +288,8 @@
                 }
             }
             server.react(client_id, actions)
-        }
+        },
+        Rnd(v) => server.react(client_id, rnd_reply(v)),
         _ => warn!("Unimplemented!")
     }
 }