Skip to content

Commit

Permalink
Rename vault functions that were called ...AndWait despite not blocking
Browse files Browse the repository at this point in the history
  • Loading branch information
dgelessus committed Sep 16, 2023
1 parent 97bd41b commit a6fa60e
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 31 deletions.
6 changes: 3 additions & 3 deletions Sources/Plasma/FeatureLib/pfConsole/pfConsoleCommandsNet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -750,7 +750,7 @@ PF_CONSOLE_CMD( Net_Vault,
"string stationName, string mtSpawnPt",
"Register an MT Station with your Nexus" )
{
VaultRegisterMTStationAndWait(params[0], params[1]);
VaultRegisterMTStation(params[0], params[1]);
PrintString("Registered MT Station.");
}

Expand Down Expand Up @@ -779,7 +779,7 @@ PF_CONSOLE_CMD( Net_Vault,
{
plAgeInfoStruct info;
info.SetAgeFilename(params[0]);
bool success = VaultUnregisterOwnedAgeAndWait(&info);
bool success = VaultUnregisterOwnedAge(&info);
PrintString(ST::format("Operation {}.", success ? "Successful" : "Failed"));
}

Expand Down Expand Up @@ -809,7 +809,7 @@ PF_CONSOLE_CMD( Net_Vault,
info.SetAgeFilename(params[0]);

unsigned count = 0;
while (VaultUnregisterVisitAgeAndWait(&info))
while (VaultUnregisterVisitAge(&info))
++count;

PrintString(ST::format("Operation {}.", count > 0 ? "Successful" : "Failed"));
Expand Down
4 changes: 2 additions & 2 deletions Sources/Plasma/FeatureLib/pfPython/cyMisc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2195,7 +2195,7 @@ void cyMisc::GetPublicAgeList(const ST::string& ageName, PyObject * cbObject)
//
void cyMisc::CreatePublicAge( pyAgeInfoStruct * ageInfo, PyObject * cbObject )
{
VaultSetOwnedAgePublicAndWait(ageInfo->GetAgeInfo(), true);
VaultSetOwnedAgePublic(ageInfo->GetAgeInfo(), true);
// TODO: make the callback here
}

Expand All @@ -2211,7 +2211,7 @@ void cyMisc::RemovePublicAge(const ST::string& ageInstanceGuid, PyObject * cbObj
plAgeInfoStruct info;
plUUID uuid(ageInstanceGuid);
info.SetAgeInstanceGuid(&uuid);
VaultSetOwnedAgePublicAndWait(&info, false);
VaultSetOwnedAgePublic(&info, false);
// TODO: make the callback here
}

Expand Down
15 changes: 6 additions & 9 deletions Sources/Plasma/FeatureLib/pfPython/pyVault.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -458,8 +458,7 @@ bool pyVault::AmAgeCzar( const pyAgeInfoStruct * ageInfo )

void pyVault::RegisterMTStation( const ST::string& stationName, const ST::string& backLinkSpawnPtObjName )
{
// Note: This doesn't actually block (~Hoikas)
VaultRegisterMTStationAndWait(stationName, backLinkSpawnPtObjName);
VaultRegisterMTStation(stationName, backLinkSpawnPtObjName);
}

void pyVault::RegisterOwnedAge( const pyAgeLinkStruct & link )
Expand All @@ -471,7 +470,7 @@ void pyVault::UnRegisterOwnedAge(const ST::string& ageFilename)
{
plAgeInfoStruct info;
info.SetAgeFilename(ageFilename);
VaultUnregisterOwnedAgeAndWait(&info);
VaultUnregisterOwnedAge(&info);
}

void pyVault::RegisterVisitAge( const pyAgeLinkStruct & link )
Expand All @@ -484,7 +483,7 @@ void pyVault::UnRegisterVisitAge(const ST::string& guidstr)
plAgeInfoStruct info;
plUUID guid(guidstr);
info.SetAgeInstanceGuid(&guid);
VaultUnregisterVisitAgeAndWait(&info);
VaultUnregisterVisitAge(&info);
}

//============================================================================
Expand Down Expand Up @@ -544,10 +543,9 @@ void pyVault::CreateNeighborhood()
plNetClientMgr * nc = plNetClientMgr::GetInstance();

// Unregister old hood
// Note: This doesn't actually block (~Hoikas)
plAgeInfoStruct info;
info.SetAgeFilename(kNeighborhoodAgeFilename);
VaultUnregisterOwnedAgeAndWait(&info);
VaultUnregisterOwnedAge(&info);

// Register new hood
plAgeLinkStruct link;
Expand Down Expand Up @@ -578,13 +576,12 @@ void pyVault::CreateNeighborhood()

bool pyVault::SetAgePublic( const pyAgeInfoStruct * ageInfo, bool makePublic )
{
// Note: This doesn't actually block (~Hoikas)
return VaultSetOwnedAgePublicAndWait(ageInfo->GetAgeInfo(), makePublic);
return VaultSetOwnedAgePublic(ageInfo->GetAgeInfo(), makePublic);
}

bool pyVault::SetAgePublic( const pyVaultAgeInfoNode * ageInfoNode, bool makePublic )
{
return VaultSetAgePublicAndWait(ageInfoNode->GetNode(), makePublic);
return VaultSetAgePublic(ageInfoNode->GetNode(), makePublic);
}


Expand Down
4 changes: 2 additions & 2 deletions Sources/Plasma/FeatureLib/pfPython/pyVaultPlayerNode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ void pyVaultPlayerNode::RemoveOwnedAgeLink(const ST::string& ageFilename)
{
plAgeInfoStruct info;
info.SetAgeFilename(ageFilename);
VaultUnregisterOwnedAgeAndWait(&info);
VaultUnregisterOwnedAge(&info);
}

PyObject *pyVaultPlayerNode::GetVisitAgeLink(const pyAgeInfoStruct *info)
Expand All @@ -214,7 +214,7 @@ void pyVaultPlayerNode::RemoveVisitAgeLink(const ST::string& guidstr)
plAgeInfoStruct info;
plUUID guid(guidstr);
info.SetAgeInstanceGuid(&guid);
VaultUnregisterOwnedAgeAndWait(&info);
VaultUnregisterOwnedAge(&info);
}

PyObject *pyVaultPlayerNode::FindChronicleEntry(const ST::string& entryName)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -856,7 +856,7 @@ void plSceneInputInterface::ILinkOffereeToAge()
// We have the age in our AgesIOwnFolder. If its volatile, dump it for the new one.
VaultAgeLinkNode linkAcc(linkNode);
if (linkAcc.GetVolatile()) {
if (VaultUnregisterOwnedAgeAndWait(link.GetAgeInfo())) {
if (VaultUnregisterOwnedAge(link.GetAgeInfo())) {
plUUID guid = plUUID::Generate();
link.GetAgeInfo()->SetAgeInstanceGuid(&guid);
VaultRegisterOwnedAgeAndWait(&link);
Expand Down
2 changes: 1 addition & 1 deletion Sources/Plasma/PubUtilLib/plNetClient/plNetLinkingMgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -975,7 +975,7 @@ uint8_t plNetLinkingMgr::IPreProcessLink()
// We have the age in our AgesIOwnFolder. If its volatile, dump it for the new one.
VaultAgeLinkNode linkAcc(linkNode);
if (linkAcc.GetVolatile()) {
if (VaultUnregisterOwnedAgeAndWait(&ageInfo)) {
if (VaultUnregisterOwnedAge(&ageInfo)) {
// Fill in fields for new age create.
if (!info->HasAgeUserDefinedName())
{
Expand Down
16 changes: 8 additions & 8 deletions Sources/Plasma/PubUtilLib/plVault/plVaultClientApi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2343,17 +2343,17 @@ bool VaultAddOwnedAgeSpawnPoint (const plUUID& ageInstId, const plSpawnPointInfo
}

//============================================================================
bool VaultSetOwnedAgePublicAndWait (const plAgeInfoStruct * info, bool publicOrNot) {
bool VaultSetOwnedAgePublic(const plAgeInfoStruct* info, bool publicOrNot) {
if (hsRef<RelVaultNode> rvnLink = VaultGetOwnedAgeLink(info)) {
if (hsRef<RelVaultNode> rvnInfo = rvnLink->GetChildNode(plVault::kNodeType_AgeInfo, 1)) {
VaultSetAgePublicAndWait(rvnInfo, publicOrNot);
VaultSetAgePublic(rvnInfo, publicOrNot);
}
}
return true;
}

//============================================================================
bool VaultSetAgePublicAndWait(hsWeakRef<NetVaultNode> ageInfoNode, bool publicOrNot) {
bool VaultSetAgePublic(hsWeakRef<NetVaultNode> ageInfoNode, bool publicOrNot) {
NetCliAuthSetAgePublic(ageInfoNode->GetNodeId(), publicOrNot);

VaultAgeInfoNode access(ageInfoNode);
Expand Down Expand Up @@ -3135,7 +3135,7 @@ void VaultRegisterVisitAge(const plAgeLinkStruct* link) {
}

//============================================================================
bool VaultUnregisterOwnedAgeAndWait (const plAgeInfoStruct * info) {
bool VaultUnregisterOwnedAge(const plAgeInfoStruct* info) {

unsigned ageLinkId = 0;
unsigned agesIOwnId;
Expand Down Expand Up @@ -3193,7 +3193,7 @@ bool VaultUnregisterOwnedAgeAndWait (const plAgeInfoStruct * info) {
}

//============================================================================
bool VaultUnregisterVisitAgeAndWait (const plAgeInfoStruct * info) {
bool VaultUnregisterVisitAge(const plAgeInfoStruct* info) {

unsigned ageLinkId = 0;
unsigned agesICanVisitId;
Expand Down Expand Up @@ -3442,7 +3442,7 @@ bool VaultAmCzarOfAge (const plUUID& ageInstId) {
}

//============================================================================
bool VaultRegisterMTStationAndWait (
bool VaultRegisterMTStation(
const ST::string& stationName,
const ST::string& linkBackSpawnPtObjName
) {
Expand Down Expand Up @@ -3477,7 +3477,7 @@ void VaultProcessUnvisitNote(hsWeakRef<RelVaultNode> rvnUnVisit) {
plAgeInfoStruct info;
if (unvisitAcc.GetVisitInfo(&info)) {
// Remove it from our "ages i can visit" folder
VaultUnregisterVisitAgeAndWait(&info);
VaultUnregisterVisitAge(&info);
}
// remove it from the inbox
VaultRemoveChildNode(rvnInbox->GetNodeId(), rvnUnVisit->GetNodeId(), nullptr, nullptr);
Expand Down Expand Up @@ -3519,7 +3519,7 @@ void VaultProcessPlayerInbox () {
plAgeInfoStruct info;
if (unvisitAcc.GetVisitInfo(&info)) {
// Remove it from our "ages i can visit" folder
VaultUnregisterVisitAgeAndWait(&info);
VaultUnregisterVisitAge(&info);
}
// remove it from the inbox
VaultRemoveChildNode(rvnInbox->GetNodeId(), rvnUnVisit->GetNodeId(), nullptr, nullptr);
Expand Down
10 changes: 5 additions & 5 deletions Sources/Plasma/PubUtilLib/plVault/plVaultClientApi.h
Original file line number Diff line number Diff line change
Expand Up @@ -339,16 +339,16 @@ 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);
bool VaultSetAgePublicAndWait(hsWeakRef<NetVaultNode> ageInfoNode, bool publicOrNot);
bool VaultSetOwnedAgePublic(const plAgeInfoStruct* info, bool publicOrNot);
bool VaultSetAgePublic(hsWeakRef<NetVaultNode> ageInfoNode, 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);
bool VaultUnregisterOwnedAge(const plAgeInfoStruct* info);
bool VaultUnregisterVisitAge(const plAgeInfoStruct* info);
hsRef<RelVaultNode> VaultFindChronicleEntry(const ST::string& entryName, int entryType = -1);
bool VaultHasChronicleEntry(const ST::string& entryName, int entryType = -1);
// if entry of same name and type already exists, value is updated
Expand All @@ -369,7 +369,7 @@ bool VaultAmOwnerOfCurrentAge ();
bool VaultAmCzarOfCurrentAge ();
bool VaultAmOwnerOfAge (const plUUID& ageInstId);
bool VaultAmCzarOfAge (const plUUID& ageInstId);
bool VaultRegisterMTStationAndWait (
bool VaultRegisterMTStation(
const ST::string& stationName,
const ST::string& linkBackSpawnPtObjName
);
Expand Down

0 comments on commit a6fa60e

Please sign in to comment.