From 798b0557567853989fa81cc8f1f4f8fbbb3bdf38 Mon Sep 17 00:00:00 2001 From: korenkonder Date: Sun, 3 Jan 2021 08:42:54 +0300 Subject: [PATCH] Update DataBank.cs --- KKdMainLib/DataBank.cs | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/KKdMainLib/DataBank.cs b/KKdMainLib/DataBank.cs index f6d87a2..562d342 100644 --- a/KKdMainLib/DataBank.cs +++ b/KKdMainLib/DataBank.cs @@ -39,8 +39,9 @@ namespace KKdMainLib else if (file.Contains("psrData")) Success = true; else if (file.Contains("PvList") && (array.Length % 7 == 0 || array.Length % 6 == 0)) { - if (array[2] != "0" && array[3] != "1") + if (array[2] != "0" && array[2] != "1") { + pvListPDA = true; pvList = new PvList[array.Length / 6]; for (i = 0; i < pvList.Length; i++) pvList[i].SetValue(array, i, true); } @@ -123,15 +124,9 @@ namespace KKdMainLib for (i = 0; i < this.pvList.Length; i++) this.pvList[i].SetValue(pvList[i], compact); } - Success = true; - pvList.Dispose(); - } - else if (file.Contains("PvListPDA")) - { - pvListPDA = true; - MsgPack pvList; - if ((pvList = msgPack["PvListPDA", true]).NotNull) + else if ((pvList = msgPack["PvListPDA", true]).NotNull) { + pvListPDA = true; this.pvList = new PvList[pvList.Array.Length]; for (i = 0; i < this.pvList.Length; i++) this.pvList[i].SetValue(pvList[i], compact); @@ -349,7 +344,7 @@ namespace KKdMainLib return msgPack; } - public string ToString(bool pda) => pda + public string ToString(bool pda) => !pda ? UrlEncode($"{PV_ID},{Version},{Edition},{AdvDemoStart},{AdvDemoEnd},{StartShow},{EndShow}") : UrlEncode($"{PV_ID},{Version},{AdvDemoStart},{AdvDemoEnd},{StartShow},{EndShow}"); }