Compare commits

..

3 Commits

Author SHA1 Message Date
HardiReady b351301bea Update API docs 2019-02-10 11:01:11 +01:00
HardiReady 9532cfeda8 Update code style 2019-02-10 10:35:30 +01:00
HardiReady 24fcb05f70 Add translations for server stats charts (CC-80) 2019-02-10 10:33:25 +01:00
8 changed files with 61 additions and 44 deletions

View File

@ -1,9 +1,9 @@
<code_scheme name="OPT-CC" version="173"> <code_scheme name="OPT-CC" version="173">
<option name="FORMATTER_TAGS_ENABLED" value="true" /> <option name="FORMATTER_TAGS_ENABLED" value="true" />
<JSCodeStyleSettings> <JSCodeStyleSettings version="0">
<option name="USE_CHAINED_CALLS_GROUP_INDENTS" value="true" /> <option name="USE_CHAINED_CALLS_GROUP_INDENTS" value="true" />
</JSCodeStyleSettings> </JSCodeStyleSettings>
<TypeScriptCodeStyleSettings> <TypeScriptCodeStyleSettings version="0">
<option name="USE_DOUBLE_QUOTES" value="false" /> <option name="USE_DOUBLE_QUOTES" value="false" />
<option name="USE_CHAINED_CALLS_GROUP_INDENTS" value="true" /> <option name="USE_CHAINED_CALLS_GROUP_INDENTS" value="true" />
</TypeScriptCodeStyleSettings> </TypeScriptCodeStyleSettings>
@ -11,6 +11,8 @@
<option name="RIGHT_MARGIN" value="120" /> <option name="RIGHT_MARGIN" value="120" />
<option name="KEEP_FIRST_COLUMN_COMMENT" value="false" /> <option name="KEEP_FIRST_COLUMN_COMMENT" value="false" />
<option name="ALIGN_MULTILINE_CHAINED_METHODS" value="true" /> <option name="ALIGN_MULTILINE_CHAINED_METHODS" value="true" />
<option name="ALIGN_MULTILINE_PARAMETERS_IN_CALLS" value="true" />
<option name="ALIGN_MULTILINE_ARRAY_INITIALIZER_EXPRESSION" value="true" />
<option name="CALL_PARAMETERS_WRAP" value="1" /> <option name="CALL_PARAMETERS_WRAP" value="1" />
<option name="METHOD_PARAMETERS_WRAP" value="1" /> <option name="METHOD_PARAMETERS_WRAP" value="1" />
<option name="EXTENDS_KEYWORD_WRAP" value="1" /> <option name="EXTENDS_KEYWORD_WRAP" value="1" />

View File

@ -22,15 +22,17 @@ A player campaign statistics object
## Properties ## Properties
+ _id: `5ab68d42f547ed304064e5f7` (string, required) - unique id of the army member + _id: `5ab68d42f547ed304064e5f7` (string, required) - unique id of the army member
+ warId: `5abf65ae3fc5fa349ffd5ca3` (string, required) - war in which this player took part + warId: `5abf65ae3fc5fa349ffd5ca3` (string, required) - war in which this player took part
+ steamUUID: `76561192214911200` (string, required) - unique ID for STEAM platform account + steamUUID: 76561192214911200 (number, optional) - unique ID for STEAM platform account
+ sort: 1 (number, required) - sorting number calculated by (kill + revive + flagTouch - friendlyFire - death - respawn) + sort: 1 (number, required) - sorting number calculated by (kill + revive + flagTouch - friendlyFire - death - respawn)
+ performance: `5abf65ae3fc5fa349ffd5cs2` (string, optional) - id of corresponding performance log entry
+ timestamp: `2018-02-24T01:01:25.825Z` - the entity creation timestamp + timestamp: `2018-02-24T01:01:25.825Z` - the entity creation timestamp
+ updatedAt: `2018-02-24T01:01:25.825Z` - the version timestamp + updatedAt: `2018-02-24T01:01:25.825Z` - the version timestamp
+ __v: 0 (number, required) - the version number of the object + __v: 0 (number, required) - the version number of the object
# HighscorePlayer (BasicPlayer) # HighscorePlayer (BasicPlayer)
A player object as resturned for the highscore arrays A player object as returned for the highscore arrays
## Properties ## Properties
+ warId: War (War, required) - war in which this player took part
+ num: 1 + num: 1

View File

@ -23,4 +23,4 @@ A war as used in statistics
A war response object on creation A war response object on creation
## Properties ## Properties
+ players (array[WarPlayer], required) - collection of all participating players with their statistics + players (array[WarPlayer], required, fixed-type) - collection of all participating players with their statistics

View File

@ -1,16 +1,16 @@
{"_id":{"$oid":"5abf65ae3fc5fa349ffd5ca4"},"name":"Pumarang","fraction":"BLUFOR","warId":{"$oid":"5abf65ae3fc5fa349ffd5ca3"},"steamUUID":7.656119805032149e+16,"respawn":1,"kill":0,"vehicle":0,"friendlyFire":0,"death":1,"revive":0,"flagTouch":0,"sort":-2,"timestamp":{"$date":"2018-03-31T10:40:46.712Z"},"updatedAt":{"$date":"2018-03-31T10:40:46.712Z"},"__v":0} {"_id":{"$oid":"5abf65ae3fc5fa349ffd5ca4"},"name":"Pumarang","fraction":"BLUFOR","warId":{"$oid":"5abf65ae3fc5fa349ffd5ca3"},"steamUUID":7.656119805032149e+16,"respawn":1,"kill":0,"vehicleLight":0,"vehicleHeavy":0,"vehicleAir":0,"steamUUID":76561192214911200,"friendlyFire":0,"death":1,"revive":0,"flagTouch":0,"sort":-2,"timestamp":{"$date":"2018-03-31T10:40:46.712Z"},"updatedAt":{"$date":"2018-03-31T10:40:46.712Z"},"__v":0}
{"_id":{"$oid":"5abf65ae3fc5fa349ffd5ca5"},"name":"Mercurat","fraction":"BLUFOR","warId":{"$oid":"5abf65ae3fc5fa349ffd5ca3"},"steamUUID":7.65611982788425e+16,"respawn":0,"kill":0,"vehicle":0,"friendlyFire":0,"death":0,"revive":0,"flagTouch":0,"sort":0,"timestamp":{"$date":"2018-03-31T10:40:46.712Z"},"updatedAt":{"$date":"2018-03-31T10:40:46.712Z"},"__v":0} {"_id":{"$oid":"5abf65ae3fc5fa349ffd5ca5"},"name":"Mercurat","fraction":"BLUFOR","warId":{"$oid":"5abf65ae3fc5fa349ffd5ca3"},"steamUUID":7.65611982788425e+16,"respawn":0,"kill":0,"vehicleLight":0,"vehicleHeavy":0,"vehicleAir":0,"steamUUID":76561192214911200,"friendlyFire":0,"death":0,"revive":0,"flagTouch":0,"sort":0,"timestamp":{"$date":"2018-03-31T10:40:46.712Z"},"updatedAt":{"$date":"2018-03-31T10:40:46.712Z"},"__v":0}
{"_id":{"$oid":"5abf65ae3fc5fa349ffd5ca6"},"name":"KalleK","fraction":"OPFOR","warId":{"$oid":"5abf65ae3fc5fa349ffd5ca3"},"steamUUID":7.656119797767603e+16,"respawn":0,"kill":0,"vehicle":0,"friendlyFire":0,"death":0,"revive":0,"flagTouch":0,"sort":0,"timestamp":{"$date":"2018-03-31T10:40:46.712Z"},"updatedAt":{"$date":"2018-03-31T10:40:46.712Z"},"__v":0} {"_id":{"$oid":"5abf65ae3fc5fa349ffd5ca6"},"name":"KalleK","fraction":"OPFOR","warId":{"$oid":"5abf65ae3fc5fa349ffd5ca3"},"steamUUID":7.656119797767603e+16,"respawn":0,"kill":0,"vehicleLight":0,"vehicleHeavy":0,"vehicleAir":0,"steamUUID":76561192214911200,"friendlyFire":0,"death":0,"revive":0,"flagTouch":0,"sort":0,"timestamp":{"$date":"2018-03-31T10:40:46.712Z"},"updatedAt":{"$date":"2018-03-31T10:40:46.712Z"},"__v":0}
{"_id":{"$oid":"5abf65ae3fc5fa349ffd5ca7"},"name":"MAPster","fraction":"OPFOR","warId":{"$oid":"5abf65ae3fc5fa349ffd5ca3"},"steamUUID":7.656119800988213e+16,"respawn":0,"kill":0,"vehicle":0,"friendlyFire":0,"death":0,"revive":0,"flagTouch":0,"sort":0,"timestamp":{"$date":"2018-03-31T10:40:46.712Z"},"updatedAt":{"$date":"2018-03-31T10:40:46.712Z"},"__v":0} {"_id":{"$oid":"5abf65ae3fc5fa349ffd5ca7"},"name":"MAPster","fraction":"OPFOR","warId":{"$oid":"5abf65ae3fc5fa349ffd5ca3"},"steamUUID":7.656119800988213e+16,"respawn":0,"kill":0,"vehicleLight":0,"vehicleHeavy":0,"vehicleAir":0,"steamUUID":76561192214911200,"friendlyFire":0,"death":0,"revive":0,"flagTouch":0,"sort":0,"timestamp":{"$date":"2018-03-31T10:40:46.712Z"},"updatedAt":{"$date":"2018-03-31T10:40:46.712Z"},"__v":0}
{"_id":{"$oid":"5abf65ae3fc5fa349ffd5ca8"},"name":"LyrikEmu","fraction":"BLUFOR","warId":{"$oid":"5abf65ae3fc5fa349ffd5ca3"},"steamUUID":7.65611982189104e+16,"respawn":0,"kill":0,"vehicle":0,"friendlyFire":0,"death":0,"revive":0,"flagTouch":0,"sort":0,"timestamp":{"$date":"2018-03-31T10:40:46.712Z"},"updatedAt":{"$date":"2018-03-31T10:40:46.712Z"},"__v":0} {"_id":{"$oid":"5abf65ae3fc5fa349ffd5ca8"},"name":"LyrikEmu","fraction":"BLUFOR","warId":{"$oid":"5abf65ae3fc5fa349ffd5ca3"},"steamUUID":7.65611982189104e+16,"respawn":0,"kill":0,"vehicleLight":0,"vehicleHeavy":0,"vehicleAir":0,"steamUUID":76561192214911200,"friendlyFire":0,"death":0,"revive":0,"flagTouch":0,"sort":0,"timestamp":{"$date":"2018-03-31T10:40:46.712Z"},"updatedAt":{"$date":"2018-03-31T10:40:46.712Z"},"__v":0}
{"_id":{"$oid":"5abf65ae3fc5fa349ffd5ca9"},"name":"Philipp","fraction":"OPFOR","warId":{"$oid":"5abf65ae3fc5fa349ffd5ca3"},"steamUUID":7.656119804179206e+16,"respawn":0,"kill":0,"vehicle":0,"friendlyFire":0,"death":0,"revive":0,"flagTouch":0,"sort":0,"timestamp":{"$date":"2018-03-31T10:40:46.712Z"},"updatedAt":{"$date":"2018-03-31T10:40:46.712Z"},"__v":0} {"_id":{"$oid":"5abf65ae3fc5fa349ffd5ca9"},"name":"Philipp","fraction":"OPFOR","warId":{"$oid":"5abf65ae3fc5fa349ffd5ca3"},"steamUUID":7.656119804179206e+16,"respawn":0,"kill":0,"vehicleLight":0,"vehicleHeavy":0,"vehicleAir":0,"steamUUID":76561192214911200,"friendlyFire":0,"death":0,"revive":0,"flagTouch":0,"sort":0,"timestamp":{"$date":"2018-03-31T10:40:46.712Z"},"updatedAt":{"$date":"2018-03-31T10:40:46.712Z"},"__v":0}
{"_id":{"$oid":"5abf65ae3fc5fa349ffd5caa"},"name":"Wiesl","fraction":"BLUFOR","warId":{"$oid":"5abf65ae3fc5fa349ffd5ca3"},"steamUUID":7.65611980596481e+16,"respawn":0,"kill":1,"vehicle":0,"friendlyFire":1,"death":0,"revive":1,"flagTouch":1,"sort":2,"timestamp":{"$date":"2018-03-31T10:40:46.712Z"},"updatedAt":{"$date":"2018-03-31T10:40:46.712Z"},"__v":0} {"_id":{"$oid":"5abf65ae3fc5fa349ffd5caa"},"name":"Wiesl","fraction":"BLUFOR","warId":{"$oid":"5abf65ae3fc5fa349ffd5ca3"},"steamUUID":7.65611980596481e+16,"respawn":0,"kill":1,"vehicleLight":0,"vehicleHeavy":0,"vehicleAir":0,"steamUUID":76561192214911200,"friendlyFire":1,"death":0,"revive":1,"flagTouch":1,"sort":2,"timestamp":{"$date":"2018-03-31T10:40:46.712Z"},"updatedAt":{"$date":"2018-03-31T10:40:46.712Z"},"__v":0}
{"_id":{"$oid":"5abf65ae3fc5fa349ffd5cab"},"name":"Murda]X[","fraction":"OPFOR","warId":{"$oid":"5abf65ae3fc5fa349ffd5ca3"},"steamUUID":7.656119797112163e+16,"respawn":0,"kill":0,"vehicle":1,"friendlyFire":0,"death":0,"revive":0,"flagTouch":0,"sort":0,"timestamp":{"$date":"2018-03-31T10:40:46.712Z"},"updatedAt":{"$date":"2018-03-31T10:40:46.712Z"},"__v":0} {"_id":{"$oid":"5abf65ae3fc5fa349ffd5cab"},"name":"Murda]X[","fraction":"OPFOR","warId":{"$oid":"5abf65ae3fc5fa349ffd5ca3"},"steamUUID":7.656119797112163e+16,"respawn":0,"kill":0,"vehicleLight":1,"vehicleHeavy":0,"vehicleAir":0,"steamUUID":76561192214911200,"friendlyFire":0,"death":0,"revive":0,"flagTouch":0,"sort":0,"timestamp":{"$date":"2018-03-31T10:40:46.712Z"},"updatedAt":{"$date":"2018-03-31T10:40:46.712Z"},"__v":0}
{"_id":{"$oid":"5abf65d83fc5fa349ffd5cbc"},"name":"Pumarang","fraction":"BLUFOR","warId":{"$oid":"5abf65d83fc5fa349ffd5cbb"},"steamUUID":7.656119805032149e+16,"respawn":1,"kill":0,"vehicle":0,"friendlyFire":0,"death":1,"revive":0,"flagTouch":0,"sort":-2,"timestamp":{"$date":"2018-03-31T10:41:28.459Z"},"updatedAt":{"$date":"2018-03-31T10:41:28.459Z"},"__v":0} {"_id":{"$oid":"5abf65d83fc5fa349ffd5cbc"},"name":"Pumarang","fraction":"BLUFOR","warId":{"$oid":"5abf65d83fc5fa349ffd5cbb"},"steamUUID":7.656119805032149e+16,"respawn":1,"kill":0,"vehicleLight":0,"vehicleHeavy":0,"vehicleAir":0,"steamUUID":76561192214911200,"friendlyFire":0,"death":1,"revive":0,"flagTouch":0,"sort":-2,"timestamp":{"$date":"2018-03-31T10:41:28.459Z"},"updatedAt":{"$date":"2018-03-31T10:41:28.459Z"},"__v":0}
{"_id":{"$oid":"5abf65d83fc5fa349ffd5cbd"},"name":"Mercurat","fraction":"BLUFOR","warId":{"$oid":"5abf65d83fc5fa349ffd5cbb"},"steamUUID":7.65611982788425e+16,"respawn":0,"kill":0,"vehicle":0,"friendlyFire":0,"death":0,"revive":0,"flagTouch":0,"sort":0,"timestamp":{"$date":"2018-03-31T10:41:28.459Z"},"updatedAt":{"$date":"2018-03-31T10:41:28.459Z"},"__v":0} {"_id":{"$oid":"5abf65d83fc5fa349ffd5cbd"},"name":"Mercurat","fraction":"BLUFOR","warId":{"$oid":"5abf65d83fc5fa349ffd5cbb"},"steamUUID":7.65611982788425e+16,"respawn":0,"kill":0,"vehicleLight":0,"vehicleHeavy":0,"vehicleAir":0,"steamUUID":76561192214911200,"friendlyFire":0,"death":0,"revive":0,"flagTouch":0,"sort":0,"timestamp":{"$date":"2018-03-31T10:41:28.459Z"},"updatedAt":{"$date":"2018-03-31T10:41:28.459Z"},"__v":0}
{"_id":{"$oid":"5abf65d83fc5fa349ffd5cbe"},"name":"KalleK","fraction":"OPFOR","warId":{"$oid":"5abf65d83fc5fa349ffd5cbb"},"steamUUID":7.656119797767603e+16,"respawn":0,"kill":0,"vehicle":0,"friendlyFire":0,"death":0,"revive":0,"flagTouch":0,"sort":0,"timestamp":{"$date":"2018-03-31T10:41:28.459Z"},"updatedAt":{"$date":"2018-03-31T10:41:28.459Z"},"__v":0} {"_id":{"$oid":"5abf65d83fc5fa349ffd5cbe"},"name":"KalleK","fraction":"OPFOR","warId":{"$oid":"5abf65d83fc5fa349ffd5cbb"},"steamUUID":7.656119797767603e+16,"respawn":0,"kill":0,"vehicleLight":0,"vehicleHeavy":0,"vehicleAir":0,"steamUUID":76561192214911200,"friendlyFire":0,"death":0,"revive":0,"flagTouch":0,"sort":0,"timestamp":{"$date":"2018-03-31T10:41:28.459Z"},"updatedAt":{"$date":"2018-03-31T10:41:28.459Z"},"__v":0}
{"_id":{"$oid":"5abf65d83fc5fa349ffd5cc1"},"name":"Philipp","fraction":"OPFOR","warId":{"$oid":"5abf65d83fc5fa349ffd5cbb"},"steamUUID":7.656119804179206e+16,"respawn":0,"kill":0,"vehicle":0,"friendlyFire":0,"death":0,"revive":0,"flagTouch":0,"sort":0,"timestamp":{"$date":"2018-03-31T10:41:28.459Z"},"updatedAt":{"$date":"2018-03-31T10:41:28.459Z"},"__v":0} {"_id":{"$oid":"5abf65d83fc5fa349ffd5cc1"},"name":"Philipp","fraction":"OPFOR","warId":{"$oid":"5abf65d83fc5fa349ffd5cbb"},"steamUUID":7.656119804179206e+16,"respawn":0,"kill":0,"vehicleLight":0,"vehicleHeavy":0,"vehicleAir":0,"steamUUID":76561192214911200,"friendlyFire":0,"death":0,"revive":0,"flagTouch":0,"sort":0,"timestamp":{"$date":"2018-03-31T10:41:28.459Z"},"updatedAt":{"$date":"2018-03-31T10:41:28.459Z"},"__v":0}
{"_id":{"$oid":"5abf65d83fc5fa349ffd5cc0"},"name":"LyrikEmu","fraction":"BLUFOR","warId":{"$oid":"5abf65d83fc5fa349ffd5cbb"},"steamUUID":7.65611982189104e+16,"respawn":0,"kill":0,"vehicle":0,"friendlyFire":0,"death":0,"revive":0,"flagTouch":0,"sort":0,"timestamp":{"$date":"2018-03-31T10:41:28.459Z"},"updatedAt":{"$date":"2018-03-31T10:41:28.459Z"},"__v":0} {"_id":{"$oid":"5abf65d83fc5fa349ffd5cc0"},"name":"LyrikEmu","fraction":"BLUFOR","warId":{"$oid":"5abf65d83fc5fa349ffd5cbb"},"steamUUID":7.65611982189104e+16,"respawn":0,"kill":0,"vehicleLight":0,"vehicleHeavy":0,"vehicleAir":0,"steamUUID":76561192214911200,"friendlyFire":0,"death":0,"revive":0,"flagTouch":0,"sort":0,"timestamp":{"$date":"2018-03-31T10:41:28.459Z"},"updatedAt":{"$date":"2018-03-31T10:41:28.459Z"},"__v":0}
{"_id":{"$oid":"5abf65d83fc5fa349ffd5cc2"},"name":"Wiesl","fraction":"BLUFOR","warId":{"$oid":"5abf65d83fc5fa349ffd5cbb"},"steamUUID":7.65611980596481e+16,"respawn":0,"kill":1,"vehicle":0,"friendlyFire":1,"death":0,"revive":1,"flagTouch":1,"sort":2,"timestamp":{"$date":"2018-03-31T10:41:28.460Z"},"updatedAt":{"$date":"2018-03-31T10:41:28.460Z"},"__v":0} {"_id":{"$oid":"5abf65d83fc5fa349ffd5cc2"},"name":"Wiesl","fraction":"BLUFOR","warId":{"$oid":"5abf65d83fc5fa349ffd5cbb"},"steamUUID":7.65611980596481e+16,"respawn":0,"kill":1,"vehicleLight":0,"vehicleHeavy":0,"vehicleAir":0,"steamUUID":76561192214911200,"friendlyFire":1,"death":0,"revive":1,"flagTouch":1,"sort":2,"timestamp":{"$date":"2018-03-31T10:41:28.460Z"},"updatedAt":{"$date":"2018-03-31T10:41:28.460Z"},"__v":0}
{"_id":{"$oid":"5abf65d83fc5fa349ffd5cc3"},"name":"Murda]X[","fraction":"OPFOR","warId":{"$oid":"5abf65d83fc5fa349ffd5cbb"},"steamUUID":7.656119797112163e+16,"respawn":0,"kill":0,"vehicle":1,"friendlyFire":0,"death":0,"revive":0,"flagTouch":0,"sort":0,"timestamp":{"$date":"2018-03-31T10:41:28.460Z"},"updatedAt":{"$date":"2018-03-31T10:41:28.460Z"},"__v":0} {"_id":{"$oid":"5abf65d83fc5fa349ffd5cc3"},"name":"Murda]X[","fraction":"OPFOR","warId":{"$oid":"5abf65d83fc5fa349ffd5cbb"},"steamUUID":7.656119797112163e+16,"respawn":0,"kill":0,"vehicleLight":1,"vehicleHeavy":0,"vehicleAir":0,"steamUUID":76561192214911200,"friendlyFire":0,"death":0,"revive":0,"flagTouch":0,"sort":0,"timestamp":{"$date":"2018-03-31T10:41:28.460Z"},"updatedAt":{"$date":"2018-03-31T10:41:28.460Z"},"__v":0}
{"_id":{"$oid":"5abf65d83fc5fa349ffd5cbf"},"name":"MAPster","fraction":"OPFOR","warId":{"$oid":"5abf65d83fc5fa349ffd5cbb"},"steamUUID":7.656119800988213e+16,"respawn":0,"kill":0,"vehicle":0,"friendlyFire":0,"death":0,"revive":0,"flagTouch":0,"sort":0,"timestamp":{"$date":"2018-03-31T10:41:28.459Z"},"updatedAt":{"$date":"2018-03-31T10:41:28.459Z"},"__v":0} {"_id":{"$oid":"5abf65d83fc5fa349ffd5cbf"},"name":"MAPster","fraction":"OPFOR","warId":{"$oid":"5abf65d83fc5fa349ffd5cbb"},"steamUUID":7.656119800988213e+16,"respawn":0,"kill":0,"vehicleLight":0,"vehicleHeavy":0,"vehicleAir":0,"steamUUID":76561192214911200,"friendlyFire":0,"death":0,"revive":0,"flagTouch":0,"sort":0,"timestamp":{"$date":"2018-03-31T10:41:28.459Z"},"updatedAt":{"$date":"2018-03-31T10:41:28.459Z"},"__v":0}

View File

@ -33,4 +33,4 @@ Get statistics for a single player for all wars of a campaign he took part at
+ Attributes + Attributes
+ name: `Pumarang` (string, required) - latest used playername + name: `Pumarang` (string, required) - latest used playername
+ campaign (Campaign,required) - campaign reflected from request is + campaign (Campaign,required) - campaign reflected from request is
+ players (array[WarPlayer],required) - collection of player instances in the campaign + players (array[HighscorePlayer],required, fixed-type) - collection of player instances in the campaign

View File

@ -42,6 +42,7 @@ export class ServerStatsComponent implements OnInit, OnChanges {
}; };
readonly labelsAsString = Object.keys(this.labels) readonly labelsAsString = Object.keys(this.labels)
.map((key) => this.labels[key]); .map((key) => this.labels[key]);
lineChartSeriesLabels: string[];
gradient = false; gradient = false;
yAxis = true; yAxis = true;
@ -72,7 +73,12 @@ export class ServerStatsComponent implements OnInit, OnChanges {
ngOnChanges(changes: SimpleChanges) { ngOnChanges(changes: SimpleChanges) {
if ((changes.war || changes.performanceData) && this.performanceData) { if ((changes.war || changes.performanceData) && this.performanceData) {
this.initializeChartData(); this.translate.get(['stats.performance.select.timeline.label.minimum',
'stats.performance.select.timeline.label.average',
'stats.performance.select.timeline.label.maximum']).subscribe((res) => {
const resValues = Object.keys(res).map(val => res[val]);
this.initializeChartData(resValues[2], resValues[0], resValues[1]);
});
Object.assign(this, [this.barChartData]); Object.assign(this, [this.barChartData]);
this.activeChartSelect = this.labels.singleAvg; this.activeChartSelect = this.labels.singleAvg;
} }
@ -107,10 +113,10 @@ export class ServerStatsComponent implements OnInit, OnChanges {
} }
} }
initializeChartData() { initializeChartData(labelMax: string, labelMin: string, labelAvg: string) {
this.tmpAvgTimeline = ChartUtils.getMultiDataArray('min', 'avg', 'max'); this.tmpAvgTimeline = ChartUtils.getMultiDataArray(labelMax, labelAvg, labelMin);
this.tmpMinTimeline = ChartUtils.getMultiDataArray('min', 'avg', 'max'); this.tmpMinTimeline = ChartUtils.getMultiDataArray(labelMax, labelAvg, labelMin);
this.tmpServerTimeline = ChartUtils.getMultiDataArray('min', 'avg'); this.tmpServerTimeline = ChartUtils.getMultiDataArray(labelAvg, labelMin);
const diffMs = (new Date(this.war.endDate).getTime() - new Date(this.war.date).getTime()); const diffMs = (new Date(this.war.endDate).getTime() - new Date(this.war.date).getTime());
const warDurationMinutes = Math.round(diffMs / 60000); const warDurationMinutes = Math.round(diffMs / 60000);
@ -150,8 +156,8 @@ export class ServerStatsComponent implements OnInit, OnChanges {
// SERVER TIMELINE DATA // SERVER TIMELINE DATA
for (let i = 0; i < entry.avgFps.length && i < warDurationMinutes; i++) { for (let i = 0; i < entry.avgFps.length && i < warDurationMinutes; i++) {
const currDate = new Date(dateObj.getTime() + i * 60000); const currDate = new Date(dateObj.getTime() + i * 60000);
this.tmpServerTimeline[0].series.push(ChartUtils.getSeriesEntry(currDate, entry.minFps[i])); this.tmpServerTimeline[0].series.push(ChartUtils.getSeriesEntry(currDate, entry.avgFps[i]));
this.tmpServerTimeline[1].series.push(ChartUtils.getSeriesEntry(currDate, entry.avgFps[i])); this.tmpServerTimeline[1].series.push(ChartUtils.getSeriesEntry(currDate, entry.minFps[i]));
} }
} }
this.tmpSingleAvg.push({ this.tmpSingleAvg.push({
@ -167,16 +173,16 @@ export class ServerStatsComponent implements OnInit, OnChanges {
tmpAvgArray = tmpAvgArray.map(x => Math.round(x / this.performanceData.length)); tmpAvgArray = tmpAvgArray.map(x => Math.round(x / this.performanceData.length));
for (let i = 0; i < tmpAvgArray.length; i++) { for (let i = 0; i < tmpAvgArray.length; i++) {
const currDate = new Date(dateObj.getTime() + i * 60000); const currDate = new Date(dateObj.getTime() + i * 60000);
this.tmpAvgTimeline[0].series.push(ChartUtils.getSeriesEntry(currDate, tmpAvgMin[i])); this.tmpAvgTimeline[0].series.push(ChartUtils.getSeriesEntry(currDate, tmpAvgMax[i]));
this.tmpAvgTimeline[1].series.push(ChartUtils.getSeriesEntry(currDate, tmpAvgArray[i])); this.tmpAvgTimeline[1].series.push(ChartUtils.getSeriesEntry(currDate, tmpAvgArray[i]));
this.tmpAvgTimeline[2].series.push(ChartUtils.getSeriesEntry(currDate, tmpAvgMax[i])); this.tmpAvgTimeline[2].series.push(ChartUtils.getSeriesEntry(currDate, tmpAvgMin[i]));
} }
tmpMinArray = tmpMinArray.map(x => Math.round(x / this.performanceData.length)); tmpMinArray = tmpMinArray.map(x => Math.round(x / this.performanceData.length));
for (let i = 0; i < tmpMinArray.length; i++) { for (let i = 0; i < tmpMinArray.length; i++) {
const currDate = new Date(dateObj.getTime() + i * 60000); const currDate = new Date(dateObj.getTime() + i * 60000);
this.tmpMinTimeline[0].series.push(ChartUtils.getSeriesEntry(currDate, tmpMinMin[i])); this.tmpMinTimeline[0].series.push(ChartUtils.getSeriesEntry(currDate, tmpMinMax[i]));
this.tmpMinTimeline[1].series.push(ChartUtils.getSeriesEntry(currDate, tmpMinArray[i])); this.tmpMinTimeline[1].series.push(ChartUtils.getSeriesEntry(currDate, tmpMinArray[i]));
this.tmpMinTimeline[2].series.push(ChartUtils.getSeriesEntry(currDate, tmpMinMax[i])); this.tmpMinTimeline[2].series.push(ChartUtils.getSeriesEntry(currDate, tmpMinMin[i]));
} }
this.tmpSingleAvg.sort((a, b) => a.value - b.value); this.tmpSingleAvg.sort((a, b) => a.value - b.value);
this.tmpSingleMin.sort((a, b) => a.value - b.value); this.tmpSingleMin.sort((a, b) => a.value - b.value);

View File

@ -34,6 +34,10 @@
"stats.performance.select.timeline.avg": "Verlauf FPS Durchschnitt", "stats.performance.select.timeline.avg": "Verlauf FPS Durchschnitt",
"stats.performance.select.timeline.min": "Verlauf FPS Minimum", "stats.performance.select.timeline.min": "Verlauf FPS Minimum",
"stats.performance.select.timeline.server": "Server FPS", "stats.performance.select.timeline.server": "Server FPS",
"stats.performance.select.timeline.label.minimum": "Minimum",
"stats.performance.select.timeline.label.average": "Mittelwert",
"stats.performance.select.timeline.label.maximum": "Maximum",
"stats.player.detail.headline": "Kampagnendetails - {{name}}", "stats.player.detail.headline": "Kampagnendetails - {{name}}",
"stats.player.detail.button.back": "Zurück", "stats.player.detail.button.back": "Zurück",

View File

@ -42,6 +42,9 @@
"stats.performance.select.timeline.avg": "Timeline FPS Average", "stats.performance.select.timeline.avg": "Timeline FPS Average",
"stats.performance.select.timeline.min": "Timeline FPS Minimum", "stats.performance.select.timeline.min": "Timeline FPS Minimum",
"stats.performance.select.timeline.server": "Server FPS", "stats.performance.select.timeline.server": "Server FPS",
"stats.performance.select.timeline.label.minimum": "Minimum",
"stats.performance.select.timeline.label.average": "Average",
"stats.performance.select.timeline.label.maximum": "Maximum",
"stats.player.detail.headline": "Campaign Details - {{name}}", "stats.player.detail.headline": "Campaign Details - {{name}}",
"stats.player.detail.button.back": "Back", "stats.player.detail.button.back": "Back",