save ProductID in HighScore to track what software a score came from

This commit is contained in:
Chris Danford
2004-05-25 06:50:04 +00:00
parent b7850ef9c2
commit ce41948d95
5 changed files with 10 additions and 2 deletions
+2
View File
@@ -58,6 +58,7 @@ XNode* HighScore::CreateNode() const
pNode->AppendChild( "Time", (int)time );
pNode->AppendChild( "PlayerGuid", sPlayerGuid );
pNode->AppendChild( "MachineGuid", sMachineGuid );
pNode->AppendChild( "ProductID", iProductID );
return pNode;
}
@@ -87,6 +88,7 @@ void HighScore::LoadFromNode( const XNode* pNode )
else if( (*child)->name == "Time" ) (*child)->GetValue( (int&)time );
else if( (*child)->name == "PlayerGuid" ) (*child)->GetValue( sPlayerGuid );
else if( (*child)->name == "MachineGuid" ) (*child)->GetValue( sMachineGuid );
else if( (*child)->name == "ProductID" ) (*child)->GetValue( iProductID );
}
/* Validate input. */
+3 -1
View File
@@ -26,7 +26,7 @@ struct HighScore
time_t time; // return value of time() when screenshot was taken
CString sPlayerGuid; // who made this high score
CString sMachineGuid; // where this high score was made
int iProductID;
HighScore() { Unset(); }
void Unset()
@@ -40,6 +40,7 @@ struct HighScore
time = 0;
sPlayerGuid = "";
sMachineGuid = "";
iProductID = 0;
}
bool operator>=( const HighScore& other ) const;
@@ -55,6 +56,7 @@ struct HighScore
COMPARE( time );
COMPARE( sPlayerGuid );
COMPARE( sMachineGuid );
COMPARE( iProductID );
#undef COMPARE
return true;
}
+3 -1
View File
@@ -298,6 +298,7 @@ void PrefsManager::Init()
}
m_sMemoryCardProfileSubdir = PRODUCT_NAME;
m_iProductID = 1;
}
PrefsManager::~PrefsManager()
@@ -507,6 +508,7 @@ void PrefsManager::ReadPrefsFromFile( CString sIni )
ini.GetValue( "Options", "DisableScreenSaver", m_bDisableScreenSaver );
ini.GetValue( "Options", "MemoryCardProfileSubdir", m_sMemoryCardProfileSubdir );
ini.GetValue( "Options", "ProductID", m_iProductID );
FOREACH_PlayerNumber( p )
{
ini.GetValue( "Options", ssprintf("DefaultLocalProfileIDP%d",p+1), m_sDefaultLocalProfileID[p] );
@@ -733,6 +735,7 @@ void PrefsManager::SaveGlobalPrefsToDisk() const
ini.SetValue( "Options", "DisableScreenSaver", m_bDisableScreenSaver );
ini.SetValue( "Options", "MemoryCardProfileSubdir", m_sMemoryCardProfileSubdir );
ini.SetValue( "Options", "ProductID", m_iProductID );
FOREACH_PlayerNumber( p )
{
ini.SetValue( "Options", ssprintf("DefaultLocalProfileIDP%d",p+1), m_sDefaultLocalProfileID[p] );
@@ -796,4 +799,3 @@ void PrefsManager::ResetToFactoryDefaults()
SaveGlobalPrefsToDisk();
m_bFirstRun = false;
}
+1
View File
@@ -182,6 +182,7 @@ public:
bool m_bDisableScreenSaver;
CString m_sLanguage;
CString m_sMemoryCardProfileSubdir; // the directory on a memory card to look in for a profile
int m_iProductID; // Saved in HighScore to track what software version a score came from.
CString m_sDefaultLocalProfileID[NUM_PLAYERS];
CString m_sMemoryCardOsMountPoint[NUM_PLAYERS]; // if set, always use the device that mounts to this point
int m_iMemoryCardUsbBus[NUM_PLAYERS]; // look for this bus when assigning cards. -1 = match any
+1
View File
@@ -898,6 +898,7 @@ void ScreenEvaluation::CommitScores(
hs.time = time(NULL);
hs.sPlayerGuid = PROFILEMAN->IsUsingProfile(p) ? PROFILEMAN->GetProfile(p)->m_sGuid : "";
hs.sMachineGuid = PROFILEMAN->GetMachineProfile()->m_sGuid;
hs.iProductID = PREFSMAN->m_iProductID;
StepsType st = GAMESTATE->GetCurrentStyleDef()->m_StepsType;