From b558c22a6a21f943c3ee75243d84b00ecae6cbe7 Mon Sep 17 00:00:00 2001 From: epoque11 Date: Thu, 29 Mar 2012 18:43:58 +0000 Subject: - Merged main-chat message handling (as requested/enforced by trojal <3) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@15816 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/map/intif.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'src/map/intif.c') diff --git a/src/map/intif.c b/src/map/intif.c index 3bfb608de..f84d57a19 100644 --- a/src/map/intif.c +++ b/src/map/intif.c @@ -192,6 +192,27 @@ int intif_broadcast2(const char* mes, int len, unsigned long fontColor, short fo return 0; } +/// send a message using the main chat system +/// the source of message +/// the message that was sent +int intif_main_message(struct map_session_data* sd, const char* message) +{ + char output[256]; + + nullpo_retv(sd); + + // format the message for main broadcasting + snprintf( output, sizeof(output), msg_txt(386), sd->status.name, message ); + + // send the message using the inter-server broadcast service + intif_broadcast2( output, strlen(output) + 1, 0xFE000000, 0, 0, 0, 0 ); + + // log the chat message + log_chat( LOG_CHAT_MAINCHAT, 0, sd->status.char_id, sd->status.account_id, mapindex_id2name(sd->mapindex), sd->bl.x, sd->bl.y, NULL, message ); + + return 0; +} + // The transmission of Wisp/Page to inter-server (player not found on this server) int intif_wis_message(struct map_session_data *sd, char *nick, char *mes, int mes_len) { -- cgit v1.2.3-60-g2f50