Add automated ban offense for anti-cheat
add EFClientStatHistory and EFClientAverageStatHistory for tracking change of stats over time
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
let offset = 15;
|
||||
let loadCount = 15;
|
||||
let isLoading = false;
|
||||
let loaderOffset = 25;
|
||||
let loadCount = 25;
|
||||
let isLoaderLoading = false;
|
||||
let loadUri = '';
|
||||
let loaderResponseId = '';
|
||||
|
||||
@ -11,26 +11,26 @@ function initLoader(location, loaderId) {
|
||||
}
|
||||
|
||||
function loadMoreItems() {
|
||||
if (isLoading) {
|
||||
if (isLoaderLoading) {
|
||||
return false;
|
||||
}
|
||||
|
||||
showLoader();
|
||||
isLoading = true;
|
||||
$.get(loadUri, { offset: offset, count : loadCount })
|
||||
isLoaderLoading = true;
|
||||
$.get(loadUri, { offset: loaderOffset, count : loadCount })
|
||||
.done(function (response) {
|
||||
$(loaderResponseId).append(response);
|
||||
if (response.trim().length === 0) {
|
||||
staleLoader();
|
||||
}
|
||||
hideLoader();
|
||||
isLoading = false;
|
||||
isLoaderLoading = false;
|
||||
})
|
||||
.fail(function (jqxhr, statis, error) {
|
||||
errorLoader();
|
||||
isLoading = false;
|
||||
isLoaderLoading = false;
|
||||
});
|
||||
offset += loadCount;
|
||||
loaderOffset += loadCount;
|
||||
}
|
||||
|
||||
function setupListeners() {
|
||||
|
61
WebfrontCore/wwwroot/js/stats.js
Normal file
61
WebfrontCore/wwwroot/js/stats.js
Normal file
@ -0,0 +1,61 @@
|
||||
function getStatsChart(id, width, height) {
|
||||
const data = $('#' + id).data('history');
|
||||
let fixedData = [];
|
||||
data.forEach(function (item, i) {
|
||||
fixedData[i] = { x: i, y: item };
|
||||
});
|
||||
|
||||
return new CanvasJS.Chart(id, {
|
||||
backgroundColor: 'transparent',
|
||||
height: height,
|
||||
width: width,
|
||||
animationEnabled: false,
|
||||
toolTip: {
|
||||
contentFormatter: function (e) {
|
||||
return e.entries[0].dataPoint.y;
|
||||
}
|
||||
},
|
||||
axisX: {
|
||||
interval: 1,
|
||||
gridThickness: 0,
|
||||
lineThickness: 0,
|
||||
tickThickness: 0,
|
||||
margin: 0,
|
||||
valueFormatString: " "
|
||||
},
|
||||
axisY: {
|
||||
gridThickness: 0,
|
||||
lineThickness: 0,
|
||||
tickThickness: 0,
|
||||
minimum: Math.min(...data) - 15,
|
||||
maximum: Math.max(...data) + 15,
|
||||
margin: 0,
|
||||
valueFormatString: " ",
|
||||
labelMaxWidth: 0
|
||||
},
|
||||
legend: {
|
||||
maxWidth: 0,
|
||||
maxHeight: 0,
|
||||
dockInsidePlotArea: true
|
||||
},
|
||||
data: [{
|
||||
showInLegend: false,
|
||||
type: "splineArea",
|
||||
color: 'rgba(0, 122, 204, 0.25)',
|
||||
markerSize: 0,
|
||||
dataPoints: fixedData
|
||||
}]
|
||||
});
|
||||
}
|
||||
|
||||
$(document).ready(function () {
|
||||
$('.client-rating-graph').each(function (i, element) {
|
||||
getStatsChart($(element).attr('id'), $(element).width(), $(element).height()).render();
|
||||
});
|
||||
|
||||
$(window).resize(function () {
|
||||
$('.client-rating-graph').each(function (index, element) {
|
||||
getStatsChart($(element).attr('id'), $(element).width(), $(element).height()).render();
|
||||
});
|
||||
});
|
||||
});
|
Reference in New Issue
Block a user