diff --git a/stepmania/Themes/default/metrics.ini b/stepmania/Themes/default/metrics.ini index 09092dc690..2665331f42 100644 --- a/stepmania/Themes/default/metrics.ini +++ b/stepmania/Themes/default/metrics.ini @@ -4429,3 +4429,6 @@ Answer3Of3Y=SCREEN_CENTER_Y+120 Answer3Of3OnCommand= Answer3Of3OffCommand= Answer3Of3Text=CANCEL + +[GameState] +UseNameBlacklist=0 \ No newline at end of file diff --git a/stepmania/src/GameState.cpp b/stepmania/src/GameState.cpp index 8f065058cd..6bf7336b66 100644 --- a/stepmania/src/GameState.cpp +++ b/stepmania/src/GameState.cpp @@ -42,7 +42,9 @@ GameState* GAMESTATE = NULL; // global and accessable from anywhere in our program #define CHARACTERS_DIR "Characters/" -#define NAMES_BLACKLIST_FILE "Data/NamesBlacklist.dat" +#define NAME_BLACKLIST_FILE "Data/NamesBlacklist.dat" + +ThemeMetric USE_NAME_BLACKLIST("GameState","UseNameBlacklist"); GameState::GameState() : m_PreferredCourseDifficulty( MESSAGE_EDIT_PREFERRED_COURSE_DIFFICULTY_P1_CHANGED ), @@ -1604,29 +1606,30 @@ bool GameState::AnyPlayerHasRankingFeats() const void GameState::StoreRankingName( PlayerNumber pn, CString name ) { - // - // Filter swear words from name - // name.MakeUpper(); - RageFile file; - if( file.Open(NAMES_BLACKLIST_FILE) ) - { - CString line; - - while (!file.AtEOF()) - { - if( file.GetLine( line ) == -1 ) - { - LOG->Warn( "Error reading \"%s\": %s", NAMES_BLACKLIST_FILE, file.GetError().c_str() ); - break; - } - line.MakeUpper(); - if( !line.empty() && name.Find(line) != -1 ) // name contains a bad word + if( USE_NAME_BLACKLIST ) + { + RageFile file; + if( file.Open(NAME_BLACKLIST_FILE) ) + { + CString line; + + while (!file.AtEOF()) { - LOG->Trace( "entered '%s' matches blacklisted item '%s'", name.c_str(), line.c_str() ); - name = ""; - break; + if( file.GetLine( line ) == -1 ) + { + LOG->Warn( "Error reading \"%s\": %s", NAME_BLACKLIST_FILE, file.GetError().c_str() ); + break; + } + + line.MakeUpper(); + if( !line.empty() && name.Find(line) != -1 ) // name contains a bad word + { + LOG->Trace( "entered '%s' matches blacklisted item '%s'", name.c_str(), line.c_str() ); + name = ""; + break; + } } } }