diff --git a/Sources/Plasma/Apps/plClient/plClient.cpp b/Sources/Plasma/Apps/plClient/plClient.cpp index ec04183a..f95701b1 100644 --- a/Sources/Plasma/Apps/plClient/plClient.cpp +++ b/Sources/Plasma/Apps/plClient/plClient.cpp @@ -868,8 +868,8 @@ hsBool plClient::MsgReceive(plMessage* msg) // plResPatcherMsg //============================================================================ if (plResPatcherMsg * resMsg = plResPatcherMsg::ConvertNoRef(msg)) { - plgDispatch::Dispatch()->UnRegisterForExactType(plResPatcherMsg::Index(), GetKey()); - IOnAsyncInitComplete(); + IHandlePatcherMsg(resMsg); + return true; } return hsKeyedObject::MsgReceive(msg); @@ -1300,7 +1300,10 @@ void plClient::IProgressMgrCallbackProc(plOperationProgress * progress) if (gTaskbarList) { HWND hwnd = fInstance->GetWindowHandle(); // lazy - if (progress->IsLastUpdate()) + if (progress->IsAborting()) + // We'll assume this is fatal + gTaskbarList->SetProgressState(hwnd, TBPF_ERROR); + else if (progress->IsLastUpdate()) gTaskbarList->SetProgressState(hwnd, TBPF_NOPROGRESS); else if (progress->GetMax() == 0.f) gTaskbarList->SetProgressState(hwnd, TBPF_INDETERMINATE); @@ -2550,6 +2553,18 @@ void plClient::IHandlePreloaderMsg (plPreloaderMsg * msg) { IPatchGlobalAgeFiles(); } +//============================================================================ +void plClient::IHandlePatcherMsg (plResPatcherMsg * msg) { + plgDispatch::Dispatch()->UnRegisterForExactType(plResPatcherMsg::Index(), GetKey()); + + if (!msg->Success()) { + plNetClientApp::GetInstance()->QueueDisableNet(true, msg->GetError()); + return; + } + + IOnAsyncInitComplete(); +} + //============================================================================ void plClient::IHandleNetCommAuthMsg (plNetCommAuthMsg * msg) { diff --git a/Sources/Plasma/Apps/plClient/plClient.h b/Sources/Plasma/Apps/plClient/plClient.h index 459ae84f..0def1745 100644 --- a/Sources/Plasma/Apps/plClient/plClient.h +++ b/Sources/Plasma/Apps/plClient/plClient.h @@ -82,7 +82,7 @@ class plBinkPlayer; class plPreloaderMsg; class plNetCommAuthMsg; class plAgeLoaded2Msg; - +class plResPatcherMsg; typedef void (*plMessagePumpProc)( void ); @@ -179,6 +179,7 @@ protected: void ICompleteInit (); void IOnAsyncInitComplete (); + void IHandlePatcherMsg (plResPatcherMsg * msg); void IHandlePreloaderMsg (plPreloaderMsg * msg); void IHandleNetCommAuthMsg (plNetCommAuthMsg * msg); bool IHandleAgeLoaded2Msg (plAgeLoaded2Msg * msg); diff --git a/Sources/Plasma/FeatureLib/pfSecurePreloader/pfSecurePreloader.cpp b/Sources/Plasma/FeatureLib/pfSecurePreloader/pfSecurePreloader.cpp index f242afe4..9ae2fea9 100644 --- a/Sources/Plasma/FeatureLib/pfSecurePreloader/pfSecurePreloader.cpp +++ b/Sources/Plasma/FeatureLib/pfSecurePreloader/pfSecurePreloader.cpp @@ -300,6 +300,7 @@ void pfSecurePreloader::Start() void pfSecurePreloader::Terminate() { FATAL("pfSecurePreloader failure"); + fProgress->SetAborting(); plPreloaderMsg* msg = new plPreloaderMsg; msg->fSuccess = false; diff --git a/Sources/Plasma/PubUtilLib/plAgeLoader/plResPatcher.cpp b/Sources/Plasma/PubUtilLib/plAgeLoader/plResPatcher.cpp index 44b9e7d3..af8b488e 100644 --- a/Sources/Plasma/PubUtilLib/plAgeLoader/plResPatcher.cpp +++ b/Sources/Plasma/PubUtilLib/plAgeLoader/plResPatcher.cpp @@ -277,7 +277,10 @@ void plResPatcher::Finish(bool success) if (success) PatcherLog(kHeader, "--- Patch Completed Successfully ---"); else + { PatcherLog(kHeader, "--- Patch Killed by Error ---"); + fProgress->SetAborting(); + } plResPatcherMsg* pMsg = new plResPatcherMsg(success, sLastError); pMsg->Send(); // whoosh... off it goes diff --git a/Sources/Plasma/PubUtilLib/plNetClient/plNetLinkingMgr.cpp b/Sources/Plasma/PubUtilLib/plNetClient/plNetLinkingMgr.cpp index 03112b49..2a243ac3 100644 --- a/Sources/Plasma/PubUtilLib/plNetClient/plNetLinkingMgr.cpp +++ b/Sources/Plasma/PubUtilLib/plNetClient/plNetLinkingMgr.cpp @@ -165,11 +165,9 @@ void plNetLinkingMgr::NCAgeJoinerCallback ( // Tell the user we failed to link. // In the future, we might want to try graceful recovery (link back to Relto?) if (!params->success) { - plNetClientMgr::StaticErrorMsg(params->msg); - hsMessageBox(params->msg, "Linking Error", hsMessageBoxNormal, hsMessageBoxIconError); + plNetClientApp::GetInstance()->ErrorMsg(params->msg); #ifdef PLASMA_EXTERNAL_RELEASE - plClientMsg* clientMsg = new plClientMsg(plClientMsg::kQuit); - clientMsg->Send(hsgResMgr::ResMgr()->FindKey(kClient_KEY)); + plNetClientApp::GetInstance()->QueueDisableNet(true, params->msg); #endif return; } diff --git a/Sources/Plasma/PubUtilLib/plProgressMgr/plProgressMgr.cpp b/Sources/Plasma/PubUtilLib/plProgressMgr/plProgressMgr.cpp index d874a55c..d98d813b 100644 --- a/Sources/Plasma/PubUtilLib/plProgressMgr/plProgressMgr.cpp +++ b/Sources/Plasma/PubUtilLib/plProgressMgr/plProgressMgr.cpp @@ -389,7 +389,6 @@ void plOperationProgress::SetAborting() hsSetBits(fFlags, kAborting); plProgressMgr::GetInstance()->IUpdateCallbackProc(this); fMax = fValue = 0.f; - hsClearBits(fFlags, kAborting); } void plOperationProgress::SetRetry() diff --git a/Sources/Plasma/PubUtilLib/plProgressMgr/plProgressMgr.h b/Sources/Plasma/PubUtilLib/plProgressMgr/plProgressMgr.h index 061d4a77..b3dc11f1 100644 --- a/Sources/Plasma/PubUtilLib/plProgressMgr/plProgressMgr.h +++ b/Sources/Plasma/PubUtilLib/plProgressMgr/plProgressMgr.h @@ -153,6 +153,7 @@ class plOperationProgress // progress bars above this one know to adjust their totals to not include any amount // that wasn't completed, and will set this progress bar to zero void SetAborting(); + bool IsAborting() { return hsCheckBits(fFlags, kAborting); } // If you're reusing an existing progress bar to retry a failed operation, call this. // It will set the retry flag, and reset the progress bar so the next update will // count as the first. If you set retry in RegisterOperation, don't use this too.