More work.

Added chat service
Updated packet service to pass the tcp stream around in a Arc type.
Updated character position data to not require multiplying the coords
Added more debug logs
Added an interceptor for gRPC comms with the chat server
Updated build and push script for the chat server changes
This commit is contained in:
2025-06-06 17:52:29 -04:00
parent 85d41c0239
commit ad6ba2c8e6
32 changed files with 787 additions and 92 deletions

View File

@@ -0,0 +1,20 @@
use tonic::{Request, Status, service::Interceptor};
#[derive(Clone, Debug)]
pub struct AuthInterceptor {
pub client_id: String,
pub session_id: String,
}
impl Interceptor for AuthInterceptor {
fn call(&mut self, mut request: Request<()>) -> Result<Request<()>, Status> {
// Attach the authenticated client ID into the metadata.
request
.metadata_mut()
.insert("x-client-id", self.client_id.parse().unwrap());
request
.metadata_mut()
.insert("x-session-id", self.session_id.parse().unwrap());
Ok(request)
}
}

View File

@@ -0,0 +1 @@
pub mod auth_interceptor;