rust/hedgewars-server/src/server/actions.rs
changeset 14673 08a8605bafaf
parent 14671 455865ccd36c
child 14675 dfe652c53470
--- a/rust/hedgewars-server/src/server/actions.rs	Mon Feb 04 19:22:21 2019 +0300
+++ b/rust/hedgewars-server/src/server/actions.rs	Mon Feb 04 20:25:35 2019 +0300
@@ -113,8 +113,6 @@
 
 pub enum Action {
     Send(PendingMessage),
-    RemoveClient,
-    ByeClient(String),
     CheckRegistered,
     JoinLobby,
     RemoveRoom(RoomId),
@@ -147,34 +145,6 @@
 pub fn run_action(server: &mut HWServer, client_id: usize, action: Action) {
     match action {
         Send(msg) => server.send(client_id, &msg.destination, msg.message),
-        ByeClient(msg) => {
-            let c = &server.clients[client_id];
-            let nick = c.nick.clone();
-
-            if let Some(id) = c.room_id {
-                if id != server.lobby_id {
-                    server.react(
-                        client_id,
-                        vec![MoveToLobby(format!("quit: {}", msg.clone()))],
-                    );
-                }
-            }
-
-            server.react(
-                client_id,
-                vec![
-                    LobbyLeft(nick, msg.clone()).send_all().action(),
-                    Bye(msg).send_self().action(),
-                    RemoveClient,
-                ],
-            );
-        }
-        RemoveClient => {
-            server.removed_clients.push(client_id);
-            if server.clients.contains(client_id) {
-                server.clients.remove(client_id);
-            }
-        }
         CheckRegistered => {
             let client = &server.clients[client_id];
             if client.protocol_number > 0 && client.nick != "" {
@@ -185,7 +155,8 @@
 
                 let actions = if !client.is_checker() && has_nick_clash {
                     if client.protocol_number < 38 {
-                        vec![ByeClient("Nickname is already in use".to_string())]
+                        //ByeClient("Nickname is already in use".to_string())
+                        vec![]
                     } else {
                         server.clients[client_id].nick.clear();
                         vec![Notice("NickAlreadyInUse".to_string()).send_self().action()]