mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
Merge pull request #167 from Learath2/pr_UpdateHang
Add a messag for the last file too
This commit is contained in:
commit
742ba20cc8
|
@ -16,7 +16,7 @@ public:
|
|||
PARSING_UPDATE,
|
||||
DOWNLOADING,
|
||||
NEED_RESTART,
|
||||
FAIL_MANIFEST,
|
||||
FAIL,
|
||||
};
|
||||
|
||||
virtual void Update() = 0;
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue