[Kernel] Added Property class and storing them for user

This commit is contained in:
Gliniak
2024-03-24 18:31:11 +01:00
parent eb785c8e35
commit 854b7df2ba
6 changed files with 243 additions and 13 deletions

View File

@@ -71,11 +71,20 @@ X_HRESULT XgiApp::DispatchMessageSync(uint32_t message, uint32_t buffer_ptr,
const util::XdbfGameData title_xdbf = kernel_state_->title_xdbf();
if (title_xdbf.is_valid()) {
const auto property = title_xdbf.GetProperty(property_id);
const auto property_xdbf = title_xdbf.GetProperty(property_id);
const XLanguage title_language = title_xdbf.GetExistingLanguage(
static_cast<XLanguage>(XLanguage::kEnglish));
const std::string desc =
title_xdbf.GetStringTableEntry(title_language, property.string_id);
const std::string desc = title_xdbf.GetStringTableEntry(
title_language, property_xdbf.string_id);
Property property =
Property(property_id, value_size,
memory_->TranslateVirtual<uint8_t*>(value_ptr));
auto user = kernel_state_->user_profile(user_index);
if (user) {
user->AddProperty(&property);
}
XELOGD("XGIUserSetPropertyEx: Setting property: {}", desc);
}