rust/hedgewars-server/src/server/io.rs
changeset 15124 823052e66611
parent 15119 9397e07b3086
child 15141 febccab419b1
--- a/rust/hedgewars-server/src/server/io.rs	Sun Jun 02 23:58:12 2019 +0300
+++ b/rust/hedgewars-server/src/server/io.rs	Mon Jun 03 01:15:57 2019 +0300
@@ -31,6 +31,14 @@
         thread::spawn(move || {
             while let Ok((request_id, task)) = io_rx.recv() {
                 let response = match task {
+                    IoTask::CheckRegistered { nick } => match db.is_registered(&nick) {
+                        Ok(is_registered) => IoResult::AccountRegistered(is_registered),
+                        Err(e) => {
+                            warn!("Unable to check account's existence: {}", e);
+                            IoResult::AccountRegistered(false)
+                        }
+                    },
+
                     IoTask::GetAccount {
                         nick,
                         protocol,