feat(chat): implement client-server chat messaging

Add protobuf definition for ChatMsg, new packet ID CHAT_MSG (4001), and
handle sending/receiving chat messages on both client and server side.
Wire up UI components (ChatBox, TextField) to allow message input and
display, including a message queue in ClientWorld for thread-safe
processing. Also add default initialization for ChatMessage::time.
This commit is contained in:
2026-07-18 20:29:14 +08:00
parent f4103e254e
commit 75f71a537f
19 changed files with 126 additions and 17 deletions

View File

@@ -334,6 +334,11 @@ void WorldScene::set_chatting(bool chatting) {
Logger::info("World Scene Chatting {}", chatting);
}
// Not thread safe
void WorldScene::handle_chat_message(ChatMessage& message) {
m_hud_ui.add_chat_message(message);
}
void WorldScene::set_error(std::string_view error) {
Logger::error("WorldScene Error Set {}", error);
m_error_ui.set_error(error);