Web: Allow turning on chat logging, off by default

Although it's pretty useless still since it's only logged to IndexedDB
This commit is contained in:
UnknownShadow200 2021-10-07 22:18:56 +11:00
parent 1c786570e4
commit 7e3a3902fd
3 changed files with 2 additions and 19 deletions

View File

@ -53,14 +53,6 @@ static void AppendChatLogTime(void) {
Chat_LogTime[logTimesCount++] = now; Chat_LogTime[logTimesCount++] = now;
} }
#ifdef CC_BUILD_MINFILES
static void ResetLogFile(void) { }
static void CloseLogFile(void) { }
void Chat_SetLogName(const cc_string* name) { }
void Chat_DisableLogging(void) { }
static void OpenChatLog(struct DateTime* now) { }
static void AppendChatLog(const cc_string* text) { }
#else
static char logNameBuffer[STRING_SIZE]; static char logNameBuffer[STRING_SIZE];
static cc_string logName = String_FromArray(logNameBuffer); static cc_string logName = String_FromArray(logNameBuffer);
static char logPathBuffer[FILENAME_SIZE]; static char logPathBuffer[FILENAME_SIZE];
@ -193,7 +185,6 @@ static void AppendChatLog(const cc_string* text) {
Chat_DisableLogging(); Chat_DisableLogging();
Logger_SysWarn2(res, "writing to", &logPath); Logger_SysWarn2(res, "writing to", &logPath);
} }
#endif
void Chat_Add1(const char* format, const void* a1) { void Chat_Add1(const char* format, const void* a1) {
Chat_Add4(format, a1, NULL, NULL, NULL); Chat_Add4(format, a1, NULL, NULL, NULL);
@ -642,9 +633,8 @@ static void OnInit(void) {
Commands_Register(&TeleportCommand); Commands_Register(&TeleportCommand);
Commands_Register(&ClearDeniedCommand); Commands_Register(&ClearDeniedCommand);
#if defined CC_BUILD_MINFILES #if defined CC_BUILD_MOBILE || defined CC_BUILD_WEB
#elif defined CC_BUILD_MOBILE /* Better to not log chat by default on mobile/web, */
/* Better to not log chat by default on mobile, */
/* since it's not easily visible to end users */ /* since it's not easily visible to end users */
Chat_Logging = Options_GetBool(OPT_CHAT_LOGGING, false); Chat_Logging = Options_GetBool(OPT_CHAT_LOGGING, false);
#else #else

View File

@ -510,8 +510,6 @@ void Game_TakeScreenshot(void) {
extern void interop_TakeScreenshot(const char* path); extern void interop_TakeScreenshot(const char* path);
Platform_EncodeUtf8(str, &filename); Platform_EncodeUtf8(str, &filename);
interop_TakeScreenshot(str); interop_TakeScreenshot(str);
#elif CC_BUILD_MINFILES
/* no screenshots for these systems */
#else #else
if (!Utils_EnsureDirectory("screenshots")) return; if (!Utils_EnsureDirectory("screenshots")) return;
String_InitArray(path, pathBuffer); String_InitArray(path, pathBuffer);

View File

@ -2857,11 +2857,6 @@ static void ChatOptionsScreen_InitWidgets(struct MenuOptionsScreen* s) {
s->numCore = 4; s->numCore = 4;
s->maxVertices += 4 * BUTTONWIDGET_MAX; s->maxVertices += 4 * BUTTONWIDGET_MAX;
MenuOptionsScreen_InitButtons(s, buttons, Array_Elems(buttons), Menu_SwitchOptions); MenuOptionsScreen_InitButtons(s, buttons, Array_Elems(buttons), Menu_SwitchOptions);
/* If MINFILES is defined, chat logging code is not even included at all */
#ifdef CC_BUILD_MINFILES
s->buttons[2].disabled = true;
#endif
} }
void ChatOptionsScreen_Show(void) { void ChatOptionsScreen_Show(void) {