Timestamped Messages

 

Copyright info

All code in this tutorial is protected by the [GPL License].
All text in this tutorial is protected by the [FDL License].

 

Tutorial by: Echon

Mailto: n_blast@hotmail.com

open client\cl_parse.c

underneath this:

 
 
void CL_ParseServerMessage (void)
{
    int            cmd;
    char          *s;
    int            i;
 
     

put this:

 
 
    // ECHON {
    char        timestamp[24];
    _strtime( timestamp );
    // } ECHON
 
     

then change this:

 
 
        case svc_print:
            i = MSG_ReadByte (&net_message);
            if (i == PRINT_CHAT)
            {
                S_StartLocalSound ("misc/talk.wav");
                con.ormask = 128;
            }
            Com_Printf ("%s", MSG_ReadString (&net_message));
            con.ormask = 0;
            break;
 
 
     

to this:

 
 
        case svc_print:
            i = MSG_ReadByte (&net_message);
            if (i == PRINT_CHAT)
            {
                S_StartLocalSound ("misc/talk.wav");
                con.ormask = 128;
                // ECHON {
                Com_Printf ("[%s] %s", timestamp, MSG_ReadString (&net_message));
                // } ECHON
            }
            // ECHON {
            else
            {
                Com_Printf ("%s", MSG_ReadString (&net_message));
            }
            // } ECHON
            con.ormask = 0;
            break;
 
     


and that's all! :)
- Echon (irc.telefragged.com #openquake regularly)

 

 

Tutorial Originally found at: