1
0
mirror of https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git synced 2025-07-20 04:09:16 +00:00

Mute the linking sound on client kicks

This commit is really quite awesome in that you can now propagate any
plLinkToAgeMsg that will mute the link out, link in sounds, or both. Some
garbage fields were repurposed for this functionality. The messages were
passed correctly on Cyan's MOULa server.

Conflicts:

	Sources/Plasma/PubUtilLib/plMessage/plLinkToAgeMsg.h
	Sources/Plasma/PubUtilLib/plNetClient/plLinkEffectsMgr.cpp
	Sources/Plasma/PubUtilLib/plNetClient/plNetClientMgr.h
	Sources/Plasma/PubUtilLib/plNetClient/plNetLinkingMgr.cpp
This commit is contained in:
2012-06-12 17:50:45 -04:00
parent 33d26ce29f
commit af1db55f67
10 changed files with 109 additions and 82 deletions

View File

@ -50,6 +50,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "plNetCliAgeJoiner.h"
#include "plNetClientMgr.h"
#include "plNetLinkingMgr.h"
#include "plNetObjectDebugger.h"
#include "pnSceneObject/plSceneObject.h"
#include "pnSceneObject/plCoordinateInterface.h"
@ -59,6 +60,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "plNetClientComm/plNetClientComm.h"
#include "plAgeLoader/plAgeLoader.h"
#include "plAvatar/plArmatureMod.h"
#include "plAvatar/plAvatarMgr.h"
#include "plVault/plVault.h"
@ -100,11 +102,13 @@ struct plNCAgeJoiner {
FNCAgeJoinerCallback callback;
void * userState;
bool complete;
bool muteLinkSfx;
plOperationProgress* progressBar;
plNCAgeJoiner (
const NetCommAge & age,
bool muteSfx,
FNCAgeJoinerCallback callback,
void * userState
);
@ -157,10 +161,12 @@ void AgeVaultDownloadCallback (
//============================================================================
plNCAgeJoiner::plNCAgeJoiner (
const NetCommAge & age,
bool muteSfx,
FNCAgeJoinerCallback callback,
void * userState
) : nextOp(kNoOp)
, age(age)
, muteLinkSfx(muteSfx)
, callback(callback)
, userState(userState)
, complete(false)
@ -354,7 +360,7 @@ void plNCAgeJoiner::ExecNextOp () {
nc->SetFlagsBit(plNetClientApp::kPlayingGame);
nc->SetFlagsBit(plNetClientApp::kNeedToSendInitialAgeStateLoadedMsg);
plAgeLoader::GetInstance()->NotifyAgeLoaded(true);
Complete(true, "Age joined");
nextOp = kNoOp;
}
break;
@ -448,6 +454,36 @@ bool plNCAgeJoiner::MsgReceive (plMessage * msg) {
nextOp = kDestroyProgressBar;
return true;
}
//========================================================================
// Done loading all states. Time to link in!
//========================================================================
plInitialAgeStateLoadedMsg * stateMsg = plInitialAgeStateLoadedMsg::ConvertNoRef(msg);
if(stateMsg) {
plNetObjectDebugger::GetInstance()->LogMsg("OnServerInitComplete");
nc->SetFlagsBit(plNetClientApp::kLoadingInitialAgeState, false);
const plArmatureMod *avMod = plAvatarMgr::GetInstance()->GetLocalAvatar();
plLinkEffectsTriggerMsg* lem = new plLinkEffectsTriggerMsg();
lem->SetLeavingAge(false); // linking in
lem->SetLinkKey(nc->GetLocalPlayerKey());
plKey animKey = avMod->GetLinkInAnimKey();
lem->SetLinkInAnimKey(animKey);
// indicate if we are invisible
if (avMod && avMod->IsInStealthMode() && avMod->GetTarget(0))
lem->SetInvisLevel(avMod->GetStealthLevel());
lem->SetBCastFlag(plMessage::kNetPropagate);
lem->MuteLinkSfx(muteLinkSfx);
lem->AddReceiver(hsgResMgr::ResMgr()->FindKey(plUoid(kLinkEffectsMgr_KEY)));
lem->AddReceiver(hsgResMgr::ResMgr()->FindKey(plUoid(kClient_KEY)));
lem->Send();
Complete(true, "Age joined");
return true;
}
return false;
}
@ -469,6 +505,7 @@ void plNCAgeJoiner::Update () {
void NCAgeJoinerCreate (
plNCAgeJoiner ** pjoiner,
const NetCommAge & age,
bool muteSfx,
FNCAgeJoinerCallback callback,
void * userState
) {
@ -478,6 +515,7 @@ void NCAgeJoinerCreate (
plNCAgeJoiner * joiner;
*pjoiner = joiner = new plNCAgeJoiner(
age,
muteSfx,
callback,
userState
);