mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
Don't get stuck on a manifest fail.
This commit is contained in:
parent
1f34ed6740
commit
b75a756367
|
@ -16,6 +16,7 @@ public:
|
||||||
PARSING_UPDATE,
|
PARSING_UPDATE,
|
||||||
DOWNLOADING,
|
DOWNLOADING,
|
||||||
NEED_RESTART,
|
NEED_RESTART,
|
||||||
|
FAIL_MANIFEST,
|
||||||
};
|
};
|
||||||
|
|
||||||
virtual void Update() = 0;
|
virtual void Update() = 0;
|
||||||
|
|
|
@ -39,7 +39,10 @@ void CAutoUpdate::CompletionCallback(CFetchTask *pTask, void *pUser)
|
||||||
CAutoUpdate *pUpdate = (CAutoUpdate *)pUser;
|
CAutoUpdate *pUpdate = (CAutoUpdate *)pUser;
|
||||||
if(!str_comp(pTask->Dest(), "update.json"))
|
if(!str_comp(pTask->Dest(), "update.json"))
|
||||||
{
|
{
|
||||||
|
if(pTask->State() == CFetchTask::STATE_DONE)
|
||||||
pUpdate->m_State = GOT_MANIFEST;
|
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))
|
else if(!str_comp(pTask->Dest(), pUpdate->m_aLastFile))
|
||||||
{
|
{
|
||||||
|
|
|
@ -1292,6 +1292,11 @@ void CMenus::RenderServerbrowser(CUIRect MainView)
|
||||||
str_format(aBuf, sizeof(aBuf), Localize("Current version: %s"), GAME_VERSION);
|
str_format(aBuf, sizeof(aBuf), Localize("Current version: %s"), GAME_VERSION);
|
||||||
else if(State >= IAutoUpdate::GETTING_MANIFEST && State < IAutoUpdate::NEED_RESTART)
|
else if(State >= IAutoUpdate::GETTING_MANIFEST && State < IAutoUpdate::NEED_RESTART)
|
||||||
str_format(aBuf, sizeof(aBuf), "Downloading %s:", AutoUpdate()->GetCurrentFile());
|
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)
|
else if(State == IAutoUpdate::NEED_RESTART)
|
||||||
{
|
{
|
||||||
str_format(aBuf, sizeof(aBuf), "DDNet Client updated!");
|
str_format(aBuf, sizeof(aBuf), "DDNet Client updated!");
|
||||||
|
|
Loading…
Reference in a new issue