Browse Source

Limit the scope of callback suppression.

Per testing on Minkata, suppressing callbacks during all vault downloads
has a deleterious effect on imagers. While my high level assumption is
correct, vault downloads can encompass situations where we want
notifications (eg re-downloading imager inbox folders, new age info
vault fragments). Whoops!
tickets/15/15/1
Adam Johnson 3 years ago
parent
commit
d007fac536
Signed by: Hoikas
GPG Key ID: 0B6515D6FF6F271E
  1. 2
      Sources/Plasma/PubUtilLib/plNetClient/plNetCliAgeJoiner.cpp
  2. 4
      Sources/Plasma/PubUtilLib/plNetClientComm/plNetClientComm.cpp
  3. 50
      Sources/Plasma/PubUtilLib/plVault/plVaultClientApi.cpp
  4. 8
      Sources/Plasma/PubUtilLib/plVault/plVaultClientApi.h

2
Sources/Plasma/PubUtilLib/plNetClient/plNetCliAgeJoiner.cpp

@ -385,7 +385,7 @@ bool plNCAgeJoiner::MsgReceive (plMessage * msg) {
} }
else if (unsigned ageVaultId = NetCommGetAge()->ageVaultId) { else if (unsigned ageVaultId = NetCommGetAge()->ageVaultId) {
// Download the age vault // Download the age vault
VaultDownload( VaultDownloadNoCallbacks(
L"AgeJoin", L"AgeJoin",
ageVaultId, ageVaultId,
AgeVaultDownloadCallback, AgeVaultDownloadCallback,

4
Sources/Plasma/PubUtilLib/plNetClientComm/plNetClientComm.cpp

@ -318,7 +318,7 @@ static void INetCliAuthSetPlayerRequestCallback (
else { else {
s_needAvatarLoad = true; s_needAvatarLoad = true;
VaultDownload( VaultDownloadNoCallbacks(
L"SetActivePlayer", L"SetActivePlayer",
s_player->playerInt, s_player->playerInt,
PlayerInitCallback, PlayerInitCallback,
@ -374,7 +374,7 @@ static void INetCliAuthLoginSetPlayerRequestCallback (
msg->Send(); msg->Send();
} }
else { else {
VaultDownload( VaultDownloadNoCallbacks(
L"SetActivePlayer", L"SetActivePlayer",
s_player->playerInt, s_player->playerInt,
LoginPlayerInitCallback, LoginPlayerInitCallback,

50
Sources/Plasma/PubUtilLib/plVault/plVaultClientApi.cpp

@ -185,7 +185,6 @@ struct VaultDownloadTrans {
: callback(), cbParam(), progressCallback(), cbProgressParam(), : callback(), cbParam(), progressCallback(), cbProgressParam(),
nodeCount(), nodesLeft(), vaultId(), result(kNetSuccess) nodeCount(), nodesLeft(), vaultId(), result(kNetSuccess)
{ {
VaultSuppressCallbacks();
} }
VaultDownloadTrans(const wchar_t* _tag, FVaultDownloadCallback _callback, VaultDownloadTrans(const wchar_t* _tag, FVaultDownloadCallback _callback,
@ -195,14 +194,10 @@ struct VaultDownloadTrans {
cbProgressParam(_cbProgressParam), nodeCount(), nodesLeft(), cbProgressParam(_cbProgressParam), nodeCount(), nodesLeft(),
vaultId(_vaultId), result(kNetSuccess) vaultId(_vaultId), result(kNetSuccess)
{ {
StrCopy(tag, _tag, MAX_PATH); StrCopy(tag, _tag, arrsize(tag));
VaultSuppressCallbacks();
} }
~VaultDownloadTrans() virtual ~VaultDownloadTrans() { }
{
VaultEnableCallbacks();
}
static void VaultNodeFetched ( static void VaultNodeFetched (
ENetError result, ENetError result,
@ -217,6 +212,28 @@ struct VaultDownloadTrans {
); );
}; };
struct VaultDownloadNoCallbacksTrans : VaultDownloadTrans {
VaultDownloadNoCallbacksTrans()
: VaultDownloadTrans()
{
VaultSuppressCallbacks();
}
VaultDownloadNoCallbacksTrans(const wchar_t* _tag, FVaultDownloadCallback _callback,
void* _cbParam, FVaultProgressCallback _progressCallback,
void* _cbProgressParam, unsigned _vaultId)
: VaultDownloadTrans(_tag, _callback, _cbParam, _progressCallback, _cbProgressParam, _vaultId)
{
VaultSuppressCallbacks();
}
~VaultDownloadNoCallbacksTrans()
{
VaultEnableCallbacks();
}
};
struct VaultAgeInitTrans { struct VaultAgeInitTrans {
FVaultInitAgeCallback callback; FVaultInitAgeCallback callback;
void * cbState; void * cbState;
@ -4995,6 +5012,25 @@ void VaultDownload (
); );
} }
//============================================================================
void VaultDownloadNoCallbacks (
const wchar tag[],
unsigned vaultId,
FVaultDownloadCallback callback,
void* cbParam,
FVaultProgressCallback progressCallback,
void* cbProgressParam
) {
VaultDownloadNoCallbacksTrans* trans = new VaultDownloadNoCallbacksTrans(tag, callback,
cbParam, progressCallback, cbProgressParam, vaultId);
NetCliAuthVaultFetchNodeRefs(
vaultId,
VaultDownloadTrans::VaultNodeRefsFetched,
trans
);
}
//============================================================================ //============================================================================
struct _DownloadVaultParam { struct _DownloadVaultParam {
ENetError result; ENetError result;

8
Sources/Plasma/PubUtilLib/plVault/plVaultClientApi.h

@ -488,6 +488,14 @@ void VaultDownload (
FVaultProgressCallback progressCallback, FVaultProgressCallback progressCallback,
void * cbProgressParam void * cbProgressParam
); );
void VaultDownloadNoCallbacks(
const wchar tag[],
unsigned vaultId,
FVaultDownloadCallback callback,
void* cbParam,
FVaultProgressCallback progressCallback,
void* cbProgressParam
);
void VaultDownloadAndWait ( void VaultDownloadAndWait (
const wchar tag[], const wchar tag[],
unsigned vaultId, unsigned vaultId,

Loading…
Cancel
Save