Ensure save is stored in memory for reload when using Save as current name, correct ServerSaveActivity to call SaveUploaded when doing an instant upload

This commit is contained in:
Simon Robertshaw
2012-10-05 16:30:32 +01:00
parent 0fbe12772d
commit 7c0ba094b8
2 changed files with 10 additions and 4 deletions

View File

@@ -1101,8 +1101,7 @@ void GameController::SaveAsCurrent()
virtual ~SaveUploadedCallback() {}; virtual ~SaveUploadedCallback() {};
virtual void SaveUploaded(SaveInfo save) virtual void SaveUploaded(SaveInfo save)
{ {
//Don't do anything c->LoadSave(&save);
//c->LoadSave(&save);
} }
}; };

View File

@@ -33,7 +33,6 @@ public:
} }
}; };
//Currently, reading is done on another thread, we can't render outside the main thread due to some bullshit with OpenGL
class SaveUploadTask: public Task class SaveUploadTask: public Task
{ {
SaveInfo save; SaveInfo save;
@@ -151,11 +150,19 @@ ServerSaveActivity::ServerSaveActivity(SaveInfo save, bool saveNow, ServerSaveAc
void ServerSaveActivity::NotifyDone(Task * task) void ServerSaveActivity::NotifyDone(Task * task)
{ {
Exit();
if(!task->GetSuccess()) if(!task->GetSuccess())
{ {
Exit();
new ErrorMessage("Error", Client::Ref().GetLastError()); new ErrorMessage("Error", Client::Ref().GetLastError());
} }
else
{
if(callback)
{
callback->SaveUploaded(save);
}
Exit();
}
} }
void ServerSaveActivity::Save() void ServerSaveActivity::Save()