From 313b115537be324421e06cab05e845dedb40978c Mon Sep 17 00:00:00 2001 From: Michael Bailey Date: Mon, 9 Sep 2024 17:48:09 +0100 Subject: [PATCH] Made other changes to GRPC implementation to clean it up (#23) * added protocol crate for the program, also removed unused crates * remove client code * removed example plugin * cleaned up foundation, added protocol crate to it * removed lua scripts * removed server ctl * migrated tp prost instead of protobuf crate * removed scripting code * moved protocol crate to foundation, created helper functions for encoding and decoding * Createde Cursive client for testing protocol stuff * added docs? * overriding server to remove actix, and simplify design * linting the server * moved network message handling into NetworkConnection struct * linting * cleaning up prints * writing better log messages * added better debug messages * purged all axtix modules, to be replaced with new components * ok, so i kind of got carried away here with the server and client. But essentially, the server has been rewritten to follow protobug up untill the point of connecting a client. the client can fetch info from the server, but cannot initiate a request to connect. I am weorkibng on both in tandem, and there will be losts of big commits :D * removing client stuff again, cause it's not going well * added client networking structs to the foundation crate * moved client stuff into foundation. * created Json structures * created protobuf structures * revamped the connection and protocolm structure to allow addition of other protocols * fixed issue with erronious request input from clients * removed select statements * Updated logging messages --- server/src/network/json/json_client_writer.rs | 4 ++-- server/src/server_va.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/server/src/network/json/json_client_writer.rs b/server/src/network/json/json_client_writer.rs index 0e55e8e..c91daec 100644 --- a/server/src/network/json/json_client_writer.rs +++ b/server/src/network/json/json_client_writer.rs @@ -61,7 +61,7 @@ impl ClientWriter for JSONClientWriter { username: details.name, }; println!( - "[ProtobufClientWriter:{}] sending client connected message", + "[JSONClientReader:{}] sending client connected message", self.addr ); write_message(&mut self.writer, message).await; @@ -70,7 +70,7 @@ impl ClientWriter for JSONClientWriter { async fn send_client_left(&mut self, uuid: Uuid) { let message = ClientStreamOut::ClientRemoved { id: uuid }; println!( - "[ProtobufClientWriter:{}] sending client connected message", + "[JSONClientReader:{}] sending client connected message", self.addr ); write_message(&mut self.writer, message).await; diff --git a/server/src/server_va.rs b/server/src/server_va.rs index 8c4cc19..a753b04 100644 --- a/server/src/server_va.rs +++ b/server/src/server_va.rs @@ -74,7 +74,7 @@ impl Server { ConnectionType::JsonConnection(stream, addr), )) => { let conn = Box::new(JSONNetworkConnection::new(stream, addr)); - println!("[Server] New protobuf connection"); + println!("[Server] New json connection"); self.handle_protobuf_connection(conn).await; } Some(ServerMessages::SendGlobalMessages(uuid)) => {