You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 22, 2021. It is now read-only.
Console.WriteLine("WARNING: The header for this demo file is corrupted. TickRate, TickTime, ParsingProgress, CurrentTime will be 0 for the first 50 ticks. PlaybackFrames, PlaybackTicks, PlaybackTime will always be 0. HeaderCorrupted event triggered.");
553
+
Console.WriteLine("WARNING: The header for this demo file is corrupted. TickRate, TickTime, CurrentTime will be 0 for ticks at the start of the demo. ParsingProgress, PlaybackFrames, PlaybackTicks, PlaybackTime will always be 0. HeaderCorrupted event triggered.");
542
554
543
555
if(HeaderCorrupted!=null)
544
556
{
@@ -571,6 +583,25 @@ public void ParseToEnd(CancellationToken token)
571
583
}
572
584
}
573
585
586
+
privatevoidFixTickTime()
587
+
{
588
+
// at the beginning of demos the tickgap can be erratic, so make sure we have 10 consecutive that are the same
589
+
intgap=TickGaps[1]-TickGaps[0];
590
+
boolisConsecutive=true;
591
+
for(inti=1;i<TickGaps.Count-1;i++){
592
+
if(TickGaps[i+1]-TickGaps[i]!=gap)
593
+
{
594
+
TickGaps.Clear();
595
+
isConsecutive=false;
596
+
break;
597
+
}
598
+
}
599
+
600
+
if(isConsecutive){
601
+
_ticktime=gap*TickInterval;
602
+
}
603
+
}
604
+
574
605
/// <summary>
575
606
/// Parses the next tick of the demo.
576
607
/// </summary>
@@ -580,6 +611,15 @@ public bool ParseNextTick()
580
611
if(Header==null)
581
612
thrownewInvalidOperationException("You need to call ParseHeader first before you call ParseToEnd or ParseNextTick!");
0 commit comments