From 0cbaf44c3d29ab0f88c5157ed6743c2d364b9b57 Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Wed, 22 Oct 2003 10:49:58 +0000 Subject: [PATCH] add high score name blacklist --- stepmania/Data/NamesBlacklist.dat | 1 + stepmania/src/GameState.cpp | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 stepmania/Data/NamesBlacklist.dat diff --git a/stepmania/Data/NamesBlacklist.dat b/stepmania/Data/NamesBlacklist.dat new file mode 100644 index 0000000000..e516a62a55 --- /dev/null +++ b/stepmania/Data/NamesBlacklist.dat @@ -0,0 +1 @@ +badword diff --git a/stepmania/src/GameState.cpp b/stepmania/src/GameState.cpp index 4082721e77..7def9f05cd 100644 --- a/stepmania/src/GameState.cpp +++ b/stepmania/src/GameState.cpp @@ -37,6 +37,7 @@ GameState* GAMESTATE = NULL; // global and accessable from anywhere in our program #define CHARACTERS_DIR BASE_PATH "Characters" SLASH +#define NAMES_BLACKLIST_FILE BASE_PATH "Data" SLASH "NamesBlacklist.dat" GameState::GameState() { @@ -913,6 +914,22 @@ void GameState::GetRankingFeats( PlayerNumber pn, vector &asFeatsO void GameState::StoreRankingName( PlayerNumber pn, CString name ) { + // + // Filter swear words from name + // + name.MakeUpper(); + ifstream f( BLACKLIST_NAMES_FILE ); + f.open(); + if( f.good() ) + { + CString sLine; + while( getline(sLine) ) + { + if( name.Find(sLine) != -1 ) + name = ""; + } + } + vector aFeats; GetRankingFeats( pn, aFeats );