mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-12 00:56:40 -04:00
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:
parent
1c786570e4
commit
7e3a3902fd
14
src/Chat.c
14
src/Chat.c
@ -53,14 +53,6 @@ static void AppendChatLogTime(void) {
|
||||
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 cc_string logName = String_FromArray(logNameBuffer);
|
||||
static char logPathBuffer[FILENAME_SIZE];
|
||||
@ -193,7 +185,6 @@ static void AppendChatLog(const cc_string* text) {
|
||||
Chat_DisableLogging();
|
||||
Logger_SysWarn2(res, "writing to", &logPath);
|
||||
}
|
||||
#endif
|
||||
|
||||
void Chat_Add1(const char* format, const void* a1) {
|
||||
Chat_Add4(format, a1, NULL, NULL, NULL);
|
||||
@ -642,9 +633,8 @@ static void OnInit(void) {
|
||||
Commands_Register(&TeleportCommand);
|
||||
Commands_Register(&ClearDeniedCommand);
|
||||
|
||||
#if defined CC_BUILD_MINFILES
|
||||
#elif defined CC_BUILD_MOBILE
|
||||
/* Better to not log chat by default on mobile, */
|
||||
#if defined CC_BUILD_MOBILE || defined CC_BUILD_WEB
|
||||
/* Better to not log chat by default on mobile/web, */
|
||||
/* since it's not easily visible to end users */
|
||||
Chat_Logging = Options_GetBool(OPT_CHAT_LOGGING, false);
|
||||
#else
|
||||
|
@ -510,8 +510,6 @@ void Game_TakeScreenshot(void) {
|
||||
extern void interop_TakeScreenshot(const char* path);
|
||||
Platform_EncodeUtf8(str, &filename);
|
||||
interop_TakeScreenshot(str);
|
||||
#elif CC_BUILD_MINFILES
|
||||
/* no screenshots for these systems */
|
||||
#else
|
||||
if (!Utils_EnsureDirectory("screenshots")) return;
|
||||
String_InitArray(path, pathBuffer);
|
||||
|
@ -2857,11 +2857,6 @@ static void ChatOptionsScreen_InitWidgets(struct MenuOptionsScreen* s) {
|
||||
s->numCore = 4;
|
||||
s->maxVertices += 4 * BUTTONWIDGET_MAX;
|
||||
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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user