[XAM] Fixed issue with achievements saving in Forza series.

Remove this ducktape asap and remove hardcodes
This commit is contained in:
Gliniak
2025-03-15 23:59:34 +01:00
parent 9132035a51
commit 8926bdcdd6
3 changed files with 9 additions and 6 deletions

View File

@@ -183,7 +183,8 @@ bool ProfileManager::LoadAccount(const uint64_t xuid) {
MountProfile(xuid);
const std::string guest_path = xuid_as_string + ":\\Account";
const std::string guest_path =
fmt::format(kDefaultMountFormat, xuid) + ":\\Account";
xe::vfs::File* output_file;
xe::vfs::FileAction action = {};
@@ -257,7 +258,7 @@ void ProfileManager::ModifyGamertag(const uint64_t xuid, std::string gamertag) {
bool ProfileManager::MountProfile(const uint64_t xuid, std::string mount_path) {
std::filesystem::path profile_path = GetProfilePath(xuid);
if (mount_path.empty()) {
mount_path = fmt::format("{:016X}", xuid);
mount_path = fmt::format(kDefaultMountFormat, xuid);
}
mount_path += ':';
@@ -275,7 +276,7 @@ bool ProfileManager::MountProfile(const uint64_t xuid, std::string mount_path) {
bool ProfileManager::DismountProfile(const uint64_t xuid) {
return kernel_state_->file_system()->UnregisterDevice(
fmt::format("{:016X}", xuid) + ':');
fmt::format(kDefaultMountFormat, xuid) + ':');
}
void ProfileManager::Login(const uint64_t xuid, const uint8_t user_index,

View File

@@ -42,6 +42,8 @@ constexpr uint32_t kDashboardID = 0xFFFE07D1;
const static std::string kDashboardStringID =
fmt::format("{:08X}", kDashboardID);
constexpr std::string kDefaultMountFormat = "User_{:016X}";
class ProfileManager {
public:
static bool DecryptAccountFile(const uint8_t* data, X_XAMACCOUNTINFO* output,

View File

@@ -74,7 +74,7 @@ void UserProfile::LoadProfileIcon(XTileType tile_type) {
}
const std::string path =
fmt::format("{:016X}:\\{}", xuid_, kTileFileNames.at(tile_type));
fmt::format("User_{:016X}:\\{}", xuid_, kTileFileNames.at(tile_type));
vfs::File* file = nullptr;
vfs::FileAction action;
@@ -97,7 +97,7 @@ void UserProfile::LoadProfileIcon(XTileType tile_type) {
std::vector<uint8_t> UserProfile::LoadGpd(const uint32_t title_id) {
auto entry = kernel_state()->file_system()->ResolvePath(
fmt::format("{:016X}:\\{:08X}.gpd", xuid_, title_id));
fmt::format("User_{:016X}:\\{:08X}.gpd", xuid_, title_id));
if (!entry) {
XELOGW("User {} (XUID: {:016X}) doesn't have profile GPD!", name(), xuid());
@@ -139,7 +139,7 @@ bool UserProfile::WriteGpd(const uint32_t title_id) {
vfs::FileAction action;
const std::string mounted_path =
fmt::format("{:016X}:\\{:08X}.gpd", xuid_, title_id);
fmt::format("User_{:016X}:\\{:08X}.gpd", xuid_, title_id);
const X_STATUS result = kernel_state()->file_system()->OpenFile(
nullptr, mounted_path, vfs::FileDisposition::kOverwriteIf,