]> git.xonotic.org Git - xonotic/xonotic.git/commitdiff
More timeout playing.
authorRudolf Polzer <divverent@xonotic.org>
Fri, 13 Sep 2013 09:51:07 +0000 (11:51 +0200)
committerRudolf Polzer <divverent@xonotic.org>
Fri, 13 Sep 2013 09:51:07 +0000 (11:51 +0200)
misc/tools/xonotic-map-compiler
misc/tools/xonotic-map-compiler-autobuild

index 371de70514562d3accd1cbc1397baaa428760999..d501437e4e2a23d3f779c452c4ddc0f23495b1ae 100755 (executable)
@@ -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
index 8379cc0222b1dc9361abdb4f50f6f763e91a15fe..1c9fc7fa4e77480d12631dabee47ece17b60b2b0 100755 (executable)
@@ -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