|
|
@ -95,9 +95,9 @@ struct RelVaultNodeLink : THashKeyVal<unsigned> { |
|
|
|
|
|
|
|
|
|
|
|
RelVaultNodeLink (bool seen, unsigned ownerId, unsigned nodeId, RelVaultNode * node) |
|
|
|
RelVaultNodeLink (bool seen, unsigned ownerId, unsigned nodeId, RelVaultNode * node) |
|
|
|
: THashKeyVal<unsigned>(nodeId) |
|
|
|
: THashKeyVal<unsigned>(nodeId) |
|
|
|
, seen(seen) |
|
|
|
|
|
|
|
, ownerId(ownerId) |
|
|
|
|
|
|
|
, node(node) |
|
|
|
, node(node) |
|
|
|
|
|
|
|
, ownerId(ownerId) |
|
|
|
|
|
|
|
, seen(seen) |
|
|
|
{ |
|
|
|
{ |
|
|
|
node->IncRef(); |
|
|
|
node->IncRef(); |
|
|
|
} |
|
|
|
} |
|
|
@ -141,6 +141,14 @@ struct VaultCreateNodeTrans { |
|
|
|
unsigned nodeId; |
|
|
|
unsigned nodeId; |
|
|
|
RelVaultNode * node; |
|
|
|
RelVaultNode * node; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
VaultCreateNodeTrans () |
|
|
|
|
|
|
|
: callback(nil), state(nil), param(nil), nodeId(0), node(nil) { } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
VaultCreateNodeTrans (FVaultCreateNodeCallback _callback, |
|
|
|
|
|
|
|
void * _state, void * _param) |
|
|
|
|
|
|
|
: callback(_callback), state(_state), param(_param), |
|
|
|
|
|
|
|
nodeId(0), node(nil) { } |
|
|
|
|
|
|
|
|
|
|
|
static void VaultNodeCreated ( |
|
|
|
static void VaultNodeCreated ( |
|
|
|
ENetError result, |
|
|
|
ENetError result, |
|
|
|
void * param, |
|
|
|
void * param, |
|
|
@ -160,6 +168,11 @@ struct VaultFindNodeTrans { |
|
|
|
FVaultFindNodeCallback callback; |
|
|
|
FVaultFindNodeCallback callback; |
|
|
|
void * param; |
|
|
|
void * param; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
VaultFindNodeTrans () : callback(nil), param(nil) { } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
VaultFindNodeTrans (FVaultFindNodeCallback _callback, void * _param) |
|
|
|
|
|
|
|
: callback(_callback), param(_param) { } |
|
|
|
|
|
|
|
|
|
|
|
static void VaultNodeFound ( |
|
|
|
static void VaultNodeFound ( |
|
|
|
ENetError result, |
|
|
|
ENetError result, |
|
|
|
void * param, |
|
|
|
void * param, |
|
|
@ -181,7 +194,24 @@ struct VaultDownloadTrans { |
|
|
|
unsigned vaultId; |
|
|
|
unsigned vaultId; |
|
|
|
ENetError result; |
|
|
|
ENetError result; |
|
|
|
|
|
|
|
|
|
|
|
VaultDownloadTrans (); |
|
|
|
VaultDownloadTrans () |
|
|
|
|
|
|
|
: callback(nil), cbParam(nil), progressCallback(nil), cbProgressParam(nil), |
|
|
|
|
|
|
|
nodeCount(0), nodesLeft(0), vaultId(0), result(kNetSuccess) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
memset(tag, 0, sizeof(tag)); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
VaultDownloadTrans (const wchar_t * _tag, FVaultDownloadCallback _callback, |
|
|
|
|
|
|
|
void * _cbParam, FVaultProgressCallback _progressCallback, |
|
|
|
|
|
|
|
void * _cbProgressParam, unsigned _vaultId) |
|
|
|
|
|
|
|
: callback(_callback), cbParam(_cbParam), progressCallback(_progressCallback), |
|
|
|
|
|
|
|
cbProgressParam(_cbProgressParam), nodeCount(0), nodesLeft(0), |
|
|
|
|
|
|
|
vaultId(_vaultId), result(kNetSuccess) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
wcsncpy(tag, _tag, arrsize(tag)); |
|
|
|
|
|
|
|
tag[arrsize(tag)-1] = 0; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static void VaultNodeFetched ( |
|
|
|
static void VaultNodeFetched ( |
|
|
|
ENetError result, |
|
|
|
ENetError result, |
|
|
@ -201,6 +231,13 @@ struct VaultAgeInitTrans { |
|
|
|
void * cbState; |
|
|
|
void * cbState; |
|
|
|
void * cbParam; |
|
|
|
void * cbParam; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
VaultAgeInitTrans() |
|
|
|
|
|
|
|
: callback(nil), cbState(nil), cbParam(nil) { } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
VaultAgeInitTrans(FVaultInitAgeCallback _callback, |
|
|
|
|
|
|
|
void * state, void * param) |
|
|
|
|
|
|
|
: callback(_callback), cbState(state), cbParam(param) { } |
|
|
|
|
|
|
|
|
|
|
|
static void AgeInitCallback ( |
|
|
|
static void AgeInitCallback ( |
|
|
|
ENetError result, |
|
|
|
ENetError result, |
|
|
|
void * param, |
|
|
|
void * param, |
|
|
@ -215,6 +252,12 @@ struct AddChildNodeFetchTrans { |
|
|
|
ENetError result; |
|
|
|
ENetError result; |
|
|
|
long opCount; |
|
|
|
long opCount; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
AddChildNodeFetchTrans() |
|
|
|
|
|
|
|
: callback(nil), cbParam(nil), result(kNetSuccess), opCount(0) { } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
AddChildNodeFetchTrans(FVaultAddChildNodeCallback _callback, void * _param) |
|
|
|
|
|
|
|
: callback(_callback), cbParam(_param), result(kNetSuccess), opCount(0) { } |
|
|
|
|
|
|
|
|
|
|
|
static void VaultNodeFetched ( |
|
|
|
static void VaultNodeFetched ( |
|
|
|
ENetError result, |
|
|
|
ENetError result, |
|
|
|
void * param, |
|
|
|
void * param, |
|
|
@ -338,7 +381,7 @@ static void BuildNodeTree ( |
|
|
|
RelVaultNodeLink * parentLink = s_nodes.Find(refs[i].parentId); |
|
|
|
RelVaultNodeLink * parentLink = s_nodes.Find(refs[i].parentId); |
|
|
|
if (!parentLink) { |
|
|
|
if (!parentLink) { |
|
|
|
newNodeIds->Add(refs[i].parentId); |
|
|
|
newNodeIds->Add(refs[i].parentId); |
|
|
|
parentLink = NEWZERO(RelVaultNodeLink)(false, 0, refs[i].parentId, NEWZERO(RelVaultNode)); |
|
|
|
parentLink = new RelVaultNodeLink(false, 0, refs[i].parentId, new RelVaultNode); |
|
|
|
parentLink->node->nodeId = refs[i].parentId; // set directly so that the field's dirty flag isn't set
|
|
|
|
parentLink->node->nodeId = refs[i].parentId; // set directly so that the field's dirty flag isn't set
|
|
|
|
s_nodes.Add(parentLink); |
|
|
|
s_nodes.Add(parentLink); |
|
|
|
} |
|
|
|
} |
|
|
@ -348,7 +391,7 @@ static void BuildNodeTree ( |
|
|
|
RelVaultNodeLink * childLink = s_nodes.Find(refs[i].childId); |
|
|
|
RelVaultNodeLink * childLink = s_nodes.Find(refs[i].childId); |
|
|
|
if (!childLink) { |
|
|
|
if (!childLink) { |
|
|
|
newNodeIds->Add(refs[i].childId); |
|
|
|
newNodeIds->Add(refs[i].childId); |
|
|
|
childLink = NEWZERO(RelVaultNodeLink)(refs[i].seen, refs[i].ownerId, refs[i].childId, NEWZERO(RelVaultNode)); |
|
|
|
childLink = new RelVaultNodeLink(refs[i].seen, refs[i].ownerId, refs[i].childId, new RelVaultNode); |
|
|
|
childLink->node->nodeId = refs[i].childId; // set directly so that the field's dirty flag isn't set
|
|
|
|
childLink->node->nodeId = refs[i].childId; // set directly so that the field's dirty flag isn't set
|
|
|
|
s_nodes.Add(childLink); |
|
|
|
s_nodes.Add(childLink); |
|
|
|
} |
|
|
|
} |
|
|
@ -366,14 +409,14 @@ static void BuildNodeTree ( |
|
|
|
|
|
|
|
|
|
|
|
if (!isImmediateParent) { |
|
|
|
if (!isImmediateParent) { |
|
|
|
// Add parent to child's parents table
|
|
|
|
// Add parent to child's parents table
|
|
|
|
parentLink = NEWZERO(RelVaultNodeLink)(false, 0, parentNode->nodeId, parentNode); |
|
|
|
parentLink = new RelVaultNodeLink(false, 0, parentNode->nodeId, parentNode); |
|
|
|
childNode->state->parents.Add(parentLink); |
|
|
|
childNode->state->parents.Add(parentLink); |
|
|
|
LogMsg(kLogDebug, L"Added relationship: p:%u,c:%u", refs[i].parentId, refs[i].childId); |
|
|
|
LogMsg(kLogDebug, L"Added relationship: p:%u,c:%u", refs[i].parentId, refs[i].childId); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (!isImmediateChild) { |
|
|
|
if (!isImmediateChild) { |
|
|
|
// Add child to parent's children table
|
|
|
|
// Add child to parent's children table
|
|
|
|
childLink = NEWZERO(RelVaultNodeLink)(refs[i].seen, refs[i].ownerId, childNode->nodeId, childNode); |
|
|
|
childLink = new RelVaultNodeLink(refs[i].seen, refs[i].ownerId, childNode->nodeId, childNode); |
|
|
|
parentNode->state->children.Add(childLink); |
|
|
|
parentNode->state->children.Add(childLink); |
|
|
|
|
|
|
|
|
|
|
|
if (notifyNow || childNode->nodeType != 0) { |
|
|
|
if (notifyNow || childNode->nodeType != 0) { |
|
|
@ -382,7 +425,7 @@ static void BuildNodeTree ( |
|
|
|
cb->cb->AddedChildNode(parentNode, childNode); |
|
|
|
cb->cb->AddedChildNode(parentNode, childNode); |
|
|
|
} |
|
|
|
} |
|
|
|
else { |
|
|
|
else { |
|
|
|
INotifyAfterDownload* notify = NEWZERO(INotifyAfterDownload)(parentNode->nodeId, childNode->nodeId); |
|
|
|
INotifyAfterDownload* notify = new INotifyAfterDownload(parentNode->nodeId, childNode->nodeId); |
|
|
|
s_notifyAfterDownload.Add(notify); |
|
|
|
s_notifyAfterDownload.Add(notify); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -413,7 +456,7 @@ static void FetchRefOwners ( |
|
|
|
ownerIds.Add(ownerId); |
|
|
|
ownerIds.Add(ownerId); |
|
|
|
} |
|
|
|
} |
|
|
|
QSORT(unsigned, ownerIds.Ptr(), ownerIds.Count(), elem1 < elem2); |
|
|
|
QSORT(unsigned, ownerIds.Ptr(), ownerIds.Count(), elem1 < elem2); |
|
|
|
RelVaultNode * templateNode = NEWZERO(RelVaultNode); |
|
|
|
RelVaultNode * templateNode = new RelVaultNode; |
|
|
|
templateNode->IncRef(); |
|
|
|
templateNode->IncRef(); |
|
|
|
templateNode->SetNodeType(plVault::kNodeType_PlayerInfo); |
|
|
|
templateNode->SetNodeType(plVault::kNodeType_PlayerInfo); |
|
|
|
{ unsigned prevId = 0; |
|
|
|
{ unsigned prevId = 0; |
|
|
@ -518,7 +561,7 @@ static void VaultNodeFetched ( |
|
|
|
// Add to global node table
|
|
|
|
// Add to global node table
|
|
|
|
RelVaultNodeLink * link = s_nodes.Find(node->nodeId); |
|
|
|
RelVaultNodeLink * link = s_nodes.Find(node->nodeId); |
|
|
|
if (!link) { |
|
|
|
if (!link) { |
|
|
|
link = NEWZERO(RelVaultNodeLink)(false, 0, node->nodeId, NEWZERO(RelVaultNode)); |
|
|
|
link = new RelVaultNodeLink(false, 0, node->nodeId, new RelVaultNode); |
|
|
|
link->node->nodeId = node->nodeId; // set directly so that the field's dirty flag isn't set
|
|
|
|
link->node->nodeId = node->nodeId; // set directly so that the field's dirty flag isn't set
|
|
|
|
s_nodes.Add(link); |
|
|
|
s_nodes.Add(link); |
|
|
|
} |
|
|
|
} |
|
|
@ -609,7 +652,7 @@ static void VaultNodeAdded ( |
|
|
|
// Fetch the nodes that do not yet have a nodetype
|
|
|
|
// Fetch the nodes that do not yet have a nodetype
|
|
|
|
unsigned prevId = 0; |
|
|
|
unsigned prevId = 0; |
|
|
|
unsigned i = 0; |
|
|
|
unsigned i = 0; |
|
|
|
{for (; i < nodeIds.Count(); ++i) { |
|
|
|
for (; i < nodeIds.Count(); ++i) { |
|
|
|
RelVaultNodeLink * link = s_nodes.Find(nodeIds[i]); |
|
|
|
RelVaultNodeLink * link = s_nodes.Find(nodeIds[i]); |
|
|
|
if (link->node->nodeType != 0) |
|
|
|
if (link->node->nodeType != 0) |
|
|
|
continue; |
|
|
|
continue; |
|
|
@ -625,7 +668,7 @@ static void VaultNodeAdded ( |
|
|
|
nil, |
|
|
|
nil, |
|
|
|
nil |
|
|
|
nil |
|
|
|
); |
|
|
|
); |
|
|
|
}} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (parentId == inboxId) { |
|
|
|
if (parentId == inboxId) { |
|
|
|
if (i > 0) |
|
|
|
if (i > 0) |
|
|
@ -831,11 +874,6 @@ void VaultFindNodeTrans::VaultNodeFound ( |
|
|
|
* |
|
|
|
* |
|
|
|
***/ |
|
|
|
***/ |
|
|
|
|
|
|
|
|
|
|
|
//============================================================================
|
|
|
|
|
|
|
|
VaultDownloadTrans::VaultDownloadTrans () { |
|
|
|
|
|
|
|
ASSERT(!nodeCount); // must be alloced with
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//============================================================================
|
|
|
|
//============================================================================
|
|
|
|
void VaultDownloadTrans::VaultNodeFetched ( |
|
|
|
void VaultDownloadTrans::VaultNodeFetched ( |
|
|
|
ENetError result, |
|
|
|
ENetError result, |
|
|
@ -1091,7 +1129,7 @@ void IRelVaultNode::Unlink (RelVaultNode * other) { |
|
|
|
|
|
|
|
|
|
|
|
//============================================================================
|
|
|
|
//============================================================================
|
|
|
|
RelVaultNode::RelVaultNode () { |
|
|
|
RelVaultNode::RelVaultNode () { |
|
|
|
state = NEWZERO(IRelVaultNode)(this); |
|
|
|
state = new IRelVaultNode(this); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//============================================================================
|
|
|
|
//============================================================================
|
|
|
@ -1233,7 +1271,7 @@ RelVaultNode * RelVaultNode::GetChildNodeIncRef ( |
|
|
|
unsigned nodeType, |
|
|
|
unsigned nodeType, |
|
|
|
unsigned maxDepth |
|
|
|
unsigned maxDepth |
|
|
|
) { |
|
|
|
) { |
|
|
|
NetVaultNode * templateNode = NEWZERO(NetVaultNode); |
|
|
|
NetVaultNode * templateNode = new NetVaultNode; |
|
|
|
templateNode->IncRef(); |
|
|
|
templateNode->IncRef(); |
|
|
|
templateNode->SetNodeType(nodeType); |
|
|
|
templateNode->SetNodeType(nodeType); |
|
|
|
RelVaultNode * result = GetChildNodeIncRef(templateNode, maxDepth); |
|
|
|
RelVaultNode * result = GetChildNodeIncRef(templateNode, maxDepth); |
|
|
@ -1246,7 +1284,7 @@ RelVaultNode * RelVaultNode::GetChildFolderNodeIncRef ( |
|
|
|
unsigned folderType, |
|
|
|
unsigned folderType, |
|
|
|
unsigned maxDepth |
|
|
|
unsigned maxDepth |
|
|
|
) { |
|
|
|
) { |
|
|
|
NetVaultNode * templateNode = NEWZERO(NetVaultNode); |
|
|
|
NetVaultNode * templateNode = new NetVaultNode; |
|
|
|
templateNode->IncRef(); |
|
|
|
templateNode->IncRef(); |
|
|
|
templateNode->SetNodeType(plVault::kNodeType_Folder); |
|
|
|
templateNode->SetNodeType(plVault::kNodeType_Folder); |
|
|
|
VaultFolderNode folder(templateNode); |
|
|
|
VaultFolderNode folder(templateNode); |
|
|
@ -1261,7 +1299,7 @@ RelVaultNode * RelVaultNode::GetChildPlayerInfoListNodeIncRef ( |
|
|
|
unsigned folderType, |
|
|
|
unsigned folderType, |
|
|
|
unsigned maxDepth |
|
|
|
unsigned maxDepth |
|
|
|
) { |
|
|
|
) { |
|
|
|
NetVaultNode * templateNode = NEWZERO(NetVaultNode); |
|
|
|
NetVaultNode * templateNode = new NetVaultNode; |
|
|
|
templateNode->IncRef(); |
|
|
|
templateNode->IncRef(); |
|
|
|
templateNode->SetNodeType(plVault::kNodeType_PlayerInfoList); |
|
|
|
templateNode->SetNodeType(plVault::kNodeType_PlayerInfoList); |
|
|
|
VaultPlayerInfoListNode access(templateNode); |
|
|
|
VaultPlayerInfoListNode access(templateNode); |
|
|
@ -1276,7 +1314,7 @@ RelVaultNode * RelVaultNode::GetChildAgeInfoListNodeIncRef ( |
|
|
|
unsigned folderType, |
|
|
|
unsigned folderType, |
|
|
|
unsigned maxDepth |
|
|
|
unsigned maxDepth |
|
|
|
) { |
|
|
|
) { |
|
|
|
NetVaultNode * templateNode = NEWZERO(NetVaultNode); |
|
|
|
NetVaultNode * templateNode = new NetVaultNode; |
|
|
|
templateNode->IncRef(); |
|
|
|
templateNode->IncRef(); |
|
|
|
templateNode->SetNodeType(plVault::kNodeType_AgeInfoList); |
|
|
|
templateNode->SetNodeType(plVault::kNodeType_AgeInfoList); |
|
|
|
VaultAgeInfoListNode access(templateNode); |
|
|
|
VaultAgeInfoListNode access(templateNode); |
|
|
@ -1333,7 +1371,7 @@ void RelVaultNode::GetChildNodesIncRef ( |
|
|
|
unsigned maxDepth, |
|
|
|
unsigned maxDepth, |
|
|
|
ARRAY(RelVaultNode*) * nodes |
|
|
|
ARRAY(RelVaultNode*) * nodes |
|
|
|
) { |
|
|
|
) { |
|
|
|
NetVaultNode * templateNode = NEWZERO(NetVaultNode); |
|
|
|
NetVaultNode * templateNode = new NetVaultNode; |
|
|
|
templateNode->IncRef(); |
|
|
|
templateNode->IncRef(); |
|
|
|
templateNode->SetNodeType(nodeType); |
|
|
|
templateNode->SetNodeType(nodeType); |
|
|
|
GetChildNodesIncRef( |
|
|
|
GetChildNodesIncRef( |
|
|
@ -1350,7 +1388,7 @@ void RelVaultNode::GetChildFolderNodesIncRef ( |
|
|
|
unsigned maxDepth, |
|
|
|
unsigned maxDepth, |
|
|
|
ARRAY(RelVaultNode*) * nodes |
|
|
|
ARRAY(RelVaultNode*) * nodes |
|
|
|
) { |
|
|
|
) { |
|
|
|
NetVaultNode * templateNode = NEWZERO(NetVaultNode); |
|
|
|
NetVaultNode * templateNode = new NetVaultNode; |
|
|
|
templateNode->IncRef(); |
|
|
|
templateNode->IncRef(); |
|
|
|
templateNode->SetNodeType(plVault::kNodeType_Folder); |
|
|
|
templateNode->SetNodeType(plVault::kNodeType_Folder); |
|
|
|
VaultFolderNode fldr(templateNode); |
|
|
|
VaultFolderNode fldr(templateNode); |
|
|
@ -1442,7 +1480,7 @@ RelVaultNode * RelVaultNode::GetParentAgeLinkIncRef () { |
|
|
|
|
|
|
|
|
|
|
|
RelVaultNode * result = nil; |
|
|
|
RelVaultNode * result = nil; |
|
|
|
|
|
|
|
|
|
|
|
NetVaultNode * templateNode = NEWZERO(NetVaultNode); |
|
|
|
NetVaultNode * templateNode = new NetVaultNode; |
|
|
|
templateNode->IncRef(); |
|
|
|
templateNode->IncRef(); |
|
|
|
templateNode->SetNodeType(plVault::kNodeType_AgeLink); |
|
|
|
templateNode->SetNodeType(plVault::kNodeType_AgeLink); |
|
|
|
|
|
|
|
|
|
|
@ -1606,7 +1644,7 @@ void VaultAddChildNode ( |
|
|
|
if (RelVaultNodeLink * parentLink = s_nodes.Find(parentId)) { |
|
|
|
if (RelVaultNodeLink * parentLink = s_nodes.Find(parentId)) { |
|
|
|
RelVaultNodeLink * childLink = s_nodes.Find(childId); |
|
|
|
RelVaultNodeLink * childLink = s_nodes.Find(childId); |
|
|
|
if (!childLink) { |
|
|
|
if (!childLink) { |
|
|
|
childLink = NEWZERO(RelVaultNodeLink)(false, ownerId, childId, NEWZERO(RelVaultNode)); |
|
|
|
childLink = new RelVaultNodeLink(false, ownerId, childId, new RelVaultNode); |
|
|
|
childLink->node->nodeId = childId; // set directly so that the field's dirty flag isn't set
|
|
|
|
childLink->node->nodeId = childId; // set directly so that the field's dirty flag isn't set
|
|
|
|
s_nodes.Add(childLink); |
|
|
|
s_nodes.Add(childLink); |
|
|
|
} |
|
|
|
} |
|
|
@ -1644,9 +1682,7 @@ void VaultAddChildNode ( |
|
|
|
|
|
|
|
|
|
|
|
if (!childLink->node->nodeType || !parentLink->node->nodeType) { |
|
|
|
if (!childLink->node->nodeType || !parentLink->node->nodeType) { |
|
|
|
// One or more nodes need to be fetched before the callback is made
|
|
|
|
// One or more nodes need to be fetched before the callback is made
|
|
|
|
AddChildNodeFetchTrans * trans = NEWZERO(AddChildNodeFetchTrans); |
|
|
|
AddChildNodeFetchTrans * trans = new AddChildNodeFetchTrans(callback, param); |
|
|
|
trans->callback = callback; |
|
|
|
|
|
|
|
trans->cbParam = param; |
|
|
|
|
|
|
|
if (!childLink->node->nodeType) { |
|
|
|
if (!childLink->node->nodeType) { |
|
|
|
AtomicAdd(&trans->opCount, 1); |
|
|
|
AtomicAdd(&trans->opCount, 1); |
|
|
|
NetCliAuthVaultNodeFetch( |
|
|
|
NetCliAuthVaultNodeFetch( |
|
|
@ -1845,10 +1881,7 @@ void VaultCreateNode ( |
|
|
|
void * state, |
|
|
|
void * state, |
|
|
|
void * param |
|
|
|
void * param |
|
|
|
) { |
|
|
|
) { |
|
|
|
VaultCreateNodeTrans * trans = NEWZERO(VaultCreateNodeTrans); |
|
|
|
VaultCreateNodeTrans * trans = new VaultCreateNodeTrans(callback, state, param); |
|
|
|
trans->callback = callback; |
|
|
|
|
|
|
|
trans->state = state; |
|
|
|
|
|
|
|
trans->param = param; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (RelVaultNode * age = VaultGetAgeNodeIncRef()) { |
|
|
|
if (RelVaultNode * age = VaultGetAgeNodeIncRef()) { |
|
|
|
VaultAgeNode access(age); |
|
|
|
VaultAgeNode access(age); |
|
|
@ -1873,7 +1906,7 @@ void VaultCreateNode ( |
|
|
|
void * state, |
|
|
|
void * state, |
|
|
|
void * param |
|
|
|
void * param |
|
|
|
) { |
|
|
|
) { |
|
|
|
RelVaultNode * templateNode = NEWZERO(RelVaultNode); |
|
|
|
RelVaultNode * templateNode = new RelVaultNode; |
|
|
|
templateNode->IncRef(); |
|
|
|
templateNode->IncRef(); |
|
|
|
templateNode->SetNodeType(nodeType); |
|
|
|
templateNode->SetNodeType(nodeType); |
|
|
|
|
|
|
|
|
|
|
@ -1943,7 +1976,7 @@ RelVaultNode * VaultCreateNodeAndWaitIncRef ( |
|
|
|
ENetError * result |
|
|
|
ENetError * result |
|
|
|
) { |
|
|
|
) { |
|
|
|
RelVaultNode * node; |
|
|
|
RelVaultNode * node; |
|
|
|
RelVaultNode * templateNode = NEWZERO(RelVaultNode); |
|
|
|
RelVaultNode * templateNode = new RelVaultNode; |
|
|
|
templateNode->IncRef(); |
|
|
|
templateNode->IncRef(); |
|
|
|
templateNode->SetNodeType(nodeType); |
|
|
|
templateNode->SetNodeType(nodeType); |
|
|
|
|
|
|
|
|
|
|
@ -1998,9 +2031,7 @@ void VaultFindNodes ( |
|
|
|
FVaultFindNodeCallback callback, |
|
|
|
FVaultFindNodeCallback callback, |
|
|
|
void * param |
|
|
|
void * param |
|
|
|
) { |
|
|
|
) { |
|
|
|
VaultFindNodeTrans * trans = NEWZERO(VaultFindNodeTrans); |
|
|
|
VaultFindNodeTrans * trans = new VaultFindNodeTrans(callback, param); |
|
|
|
trans->callback = callback; |
|
|
|
|
|
|
|
trans->param = param; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
NetCliAuthVaultNodeFind( |
|
|
|
NetCliAuthVaultNodeFind( |
|
|
|
templateNode, |
|
|
|
templateNode, |
|
|
@ -2120,10 +2151,7 @@ void VaultInitAge ( |
|
|
|
void * state, |
|
|
|
void * state, |
|
|
|
void * param |
|
|
|
void * param |
|
|
|
) { |
|
|
|
) { |
|
|
|
VaultAgeInitTrans * trans = NEWZERO(VaultAgeInitTrans); |
|
|
|
VaultAgeInitTrans * trans = new VaultAgeInitTrans(callback, state, param); |
|
|
|
trans->callback = callback; |
|
|
|
|
|
|
|
trans->cbState = state; |
|
|
|
|
|
|
|
trans->cbParam = param; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
wchar_t ageFilename[MAX_PATH]; |
|
|
|
wchar_t ageFilename[MAX_PATH]; |
|
|
|
wchar_t ageInstName[MAX_PATH]; |
|
|
|
wchar_t ageInstName[MAX_PATH]; |
|
|
@ -2157,7 +2185,7 @@ void VaultInitAge ( |
|
|
|
|
|
|
|
|
|
|
|
//============================================================================
|
|
|
|
//============================================================================
|
|
|
|
static RelVaultNode * GetPlayerNode () { |
|
|
|
static RelVaultNode * GetPlayerNode () { |
|
|
|
NetVaultNode * templateNode = NEWZERO(NetVaultNode); |
|
|
|
NetVaultNode * templateNode = new NetVaultNode; |
|
|
|
templateNode->IncRef(); |
|
|
|
templateNode->IncRef(); |
|
|
|
templateNode->SetNodeType(plVault::kNodeType_VNodeMgrPlayer); |
|
|
|
templateNode->SetNodeType(plVault::kNodeType_VNodeMgrPlayer); |
|
|
|
if (NetCommGetPlayer()) |
|
|
|
if (NetCommGetPlayer()) |
|
|
@ -2189,7 +2217,7 @@ RelVaultNode * VaultGetPlayerInfoNodeIncRef () { |
|
|
|
if (!rvnPlr) |
|
|
|
if (!rvnPlr) |
|
|
|
return nil; |
|
|
|
return nil; |
|
|
|
|
|
|
|
|
|
|
|
NetVaultNode * templateNode = NEWZERO(NetVaultNode); |
|
|
|
NetVaultNode * templateNode = new NetVaultNode; |
|
|
|
templateNode->IncRef(); |
|
|
|
templateNode->IncRef(); |
|
|
|
templateNode->SetNodeType(plVault::kNodeType_PlayerInfo); |
|
|
|
templateNode->SetNodeType(plVault::kNodeType_PlayerInfo); |
|
|
|
VaultPlayerInfoNode plrInfo(templateNode); |
|
|
|
VaultPlayerInfoNode plrInfo(templateNode); |
|
|
@ -2254,7 +2282,7 @@ bool VaultGetLinkToMyNeighborhood (plAgeLinkStruct * link) { |
|
|
|
if (!rvnFldr) |
|
|
|
if (!rvnFldr) |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
|
|
|
|
|
|
|
|
NetVaultNode * templateNode = NEWZERO(NetVaultNode); |
|
|
|
NetVaultNode * templateNode = new NetVaultNode; |
|
|
|
templateNode->IncRef(); |
|
|
|
templateNode->IncRef(); |
|
|
|
|
|
|
|
|
|
|
|
templateNode->SetNodeType(plVault::kNodeType_AgeInfo); |
|
|
|
templateNode->SetNodeType(plVault::kNodeType_AgeInfo); |
|
|
@ -2281,7 +2309,7 @@ bool VaultGetLinkToMyPersonalAge (plAgeLinkStruct * link) { |
|
|
|
if (!rvnFldr) |
|
|
|
if (!rvnFldr) |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
|
|
|
|
|
|
|
|
NetVaultNode * templateNode = NEWZERO(NetVaultNode); |
|
|
|
NetVaultNode * templateNode = new NetVaultNode; |
|
|
|
templateNode->IncRef(); |
|
|
|
templateNode->IncRef(); |
|
|
|
|
|
|
|
|
|
|
|
templateNode->SetNodeType(plVault::kNodeType_AgeInfo); |
|
|
|
templateNode->SetNodeType(plVault::kNodeType_AgeInfo); |
|
|
@ -2308,7 +2336,7 @@ bool VaultGetLinkToCity (plAgeLinkStruct * link) { |
|
|
|
if (!rvnFldr) |
|
|
|
if (!rvnFldr) |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
|
|
|
|
|
|
|
|
NetVaultNode * templateNode = NEWZERO(NetVaultNode); |
|
|
|
NetVaultNode * templateNode = new NetVaultNode; |
|
|
|
templateNode->IncRef(); |
|
|
|
templateNode->IncRef(); |
|
|
|
templateNode->SetNodeType(plVault::kNodeType_AgeInfo); |
|
|
|
templateNode->SetNodeType(plVault::kNodeType_AgeInfo); |
|
|
|
|
|
|
|
|
|
|
@ -2336,7 +2364,7 @@ RelVaultNode * VaultGetOwnedAgeLinkIncRef (const plAgeInfoStruct * info) { |
|
|
|
|
|
|
|
|
|
|
|
if (RelVaultNode * rvnFldr = VaultGetAgesIOwnFolderIncRef()) { |
|
|
|
if (RelVaultNode * rvnFldr = VaultGetAgesIOwnFolderIncRef()) { |
|
|
|
|
|
|
|
|
|
|
|
NetVaultNode * templateNode = NEWZERO(NetVaultNode); |
|
|
|
NetVaultNode * templateNode = new NetVaultNode; |
|
|
|
templateNode->IncRef(); |
|
|
|
templateNode->IncRef(); |
|
|
|
templateNode->SetNodeType(plVault::kNodeType_AgeInfo); |
|
|
|
templateNode->SetNodeType(plVault::kNodeType_AgeInfo); |
|
|
|
|
|
|
|
|
|
|
@ -2371,7 +2399,7 @@ RelVaultNode * VaultGetOwnedAgeInfoIncRef (const plAgeInfoStruct * info) { |
|
|
|
|
|
|
|
|
|
|
|
if (RelVaultNode * rvnFldr = VaultGetAgesIOwnFolderIncRef()) { |
|
|
|
if (RelVaultNode * rvnFldr = VaultGetAgesIOwnFolderIncRef()) { |
|
|
|
|
|
|
|
|
|
|
|
NetVaultNode * templateNode = NEWZERO(NetVaultNode); |
|
|
|
NetVaultNode * templateNode = new NetVaultNode; |
|
|
|
templateNode->IncRef(); |
|
|
|
templateNode->IncRef(); |
|
|
|
templateNode->SetNodeType(plVault::kNodeType_AgeInfo); |
|
|
|
templateNode->SetNodeType(plVault::kNodeType_AgeInfo); |
|
|
|
|
|
|
|
|
|
|
@ -2436,7 +2464,7 @@ bool VaultAddOwnedAgeSpawnPoint (const plUUID& ageInstId, const plSpawnPointInfo |
|
|
|
ARRAY(unsigned) nodeIds; |
|
|
|
ARRAY(unsigned) nodeIds; |
|
|
|
fldr->GetChildNodeIds(&nodeIds, 1); |
|
|
|
fldr->GetChildNodeIds(&nodeIds, 1); |
|
|
|
|
|
|
|
|
|
|
|
NetVaultNode * templateNode = NEWZERO(NetVaultNode); |
|
|
|
NetVaultNode * templateNode = new NetVaultNode; |
|
|
|
templateNode->IncRef(); |
|
|
|
templateNode->IncRef(); |
|
|
|
templateNode->SetNodeType(plVault::kNodeType_AgeInfo); |
|
|
|
templateNode->SetNodeType(plVault::kNodeType_AgeInfo); |
|
|
|
VaultAgeInfoNode access(templateNode); |
|
|
|
VaultAgeInfoNode access(templateNode); |
|
|
@ -2478,7 +2506,7 @@ bool VaultSetOwnedAgePublicAndWait (const plAgeInfoStruct * info, bool publicOrN |
|
|
|
char ageName[MAX_PATH]; |
|
|
|
char ageName[MAX_PATH]; |
|
|
|
StrToAnsi(ageName, access.ageFilename, arrsize(ageName)); |
|
|
|
StrToAnsi(ageName, access.ageFilename, arrsize(ageName)); |
|
|
|
|
|
|
|
|
|
|
|
plVaultNotifyMsg * msg = NEWZERO(plVaultNotifyMsg); |
|
|
|
plVaultNotifyMsg * msg = new plVaultNotifyMsg; |
|
|
|
if (publicOrNot) |
|
|
|
if (publicOrNot) |
|
|
|
msg->SetType(plVaultNotifyMsg::kPublicAgeCreated); |
|
|
|
msg->SetType(plVaultNotifyMsg::kPublicAgeCreated); |
|
|
|
else |
|
|
|
else |
|
|
@ -2500,7 +2528,7 @@ RelVaultNode * VaultGetVisitAgeLinkIncRef (const plAgeInfoStruct * info) { |
|
|
|
|
|
|
|
|
|
|
|
if (RelVaultNode * rvnFldr = VaultGetAgesICanVisitFolderIncRef()) { |
|
|
|
if (RelVaultNode * rvnFldr = VaultGetAgesICanVisitFolderIncRef()) { |
|
|
|
|
|
|
|
|
|
|
|
NetVaultNode * templateNode = NEWZERO(NetVaultNode); |
|
|
|
NetVaultNode * templateNode = new NetVaultNode; |
|
|
|
templateNode->IncRef(); |
|
|
|
templateNode->IncRef(); |
|
|
|
templateNode->SetNodeType(plVault::kNodeType_AgeInfo); |
|
|
|
templateNode->SetNodeType(plVault::kNodeType_AgeInfo); |
|
|
|
|
|
|
|
|
|
|
@ -2789,7 +2817,7 @@ bool VaultRegisterOwnedAgeAndWait (const plAgeLinkStruct * link) { |
|
|
|
break; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
plVaultNotifyMsg * msg = NEWZERO(plVaultNotifyMsg); |
|
|
|
plVaultNotifyMsg * msg = new plVaultNotifyMsg; |
|
|
|
msg->SetType(plVaultNotifyMsg::kRegisteredOwnedAge); |
|
|
|
msg->SetType(plVaultNotifyMsg::kRegisteredOwnedAge); |
|
|
|
msg->SetResultCode(result); |
|
|
|
msg->SetResultCode(result); |
|
|
|
msg->GetArgs()->AddInt(plNetCommon::VaultTaskArgs::kAgeLinkNode, ageLinkId); |
|
|
|
msg->GetArgs()->AddInt(plNetCommon::VaultTaskArgs::kAgeLinkNode, ageLinkId); |
|
|
@ -2855,7 +2883,7 @@ namespace _VaultRegisterOwnedAge { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Fire off vault callbacks
|
|
|
|
// Fire off vault callbacks
|
|
|
|
plVaultNotifyMsg* msg = NEWZERO(plVaultNotifyMsg); |
|
|
|
plVaultNotifyMsg* msg = new plVaultNotifyMsg; |
|
|
|
msg->SetType(plVaultNotifyMsg::kRegisteredOwnedAge); |
|
|
|
msg->SetType(plVaultNotifyMsg::kRegisteredOwnedAge); |
|
|
|
msg->SetResultCode(result); |
|
|
|
msg->SetResultCode(result); |
|
|
|
msg->GetArgs()->AddInt(plNetCommon::VaultTaskArgs::kAgeLinkNode, node->nodeId); |
|
|
|
msg->GetArgs()->AddInt(plNetCommon::VaultTaskArgs::kAgeLinkNode, node->nodeId); |
|
|
@ -3162,7 +3190,7 @@ bool VaultRegisterVisitAgeAndWait (const plAgeLinkStruct * link) { |
|
|
|
break; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
plVaultNotifyMsg * msg = NEWZERO(plVaultNotifyMsg); |
|
|
|
plVaultNotifyMsg * msg = new plVaultNotifyMsg; |
|
|
|
msg->SetType(plVaultNotifyMsg::kRegisteredVisitAge); |
|
|
|
msg->SetType(plVaultNotifyMsg::kRegisteredVisitAge); |
|
|
|
msg->SetResultCode(result); |
|
|
|
msg->SetResultCode(result); |
|
|
|
msg->GetArgs()->AddInt(plNetCommon::VaultTaskArgs::kAgeLinkNode, ageLinkId); |
|
|
|
msg->GetArgs()->AddInt(plNetCommon::VaultTaskArgs::kAgeLinkNode, ageLinkId); |
|
|
@ -3214,7 +3242,7 @@ namespace _VaultRegisterVisitAge { |
|
|
|
access.AddSpawnPoint(*p->fSpawn); |
|
|
|
access.AddSpawnPoint(*p->fSpawn); |
|
|
|
|
|
|
|
|
|
|
|
// Send out the VaultNotify msg
|
|
|
|
// Send out the VaultNotify msg
|
|
|
|
plVaultNotifyMsg * msg = NEWZERO(plVaultNotifyMsg); |
|
|
|
plVaultNotifyMsg * msg = new plVaultNotifyMsg; |
|
|
|
msg->SetType(plVaultNotifyMsg::kRegisteredVisitAge); |
|
|
|
msg->SetType(plVaultNotifyMsg::kRegisteredVisitAge); |
|
|
|
msg->SetResultCode(true); |
|
|
|
msg->SetResultCode(true); |
|
|
|
msg->GetArgs()->AddInt(plNetCommon::VaultTaskArgs::kAgeLinkNode, node->nodeId); |
|
|
|
msg->GetArgs()->AddInt(plNetCommon::VaultTaskArgs::kAgeLinkNode, node->nodeId); |
|
|
@ -3333,7 +3361,7 @@ bool VaultUnregisterOwnedAgeAndWait (const plAgeInfoStruct * info) { |
|
|
|
break; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
plVaultNotifyMsg * msg = NEWZERO(plVaultNotifyMsg); |
|
|
|
plVaultNotifyMsg * msg = new plVaultNotifyMsg; |
|
|
|
msg->SetType(plVaultNotifyMsg::kUnRegisteredOwnedAge); |
|
|
|
msg->SetType(plVaultNotifyMsg::kUnRegisteredOwnedAge); |
|
|
|
msg->SetResultCode(result); |
|
|
|
msg->SetResultCode(result); |
|
|
|
msg->GetArgs()->AddInt(plNetCommon::VaultTaskArgs::kAgeLinkNode, ageLinkId); |
|
|
|
msg->GetArgs()->AddInt(plNetCommon::VaultTaskArgs::kAgeLinkNode, ageLinkId); |
|
|
@ -3397,7 +3425,7 @@ bool VaultUnregisterVisitAgeAndWait (const plAgeInfoStruct * info) { |
|
|
|
break; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
plVaultNotifyMsg * msg = NEWZERO(plVaultNotifyMsg); |
|
|
|
plVaultNotifyMsg * msg = new plVaultNotifyMsg; |
|
|
|
msg->SetType(plVaultNotifyMsg::kUnRegisteredVisitAge); |
|
|
|
msg->SetType(plVaultNotifyMsg::kUnRegisteredVisitAge); |
|
|
|
msg->SetResultCode(result); |
|
|
|
msg->SetResultCode(result); |
|
|
|
msg->GetArgs()->AddInt(plNetCommon::VaultTaskArgs::kAgeLinkNode, ageLinkId); |
|
|
|
msg->GetArgs()->AddInt(plNetCommon::VaultTaskArgs::kAgeLinkNode, ageLinkId); |
|
|
@ -3411,7 +3439,7 @@ RelVaultNode * VaultFindChronicleEntryIncRef (const wchar_t entryName[], int ent |
|
|
|
|
|
|
|
|
|
|
|
RelVaultNode * result = nil; |
|
|
|
RelVaultNode * result = nil; |
|
|
|
if (RelVaultNode * rvnFldr = GetChildFolderNode(GetPlayerNode(), plVault::kChronicleFolder, 1)) { |
|
|
|
if (RelVaultNode * rvnFldr = GetChildFolderNode(GetPlayerNode(), plVault::kChronicleFolder, 1)) { |
|
|
|
NetVaultNode * templateNode = NEWZERO(NetVaultNode); |
|
|
|
NetVaultNode * templateNode = new NetVaultNode; |
|
|
|
templateNode->IncRef(); |
|
|
|
templateNode->IncRef(); |
|
|
|
templateNode->SetNodeType(plVault::kNodeType_Chronicle); |
|
|
|
templateNode->SetNodeType(plVault::kNodeType_Chronicle); |
|
|
|
VaultChronicleNode chrn(templateNode); |
|
|
|
VaultChronicleNode chrn(templateNode); |
|
|
@ -3445,7 +3473,7 @@ void VaultAddChronicleEntryAndWait ( |
|
|
|
chrnNode.SetEntryValue(entryValue); |
|
|
|
chrnNode.SetEntryValue(entryValue); |
|
|
|
} |
|
|
|
} |
|
|
|
else if (RelVaultNode * rvnFldr = GetChildFolderNode(GetPlayerNode(), plVault::kChronicleFolder, 1)) { |
|
|
|
else if (RelVaultNode * rvnFldr = GetChildFolderNode(GetPlayerNode(), plVault::kChronicleFolder, 1)) { |
|
|
|
NetVaultNode * templateNode = NEWZERO(NetVaultNode); |
|
|
|
NetVaultNode * templateNode = new NetVaultNode; |
|
|
|
templateNode->IncRef(); |
|
|
|
templateNode->IncRef(); |
|
|
|
templateNode->SetNodeType(plVault::kNodeType_Chronicle); |
|
|
|
templateNode->SetNodeType(plVault::kNodeType_Chronicle); |
|
|
|
VaultChronicleNode chrnNode(templateNode); |
|
|
|
VaultChronicleNode chrnNode(templateNode); |
|
|
@ -3467,7 +3495,7 @@ bool VaultAmIgnoringPlayer (unsigned playerId) { |
|
|
|
if (RelVaultNode * rvnFldr = GetChildPlayerInfoListNode(GetPlayerNode(), plVault::kIgnoreListFolder, 1)) { |
|
|
|
if (RelVaultNode * rvnFldr = GetChildPlayerInfoListNode(GetPlayerNode(), plVault::kIgnoreListFolder, 1)) { |
|
|
|
rvnFldr->IncRef(); |
|
|
|
rvnFldr->IncRef(); |
|
|
|
|
|
|
|
|
|
|
|
NetVaultNode * templateNode = NEWZERO(NetVaultNode); |
|
|
|
NetVaultNode * templateNode = new NetVaultNode; |
|
|
|
templateNode->IncRef(); |
|
|
|
templateNode->IncRef(); |
|
|
|
templateNode->SetNodeType(plVault::kNodeType_PlayerInfo); |
|
|
|
templateNode->SetNodeType(plVault::kNodeType_PlayerInfo); |
|
|
|
VaultPlayerInfoNode pinfoNode(templateNode); |
|
|
|
VaultPlayerInfoNode pinfoNode(templateNode); |
|
|
@ -3704,7 +3732,7 @@ void VaultProcessPlayerInbox () { |
|
|
|
if (RelVaultNode * rvnInbox = VaultGetPlayerInboxFolderIncRef()) { |
|
|
|
if (RelVaultNode * rvnInbox = VaultGetPlayerInboxFolderIncRef()) { |
|
|
|
{ // Process new visit requests
|
|
|
|
{ // Process new visit requests
|
|
|
|
ARRAY(RelVaultNode*) visits; |
|
|
|
ARRAY(RelVaultNode*) visits; |
|
|
|
RelVaultNode * templateNode = NEWZERO(RelVaultNode); |
|
|
|
RelVaultNode * templateNode = new RelVaultNode; |
|
|
|
templateNode->IncRef(); |
|
|
|
templateNode->IncRef(); |
|
|
|
templateNode->SetNodeType(plVault::kNodeType_TextNote); |
|
|
|
templateNode->SetNodeType(plVault::kNodeType_TextNote); |
|
|
|
VaultTextNoteNode tmpAcc(templateNode); |
|
|
|
VaultTextNoteNode tmpAcc(templateNode); |
|
|
@ -3727,7 +3755,7 @@ void VaultProcessPlayerInbox () { |
|
|
|
} |
|
|
|
} |
|
|
|
{ // Process new unvisit requests
|
|
|
|
{ // Process new unvisit requests
|
|
|
|
ARRAY(RelVaultNode*) unvisits; |
|
|
|
ARRAY(RelVaultNode*) unvisits; |
|
|
|
RelVaultNode * templateNode = NEWZERO(RelVaultNode); |
|
|
|
RelVaultNode * templateNode = new RelVaultNode; |
|
|
|
templateNode->IncRef(); |
|
|
|
templateNode->IncRef(); |
|
|
|
templateNode->SetNodeType(plVault::kNodeType_TextNote); |
|
|
|
templateNode->SetNodeType(plVault::kNodeType_TextNote); |
|
|
|
VaultTextNoteNode tmpAcc(templateNode); |
|
|
|
VaultTextNoteNode tmpAcc(templateNode); |
|
|
@ -3762,7 +3790,7 @@ void VaultProcessPlayerInbox () { |
|
|
|
|
|
|
|
|
|
|
|
//============================================================================
|
|
|
|
//============================================================================
|
|
|
|
static RelVaultNode * GetAgeNode () { |
|
|
|
static RelVaultNode * GetAgeNode () { |
|
|
|
NetVaultNode * templateNode = NEWZERO(NetVaultNode); |
|
|
|
NetVaultNode * templateNode = new NetVaultNode; |
|
|
|
templateNode->IncRef(); |
|
|
|
templateNode->IncRef(); |
|
|
|
templateNode->SetNodeType(plVault::kNodeType_VNodeMgrAge); |
|
|
|
templateNode->SetNodeType(plVault::kNodeType_VNodeMgrAge); |
|
|
|
if (NetCommGetAge()) |
|
|
|
if (NetCommGetAge()) |
|
|
@ -3775,7 +3803,7 @@ static RelVaultNode * GetAgeNode () { |
|
|
|
//============================================================================
|
|
|
|
//============================================================================
|
|
|
|
RelVaultNode * VaultGetAgeNodeIncRef () { |
|
|
|
RelVaultNode * VaultGetAgeNodeIncRef () { |
|
|
|
RelVaultNode * result = nil; |
|
|
|
RelVaultNode * result = nil; |
|
|
|
NetVaultNode * templateNode = NEWZERO(NetVaultNode); |
|
|
|
NetVaultNode * templateNode = new NetVaultNode; |
|
|
|
templateNode->IncRef(); |
|
|
|
templateNode->IncRef(); |
|
|
|
templateNode->SetNodeType(plVault::kNodeType_VNodeMgrAge); |
|
|
|
templateNode->SetNodeType(plVault::kNodeType_VNodeMgrAge); |
|
|
|
if (NetCommGetAge()) |
|
|
|
if (NetCommGetAge()) |
|
|
@ -3793,7 +3821,7 @@ static RelVaultNode * GetAgeInfoNode () { |
|
|
|
return nil; |
|
|
|
return nil; |
|
|
|
|
|
|
|
|
|
|
|
RelVaultNode * result = nil; |
|
|
|
RelVaultNode * result = nil; |
|
|
|
NetVaultNode * templateNode = NEWZERO(NetVaultNode); |
|
|
|
NetVaultNode * templateNode = new NetVaultNode; |
|
|
|
templateNode->IncRef(); |
|
|
|
templateNode->IncRef(); |
|
|
|
|
|
|
|
|
|
|
|
templateNode->SetNodeType(plVault::kNodeType_AgeInfo); |
|
|
|
templateNode->SetNodeType(plVault::kNodeType_AgeInfo); |
|
|
@ -3817,7 +3845,7 @@ RelVaultNode * VaultGetAgeInfoNodeIncRef () { |
|
|
|
return nil; |
|
|
|
return nil; |
|
|
|
|
|
|
|
|
|
|
|
RelVaultNode * result = nil; |
|
|
|
RelVaultNode * result = nil; |
|
|
|
NetVaultNode * templateNode = NEWZERO(NetVaultNode); |
|
|
|
NetVaultNode * templateNode = new NetVaultNode; |
|
|
|
templateNode->IncRef(); |
|
|
|
templateNode->IncRef(); |
|
|
|
templateNode->SetNodeType(plVault::kNodeType_AgeInfo); |
|
|
|
templateNode->SetNodeType(plVault::kNodeType_AgeInfo); |
|
|
|
templateNode->SetCreatorId(rvnAge->nodeId); |
|
|
|
templateNode->SetCreatorId(rvnAge->nodeId); |
|
|
@ -3892,7 +3920,7 @@ RelVaultNode * VaultFindAgeSubAgeLinkIncRef (const plAgeInfoStruct * info) { |
|
|
|
|
|
|
|
|
|
|
|
if (RelVaultNode * rvnFldr = VaultGetAgeSubAgesFolderIncRef()) { |
|
|
|
if (RelVaultNode * rvnFldr = VaultGetAgeSubAgesFolderIncRef()) { |
|
|
|
|
|
|
|
|
|
|
|
NetVaultNode * templateNode = NEWZERO(NetVaultNode); |
|
|
|
NetVaultNode * templateNode = new NetVaultNode; |
|
|
|
templateNode->IncRef(); |
|
|
|
templateNode->IncRef(); |
|
|
|
templateNode->SetNodeType(plVault::kNodeType_AgeInfo); |
|
|
|
templateNode->SetNodeType(plVault::kNodeType_AgeInfo); |
|
|
|
|
|
|
|
|
|
|
@ -3965,7 +3993,7 @@ RelVaultNode * VaultAgeAddDeviceAndWaitIncRef (const wchar_t deviceName[]) { |
|
|
|
//============================================================================
|
|
|
|
//============================================================================
|
|
|
|
void VaultAgeRemoveDevice (const wchar_t deviceName[]) { |
|
|
|
void VaultAgeRemoveDevice (const wchar_t deviceName[]) { |
|
|
|
if (RelVaultNode * folder = VaultGetAgeDevicesFolderIncRef()) { |
|
|
|
if (RelVaultNode * folder = VaultGetAgeDevicesFolderIncRef()) { |
|
|
|
NetVaultNode * templateNode = NEWZERO(NetVaultNode); |
|
|
|
NetVaultNode * templateNode = new NetVaultNode; |
|
|
|
templateNode->IncRef(); |
|
|
|
templateNode->IncRef(); |
|
|
|
templateNode->SetNodeType(plVault::kNodeType_TextNote); |
|
|
|
templateNode->SetNodeType(plVault::kNodeType_TextNote); |
|
|
|
VaultTextNoteNode access(templateNode); |
|
|
|
VaultTextNoteNode access(templateNode); |
|
|
@ -3986,7 +4014,7 @@ void VaultAgeRemoveDevice (const wchar_t deviceName[]) { |
|
|
|
bool VaultAgeHasDevice (const wchar_t deviceName[]) { |
|
|
|
bool VaultAgeHasDevice (const wchar_t deviceName[]) { |
|
|
|
bool found = false; |
|
|
|
bool found = false; |
|
|
|
if (RelVaultNode * folder = VaultGetAgeDevicesFolderIncRef()) { |
|
|
|
if (RelVaultNode * folder = VaultGetAgeDevicesFolderIncRef()) { |
|
|
|
NetVaultNode * templateNode = NEWZERO(NetVaultNode); |
|
|
|
NetVaultNode * templateNode = new NetVaultNode; |
|
|
|
templateNode->IncRef(); |
|
|
|
templateNode->IncRef(); |
|
|
|
templateNode->SetNodeType(plVault::kNodeType_TextNote); |
|
|
|
templateNode->SetNodeType(plVault::kNodeType_TextNote); |
|
|
|
VaultTextNoteNode access(templateNode); |
|
|
|
VaultTextNoteNode access(templateNode); |
|
|
@ -4005,7 +4033,7 @@ bool VaultAgeHasDevice (const wchar_t deviceName[]) { |
|
|
|
RelVaultNode * VaultAgeGetDeviceIncRef (const wchar_t deviceName[]) { |
|
|
|
RelVaultNode * VaultAgeGetDeviceIncRef (const wchar_t deviceName[]) { |
|
|
|
RelVaultNode * result = nil; |
|
|
|
RelVaultNode * result = nil; |
|
|
|
if (RelVaultNode * folder = VaultGetAgeDevicesFolderIncRef()) { |
|
|
|
if (RelVaultNode * folder = VaultGetAgeDevicesFolderIncRef()) { |
|
|
|
NetVaultNode * templateNode = NEWZERO(NetVaultNode); |
|
|
|
NetVaultNode * templateNode = new NetVaultNode; |
|
|
|
templateNode->IncRef(); |
|
|
|
templateNode->IncRef(); |
|
|
|
templateNode->SetNodeType(plVault::kNodeType_TextNote); |
|
|
|
templateNode->SetNodeType(plVault::kNodeType_TextNote); |
|
|
|
VaultTextNoteNode access(templateNode); |
|
|
|
VaultTextNoteNode access(templateNode); |
|
|
@ -4025,7 +4053,7 @@ RelVaultNode * VaultAgeSetDeviceInboxAndWaitIncRef (const wchar_t deviceName[], |
|
|
|
StrCopy(devInbox->inboxName, inboxName, arrsize(devInbox->inboxName)); |
|
|
|
StrCopy(devInbox->inboxName, inboxName, arrsize(devInbox->inboxName)); |
|
|
|
} |
|
|
|
} |
|
|
|
else { |
|
|
|
else { |
|
|
|
devInbox = NEWZERO(DeviceInbox)(deviceName, inboxName); |
|
|
|
devInbox = new DeviceInbox(deviceName, inboxName); |
|
|
|
s_ageDeviceInboxes.Add(devInbox); |
|
|
|
s_ageDeviceInboxes.Add(devInbox); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -4077,7 +4105,7 @@ RelVaultNode * VaultAgeGetDeviceInboxIncRef (const wchar_t deviceName[]) { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (parentNode) { |
|
|
|
if (parentNode) { |
|
|
|
NetVaultNode * templateNode = NEWZERO(NetVaultNode); |
|
|
|
NetVaultNode * templateNode = new NetVaultNode; |
|
|
|
templateNode->IncRef(); |
|
|
|
templateNode->IncRef(); |
|
|
|
templateNode->SetNodeType(plVault::kNodeType_Folder); |
|
|
|
templateNode->SetNodeType(plVault::kNodeType_Folder); |
|
|
|
VaultFolderNode access(templateNode); |
|
|
|
VaultFolderNode access(templateNode); |
|
|
@ -4141,7 +4169,7 @@ RelVaultNode * VaultGetSubAgeLinkIncRef (const plAgeInfoStruct * info) { |
|
|
|
|
|
|
|
|
|
|
|
if (RelVaultNode * rvnFldr = VaultGetAgeSubAgesFolderIncRef()) { |
|
|
|
if (RelVaultNode * rvnFldr = VaultGetAgeSubAgesFolderIncRef()) { |
|
|
|
|
|
|
|
|
|
|
|
NetVaultNode * templateNode = NEWZERO(NetVaultNode); |
|
|
|
NetVaultNode * templateNode = new NetVaultNode; |
|
|
|
templateNode->IncRef(); |
|
|
|
templateNode->IncRef(); |
|
|
|
templateNode->SetNodeType(plVault::kNodeType_AgeInfo); |
|
|
|
templateNode->SetNodeType(plVault::kNodeType_AgeInfo); |
|
|
|
|
|
|
|
|
|
|
@ -4426,7 +4454,7 @@ namespace _VaultCreateSubAge { |
|
|
|
LogMsg(kLogError, "CreateSubAge: Couldn't find SubAges folder (async)"); |
|
|
|
LogMsg(kLogError, "CreateSubAge: Couldn't find SubAges folder (async)"); |
|
|
|
|
|
|
|
|
|
|
|
// Send the VaultNotify that the plNetLinkingMgr wants...
|
|
|
|
// Send the VaultNotify that the plNetLinkingMgr wants...
|
|
|
|
plVaultNotifyMsg * msg = NEWZERO(plVaultNotifyMsg); |
|
|
|
plVaultNotifyMsg * msg = new plVaultNotifyMsg; |
|
|
|
msg->SetType(plVaultNotifyMsg::kRegisteredSubAgeLink); |
|
|
|
msg->SetType(plVaultNotifyMsg::kRegisteredSubAgeLink); |
|
|
|
msg->SetResultCode(result); |
|
|
|
msg->SetResultCode(result); |
|
|
|
msg->GetArgs()->AddInt(plNetCommon::VaultTaskArgs::kAgeLinkNode, node->nodeId); |
|
|
|
msg->GetArgs()->AddInt(plNetCommon::VaultTaskArgs::kAgeLinkNode, node->nodeId); |
|
|
@ -4602,7 +4630,7 @@ bool VaultAgeFindOrCreateChildAgeLinkAndWait ( |
|
|
|
|
|
|
|
|
|
|
|
// Check for existing child age in folder
|
|
|
|
// Check for existing child age in folder
|
|
|
|
RelVaultNode * rvnLink = nil; |
|
|
|
RelVaultNode * rvnLink = nil; |
|
|
|
NetVaultNode * templateNode = NEWZERO(NetVaultNode); |
|
|
|
NetVaultNode * templateNode = new NetVaultNode; |
|
|
|
templateNode->IncRef(); |
|
|
|
templateNode->IncRef(); |
|
|
|
templateNode->SetNodeType(plVault::kNodeType_AgeInfo); |
|
|
|
templateNode->SetNodeType(plVault::kNodeType_AgeInfo); |
|
|
|
|
|
|
|
|
|
|
@ -4788,7 +4816,7 @@ namespace _VaultCreateChildAge { |
|
|
|
VaultAddChildNode((uint32_t)((uintptr_t)p->fChildAgesFldr), node->nodeId, 0, nil, nil); |
|
|
|
VaultAddChildNode((uint32_t)((uintptr_t)p->fChildAgesFldr), node->nodeId, 0, nil, nil); |
|
|
|
|
|
|
|
|
|
|
|
// Send the VaultNotify that the plNetLinkingMgr wants...
|
|
|
|
// Send the VaultNotify that the plNetLinkingMgr wants...
|
|
|
|
plVaultNotifyMsg * msg = NEWZERO(plVaultNotifyMsg); |
|
|
|
plVaultNotifyMsg * msg = new plVaultNotifyMsg; |
|
|
|
msg->SetType(plVaultNotifyMsg::kRegisteredChildAgeLink); |
|
|
|
msg->SetType(plVaultNotifyMsg::kRegisteredChildAgeLink); |
|
|
|
msg->SetResultCode(result); |
|
|
|
msg->SetResultCode(result); |
|
|
|
msg->GetArgs()->AddInt(plNetCommon::VaultTaskArgs::kAgeLinkNode, node->nodeId); |
|
|
|
msg->GetArgs()->AddInt(plNetCommon::VaultTaskArgs::kAgeLinkNode, node->nodeId); |
|
|
@ -4867,7 +4895,7 @@ uint8_t VaultAgeFindOrCreateChildAgeLink( |
|
|
|
StrToUnicode(hack, ageName, arrsize(hack)); |
|
|
|
StrToUnicode(hack, ageName, arrsize(hack)); |
|
|
|
|
|
|
|
|
|
|
|
// Search for our age
|
|
|
|
// Search for our age
|
|
|
|
NetVaultNode* temp = NEWZERO(NetVaultNode); |
|
|
|
NetVaultNode* temp = new NetVaultNode; |
|
|
|
temp->SetNodeType(plVault::kNodeType_AgeInfo); |
|
|
|
temp->SetNodeType(plVault::kNodeType_AgeInfo); |
|
|
|
VaultAgeInfoNode theAge(temp); |
|
|
|
VaultAgeInfoNode theAge(temp); |
|
|
|
theAge.SetAgeFilename(hack); |
|
|
|
theAge.SetAgeFilename(hack); |
|
|
@ -4934,13 +4962,8 @@ void VaultDownload ( |
|
|
|
FVaultProgressCallback progressCallback, |
|
|
|
FVaultProgressCallback progressCallback, |
|
|
|
void * cbProgressParam |
|
|
|
void * cbProgressParam |
|
|
|
) { |
|
|
|
) { |
|
|
|
VaultDownloadTrans * trans = NEWZERO(VaultDownloadTrans); |
|
|
|
VaultDownloadTrans * trans = new VaultDownloadTrans(tag, callback, cbParam, |
|
|
|
StrCopy(trans->tag, tag, arrsize(trans->tag)); |
|
|
|
progressCallback, cbProgressParam, vaultId); |
|
|
|
trans->callback = callback; |
|
|
|
|
|
|
|
trans->cbParam = cbParam; |
|
|
|
|
|
|
|
trans->progressCallback = progressCallback; |
|
|
|
|
|
|
|
trans->cbProgressParam = cbProgressParam; |
|
|
|
|
|
|
|
trans->vaultId = vaultId; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
NetCliAuthVaultFetchNodeRefs( |
|
|
|
NetCliAuthVaultFetchNodeRefs( |
|
|
|
vaultId, |
|
|
|
vaultId, |
|
|
@ -5032,7 +5055,7 @@ void VaultCull (unsigned vaultId) { |
|
|
|
RelVaultNode * VaultGetSystemNodeIncRef () { |
|
|
|
RelVaultNode * VaultGetSystemNodeIncRef () { |
|
|
|
RelVaultNode * result = nil; |
|
|
|
RelVaultNode * result = nil; |
|
|
|
if (RelVaultNode * player = VaultGetPlayerNodeIncRef()) { |
|
|
|
if (RelVaultNode * player = VaultGetPlayerNodeIncRef()) { |
|
|
|
NetVaultNode * templateNode = NEWZERO(NetVaultNode); |
|
|
|
NetVaultNode * templateNode = new NetVaultNode; |
|
|
|
templateNode->IncRef(); |
|
|
|
templateNode->IncRef(); |
|
|
|
templateNode->SetNodeType(plVault::kNodeType_System); |
|
|
|
templateNode->SetNodeType(plVault::kNodeType_System); |
|
|
|
if (RelVaultNode * systemNode = player->GetChildNodeIncRef(templateNode, 1)) |
|
|
|
if (RelVaultNode * systemNode = player->GetChildNodeIncRef(templateNode, 1)) |
|
|
@ -5047,7 +5070,7 @@ RelVaultNode * VaultGetSystemNodeIncRef () { |
|
|
|
RelVaultNode * VaultGetGlobalInboxIncRef () { |
|
|
|
RelVaultNode * VaultGetGlobalInboxIncRef () { |
|
|
|
RelVaultNode * result = nil; |
|
|
|
RelVaultNode * result = nil; |
|
|
|
if (RelVaultNode * system = VaultGetSystemNodeIncRef()) { |
|
|
|
if (RelVaultNode * system = VaultGetSystemNodeIncRef()) { |
|
|
|
NetVaultNode * templateNode = NEWZERO(NetVaultNode); |
|
|
|
NetVaultNode * templateNode = new NetVaultNode; |
|
|
|
templateNode->IncRef(); |
|
|
|
templateNode->IncRef(); |
|
|
|
templateNode->SetNodeType(plVault::kNodeType_Folder); |
|
|
|
templateNode->SetNodeType(plVault::kNodeType_Folder); |
|
|
|
VaultFolderNode folder(templateNode); |
|
|
|
VaultFolderNode folder(templateNode); |
|
|
|