Reference by global in statistics_exporter

Store export function in a global table in the lua module for statistics
exporter in order to avoid a remote.call.
This commit is contained in:
Hornwitser committed 2020-01-04 17:34:16 +01:00
1 parent 0e9cd35c30
commit 6cf16cc09e
4 files changed
+6 -11

No files matched your search

+2 -2
View File
@@ -16,7 +16,7 @@ describe("statistics_exporter plugin", function() {
describe(".onMetrics()", function() {
it("should record statistics", async function() {
instancePlugin.instance.server.rconCommandResults.set(
'/sc remote.call("statistics_exporter", "export")',
'/sc statistics_exporter.export()',
JSON.stringify({
game_tick: 100,
player_count: 3,
@@ -51,7 +51,7 @@ describe("statistics_exporter plugin", function() {
it("should pass on JSON parse errors", async function() {
let string = 'An error occured\n';
instancePlugin.instance.server.rconCommandResults.set(
'/sc remote.call("statistics_exporter", "export")', string
'/sc statistics_exporter.export()', string
);
let errorMessage;