实现新存档系统HashCheck功能

This commit is contained in:
ZouJin 2023-09-23 00:59:41 +08:00
parent 0a06c6df28
commit 05346d1689
4 changed files with 14 additions and 7 deletions

View File

@ -57,7 +57,7 @@ namespace VPet_Simulator.Windows.Interface
hash = lps.GetInt64("hash"); hash = lps.GetInt64("hash");
if (lps.Remove("hash")) if (lps.Remove("hash"))
{ {
HashCheck = lps.GetLongHashCode() == hash; HashCheck = Sub.GetHashCode(lps.ToString()) == hash;
} }
} }
@ -108,7 +108,7 @@ namespace VPet_Simulator.Windows.Interface
lps.Remove("hash"); lps.Remove("hash");
if (HashCheck) if (HashCheck)
{ {
lps[(gi64)"hash"] = new LPS(lps).GetLongHashCode(); lps[(gi64)"hash"] = Sub.GetHashCode(lps.ToString());
} }
else else
lps[(gint)"hash"] = -1; lps[(gint)"hash"] = -1;

View File

@ -215,9 +215,9 @@ namespace VPet_Simulator.Windows.Interface
/// </summary> /// </summary>
public ILine PetData_OLD => this["petdata"]; public ILine PetData_OLD => this["petdata"];
/// <summary> /// <summary>
/// 储存顺序次数 /// 储存顺序次数++
/// </summary> /// </summary>
public int SaveTimes public int SaveTimesPP
{ {
get get
{ {
@ -226,6 +226,13 @@ namespace VPet_Simulator.Windows.Interface
return list; return list;
} }
} }
/// <summary>
/// 储存顺序次数
/// </summary>
public int SaveTimes
{
get => GetInt("savetimes", 100000);
}
private int presslength; private int presslength;
private int intercycle; private int intercycle;

View File

@ -175,7 +175,7 @@ namespace VPet_Simulator.Windows
//游戏存档 //游戏存档
if (Set != null) if (Set != null)
{ {
var st = Set.SaveTimes; var st = Set.SaveTimesPP;
if (Main != null) if (Main != null)
{ {
Set.VoiceVolume = Main.PlayVoiceVolume; Set.VoiceVolume = Main.PlayVoiceVolume;

View File

@ -1098,9 +1098,9 @@ namespace VPet_Simulator.Windows
int reloadid = 0; int reloadid = 0;
private void CBSaveReLoad_MouseEnter(object sender, MouseEventArgs e) private void CBSaveReLoad_MouseEnter(object sender, MouseEventArgs e)
{ {
if (reloadid != mw.GameSavesData.Statistics[(gint)"savetimes"]) if (reloadid != mw.Set.SaveTimes)
{ {
reloadid = mw.GameSavesData.Statistics[(gint)"savetimes"]; reloadid = mw.Set.SaveTimes;
CBSaveReLoad.SelectedItem = null; CBSaveReLoad.SelectedItem = null;
CBSaveReLoad.Items.Clear(); CBSaveReLoad.Items.Clear();
if (Directory.Exists(ExtensionValue.BaseDirectory + @"\BackUP")) if (Directory.Exists(ExtensionValue.BaseDirectory + @"\BackUP"))