From 7ca1b5aeacd9633e5a3dca9f7596975dbc686508 Mon Sep 17 00:00:00 2001 From: salmonik Date: Sun, 1 Mar 2026 14:39:56 +0100 Subject: slowly preparing for actual casino --- src/bin/client/connection.rs | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) (limited to 'src/bin/client/connection.rs') diff --git a/src/bin/client/connection.rs b/src/bin/client/connection.rs index 497ed36..b07bf01 100644 --- a/src/bin/client/connection.rs +++ b/src/bin/client/connection.rs @@ -4,17 +4,9 @@ use std::sync::mpsc; use std::thread; use std::time::{Duration, Instant}; use rusqlite::Connection; -use bcrypt::hash_with_salt; use crate::database; -const SALT: [u8; 16] = *b"fixedsalt1234567"; - -fn hash_password(password: &str) -> String { - let result = hash_with_salt(password, 10, SALT).unwrap(); - result.to_string() -} - -pub fn connect(addr: &str, conn: &Connection) -> Result> { +pub fn connect(addr: &str, conn: &Connection) -> Result<(TcpStream, Option), Box> { let (tx, rx) = mpsc::channel(); let addr_str = addr.to_string(); thread::spawn(move || { @@ -36,19 +28,20 @@ pub fn connect(addr: &str, conn: &Connection) -> Result Err(Box::new(e)), Err(mpsc::RecvTimeoutError::Timeout) => Err("Connection timed out after 3 seconds".into()), -- cgit v1.2.3