Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Web;
- using System.Web.UI;
- using System.Web.UI.WebControls;
- using System.IO;
- public partial class games_SmashyBall : System.Web.UI.Page
- {
- private const int CURRENT_VERSION = 1;
- private const string CURRENT_LAUNCHER_VERSION = "1.0.0.3";
- protected void Page_Load(object sender, EventArgs e)
- {
- if (Request.Params.Count >= 2)
- {
- int version = int.Parse(Request.Params.Get("gameVersion"));
- string launcherVersion = Request.Params.Get("launcherVersion");
- if (Request.Params.Count == 6)
- {
- string id = Request.Params.Get("id");
- string os = Request.Params.Get("os");
- int monitors = int.Parse(Request.Params.Get("monitors"));
- string resolutions = Request.Params.Get("resolutions");
- int processors = int.Parse(Request.Params.Get("processors"));
- string is64Bit = Request.Params.Get("is64Bit");
- }
- using (BinaryWriter metaWriter = new BinaryWriter(Response.OutputStream))
- {
- metaWriter.Write(CURRENT_VERSION);
- metaWriter.Write(CURRENT_LAUNCHER_VERSION);
- metaWriter.Write(2);
- metaWriter.Write(
- @"4/29/2015:
- This release of Smashy Ball is for everybody who is up and running on a Windows PC.
- For the 12 months this game has been out, the PC market has not had proper support or updates for this game.
- To fix this, this new launcher has been created to make sure you're game version is always up to date.");
- metaWriter.Write(
- @"4/30/2015:
- Updated the Launcher. You'll have to go and download the new one from itch.io");
- if (CURRENT_LAUNCHER_VERSION == launcherVersion)
- {
- using (FileStream input = new FileStream(Path.Combine(AppDomain.CurrentDomain.BaseDirectory + @"\games\", "game.zip"),
- FileMode.Open, FileAccess.Read))
- {
- metaWriter.Write(input.Length);
- //metaWriter.Write(DateTime.Now.Ticks);
- byte[] buffer = new byte[32768];
- int read;
- while ((read = input.Read(buffer, 0, buffer.Length)) != 0)
- {
- Response.OutputStream.Write(buffer, 0, read);
- }
- }
- }
- else
- {
- using (FileStream input = new FileStream(Path.Combine(AppDomain.CurrentDomain.BaseDirectory + @"\games\", "launcher.exe"),
- FileMode.Open, FileAccess.Read))
- {
- metaWriter.Write(input.Length);
- //metaWriter.Write(DateTime.Now.Ticks);
- byte[] buffer = new byte[32768];
- int read;
- while ((read = input.Read(buffer, 0, buffer.Length)) != 0)
- {
- Response.OutputStream.Write(buffer, 0, read);
- }
- }
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment