Skip to content

Commit

Permalink
Error handler
Browse files Browse the repository at this point in the history
  • Loading branch information
Chuanhsing committed Jan 14, 2019
1 parent 46e842a commit 456f9e6
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion VPatchGGPK/Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -466,14 +466,22 @@ Boolean downloadAndVerifyPatch(string patch_md5)
{
string remoteUri = "https://52.199.220.87/fg/";
string fileName = patch_md5 + ".zip";
wc.DownloadFile(remoteUri + fileName, fileName);
if (!File.Exists(fileName))
{
wc.DownloadFile(remoteUri + fileName, fileName);
}
if (!File.Exists(fileName))
{
return false;
}
string md5sum = CalculateMD5(fileName);
OutputLine(md5sum);
if (patch_md5.Equals(md5sum))
{
OutputLine("MD5 sum matched.");
return true;
}
File.Delete(fileName);
OutputLine("MD5 sum not matched.");
return false;
}
Expand All @@ -482,6 +490,10 @@ Boolean downloadAndVerifyPatch(string patch_md5)
private void buttonApplyChinese_Click(object objsender, EventArgs e)
{
string server_version = getServerVersion();
if (String.IsNullOrEmpty(server_version))
{
return;
}
dynamic patch = getPatchInfo();
string patch_version = patch.version;
OutputLine("Patch Version: " + patch_version);
Expand Down

0 comments on commit 456f9e6

Please sign in to comment.