diff --git a/[web]/webstats/Data.xml b/[web]/webstats/Data.xml deleted file mode 100644 index 7ec8615d5..000000000 --- a/[web]/webstats/Data.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - diff --git a/[web]/webstats/FCF_Area2D.swf b/[web]/webstats/FCF_Area2D.swf deleted file mode 100644 index 224fb17eb..000000000 Binary files a/[web]/webstats/FCF_Area2D.swf and /dev/null differ diff --git a/[web]/webstats/FCF_Bar2D.swf b/[web]/webstats/FCF_Bar2D.swf deleted file mode 100644 index 7b1b09e77..000000000 Binary files a/[web]/webstats/FCF_Bar2D.swf and /dev/null differ diff --git a/[web]/webstats/FCF_Candlestick.swf b/[web]/webstats/FCF_Candlestick.swf deleted file mode 100644 index 01ba770d7..000000000 Binary files a/[web]/webstats/FCF_Candlestick.swf and /dev/null differ diff --git a/[web]/webstats/FCF_Column2D.swf b/[web]/webstats/FCF_Column2D.swf deleted file mode 100644 index e6913b5fa..000000000 Binary files a/[web]/webstats/FCF_Column2D.swf and /dev/null differ diff --git a/[web]/webstats/FCF_Column3D.swf b/[web]/webstats/FCF_Column3D.swf deleted file mode 100644 index a02364292..000000000 Binary files a/[web]/webstats/FCF_Column3D.swf and /dev/null differ diff --git a/[web]/webstats/FCF_Doughnut2D.swf b/[web]/webstats/FCF_Doughnut2D.swf deleted file mode 100644 index 58d826056..000000000 Binary files a/[web]/webstats/FCF_Doughnut2D.swf and /dev/null differ diff --git a/[web]/webstats/FCF_Funnel.swf b/[web]/webstats/FCF_Funnel.swf deleted file mode 100644 index 87d1c663d..000000000 Binary files a/[web]/webstats/FCF_Funnel.swf and /dev/null differ diff --git a/[web]/webstats/FCF_Gantt.swf b/[web]/webstats/FCF_Gantt.swf deleted file mode 100644 index de6de3ec6..000000000 Binary files a/[web]/webstats/FCF_Gantt.swf and /dev/null differ diff --git a/[web]/webstats/FCF_Line.swf b/[web]/webstats/FCF_Line.swf deleted file mode 100644 index 547e54f8c..000000000 Binary files a/[web]/webstats/FCF_Line.swf and /dev/null differ diff --git a/[web]/webstats/FCF_MSArea2D.swf b/[web]/webstats/FCF_MSArea2D.swf deleted file mode 100644 index bff3774ae..000000000 Binary files a/[web]/webstats/FCF_MSArea2D.swf and /dev/null differ diff --git a/[web]/webstats/FCF_MSBar2D.swf b/[web]/webstats/FCF_MSBar2D.swf deleted file mode 100644 index 476d7b906..000000000 Binary files a/[web]/webstats/FCF_MSBar2D.swf and /dev/null differ diff --git a/[web]/webstats/FCF_MSColumn2D.swf b/[web]/webstats/FCF_MSColumn2D.swf deleted file mode 100644 index 0e0cbebc6..000000000 Binary files a/[web]/webstats/FCF_MSColumn2D.swf and /dev/null differ diff --git a/[web]/webstats/FCF_MSColumn2DLineDY.swf b/[web]/webstats/FCF_MSColumn2DLineDY.swf deleted file mode 100644 index b79490140..000000000 Binary files a/[web]/webstats/FCF_MSColumn2DLineDY.swf and /dev/null differ diff --git a/[web]/webstats/FCF_MSColumn3D.swf b/[web]/webstats/FCF_MSColumn3D.swf deleted file mode 100644 index 5076f580e..000000000 Binary files a/[web]/webstats/FCF_MSColumn3D.swf and /dev/null differ diff --git a/[web]/webstats/FCF_MSColumn3DLineDY.swf b/[web]/webstats/FCF_MSColumn3DLineDY.swf deleted file mode 100644 index 501291a94..000000000 Binary files a/[web]/webstats/FCF_MSColumn3DLineDY.swf and /dev/null differ diff --git a/[web]/webstats/FCF_MSLine.swf b/[web]/webstats/FCF_MSLine.swf deleted file mode 100644 index 26329e644..000000000 Binary files a/[web]/webstats/FCF_MSLine.swf and /dev/null differ diff --git a/[web]/webstats/FCF_Pie2D.swf b/[web]/webstats/FCF_Pie2D.swf deleted file mode 100644 index d0eea3588..000000000 Binary files a/[web]/webstats/FCF_Pie2D.swf and /dev/null differ diff --git a/[web]/webstats/FCF_Pie3D.swf b/[web]/webstats/FCF_Pie3D.swf deleted file mode 100644 index 1d78f79b0..000000000 Binary files a/[web]/webstats/FCF_Pie3D.swf and /dev/null differ diff --git a/[web]/webstats/FCF_StackedArea2D.swf b/[web]/webstats/FCF_StackedArea2D.swf deleted file mode 100644 index 5f8d3e7a1..000000000 Binary files a/[web]/webstats/FCF_StackedArea2D.swf and /dev/null differ diff --git a/[web]/webstats/FCF_StackedBar2D.swf b/[web]/webstats/FCF_StackedBar2D.swf deleted file mode 100644 index b9dfb0baf..000000000 Binary files a/[web]/webstats/FCF_StackedBar2D.swf and /dev/null differ diff --git a/[web]/webstats/FCF_StackedColumn2D.swf b/[web]/webstats/FCF_StackedColumn2D.swf deleted file mode 100644 index 7559014b8..000000000 Binary files a/[web]/webstats/FCF_StackedColumn2D.swf and /dev/null differ diff --git a/[web]/webstats/FCF_StackedColumn3D.swf b/[web]/webstats/FCF_StackedColumn3D.swf deleted file mode 100644 index be1ca1c4b..000000000 Binary files a/[web]/webstats/FCF_StackedColumn3D.swf and /dev/null differ diff --git a/[web]/webstats/FusionCharts.js b/[web]/webstats/FusionCharts.js deleted file mode 100644 index 45b7d06dc..000000000 --- a/[web]/webstats/FusionCharts.js +++ /dev/null @@ -1,310 +0,0 @@ -/** - * FusionCharts: Flash Player detection and Chart embedding. - * Version: vFree.1.2 (1st November, 2007) - Added Player detection, New conditional fixes for IE, supports FORM in IE - * - * Morphed from SWFObject (http://blog.deconcept.com/swfobject/) under MIT License: - * http://www.opensource.org/licenses/mit-license.php - * - */ -if(typeof infosoftglobal == "undefined") var infosoftglobal = new Object(); -if(typeof infosoftglobal.FusionChartsUtil == "undefined") infosoftglobal.FusionChartsUtil = new Object(); -infosoftglobal.FusionCharts = function(swf, id, w, h, debugMode, registerWithJS, c, scaleMode, lang, detectFlashVersion, autoInstallRedirect){ - if (!document.getElementById) { return; } - - //Flag to see whether data has been set initially - this.initialDataSet = false; - - //Create container objects - this.params = new Object(); - this.variables = new Object(); - this.attributes = new Array(); - - //Set attributes for the SWF - if(swf) { this.setAttribute('swf', swf); } - if(id) { this.setAttribute('id', id); } - if(w) { this.setAttribute('width', w); } - if(h) { this.setAttribute('height', h); } - - //Set background color - if(c) { this.addParam('bgcolor', c); } - - //Set Quality - this.addParam('quality', 'high'); - - //Add scripting access parameter - this.addParam('allowScriptAccess', 'always'); - - //Pass width and height to be appended as chartWidth and chartHeight - this.addVariable('chartWidth', w); - this.addVariable('chartHeight', h); - - //Whether in debug mode - debugMode = debugMode ? debugMode : 0; - this.addVariable('debugMode', debugMode); - //Pass DOM ID to Chart - this.addVariable('DOMId', id); - //Whether to registed with JavaScript - registerWithJS = registerWithJS ? registerWithJS : 0; - this.addVariable('registerWithJS', registerWithJS); - - //Scale Mode of chart - scaleMode = scaleMode ? scaleMode : 'noScale'; - this.addVariable('scaleMode', scaleMode); - //Application Message Language - lang = lang ? lang : 'EN'; - this.addVariable('lang', lang); - - //Whether to auto detect and re-direct to Flash Player installation - this.detectFlashVersion = detectFlashVersion?detectFlashVersion:1; - this.autoInstallRedirect = autoInstallRedirect?autoInstallRedirect:1; - - //Ger Flash Player version - this.installedVer = infosoftglobal.FusionChartsUtil.getPlayerVersion(); - - if (!window.opera && document.all && this.installedVer.major > 7) { - // Only add the onunload cleanup if the Flash Player version supports External Interface and we are in IE - infosoftglobal.FusionCharts.doPrepUnload = true; - } -} - -infosoftglobal.FusionCharts.prototype = { - setAttribute: function(name, value){ - this.attributes[name] = value; - }, - getAttribute: function(name){ - return this.attributes[name]; - }, - addParam: function(name, value){ - this.params[name] = value; - }, - getParams: function(){ - return this.params; - }, - addVariable: function(name, value){ - this.variables[name] = value; - }, - getVariable: function(name){ - return this.variables[name]; - }, - getVariables: function(){ - return this.variables; - }, - getVariablePairs: function(){ - var variablePairs = new Array(); - var key; - var variables = this.getVariables(); - for(key in variables){ - variablePairs.push(key +"="+ variables[key]); - } - return variablePairs; - }, - getSWFHTML: function() { - var swfNode = ""; - if (navigator.plugins && navigator.mimeTypes && navigator.mimeTypes.length) { - // netscape plugin architecture - swfNode = ' 0){ swfNode += 'flashvars="'+ pairs +'"'; } - swfNode += '/>'; - } else { // PC IE - swfNode = ''; - swfNode += ''; - var params = this.getParams(); - for(var key in params) { - swfNode += ''; - } - var pairs = this.getVariablePairs().join("&"); - if(pairs.length > 0) {swfNode += '';} - swfNode += ""; - } - return swfNode; - }, - setDataURL: function(strDataURL){ - //This method sets the data URL for the chart. - //If being set initially - if (this.initialDataSet==false){ - this.addVariable('dataURL',strDataURL); - //Update flag - this.initialDataSet = true; - }else{ - //Else, we update the chart data using External Interface - //Get reference to chart object - var chartObj = infosoftglobal.FusionChartsUtil.getChartObject(this.getAttribute('id')); - chartObj.setDataURL(strDataURL); - } - }, - setDataXML: function(strDataXML){ - //If being set initially - if (this.initialDataSet==false){ - //This method sets the data XML for the chart INITIALLY. - this.addVariable('dataXML',strDataXML); - //Update flag - this.initialDataSet = true; - }else{ - //Else, we update the chart data using External Interface - //Get reference to chart object - var chartObj = infosoftglobal.FusionChartsUtil.getChartObject(this.getAttribute('id')); - chartObj.setDataXML(strDataXML); - } - }, - render: function(elementId){ - //First check for installed version of Flash Player - we need a minimum of 6 - if((this.detectFlashVersion==1) && (this.installedVer.major < 6)){ - if (this.autoInstallRedirect==1){ - //If we can auto redirect to install the player? - var installationConfirm = window.confirm("You need Adobe Flash Player 6 (or above) to view the charts. It is a free and lightweight installation from Adobe.com. Please click on Ok to install the same."); - if (installationConfirm){ - window.location = "http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash"; - }else{ - return false; - } - }else{ - //Else, do not take an action. It means the developer has specified a message in the DIV (and probably a link). - //So, expect the developers to provide a course of way to their end users. - //window.alert("You need Adobe Flash Player 6 (or above) to view the charts. It is a free and lightweight installation from Adobe.com. "); - return false; - } - }else{ - //Render the chart - var n = (typeof elementId == 'string') ? document.getElementById(elementId) : elementId; - n.innerHTML = this.getSWFHTML(); - - //Added for .NET AJAX and
compatibility - if(!document.embeds[this.getAttribute('id')] && !window[this.getAttribute('id')]) - window[this.getAttribute('id')]=document.getElementById(this.getAttribute('id')); - //or else document.forms[formName/formIndex][chartId] - - return true; - } - } -} - -/* ---- detection functions ---- */ -infosoftglobal.FusionChartsUtil.getPlayerVersion = function(){ - var PlayerVersion = new infosoftglobal.PlayerVersion([0,0,0]); - if(navigator.plugins && navigator.mimeTypes.length){ - var x = navigator.plugins["Shockwave Flash"]; - if(x && x.description) { - PlayerVersion = new infosoftglobal.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/, "").replace(/(\s+r|\s+b[0-9]+)/, ".").split(".")); - } - }else if (navigator.userAgent && navigator.userAgent.indexOf("Windows CE") >= 0){ - //If Windows CE - var axo = 1; - var counter = 3; - while(axo) { - try { - counter++; - axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+ counter); - PlayerVersion = new infosoftglobal.PlayerVersion([counter,0,0]); - } catch (e) { - axo = null; - } - } - } else { - // Win IE (non mobile) - // Do minor version lookup in IE, but avoid Flash Player 6 crashing issues - try{ - var axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7"); - }catch(e){ - try { - var axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6"); - PlayerVersion = new infosoftglobal.PlayerVersion([6,0,21]); - axo.AllowScriptAccess = "always"; // error if player version < 6.0.47 (thanks to Michael Williams @ Adobe for this code) - } catch(e) { - if (PlayerVersion.major == 6) { - return PlayerVersion; - } - } - try { - axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash"); - } catch(e) {} - } - if (axo != null) { - PlayerVersion = new infosoftglobal.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(",")); - } - } - return PlayerVersion; -} -infosoftglobal.PlayerVersion = function(arrVersion){ - this.major = arrVersion[0] != null ? parseInt(arrVersion[0]) : 0; - this.minor = arrVersion[1] != null ? parseInt(arrVersion[1]) : 0; - this.rev = arrVersion[2] != null ? parseInt(arrVersion[2]) : 0; -} -// ------------ Fix for Out of Memory Bug in IE in FP9 ---------------// -/* Fix for video streaming bug */ -infosoftglobal.FusionChartsUtil.cleanupSWFs = function() { - var objects = document.getElementsByTagName("OBJECT"); - for (var i = objects.length - 1; i >= 0; i--) { - objects[i].style.display = 'none'; - for (var x in objects[i]) { - if (typeof objects[i][x] == 'function') { - objects[i][x] = function(){}; - } - } - } -} -// Fixes bug in fp9 -if (infosoftglobal.FusionCharts.doPrepUnload) { - if (!infosoftglobal.unloadSet) { - infosoftglobal.FusionChartsUtil.prepUnload = function() { - __flash_unloadHandler = function(){}; - __flash_savedUnloadHandler = function(){}; - window.attachEvent("onunload", infosoftglobal.FusionChartsUtil.cleanupSWFs); - } - window.attachEvent("onbeforeunload", infosoftglobal.FusionChartsUtil.prepUnload); - infosoftglobal.unloadSet = true; - } -} -/* Add document.getElementById if needed (mobile IE < 5) */ -if (!document.getElementById && document.all) { document.getElementById = function(id) { return document.all[id]; }} -/* Add Array.push if needed (ie5) */ -if (Array.prototype.push == null) { Array.prototype.push = function(item) { this[this.length] = item; return this.length; }} - -/* Function to return Flash Object from ID */ -infosoftglobal.FusionChartsUtil.getChartObject = function(id) -{ - // set off to test in .NET AJAX and environment - //if (window.document[id]) { - // return window.document[id]; - //} - var chartRef=null; - if (navigator.appName.indexOf("Microsoft Internet")==-1) { - if (document.embeds && document.embeds[id]) - chartRef = document.embeds[id]; - else - chartRef = window.document[id]; - } - else { - chartRef = window[id]; - } - if (!chartRef) - chartRef = document.getElementById(id); - - return chartRef; -} - - -/* - Function to update chart's data at client side (FOR FusionCharts vFREE and 2.x -*/ -infosoftglobal.FusionChartsUtil.updateChartXML = function(chartId, strXML){ - //Get reference to chart object - var chartObj = infosoftglobal.FusionChartsUtil.getChartObject(chartId); - //Set dataURL to null - chartObj.SetVariable("_root.dataURL",""); - //Set the flag - chartObj.SetVariable("_root.isNewData","1"); - //Set the actual data - chartObj.SetVariable("_root.newData",strXML); - //Go to the required frame - chartObj.TGotoLabel("/", "JavaScriptHandler"); -} - - -/* Aliases for easy usage */ -var getChartFromId = infosoftglobal.FusionChartsUtil.getChartObject; -var updateChartXML = infosoftglobal.FusionChartsUtil.updateChartXML; -var FusionCharts = infosoftglobal.FusionCharts; diff --git a/[web]/webstats/css.css b/[web]/webstats/css.css index 841b5c67d..c103c3d14 100644 --- a/[web]/webstats/css.css +++ b/[web]/webstats/css.css @@ -1,20 +1,56 @@ +body { + font-family: 'Trebuchet MS', Arial, sans-serif; + font-size: 0.8em; + margin: 0; + display: flex; + flex-direction: column; +} + +html, +body { + height: 100%; +} + #topbar { - position: absolute; - top:0px; - right:0px; - left:0px; - height:23px; - background:#555555; - color:#FFFFFF; - padding:7px;" + background: #555; + color: #fff; + height: 23px; + padding: 7px; } #datasets { - position: absolute; - right: 0px; - top: 37px; - width: 20%; - bottom: 0px; - background:#555555; - overflow:auto; + background: #555; + height: 100%; + width: 250px; +} + +#chart-container { + height: 80%; + width: 100%; +} + +#wrapper { + display: flex; + height: 100%; +} + +#toggleButton { + float: right; +} + +details { + background: #777; +} + +summary { + background: #444444; + cursor: pointer; + font-weight: bold; + padding: 5px 10px; +} + +details label { + cursor: pointer; + display: block; + padding: 2px 10px; } diff --git a/[web]/webstats/elements.xml b/[web]/webstats/elements.xml deleted file mode 100644 index 117fb5edf..000000000 --- a/[web]/webstats/elements.xml +++ /dev/null @@ -1,94 +0,0 @@ -<* - -local colors = {"FF0000", "00FF00", "0000FF", "FFFF00", "00FFFF", "FF00FF", "FFFFFF", "80FFFF", "FF80FF", "FFFF80", "80FF00"} -local border_colors = {"FF0000", "00FF00", "0000FF", "FFFF00", "00FFFF", "FF00FF", "FFFFFF", "80FFFF", "FF80FF", "FFFF80", "80FF00"} - -function split(str, delim, maxNb) - -- Eliminate bad cases... - if string.find(str, delim) == nil then - return { str } - end - if maxNb == nil or maxNb < 1 then - maxNb = 0 -- No limit - end - local result = {} - local pat = "(.-)" .. delim .. "()" - local nb = 0 - local lastPos - for part, pos in string.gfind(str, pat) do - nb = nb + 1 - result[nb] = part - lastPos = pos - if nb == maxNb then break end - end - -- Handle the last field - if nb ~= maxNb then - result[nb + 1] = string.sub(str, lastPos) - end - return result -end - -thisresource = getThisResource() - -statsList = querystring.stats -if ( statsList == nil ) then - statsList = "" -end - -args = split(querystring.stats,"|") -charttype = args [2] -if ( charttype == nil ) then - httpWrite ( "Must specify a chart type!" ) -end - -local registeredStats = call(thisresource, "getRegisteredStats") - -if ( charttype == "FCF_Line" ) then - yAxisName = registeredStats[split(args[1], ",")[1]].name -else - yAxisName = "" -end -*> - - <* - stats = call ( thisresource, "getCurrentStats" ) - - if ( charttype == "FCF_StackedArea2D" or charttype == "FCF_StackedColumn2D" or charttype=="FCF_StackedColumn3D" or charttype=="FCF_MSLine" ) then - *> - - <* for k,v in ipairs(stats) do *> - - <* end *> - - - <* - local statsRequired = split(args[1], ",") - local i = 0 - for p,q in ipairs(statsRequired) do - i = i + 1 - *> - - <* for k,v in ipairs(stats) do *> - - <* end *> - - <* - end - elseif ( charttype == "FCF_Pie2D" or charttype == "FCF_Pie3D" ) then - local statsRequired = split(args[1], ",") - local i = 0 - for p,q in ipairs(statsRequired) do - i = i + 1 - *> - - <* - end - elseif ( charttype == "FCF_Line" ) then - local statsRequired = split(args[1], ",") - q = statsRequired[1] - for k,v in ipairs(stats) do *> - - <* end - end - *> - diff --git a/[web]/webstats/ie-70.css b/[web]/webstats/ie-70.css deleted file mode 100644 index 3ef14e5a6..000000000 --- a/[web]/webstats/ie-70.css +++ /dev/null @@ -1,13 +0,0 @@ -#topbar { - right:-20px; -} - -#datasets { - position: absolute; - right: -1px; - top: 37px; - width: 20%; - height: 89s%; - background:#555555; - overflow:auto; -} diff --git a/[web]/webstats/index.htm b/[web]/webstats/index.htm index 1b9b57ec3..9d5e1ba4d 100644 --- a/[web]/webstats/index.htm +++ b/[web]/webstats/index.htm @@ -1,121 +1,65 @@ - - -<* = call(getResourceFromName("ajax"),"start", getResourceName(getThisResource()) ) *> - - + + + + - - - - + - - function toggleDatasets() - { - var datasets = document.getElementById("datasets"); - var toggleButton = document.getElementById("toggleButton"); - var chart = document.getElementById("chart"); - if ( toggleButton.value == "hide datasets" ) - { - datasets.style.display = "none"; - toggleButton.value = "show datasets"; - chart.style.width = "97%"; - } - else - { - datasets.style.display = "block"; - toggleButton.value = "hide datasets"; - chart.style.width = "78%"; - } - } - - + + + + +
+ + + + +
- +
+
+ Canvas is not supported on this browser. +
-
- Select datasets from the list on the right to begin. -
- -
-
- - - -
- -
- - <* - resourceStats = call(getThisResource(),"getStatListByResource") - for p,q in pairs(resourceStats) do - resname = getResourceInfo(p, "name") - if ( resname == false ) then - resname = getResourceName(p) - end - *> -
<*= resname *>
-
+
<* - local i = 0 - for k,v in pairs(q) do + local resourceStats = call(resource, "getStatListByResource") + for p, q in pairs(resourceStats) do + local resname = getResourceInfo(p, "name") + if (resname == false) then + resname = getResourceName(p) + end *> -
- <* - i= i+1 - end - *> -
- <* - end - *> -
- - - - + > + + <*= resname *> + + <* for k, v in pairs(q) do *> + + <* end *> + + <* end *> +
+
+ diff --git a/[web]/webstats/internal_stats.lua b/[web]/webstats/internal_stats.lua index c631557ba..cd1b833df 100644 --- a/[web]/webstats/internal_stats.lua +++ b/[web]/webstats/internal_stats.lua @@ -1,89 +1,87 @@ -call(getThisResource(), "registerStat", getThisResource(), "getVehicleCount", "Vehicles", "The number of vehicles") +local publichatcount = 0 +local teamchatcount = 0 +local totalchatcount = 0 +local vehicleswasted = 0 +local damagecount = 0 + +registerStat(resource, "getVehicleCount", "Vehicles", "The number of vehicles") function getVehicleCount() - return #getElementsByType("vehicle"); + return #getElementsByType("vehicle") end -call(getThisResource(), "registerStat", getThisResource(), "getObjectCount", "Objects", "The number of objects") +registerStat(resource, "getObjectCount", "Objects", "The number of objects") function getObjectCount() - return #getElementsByType("object"); + return #getElementsByType("object") end -call(getThisResource(), "registerStat", getThisResource(), "getPlayerCount", "Players", "The number of players") +registerStat(resource, "getPlayerCount", "Players", "The number of players") +function getPlayerCount() + return #getElementsByType("player") +end -call(getThisResource(), "registerStat", getThisResource(), "getBlipCount", "Blips", "The number of blips") +registerStat(resource, "getBlipCount", "Blips", "The number of blips") function getBlipCount() - return #getElementsByType("blip"); + return #getElementsByType("blip") end -call(getThisResource(), "registerStat", getThisResource(), "getMarkerCount", "Markers", "The number of markers") +registerStat(resource, "getMarkerCount", "Markers", "The number of markers") function getMarkerCount() - return #getElementsByType("marker"); + return #getElementsByType("marker") end -call(getThisResource(), "registerStat", getThisResource(), "getPickupCount", "Pickups", "The number of pickups") +registerStat(resource, "getPickupCount", "Pickups", "The number of pickups") function getPickupCount() - return #getElementsByType("pickup"); + return #getElementsByType("pickup") end -publichatcount = 0 -teamchatcount = 0 -totalchatcount = 0 -addEventHandler ( "onPlayerChat", getRootElement(), - function(message,messageType) - if messageType == 0 or messageType == 1 then - publichatcount = publichatcount + 1 - else - teamchatcount = teamchatcount + 1 - end - totalchatcount = totalchatcount + 1 +registerStat(resource, "getPublicChatCount", "Public Chat Count", "The number of lines of public chat") +addEventHandler("onPlayerChat", root, function (message, messageType) + if (messageType == 0) or (messageType == 1) then + publichatcount = publichatcount + 1 + else + teamchatcount = teamchatcount + 1 end -) + totalchatcount = totalchatcount + 1 +end) -call(getThisResource(), "registerStat", getThisResource(), "getPublicChatCount", "Public Chat Count", "The number of lines of public chat") function getPublicChatCount() - local ret = publichatcount; - publichatcount = 0; - return ret; + local ret = publichatcount + publichatcount = 0 + return ret end -call(getThisResource(), "registerStat", getThisResource(), "getTeamChatCount", "Team Chat Count", "The number of lines of team chat") +registerStat(resource, "getTeamChatCount", "Team Chat Count", "The number of lines of team chat") function getTeamChatCount() - local ret = teamchatcount; - teamchatcount = 0; - return ret; + local ret = teamchatcount + teamchatcount = 0 + return ret end -call(getThisResource(), "registerStat", getThisResource(), "getChatCount", "Chat Count", "The number of lines of chat") +registerStat(resource, "getChatCount", "Chat Count", "The number of lines of chat") function getChatCount() - local ret = totalchatcount; - totalchatcount = 0; - return ret; + local ret = totalchatcount + totalchatcount = 0 + return ret end -call(getThisResource(), "registerStat", getThisResource(), "getDamageCount", "Damage Given", "The amount of damage players have taken") -damagecount = 0 -addEventHandler ( "onPlayerDamage", getRootElement(), - function( attacker, attackerweapon, bodypart, loss ) - damagecount = damagecount + loss - end -) +registerStat(resource, "getDamageCount", "Damage Given", "The amount of damage players have taken") +addEventHandler("onPlayerDamage", root, function (_, _, _, loss) + damagecount = damagecount + loss +end) function getDamageCount() - local ret = damagecount; - damagecount = 0; - return ret; + local ret = damagecount + damagecount = 0 + return ret end -call(getThisResource(), "registerStat", getThisResource(), "getVehiclesWastedCount", "Vehicles Wasted", "The number of vehicles destroyed") -vehicleswasted = 0 -addEventHandler ( "onVehicleExplode", getRootElement(), - function( ) - vehicleswasted = vehicleswasted + 1 - end -) +registerStat(resource, "getVehiclesWastedCount", "Vehicles Wasted", "The number of vehicles destroyed") +addEventHandler("onVehicleExplode", root, function () + vehicleswasted = vehicleswasted + 1 +end) function getVehiclesWastedCount() - local ret = vehicleswasted; - vehicleswasted = 0; - return ret; + local ret = vehicleswasted + vehicleswasted = 0 + return ret end diff --git a/[web]/webstats/meta.xml b/[web]/webstats/meta.xml index 320b70c34..b38411baf 100644 --- a/[web]/webstats/meta.xml +++ b/[web]/webstats/meta.xml @@ -1,28 +1,20 @@ - - -