From 1b7b246455f8309e8d605cfd2caec5e00bb4bde4 Mon Sep 17 00:00:00 2001 From: Cassio de Campos Date: Fri, 4 Aug 2017 16:41:43 +0100 Subject: small fixes --- src/frun.php | 19 +++++++------ src/fscore.php | 52 +++++++++++++++++------------------ src/php.php | 1 - src/private/remotescores/otherservers | 1 - 4 files changed, 37 insertions(+), 36 deletions(-) delete mode 100644 src/php.php diff --git a/src/frun.php b/src/frun.php index 34bfd83..5576bcd 100644 --- a/src/frun.php +++ b/src/frun.php @@ -753,14 +753,17 @@ function DBNewRun($param,$c=null) { return 0; } } else { - $b = DBSiteInfo($contest, $site, $c); - $dif = $rundatediff; - if ($dif >= $b['siteduration']) { - DBExec($c, "rollback work", "DBNewRun(rollback-over)"); - LOGError("Tried to submit a run but the contest is over. SQL=(" . $sql . ")"); - MSGError("The contest is over!"); - return 0; - } + //cassiopc: so we let the run enter the system if it comes with a defined timestamp, but it is to decide later if it will be counted... + //$b = DBSiteInfo($contest, $site, $c); + $dif = $rundatediff; + /* + if ($dif >= $b['siteduration']) { + DBExec($c, "rollback work", "DBNewRun(rollback-over)"); + LOGError("Tried to submit a run but the contest is over. SQL=(" . $sql . ")"); + MSGError("The contest is over!"); + return 0; + } + */ } if($updatetime > $t || $insert) { diff --git a/src/fscore.php b/src/fscore.php index dbf55c4..2c57695 100644 --- a/src/fscore.php +++ b/src/fscore.php @@ -49,47 +49,47 @@ function ScoreCMP($a,$b) { } function ordena($a) { /* - $n = count($a); - $r = array(); - for ($i=0; $i<$n; $i++) { + $n = count($a); + $r = array(); + for ($i=0; $i<$n; $i++) { $max=null; foreach($a as $e => $c) { - if ($c != null && ($max==null || ScoreCMP($c,$max) > 0)) { - // $j=0; - // for(;$j<$i;$j++) - // if($r[$j]['user']==$a[$e]['user'] && $r[$j]['site']==$a[$e]['site']) break; - // if($j>=$i) { - $max = $c; - $maxe = $e; - // } - } + if ($c != null && ($max==null || ScoreCMP($c,$max) > 0)) { + // $j=0; + // for(;$j<$i;$j++) + // if($r[$j]['user']==$a[$e]['user'] && $r[$j]['site']==$a[$e]['site']) break; + // if($j>=$i) { + $max = $c; + $maxe = $e; + // } + } } if ($max==null) break; $r[$i] = $max; $a[$maxe] = null; - } + } */ uasort($a, "ScoreCMPinv"); return $a; /* - $r = array(); - $j = 0; - foreach($a as $k => $v) { + $r = array(); + $j = 0; + foreach($a as $k => $v) { $r[$j] = $v; $j++; - } - $j = 0; - $r = array(); - foreach($a as $k) { + } + $j = 0; + $r = array(); + foreach($a as $k) { if($j == 0) $r[0] = $k; else { - if($k['user'] != $r[$j]['user'] || $k['site'] != $r[$j]['site']) { - $j++; - $r[$j] = $k; - } - } + if($k['user'] != $r[$j]['user'] || $k['site'] != $r[$j]['site']) { + $j++; + $r[$j] = $k; + } } - return $r; + } + return $r; */ } function DBScore($contest, $verifylastmile, $hor=-1, $globalsite='0') { diff --git a/src/php.php b/src/php.php deleted file mode 100644 index 147cebc..0000000 --- a/src/php.php +++ /dev/null @@ -1 +0,0 @@ - diff --git a/src/private/remotescores/otherservers b/src/private/remotescores/otherservers index 1fa415c..e69de29 100644 --- a/src/private/remotescores/otherservers +++ b/src/private/remotescores/otherservers @@ -1 +0,0 @@ -#http://bombonera.org/boca siteX password -- cgit v1.2.3