Nagad 1 Posted July 28, 2015 Can someone adapt this old source code for eAthena that implements the timestamp for chat messages (for party/guild chat)?? Would be really cool to have it for any chat (even the normal one) clif.c Party Chat: void clif_parse_PartyMessage(int fd, struct map_session_data *sd){ char *mes; int len, prefixlenparty; // ++ char prefixparty[255]; // ++ time_t t = time(NULL); // ++ strftime(prefixparty, 10, "[%H:%M] ", localtime(&t)); // ++ len = RFIFOW(fd,2) - 4; mes = (char*)RFIFOP(fd,4); mes_len_check(mes, len, CHAT_SIZE); if (is_charcommand(fd, sd, mes) != CharCommand_None || is_atcommand(fd, sd, mes) != AtCommand_None) return; if (sd->sc.count && ( sd->sc.data[SC_BERSERK].timer!=-1 || (sd->sc.data[SC_NOCHAT].timer!=-1 && sd->sc.data[SC_NOCHAT].val1&MANNER_NOCHAT) )) return; if (battle_config.min_chat_delay) { //[Skotlex] if (DIFF_TICK(sd->cantalk_tick, gettick()) > 0) return; sd->cantalk_tick = gettick() + battle_config.min_chat_delay; } strcat(prefixparty,mes); //++ prefixlenparty = strlen(prefixparty)+1;// ++ party_send_message(sd, prefixparty, prefixlenparty); // ++} Guild Chat: void clif_parse_GuildMessage(int fd,struct map_session_data *sd){ char *mes; int len, prefixlenguild; //++ char prefixguild[255]; // ++ time_t t = time(NULL); // ++ strftime(prefixguild, 10, "[%H:%M] ", localtime(&t)); //++ len = RFIFOW(fd,2) - 4; mes = (char*)RFIFOP(fd,4); mes_len_check(mes, len, CHAT_SIZE); if (is_charcommand(fd, sd, mes) != CharCommand_None || is_atcommand(fd, sd, mes) != AtCommand_None) return; if (sd->sc.count && ( sd->sc.data[SC_BERSERK].timer!=-1 || (sd->sc.data[SC_NOCHAT].timer!=-1 && sd->sc.data[SC_NOCHAT].val1&MANNER_NOCHAT) )) return; if (battle_config.min_chat_delay) { //[Skotlex] if (DIFF_TICK(sd->cantalk_tick, gettick()) > 0) return; sd->cantalk_tick = gettick() + battle_config.min_chat_delay; } strcat(prefixguild,mes); //++ prefixlenguild = strlen(prefixguild)+1; // ++ guild_send_message(sd, prefixguild, prefixlenguild); //++} Quote Share this post Link to post Share on other sites
Can someone adapt this old source code for eAthena that implements the timestamp for chat messages (for party/guild chat)?? Would be really cool to have it for any chat (even the normal one)
clif.c
Party Chat:
Guild Chat:
Share this post
Link to post
Share on other sites