From: Jan "Yenya" Kasprzak Date: Sat, 7 May 2011 21:17:07 +0000 (+0200) Subject: replay -f: do not show semaphore X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=commitdiff_plain;h=b59f8d3cf415df9b25e05fa7e95726c378ac5ce7;p=slotcarman.git replay -f: do not show semaphore When replaying log with -f (as fast as possible), do not show the semaphore, because it is timed by wallclock time, and causes early start to be reported. FIXME: we should probably time the semaphore using the log time instead. --- diff --git a/SCX/Track.pm b/SCX/Track.pm index c88e6f8..a86ba42 100644 --- a/SCX/Track.pm +++ b/SCX/Track.pm @@ -20,6 +20,7 @@ sub new { round => 0, now => 0, qualification_setup => -100, + no_semaphore => $args->{no_semaphore}, }; bless $self, $class; @@ -49,6 +50,11 @@ sub race_start { if ($time - $self->{qualification_setup} < 1) { $self->{qualification_running} = 1; + } elsif ($self->{no_semaphore}) { + $self->{round} = 0; + $self->{race_running} = 1; + $self->{race_running_since} = $self->{now}; + $self->{start_in_progress} = undef; } else { $self->{round} = 0; $self->{race_running} = 0; diff --git a/slotcarman b/slotcarman index 5e3a04f..66a6d98 100755 --- a/slotcarman +++ b/slotcarman @@ -26,7 +26,7 @@ if (($opt{t} && $opt{l}) } my $gui = SCX::GUI->new({ img_height => 100 }); -my $track = SCX::Track->new({ gui => $gui }); +my $track = SCX::Track->new({ gui => $gui, no_semaphore => $opt{f} }); my $logfile = 'log';