From e7319c8ab29f33d7d66b6be8310f9faa59182cf8 Mon Sep 17 00:00:00 2001 From: Darryl Pogue Date: Sun, 29 Jan 2012 01:46:26 -0800 Subject: [PATCH] Fix plNetClient. --- .../PubUtilLib/plNetClient/plNetClientMgr.cpp | 5 +++-- .../plNetClient/plNetClientMgrSend.cpp | 3 ++- .../plNetClient/plNetClientMgrVoice.cpp | 1 + .../plNetClient/plNetClientMsgHandler.cpp | 4 ++-- .../PubUtilLib/plNetClient/plNetLinkingMgr.cpp | 16 ++++++++++------ .../plNetCommon/plNetServerSessionInfo.cpp | 3 ++- 6 files changed, 20 insertions(+), 12 deletions(-) diff --git a/Sources/Plasma/PubUtilLib/plNetClient/plNetClientMgr.cpp b/Sources/Plasma/PubUtilLib/plNetClient/plNetClientMgr.cpp index 2bd48065..bc00775f 100644 --- a/Sources/Plasma/PubUtilLib/plNetClient/plNetClientMgr.cpp +++ b/Sources/Plasma/PubUtilLib/plNetClient/plNetClientMgr.cpp @@ -461,7 +461,8 @@ void plNetClientMgr::StartLinkInFX() plLinkEffectsTriggerMsg* lem = new plLinkEffectsTriggerMsg(); lem->SetLeavingAge(false); // linking in lem->SetLinkKey(fLocalPlayerKey); - lem->SetLinkInAnimKey(avMod->GetLinkInAnimKey()); + plKey animKey = avMod->GetLinkInAnimKey(); + lem->SetLinkInAnimKey(animKey); // indicate if we are invisible if (avMod && avMod->IsInStealthMode() && avMod->GetTarget(0)) @@ -1287,7 +1288,7 @@ void plNetClientMgr::QueueDisableNet (bool showDlg, const char str[]) { msg->Ref(); fDisableMsg = msg; IDisableNet(); -#endif; +#endif } void plNetClientMgr::IDisableNet () { diff --git a/Sources/Plasma/PubUtilLib/plNetClient/plNetClientMgrSend.cpp b/Sources/Plasma/PubUtilLib/plNetClient/plNetClientMgrSend.cpp index f9950354..10164592 100644 --- a/Sources/Plasma/PubUtilLib/plNetClient/plNetClientMgrSend.cpp +++ b/Sources/Plasma/PubUtilLib/plNetClient/plNetClientMgrSend.cpp @@ -163,7 +163,8 @@ void plNetClientMgr::ISendCCRPetition(plCCRPetitionMsg* petMsg) // write config info formatted like an ini file to a buffer hsRAMStream ram; - info.WriteTo( &plIniStreamConfigSource( &ram ) ); + plIniStreamConfigSource src(&ram); + info.WriteTo(&src); int size = ram.GetPosition(); ram.Rewind(); std::string buf; diff --git a/Sources/Plasma/PubUtilLib/plNetClient/plNetClientMgrVoice.cpp b/Sources/Plasma/PubUtilLib/plNetClient/plNetClientMgrVoice.cpp index c4f1fffc..af7880e9 100644 --- a/Sources/Plasma/PubUtilLib/plNetClient/plNetClientMgrVoice.cpp +++ b/Sources/Plasma/PubUtilLib/plNetClient/plNetClientMgrVoice.cpp @@ -41,6 +41,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ #include +#include #include "hsMatrix44.h" #include "hsGeometry3.h" #include "plNetClientMgr.h" diff --git a/Sources/Plasma/PubUtilLib/plNetClient/plNetClientMsgHandler.cpp b/Sources/Plasma/PubUtilLib/plNetClient/plNetClientMsgHandler.cpp index 2420ec2f..979d9f85 100644 --- a/Sources/Plasma/PubUtilLib/plNetClient/plNetClientMsgHandler.cpp +++ b/Sources/Plasma/PubUtilLib/plNetClient/plNetClientMsgHandler.cpp @@ -402,8 +402,8 @@ MSG_HANDLER_DEFN(plNetClientMsgHandler,plNetMsgVoice) int bufLen = m->GetVoiceDataLen(); const char* buf = m->GetVoiceData(); - BYTE flags = m->GetFlags(); - BYTE numFrames = m->GetNumFrames(); + uint8_t flags = m->GetFlags(); + uint8_t numFrames = m->GetNumFrames(); plKey key = NULL; // plKey key=hsgResMgr::ResMgr()->FindKey(m->ObjectInfo()->GetUoid()); diff --git a/Sources/Plasma/PubUtilLib/plNetClient/plNetLinkingMgr.cpp b/Sources/Plasma/PubUtilLib/plNetClient/plNetLinkingMgr.cpp index ea092f92..7d9bfe74 100644 --- a/Sources/Plasma/PubUtilLib/plNetClient/plNetLinkingMgr.cpp +++ b/Sources/Plasma/PubUtilLib/plNetClient/plNetLinkingMgr.cpp @@ -912,8 +912,10 @@ uint8_t plNetLinkingMgr::IPreProcessLink(void) //-------------------------------------------------------------------- // BASIC LINK. Link to a unique instance of the age, if no instance specified. case plNetCommon::LinkingRules::kBasicLink: - if (!info->HasAgeInstanceGuid()) - info->SetAgeInstanceGuid(&plUUID(GuidGenerate())); + if (!info->HasAgeInstanceGuid()) { + plUUID newuuid(GuidGenerate()); + info->SetAgeInstanceGuid(&newuuid); + } break; //-------------------------------------------------------------------- @@ -952,7 +954,8 @@ uint8_t plNetLinkingMgr::IPreProcessLink(void) info->SetAgeDescription(desc.c_str()); } if (!info->HasAgeInstanceGuid()) { - info->SetAgeInstanceGuid(&plUUID(GuidGenerate())); + plUUID newuuid(GuidGenerate()); + info->SetAgeInstanceGuid(&newuuid); } // register this as an owned age now before we link to it. @@ -992,7 +995,8 @@ uint8_t plNetLinkingMgr::IPreProcessLink(void) } if (!info->HasAgeInstanceGuid()) { - info->SetAgeInstanceGuid(&plUUID(GuidGenerate())); + plUUID newuuid(GuidGenerate()); + info->SetAgeInstanceGuid(&newuuid); } VaultRegisterOwnedAge(link); @@ -1078,10 +1082,10 @@ uint8_t plNetLinkingMgr::IPreProcessLink(void) case hsFail: success = kLinkFailed; break; - case FALSE: + case false: success = kLinkDeferred; break; - case TRUE: + case true: success = kLinkImmediately; } diff --git a/Sources/Plasma/PubUtilLib/plNetCommon/plNetServerSessionInfo.cpp b/Sources/Plasma/PubUtilLib/plNetCommon/plNetServerSessionInfo.cpp index 3df7e2f1..4004ccc3 100644 --- a/Sources/Plasma/PubUtilLib/plNetCommon/plNetServerSessionInfo.cpp +++ b/Sources/Plasma/PubUtilLib/plNetCommon/plNetServerSessionInfo.cpp @@ -171,7 +171,8 @@ void plAgeInfoStruct::CopyFrom(const NetAgeInfo & info) { StrToAnsi(tmp, info.ageDesc, arrsize(tmp)); SetAgeDescription(tmp); - SetAgeInstanceGuid(&plUUID(info.ageInstId)); + plUUID inst(info.ageInstId); + SetAgeInstanceGuid(&inst); SetAgeSequenceNumber(info.ageSequenceNumber); SetAgeLanguage(info.ageLanguage); }