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,22 @@
use crate::chat_channels::ChatChannel;
use crate::chat_service::Clients;
use crate::chat_service::chat::ChatMessage;
/// A dedicated module for guild chat.
#[derive(Debug)]
pub struct GuildChat;
impl ChatChannel for GuildChat {
fn handle_message(&self, message: ChatMessage, sender_id: &str, clients: &Clients) {
// This is a placeholder. In a real implementation, verify
// guild membership by consulting your Character or Guild service.
let clients_lock = clients.lock().unwrap();
for (id, tx) in clients_lock.iter() {
// For demonstration, send only to clients whose IDs contain
// "guild". Replace this logic with your actual membership check.
if id != sender_id && id.contains("guild") {
let _ = tx.try_send(message.clone());
}
}
}
}