示例#1
0
 if ($scoreHome > $scoreAway) {
   $scoreLeft = $scoreHome;
   $scoreRight = $scoreAway;
   $userIdLoser = $row['userIdAway'];
   $dcLeft = $dcHome;
   $dcRight = $dcAway;
   
 } else {
   $scoreLeft = $scoreAway;
   $scoreRight = $scoreHome;
   $userIdLoser = $row['userIdHome'];
   $dcLeft = $dcAway;
   $dcRight = $dcHome;
 }
 
 if (IsFishySixserverGame($scoreLeft, $scoreRight, $minutes)) {
   
   $punish = false;
   if (($scoreLeft >= $scoreRight) && $dcRight) {
     $punish = true;
   } elseif (($scoreLeft == $scoreRight) && $dcLeft)  {
     $punish = true;
     $userIdLoser = $row['userIdAway'];
   }
     
   if ($punish) {
     if (array_key_exists($userIdLoser, $users)) {
       $users[$userIdLoser]['monthDC'] = $users[$userIdLoser]['monthDC'] + 1;
     } else {
       $users[$userIdLoser] = array('weekDC' => 0, 'monthDC' => 1, 'seasonDC' => 0, 'userId' => $userIdLoser);
     }
示例#2
0
            $playerLeft3 = $player_home3;
            $playerRight3 = $player_away3;   

            $hostLeft = $manBlue;
            $hostRight = $manRed;
            
            $DCLeft = $homeDC;
            $DCRight = $awayDC;
          }
          
          $rowspan = "";
          $topmargin = 'style="margin-top:2px"';
          
          if ($selectname == 'all' && ($playerLeft == $cookie_name || $playerRight == $cookie_name || (!empty($playerLeft2) && $playerLeft2 == $cookie_name) || (!empty($playerRight2) && $playerRight2 == $cookie_name))) {
            $rowclass = "row_active";
          } elseif (empty($playerLeft2) && empty($playerRight2) && ($lobbyName <> 'Training') && IsFishySixserverGame($scoreLeft, $scoreRight, $minutes) && ($DCRight || ($scoreLeft == $scoreRight && $DCLeft))) {
            $rowclass = "row_alert";
          } else {
            $rowclass = "row";
          }
          
          $regScoreInfo = "";
          if (($scoreLeft > $scoreRegLeft) || ($scoreRight > $scoreRegRight)) {
            $regScoreInfo = ' style="cursor:help;" title="'.$scoreRegLeft.'-'.$scoreRegRight.' after 90 minutes"';
          }
          if (!is_null($exitLeft)) {
            $playerLeftDisplay = '<span title="Disconnected at '.formatLongDate($exitLeft).'">'.$playerLeft.'</span>';
          } else {
            $playerLeftDisplay = $playerLeft;
          }
          
示例#3
0
            $winner2 = $playerHome2;
        }
        if ($profileAway2 > 0) {
            $loser2 = $playerAway2;
        }
        if ($scoreHome == $scoreAway) {
            //report draw?
            if ($playerHome1Points > $playerAway1Points && $dc == 1 || $playerHome1Points < $playerAway1Points && $dc == 2) {
                $loserDC = true;
            }
        } elseif ($dc == 2) {
            $loserDC = true;
        }
    }
    $log->LogInfo('dc=' . $dc . ' loserDC=' . $loserDC);
    if (($minutes >= 75 || IsFishySixserverGame($scoreLeft, $scoreRight, $minutes)) && $loserDC) {
        ReportToLadder($smId, $teamLeft, $teamRight, $winner1, $winner2, $loser1, $loser2, $scoreLeft, $scoreRight, $scoreLeftExt, $scoreRightExt, $patchId, $log, false);
    } else {
        $log->LogInfo('Game not fishy, skipping: #' . $smId);
        $sql = "UPDATE six_matches_status SET reported=1, updated=updated WHERE id=" . $smId;
        $res = mysql_query($sql);
    }
}
function ReportToLadder($matchId, $teamLeft, $teamRight, $winner1, $winner2, $loser1, $loser2, $scoreLeft, $scoreRight, $scoreLeftExt, $scoreRightExt, $patchId, $log, $finished)
{
    // Settings correct?
    $sql = "SELECT matchTime FROM six_matches_info WHERE matchId={$matchId} AND type=";
    if ($finished) {
        $sql .= "'F'";
    } else {
        $sql .= "'U'";
示例#4
0
function RecalculateDcForProfile($profileId)
{
    $sql = "SELECT season FROM six_stats";
    $sixSeason = mysql_fetch_array(mysql_query($sql))[0];
    $sql = "SELECT sms.season, sms.minutes, sms.scoreHome, sms.scoreAway, sms.profileHome, sms.profileAway, " . "sp1.user_id AS userIdHome, sp2.user_id AS userIdAway, " . "UNIX_TIMESTAMP( sms.updated ) AS updatedTS " . "FROM six_matches_status sms " . "LEFT JOIN six_profiles sp1 ON sp1.id = sms.profileHome " . "LEFT JOIN six_profiles sp2 ON sp2.id = sms.profileAway " . "WHERE (sms.profileHome={$profileId} OR sms.profileAway={$profileId}) " . "AND sms.profileHome2=0 " . "AND sms.profileAway2=0 " . "AND sms.lobbyName <> 'Training' " . "AND sms.season={$sixSeason}";
    // echo "<p>$sql</p>";
    $result = mysql_query($sql);
    $profiles = array();
    $users = array();
    $dc = 0;
    while ($row = mysql_fetch_array($result)) {
        $scoreHome = $row['scoreHome'];
        $scoreAway = $row['scoreAway'];
        $minutes = $row['minutes'];
        $updated = $row['updatedTS'];
        $season = $row['season'];
        if ($scoreHome > $scoreAway) {
            $scoreLeft = $scoreHome;
            $scoreRight = $scoreAway;
            $profileIdLoser = $row['profileAway'];
            $userIdLoser = $row['userIdAway'];
        } else {
            $scoreLeft = $scoreAway;
            $scoreRight = $scoreHome;
            $profileIdLoser = $row['profileHome'];
            $userIdLoser = $row['userIdHome'];
        }
        if (IsFishySixserverGame($scoreLeft, $scoreRight, $minutes) && $profileIdLoser == $profileId) {
            $dc++;
        }
    }
    $sql = "SELECT disconnects from six_profiles WHERE id={$profileId}";
    $dcOld = mysql_fetch_array(mysql_query($sql))[0];
    $sql = "UPDATE six_profiles SET disconnects={$dc} WHERE id={$profileId}";
    mysql_query($sql);
    $result = "RecalculateDcForProfile: profileId={$profileId} dcOld={$dcOld} dc={$dc}";
    return $result;
}