Update 9.1

This commit is contained in:
ChocoTaco 2021-06-03 18:11:38 -04:00
parent faac027428
commit b223c3a034

View file

@ -14,7 +14,7 @@
//-----------Settings------------ //-----------Settings------------
//Notes score ui width is 592 //Notes score ui width is 592
$dtStats::version = 9.0; $dtStats::version = 9.1;
//disable stats system //disable stats system
$dtStats::Enable = 1; $dtStats::Enable = 1;
//enable disable map stats //enable disable map stats
@ -2471,16 +2471,16 @@ package dtStatsGame{
%dtStats = %player.client.dtStats; %dtStats = %player.client.dtStats;
%time = ((getSimTime() - $missionStartTime)/1000)/60; %time = ((getSimTime() - $missionStartTime)/1000)/60;
if(%clTeam == 1){ if(%clTeam == 1){
if(!%dtStats.teamOneCapTimes) if(!$dtStats::teamOneCapTimes)
%dtStats.teamOneCapTimes = cropFloat(%time,1); $dtStats::teamOneCapTimes = cropFloat(%time,1);
else else
%dtStats.teamOneCapTimes = %dtStats.teamOneCapTimes @ "," @ cropFloat(%time,1); $dtStats::teamOneCapTimes = $dtStats::teamOneCapTimes @ "," @ cropFloat(%time,1);
} }
else{ else{
if(!%dtStats.teamTwoCapTimes) if(!$dtStats::teamTwoCapTimes)
%dtStats.teamTwoCapTimes = cropFloat(%time,1); $dtStats::teamTwoCapTimes = cropFloat(%time,1);
else else
%dtStats.teamTwoCapTimes = %dtStats.teamTwoCapTimes @ "," @ cropFloat(%time,1); $dtStats::teamTwoCapTimes = $dtStats::teamTwoCapTimes @ "," @ cropFloat(%time,1);
} }
if(%game.dtTotalFlagTime[%flag]){ if(%game.dtTotalFlagTime[%flag]){
%heldTime = (getSimTime() - %game.dtTotalFlagTime[%flag])/1000; %heldTime = (getSimTime() - %game.dtTotalFlagTime[%flag])/1000;
@ -2585,16 +2585,16 @@ package dtStatsGame{
%dtStats = %player.client.dtStats; %dtStats = %player.client.dtStats;
%time = ((getSimTime() - $missionStartTime)/1000)/60; %time = ((getSimTime() - $missionStartTime)/1000)/60;
if(%clTeam == 1){ if(%clTeam == 1){
if(!%dtStats.teamOneCapTimes) if(!$dtStats::teamOneCapTimes)
%dtStats.teamOneCapTimes = cropFloat(%time,1); $dtStats::teamOneCapTimes = cropFloat(%time,1);
else else
%dtStats.teamOneCapTimes = %dtStats.teamOneCapTimes @ "," @ cropFloat(%time,1); $dtStats::teamOneCapTimes = $dtStats::teamOneCapTimes @ "," @ cropFloat(%time,1);
} }
else{ else{
if(!%dtStats.teamTwoCapTimes) if(!$dtStats::teamTwoCapTimes)
%dtStats.teamTwoCapTimes = cropFloat(%time,1); $dtStats::teamTwoCapTimes = cropFloat(%time,1);
else else
%dtStats.teamTwoCapTimes = %dtStats.teamTwoCapTimes @ "," @ cropFloat(%time,1); $dtStats::teamTwoCapTimes = $dtStats::teamTwoCapTimes @ "," @ cropFloat(%time,1);
} }
if(%game.dtTotalFlagTime[%flag]){ if(%game.dtTotalFlagTime[%flag]){
%heldTime = (getSimTime() - %game.dtTotalFlagTime[%flag])/1000; %heldTime = (getSimTime() - %game.dtTotalFlagTime[%flag])/1000;
@ -4013,7 +4013,7 @@ function dtStatsClientLeaveGame(%client){
%client.dtStats.clientLeft = 1; %client.dtStats.clientLeft = 1;
%client.dtStats.leftTime = getSimTime(); %client.dtStats.leftTime = getSimTime();
%client.dtStats.leftID = $dtStats::leftID; %client.dtStats.leftID = $dtStats::leftID;
%client.dtStats.leftPCT = (isGameRun() == 1) ? %game.getGamePct() : 0; %client.dtStats.leftPCT = %game.getGamePct();
if(isObject(Game) && isGameRun() && %client.score != 0) if(isObject(Game) && isGameRun() && %client.score != 0)
bakGameStats(%client,Game.class);//back up there current game in case they lost connection bakGameStats(%client,Game.class);//back up there current game in case they lost connection
} }
@ -4079,8 +4079,10 @@ function dtStatsGameOver( %game ){
} }
} }
function dtSaveDone(){ function dtSaveDone(){
$dtStats::statsSave = 0; $dtStats::statsSave = 0;
$dtStats::leftID++; $dtStats::leftID++;
$dtStats::teamOneCapTimes = 0;
$dtStats::teamTwoCapTimes = 0;
} }
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
@ -4196,6 +4198,8 @@ function DefaultGame::postGameStats(%game,%dtStats){ //stats to add up at the en
if(%game.class $= "CTFGame" || %game.class $= "SCtFGame"){ if(%game.class $= "CTFGame" || %game.class $= "SCtFGame"){
%dtStats.teamOneCapTimes = $dtStats::teamOneCapTimes;
%dtStats.teamTwoCapTimes = $dtStats::teamTwoCapTimes;
%dtStats.teamScore = $TeamScore[%dtStats.dtTeam]; %dtStats.teamScore = $TeamScore[%dtStats.dtTeam];
%dtStats.destruction = %dtStats.genDestroys + %dtStats.destruction = %dtStats.genDestroys +
@ -12967,3 +12971,8 @@ function testVarsRandomAll(%max){
// Added startPCt and endPct for game progress info // Added startPCt and endPct for game progress info
// Added clientQuit to make filtering easier // Added clientQuit to make filtering easier
// Some code cleanup // Some code cleanup
//
// 9.1
// Stat fixes
// - had cap times tied to the client instead of being global
// - fixed endPCt/leftPCT