//print_r($ships);
//print_r($speechLines);
$stats = checkFiles();
$errorCount = count($stats['problemShips']);
foreach ($errorLines as $scriptErrors) {
    $errorCount += count($scriptErrors);
}
$warningCount = count($stats['warningShips']);
foreach ($warningLines as $scriptWarnings) {
    $warningCount += count($scriptWarnings);
}
if ($errorCount < 1) {
    $FIX = false;
}
if ($FIX == false) {
    displayStats($stats);
} else {
    echo "Errors found:    " . $errorCount . "\nAttempting to repair...\n";
    if (copy($FILE_COMMANDS, "{$FILE_COMMANDS}.bak") == false || copy($FILE_STATUS, "{$FILE_STATUS}.bak") == false) {
        echo "Unable to backup scripts. Exiting!";
        return false;
    }
    if (fix() == false) {
        echo "Unable to repair scripts.\n";
    } else {
        echo "Scripts repaired. Run {$argv['0']} (without {$argv['1']}) to view current status.\n";
    }
    exit;
}
function displayStats($stats)
{
Ejemplo n.º 2
0
</form>

</div>

<div class="dateRange">
Statistics from <?php 
echo $fm_date_start;
?>
 to <?php 
echo $fm_date_end;
?>
</div>

<!-- kz debugging: group list for logged in user
<?php 
print_r($_SESSION['groups']);
?>
-->
<?php 
displayStats($stats, $fm_summary);
if (USE_JAVASCRIPT_TOTALS) {
    ?>
<script>
getAllSenatorTotal();
</script>
<?php 
}
?>
</body>
</html>
Ejemplo n.º 3
0
        }
        $res = mysql_query("SELECT name, sum(duration) AS sum FROM Games JOIN Mods ON modId = Mods.id AND Games.id IN (SELECT distinct gameId AS cnt FROM Games2players WHERE playerId={$pid}) GROUP BY modId ORDER BY sum DESC LIMIT 0,5 ");
        echo "most played MODS are:\n";
        $i = 1;
        while ($row = mysql_fetch_array($res)) {
            echo $i . ". {$row['name']} - " . timeDiff($row[sum]) . "\n";
            $i++;
        }
        $res = mysql_query("SELECT count(*) AS cnt, side FROM Games2players WHERE playerId = {$pid} AND spectator = 0 GROUP BY side ORDER BY cnt DESC LIMIT 0,5");
        echo "most played SIDES are:\n";
        $i = 1;
        while ($row = mysql_fetch_array($res)) {
            echo $i . ". {$row['side']} - {$row['cnt']} times \n";
            $i++;
        }
        break;
    case "":
        echo "--- Stats for current game ---\n";
        $res = mysql_query("SELECT sum(duration) AS totalTime, avg(duration) AS avgTime, count(*) AS cnt,avg(players) AS avgPlayers FROM Games WHERE modId = " . getModId($_GET[mod]) . " AND mapId = " . getMapId($_GET[map]));
        @($row = mysql_fetch_array($res));
        echo "Game on this map and mod usually lasts " . timeDiff($row[avgTime]) . " and is played by " . round($row[avgPlayers]) . " players \n";
        for ($i = 0; $i < count($_GET[users]); $i++) {
            $spl = explode("|", $_GET[users][$i]);
            echo $spl[0] . " --> " . displayStats(getPlayerId($spl[0])) . "\n";
        }
        exit;
        break;
    default:
        echo "RESPOND\nuse !stats games, !stats maps, !stats player <name>";
        break;
}