本文整理汇总了C++中RelVaultNode类的典型用法代码示例。如果您正苦于以下问题:C++ RelVaultNode类的具体用法?C++ RelVaultNode怎么用?C++ RelVaultNode使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了RelVaultNode类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: access
PyObject * pyVaultNodeRef::GetSaver () {
if (!fParent || !fChild)
return 0;
RelVaultNode * saver = nil;
if (RelVaultNode * child = VaultGetNodeIncRef(fChild->GetNodeId())) {
if (unsigned saverId = child->GetRefOwnerId(fParent->GetNodeId())) {
// Find the player info node representing the saver
NetVaultNode * templateNode = new NetVaultNode;
templateNode->IncRef();
templateNode->SetNodeType(plVault::kNodeType_PlayerInfo);
VaultPlayerInfoNode access(templateNode);
access.SetPlayerId(saverId);
saver = VaultGetNodeIncRef(templateNode);
if (!saver) {
ARRAY(unsigned) nodeIds;
VaultFindNodesAndWait(templateNode, &nodeIds);
if (nodeIds.Count() > 0) {
VaultFetchNodesAndWait(nodeIds.Ptr(), nodeIds.Count());
saver = VaultGetNodeIncRef(nodeIds[0]);
}
}
templateNode->DecRef();
}
child->DecRef();
}
if (!saver)
PYTHON_RETURN_NONE;
PyObject * result = pyVaultPlayerInfoNode::New(saver);
saver->DecRef();
return result;
}
示例2: pyVaultNodeOperationCallback
PyObject* pyVaultNode::AddNode(pyVaultNode* pynode, PyObject* cbObject, uint32_t cbContext)
{
pyVaultNodeOperationCallback * cb = new pyVaultNodeOperationCallback(cbObject);
if ( fNode && pynode && pynode->GetNode() )
{
// Hack the callbacks until vault notification is in place
cb->VaultOperationStarted(cbContext);
int hsResult = hsOK;
if ( !pynode->GetID() )
{
// Block here until node is created and fetched =(
ASSERT(pynode->GetNode()->GetNodeType());
ENetError result;
RelVaultNode * newNode = VaultCreateNodeAndWaitIncRef(
pynode->GetNode(),
&result
);
if (newNode) {
newNode->Ref();
pynode->fNode->UnRef();
pynode->fNode = newNode;
}
else {
hsResult = hsFail;
}
}
PyObject* nodeRef = cb->fPyNodeRef = pyVaultNodeRef::New(fNode, pynode->fNode);
Py_INCREF(nodeRef); // The callback steals the ref, according to Eric...
cb->SetNode(pynode->fNode);
VaultAddChildNode(fNode->GetNodeId(),
pynode->fNode->GetNodeId(),
NetCommGetPlayer()->playerInt,
(FVaultAddChildNodeCallback)_AddNodeCallback,
cb
);
// Evil undocumented functionality that some fool
// decided to use in xKI.py. Really???
return nodeRef;
}
else
{
// manually make the callback
cb->VaultOperationStarted( cbContext );
cb->VaultOperationComplete(hsFail);
}
// just return a None object
PYTHON_RETURN_NONE;
}
示例3: VaultGetAgeInfoNodeIncRef
plUUID pyAgeVault::GetAgeGuid( void )
{
RelVaultNode * rvn = VaultGetAgeInfoNodeIncRef();
if (rvn) {
VaultAgeInfoNode ageInfo(rvn);
plUUID uuid = ageInfo.GetAgeInstanceGuid();
rvn->UnRef();
return uuid;
}
return kNilUuid;
}
示例4: GetNode
// override the equals to operator
bool pyVaultNode::operator==(const pyVaultNode &vaultNode) const
{
RelVaultNode* ours = GetNode();
RelVaultNode* theirs = vaultNode.GetNode();
if (ours == nil && theirs == nil)
return true;
if (ours == nil || theirs == nil)
return false;
if (ours->GetNodeId() == theirs->GetNodeId())
return true;
return ours->Matches(theirs);
}
示例5: VaultGetAgeDevicesFolderIncRef
PyObject* pyAgeVault::GetAgeDevicesFolder( void )
{
RelVaultNode * rvn = VaultGetAgeDevicesFolderIncRef();
if (rvn) {
PyObject * result = pyVaultFolderNode::New(rvn);
rvn->UnRef();
return result;
}
// just return a None object
PYTHON_RETURN_NONE;
}
示例6: VaultFindAgeSubAgeLinkIncRef
PyObject* pyAgeVault::GetSubAgeLink( const pyAgeInfoStruct & info )
{
RelVaultNode * rvn = VaultFindAgeSubAgeLinkIncRef(info.GetAgeInfo());
if (rvn) {
PyObject * result = pyVaultAgeLinkNode::New(rvn);
rvn->UnRef();
return result;
}
// just return a None object
PYTHON_RETURN_NONE;
}
示例7: VaultGetAgePeopleIKnowAboutFolderIncRef
PyObject* pyAgeVault::GetPeopleIKnowAboutFolder( void )
{
RelVaultNode * rvn = VaultGetAgePeopleIKnowAboutFolderIncRef();
if (rvn) {
PyObject * result = pyVaultFolderNode::New(rvn);
rvn->DecRef();
return result;
}
// just return a None object
PYTHON_RETURN_NONE;
}
示例8: VaultGetAgeInfoNodeIncRef
const char* pyAgeVault::GetAgeGuid( void )
{
RelVaultNode * rvn = VaultGetAgeInfoNodeIncRef();
if (rvn) {
VaultAgeInfoNode ageInfo(rvn);
GuidToString(ageInfo.ageInstUuid, fAgeGuid, arrsize(fAgeGuid));
rvn->DecRef();
}
else {
fAgeGuid[0] = 0;
}
return fAgeGuid;
}
示例9: FindNode
PyObject* pyAgeVault::FindNode( pyVaultNode* templateNode ) const
{
if (RelVaultNode * rvn = VaultGetAgeNodeIncRef()) {
RelVaultNode * find = rvn->GetChildNodeIncRef(templateNode->fNode, 1);
rvn->UnRef();
if (find) {
PyObject * result = pyVaultNode::New(find);
find->UnRef();
return result;
}
}
PYTHON_RETURN_NONE;
}
示例10: NEWZERO
//==================================================================
// class RelVaultNode : public plVaultFolderNode
//
bool pyVaultPlayerInfoListNode::HasPlayer( uint32_t playerID )
{
if (!fNode)
return false;
NetVaultNode * templateNode = NEWZERO(NetVaultNode);
templateNode->IncRef();
templateNode->SetNodeType(plVault::kNodeType_PlayerInfo);
VaultPlayerInfoNode access(templateNode);
access.SetPlayerId(playerID);
RelVaultNode * rvn = fNode->GetChildNodeIncRef(templateNode, 1);
if (rvn)
rvn->DecRef();
templateNode->DecRef();
return (rvn != nil);
}
示例11:
PyObject * pyVaultNode::GetNode2( uint32_t nodeID ) const
{
PyObject * result = nil;
if ( fNode )
{
RelVaultNode * templateNode = new RelVaultNode;
templateNode->Ref();
templateNode->SetNodeId(nodeID);
if (RelVaultNode * rvn = fNode->GetChildNodeIncRef(templateNode, 1)) {
result = pyVaultNodeRef::New(fNode, rvn);
rvn->UnRef();
}
templateNode->UnRef();
}
if (result)
return result;
PYTHON_RETURN_NONE;
}
示例12: GetAgeLink
bool plNetLinkingMgr::IProcessVaultNotifyMsg(plVaultNotifyMsg* msg)
{
// No deferred link? Bye bye.
if (fDeferredLink == nil)
return false;
plAgeLinkStruct* cur = GetAgeLink();
RelVaultNode* cVaultLink = nil;
switch (msg->GetType())
{
case plVaultNotifyMsg::kRegisteredChildAgeLink:
case plVaultNotifyMsg::kRegisteredOwnedAge:
case plVaultNotifyMsg::kRegisteredSubAgeLink:
cVaultLink = VaultGetNodeIncRef(msg->GetArgs()->GetInt(plNetCommon::VaultTaskArgs::kAgeLinkNode));
break;
default:
return false;
}
if (cVaultLink != nil)
{
// This is something that Cyan does... >.<
// It's very useful though...
VaultAgeLinkNode accLink(cVaultLink);
accLink.CopyTo(cur);
if (RelVaultNode* rvnInfo = cVaultLink->GetChildNodeIncRef(plVault::kNodeType_AgeInfo, 1))
{
VaultAgeInfoNode accInfo(rvnInfo);
accInfo.CopyTo(cur->GetAgeInfo());
rvnInfo->DecRef();
}
IDoLink(fDeferredLink);
fDeferredLink = nil;
return true;
cVaultLink->DecRef();
}
return false;
}
示例13: plrInfo
PyObject* pyVaultNode::GetCreatorNode( void )
{
PyObject * result = nil;
if (fNode)
{
RelVaultNode * templateNode = new RelVaultNode;
templateNode->Ref();
templateNode->SetNodeType(plVault::kNodeType_PlayerInfo);
VaultPlayerInfoNode plrInfo(templateNode);
plrInfo.SetPlayerId(fNode->GetCreatorId());
if (RelVaultNode * rvn = VaultGetNodeIncRef(templateNode)) {
result = pyVaultPlayerInfoNode::New(rvn);
rvn->UnRef();
}
templateNode->UnRef();
}
if (result)
return result;
// just return a None object
PYTHON_RETURN_NONE;
}
示例14: VaultGetPlayerNodeIncRef
// finds the stats for the players vault
// ...such as how many pictures, notes and markers they have
PyObject* pyVault::GetKIUsage(void)
{
uint32_t pictures = 0;
uint32_t notes = 0;
uint32_t markerGames = 0;
for (;;) {
RelVaultNode * rvnPlr = VaultGetPlayerNodeIncRef();
if (!rvnPlr)
break;
for (;;) {
RelVaultNode * rvnAgeJrnlz = rvnPlr->GetChildFolderNodeIncRef(plVault::kAgeJournalsFolder, 1);
if (!rvnAgeJrnlz)
break;
// Get child nodes up to two levels deep
ARRAY(RelVaultNode*) nodeArr;
rvnAgeJrnlz->GetChildNodesIncRef(2, &nodeArr);
RelVaultNode ** cur = nodeArr.Ptr();
RelVaultNode ** end = nodeArr.Term();
for (; cur != end; ++cur) {
RelVaultNode * rvn = *cur;
if (rvn->GetNodeType() == plVault::kNodeType_Image)
++pictures;
else if (rvn->GetNodeType() == plVault::kNodeType_TextNote)
++notes;
else if (rvn->GetNodeType() == plVault::kNodeType_MarkerGame)
++markerGames;
rvn->DecRef();
}
rvnAgeJrnlz->DecRef();
break;
}
rvnPlr->DecRef();
break;
}
// create the tuple of usage numbers
PyObject* retVal = PyTuple_New(4);
PyTuple_SetItem(retVal, 0, PyLong_FromUnsignedLong(pictures));
PyTuple_SetItem(retVal, 1, PyLong_FromUnsignedLong(notes));
PyTuple_SetItem(retVal, 2, PyLong_FromUnsignedLong(markerGames));
return retVal;
}