From 2599bfbd7a8c6b145dc59d6bc6fc6f0f57764cc1 Mon Sep 17 00:00:00 2001 From: Adam Johnson Date: Fri, 3 Feb 2012 23:24:49 -0500 Subject: [PATCH] Add an error message for NCAgeJoiner failures Since we have a pfSecurePreloader that doesn't redownload every single launch, I don't feel bad about presenting an error message to the user and killing the client. This is really better than letting them languish at a black screen, groping for the relto book. --- .../PubUtilLib/plNetClient/plNetLinkingMgr.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/Sources/Plasma/PubUtilLib/plNetClient/plNetLinkingMgr.cpp b/Sources/Plasma/PubUtilLib/plNetClient/plNetLinkingMgr.cpp index ea092f92..9749fb4f 100644 --- a/Sources/Plasma/PubUtilLib/plNetClient/plNetLinkingMgr.cpp +++ b/Sources/Plasma/PubUtilLib/plNetClient/plNetLinkingMgr.cpp @@ -47,6 +47,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "plNetTransport/plNetTransportMember.h" // OfferLinkToPlayer() #include "plgDispatch.h" +#include "pnMessage/plClientMsg.h" #include "pnMessage/plTimeMsg.h" #include "plMessage/plLinkToAgeMsg.h" #include "pnKeyedObject/plKey.h" @@ -159,8 +160,19 @@ void plNetLinkingMgr::NCAgeJoinerCallback ( void * notify, void * userState ) { - plNetLinkingMgr * lm = plNetLinkingMgr::GetInstance(); + NCAgeJoinerCompleteNotify* params = (NCAgeJoinerCompleteNotify*)notify; + + // 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); + plClientMsg* clientMsg = new plClientMsg(plClientMsg::kQuit); + clientMsg->Send(hsgResMgr::ResMgr()->FindKey(kClient_KEY)); + return; + } + plNetLinkingMgr * lm = plNetLinkingMgr::GetInstance(); switch (type) { case kAgeJoinerComplete: { ASSERT(joiner == s_ageJoiner);