diff --git a/gts/BattleVideo.aspx b/gts/BattleVideo.aspx index 32ca41a0..21c48072 100644 --- a/gts/BattleVideo.aspx +++ b/gts/BattleVideo.aspx @@ -2,22 +2,25 @@ <%@ Register TagPrefix="pf" Namespace="PkmnFoundations.GTS" Assembly="PkmnFoundations.GTS" %> - +

Battle videos

-

Please enter your battle video's ID (eg. 12-34567-89012) into this form to have it backed up -onto Foundations GTS.

+

Since the official Battle Video server has gone offline, you can no longer queue +your battle videos for retrieval. You can still type your battle video ID into one +of the below forms to check if I have it backed up. If not, you can try +Pokécheck. If it’s not there, +your video is gone. If it’s still on your game cartridge, you will be able to +reupload it to fGTS under a new ID once I launch the battle video server. Stay tuned.

Generation IV (Platinum, Heart Gold, Soul Silver)

- + +
- -videos queued, videos saved in total.
@@ -25,14 +28,12 @@ videos saved in total.

Generation V (Black, White, Black 2, White 2)

- + +
- -videos queued, videos saved in total.
-
diff --git a/gts/BattleVideo.aspx.cs b/gts/BattleVideo.aspx.cs index 19baacb3..6ee6da22 100644 --- a/gts/BattleVideo.aspx.cs +++ b/gts/BattleVideo.aspx.cs @@ -14,16 +14,14 @@ namespace PkmnFoundations.GTS { protected void Page_Load(object sender, EventArgs e) { - litMessage.Text = ""; + litMessage4.Text = ""; + litMessage5.Text = ""; using (MySqlConnection db = CreateConnection()) { db.Open(); - litQueued4.Text = HttpUtility.HtmlEncode(db.ExecuteScalar("SELECT Count(*) FROM BattleVideoCrawlQueue WHERE Complete = 0")); litTotal4.Text = HttpUtility.HtmlEncode(db.ExecuteScalar("SELECT Count(*) FROM BattleVideoCrawlQueue WHERE Complete = 1")); - - litQueued5.Text = HttpUtility.HtmlEncode(db.ExecuteScalar("SELECT Count(*) FROM BattleVideoCrawlQueue5 WHERE Complete = 0")); litTotal5.Text = HttpUtility.HtmlEncode(db.ExecuteScalar("SELECT Count(*) FROM BattleVideoCrawlQueue5 WHERE Complete = 1")); db.Close(); @@ -36,7 +34,7 @@ namespace PkmnFoundations.GTS UInt64.TryParse(txtBattleVideo4.Text.Replace('-', ' ').Replace(" ", ""), out id); if (id == 0) { - litMessage.Text = "The battle video ID could not be read. Please enter a battle video ID in the format, xx-xxxxx-xxxxx, and try again."; + litMessage4.Text = "The battle video ID could not be read. Please enter a battle video ID in the format, xx-xxxxx-xxxxx, and try again."; return; } @@ -50,19 +48,15 @@ namespace PkmnFoundations.GTS private void QueueVideoId4(MySqlConnection db, ulong id) { - using (MySqlTransaction tran = db.BeginTransaction()) + long count = (long)db.ExecuteScalar("SELECT Count(*) FROM BattleVideoCrawlQueue " + + "WHERE SerialNumber = @serial_number AND Complete = 1", + new MySqlParameter("@serial_number", id)); + if (count > 0) { - long count = (long)tran.ExecuteScalar("SELECT Count(*) FROM BattleVideoCrawlQueue WHERE SerialNumber = @serial_number", new MySqlParameter("@serial_number", id)); - if (count > 0) - { - tran.Rollback(); - litMessage.Text = "The battle video is already queued for retrieval."; - return; - } - tran.ExecuteNonQuery("INSERT INTO BattleVideoCrawlQueue (SerialNumber, `Timestamp`) VALUES (@serial_number, NOW())", new MySqlParameter("@serial_number", id)); - tran.Commit(); - litMessage.Text = "The battle video has been queued for retrieval."; + litMessage4.Text = "This battle video has been saved."; + return; } + litMessage4.Text = "This battle video is lost."; } protected void btnSend5_Click(object sender, EventArgs e) @@ -71,7 +65,7 @@ namespace PkmnFoundations.GTS UInt64.TryParse(txtBattleVideo5.Text.Replace('-', ' ').Replace(" ", ""), out id); if (id == 0) { - litMessage.Text = "The battle video ID could not be read. Please enter a battle video ID in the format, xx-xxxxx-xxxxx, and try again."; + litMessage5.Text = "The battle video ID could not be read. Please enter a battle video ID in the format, xx-xxxxx-xxxxx, and try again."; return; } @@ -85,19 +79,15 @@ namespace PkmnFoundations.GTS private void QueueVideoId5(MySqlConnection db, ulong id) { - using (MySqlTransaction tran = db.BeginTransaction()) + long count = (long)db.ExecuteScalar("SELECT Count(*) FROM BattleVideoCrawlQueue5 " + + "WHERE SerialNumber = @serial_number AND Complete = 1", + new MySqlParameter("@serial_number", id)); + if (count > 0) { - long count = (long)tran.ExecuteScalar("SELECT Count(*) FROM BattleVideoCrawlQueue5 WHERE SerialNumber = @serial_number", new MySqlParameter("@serial_number", id)); - if (count > 0) - { - tran.Rollback(); - litMessage.Text = "The battle video is already queued for retrieval."; - return; - } - tran.ExecuteNonQuery("INSERT INTO BattleVideoCrawlQueue5 (SerialNumber, `Timestamp`) VALUES (@serial_number, NOW())", new MySqlParameter("@serial_number", id)); - tran.Commit(); - litMessage.Text = "The battle video has been queued for retrieval."; + litMessage5.Text = "This battle video has been saved."; + return; } + litMessage5.Text = "This battle video is lost."; } public static MySqlConnection CreateConnection() diff --git a/gts/BattleVideo.aspx.designer.cs b/gts/BattleVideo.aspx.designer.cs index 9604ed55..3345818b 100644 --- a/gts/BattleVideo.aspx.designer.cs +++ b/gts/BattleVideo.aspx.designer.cs @@ -12,6 +12,15 @@ namespace PkmnFoundations.GTS { public partial class BattleVideo { + /// + /// HeaderColour1 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::PkmnFoundations.GTS.HeaderColour HeaderColour1; + /// /// theForm control. /// @@ -40,13 +49,13 @@ namespace PkmnFoundations.GTS { protected global::System.Web.UI.WebControls.Button btnSend4; /// - /// litQueued4 control. + /// litMessage4 control. /// /// /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// - protected global::System.Web.UI.WebControls.Literal litQueued4; + protected global::System.Web.UI.WebControls.Literal litMessage4; /// /// litTotal4 control. @@ -76,13 +85,13 @@ namespace PkmnFoundations.GTS { protected global::System.Web.UI.WebControls.Button btnSend5; /// - /// litQueued5 control. + /// litMessage5 control. /// /// /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// - protected global::System.Web.UI.WebControls.Literal litQueued5; + protected global::System.Web.UI.WebControls.Literal litMessage5; /// /// litTotal5 control. @@ -92,14 +101,5 @@ namespace PkmnFoundations.GTS { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.Literal litTotal5; - - /// - /// litMessage control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Literal litMessage; } }