version 1.5 | | version 1.6 |
---|
| | |
//end this section addition -VR | | //end this section addition -VR |
| | |
int HUD_log_messages = 0; | | int HUD_log_messages = 0; |
| | int HUD_log_multi_autostart = 0; |
| | int HUD_log_autostart = 0; |
| | int fhudmulti = 0; |
FILE *fhudlog=NULL; | | FILE *fhudlog=NULL; |
char hudlogdir[128]=""; | | char hudlogdir[128]=""; |
char hudlogname[143]; | | char hudlogname[143]; |
| | |
} | | } |
} | | } |
| | |
| | void hud_log_check_multi_start(void){ |
| | if ((Game_mode & GM_MULTI) && HUD_log_multi_autostart){ |
| | if (!fhudlog || !fhudmulti) |
| | open_hud_log();//don't reopen the log file (for example, when changing levels in a multi player game) |
| | } |
| | } |
| | void hud_log_check_multi_stop(void){ |
| | if (HUD_log_multi_autostart && fhudmulti){ |
| | close_hud_log(); |
| | } |
| | } |
| | |
void open_hud_log(void){ | | void open_hud_log(void){ |
static int num=0; | | static int num=0; |
//edited 02/06/99 Matthew Mueller - changed filename to include date | | //edited 02/06/99 Matthew Mueller - changed filename to include date |
| | |
| | |
if (fhudlog)close_hud_log(); | | if (fhudlog)close_hud_log(); |
| | |
| | fhudmulti = Game_mode & GM_MULTI; |
| | |
t=time(NULL); | | t=time(NULL); |
lt=localtime(&t); | | lt=localtime(&t); |
| | |
| | |
if (fhudlog)close_hud_log(); | | if (fhudlog)close_hud_log(); |
else open_hud_log(); | | else open_hud_log(); |
} | | } |
| | |
void hud_log_message(char * message){ | | void hud_log_message(char * message){ |
| | static int recurse_flag=0; |
| | // printf("hud_log_message %i %i %i %p: %s\n",recurse_flag,HUD_log_autostart,HUD_log_multi_autostart,fhudlog,message); |
| | if (++recurse_flag==1){//avoid infinite loop. doh. |
| | if (fhudlog){ |
| | if (HUD_log_multi_autostart && ((Game_mode & GM_MULTI) != fhudmulti)) |
| | close_hud_log();//if we are using -hudlog_multi, presumably we would want multiplayer games in seperate log files than single player, so close the log file and let a new one be reopened if needed. |
| | } |
| | if (!fhudlog){ |
| | if (HUD_log_autostart) |
| | open_hud_log(); |
| | else if ((Game_mode & GM_MULTI) && HUD_log_multi_autostart){ |
| | open_hud_log(); |
| | } |
| | } |
| | } |
| | --recurse_flag; |
if (HUD_log_messages||fhudlog){ | | if (HUD_log_messages||fhudlog){ |
time_t t; | | time_t t; |
struct tm *lt; | | struct tm *lt; |