Skip to content

Commit

Permalink
Fixed many ipmortant bugs
Browse files Browse the repository at this point in the history
 -  Openwith
 -  Overlay
 -  Other minor stuff in save and resharper stuff
  • Loading branch information
Traderain committed Dec 8, 2016
1 parent 7174e16 commit b78de99
Show file tree
Hide file tree
Showing 80 changed files with 646 additions and 500 deletions.
Binary file modified .vs/VolvoWrench/v14/.suo
Binary file not shown.
4 changes: 3 additions & 1 deletion VolvoWrench/DG/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ private static void Main(string[] args)
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
var cla = args;
var argsappended = args.ToList();
argsappended.Add(AppDomain.CurrentDomain?.SetupInformation?.ActivationArguments?.ActivationData[0]); //This fixes the OpenWith on clickonce apps
var cla = argsappended;
if (cla.Any(x => Path.GetExtension(x) == ".dem" || Path.GetExtension(x) == ".sav"))
if (cla.Any(x => Path.GetExtension(x) == ".dem"))
Application.Run(new Main(cla.First(x => Path.GetExtension(x) == ".dem")));
Expand Down
9 changes: 4 additions & 5 deletions VolvoWrench/Demo stuff/CrossDemoParser.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using VolvoWrench.Demo_stuff.GoldSource;
using VolvoWrench.Demo_stuff.L4D2Branch;
using VolvoWrench.Demo_stuff.Source;
using VolvoWrench.Demo_Stuff.GoldSource;
using VolvoWrench.Demo_Stuff.L4D2Branch;
using VolvoWrench.Demo_Stuff.Source;

namespace VolvoWrench.Demo_stuff
namespace VolvoWrench.Demo_Stuff
{
/// <summary>
/// Type of the demo
Expand Down
43 changes: 43 additions & 0 deletions VolvoWrench/Demo stuff/DemoInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
using System.Collections.Generic;

namespace VolvoWrench.Demo_Stuff
{
/// <summary>
/// Demos return a class that inherits this
/// </summary>
public abstract class DemoInfo
{
/// <summary>
/// The errors that happened in the demo
/// </summary>
public List<string> ParsingErrors;

/// <summary>
/// The name of the file
/// </summary>
public string FileName;
}

/// <summary>
/// This is a template for every demo's header
/// </summary>
public abstract class DemoHeader
{
/// <summary>
/// Protocol of the demo
/// </summary>
public int DemoProtocol;
/// <summary>
/// Netprotocol of the demo
/// </summary>
public int NetProtocol;
/// <summary>
/// The map the demo is played on
/// </summary>
public string MapName;
/// <summary>
/// The game directory's name
/// </summary>
public string GameDir;
}
}
2 changes: 1 addition & 1 deletion VolvoWrench/Demo stuff/GoldSource/Demo doctor.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions VolvoWrench/Demo stuff/GoldSource/Demo doctor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using System.Windows.Forms;
using VolvoWrench.Properties;

namespace VolvoWrench.Demo_stuff.GoldSource
namespace VolvoWrench.Demo_Stuff.GoldSource
{
/// <summary>
/// A form for repairing goldsource demos
Expand All @@ -19,7 +19,7 @@ public partial class DemoDoctor : Form
/// <summary>
/// We call this constructor when finding a broken demo
/// </summary>
/// <param name="filename"></param>
/// <param name="filename">Path to file</param>
public DemoDoctor(string filename)
{
InitializeComponent();
Expand Down
52 changes: 26 additions & 26 deletions VolvoWrench/Demo stuff/GoldSource/GoldSourceParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using System.Windows.Forms;
using System.Windows.Media.Media3D;

namespace VolvoWrench.Demo_stuff.GoldSource
namespace VolvoWrench.Demo_Stuff.GoldSource
{
/// <summary>
/// Types for HLSOOE
Expand Down Expand Up @@ -119,14 +119,19 @@ public class StartupPacketFrame : IFrame
public Point3D ViewOrigins;
}

public class DemoHeader : IFrame
/// <summary>
/// This is the header of HLS:OOE demos
/// </summary>
public class DemoHeader : Demo_Stuff.DemoHeader
{
public int DemoProtocol;
/// <summary>
/// The byte offset to the first directory entry
/// </summary>
public int DirectoryOffset;
public string GameDirectory;
/// <summary>
/// The magic of the file mostly HLDEMO
/// </summary>
public string Magic;
public string MapName;
public int Netprotocol;
}

public class DemoDirectoryEntry
Expand Down Expand Up @@ -220,14 +225,19 @@ public string EngineName(int name)
return s;
}

public class DemoHeader
/// <summary>
/// The header of the GoldSource demo
/// </summary>
public class DemoHeader : Demo_Stuff.DemoHeader
{
public int DemoProtocol;
/// <summary>
/// Byte offset untill the first directory enry
/// </summary>
public int DirectoryOffset;
public string GameDir;
/// <summary>
/// Map ID
/// </summary>
public uint MapCrc;
public string MapName;
public int NetProtocol;
};

public struct DemoDirectoryEntry
Expand All @@ -243,9 +253,7 @@ public struct DemoDirectoryEntry
public int Type;
}

public interface IFrame
{
}
public interface IFrame { }

public struct Point4D
{
Expand Down Expand Up @@ -457,7 +465,7 @@ public struct Stats
/// <summary>
/// Info class about normal GoldSource engine demos
/// </summary>
public struct GoldSourceDemoInfo
public class GoldSourceDemoInfo : DemoInfo
{
/// <summary>
/// The directory entries of the demo containing the frames
Expand All @@ -471,16 +479,12 @@ public struct GoldSourceDemoInfo
/// The header of the demo
/// </summary>
public GoldSource.DemoHeader Header;
/// <summary>
/// A string list containing the errors happened while parsing the demo
/// </summary>
public List<string> ParsingErrors;
}

/// <summary>
/// Info class about HLSOOE Demos
/// </summary>
public class GoldSourceDemoInfoHlsooe
public class GoldSourceDemoInfoHlsooe : DemoInfo
{
/// <summary>
/// The directory entries of the demo containing the frames
Expand All @@ -490,10 +494,6 @@ public class GoldSourceDemoInfoHlsooe
/// The header of the demo
/// </summary>
public Hlsooe.DemoHeader Header;
/// <summary>
/// A string list containing the errors happened while parsing the demo
/// </summary>
public List<string> ParsingErrors;
}

/// <summary>
Expand Down Expand Up @@ -540,11 +540,11 @@ public static GoldSourceDemoInfoHlsooe ParseDemoHlsooe(string s)
if (mw == "HLDEMO")
{
hlsooeDemo.Header.DemoProtocol = br.ReadInt32();
hlsooeDemo.Header.Netprotocol = br.ReadInt32();
hlsooeDemo.Header.NetProtocol = br.ReadInt32();
hlsooeDemo.Header.MapName = Encoding.ASCII.GetString(br.ReadBytes(260))
.Trim('\0')
.Replace("\0", string.Empty);
hlsooeDemo.Header.GameDirectory =
hlsooeDemo.Header.GameDir =
Encoding.ASCII.GetString(br.ReadBytes(260)).Trim('\0').Replace("\0", string.Empty);
hlsooeDemo.Header.DirectoryOffset = br.ReadInt32();
//Header Parsed... now we read the directory entries
Expand Down
2 changes: 1 addition & 1 deletion VolvoWrench/Demo stuff/GoldSource/Verification.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion VolvoWrench/Demo stuff/GoldSource/Verification.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
using System.Windows.Forms;
using MoreLinq;

namespace VolvoWrench.Demo_stuff.GoldSource
namespace VolvoWrench.Demo_Stuff.GoldSource
{
/// <summary>
/// This is a form to aid goldsource run verification
Expand Down
2 changes: 1 addition & 1 deletion VolvoWrench/Demo stuff/Heatmap/Heatmap.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion VolvoWrench/Demo stuff/Heatmap/Heatmap.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using System.Drawing.Drawing2D;
using System.Windows.Forms;

namespace VolvoWrench.Demo_stuff.Heatmap
namespace VolvoWrench.Demo_Stuff.Heatmap
{
public partial class Heatmap : Form
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using System.IO;
using System.Text;

namespace VolvoWrench.Demo_stuff.L4D2Branch.BitStreamUtil
namespace VolvoWrench.Demo_Stuff.L4D2Branch.BitStreamUtil
{
public class BitArrayStream : IBitStream
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using System.IO;
using System.Text;

namespace VolvoWrench.Demo_stuff.L4D2Branch.BitStreamUtil
namespace VolvoWrench.Demo_Stuff.L4D2Branch.BitStreamUtil
{
public static class BitStreamUtil
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using System.IO;
using System.Linq;

namespace VolvoWrench.Demo_stuff.L4D2Branch.BitStreamUtil
namespace VolvoWrench.Demo_Stuff.L4D2Branch.BitStreamUtil
{
public class DebugBitStream : IBitStream
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System;
using System.IO;

namespace VolvoWrench.Demo_stuff.L4D2Branch.BitStreamUtil
namespace VolvoWrench.Demo_Stuff.L4D2Branch.BitStreamUtil
{
public interface IBitStream : IDisposable
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using System.Diagnostics;
using System.IO;

namespace VolvoWrench.Demo_stuff.L4D2Branch.BitStreamUtil
namespace VolvoWrench.Demo_Stuff.L4D2Branch.BitStreamUtil
{
public class ManagedBitStream : IBitStream
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

namespace VolvoWrench.Demo_stuff.L4D2Branch.BitStreamUtil
namespace VolvoWrench.Demo_Stuff.L4D2Branch.BitStreamUtil
{
public unsafe class UnsafeBitStream : IBitStream
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace VolvoWrench.Demo_stuff.L4D2Branch.CSGODemoInfo
namespace VolvoWrench.Demo_Stuff.L4D2Branch.CSGODemoInfo
{
public class AdditionalPlayerInformation
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
using VolvoWrench.Demo_stuff.L4D2Branch.BitStreamUtil;
using VolvoWrench.Demo_stuff.L4D2Branch.CSGODemoInfo.DP.FastNetmessages;
using VolvoWrench.Demo_stuff.L4D2Branch.CSGODemoInfo.Messages;
using VolvoWrench.Demo_Stuff.L4D2Branch.BitStreamUtil;
using VolvoWrench.Demo_Stuff.L4D2Branch.CSGODemoInfo.DP.FastNetmessages;
using VolvoWrench.Demo_Stuff.L4D2Branch.CSGODemoInfo.Messages;

namespace VolvoWrench.Demo_stuff.L4D2Branch.CSGODemoInfo.DP
namespace VolvoWrench.Demo_Stuff.L4D2Branch.CSGODemoInfo.DP
{
public static class DemoPacketParser
{
{
#if SLOW_PROTOBUF
private static IEnumerable<IMessageParser> Parsers = (
from type in Assembly.GetExecutingAssembly().GetTypes()
Expand All @@ -21,10 +21,10 @@ where type.GetInterfaces().Contains(typeof(IMessageParser))
/// <param name="bitstream">Bitstream.</param>
/// <param name="demo">Demo.</param>
public static void ParsePacket(IBitStream bitstream, DemoParser demo)
{
{
//As long as there is stuff to read
while (!bitstream.ChunkFinished)
{
{
int cmd = bitstream.ReadProtobufVarInt(); //What type of packet is this?
int length = bitstream.ReadProtobufVarInt(); //And how long is it?
bitstream.BeginChunk(length * 8); //read length bytes
Expand Down Expand Up @@ -69,7 +69,7 @@ public static void ParsePacket(IBitStream bitstream, DemoParser demo)
#endif
}
bitstream.EndChunk();
}
}
}
}
}
}
}
8 changes: 4 additions & 4 deletions VolvoWrench/Demo stuff/L4D2Branch/CSGODemoInfo/DP/Entity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using VolvoWrench.Demo_stuff.L4D2Branch.BitStreamUtil;
using VolvoWrench.Demo_stuff.L4D2Branch.CSGODemoInfo.DP.Handler;
using VolvoWrench.Demo_stuff.L4D2Branch.CSGODemoInfo.DT;
using VolvoWrench.Demo_Stuff.L4D2Branch.BitStreamUtil;
using VolvoWrench.Demo_Stuff.L4D2Branch.CSGODemoInfo.DP.Handler;
using VolvoWrench.Demo_Stuff.L4D2Branch.CSGODemoInfo.DT;

namespace VolvoWrench.Demo_stuff.L4D2Branch.CSGODemoInfo.DP
namespace VolvoWrench.Demo_Stuff.L4D2Branch.CSGODemoInfo.DP
{
internal class Entity
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
using System;
using System.IO;
using VolvoWrench.Demo_stuff.L4D2Branch.BitStreamUtil;
using VolvoWrench.Demo_stuff.L4D2Branch.CSGODemoInfo.DP.Handler;
using VolvoWrench.Demo_Stuff.L4D2Branch.BitStreamUtil;
using VolvoWrench.Demo_Stuff.L4D2Branch.CSGODemoInfo.DP.Handler;

namespace VolvoWrench.Demo_stuff.L4D2Branch.CSGODemoInfo.DP.FastNetmessages
namespace VolvoWrench.Demo_Stuff.L4D2Branch.CSGODemoInfo.DP.FastNetmessages
{
public struct CreateStringTable
{
Expand Down
Loading

0 comments on commit b78de99

Please sign in to comment.