equal
deleted
inserted
replaced
4 use server::actions::Action; |
4 use server::actions::Action; |
5 use server::actions::Action::*; |
5 use server::actions::Action::*; |
6 use protocol::messages::HWProtocolMessage; |
6 use protocol::messages::HWProtocolMessage; |
7 use protocol::messages::HWServerMessage::*; |
7 use protocol::messages::HWServerMessage::*; |
8 |
8 |
9 pub fn handle(server: &mut HWServer, token: mio::Token, poll: &mio::Poll, message: HWProtocolMessage) { |
9 pub fn handle(server: &mut HWServer, token: usize, poll: &mio::Poll, message: HWProtocolMessage) { |
10 match message { |
10 match message { |
11 HWProtocolMessage::Nick(nick) => |
11 HWProtocolMessage::Nick(nick) => |
12 if server.clients[token].room_id == None { |
12 if server.clients[token].room_id == None { |
13 server.react(token, poll, vec![SendMe(Nick(&nick).to_raw_protocol())]); |
13 server.react(token, poll, vec![SendMe(Nick(&nick).to_raw_protocol())]); |
14 server.clients[token].nick = nick; |
14 server.clients[token].nick = nick; |