Don't get stuck on a manifest fail.

This commit is contained in:
Learath Lea 2015-03-13 21:18:00 +02:00
parent 1f34ed6740
commit b75a756367
3 changed files with 10 additions and 1 deletions

View file

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

View file

@ -39,7 +39,10 @@ void CAutoUpdate::CompletionCallback(CFetchTask *pTask, void *pUser)
CAutoUpdate *pUpdate = (CAutoUpdate *)pUser;
if(!str_comp(pTask->Dest(), "update.json"))
{
pUpdate->m_State = GOT_MANIFEST;
if(pTask->State() == CFetchTask::STATE_DONE)
pUpdate->m_State = GOT_MANIFEST;
else if(pTask->State() == CFetchTask::STATE_ERROR)
pUpdate->m_State = FAIL_MANIFEST;
}
else if(!str_comp(pTask->Dest(), pUpdate->m_aLastFile))
{

View file

@ -1292,6 +1292,11 @@ 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)
{
str_format(aBuf, sizeof(aBuf), "Failed to download manifest!");
TextRender()->TextColor(1.0f, 0.4f, 0.4f, 1.0f);
}
else if(State == IAutoUpdate::NEED_RESTART)
{
str_format(aBuf, sizeof(aBuf), "DDNet Client updated!");