Profile::LoadStatsXmlFromNode

This commit is contained in:
Glenn Maynard
2005-01-08 19:15:56 +00:00
parent 8ee052516a
commit 5e102d4946
2 changed files with 10 additions and 4 deletions
+9 -4
View File
@@ -589,7 +589,7 @@ void Profile::IncrementCategoryPlayCount( StepsType st, RankingCategory rc )
#define WARN_AND_CONTINUE_M(m) { WARN_M(m); continue; }
#define WARN_AND_BREAK_M(m) { WARN_M(m); break; }
#define LOAD_NODE(X) { \
XNode* X = xml.GetChild(#X); \
const XNode* X = xml->GetChild(#X); \
if( X==NULL ) LOG->Warn("Failed to read section " #X); \
else Load##X##FromNode(X); }
@@ -655,14 +655,19 @@ Profile::LoadResult Profile::LoadAllFromDir( CString sDir, bool bRequireSignatur
}
LOG->Trace( "Done." );
return LoadStatsXmlFromNode( &xml );
}
Profile::LoadResult Profile::LoadStatsXmlFromNode( const XNode *xml )
{
/* The placeholder stats.xml file has an <html> tag. Don't load it, but don't
* warn about it. */
if( xml.m_sName == "html" )
if( xml->m_sName == "html" )
return failed_no_profile;
if( xml.m_sName != "Stats" )
if( xml->m_sName != "Stats" )
{
WARN_M( xml.m_sName );
WARN_M( xml->m_sName );
return failed_tampered;
}
+1
View File
@@ -267,6 +267,7 @@ public:
bool SaveAllToDir( CString sDir, bool bSignData ) const;
void LoadEditableDataFromDir( CString sDir );
LoadResult LoadStatsXmlFromNode( const XNode* pNode );
void LoadGeneralDataFromNode( const XNode* pNode );
void LoadSongScoresFromNode( const XNode* pNode );
void LoadCourseScoresFromNode( const XNode* pNode );