From 644e9e421b03f7d5551c8793b1753023d5eb51ad Mon Sep 17 00:00:00 2001 From: TheBrokenRail Date: Sun, 3 Nov 2024 00:02:13 -0400 Subject: [PATCH] Finally Fix Dumb Method Names --- mods/include/mods/chat/chat.h | 2 +- mods/src/chat/chat-internal.h | 4 +--- mods/src/chat/chat.cpp | 8 ++++---- mods/src/chat/ui.cpp | 2 +- 4 files changed, 7 insertions(+), 9 deletions(-) diff --git a/mods/include/mods/chat/chat.h b/mods/include/mods/chat/chat.h index 1892b003d6..49d323d2dd 100644 --- a/mods/include/mods/chat/chat.h +++ b/mods/include/mods/chat/chat.h @@ -10,6 +10,6 @@ extern "C" { std::string chat_send_api_command(const Minecraft *minecraft, const std::string &str); // Override using the HOOK() macro to provide customized chat behavior. -void chat_send_message(ServerSideNetworkHandler *server_side_network_handler, const char *username, const char *message); +void chat_send_message_to_clients(ServerSideNetworkHandler *server_side_network_handler, const char *username, const char *message); void chat_handle_packet_send(const Minecraft *minecraft, ChatPacket *packet); } diff --git a/mods/src/chat/chat-internal.h b/mods/src/chat/chat-internal.h index ce08272400..fc0d551456 100644 --- a/mods/src/chat/chat-internal.h +++ b/mods/src/chat/chat-internal.h @@ -9,9 +9,7 @@ // Message Prefix __attribute__((visibility("internal"))) std::string _chat_get_prefix(const char *username); - // Queue Message For Sending -__attribute__((visibility("internal"))) void _chat_send_message(const Minecraft *minecraft, const char *message); - +__attribute__((visibility("internal"))) void _chat_send_message_to_server(const Minecraft *minecraft, const char *message); // Init Chat UI __attribute__((visibility("internal"))) void _init_chat_ui(); \ No newline at end of file diff --git a/mods/src/chat/chat.cpp b/mods/src/chat/chat.cpp index 1d924fd299..408fe86b34 100644 --- a/mods/src/chat/chat.cpp +++ b/mods/src/chat/chat.cpp @@ -34,7 +34,7 @@ static void send_api_chat_command(const Minecraft *minecraft, const char *str) { std::string _chat_get_prefix(const char *username) { return std::string("<") + username + "> "; } -void chat_send_message(ServerSideNetworkHandler *server_side_network_handler, const char *username, const char *message) { +void chat_send_message_to_clients(ServerSideNetworkHandler *server_side_network_handler, const char *username, const char *message) { std::string full_message = _chat_get_prefix(username) + message; char *raw_str = strdup(full_message.c_str()); ALLOC_CHECK(raw_str); @@ -50,7 +50,7 @@ void chat_handle_packet_send(const Minecraft *minecraft, ChatPacket *packet) { // Hosting Multiplayer const char *message = packet->message.c_str(); ServerSideNetworkHandler *server_side_network_handler = (ServerSideNetworkHandler *) minecraft->network_handler; - chat_send_message(server_side_network_handler, Strings::default_username, (char *) message); + chat_send_message_to_clients(server_side_network_handler, Strings::default_username, (char *) message); } else { // Client rak_net_instance->send(*(Packet *) packet); @@ -71,12 +71,12 @@ static void ServerSideNetworkHandler_handle_ChatPacket_injection(ServerSideNetwo if (player != nullptr) { const char *username = player->username.c_str(); const char *message = chat_packet->message.c_str(); - chat_send_message(server_side_network_handler, username, message); + chat_send_message_to_clients(server_side_network_handler, username, message); } } // Send Message -void _chat_send_message(const Minecraft *minecraft, const char *message) { +void _chat_send_message_to_server(const Minecraft *minecraft, const char *message) { send_api_chat_command(minecraft, message); } diff --git a/mods/src/chat/ui.cpp b/mods/src/chat/ui.cpp index 5b9504730c..1392b7353a 100644 --- a/mods/src/chat/ui.cpp +++ b/mods/src/chat/ui.cpp @@ -93,7 +93,7 @@ CUSTOM_VTABLE(chat_screen, Screen) { if (get_history().size() == 0 || text != get_history().back()) { get_history().push_back(text); } - _chat_send_message(super->minecraft, text.c_str()); + _chat_send_message_to_server(super->minecraft, text.c_str()); } super->minecraft->setScreen(nullptr); } else if (key == MC_KEY_UP) {