Example #1
0
<?php

$pageName = "statusdata.php";
include "inc.config.php";
error_reporting($reportLevel);
include "inc.common.php";
include "inc.mysqli.conn.php";
include "inc.requests.php";
echo "<table class='status'>\n";
echo "<tr><td class='center' colspan='2'>" . $siteName . "</td></tr>\n";
$ServerStats = sqlGetServerStats($mySQLiConn);
if ($ServerStats["ServerState"] == 0) {
    echo "<tr><td class='center' colspan='2'><img src='./img/Offline.png' alt='OFFLINE'></td></tr>\n";
} else {
    echo "<tr><td class='center' colspan='2'><img src='./img/Online.png' alt='ONLINE'></td></tr>\n";
}
$SessionStatus = "";
if ($ServerStats["MaxLaps"] < 2147483647) {
    $SessionStatus = " (" . $ServerStats["CurLaps"] . "/" . $ServerStats["MaxLaps"] . " Laps)";
}
echo "<tr><td class='right'>Venue</td><td>" . $ServerStats["TrackName"] . "</td></tr>\n";
echo "<tr><td class='right'>Start</td><td>" . formatStartTime($ServerStats["SessionStart"]) . "</td></tr>\n";
echo "<tr><td class='right'>Session</td><td>" . setSessionName($ServerStats["SessionID"], $ServerStats["GameID"]) . " (" . setSessionState($ServerStats["SessionState"]) . ")</td></tr>\n";
echo "<tr><td class='right'>Status</td><td>" . formatSessionTime($ServerStats["SessionEnd"] - $ServerStats["SessionTime"]) . $SessionStatus . "</td></tr>\n";
echo "<tr><td class='right'>Vehicles</td><td>" . $ServerStats["NumVehicles"] . "</td></tr>\n";
echo "<tr><td class='right'>Ambient</td><td>" . sprintf("%.1f", $ServerStats["AmbientTemp"]) . " &deg;C</td></tr>\n";
echo "<tr><td class='right'>Track</td><td>" . sprintf("%.1f", $ServerStats["TrackTemp"]) . " &deg;C</td></tr>\n";
echo "<tr><td class='right'>Date</td><td>" . date("d.m.Y (H:i:s) T") . "</td></tr>\n";
echo "<tr><td class='right'>Live View</td><td><a href='" . $siteURL . "/monitor.php' target='_blank'>Monitor</a> &copy; <a href='http://vortex-motorsports.de/' target='_blank'>VorteX-Motorsports</a></td></tr>\n";
echo "</table>\n";
Example #2
0
 //              $MonitorData .= "<fieldset class='sessioninfo'>\n";
 while ($rowSessionInfos = $resultSessionInfos->fetch_assoc()) {
     // -- set session infos
     $siLoaderVersion = $rowSessionInfos["LoaderVersion"];
     $siGameID = $rowSessionInfos["GameID"];
     $siGameVersion = $rowSessionInfos["GameVersion"];
     $siPluginVersion = $rowSessionInfos["PluginVersion"];
     $siServerStart = $rowSessionInfos["ServerStart"];
     $siServerState = $rowSessionInfos["ServerState"];
     $siSessionStart = $rowSessionInfos["SessionStart"];
     $siSessionID = $rowSessionInfos["SessionID"];
     $siSessionState = $rowSessionInfos["SessionState"];
     $siSessionTime = $rowSessionInfos["SessionTime"];
     $siSessionEnd = $rowSessionInfos["SessionEnd"];
     $siSessionTimeLeft = formatSessionTime($siSessionEnd - $siSessionTime);
     $siSessionName = setSessionName($siSessionID, $siGameID);
     $siSessionLaps = $rowSessionInfos["CurLaps"];
     $siMaxLaps = $rowSessionInfos["MaxLaps"];
     $siTrackName = $rowSessionInfos["TrackName"];
     $siTrackLength = $rowSessionInfos["TrackLength"];
     $siInGameStart = $rowSessionInfos["InGameStart"];
     $siAmbientTemp = formatTemp($rowSessionInfos["AmbientTemp"]);
     $siTrackTemp = formatTemp($rowSessionInfos["TrackTemp"]);
     $siDarkClouds = formatWetness($rowSessionInfos["DarkCloud"]);
     $siRaining = formatWetness($rowSessionInfos["Raining"]);
     $siWetOnTrack = formatWetness($rowSessionInfos["OnPathWetness"]);
     $siTrackState = setTrackState($rowSessionInfos["YellowFlagState"]);
     // -- set session top lap times
     $siTopS1 = $rowSessionInfos["TopS1"];
     if ($siTopS1 >= 2147483647) {
         $siTopS1 = 0;
Example #3
0
$tr2 = '';
$cpClass1 = 1;
$cpClass2 = 1;
$cpClass3 = 1;
$cpClass4 = 1;
$bestLap = 0;
$gapBest = 0;
if (!$mySQLiConn->connect_error) {
    $selectSessionInfos = "SELECT SQL_CACHE * FROM `sessioninfos` WHERE `ID` = '1' LIMIT 1";
    if ($resultSessionInfos = $mySQLiConn->query($selectSessionInfos)) {
        if ($resultSessionInfos->num_rows == 1) {
            while ($rowSessionInfos = $resultSessionInfos->fetch_assoc()) {
                $siGameID = $rowSessionInfos["GameID"];
                $siSessionStart = $rowSessionInfos["SessionStart"];
                $siTrackName = $mySQLiConn->real_escape_string($rowSessionInfos["TrackName"]);
                $siSessionName = setSessionName($rowSessionInfos["SessionID"], $siGameID);
                $siSessionState = setSessionState($rowSessionInfos["SessionState"], $siGameID);
            }
        }
        $resultSessionInfos->free();
    } else {
        writeErrorLog($pageName, "selectSessionInfos", "SQL ERROR: (" . $mySQLiConn->error . ") QUERY: (" . $selectSessionInfos . ")");
    }
    if ($siSessionStart == "0") {
        $MarqueeData = '<table><tr><td class="NoData">No Session Data</td></tr></table>';
    } else {
        $selectSlots = "SELECT SQL_CACHE * FROM `slots` ORDER BY `Place` ASC";
        if ($resultSlots = $mySQLiConn->query($selectSlots)) {
            if ($resultSlots->num_rows > 0) {
                while ($rowSlots = $resultSlots->fetch_assoc()) {
                    $slotPos = $rowSlots["Place"];
Example #4
0
 *   So, we have defined main paths and loaded configs.
 *   Now define and configure all other options (for php, session, etc)
 * */
/* setting php configuration options, session lifetime and error_reporting level */
ini_set('max_execution_time', 500);
ini_set('short_open_tag', 'off');
// upload params
ini_set('upload_max_filesize', '200M');
ini_set('post_max_size', '200M');
ini_set('max_file_uploads', '20');
ini_set('memory_limit', '400M');
// session params
$sessionLifetime = (IS_DEBUG_HOST ? 0 : Config::get('session.lifetime', 4320)) * 60;
ini_set("session.gc_maxlifetime", $sessionLifetime);
ini_set("session.gc_divisor", "100");
ini_set("session.gc_probability", "1");
session_set_cookie_params($sessionLifetime, '/' . $cfg['core_name'] . '/', $_SERVER['SERVER_NAME'], !empty($_SERVER['HTTPS']), true);
session_name(setSessionName());
//error reporting params
error_reporting(IS_DEBUG_HOST ? E_ALL : E_ERROR);
// mb encoding config
mb_internal_encoding("UTF-8");
mb_detect_order('UTF-8,UTF-7,ASCII,EUC-JP,SJIS,eucJP-win,SJIS-win,JIS,ISO-2022-JP,WINDOWS-1251,WINDOWS-1250');
mb_substitute_character("none");
// timezone
date_default_timezone_set('UTC');
/* end of setting php configuration options, session lifetime and error_reporting level */
//clear debug_log for each request when on debug host
if (IS_DEBUG_HOST) {
    // @unlink(Config::get('debug_log'));
}
Example #5
0
         $ClassName = "<span style='color:" . $class3Color . ";'>" . $class3DisplayName . "</span>";
         $LapTime = "<span style='color:" . $class3Color . ";'>" . formatLapTime($Row["LapTime"]) . "</span>";
         $GapToNextLap = "<span style='color:" . $class3Color . ";'>" . $GapToNextLap . "</span>";
         break;
     case $class4RealName:
         $ClassName = "<span style='color:" . $class4Color . ";'>" . $class4DisplayName . "</span>";
         $LapTime = "<span style='color:" . $class4Color . ";'>" . formatLapTime($Row["LapTime"]) . "</span>";
         $GapToNextLap = "<span style='color:" . $class4Color . ";'>" . $GapToNextLap . "</span>";
         break;
     default:
         $ClassName = "<span class='classUC'>" . $Row["VehicleClass"] . "</span>";
         $LapTime = "<span class='classUC'>" . formatLapTime($Row["LapTime"]) . "</span>";
         $GapToNextLap = "<span class='classUC'>" . $GapToNextLap . "</span>";
         break;
 }
 $SessionName = setSessionName($Row["SessionID"], $GameID);
 $trClass = "'bg0'";
 if ($HotlapRank % 2 == 0) {
     $trClass = "'bg1'";
 }
 if (isset($admitLaps) && $admitLaps > 0) {
     if ($Row["TimedLaps"] < $admitLaps) {
         $trClass = "'bg2'";
     }
 }
 if (isset($admitTime) && $admitTime > 0) {
     if (isset($admitTimePerClass) && $admitTimePerClass == 1) {
         if ($Row["LapTime"] > $ClassBestLap * $admitTime) {
             $trClass = "'bg3'";
         }
     } else {