mirror of
https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git
synced 2025-07-20 04:09:16 +00:00
Merged in cwalther/cwe/setpublic (pull request #35)
Let ptVault.setAgePublic accept ptVaultAgeInfoNode in addition to ptAgeInfoStruct In this case it now also works for non-owners of the age. Previously it only worked for owners because the ageInfoStruct does not contain the vault node ID, so it needed to be looked up somewhere, and that was in the AgesIOwnFolder. Prerequisite for hood auto-bump (MOULSCRIPT-ou PR #22). From H-uru/Plasma#461.
This commit is contained in:
@ -2476,21 +2476,7 @@ bool VaultAddOwnedAgeSpawnPoint (const Uuid & ageInstId, const plSpawnPointInfo
|
||||
bool VaultSetOwnedAgePublicAndWait (const plAgeInfoStruct * info, bool publicOrNot) {
|
||||
if (RelVaultNode * rvnLink = VaultGetOwnedAgeLinkIncRef(info)) {
|
||||
if (RelVaultNode * rvnInfo = rvnLink->GetChildNodeIncRef(plVault::kNodeType_AgeInfo, 1)) {
|
||||
NetCliAuthSetAgePublic(rvnInfo->nodeId, publicOrNot);
|
||||
|
||||
VaultAgeInfoNode access(rvnInfo);
|
||||
char ageName[MAX_PATH];
|
||||
StrToAnsi(ageName, access.ageFilename, arrsize(ageName));
|
||||
|
||||
plVaultNotifyMsg * msg = NEWZERO(plVaultNotifyMsg);
|
||||
if (publicOrNot)
|
||||
msg->SetType(plVaultNotifyMsg::kPublicAgeCreated);
|
||||
else
|
||||
msg->SetType(plVaultNotifyMsg::kPublicAgeRemoved);
|
||||
msg->SetResultCode(true);
|
||||
msg->GetArgs()->AddString(plNetCommon::VaultTaskArgs::kAgeFilename, ageName);
|
||||
msg->Send();
|
||||
|
||||
VaultSetAgePublicAndWait(rvnInfo, publicOrNot);
|
||||
rvnInfo->DecRef();
|
||||
}
|
||||
rvnLink->DecRef();
|
||||
@ -2498,6 +2484,25 @@ bool VaultSetOwnedAgePublicAndWait (const plAgeInfoStruct * info, bool publicOrN
|
||||
return true;
|
||||
}
|
||||
|
||||
//============================================================================
|
||||
bool VaultSetAgePublicAndWait (NetVaultNode * ageInfoNode, bool publicOrNot) {
|
||||
NetCliAuthSetAgePublic(ageInfoNode->nodeId, publicOrNot);
|
||||
|
||||
VaultAgeInfoNode access(ageInfoNode);
|
||||
char ageName[MAX_PATH];
|
||||
StrToAnsi(ageName, access.ageFilename, arrsize(ageName));
|
||||
|
||||
plVaultNotifyMsg * msg = NEWZERO(plVaultNotifyMsg);
|
||||
if (publicOrNot)
|
||||
msg->SetType(plVaultNotifyMsg::kPublicAgeCreated);
|
||||
else
|
||||
msg->SetType(plVaultNotifyMsg::kPublicAgeRemoved);
|
||||
msg->SetResultCode(true);
|
||||
msg->GetArgs()->AddString(plNetCommon::VaultTaskArgs::kAgeFilename, ageName);
|
||||
msg->Send();
|
||||
return true;
|
||||
}
|
||||
|
||||
//============================================================================
|
||||
RelVaultNode * VaultGetVisitAgeLinkIncRef (const plAgeInfoStruct * info) {
|
||||
RelVaultNode * rvnLink = nil;
|
||||
|
@ -345,6 +345,7 @@ RelVaultNode * VaultGetOwnedAgeInfoIncRef (const plAgeInfoStruct * info);
|
||||
bool VaultGetOwnedAgeLink (const plAgeInfoStruct * info, plAgeLinkStruct * link);
|
||||
bool VaultAddOwnedAgeSpawnPoint (const Uuid & ageInstId, const plSpawnPointInfo & spawnPt);
|
||||
bool VaultSetOwnedAgePublicAndWait (const plAgeInfoStruct * info, bool publicOrNot);
|
||||
bool VaultSetAgePublicAndWait (NetVaultNode * ageInfoNode, bool publicOrNot);
|
||||
RelVaultNode * VaultGetVisitAgeLinkIncRef (const plAgeInfoStruct * info);
|
||||
bool VaultGetVisitAgeLink (const plAgeInfoStruct * info, class plAgeLinkStruct * link);
|
||||
bool VaultRegisterOwnedAgeAndWait (const plAgeLinkStruct * link);
|
||||
|
Reference in New Issue
Block a user