mirror of
https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git
synced 2025-07-18 19:29:09 +00:00
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.
This commit is contained in:
@ -2477,25 +2477,31 @@ bool VaultAddOwnedAgeSpawnPoint (const plUUID& ageInstId, const plSpawnPointInfo
|
||||
bool VaultSetOwnedAgePublicAndWait (const plAgeInfoStruct * info, bool publicOrNot) {
|
||||
if (hsRef<RelVaultNode> rvnLink = VaultGetOwnedAgeLink(info)) {
|
||||
if (hsRef<RelVaultNode> rvnInfo = rvnLink->GetChildNode(plVault::kNodeType_AgeInfo, 1)) {
|
||||
NetCliAuthSetAgePublic(rvnInfo->GetNodeId(), publicOrNot);
|
||||
|
||||
VaultAgeInfoNode access(rvnInfo);
|
||||
char ageName[MAX_PATH];
|
||||
StrToAnsi(ageName, access.GetAgeFilename(), arrsize(ageName));
|
||||
|
||||
plVaultNotifyMsg * msg = new 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);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
//============================================================================
|
||||
bool VaultSetAgePublicAndWait (NetVaultNode * ageInfoNode, bool publicOrNot) {
|
||||
NetCliAuthSetAgePublic(ageInfoNode->GetNodeId(), publicOrNot);
|
||||
|
||||
VaultAgeInfoNode access(ageInfoNode);
|
||||
char ageName[MAX_PATH];
|
||||
StrToAnsi(ageName, access.GetAgeFilename(), arrsize(ageName));
|
||||
|
||||
plVaultNotifyMsg * msg = new 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;
|
||||
}
|
||||
|
||||
//============================================================================
|
||||
hsRef<RelVaultNode> VaultGetVisitAgeLink (const plAgeInfoStruct * info) {
|
||||
hsRef<RelVaultNode> rvnLink;
|
||||
|
@ -345,6 +345,7 @@ 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);
|
||||
bool VaultSetAgePublicAndWait(NetVaultNode * ageInfoNode, bool publicOrNot);
|
||||
hsRef<RelVaultNode> VaultGetVisitAgeLink(const plAgeInfoStruct * info);
|
||||
bool VaultGetVisitAgeLink(const plAgeInfoStruct * info, class plAgeLinkStruct * link);
|
||||
bool VaultRegisterOwnedAgeAndWait(const plAgeLinkStruct * link);
|
||||
|
Reference in New Issue
Block a user