More timeout playing.

This commit is contained in:
Rudolf Polzer 2013-09-13 11:51:07 +02:00
parent 06d705ee7c
commit fb187bb0ce
2 changed files with 16 additions and 2 deletions

View File

@ -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

View File

@ -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