Remove Profile::m_SavedLuaData. Don't store data as
serialized Lua blobs. The Lua blob format may change with Lua upgrades, and it's hard to impossible to use the data with other apps. This wasn't used right now anyway, but if it's needed, use an XML format.
This commit is contained in:
@@ -136,11 +136,6 @@ void Profile::InitGeneralData()
|
||||
m_iNumTotalSongsPlayed = 0;
|
||||
ZERO( m_iNumStagesPassedByPlayMode );
|
||||
ZERO( m_iNumStagesPassedByGrade );
|
||||
|
||||
Lua *L = LUA->Get();
|
||||
lua_newtable( L );
|
||||
m_SavedLuaData.SetFromStack( L );
|
||||
LUA->Release( L );
|
||||
}
|
||||
|
||||
void Profile::InitSongScores()
|
||||
@@ -1025,7 +1020,6 @@ XNode* Profile::SaveGeneralDataCreateNode() const
|
||||
pGeneralDataNode->AppendChild( "TotalRolls", m_iTotalRolls );
|
||||
pGeneralDataNode->AppendChild( "TotalMines", m_iTotalMines );
|
||||
pGeneralDataNode->AppendChild( "TotalHands", m_iTotalHands );
|
||||
pGeneralDataNode->AppendChild( "Data", m_SavedLuaData.Serialize() );
|
||||
|
||||
// Keep declared variables in a very local scope so they aren't
|
||||
// accidentally used where they're not intended. There's a lot of
|
||||
@@ -1189,22 +1183,6 @@ void Profile::LoadGeneralDataFromNode( const XNode* pNode )
|
||||
pNode->GetChildValue( "TotalMines", m_iTotalMines );
|
||||
pNode->GetChildValue( "TotalHands", m_iTotalHands );
|
||||
|
||||
{
|
||||
RString sData;
|
||||
if( pNode->GetChildValue( "Data", sData ) )
|
||||
{
|
||||
m_SavedLuaData.LoadFromString( sData );
|
||||
if( m_SavedLuaData.GetLuaType() != LUA_TTABLE )
|
||||
{
|
||||
LOG->Warn( "Profile data did not evaluate to a table" );
|
||||
Lua *L = LUA->Get();
|
||||
lua_newtable( L );
|
||||
m_SavedLuaData.SetFromStack( L );
|
||||
LUA->Release( L );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
const XNode* pDefaultModifiers = pNode->GetChild("DefaultModifiers");
|
||||
if( pDefaultModifiers )
|
||||
@@ -1944,7 +1922,6 @@ public:
|
||||
static int GetGoalSeconds( T* p, lua_State *L ) { lua_pushnumber(L, p->m_iGoalSeconds ); return 1; }
|
||||
static int SetGoalSeconds( T* p, lua_State *L ) { p->m_iGoalSeconds = IArg(1); return 0; }
|
||||
static int GetCaloriesBurnedToday( T* p, lua_State *L ) { lua_pushnumber(L, p->GetCaloriesBurnedToday() ); return 1; }
|
||||
static int GetSaved( T* p, lua_State *L ) { p->m_SavedLuaData.PushSelf(L); return 1; }
|
||||
static int GetTotalNumSongsPlayed( T* p, lua_State *L ) { lua_pushnumber(L, p->m_iNumTotalSongsPlayed ); return 1; }
|
||||
static int IsCodeUnlocked( T* p, lua_State *L ) { lua_pushboolean(L, p->IsCodeUnlocked(SArg(1)) ); return 1; }
|
||||
static int GetSongsActual( T* p, lua_State *L ) { lua_pushnumber(L, p->GetSongsActual((StepsType)IArg(1),(Difficulty)IArg(2)) ); return 1; }
|
||||
@@ -2006,7 +1983,6 @@ public:
|
||||
ADD_METHOD( GetGoalSeconds );
|
||||
ADD_METHOD( SetGoalSeconds );
|
||||
ADD_METHOD( GetCaloriesBurnedToday );
|
||||
ADD_METHOD( GetSaved );
|
||||
ADD_METHOD( GetTotalNumSongsPlayed );
|
||||
ADD_METHOD( IsCodeUnlocked );
|
||||
ADD_METHOD( GetSongsActual );
|
||||
|
||||
@@ -15,7 +15,6 @@
|
||||
#include "CourseUtil.h" // for CourseID
|
||||
#include "TrailUtil.h" // for TrailID
|
||||
#include "StyleUtil.h" // for StyleID
|
||||
#include "LuaReference.h" // for LuaData
|
||||
|
||||
class XNode;
|
||||
struct lua_State;
|
||||
@@ -337,7 +336,6 @@ public:
|
||||
|
||||
// Lua
|
||||
void PushSelf( lua_State *L );
|
||||
LuaData m_SavedLuaData;
|
||||
|
||||
private:
|
||||
const HighScoresForASong *GetHighScoresForASong( const SongID& songID ) const;
|
||||
|
||||
Reference in New Issue
Block a user