存档文件改为每个独立用户各自拥有

This commit is contained in:
ALIENJACK\alien 2025-04-16 13:09:25 +08:00
parent 959956706f
commit 16a7acee61
2 changed files with 9 additions and 3 deletions
AxibugEmuOnline.Client/Assets/Script/AppMain
App.cs
Manager/SaveSlotManager

View File

@ -63,6 +63,12 @@ namespace AxibugEmuOnline.Client.ClientCore
{
return s_persistentRoot + "/" + emuPlatform.ToString();
}
public static string UserPersistenDataPath(RomPlatformType emuPlatform)
{
return string.Format("{0}/{1}", PersistentDataPath(emuPlatform), user.userdata.UID);
}
public static string PersistentDataRoot() => s_persistentRoot;
public static RomLib GetRomLib(RomPlatformType platform)

View File

@ -7,7 +7,7 @@ using System.Runtime.InteropServices;
namespace AxibugEmuOnline.Client
{
/// <summary> 存档文件管理类 </summary>
/// <summary> 存档文件抽象类 </summary>
public class SaveFile
{
public SavCloudApi CloudAPI => App.SavMgr.CloudApi;
@ -28,8 +28,8 @@ namespace AxibugEmuOnline.Client
{
get
{
var path = App.PersistentDataPath(EmuPlatform);
path = $"{path}/Slot/{EmuPlatform}/{RomID}";
var path = App.UserPersistenDataPath(EmuPlatform);
path = $"{path}/Slot/{RomID}";
Directory.CreateDirectory(path);