From 858d1936f6ab3bcb47f572e6f9e077ef869ff4e7 Mon Sep 17 00:00:00 2001 From: Bruno Ribas Date: Thu, 5 Nov 2020 15:22:28 -0300 Subject: admin/report/webcast.php: Stream via webcast.sep Signed-off-by: Bruno Ribas --- src/admin/report/webcast.php | 49 ++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 45 insertions(+), 4 deletions(-) (limited to 'src/admin/report/webcast.php') diff --git a/src/admin/report/webcast.php b/src/admin/report/webcast.php index cf791a7..58a71b1 100644 --- a/src/admin/report/webcast.php +++ b/src/admin/report/webcast.php @@ -37,7 +37,7 @@ $wcloweruser = array(); $wcupperuser = array(); for($i=0; $i= ' . $wcloweruser[$i] . ' AND usernumber <= ' . $wcupperuser[$i] . ')'; $sql .= ')'; @@ -157,13 +158,14 @@ for ($i = 0; $i < $numRuns; $i++) { if(in_array($runTeam, $teamIDs)) { $runProblem = $run[$i]['problem']; +if($runTime < $freezeTime) { $runfile = $runfile . $runID . '' . $runTime . '' . $runTeam . '' . $runProblem . ''; - if ($runTime > $freezeTime) { + if ($runTime >= $freezeTime) { $runfile = $runfile . '?' . "\n"; } else if ($run[$i]['yes'] == 't') { $runfile = $runfile . 'Y' . "\n"; @@ -174,15 +176,54 @@ for ($i = 0; $i < $numRuns; $i++) { } } } +} +if($st['currenttime'] >= $freezeTime) +$timefile = $freezeTime; +else $timefile = $st['currenttime']; + + $versionfile = '1.0' . "\n"; +$_SESSION["usertable"]=array(); +$_SESSION["usertable"]["contestnumber"]=1; +$_SESSION["usertable"]["usersitenumber"]=1; + + +$score = DBScore($contest, false, -1, $site); + +$icpcfile=''; +$class=1; +$nid=1; +while(list($e, $c) = each($score)) { + if(isset($score[$e]["site"]) && isset($score[$e]["user"])) { + $r = DBUserInfo($contest, + $score[$e]["site"], $score[$e]["user"]); + if(in_array($r['username'], $teamIDs)) { + if(is_numeric($r["usericpcid"]) && $r["usericpcid"] > 0) { + $icpcfile .= $r["usericpcid"] . ","; +//} else { +//$icpcfile .= $nid++ . ','; +//} + $icpcfile .= $class++ . ","; + $icpcfile .= $score[$e]["totalcount"] . ","; + $icpcfile .= $score[$e]["totaltime"] . ","; + + if($score[$e]["first"]) + $icpcfile .= $score[$e]["first"] . "\n"; + else $icpcfile .= "0\n"; + } + } + } +} + if(is_writable($webcastdir)) { @file_put_contents($webcastdir . $ds . 'runs',$runfile); @file_put_contents($webcastdir . $ds . 'contest',$contestfile); @file_put_contents($webcastdir . $ds . 'version',$versionfile); @file_put_contents($webcastdir . $ds . 'time',$timefile); + @file_put_contents($webcastdir . $ds . 'icpc',$icpcfile); if(@create_zip($webcastdir,array('.'),$webcastdir . ".zip") != 1) { LOGError("Cannot create score webcast.zip file"); MSGError("Cannot create score webcast.zip file"); @@ -195,4 +236,4 @@ if(is_writable($webcastdir)) { MSGError('Error creating the folder for the ZIP file: '.$webcastdir); ForceLoad("../index.php"); } -?> \ No newline at end of file +?> -- cgit v1.2.3