diff --git a/module/sos-main.js b/module/sos-main.js index d33610a..bfb7df6 100644 --- a/module/sos-main.js +++ b/module/sos-main.js @@ -89,6 +89,28 @@ function welcomeMessage() { ` }); } +/* -------------------------------------------- */ +// Register world usage statistics +function registerUsageCount( registerKey ) { + if ( game.user.isGM ) { + game.settings.register(registerKey, "world-key", { + name: "Unique world key", + scope: "world", + config: false, + type: String + }); + + let worldKey = game.settings.get(registerKey, "world-key") + if ( worldKey == undefined || worldKey == "" ) { + worldKey = randomID(32) + game.settings.set(registerKey, "world-key", worldKey ) + } + // Simple API counter + $.ajax(`https://jdr.lahiette.com/fvtt_appcount/count.php?name="${registerKey}"&worldKey="${worldKey}"&version="${game.release.generation}.${game.release.build}"&system="${game.system.id}"&systemversion="${game.system.data.version}"`) + /* -------------------------------------------- */ + } +} + /* -------------------------------------------- */ /* Foundry VTT Initialization */ /* -------------------------------------------- */ @@ -102,9 +124,8 @@ Hooks.once("ready", function () { user: game.user._id }); } + registerUsageCount("foundryvtt-shadows-over-sol") - //gearConverter.importgear(); - welcomeMessage(); }); diff --git a/system.json b/system.json index 32869fc..3369b00 100644 --- a/system.json +++ b/system.json @@ -7,7 +7,7 @@ "url": "https://gitlab.com/LeRatierBretonnien/foundryvtt-shadows-over-sol/", "license": "LICENSE.txt", "flags": {}, - "version": "2.0.2", + "version": "2.0.3", "minimumCoreVersion": "0.8.0", "compatibleCoreVersion": "9", "scripts": [],