[saco] Implement/match CChatWindow::WriteChatLog; the entry type is a switch (subtract chain) and the timestamp buffer takes 68 stack bytes

This commit is contained in:
ricardoofnl committed 2026-09-05 07:36:48 +07:00
1 parent 256a3d372c
commit f1d8eabde1
2 files changed
+34

No files matched your search

+32
View File
@@ -1,4 +1,5 @@
#include <time.h>
#include "main.h"
#include "game/util.h"
@@ -374,3 +375,34 @@ void CChatWindow::FUNC_10067E00()
}
}
}
//----------------------------------------------------
void CChatWindow::WriteChatLog(int iType, char *szText, char *szName)
{
time_t curTime = time(NULL);
if(field_D)
{
FILE *f = fopen(field_11,"a");
if(f)
{
// the frame reserves 68 bytes for this, strftime is still capped at 64
char szTimestamp[68];
strftime(szTimestamp,64,"[%H:%M:%S]",localtime(&curTime));
switch(iType)
{
case 2:
fprintf(f,"%s <%s> %s\r\n",szTimestamp,szName,szText);
break;
case 4:
case 8:
fprintf(f,"%s %s\r\n",szTimestamp,szText);
break;
}
fclose(f);
}
}
}
+2
View File
@@ -73,6 +73,8 @@ public:
public:
void WriteChatLog(int iType, char *szText, char *szName); // .text:100677D0
int sub_10067BE0(int a1, char *a2, char *a3, DWORD a4, DWORD a5); // .text:10067BE0
void AddChatMessage(PCHAR szName, DWORD dwColor, PCHAR szText); // .text:10068020