Skip to content

Commit

Permalink
fixed hlsooe parser
Browse files Browse the repository at this point in the history
  • Loading branch information
Traderain committed Nov 7, 2016
1 parent 93ed5a1 commit d8eef75
Show file tree
Hide file tree
Showing 20 changed files with 107 additions and 76 deletions.
Binary file modified .vs/VolvoWrench/v14/.suo
Binary file not shown.
Binary file modified VolvoWrench.VC.db
Binary file not shown.
1 change: 1 addition & 0 deletions VolvoWrench/Demo stuff/CrossDemoParser.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System.IO;
using System.IO.MemoryMappedFiles;
using System.Text;
using VolvoWrench.Demo_stuff.GoldSource;

namespace VolvoWrench.Demo_stuff
{
Expand Down
112 changes: 69 additions & 43 deletions VolvoWrench/Demo stuff/GoldSource/GoldSourceParser.cs

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions VolvoWrench/Demo stuff/GoldSource/Verification.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ private void button1_Click(object sender, EventArgs e)
foreach (var f in from entry in d.Value.GsDemoInfo.DirectoryEntries
from frame in entry.Frames
where (int) frame.Key.Type < 2 || (int) frame.Key.Type > 9
select (GoldSource.NetMsgFrame) frame.Value)
select (GoldSource.GoldSource.NetMsgFrame) frame.Value)
{
fts += f.RParms.Frametime;
msecSum += f.UCmd.Msec;
Expand Down Expand Up @@ -100,8 +100,8 @@ from frame in entry.Frames
mrtb.AppendText(Path.GetFileName(dem.Key) + " -> " + dem.Value.GsDemoInfo.Header.MapName + "\n");
foreach (var f in dem.Value.GsDemoInfo.DirectoryEntries.SelectMany(entry =>
(from frame in entry.Frames.Where(
x => x.Key.Type == GoldSource.DemoFrameType.ConsoleCommand)
select (GoldSource.ConsoleCommandFrame) frame.Value into f
x => x.Key.Type == GoldSource.GoldSource.DemoFrameType.ConsoleCommand)
select (GoldSource.GoldSource.ConsoleCommandFrame) frame.Value into f
let cheats = new List<string>
{
"+lookup",
Expand Down
34 changes: 19 additions & 15 deletions VolvoWrench/Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using System.Security.Principal;
using System.Windows.Forms;
using VolvoWrench.Demo_stuff;
using VolvoWrench.Demo_stuff.GoldSource;
using static System.Convert;

namespace VolvoWrench
Expand Down Expand Up @@ -394,6 +395,7 @@ public void PrintDemoDetails(CrossParseResult demo)
{
if (demo != null)
{
richTextBox1.Text = "Demo parsed!";
StripEnabler(demo);
switch (demo.Type)
{
Expand All @@ -408,7 +410,7 @@ public void PrintDemoDetails(CrossParseResult demo)
UpdateForm();
foreach (var err in demo.GsDemoInfo.ParsingErrors)
{
richTextBox1.AppendText(err);
richTextBox1.AppendText("\n" + err);
UpdateForm();
}

Expand Down Expand Up @@ -478,31 +480,34 @@ public void PrintDemoDetails(CrossParseResult demo)
}
else
{
richTextBox1.Text =
$@"Analyzed HLS:OOE engine demo file ({demo.HlsooeDemoInfo.Header.GameDirectory
}):
richTextBox1.Text = $@"Analyzed HLS:OOE engine demo file ({demo.HlsooeDemoInfo.Header.GameDirectory}):
----------------------------------------------------------
Demo protocol: {demo.HlsooeDemoInfo.Header.DemoProtocol}
Net protocol: {demo.HlsooeDemoInfo.Header.Netprotocol}
Directory offset: {demo.HlsooeDemoInfo.Header.DirectoryOffset}
Map name: {demo.HlsooeDemoInfo.Header.MapName}
Game directory: {demo.HlsooeDemoInfo.Header.GameDirectory}
Length in seconds: {demo.HlsooeDemoInfo.DirectoryEntries.Skip(1).Sum(x => x.Frames.Last().Key.Time).ToString("n3")}s
Frame count: {demo.HlsooeDemoInfo.DirectoryEntries.Sum(x => x.FrameCount)}
Length in seconds: {(demo.HlsooeDemoInfo.DirectoryEntries.Last().Frames.LastOrDefault().Key.Frame) *0.015}s
Tick count: {(demo.HlsooeDemoInfo.DirectoryEntries.Last().Frames.LastOrDefault().Key.Frame)}
----------------------------------------------------------";
UpdateForm();
//TODO: Bug in time print
foreach (var demoDirectoryEntry in demo.HlsooeDemoInfo.DirectoryEntries)
{
foreach (var flag in demoDirectoryEntry.Flags)
{
richTextBox1.AppendText(flag.Value.Command + " at " + flag.Key.Frame + " -> " + (flag.Key.Frame*0.015).ToString("n3") + "s");
}
}
}
break;
case Parseresult.Source:
if (demo.Sdi.ParsingErrors.ToArray().Length > 0)
{
richTextBox1.Text = @"Error while parsing Source engine demo:
";
richTextBox1.Text = @"Error while parsing Source engine demo: ";
UpdateForm();
foreach (var err in demo.Sdi.ParsingErrors)
{
richTextBox1.AppendText(err);
richTextBox1.AppendText("\n"+err);
UpdateForm();
}
}
Expand All @@ -518,7 +523,7 @@ public void PrintDemoDetails(CrossParseResult demo)
Client name: {demo.Sdi.ClientName}
Map name: {demo.Sdi.MapName}
Game directory: {demo.Sdi.GameDirectory}
Playback seconds: {demo.Sdi.Seconds.ToString("#,0.000")}s
Playback seconds: {demo.Sdi.Seconds.ToString("n3")}s
Playback tick: {demo.Sdi.TickCount}
Frame count: {demo.Sdi.FrameCount}
Expand Down Expand Up @@ -552,7 +557,7 @@ public void PrintDemoDetails(CrossParseResult demo)
UpdateForm();
foreach (var err in demo.L4D2BranchInfo.parsingerrors)
{
richTextBox1.AppendText(err);
richTextBox1.AppendText("\n" + err);
UpdateForm();
}
}
Expand All @@ -566,7 +571,7 @@ public void PrintDemoDetails(CrossParseResult demo)
Client name: {demo.L4D2BranchInfo.Header.ClientName}
Mapname: {demo.L4D2BranchInfo.Header.MapName}
GameDir: {demo.L4D2BranchInfo.Header.GameDirectory}
Playbacktime: {demo.L4D2BranchInfo.Header.PlaybackTime}s
Playbacktime: {demo.L4D2BranchInfo.Header.PlaybackTime.ToString("n3")}s
Playbackticks: {demo.L4D2BranchInfo.Header.PlaybackTicks}
Playbackframes: {demo.L4D2BranchInfo.Header.PlaybackFrames}
Signonlength: {demo.L4D2BranchInfo.Header.SignonLength}
Expand Down Expand Up @@ -611,8 +616,7 @@ public void HighlightLastLine(RichTextBox textControl, Color highlightColor)

public static void Log(string s)
{
Directory.CreateDirectory(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\" +
"VolvoWrench");
Directory.CreateDirectory(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\" +"VolvoWrench");
File.AppendAllLines(LogPath, new[]
{
(DateTime.Now.ToString("yyyy-MM-ddTHH\\:mm\\:ss.fffffffzzz") + " " +
Expand Down
2 changes: 1 addition & 1 deletion VolvoWrench/bin/Debug/VolvoWrench.application
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
</dsig:Transforms>
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha256" />
<dsig:DigestValue>WJ/irLu1yDuWcE5+dQd9gQ8lf86mdWqDuWDUsbGPhPs=</dsig:DigestValue>
<dsig:DigestValue>6CUtqMb7b2p8ebFuATM9AvMgHKdCQuOM6jgVQLzWwiw=</dsig:DigestValue>
</hash>
</dependentAssembly>
</dependency>
Expand Down
Binary file modified VolvoWrench/bin/Debug/VolvoWrench.exe
Binary file not shown.
8 changes: 4 additions & 4 deletions VolvoWrench/bin/Debug/VolvoWrench.exe.manifest
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<description asmv2:iconFile="08 Wrench.ico" xmlns="urn:schemas-microsoft-com:asm.v1" />
<application />
<entryPoint>
<assemblyIdentity name="VolvoWrench" version="1.0.6154.32867" language="neutral" processorArchitecture="amd64" />
<assemblyIdentity name="VolvoWrench" version="1.0.6155.37628" language="neutral" processorArchitecture="amd64" />
<commandLine file="VolvoWrench.exe" parameters="" />
</entryPoint>
<trustInfo>
Expand Down Expand Up @@ -55,14 +55,14 @@
</dependentAssembly>
</dependency>
<dependency>
<dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="VolvoWrench.exe" size="864248">
<assemblyIdentity name="VolvoWrench" version="1.0.6154.32867" language="neutral" processorArchitecture="amd64" />
<dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="VolvoWrench.exe" size="865272">
<assemblyIdentity name="VolvoWrench" version="1.0.6155.37628" language="neutral" processorArchitecture="amd64" />
<hash>
<dsig:Transforms>
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
</dsig:Transforms>
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha256" />
<dsig:DigestValue>w9mF1wL4SOJ4+elMBCJzKVsN96D5vD5JUqmdzSl2XJY=</dsig:DigestValue>
<dsig:DigestValue>LgEO6zcGY4Nhyhx7yeo8SexAsSIddpkTK21GQQZ7PC0=</dsig:DigestValue>
</hash>
</dependentAssembly>
</dependency>
Expand Down
Binary file modified VolvoWrench/bin/Debug/VolvoWrench.pdb
Binary file not shown.
2 changes: 1 addition & 1 deletion VolvoWrench/bin/Debug/VolvoWrench.vshost.application
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
</dsig:Transforms>
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha256" />
<dsig:DigestValue>WJ/irLu1yDuWcE5+dQd9gQ8lf86mdWqDuWDUsbGPhPs=</dsig:DigestValue>
<dsig:DigestValue>6CUtqMb7b2p8ebFuATM9AvMgHKdCQuOM6jgVQLzWwiw=</dsig:DigestValue>
</hash>
</dependentAssembly>
</dependency>
Expand Down
8 changes: 4 additions & 4 deletions VolvoWrench/bin/Debug/VolvoWrench.vshost.exe.manifest
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<description asmv2:iconFile="08 Wrench.ico" xmlns="urn:schemas-microsoft-com:asm.v1" />
<application />
<entryPoint>
<assemblyIdentity name="VolvoWrench" version="1.0.6154.32867" language="neutral" processorArchitecture="amd64" />
<assemblyIdentity name="VolvoWrench" version="1.0.6155.37628" language="neutral" processorArchitecture="amd64" />
<commandLine file="VolvoWrench.exe" parameters="" />
</entryPoint>
<trustInfo>
Expand Down Expand Up @@ -55,14 +55,14 @@
</dependentAssembly>
</dependency>
<dependency>
<dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="VolvoWrench.exe" size="864248">
<assemblyIdentity name="VolvoWrench" version="1.0.6154.32867" language="neutral" processorArchitecture="amd64" />
<dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="VolvoWrench.exe" size="865272">
<assemblyIdentity name="VolvoWrench" version="1.0.6155.37628" language="neutral" processorArchitecture="amd64" />
<hash>
<dsig:Transforms>
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
</dsig:Transforms>
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha256" />
<dsig:DigestValue>w9mF1wL4SOJ4+elMBCJzKVsN96D5vD5JUqmdzSl2XJY=</dsig:DigestValue>
<dsig:DigestValue>LgEO6zcGY4Nhyhx7yeo8SexAsSIddpkTK21GQQZ7PC0=</dsig:DigestValue>
</hash>
</dependentAssembly>
</dependency>
Expand Down
Binary file modified VolvoWrench/bin/Debug/app.publish/VolvoWrench.exe
Binary file not shown.
Binary file modified VolvoWrench/obj/Debug/DesignTimeResolveAssemblyReferences.cache
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion VolvoWrench/obj/Debug/VolvoWrench.application
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
</dsig:Transforms>
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha256" />
<dsig:DigestValue>WJ/irLu1yDuWcE5+dQd9gQ8lf86mdWqDuWDUsbGPhPs=</dsig:DigestValue>
<dsig:DigestValue>6CUtqMb7b2p8ebFuATM9AvMgHKdCQuOM6jgVQLzWwiw=</dsig:DigestValue>
</hash>
</dependentAssembly>
</dependency>
Expand Down
Binary file not shown.
Binary file modified VolvoWrench/obj/Debug/VolvoWrench.exe
Binary file not shown.
8 changes: 4 additions & 4 deletions VolvoWrench/obj/Debug/VolvoWrench.exe.manifest
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<description asmv2:iconFile="08 Wrench.ico" xmlns="urn:schemas-microsoft-com:asm.v1" />
<application />
<entryPoint>
<assemblyIdentity name="VolvoWrench" version="1.0.6154.32867" language="neutral" processorArchitecture="amd64" />
<assemblyIdentity name="VolvoWrench" version="1.0.6155.37628" language="neutral" processorArchitecture="amd64" />
<commandLine file="VolvoWrench.exe" parameters="" />
</entryPoint>
<trustInfo>
Expand Down Expand Up @@ -55,14 +55,14 @@
</dependentAssembly>
</dependency>
<dependency>
<dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="VolvoWrench.exe" size="864248">
<assemblyIdentity name="VolvoWrench" version="1.0.6154.32867" language="neutral" processorArchitecture="amd64" />
<dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="VolvoWrench.exe" size="865272">
<assemblyIdentity name="VolvoWrench" version="1.0.6155.37628" language="neutral" processorArchitecture="amd64" />
<hash>
<dsig:Transforms>
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
</dsig:Transforms>
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha256" />
<dsig:DigestValue>w9mF1wL4SOJ4+elMBCJzKVsN96D5vD5JUqmdzSl2XJY=</dsig:DigestValue>
<dsig:DigestValue>LgEO6zcGY4Nhyhx7yeo8SexAsSIddpkTK21GQQZ7PC0=</dsig:DigestValue>
</hash>
</dependentAssembly>
</dependency>
Expand Down
Binary file modified VolvoWrench/obj/Debug/VolvoWrench.pdb
Binary file not shown.

0 comments on commit d8eef75

Please sign in to comment.