From c90b3ac1ded3acf55a323505ebeec1c28d40cd4f Mon Sep 17 00:00:00 2001 From: Greg Edwards Date: Tue, 27 May 2014 23:43:08 -0400 Subject: [PATCH] Added some missing try blocks to gamestats request decoder. --- gts/test/Decode.aspx.cs | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/gts/test/Decode.aspx.cs b/gts/test/Decode.aspx.cs index c3f5b929..0829ff85 100644 --- a/gts/test/Decode.aspx.cs +++ b/gts/test/Decode.aspx.cs @@ -50,7 +50,7 @@ namespace PkmnFoundations.GTS.debug { } - if (data == null) + if (data == null) try { data = DecryptData(txtData.Text); @@ -58,10 +58,25 @@ namespace PkmnFoundations.GTS.debug foreach (byte b in data) checkedsum += b; - litGeneration.Text = ""; + litGeneration.Text = "Platinum?"; litChecksum.Text = checkedsum.ToString(); phChecksum.Visible = true; } + catch (FormatException) + { + } + + if (data == null) try + { + data = GtsSessionBase.FromUrlSafeBase64String(txtData.Text); + + litGeneration.Text = "Unknown (are you sure this is gamestats data?)"; + litChecksum.Text = ""; + phChecksum.Visible = false; + } + catch (FormatException) + { + } if (data == null) {