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;
- using System.Data.SqlClient;
- public partial class games_SmashyBall : System.Web.UI.Page
- {
- private const int CURRENT_VERSION = 31;
- private const string CURRENT_LAUNCHER_VERSION = "1.0.1.5";
- protected void Page_Load(object sender, EventArgs e)
- {
- if (Request.QueryString.Count >= 2)
- {
- int version = int.Parse(Request.Params.Get("gameVersion"));
- string launcherVersion = Request.Params.Get("launcherVersion");
- if (Request.QueryString.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");
- try
- {
- #region SQL Tracking
- SqlConnectionStringBuilder builder = new SqlConnectionStringBuilder();
- builder.DataSource = @"(local)\sebastianlawe";
- builder.UserID = System.Web.Configuration.WebConfigurationManager.AppSettings["DatabaseName"];
- builder.Password = System.Web.Configuration.WebConfigurationManager.AppSettings["DatabasePassword"];
- using (SqlConnection connection = new SqlConnection(builder.ConnectionString))
- {
- connection.Open();
- using (SqlCommand command = connection.CreateCommand())
- {
- command.CommandText = @"INSERT INTO [SebastianLawe].[dbo].[ProjectNORStats] (Id, OperatingSystem, Monitors, Resolutions, Processors, Is64Bit)
- VALUES (@Id, @OS, @Monitors, @Resolutions, @Processors, @Is64Bit)";
- SqlParameter parameter = command.CreateParameter();
- parameter.ParameterName = "@Id";
- parameter.Value = id;
- command.Parameters.Add(parameter);
- //--------------------------
- parameter = command.CreateParameter();
- parameter.ParameterName = "@OS";
- parameter.Value = os;
- command.Parameters.Add(parameter);
- //--------------------------
- parameter = command.CreateParameter();
- parameter.ParameterName = "@Monitors";
- parameter.Value = monitors;
- command.Parameters.Add(parameter);
- //--------------------------
- parameter = command.CreateParameter();
- parameter.ParameterName = "@Resolutions";
- parameter.Value = SmartTrim(resolutions);
- command.Parameters.Add(parameter);
- //--------------------------
- parameter = command.CreateParameter();
- parameter.ParameterName = "@Processors";
- parameter.Value = processors;
- command.Parameters.Add(parameter);
- //--------------------------
- parameter = command.CreateParameter();
- parameter.ParameterName = "@Is64Bit";
- parameter.Value = is64Bit;
- command.Parameters.Add(parameter);
- command.ExecuteNonQuery();
- }
- }
- #endregion SQL Tracking
- }
- catch { }
- }
- using (BinaryWriter metaWriter = new BinaryWriter(Response.OutputStream))
- {
- metaWriter.Write(CURRENT_VERSION);
- metaWriter.Write(CURRENT_LAUNCHER_VERSION);
- metaWriter.Write(19);
- metaWriter.Write(
- @"9/24/2015:
- Welcome to Project NOR!
- This is a first person shooter that takes a new spin on what a shooter is, and has full split screen support.
- This game is in alpha, and is bound to have plenty of bugs, and frequent updates.
- Asset changes, and entire theme re-designs may also happen as time progresses.
- Thanks for understanding that this is not a finished game, and happy testing!");
- metaWriter.Write(
- @"9/25/2015:
- Added more in depth controller settings. Added bumpmaps.");
- metaWriter.Write(
- @"9/26/2015:
- Fixed bug that prevented matchmaking from working.");
- metaWriter.Write(
- @"9/27/2015:
- Fixed bug where player could stick to walls.
- Increased player and bot movment speed.
- Added the ability to navigate menus with a controller or keyboard.
- Removed MapC(the maze) from the game due to performance issues.
- Fixed a bug where another team member could collect a point in CTF if another got the flag.
- Falling in water now stuns the player alongside being teleported.
- Fixed a bug where the player could infintite jump in MapF if the bridges dissapeared.
- Fixed a bug where the running animation would continue if a player was stunned.");
- metaWriter.Write(
- @"9/28/2015:
- Upgraded Unity runtime to the latest patch, sudden game crashes should hopefully be gone.");
- metaWriter.Write(
- @"9/30/2015:
- - New theme song, and initial main menu.
- - Fixed bug where team mate can re-steal a flag after its been stolen.
- - Fixed bug where AI players would act weird when the game menu is brought up.
- - Updated some of the maps with new additions.
- - Added optimizations to AI and changeable colours, and a few other routines.
- - Made stun bar the colour of whatever team the player is on.
- - Overhauled the controller input system. Nothing will be noticed gameplay wise.
- - Fixed bug where collision checking would have the player run into invisible walls under certain conditions.
- ");
- metaWriter.Write(
- @"10/1/2015:
- - Changed pathfinding system for AI.
- - Made some performance changes.
- ");
- metaWriter.Write(
- @"10/1/2015 - 2:40pm:
- - Fixed AI pathfinding in Map F
- - Disconnecting appears to have some bugs.
- ");
- metaWriter.Write(
- @"10/7/2015 - 5:27am:
- - Fixed bug where matchmaking would never find matches.
- - Added a new map (MapH).
- - Tweaked the AI not to run into one another.
- ");
- metaWriter.Write(
- @"10/8/2015 - 9:07am:
- - Added graphics options
- - Fixed bug where players could shoot from the menu.
- - Tweaked lighting.
- ");
- metaWriter.Write(
- @"10/12/2015 - 1:34am:
- - Added King Of The Hill
- - Added Single Flag CTF
- - Tweaked teleport enemy players.
- - Made blockades wider.
- ");
- metaWriter.Write(
- @"10/12/2015 - 2:12am:
- - Fixed bug where King Zones wouldn't detect if a player left the zone.
- - Fixed bug where teleporting enemy players was not working.
- - Fixed raised stun zone in MapH
- ");
- metaWriter.Write(
- @"10/14/2015 - 5:50pm:
- - Added a new map with new anti-gravity mechanics (MapI)
- - AI are not well suited for anti-gravity maps, expect bugs.
- ");
- metaWriter.Write(
- @"10/17/2015 - 4:50am:
- - Added a new map with anti-gravity mechanics (MapJ).
- - Made the anti-gravity mechanics fully flexible.
- - Fixed bug where CTF was not working properly.
- - Removed Realtime GI (it slows down the development process).
- - Modified MapF with new bases.
- ");
- metaWriter.Write(
- @"10/17/2015 - 2:04pm:
- - Fixed Occlusion Culling on MapJ
- - Fixed wall spawning when walking on walls.
- ");
- metaWriter.Write(
- @"10/17/2015 - 4:18pm:
- - Fixed spawns in MapF
- - Adjusted jumping
- - Fixed bug where AI would stutter and not follow any path.
- ");
- metaWriter.Write(
- @"10/17/2015 - 7:23pm:
- - Fixed bug where AI would stutter and not follow any path (still stutters though).
- ");
- metaWriter.Write(
- @"10/18/2015 - 5:43am:
- - Added level introductions.
- - Optimized and changed custom games menu.
- ");
- metaWriter.Write(
- @"10/21/2015 - 10:03:
- - Fixed bug where jumping would sometimes not work.
- - Made some subtle audio adjustments.
- ");
- if (CURRENT_LAUNCHER_VERSION == launcherVersion)
- {
- SqlConnectionStringBuilder builder = new SqlConnectionStringBuilder();
- builder.DataSource = @"(local)\sebastianlawe";
- builder.UserID = System.Web.Configuration.WebConfigurationManager.AppSettings["DatabaseName"];
- builder.Password = System.Web.Configuration.WebConfigurationManager.AppSettings["DatabasePassword"];
- using (SqlConnection connection = new SqlConnection(builder.ConnectionString))
- {
- connection.Open();
- using (SqlCommand command = connection.CreateCommand())
- {
- command.CommandText = @"select top 5 [Url], [ImageUrl] from [SebastianLawe].[dbo].[HomeCarousel]
- Order by [DateCreated] ASC";
- SqlDataReader reader = command.ExecuteReader();
- List<KeyValuePair<string, string>> pairs = new List<KeyValuePair<string, string>>();
- while (reader.Read())
- {
- pairs.Add(new KeyValuePair<string, string>((string)reader.GetValue(0), (string)reader.GetValue(1)));
- }
- metaWriter.Write(pairs.Count);
- foreach (KeyValuePair<string, string> pair in pairs)
- {
- metaWriter.Write(pair.Key);
- metaWriter.Write(pair.Value);
- }
- }
- }
- if (version < CURRENT_VERSION)
- {
- using (FileStream input = new FileStream(Path.Combine(AppDomain.CurrentDomain.BaseDirectory + @"\games\ProjectNOR\", "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
- {
- if (launcherVersion == "1.0.0.4")
- {
- metaWriter.Write((long)0);
- }
- using (FileStream input = new FileStream(Path.Combine(AppDomain.CurrentDomain.BaseDirectory + @"\games\ProjectNOR\", "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);
- }
- }
- }
- }
- }
- }
- private string SmartTrim(string resolutions)
- {
- string value = "";
- foreach (char character in resolutions)
- {
- if (character != '<')
- {
- value += character;
- }
- else
- {
- break;
- }
- }
- return value;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment