rust/hedgewars-server/src/server/handlers.rs
changeset 14784 8390d5e4e39c
parent 14783 b3adc030104b
child 14785 a1077e8d26f4
equal deleted inserted replaced
14783:b3adc030104b 14784:8390d5e4e39c
    21 mod inroom;
    21 mod inroom;
    22 mod lobby;
    22 mod lobby;
    23 mod loggingin;
    23 mod loggingin;
    24 
    24 
    25 use self::loggingin::LoginResult;
    25 use self::loggingin::LoginResult;
       
    26 use crate::protocol::messages::global_chat;
    26 use std::fmt::{Formatter, LowerHex};
    27 use std::fmt::{Formatter, LowerHex};
    27 
    28 
    28 #[derive(PartialEq)]
    29 #[derive(PartialEq)]
    29 pub struct Sha1Digest([u8; 20]);
    30 pub struct Sha1Digest([u8; 20]);
    30 
    31 
   213                         common::remove_client(server, response, "User quit: ".to_string() + &msg);
   214                         common::remove_client(server, response, "User quit: ".to_string() + &msg);
   214                     }
   215                     }
   215                     HWProtocolMessage::Quit(None) => {
   216                     HWProtocolMessage::Quit(None) => {
   216                         common::remove_client(server, response, "User quit".to_string());
   217                         common::remove_client(server, response, "User quit".to_string());
   217                     }
   218                     }
       
   219                     HWProtocolMessage::Global(msg) => response.add(global_chat(msg).send_all()),
   218                     _ => match server.clients[client_id].room_id {
   220                     _ => match server.clients[client_id].room_id {
   219                         None => lobby::handle(server, client_id, response, message),
   221                         None => lobby::handle(server, client_id, response, message),
   220                         Some(room_id) => {
   222                         Some(room_id) => {
   221                             inroom::handle(server, client_id, response, room_id, message)
   223                             inroom::handle(server, client_id, response, room_id, message)
   222                         }
   224                         }