Skip to content

Commit

Permalink
Merge pull request #5 from randommonk/develop
Browse files Browse the repository at this point in the history
Bumped version to 4.3. Added jpgraph stats developed by killerEye
  • Loading branch information
sn3p authored Jan 8, 2018
2 parents 66b162b + 730c20d commit e861eaf
Show file tree
Hide file tree
Showing 49 changed files with 4,934 additions and 61 deletions.
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# OS generated files #
######################
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
ehthumbs.db
Thumbs.db
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,17 @@ There's also a tool that extracts screenshots [here](http://www.unrealadmin.org/

The current install is compatible with the database of version 4.2 and later.
However bunny track stats are only available from version 4.2.5.
Additionally, graph imports are only available from version 4.3.

Just remove all the files/folders (apart from the logs folder, if you wish to
keep your backup logs), and upload all the files in the html folder to your
webserver.

Then visit the admin area and click "Check Server Settings" near the bottom of
the list. This will install databases if they're missing and fix the Bunny
Track captimes to the new format if needed.
the list. This will:
- Install missing database tables if they're missing.
- Insert all the required charttype data into the database.
- Fix the BunnyTrack captimes to the new format if needed.

If you use your old config.php make sure the following section is included:

Expand Down
25 changes: 25 additions & 0 deletions html/import.php
Original file line number Diff line number Diff line change
Expand Up @@ -740,6 +740,7 @@ function add_info($name, $value) {
echo "Done\n";
if ($html) echo'</td></tr>';

include('import/import_renderer-preconfig.php');

$updategameinfo = false;
if (count($ignored_players) > 0) {
Expand All @@ -757,6 +758,30 @@ function add_info($name, $value) {
mysql_query("UPDATE uts_match SET gameinfo = '$gameinfo' WHERE id = '$matchid'");
$updategameinfo = false;
}
if ($gamename == "Domination" || $gamename == "Domination (insta)" ) {
if ($html) echo '<tr><td class="smheading" align="left" width="350">';
echo "Generating dom graphs: ";
if ($html) echo '</td><td class="grey" align="left" width="200">';
include("import/import_renderer-dom.php");
echo "Done\n";
if ($html) echo'</td></tr>';
}
else if ($gamename == "Tournament DeathMatch" || $gamename == "Tournament DeathMatch (insta)" || $gamename == "Tournament Team Game" || $gamename == "Tournament Team Game (insta)" ) {
if ($html) echo '<tr><td class="smheading" align="left" width="350">';
echo "Generating dm graphs: ";
if ($html) echo '</td><td class="grey" align="left" width="200">';
include("import/import_renderer-dm.php");
echo "Done\n";
if ($html) echo'</td></tr>';
}
else if ($gamename == "Capture the Flag" || $gamename == "Capture the Flag (insta)" ) {
if ($html) echo '<tr><td class="smheading" align="left" width="350">';
echo "Generating ctf graphs: ";
if ($html) echo '</td><td class="grey" align="left" width="200">';
include("import/import_renderer-ctf.php");
echo "Done\n";
if ($html) echo'</td></tr>';
}
}
}

Expand Down
30 changes: 30 additions & 0 deletions html/import/import_renderer-ctf.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@

<?php
include_once('includes/renderer-dm.php');
include_once('includes/renderer-ctf.php');

// Only run script if at least 5 minutes were played
if(($time_gameend-$time_gamestart)>300 && count(array_unique($playernames))>=2) {

try {
$safe_uid = mysql_real_escape_string($uid);

prepCTFdata($safe_uid);

renderScoreGraph($safe_uid);

// Get relevant data
list($datafrags, $derivfrags, $topFraggers,$counter,$datafragsteam,$derivfragsteam,$topTeams) = parseDMdata($safe_uid);

renderFragBarsTeams($datafragsteam,$derivfragsteam,$topTeams,$counter);

if($playernumberofteams == 2)
renderDataPickups($safe_uid);

} catch (Exception $e) {

// Do nothing, but simply do not block import

}
}
?>
31 changes: 31 additions & 0 deletions html/import/import_renderer-dm.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@

<?php
include_once('includes/renderer-dm.php');


// Only run script if at least 5 minutes were played
if(($time_gameend-$time_gamestart)>300 && count(array_unique($playernames))>=2) {

try {
$safe_uid = mysql_real_escape_string($uid);

// Get relevant data
list($datafrags, $derivfrags, $topFraggers,$counter,$datafragsteam,$derivfragsteam,$topTeams) = parseDMdata($safe_uid);

if($playernumberofteams > 1 && count(array_unique($playernames)) > 3 &&($gamename == "Tournament Team Game" || $gamename == "Tournament Team Game (insta)" || $gamename == "2v2v2v2 iTDM"))
renderFragBarsTeams($datafragsteam,$derivfragsteam,$topTeams,$counter);

renderFragBars($datafrags, $derivfrags, $topFraggers,$counter);

if(count($playernames) == 2)
renderDataPickups($safe_uid,false,($playerteams[$topFraggers[0]]==0),$topFraggers);
else if($playernumberofteams == 2)
renderDataPickups($safe_uid);

} catch (Exception $e) {

// Do nothing, but simply do not block import

}
}
?>
32 changes: 32 additions & 0 deletions html/import/import_renderer-dom.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@

<?php
include_once('includes/renderer-dom.php');
include_once('includes/renderer-dm.php');

// Only run script if at least 5 minutes were played
if(($time_gameend-$time_gamestart)>300 && count(array_unique($playernames))>=8) {

$tableTempIdom = generateTempTable($safe_uid);
$ampTimes = generateAmpTimes($safe_uid);

try {

renderDataTotal($safe_uid,$tableTempIdom);
renderDataCPs($safe_uid,$tableTempIdom);

renderDataPickups($safe_uid);
renderAmpBars($safe_uid,$tableTempIdom);

list($datafrags, $derivfrags, $topFraggers,$counter,$datafragsteam,$derivfragsteam,$topTeams) = parseDMdata($safe_uid);
renderFragBarsTeams($datafragsteam,$derivfragsteam,$topTeams,$counter);

} catch (Exception $e) {

// Do nothing, but simply do not block import

}

// drop table
mysql_query("DROP TABLE $tableTempIdom") or die(mysql_error());
}
?>
17 changes: 17 additions & 0 deletions html/import/import_renderer-preconfig.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php
require_once 'includes/renderer-general-import.php';

$safe_uid = mysql_real_escape_string($uid);

// Get relevant info
$playerinfo = getPlayerTeam($uid);
$playernames = $playerinfo[0];
$playerteams = $playerinfo[1];
$playernumberofteams = $playerinfo[2];

$time_gameinfo = getGameStartEndRatio($uid);
$time_gamestart = $time_gameinfo[0];
$time_gameend = $time_gameinfo[1];
$time_ratio_correction = $time_gameinfo[2];

?>
65 changes: 60 additions & 5 deletions html/includes/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@

// Use the MySQL temporary tables feature?
// Available since MySQL 3.23 - requires CREATE TEMPORARY TABLE privilege since 4.0.2
$import_use_temporary_tables = true; // set to true if available
// No longer supported from UTStats version 4.3 onwards. Left here for historical purposes.
$import_use_temporary_tables = false; // DON'T USE IF YOU DON'T KNOW WHAT YOU'RE DOING!

// Use temporary heap tables?
// This will (at any cost) keep the entire table in RAM and may speed and/or fuck things up
Expand All @@ -41,7 +42,6 @@
// Purge old logs after x days. 0 to disable.
$import_log_backups_purge_after = 0;


// After how many seconds should we reload the import page?
// This is to prevent the 'maximum execution time exeeded' error. It will reload
// the page after the amount of seconds you specify in order to bypass php's time limit.
Expand Down Expand Up @@ -140,6 +140,7 @@
// FTP Connection Details
$ftp_use = false; // Whether to auto get the log files
$ftp_interval = 0; // How often in minutes to allow stats update
$ftp_debug = false; // Debugging output that may help you to resolve ftp problems
$ftp_type = 'sockets'; // Which FTP module do you want to use?
// sockets - (recommended)
// Use PHP's socket extension to connect to the FTP server
Expand All @@ -150,9 +151,6 @@
// Debugging will not be available with this module and
// error handling may not be as good as with the other modules

$ftp_debug = false; // Debugging output that may help you to resolve ftp problems


// UT Server 1
$i = 0;
$ftp_hostname[$i] = ''; // FTP server location here
Expand Down Expand Up @@ -183,4 +181,61 @@
$ftp_delete[$i] = true; // Delete logs after download?
*/

// This section is for stats graphs as of version 4.3
$renderer_folder = "renderings";
$renderer_width = 350;
$renderer_heigth = 250;
$renderer_color['team'][0][0] = '#ff3333'; // team red color 1
$renderer_color['team'][0][1] = '#cc0000'; // team red color 2
$renderer_color['team'][1][0] = '#0080ff'; // team blue color 1
$renderer_color['team'][1][1] = '#0000cc'; // team blue color 2
$renderer_color['team'][2][0] = '#88d8b0'; // team green color 1
$renderer_color['team'][2][1] = '#009f50'; // team green color 2
$renderer_color['team'][3][0] = '#ffeead'; // team gold color 1
$renderer_color['team'][3][1] = '#e5b021'; // team gold color 2
$renderer_color['player'][0][0] = '#a7d848'; // player 1 color 1
$renderer_color['player'][0][1] = '#98be44'; // player 1 color 2
$renderer_color['player'][1][0] = '#6ccdd0'; // player 2 color 1
$renderer_color['player'][1][1] = '#66af9f'; // player 2 color 2
$renderer_color['player'][2][0] = '#ffce59'; // player 3 color 1
$renderer_color['player'][2][1] = '#ffa65a'; // player 3 color 2
$renderer_color['player'][3][0] = '#fba263'; // player 4 color 1
$renderer_color['player'][3][1] = '#eb7254'; // player 4 color 2
$renderer_color['player'][4][0] = '#fb6370 '; // player 5 color 1
$renderer_color['player'][4][1] = '#fb6363'; // player 5 color 2
$renderer_color['background'] = '#262626';// background color 1
$renderer_color['band'][0] = '#666666';// band color 1
$renderer_color['band'][1] = '#515151';// band color 2
$renderer_color['heading'] = '#bbdeff';// font heading
$renderer_color['font'] = '#999999';// font other
$renderer_color['amp'] = '#aa02db';// color amp
$renderer_color_transparancy = 0.3;// color amp

define("TIMERATIO", 1.09863333333333333333333333333333333333333333333333333333333);

define("RENDERER_CHARTTYPE_LINE", "line");
define("RENDERER_CHARTTYPE_COLUMN", "column");
define("RENDERER_CHARTTYPE_BAR", "bar");
define("RENDERER_CHARTTYPE_LINESTEP", "linestep");
define("RENDERER_CHARTTYPE_LINECOLUMN", "linecolumn");
define("RENDERER_CHARTTYPE_LINESTEPCOLUMN", "linestepcolumn");
define("RENDERER_CHARTTYPE_RADAR", "radar");

define("RENDERER_CHART_CTF_TEAMSCORE", 10);
define("RENDERER_CHART_CTF_GRABBREAKDOWN", 11);

define("RENDERER_CHART_DOM_SCOREDERIV", 21);

define("RENDERER_CHART_FRAGS_TEAMSCORE", 90);
define("RENDERER_CHART_FRAGS_TEAMDERIV", 91);
define("RENDERER_CHART_FRAGS_TEAMNORMAL", 92);
define("RENDERER_CHART_FRAGS_PLAYERSCORE", 93);
define("RENDERER_CHART_FRAGS_PLAYERDERIV", 94);
define("RENDERER_CHART_FRAGS_PLAYERNORMAL", 95);
define("RENDERER_CHART_FRAGS_PLAYERSCORE5", 96);
define("RENDERER_CHART_FRAGS_PLAYERNORMAL5", 97);

define("RENDERER_CHART_ITEMS_TEAMPICKUPS", 100);
define("RENDERER_CHART_ITEMS_PLAYERPICKUPS", 101);
define("RENDERER_CHART_ITEMS_AMPRUNS", 102);
?>
12 changes: 12 additions & 0 deletions html/includes/css/themes/tooltipster-light.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
.tooltipster-light {
border-radius: 5px;
border: 1px solid #cccccc;
background: #ededed;
color: #666666;
}
.tooltipster-light .tooltipster-content {
font-family: Arial, sans-serif;
font-size: 14px;
line-height: 16px;
padding: 8px 10px;
}
12 changes: 12 additions & 0 deletions html/includes/css/themes/tooltipster-noir.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
.tooltipster-noir {
border-radius: 0px;
border: 3px solid #2c2c2c;
background: #fff;
color: #2c2c2c;
}
.tooltipster-noir .tooltipster-content {
font-family: 'Georgia', serif;
font-size: 14px;
line-height: 16px;
padding: 8px 10px;
}
12 changes: 12 additions & 0 deletions html/includes/css/themes/tooltipster-punk.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
.tooltipster-punk {
border-radius: 5px;
border-bottom: 3px solid #f71169;
background: #2a2a2a;
color: #fff;
}
.tooltipster-punk .tooltipster-content {
font-family: 'Courier', monospace;
font-size: 14px;
line-height: 16px;
padding: 8px 10px;
}
12 changes: 12 additions & 0 deletions html/includes/css/themes/tooltipster-shadow.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
.tooltipster-shadow {
border-radius: 5px;
background: #fff;
box-shadow: 0px 0px 14px rgba(0,0,0,0.3);
color: #2c2c2c;
}
.tooltipster-shadow .tooltipster-content {
font-family: 'Arial', sans-serif;
font-size: 14px;
line-height: 16px;
padding: 8px 10px;
}
Loading

0 comments on commit e861eaf

Please sign in to comment.