fix high score name saving

This commit is contained in:
Chris Danford
2003-12-10 06:49:27 +00:00
parent 6dc897bd10
commit 2cbabe8dcf
2 changed files with 23 additions and 13 deletions
+10 -10
View File
@@ -1123,18 +1123,18 @@ void GameState::StoreRankingName( PlayerNumber pn, CString name )
name.MakeUpper();
RageFile file(NAMES_BLACKLIST_FILE);
if (file.IsOpen())
if (file.IsOpen())
{
CString line;
while (!file.AtEOF())
{
CString line;
while (!file.AtEOF())
{
line = file.GetLine();
line.MakeUpper();
if (name.Find(line) != -1)
name = "";
}
line = file.GetLine();
line.MakeUpper();
if( !line.empty() && name.Find(line) != -1 ) // name contains a bad word
name = "";
}
}
vector<RankingFeats> aFeats;
GetRankingFeats( pn, aFeats );
+13 -3
View File
@@ -970,6 +970,7 @@ void ProfileManager::SaveStatsWebPageToDir( CString sDir, MemoryCard mc )
#define PRINT_LINE_B(szName,bVal) f.Write( ssprintf("<p>%s = <b>%s</b></p>\n",szName,(bVal)?"yes":"no") )
#define PRINT_LINE_I(szName,iVal) f.Write( ssprintf("<p>%s = <b>%d</b></p>\n",szName,iVal) )
#define PRINT_LINE_RANK(iRank,sName,iVal) f.Write( ssprintf("<p><b>%d</b> - %s (%d)</p>\n",iRank,sName.c_str(),iVal) )
#define PRINT_LINE_RANK_LINK(iRank,sName,szLink,iVal) f.Write( ssprintf("<p><b>%d</b> - <a href='%s'>%s</a> (%d)</p>\n",iRank,szLink,sName.c_str(),iVal) )
//
// Print table of contents
@@ -1072,7 +1073,7 @@ void ProfileManager::SaveStatsWebPageToDir( CString sDir, MemoryCard mc )
for( unsigned i=0; i<uNumToShow; i++ )
{
Song* pSong = vpSongs[i];
PRINT_LINE_RANK( i+1, pSong->GetFullDisplayTitle(), pSong->GetNumTimesPlayed(mc) );
PRINT_LINE_RANK_LINK( i+1, pSong->GetFullDisplayTitle(), ssprintf("#%u",pSong).c_str(), pSong->GetNumTimesPlayed(mc) );
}
PRINT_DIV_END;
}
@@ -1093,7 +1094,7 @@ void ProfileManager::SaveStatsWebPageToDir( CString sDir, MemoryCard mc )
s += GAMEMAN->NotesTypeToString(pSteps->m_StepsType);
s += " ";
s += DifficultyToString(pSteps->GetDifficulty());
PRINT_LINE_RANK( i+1, s, pSteps->GetNumTimesPlayed(mc) );
PRINT_LINE_RANK_LINK( i+1, s, ssprintf("#%u",pSteps).c_str(), pSteps->GetNumTimesPlayed(mc) );
}
PRINT_DIV_END;
}
@@ -1107,7 +1108,7 @@ void ProfileManager::SaveStatsWebPageToDir( CString sDir, MemoryCard mc )
for( unsigned i=0; i<uNumToShow; i++ )
{
Course* pCourse = vpCourses[i];
PRINT_LINE_RANK( i+1, pCourse->m_sName, pCourse->GetNumTimesPlayed(mc) );
PRINT_LINE_RANK_LINK( i+1, pCourse->m_sName, ssprintf("#%u",pCourse).c_str(), pCourse->GetNumTimesPlayed(mc) );
}
PRINT_DIV_END;
}
@@ -1215,6 +1216,15 @@ void ProfileManager::SaveStatsWebPageToDir( CString sDir, MemoryCard mc )
DifficultyToString(pSteps->GetDifficulty());
PRINT_DIV2_START_ANCHOR( /*Steps primary key*/pSteps, s.c_str() ); // use pointer value as the hash
PRINT_LINE_I( "NumTimesPlayed", pSteps->m_MemCardDatas[mc].iNumTimesPlayed );
vector<Steps::MemCardData::HighScore>& vHighScores = pSteps->m_MemCardDatas[mc].vHighScores;
for( int i=0; i<vHighScores.size(); i++ )
{
Steps::MemCardData::HighScore &hs = vHighScores[i];
CString sName = ssprintf("#%d",i+1);
CString sValue = ssprintf("%s, %s, %i, %.2f%%", hs.sName.c_str(), GradeToString(hs.grade).c_str(), hs.iScore, hs.fPercentDP*100);
PRINT_LINE_S( sName.c_str(), sValue );
}
f.PutLine( "</div>\n" );
PRINT_DIV2_END;
}