mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-25 01:41:29 +00:00
Added clamp for EQEmuLogSys::LogSettings database values load
This commit is contained in:
parent
94d8db4691
commit
fa1edee790
@ -2056,6 +2056,8 @@ uint32 Database::GetGuildIDByCharID(uint32 character_id)
|
|||||||
|
|
||||||
void Database::LoadLogSettings(EQEmuLogSys::LogSettings* log_settings)
|
void Database::LoadLogSettings(EQEmuLogSys::LogSettings* log_settings)
|
||||||
{
|
{
|
||||||
|
// log_settings previously initialized to '0' by EQEmuLogSys::LoadLogSettingsDefaults()
|
||||||
|
|
||||||
std::string query =
|
std::string query =
|
||||||
"SELECT "
|
"SELECT "
|
||||||
"log_category_id, "
|
"log_category_id, "
|
||||||
@ -2073,6 +2075,9 @@ void Database::LoadLogSettings(EQEmuLogSys::LogSettings* log_settings)
|
|||||||
|
|
||||||
for (auto row = results.begin(); row != results.end(); ++row) {
|
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||||
log_category = atoi(row[0]);
|
log_category = atoi(row[0]);
|
||||||
|
if (log_category <= Logs::None || log_category >= Logs::MaxCategoryID)
|
||||||
|
continue;
|
||||||
|
|
||||||
log_settings[log_category].log_to_console = atoi(row[2]);
|
log_settings[log_category].log_to_console = atoi(row[2]);
|
||||||
log_settings[log_category].log_to_file = atoi(row[3]);
|
log_settings[log_category].log_to_file = atoi(row[3]);
|
||||||
log_settings[log_category].log_to_gmsay = atoi(row[4]);
|
log_settings[log_category].log_to_gmsay = atoi(row[4]);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user