diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVault.cpp b/Sources/Plasma/FeatureLib/pfPython/pyVault.cpp index 1c40f4f1..b78cc53d 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVault.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyVault.cpp @@ -365,7 +365,10 @@ void pyVault::AddChronicleEntry( const char * name, UInt32 type, const char * va wchar * wEntryName = StrDupToUnicode(name); wchar * wEntryValue = StrDupToUnicode(value); - VaultAddChronicleEntry(wEntryName, type, wEntryValue); + // FIXME: We should ideally not block, but for now, the Python assumes that when + // we return, the chronicle exists and can be found with findChronicleEntry. + // Maybe we should insert a dummy into the tree? (currently hard) + VaultAddChronicleEntryAndWait(wEntryName, type, wEntryValue); FREE(wEntryName); FREE(wEntryValue); diff --git a/Sources/Plasma/PubUtilLib/plVault/plVaultClientApi.cpp b/Sources/Plasma/PubUtilLib/plVault/plVaultClientApi.cpp index b1943163..bbb4e014 100644 --- a/Sources/Plasma/PubUtilLib/plVault/plVaultClientApi.cpp +++ b/Sources/Plasma/PubUtilLib/plVault/plVaultClientApi.cpp @@ -3444,38 +3444,6 @@ bool VaultHasChronicleEntry (const wchar entryName[], int entryType) { return false; } -//============================================================================ -void VaultAddChronicleEntry (const wchar entryName[], int entryType, const wchar entryValue[]) { - // Sometimes we try to create chrons in StartUp. - // This is bad... - if (GetPlayerNode() == nil) - return; - - if (RelVaultNode* rvnChrn = VaultFindChronicleEntryIncRef(entryName, entryType)) { - VaultChronicleNode chrnNode(rvnChrn); - chrnNode.SetEntryValue(entryValue); - rvnChrn->DecRef(); - } else { - NetVaultNode* templateNode = NEWZERO(NetVaultNode); - templateNode->IncRef(); - templateNode->SetNodeType(plVault::kNodeType_Chronicle); - VaultChronicleNode chrnNode(templateNode); - chrnNode.SetEntryName(entryName); - chrnNode.SetEntryType(entryType); - chrnNode.SetEntryValue(entryValue); - VaultCreateNode(templateNode, (FVaultCreateNodeCallback)(_VaultAddChronicleEntryCB), nil, nil); - templateNode->DecRef(); - } -} - -void _VaultAddChronicleEntryCB(ENetError result, void* state, void * param, RelVaultNode* node) { - if (result == ENetError::kNetSuccess) { - RelVaultNode* rvnFldr = GetChildFolderNode(GetPlayerNode(), plVault::kChronicleFolder, 1); - if (rvnFldr != nil) - VaultAddChildNode(rvnFldr->nodeId, node->nodeId, 0, nil, nil); - } -} - //============================================================================ void VaultAddChronicleEntryAndWait ( const wchar entryName[], diff --git a/Sources/Plasma/PubUtilLib/plVault/plVaultClientApi.h b/Sources/Plasma/PubUtilLib/plVault/plVaultClientApi.h index 0505b808..39bd0aa0 100644 --- a/Sources/Plasma/PubUtilLib/plVault/plVaultClientApi.h +++ b/Sources/Plasma/PubUtilLib/plVault/plVaultClientApi.h @@ -357,8 +357,6 @@ bool VaultUnregisterVisitAgeAndWait (const plAgeInfoStruct * info); RelVaultNode * VaultFindChronicleEntryIncRef (const wchar entryName[], int entryType = -1); bool VaultHasChronicleEntry (const wchar entryName[], int entryType = -1); // if entry of same name and type already exists, value is updated -void VaultAddChronicleEntry (const wchar entryName[], int entryType, const wchar entryValue[]); -void _VaultAddChronicleEntryCB(ENetError result, void* state, void * param, RelVaultNode* node); void VaultAddChronicleEntryAndWait ( const wchar entryName[], int entryType,