gameServer2/src/server/handlers/lobby.rs
changeset 12852 bd35cb2302b3
parent 12147 03ccb89820f3
child 13119 1e39b8749072
--- a/gameServer2/src/server/handlers/lobby.rs	Tue Dec 05 11:36:29 2017 -0500
+++ b/gameServer2/src/server/handlers/lobby.rs	Wed Dec 06 23:46:17 2017 +0100
@@ -6,14 +6,14 @@
 use protocol::messages::HWProtocolMessage;
 use protocol::messages::HWServerMessage::*;
 
-pub fn handle(server: &mut HWServer, token: mio::Token, poll: &mio::Poll, message: HWProtocolMessage) {
+pub fn handle(server: &mut HWServer, token: usize, poll: &mio::Poll, message: HWProtocolMessage) {
     match message {
         HWProtocolMessage::Chat(msg) => {
             let chat_msg = ChatMsg(&server.clients[token].nick, &msg).to_raw_protocol();
             server.react(token, poll, vec![SendAllButMe(chat_msg)]);
         },
         HWProtocolMessage::CreateRoom(name, password) => {
-            let room_exists = server.rooms.iter().find(|&r| r.name == name).is_some();
+            let room_exists = server.rooms.iter().find(|&(_, r)| r.name == name).is_some();
             if room_exists {
                 server.react(token, poll, vec![Warn("Room exists".to_string())]);
             } else {