rust/hedgewars-server/src/server/io.rs
changeset 15103 823052e66611
parent 15098 9397e07b3086
child 15120 febccab419b1
equal deleted inserted replaced
15102:80ff12edf5e6 15103:823052e66611
    29         db.connect("localhost");
    29         db.connect("localhost");
    30 
    30 
    31         thread::spawn(move || {
    31         thread::spawn(move || {
    32             while let Ok((request_id, task)) = io_rx.recv() {
    32             while let Ok((request_id, task)) = io_rx.recv() {
    33                 let response = match task {
    33                 let response = match task {
       
    34                     IoTask::CheckRegistered { nick } => match db.is_registered(&nick) {
       
    35                         Ok(is_registered) => IoResult::AccountRegistered(is_registered),
       
    36                         Err(e) => {
       
    37                             warn!("Unable to check account's existence: {}", e);
       
    38                             IoResult::AccountRegistered(false)
       
    39                         }
       
    40                     },
       
    41 
    34                     IoTask::GetAccount {
    42                     IoTask::GetAccount {
    35                         nick,
    43                         nick,
    36                         protocol,
    44                         protocol,
    37                         password_hash,
    45                         password_hash,
    38                         client_salt,
    46                         client_salt,