1
1
forked from 0ad/0ad

Don't print lobby buddies to mainlog.html, refs D209 / dcf12abe8c.

Differential Revision: https://code.wildfiregames.com/D1563
Comments By: Vladislav
This was SVN commit r21844.
This commit is contained in:
elexis 2018-06-06 22:37:20 +00:00
parent ce64c57b8c
commit f51f78c999
2 changed files with 9 additions and 2 deletions

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2017 Wildfire Games. /* Copyright (C) 2018 Wildfire Games.
* This file is part of 0 A.D. * This file is part of 0 A.D.
* *
* 0 A.D. is free software: you can redistribute it and/or modify * 0 A.D. is free software: you can redistribute it and/or modify
@ -121,6 +121,7 @@ END_NMT_CLASS()
START_NMT_CLASS_(Authenticate, NMT_AUTHENTICATE) START_NMT_CLASS_(Authenticate, NMT_AUTHENTICATE)
NMT_FIELD(CStrW, m_Name) NMT_FIELD(CStrW, m_Name)
// TODO: The password should not be printed to logfiles
NMT_FIELD(CStrW, m_Password) NMT_FIELD(CStrW, m_Password)
NMT_FIELD_INT(m_IsLocalClient, u8, 1) NMT_FIELD_INT(m_IsLocalClient, u8, 1)
END_NMT_CLASS() END_NMT_CLASS()

View File

@ -33,6 +33,12 @@ bool CConfigDB::m_HasChanges[CFG_LAST];
static pthread_mutex_t cfgdb_mutex = PTHREAD_MUTEX_INITIALIZER; static pthread_mutex_t cfgdb_mutex = PTHREAD_MUTEX_INITIALIZER;
// These entries will not be printed to logfiles
static const std::set<CStr> g_UnloggedEntries = {
"lobby.password",
"lobby.buddies"
};
CConfigDB::CConfigDB() CConfigDB::CConfigDB()
{ {
// Recursive mutex needed for WriteFile // Recursive mutex needed for WriteFile
@ -368,7 +374,7 @@ bool CConfigDB::Reload(EConfigNamespace ns)
{ {
CStr key(header + name); CStr key(header + name);
newMap[key] = values; newMap[key] = values;
if (key == "lobby.password") if (g_UnloggedEntries.find(key) != g_UnloggedEntries.end())
LOGMESSAGE("Loaded config string \"%s\"", key); LOGMESSAGE("Loaded config string \"%s\"", key);
else else
{ {