From: Rudolf Polzer Date: Fri, 13 Sep 2013 09:51:07 +0000 (+0200) Subject: More timeout playing. X-Git-Tag: xonotic-v0.8.0~75 X-Git-Url: https://git.xonotic.org/?p=xonotic%2Fxonotic.git;a=commitdiff_plain;h=fb187bb0cee595c3d0b0848aaac4592c25383e5e More timeout playing. --- diff --git a/misc/tools/xonotic-map-compiler b/misc/tools/xonotic-map-compiler index 371de705..d501437e 100755 --- a/misc/tools/xonotic-map-compiler +++ b/misc/tools/xonotic-map-compiler @@ -60,7 +60,8 @@ my $options = vis_timeout => 0, light_timeout => 0, minimap_timeout => 0, - scale_timeout => 0 + scale_timeout => 0, + timeout_stealing => 0, }; my $curmode = 'maps'; @@ -126,6 +127,10 @@ while(@ARGV) { $options->{scale_timeout} = shift @ARGV; } + elsif($_ eq '-timeout_stealing') + { + $options->{timeout_stealing} = shift @ARGV; + } elsif($_ eq '-order') { $options->{order} = [split /\s*,\s*/, shift @ARGV]; @@ -184,6 +189,8 @@ while(@ARGV) } my $linkdir = File::Temp::tempdir("xonotic-map-compiler.XXXXXX", TMPDIR => 1, CLEANUP => 1); +my $starttime = time; +my $endtime = time; sub q3map2(@) { @@ -195,8 +202,15 @@ sub q3map2(@) $timeout = $options->{minimap_timeout} if $mode eq '-minimap'; $timeout = $options->{scale_timeout} if $mode eq '-scale'; die "Invalid call: not a standard q3map2 stage" if not defined $timeout; + $endtime += $timeout; + my $stolen_timeout = $endtime - time; + if ($stolen_timeout > $timeout) + { + $timeout += ($stolen_timeout - $timeout) * $options->{timeout_stealing}; + } my @args = ($Q3MAP2, split(/\s+/, $Q3MAP2FLAGS), '-game', 'xonotic', '-fs_basepath', $XONOTICDIR, '-fs_basepath', $linkdir, '-v', @_); print "\$ @args\n"; + print "Using timeout: $timeout\n"; defined(my $pid = fork()) or die "fork: $!"; if($pid) # parent diff --git a/misc/tools/xonotic-map-compiler-autobuild b/misc/tools/xonotic-map-compiler-autobuild index 8379cc02..1c9fc7fa 100755 --- a/misc/tools/xonotic-map-compiler-autobuild +++ b/misc/tools/xonotic-map-compiler-autobuild @@ -7,7 +7,7 @@ url_http=http://beta.xonotic.org/autobuild-bsp/ url_ssh=xonotic-beta:autobuild-bsp/ build_cachedir="$HOME/xonotic-map-compiler.cache/" screenshot_cachedir="$HOME/xonotic-map-screenshot.cache/" -build_override="-bsp_timeout 3600 -vis_timeout 10800 -light_timeout 14400 -minimap_timeout 900 -scale_timeout 900" +build_override="-bsp_timeout 3600 -vis_timeout 10800 -light_timeout 18000 -minimap_timeout 900 -scale_timeout 900 -timeout_stealing 0.75" screenshot_override="9 900 5 +g_ctf 1" getthemap_fail=false