Development into Master #10

Merged
michael-bailey merged 102 commits from Development into master 2021-08-03 20:53:15 +00:00
4 changed files with 11 additions and 15 deletions
Showing only changes of commit e082971df0 - Show all commits

View File

@ -32,7 +32,7 @@ impl ClientManager {
let channels = unbounded();
let mut manager_ref: Arc<Self> = Arc::new(ClientManager {
let manager_ref: Arc<Self> = Arc::new(ClientManager {
clients: Mutex::default(),
weak_self: Mutex::default(),
@ -63,15 +63,15 @@ impl ClientManager {
}
impl TClientManager<Client, ClientMessage> for ClientManager {
fn addClient(&self, Client: std::sync::Arc<Client>) {
self.clients.lock().unwrap().push(Client);
fn add_client(&self, client: std::sync::Arc<Client>) {
self.clients.lock().unwrap().push(client);
}
fn removeClient(&self, uuid: Uuid) {
fn remove_client(&self, _uuid: Uuid) {
self.clients.lock().unwrap().sort();
}
fn messageClient(&self, id: Uuid, msg: ClientMessage) {
fn message_client(&self, _id: Uuid, _msg: ClientMessage) {
todo!()
}
fn tick(&self) {
@ -86,9 +86,9 @@ mod test {
#[test]
fn test_get_ref() {
let mut clientManager = ClientManager::new();
let cm_ref = clientManager.get_ref();
assert_eq!(Arc::weak_count(&clientManager), 2);
let client_manager = ClientManager::new();
let _cm_ref = client_manager.get_ref();
assert_eq!(Arc::weak_count(&client_manager), 2);
}
#[test]

View File

@ -2,8 +2,6 @@ use std::sync::Arc;
use uuid::Uuid;
use super::client::traits;
/**
* @michael-bailey
*/

View File

@ -2,4 +2,4 @@ pub mod client_management;
// pub mod server;
// pub mod server_v3;
pub struct Server {}
pub struct _Server {}

View File

@ -1,16 +1,14 @@
mod lib;
use clap::{App, Arg};
use lib::server::Server;
fn main() {
let args = App::new("--rust chat server--")
let _args = App::new("--rust chat server--")
.version("0.1.5")
.author("Mitchel Hardie <mitch161>, Michael Bailey <michael-bailey>")
.about("this is a chat server developed in rust, depending on the version one of two implementations will be used")
.arg(
Arg::with_name("config")
Arg::new("config")
.short('p')
.long("port")
.value_name("PORT")