Jump to content

  •  

Photo

Chat with timestamp


  • Please log in to reply
No replies to this topic

#1 Nagad

Nagad

    Advanced Member

  • Members
  • PipPipPip
  • 109 posts

Posted 28 July 2015 - 08:18 AM

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); //++}

 






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users


This topic has been visited by 36 user(s)