Browse Source

Replace most vault *IncRef() API functions with hsRef versions

Michael Hansen 11 years ago
parent
commit
d2a05929f8
  1. 1
      Sources/Plasma/CoreLib/hsRefCnt.h
  2. 6
      Sources/Plasma/FeatureLib/pfPython/cyAvatar.cpp
  3. 6
      Sources/Plasma/FeatureLib/pfPython/cyMisc.cpp
  4. 3
      Sources/Plasma/FeatureLib/pfPython/plPythonFileMod.cpp
  5. 119
      Sources/Plasma/FeatureLib/pfPython/pyAgeVault.cpp
  6. 13
      Sources/Plasma/FeatureLib/pfPython/pyDniInfoSource.cpp
  7. 12
      Sources/Plasma/FeatureLib/pfPython/pyGameScore.cpp
  8. 130
      Sources/Plasma/FeatureLib/pfPython/pyVault.cpp
  9. 15
      Sources/Plasma/FeatureLib/pfPython/pyVaultAgeInfoNode.cpp
  10. 4
      Sources/Plasma/FeatureLib/pfPython/pyVaultAgeLinkNode.cpp
  11. 47
      Sources/Plasma/FeatureLib/pfPython/pyVaultNode.cpp
  12. 22
      Sources/Plasma/FeatureLib/pfPython/pyVaultNodeRef.cpp
  13. 26
      Sources/Plasma/FeatureLib/pfPython/pyVaultPlayerInfoListNode.cpp
  14. 28
      Sources/Plasma/FeatureLib/pfPython/pyVaultPlayerNode.cpp
  15. 4
      Sources/Plasma/FeatureLib/pfPython/pyVaultTextNoteNode.cpp
  16. 45
      Sources/Plasma/PubUtilLib/plAvatar/plAvatarClothing.cpp
  17. 3
      Sources/Plasma/PubUtilLib/plInputCore/plSceneInputInterface.cpp
  18. 39
      Sources/Plasma/PubUtilLib/plNetClient/plNetLinkingMgr.cpp
  19. 10
      Sources/Plasma/PubUtilLib/plNetClientComm/plNetClientComm.cpp
  20. 834
      Sources/Plasma/PubUtilLib/plVault/plVaultClientApi.cpp
  21. 127
      Sources/Plasma/PubUtilLib/plVault/plVaultClientApi.h
  22. 6
      Sources/Plasma/PubUtilLib/plVault/plVaultNodeAccess.cpp

1
Sources/Plasma/CoreLib/hsRefCnt.h

@ -124,6 +124,7 @@ public:
if (fObj)
fObj->UnRef();
fObj = nullptr;
return *this;
}
bool operator==(const hsRef<_Ref> &other) const { return fObj == other.fObj; }

6
Sources/Plasma/FeatureLib/pfPython/cyAvatar.cpp

@ -1670,11 +1670,10 @@ void cyAvatar::ChangeAvatar(const char* genderName)
wchar_t wStr[MAX_PATH];
StrToUnicode(wStr, genderName, arrsize(wStr));
RelVaultNode * rvnPlr = VaultGetPlayerNodeIncRef();
hsRef<RelVaultNode> rvnPlr = VaultGetPlayerNode();
if (rvnPlr) {
VaultPlayerNode plr(rvnPlr);
plr.SetAvatarShapeName(wStr);
rvnPlr->UnRef();
}
#endif
}
@ -1691,11 +1690,10 @@ void cyAvatar::ChangePlayerName(const char* playerName)
wchar_t wStr[MAX_PATH];
StrToUnicode(wStr, playerName, arrsize(wStr));
RelVaultNode * rvnPlr = VaultGetPlayerNodeIncRef();
hsRef<RelVaultNode> rvnPlr = VaultGetPlayerNode();
if (rvnPlr) {
VaultPlayerNode plr(rvnPlr);
plr.SetPlayerName(wStr);
rvnPlr->UnRef();
}
}

6
Sources/Plasma/FeatureLib/pfPython/cyMisc.cpp

@ -2471,10 +2471,9 @@ int cyMisc::GetKILevel()
wchar_t wStr[MAX_PATH];
StrToUnicode(wStr, pfKIMsg::kChronicleKILevel, arrsize(wStr));
if (RelVaultNode * rvn = VaultFindChronicleEntryIncRef(wStr)) {
if (hsRef<RelVaultNode> rvn = VaultFindChronicleEntry(wStr)) {
VaultChronicleNode chron(rvn);
result = wcstol(chron.GetEntryValue(), nil, 0);
rvn->UnRef();
}
return result;
@ -2880,7 +2879,7 @@ void cyMisc::SetBehaviorNetFlags(pyKey & behKey, bool netForce, bool netProp)
void cyMisc::SendFriendInvite(const wchar_t email[], const wchar_t toName[])
{
if (RelVaultNode* pNode = VaultGetPlayerNodeIncRef())
if (hsRef<RelVaultNode> pNode = VaultGetPlayerNode())
{
VaultPlayerNode player(pNode);
plUUID inviteUuid = player.GetInviteUuid();
@ -2893,7 +2892,6 @@ void cyMisc::SendFriendInvite(const wchar_t email[], const wchar_t toName[])
}
NetCommSendFriendInvite(email, toName, inviteUuid);
pNode->UnRef();
}
}

3
Sources/Plasma/FeatureLib/pfPython/plPythonFileMod.cpp

@ -2079,11 +2079,10 @@ bool plPythonFileMod::MsgReceive(plMessage* msg)
case plVaultNotifyMsg::kRegisteredVisitAge:
case plVaultNotifyMsg::kUnRegisteredOwnedAge:
case plVaultNotifyMsg::kUnRegisteredVisitAge: {
if (RelVaultNode * rvn = VaultGetNodeIncRef(vaultNotifyMsg->GetArgs()->GetInt(plNetCommon::VaultTaskArgs::kAgeLinkNode))) {
if (hsRef<RelVaultNode> rvn = VaultGetNode(vaultNotifyMsg->GetArgs()->GetInt(plNetCommon::VaultTaskArgs::kAgeLinkNode))) {
Py_DECREF(ptuple);
ptuple = PyTuple_New(1);
PyTuple_SetItem(ptuple, 0, pyVaultAgeLinkNode::New(rvn));
rvn->UnRef();
}
}
break;

119
Sources/Plasma/FeatureLib/pfPython/pyAgeVault.cpp

@ -81,12 +81,9 @@ pyAgeVault::~pyAgeVault() {
PyObject* pyAgeVault::GetAgeInfo()
{
RelVaultNode * rvn = VaultGetAgeInfoNodeIncRef();
if (rvn) {
PyObject * result = pyVaultAgeInfoNode::New(rvn);
rvn->UnRef();
return result;
}
hsRef<RelVaultNode> rvn = VaultGetAgeInfoNode();
if (rvn)
return pyVaultAgeInfoNode::New(rvn);
// just return a None object
PYTHON_RETURN_NONE;
@ -94,12 +91,9 @@ PyObject* pyAgeVault::GetAgeInfo()
PyObject* pyAgeVault::GetAgeDevicesFolder( void )
{
RelVaultNode * rvn = VaultGetAgeDevicesFolderIncRef();
if (rvn) {
PyObject * result = pyVaultFolderNode::New(rvn);
rvn->UnRef();
return result;
}
hsRef<RelVaultNode> rvn = VaultGetAgeDevicesFolder();
if (rvn)
return pyVaultFolderNode::New(rvn);
// just return a None object
PYTHON_RETURN_NONE;
@ -107,12 +101,9 @@ PyObject* pyAgeVault::GetAgeDevicesFolder( void )
PyObject* pyAgeVault::GetSubAgesFolder( void )
{
RelVaultNode * rvn = VaultGetAgeSubAgesFolderIncRef();
if (rvn) {
PyObject * result = pyVaultFolderNode::New(rvn);
rvn->UnRef();
return result;
}
hsRef<RelVaultNode> rvn = VaultGetAgeSubAgesFolder();
if (rvn)
return pyVaultFolderNode::New(rvn);
// just return a None object
PYTHON_RETURN_NONE;
@ -120,12 +111,9 @@ PyObject* pyAgeVault::GetSubAgesFolder( void )
PyObject* pyAgeVault::GetChronicleFolder( void )
{
RelVaultNode * rvn = VaultGetAgeChronicleFolderIncRef();
if (rvn) {
PyObject * result = pyVaultFolderNode::New(rvn);
rvn->UnRef();
return result;
}
hsRef<RelVaultNode> rvn = VaultGetAgeChronicleFolder();
if (rvn)
return pyVaultFolderNode::New(rvn);
// just return a None object
PYTHON_RETURN_NONE;
@ -133,12 +121,9 @@ PyObject* pyAgeVault::GetChronicleFolder( void )
PyObject* pyAgeVault::GetBookshelfFolder ( void )
{
RelVaultNode * rvn = VaultAgeGetBookshelfFolderIncRef();
if (rvn) {
PyObject * result = pyVaultFolderNode::New(rvn);
rvn->UnRef();
return result;
}
hsRef<RelVaultNode> rvn = VaultAgeGetBookshelfFolder();
if (rvn)
return pyVaultFolderNode::New(rvn);
// just return a None object
PYTHON_RETURN_NONE;
@ -146,12 +131,9 @@ PyObject* pyAgeVault::GetBookshelfFolder ( void )
PyObject* pyAgeVault::GetPeopleIKnowAboutFolder( void )
{
RelVaultNode * rvn = VaultGetAgePeopleIKnowAboutFolderIncRef();
if (rvn) {
PyObject * result = pyVaultFolderNode::New(rvn);
rvn->UnRef();
return result;
}
hsRef<RelVaultNode> rvn = VaultGetAgePeopleIKnowAboutFolder();
if (rvn)
return pyVaultFolderNode::New(rvn);
// just return a None object
PYTHON_RETURN_NONE;
@ -160,12 +142,9 @@ PyObject* pyAgeVault::GetPeopleIKnowAboutFolder( void )
PyObject* pyAgeVault::GetPublicAgesFolder(void)
{
RelVaultNode * rvn = VaultGetAgePublicAgesFolderIncRef();
if (rvn) {
PyObject * result = pyVaultFolderNode::New(rvn);
rvn->UnRef();
return result;
}
hsRef<RelVaultNode> rvn = VaultGetAgePublicAgesFolder();
if (rvn)
return pyVaultFolderNode::New(rvn);
// just return a None object
PYTHON_RETURN_NONE;
@ -173,12 +152,9 @@ PyObject* pyAgeVault::GetPublicAgesFolder(void)
PyObject* pyAgeVault::GetSubAgeLink( const pyAgeInfoStruct & info )
{
RelVaultNode * rvn = VaultFindAgeSubAgeLinkIncRef(info.GetAgeInfo());
if (rvn) {
PyObject * result = pyVaultAgeLinkNode::New(rvn);
rvn->UnRef();
return result;
}
hsRef<RelVaultNode> rvn = VaultFindAgeSubAgeLink(info.GetAgeInfo());
if (rvn)
return pyVaultAgeLinkNode::New(rvn);
// just return a None object
PYTHON_RETURN_NONE;
@ -186,12 +162,10 @@ PyObject* pyAgeVault::GetSubAgeLink( const pyAgeInfoStruct & info )
plUUID pyAgeVault::GetAgeGuid( void )
{
RelVaultNode * rvn = VaultGetAgeInfoNodeIncRef();
hsRef<RelVaultNode> rvn = VaultGetAgeInfoNode();
if (rvn) {
VaultAgeInfoNode ageInfo(rvn);
plUUID uuid = ageInfo.GetAgeInstanceGuid();
rvn->UnRef();
return uuid;
return ageInfo.GetAgeInstanceGuid();
}
return kNilUuid;
}
@ -204,11 +178,8 @@ PyObject* pyAgeVault::FindChronicleEntry( const char * entryName )
wchar_t wEntryName[kMaxVaultNodeStringLength];
StrToUnicode(wEntryName, entryName, arrsize(wEntryName));
if (RelVaultNode * rvn = VaultFindAgeChronicleEntryIncRef(wEntryName)) {
PyObject * result = pyVaultChronicleNode::New(rvn);
rvn->UnRef();
return result;
}
if (hsRef<RelVaultNode> rvn = VaultFindAgeChronicleEntry(wEntryName))
return pyVaultChronicleNode::New(rvn);
// just return a None object
PYTHON_RETURN_NONE;
@ -235,10 +206,8 @@ void pyAgeVault::AddDevice( const char * deviceName, PyObject * cbObject, uint32
wchar_t wStr[MAX_PATH];
StrToUnicode(wStr, deviceName, arrsize(wStr));
if (RelVaultNode * rvn = VaultAgeAddDeviceAndWaitIncRef(wStr)) {
if (hsRef<RelVaultNode> rvn = VaultAgeAddDeviceAndWait(wStr))
cb->SetNode(rvn);
rvn->UnRef();
}
cb->VaultOperationComplete( cbContext, cb->GetNode() ? hsOK : hsFail); // cbHolder deletes itself here.
}
@ -266,11 +235,8 @@ PyObject * pyAgeVault::GetDevice( const char * deviceName )
wchar_t wStr[MAX_PATH];
StrToUnicode(wStr, deviceName, arrsize(wStr));
if (RelVaultNode * rvn = VaultAgeGetDeviceIncRef(wStr)) {
PyObject * result = pyVaultTextNoteNode::New(rvn);
rvn->UnRef();
return result;
}
if (hsRef<RelVaultNode> rvn = VaultAgeGetDevice(wStr))
return pyVaultTextNoteNode::New(rvn);
PYTHON_RETURN_NONE;
}
@ -286,10 +252,8 @@ void pyAgeVault::SetDeviceInbox( const char * deviceName, const char * inboxName
wchar_t wInb[MAX_PATH];
StrToUnicode(wInb, inboxName, arrsize(wInb));
if (RelVaultNode * rvn = VaultAgeSetDeviceInboxAndWaitIncRef(wDev, wInb)) {
if (hsRef<RelVaultNode> rvn = VaultAgeSetDeviceInboxAndWait(wDev, wInb))
cb->SetNode(rvn);
rvn->UnRef();
}
cb->VaultOperationComplete( cbContext, cb->GetNode() ? hsOK : hsFail ); // cbHolder deletes itself here.
}
@ -299,11 +263,8 @@ PyObject * pyAgeVault::GetDeviceInbox( const char * deviceName )
wchar_t wStr[MAX_PATH];
StrToUnicode(wStr, deviceName, arrsize(wStr));
if (RelVaultNode * rvn = VaultAgeGetDeviceInboxIncRef(wStr)) {
PyObject * result = pyVaultTextNoteNode::New(rvn);
rvn->UnRef();
return result;
}
if (hsRef<RelVaultNode> rvn = VaultAgeGetDeviceInbox(wStr))
return pyVaultTextNoteNode::New(rvn);
PYTHON_RETURN_NONE;
}
@ -331,14 +292,10 @@ void pyAgeVault::UpdateAgeSDL( pySDLStateDataRecord & pyrec )
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;
}
if (hsRef<RelVaultNode> rvn = VaultGetAgeNode()) {
hsRef<RelVaultNode> find = rvn->GetChildNode(templateNode->fNode, 1);
if (find)
return pyVaultNode::New(find);
}
PYTHON_RETURN_NONE;

13
Sources/Plasma/FeatureLib/pfPython/pyDniInfoSource.cpp

@ -71,7 +71,7 @@ PyObject* pyDniInfoSource::GetAgeCoords( void )
uint32_t pyDniInfoSource::GetAgeTime( void ) const
{
RelVaultNode * node = VaultGetAgeInfoNodeIncRef();
hsRef<RelVaultNode> node = VaultGetAgeInfoNode();
if (!node)
return 0;
@ -81,34 +81,29 @@ uint32_t pyDniInfoSource::GetAgeTime( void ) const
result = (uint32_t)utime->GetSecs();
else
result = 0;
node->UnRef();
return result;
}
const char * pyDniInfoSource::GetAgeName( void ) const
{
RelVaultNode * node = VaultGetAgeInfoNodeIncRef();
hsRef<RelVaultNode> node = VaultGetAgeInfoNode();
if (!node)
return "";
VaultAgeInfoNode ageInfo(node);
fAgeName = StrDupToAnsi(ageInfo.GetAgeInstanceName());
node->UnRef();
return fAgeName;
}
plUUID pyDniInfoSource::GetAgeGuid( void ) const
{
if (RelVaultNode * node = VaultGetAgeInfoNodeIncRef())
if (hsRef<RelVaultNode> node = VaultGetAgeInfoNode())
{
VaultAgeInfoNode ageInfo(node);
plUUID uuid = ageInfo.GetAgeInstanceGuid();
node->UnRef();
return uuid;
return ageInfo.GetAgeInstanceGuid();
}
return kNilUuid;

12
Sources/Plasma/FeatureLib/pfPython/pyGameScore.cpp

@ -125,11 +125,10 @@ void pyGameScore::SetPoints(int32_t numPoints, pyKey& rcvr)
void pyGameScore::CreateAgeScore(const plString& name, uint32_t type, int32_t points, pyKey& rcvr)
{
if (RelVaultNode* ageInfo = VaultGetAgeInfoNodeIncRef())
if (hsRef<RelVaultNode> ageInfo = VaultGetAgeInfoNode())
{
uint32_t ownerId = ageInfo->GetNodeId();
pfGameScore::Create(ownerId, name, type, points, rcvr.getKey());
ageInfo->UnRef();
} else
hsAssert(false, "Age has no vault... Need to rewrite score python script?");
}
@ -141,11 +140,10 @@ void pyGameScore::CreateGlobalScore(const plString& name, uint32_t type, int32_t
void pyGameScore::CreatePlayerScore(const plString& name, uint32_t type, int32_t points, pyKey& rcvr)
{
if (RelVaultNode* node = VaultGetPlayerInfoNodeIncRef())
if (hsRef<RelVaultNode> node = VaultGetPlayerInfoNode())
{
uint32_t ownerId = node->GetNodeId();
pfGameScore::Create(ownerId, name, type, points, rcvr.getKey());
node->UnRef();
} else
hsAssert(false, "No PlayerInfo node... Need to rewrite python script?");
}
@ -157,11 +155,10 @@ void pyGameScore::CreateScore(uint32_t ownerId, const plString& name, uint32_t t
void pyGameScore::FindAgeScores(const plString& name, pyKey& rcvr)
{
if (RelVaultNode* ageInfo = VaultGetAgeInfoNodeIncRef())
if (hsRef<RelVaultNode> ageInfo = VaultGetAgeInfoNode())
{
uint32_t ownerId = ageInfo->GetNodeId();
pfGameScore::Find(ownerId, name, rcvr.getKey());
ageInfo->UnRef();
} else
hsAssert(false, "Age has no vault... Need to rewrite score python script?");
}
@ -173,11 +170,10 @@ void pyGameScore::FindGlobalScores(const plString& name, pyKey& rcvr)
void pyGameScore::FindPlayerScores(const plString& name, pyKey& rcvr)
{
if (RelVaultNode* node = VaultGetPlayerInfoNodeIncRef())
if (hsRef<RelVaultNode> node = VaultGetPlayerInfoNode())
{
uint32_t ownerId = node->GetNodeId();
pfGameScore::Find(ownerId, name, rcvr.getKey());
node->UnRef();
}
else
hsAssert(false, "No PlayerInfo node.. Need to rewrite python script?");

130
Sources/Plasma/FeatureLib/pfPython/pyVault.cpp

@ -81,12 +81,9 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
//============================================================================
static PyObject * GetFolder (unsigned folderType) {
PyObject * result = nil;
if (RelVaultNode * rvnPlr = VaultGetPlayerNodeIncRef()) {
if (RelVaultNode * rvnFldr = rvnPlr->GetChildFolderNodeIncRef(folderType, 1)) {
if (hsRef<RelVaultNode> rvnPlr = VaultGetPlayerNode()) {
if (hsRef<RelVaultNode> rvnFldr = rvnPlr->GetChildFolderNode(folderType, 1))
result = pyVaultFolderNode::New(rvnFldr);
rvnFldr->UnRef();
}
rvnPlr->UnRef();
}
return result;
@ -95,12 +92,9 @@ static PyObject * GetFolder (unsigned folderType) {
//============================================================================
static PyObject * GetPlayerInfoList (unsigned folderType) {
PyObject * result = nil;
if (RelVaultNode * rvnPlr = VaultGetPlayerNodeIncRef()) {
if (RelVaultNode * rvnFldr = rvnPlr->GetChildPlayerInfoListNodeIncRef(folderType, 1)) {
if (hsRef<RelVaultNode> rvnPlr = VaultGetPlayerNode()) {
if (hsRef<RelVaultNode> rvnFldr = rvnPlr->GetChildPlayerInfoListNode(folderType, 1))
result = pyVaultPlayerInfoListNode::New(rvnFldr);
rvnFldr->UnRef();
}
rvnPlr->UnRef();
}
return result;
@ -109,12 +103,9 @@ static PyObject * GetPlayerInfoList (unsigned folderType) {
//============================================================================
static PyObject * GetAgeInfoList (unsigned folderType) {
PyObject * result = nil;
if (RelVaultNode * rvnPlr = VaultGetPlayerNodeIncRef()) {
if (RelVaultNode * rvnFldr = rvnPlr->GetChildAgeInfoListNodeIncRef(folderType, 1)) {
if (hsRef<RelVaultNode> rvnPlr = VaultGetPlayerNode()) {
if (hsRef<RelVaultNode> rvnFldr = rvnPlr->GetChildAgeInfoListNode(folderType, 1))
result = pyVaultAgeInfoListNode::New(rvnFldr);
rvnFldr->UnRef();
}
rvnPlr->UnRef();
}
return result;
@ -124,12 +115,9 @@ static PyObject * GetAgeInfoList (unsigned folderType) {
PyObject* pyVault::GetPlayerInfo()
{
PyObject * result = nil;
if (RelVaultNode * rvnPlr = VaultGetPlayerNodeIncRef()) {
if (RelVaultNode * rvnPlrInfo = rvnPlr->GetChildNodeIncRef(plVault::kNodeType_PlayerInfo, 1)) {
if (hsRef<RelVaultNode> rvnPlr = VaultGetPlayerNode()) {
if (hsRef<RelVaultNode> rvnPlrInfo = rvnPlr->GetChildNode(plVault::kNodeType_PlayerInfo, 1))
result = pyVaultPlayerInfoNode::New(rvnPlrInfo);
rvnPlrInfo->UnRef();
}
rvnPlr->UnRef();
}
// just return an empty node
@ -208,12 +196,12 @@ PyObject* pyVault::GetKIUsage(void)
uint32_t markerGames = 0;
for (;;) {
RelVaultNode * rvnPlr = VaultGetPlayerNodeIncRef();
hsRef<RelVaultNode> rvnPlr = VaultGetPlayerNode();
if (!rvnPlr)
break;
for (;;) {
RelVaultNode * rvnAgeJrnlz = rvnPlr->GetChildFolderNodeIncRef(plVault::kAgeJournalsFolder, 1);
hsRef<RelVaultNode> rvnAgeJrnlz = rvnPlr->GetChildFolderNode(plVault::kAgeJournalsFolder, 1);
if (!rvnAgeJrnlz)
break;
@ -234,10 +222,8 @@ PyObject* pyVault::GetKIUsage(void)
rvn->UnRef();
}
rvnAgeJrnlz->UnRef();
break;
}
rvnPlr->UnRef();
break;
}
@ -303,11 +289,8 @@ PyObject* pyVault::GetLinkToMyNeighborhood() const
plAgeInfoStruct info;
info.SetAgeFilename(kNeighborhoodAgeFilename);
if (RelVaultNode * rvn = VaultGetOwnedAgeLinkIncRef(&info)) {
PyObject * result = pyVaultAgeLinkNode::New(rvn);
rvn->UnRef();
return result;
}
if (hsRef<RelVaultNode> rvn = VaultGetOwnedAgeLink(&info))
return pyVaultAgeLinkNode::New(rvn);
PYTHON_RETURN_NONE;
}
@ -317,11 +300,8 @@ PyObject* pyVault::GetLinkToCity() const
plAgeInfoStruct info;
info.SetAgeFilename(kCityAgeFilename);
if (RelVaultNode * rvn = VaultGetOwnedAgeLinkIncRef(&info)) {
PyObject * result = pyVaultAgeLinkNode::New(rvn);
rvn->UnRef();
return result;
}
if (hsRef<RelVaultNode> rvn = VaultGetOwnedAgeLink(&info))
return pyVaultAgeLinkNode::New(rvn);
PYTHON_RETURN_NONE;
}
@ -330,11 +310,8 @@ PyObject* pyVault::GetLinkToCity() const
// Owned ages
PyObject* pyVault::GetOwnedAgeLink( const pyAgeInfoStruct & info )
{
if (RelVaultNode * rvnLink = VaultGetOwnedAgeLinkIncRef(info.GetAgeInfo())) {
PyObject * result = pyVaultAgeLinkNode::New(rvnLink);
rvnLink->UnRef();
return result;
}
if (hsRef<RelVaultNode> rvnLink = VaultGetOwnedAgeLink(info.GetAgeInfo()))
return pyVaultAgeLinkNode::New(rvnLink);
// just return a None object
PYTHON_RETURN_NONE;
@ -343,11 +320,8 @@ PyObject* pyVault::GetOwnedAgeLink( const pyAgeInfoStruct & info )
// Visit ages
PyObject* pyVault::GetVisitAgeLink( const pyAgeInfoStruct & info)
{
if (RelVaultNode * rvnLink = VaultGetVisitAgeLinkIncRef(info.GetAgeInfo())) {
PyObject * result = pyVaultAgeLinkNode::New(rvnLink);
rvnLink->UnRef();
return result;
}
if (hsRef<RelVaultNode> rvnLink = VaultGetVisitAgeLink(info.GetAgeInfo()))
return pyVaultAgeLinkNode::New(rvnLink);
// just return a None object
PYTHON_RETURN_NONE;
@ -361,11 +335,8 @@ PyObject* pyVault::FindChronicleEntry( const char * entryName )
wchar_t wEntryName[kMaxVaultNodeStringLength];
StrToUnicode(wEntryName, entryName, arrsize(wEntryName));
if (RelVaultNode * rvn = VaultFindChronicleEntryIncRef(wEntryName)) {
PyObject * result = pyVaultChronicleNode::New(rvn);
rvn->UnRef();
return result;
}
if (hsRef<RelVaultNode> rvn = VaultFindChronicleEntry(wEntryName))
return pyVaultChronicleNode::New(rvn);
// just return a None object
PYTHON_RETURN_NONE;
@ -441,10 +412,9 @@ PyObject* pyVault::GetInviteFolder()
PyObject* pyVault::GetPsnlAgeSDL() const
{
PyObject * result = nil;
NetVaultNode * templateNode = new NetVaultNode;
templateNode->Ref();
hsRef<NetVaultNode> templateNode = new NetVaultNode;
if (RelVaultNode * rvnFldr = VaultGetAgesIOwnFolderIncRef()) {
if (hsRef<RelVaultNode> rvnFldr = VaultGetAgesIOwnFolder()) {
templateNode->ClearFieldFlags();
templateNode->SetNodeType(plVault::kNodeType_AgeInfo);
@ -453,27 +423,22 @@ PyObject* pyVault::GetPsnlAgeSDL() const
StrToUnicode(str, kPersonalAgeFilename, arrsize(str));
ageInfo.SetAgeFilename(str);
if (RelVaultNode * rvnInfo = rvnFldr->GetChildNodeIncRef(templateNode, 2)) {
if (hsRef<RelVaultNode> rvnInfo = rvnFldr->GetChildNode(templateNode, 2)) {
templateNode->ClearFieldFlags();
templateNode->SetNodeType(plVault::kNodeType_SDL);
if (RelVaultNode * rvnSdl = rvnInfo->GetChildNodeIncRef(templateNode, 1)) {
if (hsRef<RelVaultNode> rvnSdl = rvnInfo->GetChildNode(templateNode, 1)) {
VaultSDLNode sdl(rvnSdl);
plStateDataRecord * rec = new plStateDataRecord;
if (sdl.GetStateDataRecord(rec, plSDL::kKeepDirty))
result = pySDLStateDataRecord::New(rec);
else
delete rec;
rvnSdl->UnRef();
}
rvnInfo->UnRef();
}
rvnFldr->UnRef();
}
templateNode->UnRef();
if (!result)
PYTHON_RETURN_NONE;
@ -486,10 +451,9 @@ void pyVault::UpdatePsnlAgeSDL( pySDLStateDataRecord & pyrec )
if ( !rec )
return;
NetVaultNode * templateNode = new NetVaultNode;
templateNode->Ref();
hsRef<NetVaultNode> templateNode = new NetVaultNode;
if (RelVaultNode * rvnFldr = VaultGetAgesIOwnFolderIncRef()) {
if (hsRef<RelVaultNode> rvnFldr = VaultGetAgesIOwnFolder()) {
templateNode->ClearFieldFlags();
templateNode->SetNodeType(plVault::kNodeType_AgeInfo);
@ -498,22 +462,17 @@ void pyVault::UpdatePsnlAgeSDL( pySDLStateDataRecord & pyrec )
StrToUnicode(str, kPersonalAgeFilename, arrsize(str));
ageInfo.SetAgeFilename(str);
if (RelVaultNode * rvnInfo = rvnFldr->GetChildNodeIncRef(templateNode, 2)) {
if (hsRef<RelVaultNode> rvnInfo = rvnFldr->GetChildNode(templateNode, 2)) {
templateNode->ClearFieldFlags();
templateNode->SetNodeType(plVault::kNodeType_SDL);
if (RelVaultNode * rvnSdl = rvnInfo->GetChildNodeIncRef(templateNode, 1)) {
if (hsRef<RelVaultNode> rvnSdl = rvnInfo->GetChildNode(templateNode, 1)) {
VaultSDLNode sdl(rvnSdl);
sdl.SetStateDataRecord(rec, plSDL::kDirtyOnly | plSDL::kTimeStampOnRead);
rvnSdl->UnRef();
}
rvnInfo->UnRef();
}
rvnFldr->UnRef();
}
templateNode->UnRef();
}
bool pyVault::InMyPersonalAge() const
@ -622,24 +581,19 @@ void pyVault::UnInvitePlayerToAge( const char * str, uint32_t playerID )
plUUID guid(str);
info.SetAgeInstanceGuid(&guid);
if (RelVaultNode * rvnLink = VaultGetOwnedAgeLinkIncRef(&info)) {
if (RelVaultNode * rvnInfo = rvnLink->GetChildNodeIncRef(plVault::kNodeType_AgeInfo, 1)) {
if (hsRef<RelVaultNode> rvnLink = VaultGetOwnedAgeLink(&info)) {
if (hsRef<RelVaultNode> rvnInfo = rvnLink->GetChildNode(plVault::kNodeType_AgeInfo, 1)) {
VaultAgeInfoNode ageInfo(rvnInfo);
ageInfo.CopyTo(&info);
rvnInfo->UnRef();
}
rvnLink->UnRef();
}
NetVaultNode * templateNode = new NetVaultNode;
templateNode->Ref();
hsRef<NetVaultNode> templateNode = new NetVaultNode;
templateNode->SetNodeType(plVault::kNodeType_TextNote);
VaultTextNoteNode visitAcc(templateNode);
visitAcc.SetNoteType(plVault::kNoteType_UnVisit);
visitAcc.SetVisitInfo(info);
VaultCreateNode(templateNode, (FVaultCreateNodeCallback)_UninvitePlayerToAge, nil, (void*)playerID);
templateNode->UnRef();
}
//============================================================================
@ -696,12 +650,8 @@ bool pyVault::SetAgePublic( const pyAgeInfoStruct * ageInfo, bool makePublic )
PyObject* pyVault::GetGlobalInbox()
{
PyObject * result = nil;
if (RelVaultNode * rvnGlobalInbox = VaultGetGlobalInboxIncRef()) {
result = pyVaultFolderNode::New(rvnGlobalInbox);
rvnGlobalInbox->UnRef();
return result;
}
if (hsRef<RelVaultNode> rvnGlobalInbox = VaultGetGlobalInbox())
return pyVaultFolderNode::New(rvnGlobalInbox);
PYTHON_RETURN_NONE;
}
@ -712,11 +662,8 @@ PyObject* pyVault::GetGlobalInbox()
PyObject* pyVault::FindNode( pyVaultNode* templateNode ) const
{
// See if we already have a matching node locally
if (RelVaultNode * rvn = VaultGetNodeIncRef(templateNode->GetNode())) {
PyObject * result = pyVaultNode::New(rvn);
rvn->UnRef();
return result;
}
if (hsRef<RelVaultNode> rvn = VaultGetNode(templateNode->GetNode()))
return pyVaultNode::New(rvn);
// See if a matching node exists on the server
ARRAY(unsigned) nodeIds;
@ -726,11 +673,8 @@ PyObject* pyVault::FindNode( pyVaultNode* templateNode ) const
// Only fetch the first matching node since this function returns a single node
VaultFetchNodesAndWait(&nodeIds[0], 1);
// If we fetched it successfully then it'll be in our local node cache now
if (RelVaultNode * rvn = VaultGetNodeIncRef(nodeIds[0])) {
PyObject * result = pyVaultNode::New(rvn);
rvn->UnRef();
return result;
}
if (hsRef<RelVaultNode> rvn = VaultGetNode(nodeIds[0]))
return pyVaultNode::New(rvn);
}
PYTHON_RETURN_NONE;

15
Sources/Plasma/FeatureLib/pfPython/pyVaultAgeInfoNode.cpp

@ -89,20 +89,16 @@ static PyObject * GetChildFolder (RelVaultNode * node, unsigned type) {
//============================================================================
static PyObject * GetChildPlayerInfoList (RelVaultNode * node, unsigned type) {
PyObject * result = nil;
if (RelVaultNode * rvn = node->GetChildPlayerInfoListNodeIncRef(type, 1)) {
if (hsRef<RelVaultNode> rvn = node->GetChildPlayerInfoListNode(type, 1))
result = pyVaultPlayerInfoListNode::New(rvn);
rvn->UnRef();
}
return result;
}
//============================================================================
static PyObject * GetChildAgeInfoList (RelVaultNode * node, unsigned type) {
PyObject * result = nil;
if (RelVaultNode * rvn = node->GetChildAgeInfoListNodeIncRef(type, 1)) {
if (hsRef<RelVaultNode> rvn = node->GetChildAgeInfoListNode(type, 1))
result = pyVaultAgeInfoListNode::New(rvn);
rvn->UnRef();
}
return result;
}
@ -173,11 +169,8 @@ PyObject * pyVaultAgeInfoNode::GetParentAgeLink () const
if (!fNode)
PYTHON_RETURN_NONE;
if (RelVaultNode * rvn = fNode->GetParentAgeLinkIncRef()) {
PyObject * result = pyVaultAgeLinkNode::New(rvn);
rvn->UnRef();
return result;
}
if (hsRef<RelVaultNode> rvn = fNode->GetParentAgeLink())
return pyVaultAgeLinkNode::New(rvn);
// just return a None object.
PYTHON_RETURN_NONE

4
Sources/Plasma/FeatureLib/pfPython/pyVaultAgeLinkNode.cpp

@ -82,10 +82,8 @@ PyObject* pyVaultAgeLinkNode::GetAgeInfo() const
PYTHON_RETURN_NONE;
PyObject * result = nil;
if (RelVaultNode * rvn = fNode->GetChildNodeIncRef(plVault::kNodeType_AgeInfo, 1)) {
if (hsRef<RelVaultNode> rvn = fNode->GetChildNode(plVault::kNodeType_AgeInfo, 1))
result = pyVaultAgeInfoNode::New(rvn);
rvn->UnRef();
}
if (result)
return result;

47
Sources/Plasma/FeatureLib/pfPython/pyVaultNode.cpp

@ -270,17 +270,13 @@ PyObject* pyVaultNode::GetCreatorNode( void )
PyObject * result = nil;
if (fNode)
{
RelVaultNode * templateNode = new RelVaultNode;
templateNode->Ref();
hsRef<RelVaultNode> templateNode = new RelVaultNode;
templateNode->SetNodeType(plVault::kNodeType_PlayerInfo);
VaultPlayerInfoNode plrInfo(templateNode);
plrInfo.SetPlayerId(fNode->GetCreatorId());
if (RelVaultNode * rvn = VaultGetNodeIncRef(templateNode)) {
if (hsRef<RelVaultNode> rvn = VaultGetNode(templateNode))
result = pyVaultPlayerInfoNode::New(rvn);
rvn->UnRef();
}
templateNode->UnRef();
}
if (result)
@ -417,7 +413,7 @@ PyObject* pyVaultNode::AddNode(pyVaultNode* pynode, PyObject* cbObject, uint32_t
// Block here until node is created and fetched =(
ASSERT(pynode->GetNode()->GetNodeType());
ENetError result;
RelVaultNode * newNode = VaultCreateNodeAndWaitIncRef(
hsRef<RelVaultNode> newNode = VaultCreateNodeAndWait(
pynode->GetNode(),
&result
);
@ -468,10 +464,9 @@ void pyVaultNode::LinkToNode(int nodeID, PyObject* cbObject, uint32_t cbContext)
// Hack the callbacks until vault notification is in place
cb->VaultOperationStarted( cbContext );
if (RelVaultNode * rvn = VaultGetNodeIncRef(nodeID)) {
if (hsRef<RelVaultNode> rvn = VaultGetNode(nodeID)) {
cb->SetNode(rvn);
cb->fPyNodeRef = pyVaultNodeRef::New(fNode, rvn);
rvn->UnRef();
}
VaultAddChildNode(fNode->GetNodeId(),
@ -535,7 +530,8 @@ void pyVaultNode::Save(PyObject* cbObject, uint32_t cbContext)
// otherwise just ignore the save request since vault nodes are now auto-saved.
if (!fNode->GetNodeId() && fNode->GetNodeType()) {
ENetError result;
if (RelVaultNode * node = VaultCreateNodeAndWaitIncRef(fNode, &result)) {
if (hsRef<RelVaultNode> node = VaultCreateNodeAndWait(fNode, &result)) {
node->Ref();
fNode->UnRef();
fNode = node;
}
@ -559,7 +555,8 @@ void pyVaultNode::ForceSave()
{
if (!fNode->GetNodeId() && fNode->GetNodeType()) {
ENetError result;
if (RelVaultNode * node = VaultCreateNodeAndWaitIncRef(fNode, &result)) {
if (hsRef<RelVaultNode> node = VaultCreateNodeAndWait(fNode, &result)) {
node->Ref();
fNode->UnRef();
fNode = node;
}
@ -578,7 +575,8 @@ void pyVaultNode::SendTo(uint32_t destClientNodeID, PyObject* cbObject, uint32_t
// If the node doesn't have an id, then use it as a template to create the node in the vault,
if (!fNode->GetNodeId() && fNode->GetNodeType()) {
ENetError result;
if (RelVaultNode * node = VaultCreateNodeAndWaitIncRef(fNode, &result)) {
if (hsRef<RelVaultNode> node = VaultCreateNodeAndWait(fNode, &result)) {
node->Ref();
fNode->UnRef();
fNode = node;
}
@ -656,14 +654,10 @@ PyObject * pyVaultNode::GetNode2( uint32_t nodeID ) const
PyObject * result = nil;
if ( fNode )
{
RelVaultNode * templateNode = new RelVaultNode;
templateNode->Ref();
hsRef<RelVaultNode> templateNode = new RelVaultNode;
templateNode->SetNodeId(nodeID);
if (RelVaultNode * rvn = fNode->GetChildNodeIncRef(templateNode, 1)) {
if (hsRef<RelVaultNode> rvn = fNode->GetChildNode(templateNode, 1))
result = pyVaultNodeRef::New(fNode, rvn);
rvn->UnRef();
}
templateNode->UnRef();
}
if (result)
@ -677,10 +671,8 @@ PyObject* pyVaultNode::FindNode( pyVaultNode * templateNode )
PyObject * result = nil;
if ( fNode && templateNode->fNode )
{
if (RelVaultNode * rvn = fNode->GetChildNodeIncRef(templateNode->fNode, 1)) {
if (hsRef<RelVaultNode> rvn = fNode->GetChildNode(templateNode->fNode, 1))
result = pyVaultNode::New(rvn);
rvn->UnRef();
}
}
if (result)
@ -694,17 +686,12 @@ PyObject * pyVaultNode::GetChildNode (unsigned nodeId) {
if (!fNode)
PYTHON_RETURN_NONE;
RelVaultNode * templateNode = new RelVaultNode;
templateNode->Ref();
hsRef<RelVaultNode> templateNode = new RelVaultNode;
templateNode->SetNodeId(nodeId);
RelVaultNode * rvn = fNode->GetChildNodeIncRef(templateNode, 1);
templateNode->UnRef();
hsRef<RelVaultNode> rvn = fNode->GetChildNode(templateNode, 1);
if (rvn) {
PyObject * result = pyVaultNode::New(rvn);
rvn->UnRef();
return result;
}
if (rvn)
return pyVaultNode::New(rvn);
PYTHON_RETURN_NONE;
}

22
Sources/Plasma/FeatureLib/pfPython/pyVaultNodeRef.cpp

@ -113,10 +113,8 @@ unsigned pyVaultNodeRef::GetSaverID () {
return 0;
unsigned saverId = 0;
if (RelVaultNode * child = VaultGetNodeIncRef(fChild->GetNodeId())) {
if (hsRef<RelVaultNode> child = VaultGetNode(fChild->GetNodeId()))
saverId = child->GetRefOwnerId(fParent->GetNodeId());
child->UnRef();
}
return saverId;
}
@ -124,36 +122,30 @@ PyObject * pyVaultNodeRef::GetSaver () {
if (!fParent || !fChild)
return 0;
RelVaultNode * saver = nil;
if (RelVaultNode * child = VaultGetNodeIncRef(fChild->GetNodeId())) {
hsRef<RelVaultNode> saver;
if (hsRef<RelVaultNode> child = VaultGetNode(fChild->GetNodeId())) {
if (unsigned saverId = child->GetRefOwnerId(fParent->GetNodeId())) {
// Find the player info node representing the saver
NetVaultNode * templateNode = new NetVaultNode;
templateNode->Ref();
hsRef<NetVaultNode> templateNode = new NetVaultNode;
templateNode->SetNodeType(plVault::kNodeType_PlayerInfo);
VaultPlayerInfoNode access(templateNode);
access.SetPlayerId(saverId);
saver = VaultGetNodeIncRef(templateNode);
saver = VaultGetNode(templateNode);
if (!saver) {
ARRAY(unsigned) nodeIds;
VaultFindNodesAndWait(templateNode, &nodeIds);
if (nodeIds.Count() > 0) {
VaultFetchNodesAndWait(nodeIds.Ptr(), nodeIds.Count());
saver = VaultGetNodeIncRef(nodeIds[0]);
saver = VaultGetNode(nodeIds[0]);
}
}
templateNode->UnRef();
}
child->UnRef();
}
if (!saver)
PYTHON_RETURN_NONE;
PyObject * result = pyVaultPlayerInfoNode::New(saver);
saver->UnRef();
return result;
return pyVaultPlayerInfoNode::New(saver);
}
bool pyVaultNodeRef::BeenSeen () {

26
Sources/Plasma/FeatureLib/pfPython/pyVaultPlayerInfoListNode.cpp

@ -79,17 +79,13 @@ bool pyVaultPlayerInfoListNode::HasPlayer( uint32_t playerID )
if (!fNode)
return false;
NetVaultNode * templateNode = new NetVaultNode;
templateNode->Ref();
hsRef<NetVaultNode> templateNode = new NetVaultNode;
templateNode->SetNodeType(plVault::kNodeType_PlayerInfo);
VaultPlayerInfoNode access(templateNode);
access.SetPlayerId(playerID);
RelVaultNode * rvn = fNode->GetChildNodeIncRef(templateNode, 1);
if (rvn)
rvn->UnRef();
hsRef<RelVaultNode> rvn = fNode->GetChildNode(templateNode, 1);
templateNode->UnRef();
return (rvn != nil);
}
@ -131,18 +127,13 @@ void pyVaultPlayerInfoListNode::RemovePlayer( uint32_t playerID )
if (!fNode)
return;
NetVaultNode * templateNode = new NetVaultNode;
templateNode->Ref();
hsRef<NetVaultNode> templateNode = new NetVaultNode;
templateNode->SetNodeType(plVault::kNodeType_PlayerInfo);
VaultPlayerInfoNode access(templateNode);
access.SetPlayerId(playerID);
if (RelVaultNode * rvn = fNode->GetChildNodeIncRef(templateNode, 1)) {
if (hsRef<RelVaultNode> rvn = fNode->GetChildNode(templateNode, 1))
VaultRemoveChildNode(fNode->GetNodeId(), rvn->GetNodeId(), nil, nil);
rvn->UnRef();
}
templateNode->UnRef();
}
PyObject * pyVaultPlayerInfoListNode::GetPlayer( uint32_t playerID )
@ -150,19 +141,14 @@ PyObject * pyVaultPlayerInfoListNode::GetPlayer( uint32_t playerID )
if (!fNode)
PYTHON_RETURN_NONE;
NetVaultNode * templateNode = new NetVaultNode;
templateNode->Ref();
hsRef<NetVaultNode> templateNode = new NetVaultNode;
templateNode->SetNodeType(plVault::kNodeType_PlayerInfo);
VaultPlayerInfoNode access(templateNode);
access.SetPlayerId(playerID);
PyObject * result = nil;
if (RelVaultNode * rvn = fNode->GetChildNodeIncRef(templateNode, 1)) {
if (hsRef<RelVaultNode> rvn = fNode->GetChildNode(templateNode, 1))
result = pyVaultPlayerInfoNode::New(rvn);
rvn->UnRef();
}
templateNode->UnRef();
if (!result)
PYTHON_RETURN_NONE;

28
Sources/Plasma/FeatureLib/pfPython/pyVaultPlayerNode.cpp

@ -65,12 +65,9 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
//============================================================================
static PyObject * GetPlayerVaultFolder (unsigned folderType) {
PyObject * result = nil;
if (RelVaultNode * rvnPlr = VaultGetPlayerNodeIncRef()) {
if (RelVaultNode * rvnFldr = rvnPlr->GetChildFolderNodeIncRef(folderType, 1)) {
if (hsRef<RelVaultNode> rvnPlr = VaultGetPlayerNode()) {
if (hsRef<RelVaultNode> rvnFldr = rvnPlr->GetChildFolderNode(folderType, 1))
result = pyVaultFolderNode::New(rvnFldr);
rvnFldr->UnRef();
}
rvnPlr->UnRef();
}
return result;
@ -172,11 +169,8 @@ PyObject *pyVaultPlayerNode::GetAgesIOwnFolder()
PyObject *pyVaultPlayerNode::GetPlayerInfo()
{
if (RelVaultNode * rvn = VaultGetPlayerInfoNodeIncRef()) {
PyObject * result = pyVaultPlayerInfoNode::New(rvn);
rvn->UnRef();
return result;
}
if (hsRef<RelVaultNode> rvn = VaultGetPlayerInfoNode())
return pyVaultPlayerInfoNode::New(rvn);
PYTHON_RETURN_NONE;
}
@ -221,11 +215,8 @@ void pyVaultPlayerNode::RemoveOwnedAgeLink(const char* ageFilename)
PyObject *pyVaultPlayerNode::GetVisitAgeLink(const pyAgeInfoStruct *info)
{
if (RelVaultNode * rvn = VaultGetVisitAgeLinkIncRef(info->GetAgeInfo())) {
PyObject * result = pyVaultAgeLinkNode::New(rvn);
rvn->UnRef();
return result;
}
if (hsRef<RelVaultNode> rvn = VaultGetVisitAgeLink(info->GetAgeInfo()))
return pyVaultAgeLinkNode::New(rvn);
PYTHON_RETURN_NONE;
}
@ -242,11 +233,8 @@ PyObject *pyVaultPlayerNode::FindChronicleEntry(const char *entryName)
{
wchar_t wStr[MAX_PATH];
StrToUnicode(wStr, entryName, arrsize(wStr));
if (RelVaultNode * rvn = VaultFindChronicleEntryIncRef(wStr)) {
PyObject * result = pyVaultChronicleNode::New(rvn);
rvn->UnRef();
return result;
}
if (hsRef<RelVaultNode> rvn = VaultFindChronicleEntry(wStr))
return pyVaultChronicleNode::New(rvn);
PYTHON_RETURN_NONE;
}

4
Sources/Plasma/FeatureLib/pfPython/pyVaultTextNoteNode.cpp

@ -228,10 +228,8 @@ void pyVaultTextNoteNode::SetDeviceInbox( const char * devName, PyObject * cbObj
wchar_t wDev[MAX_PATH];
StrToUnicode(wDev, devName, arrsize(wDev));
if (RelVaultNode * rvn = VaultAgeSetDeviceInboxAndWaitIncRef(wDev, DEFAULT_DEVICE_INBOX)) {
if (hsRef<RelVaultNode> rvn = VaultAgeSetDeviceInboxAndWait(wDev, DEFAULT_DEVICE_INBOX))
cb->SetNode(rvn);
rvn->UnRef();
}
cb->VaultOperationComplete( cbContext, cb->GetNode() ? hsOK : hsFail ); // cbHolder deletes itself here.
}

45
Sources/Plasma/PubUtilLib/plAvatar/plAvatarClothing.cpp

@ -802,7 +802,7 @@ bool plClothingOutfit::IReadFromVault()
WearDefaultClothing();
RelVaultNode * rvn = VaultGetAvatarOutfitFolderIncRef();
hsRef<RelVaultNode> rvn = VaultGetAvatarOutfitFolder();
if (!rvn)
return false;
@ -837,7 +837,6 @@ bool plClothingOutfit::IReadFromVault()
fSynchClients = true; // set true if the next synch should be bcast
ForceUpdate(true);
rvn->UnRef();
return true;
}
@ -857,8 +856,8 @@ void plClothingOutfit::WriteToVault()
if (!fVaultSaveEnabled)
return;
RelVaultNode * rvn;
if (nil == (rvn = VaultGetAvatarOutfitFolderIncRef()))
hsRef<RelVaultNode> rvn = VaultGetAvatarOutfitFolder();
if (!rvn)
return;
ARRAY(plStateDataRecord*) SDRs;
@ -874,7 +873,6 @@ void plClothingOutfit::WriteToVault()
SDRs.Add(appearanceStateDesc->GetStateDataRecord(0));
WriteToVault(SDRs);
rvn->UnRef();
}
void plClothingOutfit::WriteToVault(const ARRAY(plStateDataRecord*) & SDRs)
@ -883,8 +881,8 @@ void plClothingOutfit::WriteToVault(const ARRAY(plStateDataRecord*) & SDRs)
if (fAvatar->GetTarget(0) != plNetClientApp::GetInstance()->GetLocalPlayer())
return;
RelVaultNode * rvn;
if (nil == (rvn = VaultGetAvatarOutfitFolderIncRef()))
hsRef<RelVaultNode> rvn = VaultGetAvatarOutfitFolder();
if (!rvn)
return;
ARRAY(plStateDataRecord*) morphs;
@ -922,25 +920,19 @@ void plClothingOutfit::WriteToVault(const ARRAY(plStateDataRecord*) & SDRs)
// Write all SDL to to the outfit folder, reusing existing nodes and creating new ones as necessary
for (unsigned i = 0; i < arr->Count(); ++i) {
RelVaultNode * node;
hsRef<RelVaultNode> node;
if (nodes.Count()) {
node = nodes[0];
nodes.DeleteUnordered(0);
node->Ref(); // REF: Work
node->UnRef(); // REF: Find
}
else {
RelVaultNode * templateNode = new RelVaultNode;
templateNode->SetNodeType(plVault::kNodeType_SDL);
templates.Add(templateNode);
node = templateNode;
node->Ref(); // REF: Create
node->Ref(); // REF: Work
node = new RelVaultNode;
node->SetNodeType(plVault::kNodeType_SDL);
templates.Add(node);
}
VaultSDLNode sdl(node);
sdl.SetStateDataRecord((*arr)[i], 0);
node->UnRef(); // REF: Work
}
}
@ -953,7 +945,8 @@ void plClothingOutfit::WriteToVault(const ARRAY(plStateDataRecord*) & SDRs)
// Create actual new nodes from their templates
for (unsigned i = 0; i < templates.Count(); ++i) {
ENetError result;
if (RelVaultNode * actual = VaultCreateNodeAndWaitIncRef(templates[i], &result)) {
if (hsRef<RelVaultNode> actual = VaultCreateNodeAndWait(templates[i], &result)) {
actual->Ref();
actuals.Add(actual);
}
templates[i]->UnRef(); // REF: Create
@ -1483,7 +1476,7 @@ bool plClothingOutfit::WriteToFile(const plFileName &filename)
if (!filename.IsValid())
return false;
RelVaultNode* rvn = VaultGetAvatarOutfitFolderIncRef();
hsRef<RelVaultNode> rvn = VaultGetAvatarOutfitFolder();
if (!rvn)
return false;
@ -1505,7 +1498,6 @@ bool plClothingOutfit::WriteToFile(const plFileName &filename)
S.Write(sdl.GetSDLDataLength(), sdl.GetSDLData());
nodes[i]->UnRef();
}
rvn->UnRef();
S.Close();
return true;
@ -1626,7 +1618,7 @@ plClothingElement *plClothingMgr::FindElementByName(const plString &name) const
void plClothingMgr::AddItemsToCloset(hsTArray<plClosetItem> &items)
{
RelVaultNode * rvn = VaultGetAvatarClosetFolderIncRef();
hsRef<RelVaultNode> rvn = VaultGetAvatarClosetFolder();
if (!rvn)
return;
@ -1663,23 +1655,20 @@ void plClothingMgr::AddItemsToCloset(hsTArray<plClosetItem> &items)
for (unsigned i = 0; i < templates.Count(); ++i) {
ENetError result;
if (RelVaultNode * actual = VaultCreateNodeAndWaitIncRef(templates[i], &result)) {
if (hsRef<RelVaultNode> actual = VaultCreateNodeAndWait(templates[i], &result)) {
VaultAddChildNodeAndWait(
rvn->GetNodeId(),
actual->GetNodeId(),
NetCommGetPlayer()->playerInt
);
actual->UnRef(); // REF: Create
}
templates[i]->UnRef(); // REF: Create
}
rvn->UnRef();
}
void plClothingMgr::GetClosetItems(hsTArray<plClosetItem> &out)
{
RelVaultNode * rvn = VaultGetAvatarClosetFolderIncRef();
hsRef<RelVaultNode> rvn = VaultGetAvatarClosetFolder();
if (!rvn)
return;
@ -1701,9 +1690,7 @@ void plClothingMgr::GetClosetItems(hsTArray<plClosetItem> &out)
out.Remove(i);
}
}
rvn->UnRef();
}
}
void plClothingMgr::GetAllWithSameMesh(plClothingItem *item, hsTArray<plClothingItem*> &out)
{

3
Sources/Plasma/PubUtilLib/plInputCore/plSceneInputInterface.cpp

@ -858,7 +858,7 @@ void plSceneInputInterface::ILinkOffereeToAge()
return;
}
}
else if (RelVaultNode * linkNode = VaultGetOwnedAgeLinkIncRef(&info)) {
else if (hsRef<RelVaultNode> linkNode = VaultGetOwnedAgeLink(&info)) {
// We have the age in our AgesIOwnFolder. If its volatile, dump it for the new one.
VaultAgeLinkNode linkAcc(linkNode);
if (linkAcc.GetVolatile()) {
@ -868,7 +868,6 @@ void plSceneInputInterface::ILinkOffereeToAge()
VaultRegisterOwnedAgeAndWait(&link);
}
}
linkNode->UnRef();
}
if (!fSpawnPoint.IsEmpty()) {

39
Sources/Plasma/PubUtilLib/plNetClient/plNetLinkingMgr.cpp

@ -513,13 +513,13 @@ bool plNetLinkingMgr::IProcessVaultNotifyMsg(plVaultNotifyMsg* msg)
return false;
plAgeLinkStruct* cur = GetAgeLink();
RelVaultNode* cVaultLink = nil;
hsRef<RelVaultNode> cVaultLink;
switch (msg->GetType())
{
case plVaultNotifyMsg::kRegisteredChildAgeLink:
case plVaultNotifyMsg::kRegisteredOwnedAge:
case plVaultNotifyMsg::kRegisteredSubAgeLink:
cVaultLink = VaultGetNodeIncRef(msg->GetArgs()->GetInt(plNetCommon::VaultTaskArgs::kAgeLinkNode));
cVaultLink = VaultGetNode(msg->GetArgs()->GetInt(plNetCommon::VaultTaskArgs::kAgeLinkNode));
break;
default:
return false;
@ -531,18 +531,15 @@ bool plNetLinkingMgr::IProcessVaultNotifyMsg(plVaultNotifyMsg* msg)
// It's very useful though...
VaultAgeLinkNode accLink(cVaultLink);
accLink.CopyTo(cur);
if (RelVaultNode* rvnInfo = cVaultLink->GetChildNodeIncRef(plVault::kNodeType_AgeInfo, 1))
if (hsRef<RelVaultNode> rvnInfo = cVaultLink->GetChildNode(plVault::kNodeType_AgeInfo, 1))
{
VaultAgeInfoNode accInfo(rvnInfo);
accInfo.CopyTo(cur->GetAgeInfo());
rvnInfo->UnRef();
}
IDoLink(fDeferredLink);
fDeferredLink = nil;
return true;
cVaultLink->UnRef();
}
return false;
@ -778,7 +775,7 @@ void plNetLinkingMgr::IPostProcessLink( void )
bool psnl = (info->GetAgeFilename().CompareI(kPersonalAgeFilename) == 0);
// Update our online status
if (RelVaultNode* rvnInfo = VaultGetPlayerInfoNodeIncRef()) {
if (hsRef<RelVaultNode> rvnInfo = VaultGetPlayerInfoNode()) {
VaultPlayerInfoNode accInfo(rvnInfo);
wchar_t ageInstName[MAX_PATH];
plUUID ageInstGuid = *info->GetAgeInstanceGuid();
@ -786,7 +783,6 @@ void plNetLinkingMgr::IPostProcessLink( void )
accInfo.SetAgeInstName(ageInstName);
accInfo.SetAgeInstUuid(ageInstGuid);
accInfo.SetOnline(true);
rvnInfo->UnRef();
}
switch (link->GetLinkingRules()) {
@ -797,8 +793,8 @@ void plNetLinkingMgr::IPostProcessLink( void )
break;
{ // Ensure we're in the AgeOwners folder
RelVaultNode* fldr = VaultGetAgeAgeOwnersFolderIncRef();
RelVaultNode* info = VaultGetPlayerInfoNodeIncRef();
hsRef<RelVaultNode> fldr = VaultGetAgeAgeOwnersFolder();
hsRef<RelVaultNode> info = VaultGetPlayerInfoNode();
if (fldr && info)
if (!fldr->IsParentOf(info->GetNodeId(), 1))
@ -809,11 +805,6 @@ void plNetLinkingMgr::IPostProcessLink( void )
nil,
nil
);
if (fldr)
fldr->UnRef();
if (info)
info->UnRef();
}
}
break;
@ -824,8 +815,8 @@ void plNetLinkingMgr::IPostProcessLink( void )
break;
{ // Ensure we're in the CanVisit folder
RelVaultNode* fldr = VaultGetAgeCanVisitFolderIncRef();
RelVaultNode* info = VaultGetPlayerInfoNodeIncRef();
hsRef<RelVaultNode> fldr = VaultGetAgeCanVisitFolder();
hsRef<RelVaultNode> info = VaultGetPlayerInfoNode();
if (fldr && info)
if (!fldr->IsParentOf(info->GetNodeId(), 1))
@ -836,11 +827,6 @@ void plNetLinkingMgr::IPostProcessLink( void )
nil,
nil
);
if (fldr)
fldr->UnRef();
if (info)
info->UnRef();
}
}
break;
@ -873,16 +859,15 @@ uint8_t plNetLinkingMgr::IPreProcessLink(void)
#if 0
// Appear offline until we're done linking
if (RelVaultNode * rvnInfo = VaultGetPlayerInfoNodeIncRef()) {
if (hsRef<RelVaultNode> rvnInfo = VaultGetPlayerInfoNode()) {
VaultPlayerInfoNode accInfo(rvnInfo);
accInfo.SetAgeInstName(nil);
accInfo.SetAgeInstUuid(kNilUuid);
accInfo.SetOnline(false);
rvnInfo->UnRef();
}
#else
// Update our online status
if (RelVaultNode * rvnInfo = VaultGetPlayerInfoNodeIncRef()) {
if (hsRef<RelVaultNode> rvnInfo = VaultGetPlayerInfoNode()) {
VaultPlayerInfoNode accInfo(rvnInfo);
wchar_t ageInstName[MAX_PATH];
plUUID ageInstGuid = *GetAgeLink()->GetAgeInfo()->GetAgeInstanceGuid();
@ -890,7 +875,6 @@ uint8_t plNetLinkingMgr::IPreProcessLink(void)
accInfo.SetAgeInstName(ageInstName);
accInfo.SetAgeInstUuid(ageInstGuid);
accInfo.SetOnline(true);
rvnInfo->UnRef();
}
#endif
@ -984,7 +968,7 @@ uint8_t plNetLinkingMgr::IPreProcessLink(void)
success = kLinkDeferred;
break;
}
else if (RelVaultNode* linkNode = VaultGetOwnedAgeLinkIncRef(&ageInfo)) {
else if (hsRef<RelVaultNode> linkNode = VaultGetOwnedAgeLink(&ageInfo)) {
// We have the age in our AgesIOwnFolder. If its volatile, dump it for the new one.
VaultAgeLinkNode linkAcc(linkNode);
if (linkAcc.GetVolatile()) {
@ -1035,7 +1019,6 @@ uint8_t plNetLinkingMgr::IPreProcessLink(void)
break;
}
}
linkNode->UnRef();
}
}

10
Sources/Plasma/PubUtilLib/plNetClientComm/plNetClientComm.cpp

@ -275,10 +275,9 @@ static void PlayerInitCallback (
// Ensure the city link has the required spawn points
plAgeInfoStruct info;
info.SetAgeFilename(kCityAgeFilename);
if (RelVaultNode * rvn = VaultGetOwnedAgeLinkIncRef(&info)) {
if (hsRef<RelVaultNode> rvn = VaultGetOwnedAgeLink(&info)) {
VaultAgeLinkNode acc(rvn);
acc.AddSpawnPoint(plSpawnPointInfo(kCityFerryTerminalLinkTitle, kCityFerryTerminalLinkSpawnPtName));
rvn->UnRef();
}
VaultProcessPlayerInbox();
@ -1119,14 +1118,12 @@ void NetCommSetActivePlayer (//--> plNetCommActivePlayerMsg
unsigned playerInt = 0;
if (s_player) {
if (RelVaultNode* rvn = VaultGetPlayerInfoNodeIncRef()) {
if (hsRef<RelVaultNode> rvn = VaultGetPlayerInfoNode()) {
VaultPlayerInfoNode pInfo(rvn);
pInfo.SetAgeInstName(nil);
pInfo.SetAgeInstUuid(kNilUuid);
pInfo.SetOnline(false);
NetCliAuthVaultNodeSave(rvn, nil, nil);
rvn->UnRef();
}
VaultCull(s_player->playerInt);
@ -1321,10 +1318,9 @@ void NetCommUpgradeVisitorToExplorer (
void NetCommSetCCRLevel (
unsigned ccrLevel
) {
if (RelVaultNode * rvnInfo = VaultGetPlayerInfoNodeIncRef()) {
if (hsRef<RelVaultNode> rvnInfo = VaultGetPlayerInfoNode()) {
VaultPlayerInfoNode pInfo(rvnInfo);
pInfo.SetCCRLevel(ccrLevel);
rvnInfo->UnRef();
}
NetCliAuthSetCCRLevel(ccrLevel);

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

File diff suppressed because it is too large Load Diff

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

@ -126,28 +126,28 @@ struct RelVaultNode : NetVaultNode {
unsigned maxDepth
);
// returns first matching node found
RelVaultNode * GetParentNodeIncRef (
// returns first matching node found
hsRef<RelVaultNode> GetParentNode (
NetVaultNode * templateNode,
unsigned maxDepth
);
RelVaultNode * GetChildNodeIncRef (
hsRef<RelVaultNode> GetChildNode (
NetVaultNode * templateNode,
unsigned maxDepth
);
RelVaultNode * GetChildNodeIncRef (
hsRef<RelVaultNode> GetChildNode (
unsigned nodeType,
unsigned maxDepth
);
RelVaultNode * GetChildFolderNodeIncRef (
hsRef<RelVaultNode> GetChildFolderNode (
unsigned folderType,
unsigned maxDepth
);
RelVaultNode * GetChildPlayerInfoListNodeIncRef (
hsRef<RelVaultNode> GetChildPlayerInfoListNode (
unsigned folderType,
unsigned maxDepth
);
RelVaultNode * GetChildAgeInfoListNodeIncRef (
hsRef<RelVaultNode> GetChildAgeInfoListNode (
unsigned folderType,
unsigned maxDepth
);
@ -183,7 +183,7 @@ struct RelVaultNode : NetVaultNode {
void PrintTree (FStateDump dumpProc, unsigned level);
// AgeInfoNode-specific (and it checks!)
RelVaultNode * GetParentAgeLinkIncRef ();
hsRef<RelVaultNode> GetParentAgeLink ();
};
@ -204,12 +204,9 @@ void VaultUpdate ();
*
***/
RelVaultNode * VaultGetNodeIncRef (
unsigned nodeId
);
RelVaultNode * VaultGetNodeIncRef (
NetVaultNode * templateNode
);
hsRef<RelVaultNode> VaultGetNode(unsigned nodeId);
hsRef<RelVaultNode> VaultGetNode(NetVaultNode * templateNode);
// VaultAddChildNode will download the child node if necessary
// the parent exists locally before making the callback.
typedef void (*FVaultAddChildNodeCallback)(
@ -272,11 +269,11 @@ void VaultCreateNode ( // non-blocking
void * state,
void * param
);
RelVaultNode * VaultCreateNodeAndWaitIncRef ( // block until completion. returns node. nil --> failure
hsRef<RelVaultNode> VaultCreateNodeAndWait ( // block until completion. returns node. nil --> failure
plVault::NodeTypes nodeType,
ENetError * result
);
RelVaultNode * VaultCreateNodeAndWaitIncRef ( // block until completion. returns node. nil --> failure
hsRef<RelVaultNode> VaultCreateNodeAndWait ( // block until completion. returns node. nil --> failure
NetVaultNode * templateNode,
ENetError * result
);
@ -303,7 +300,7 @@ void VaultLocalFindNodes (
NetVaultNode * templateNode,
ARRAY(unsigned) * nodeIds
);
void VaultFetchNodesAndWait ( // Use VaultGetNodeIncRef to access the fetched nodes
void VaultFetchNodesAndWait ( // Use VaultGetNode to access the fetched nodes
const unsigned nodeIds[],
unsigned count,
bool force = false
@ -330,32 +327,32 @@ void VaultInitAge (
*
***/
unsigned VaultGetPlayerId ();
RelVaultNode * VaultGetPlayerNodeIncRef ();
RelVaultNode * VaultGetPlayerInfoNodeIncRef ();
RelVaultNode * VaultGetAvatarOutfitFolderIncRef ();
RelVaultNode * VaultGetAvatarClosetFolderIncRef ();
bool VaultGetLinkToMyNeighborhood (plAgeLinkStruct * link);
bool VaultGetLinkToMyPersonalAge (plAgeLinkStruct * link);
bool VaultGetLinkToCity (plAgeLinkStruct * link);
RelVaultNode * VaultGetAgesIOwnFolderIncRef ();
RelVaultNode * VaultGetAgesICanVisitFolderIncRef ();
RelVaultNode * VaultGetPlayerInboxFolderIncRef ();
RelVaultNode * VaultGetOwnedAgeLinkIncRef (const plAgeInfoStruct * info);
RelVaultNode * VaultGetOwnedAgeInfoIncRef (const plAgeInfoStruct * info);
bool VaultGetOwnedAgeLink (const plAgeInfoStruct * info, plAgeLinkStruct * link);
bool VaultAddOwnedAgeSpawnPoint (const plUUID& ageInstId, const plSpawnPointInfo & spawnPt);
bool VaultSetOwnedAgePublicAndWait (const plAgeInfoStruct * info, bool publicOrNot);
RelVaultNode * VaultGetVisitAgeLinkIncRef (const plAgeInfoStruct * info);
bool VaultGetVisitAgeLink (const plAgeInfoStruct * info, class plAgeLinkStruct * link);
bool VaultRegisterOwnedAgeAndWait (const plAgeLinkStruct * link);
void VaultRegisterOwnedAge(const plAgeLinkStruct* link);
bool VaultRegisterVisitAgeAndWait (const plAgeLinkStruct * link);
void VaultRegisterVisitAge (const plAgeLinkStruct* link);
bool VaultUnregisterOwnedAgeAndWait (const plAgeInfoStruct * info);
bool VaultUnregisterVisitAgeAndWait (const plAgeInfoStruct * info);
RelVaultNode * VaultFindChronicleEntryIncRef (const wchar_t entryName[], int entryType = -1);
bool VaultHasChronicleEntry (const wchar_t entryName[], int entryType = -1);
unsigned VaultGetPlayerId();
hsRef<RelVaultNode> VaultGetPlayerNode();
hsRef<RelVaultNode> VaultGetPlayerInfoNode();
hsRef<RelVaultNode> VaultGetAvatarOutfitFolder();
hsRef<RelVaultNode> VaultGetAvatarClosetFolder();
bool VaultGetLinkToMyNeighborhood(plAgeLinkStruct * link);
bool VaultGetLinkToMyPersonalAge(plAgeLinkStruct * link);
bool VaultGetLinkToCity(plAgeLinkStruct * link);
hsRef<RelVaultNode> VaultGetAgesIOwnFolder();
hsRef<RelVaultNode> VaultGetAgesICanVisitFolder();
hsRef<RelVaultNode> VaultGetPlayerInboxFolder();
hsRef<RelVaultNode> VaultGetOwnedAgeLink(const plAgeInfoStruct * info);
hsRef<RelVaultNode> VaultGetOwnedAgeInfo(const plAgeInfoStruct * info);
bool VaultGetOwnedAgeLink(const plAgeInfoStruct * info, plAgeLinkStruct * link);
bool VaultAddOwnedAgeSpawnPoint(const plUUID& ageInstId, const plSpawnPointInfo & spawnPt);
bool VaultSetOwnedAgePublicAndWait(const plAgeInfoStruct * info, bool publicOrNot);
hsRef<RelVaultNode> VaultGetVisitAgeLink(const plAgeInfoStruct * info);
bool VaultGetVisitAgeLink(const plAgeInfoStruct * info, class plAgeLinkStruct * link);
bool VaultRegisterOwnedAgeAndWait(const plAgeLinkStruct * link);
void VaultRegisterOwnedAge(const plAgeLinkStruct* link);
bool VaultRegisterVisitAgeAndWait(const plAgeLinkStruct * link);
void VaultRegisterVisitAge(const plAgeLinkStruct* link);
bool VaultUnregisterOwnedAgeAndWait(const plAgeInfoStruct * info);
bool VaultUnregisterVisitAgeAndWait(const plAgeInfoStruct * info);
hsRef<RelVaultNode> VaultFindChronicleEntry(const wchar_t entryName[], int entryType = -1);
bool VaultHasChronicleEntry(const wchar_t entryName[], int entryType = -1);
// if entry of same name and type already exists, value is updated
void VaultAddChronicleEntryAndWait (
const wchar_t entryName[],
@ -390,32 +387,32 @@ void VaultProcessPlayerInbox ();
#define DEFAULT_DEVICE_INBOX L"DevInbox"
RelVaultNode * VaultGetAgeNodeIncRef ();
RelVaultNode * VaultGetAgeInfoNodeIncRef ();
RelVaultNode * VaultGetAgeChronicleFolderIncRef ();
RelVaultNode * VaultGetAgeDevicesFolderIncRef ();
RelVaultNode * VaultGetAgeSubAgesFolderIncRef ();
RelVaultNode * VaultGetAgeChildAgesFolderIncRef ();
RelVaultNode * VaultGetAgeAgeOwnersFolderIncRef ();
RelVaultNode * VaultGetAgeCanVisitFolderIncRef ();
RelVaultNode * VaultGetAgePeopleIKnowAboutFolderIncRef ();
RelVaultNode * VaultGetAgePublicAgesFolderIncRef ();
RelVaultNode * VaultAgeGetBookshelfFolderIncRef ();
RelVaultNode * VaultFindAgeSubAgeLinkIncRef (const plAgeInfoStruct * info);
RelVaultNode * VaultFindAgeChildAgeLinkIncRef (const plAgeInfoStruct * info);
RelVaultNode * VaultFindAgeChronicleEntryIncRef (const wchar_t entryName[], int entryType = -1);
hsRef<RelVaultNode> VaultGetAgeNode();
hsRef<RelVaultNode> VaultGetAgeInfoNode();
hsRef<RelVaultNode> VaultGetAgeChronicleFolder();
hsRef<RelVaultNode> VaultGetAgeDevicesFolder();
hsRef<RelVaultNode> VaultGetAgeSubAgesFolder();
hsRef<RelVaultNode> VaultGetAgeChildAgesFolder();
hsRef<RelVaultNode> VaultGetAgeAgeOwnersFolder();
hsRef<RelVaultNode> VaultGetAgeCanVisitFolder();
hsRef<RelVaultNode> VaultGetAgePeopleIKnowAboutFolder();
hsRef<RelVaultNode> VaultGetAgePublicAgesFolder();
hsRef<RelVaultNode> VaultAgeGetBookshelfFolder();
hsRef<RelVaultNode> VaultFindAgeSubAgeLink(const plAgeInfoStruct * info);
hsRef<RelVaultNode> VaultFindAgeChildAgeLink(const plAgeInfoStruct * info);
hsRef<RelVaultNode> VaultFindAgeChronicleEntry(const wchar_t entryName[], int entryType = -1);
// if entry of same name and type already exists, value is updated
void VaultAddAgeChronicleEntry (
const wchar_t entryName[],
int entryType,
const wchar_t entryValue[]
);
RelVaultNode * VaultAgeAddDeviceAndWaitIncRef (const wchar_t deviceName[]); // blocks until completion
hsRef<RelVaultNode> VaultAgeAddDeviceAndWait(const wchar_t deviceName[]); // blocks until completion
void VaultAgeRemoveDevice (const wchar_t deviceName[]);
bool VaultAgeHasDevice (const wchar_t deviceName[]);
RelVaultNode * VaultAgeGetDeviceIncRef (const wchar_t deviceName[]);
RelVaultNode * VaultAgeSetDeviceInboxAndWaitIncRef (const wchar_t deviceName[], const wchar_t inboxName[]); // blocks until completion
RelVaultNode * VaultAgeGetDeviceInboxIncRef (const wchar_t deviceName[]);
hsRef<RelVaultNode> VaultAgeGetDevice(const wchar_t deviceName[]);
hsRef<RelVaultNode> VaultAgeSetDeviceInboxAndWait(const wchar_t deviceName[], const wchar_t inboxName[]); // blocks until completion
hsRef<RelVaultNode> VaultAgeGetDeviceInbox(const wchar_t deviceName[]);
void VaultClearDeviceInboxMap ();
bool VaultAgeGetAgeSDL (class plStateDataRecord * out);
@ -423,7 +420,7 @@ void VaultAgeUpdateAgeSDL (const class plStateDataRecord * rec);
unsigned VaultAgeGetAgeTime ();
RelVaultNode * VaultGetSubAgeLinkIncRef (const plAgeInfoStruct * info);
hsRef<RelVaultNode> VaultGetSubAgeLink(const plAgeInfoStruct * info);
bool VaultAgeGetSubAgeLink (
const plAgeInfoStruct * info,
plAgeLinkStruct * link
@ -435,7 +432,7 @@ bool VaultAgeFindOrCreateSubAgeLinkAndWait (
);
bool VaultAgeFindOrCreateSubAgeLink(const plAgeInfoStruct* info, plAgeLinkStruct* link, const plUUID& arentUuid);
bool VaultAgeFindOrCreateChildAgeLinkAndWait (
const wchar_t parentAgeName[], // nil --> current age, non-nil --> owned age by given name
const wchar_t parentAgeName[], // nil --> current age, non-nil --> owned age by given name
const plAgeInfoStruct * info,
plAgeLinkStruct * link
);
@ -494,7 +491,7 @@ void VaultCull (
*
***/
RelVaultNode * VaultGetSystemNodeIncRef ();
RelVaultNode * VaultGetGlobalInboxIncRef ();
hsRef<RelVaultNode> VaultGetSystemNode();
hsRef<RelVaultNode> VaultGetGlobalInbox();
#endif // def CLIENT

6
Sources/Plasma/PubUtilLib/plVault/plVaultNodeAccess.cpp

@ -435,14 +435,12 @@ struct MatchesSpawnPointName
//============================================================================
#ifdef CLIENT
bool VaultAgeLinkNode::CopyTo (plAgeLinkStruct * link) {
if (RelVaultNode * me = VaultGetNodeIncRef(base->GetNodeId())) {
if (RelVaultNode * info = me->GetChildNodeIncRef(plVault::kNodeType_AgeInfo, 1)) {
if (hsRef<RelVaultNode> me = VaultGetNode(base->GetNodeId())) {
if (hsRef<RelVaultNode> info = me->GetChildNode(plVault::kNodeType_AgeInfo, 1)) {
VaultAgeInfoNode access(info);
access.CopyTo(link->GetAgeInfo());
me->UnRef();
return true;
}
me->UnRef();
}
link->Clear();
return false;

Loading…
Cancel
Save