客户端rsa,冗余清理,bug修复,安卓build问题
This commit is contained in:
@@ -11,6 +11,7 @@ public static class ExpBottleLedgerStorage
|
||||
private const string MainFileName = ".xpv.dat";
|
||||
private const string BackupFileName = ".xpv.bak";
|
||||
private const string TempFileName = ".xpv.tmp";
|
||||
private const string RecoverySlotKey = "exp_bottle_ledger_storage";
|
||||
|
||||
private static string VaultDirectoryPath
|
||||
{
|
||||
@@ -53,9 +54,23 @@ public static class ExpBottleLedgerStorage
|
||||
return true;
|
||||
}
|
||||
|
||||
if (LocalRecoveryMirror.TryLoadJson(RecoverySlotKey, out payload) && payload != null)
|
||||
{
|
||||
TrySave(payload);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public static bool HasAnyRecoverableState()
|
||||
{
|
||||
return HasAnyVaultFile(MainFileName)
|
||||
|| HasAnyVaultFile(BackupFileName)
|
||||
|| PlayerProgressBackupService.HasExpBottleBackup()
|
||||
|| LocalRecoveryMirror.HasSlotData(RecoverySlotKey);
|
||||
}
|
||||
|
||||
public static bool TrySave(ExpBottleLedgerPayload payload)
|
||||
{
|
||||
try
|
||||
@@ -77,6 +92,7 @@ public static class ExpBottleLedgerStorage
|
||||
TryHidePath(MainFilePath);
|
||||
File.Delete(TempFilePath);
|
||||
PlayerProgressBackupService.SaveExpBottle(payload);
|
||||
LocalRecoveryMirror.SaveJson(RecoverySlotKey, payload);
|
||||
return true;
|
||||
}
|
||||
catch (Exception ex)
|
||||
@@ -169,6 +185,20 @@ public static class ExpBottleLedgerStorage
|
||||
return false;
|
||||
}
|
||||
|
||||
private static bool HasAnyVaultFile(string fileName)
|
||||
{
|
||||
var candidates = SaveIdentityUtility.GetVaultFilePathVariants(fileName);
|
||||
for (int i = 0; i < candidates.Count; i++)
|
||||
{
|
||||
if (File.Exists(candidates[i]))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private static string BuildEnvelopeJson(ExpBottleLedgerPayload payload)
|
||||
{
|
||||
payload.lastUpdatedUtcTicks = DateTime.UtcNow.Ticks;
|
||||
|
||||
Reference in New Issue
Block a user