Merge pull request #167 from Learath2/pr_UpdateHang

Add a messag for the last file too
This commit is contained in:
Dennis Felsing 2015-03-13 20:30:04 +01:00
commit 742ba20cc8
3 changed files with 14 additions and 9 deletions

View file

@ -16,7 +16,7 @@ public:
PARSING_UPDATE,
DOWNLOADING,
NEED_RESTART,
FAIL_MANIFEST,
FAIL,
};
virtual void Update() = 0;

View file

@ -42,15 +42,20 @@ void CAutoUpdate::CompletionCallback(CFetchTask *pTask, void *pUser)
if(pTask->State() == CFetchTask::STATE_DONE)
pUpdate->m_State = GOT_MANIFEST;
else if(pTask->State() == CFetchTask::STATE_ERROR)
pUpdate->m_State = FAIL_MANIFEST;
pUpdate->m_State = FAIL;
}
else if(!str_comp(pTask->Dest(), pUpdate->m_aLastFile))
{
if(pUpdate->m_ClientUpdate)
pUpdate->ReplaceClient();
if(pUpdate->m_ServerUpdate)
pUpdate->ReplaceServer();
pUpdate->m_State = NEED_RESTART;
if(pTask->State() == CFetchTask::STATE_DONE)
{
if(pUpdate->m_ClientUpdate)
pUpdate->ReplaceClient();
if(pUpdate->m_ServerUpdate)
pUpdate->ReplaceServer();
pUpdate->m_State = NEED_RESTART;
}
else if(pTask->State() == CFetchTask::STATE_ERROR)
pUpdate->m_State = FAIL;
}
delete pTask;
}

View file

@ -1292,9 +1292,9 @@ void CMenus::RenderServerbrowser(CUIRect MainView)
str_format(aBuf, sizeof(aBuf), Localize("Current version: %s"), GAME_VERSION);
else if(State >= IAutoUpdate::GETTING_MANIFEST && State < IAutoUpdate::NEED_RESTART)
str_format(aBuf, sizeof(aBuf), "Downloading %s:", AutoUpdate()->GetCurrentFile());
else if(State == IAutoUpdate::FAIL_MANIFEST)
else if(State == IAutoUpdate::FAIL)
{
str_format(aBuf, sizeof(aBuf), "Failed to download manifest!");
str_format(aBuf, sizeof(aBuf), "Failed to download a file! Restart client to retry...");
TextRender()->TextColor(1.0f, 0.4f, 0.4f, 1.0f);
}
else if(State == IAutoUpdate::NEED_RESTART)