There is a batch updating system for incremental updates of metrics. This is to prevent a query overload of the Database as it would otherwise be doing on every single instance of the metric.
Faction Stats
Object: factionUpdates
Updater: updateFactionStats
Processor: batchUpdateFactionStats
Table: ws_factions AND ws_factions_totals
Each value gets incremented using the function updateFactionStats. This takes the combatArray and generates metrics based off the values of that object.
Batch function batchUpdateFactionStats is then called which takes the object's values and commits them to database.
Line 2822 checks if the object key exists, if not, initializes it. Line 2827 then increments the record.
xpTotalsUpdates {
4: 12345,
5: 67890
}
Contains any of the following keys:
var allowedXPTypes = [4,5,6,7,8,10,11,15,16,25,26,29,26,32,34,37,51,53,54,55,56,131,132,133,134,135,136,137,138,139,140,141,142,201,236,237,240,241,270,272,275,276,277,278,279,293,294,370,437,438,439,556,557,579,584,592];
Outfit Totals
Object: outfitTotalsUpdates
Updater: insertOutfitStats
Processor: batchUpdateOutfitTotals
Table: ws_outfits AND ws_outfits_total
@ Line 1872 and beyond, each outfit (killer and/or victim) ID is checked and created if necessary. This includes initializing the resultID object.
@ Line 1906 and beyond, the metrics are calculated.
This batch updater does twofold updates for the total for the outfit globally, and just for the alert itself, via increment statements. e.g. SET outfitKills=outfitKills+1234
Class Totals
Object: classTotalsUpdates AND classPlayerUpdates
Updater: insertClassStats
Processor: batchUpdateClassTotals
Table: ws_classes
Very similar to Outfit Totals, however they are using loadoutIDs instead of outfit IDs.
Batch update interval found on line
2212
There is a batch updating system for incremental updates of metrics. This is to prevent a query overload of the Database as it would otherwise be doing on every single instance of the metric.
Faction Stats
Object:
factionUpdates
Updater:updateFactionStats
Processor:batchUpdateFactionStats
Table:ws_factions
ANDws_factions_totals
Each value gets incremented using the function
updateFactionStats
. This takes thecombatArray
and generates metrics based off the values of that object.Batch function
batchUpdateFactionStats
is then called which takes the object's values and commits them to database.XP Totals
Object:
xpTotalsUpdates
Updater:insertExperience
Processor:batchUpdateXpTotals
Table:ws_xp_totals
Line
2822
checks if the object key exists, if not, initializes it. Line2827
then increments the record.Contains any of the following keys:
var allowedXPTypes = [4,5,6,7,8,10,11,15,16,25,26,29,26,32,34,37,51,53,54,55,56,131,132,133,134,135,136,137,138,139,140,141,142,201,236,237,240,241,270,272,275,276,277,278,279,293,294,370,437,438,439,556,557,579,584,592];
Outfit Totals
Object:
outfitTotalsUpdates
Updater:insertOutfitStats
Processor:batchUpdateOutfitTotals
Table:ws_outfits
ANDws_outfits_total
@ Line1872
and beyond, each outfit (killer and/or victim) ID is checked and created if necessary. This includes initializing the resultID object.@ Line
1906
and beyond, the metrics are calculated.This batch updater does twofold updates for the total for the outfit globally, and just for the alert itself, via increment statements. e.g.
SET outfitKills=outfitKills+1234
Class Totals
Object:
classTotalsUpdates
ANDclassPlayerUpdates
Updater:insertClassStats
Processor:batchUpdateClassTotals
Table:ws_classes
Very similar to Outfit Totals, however they are using loadoutIDs instead of outfit IDs.
classPlayerUpdates
However, this function also does something extra, which is process individual player class statistics as well, which starts on line
2920
.This object has two levels of indentation:
The processing for both the class and the individual players starts on line
2961
.