From 7b8136d0c4fe59c95a12d421f838204382f23aea Mon Sep 17 00:00:00 2001 From: sladecraven Date: Sun, 6 Feb 2022 19:07:10 +0100 Subject: [PATCH] Prepare transation --- module/module.json | 2 +- module/modules/swade-fr-init.js | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/module/module.json b/module/module.json index 9fe4ed5..93da3d3 100644 --- a/module/module.json +++ b/module/module.json @@ -42,7 +42,7 @@ ], "url": "https://gitlab.com/sasmira/swade-fr", "flags": {}, - "version": "0.19.0.1", + "version": "0.19.0.2", "minimumCoreVersion": "0.7.9", "compatibleCoreVersion": "9", "scripts": [], diff --git a/module/modules/swade-fr-init.js b/module/modules/swade-fr-init.js index 5ef5a30..a694d54 100644 --- a/module/modules/swade-fr-init.js +++ b/module/modules/swade-fr-init.js @@ -135,9 +135,33 @@ const subFolder = { 'Social Edges': 'Atouts sociaux', 'Background Edges': 'Atout 'Catapults': 'Catapultes', 'Flamethrowers': 'Lance-flammes', 'Rocket Launchers & Torpedoes': 'Lance roquettes et torpilles', 'Vehicular Weapons': 'Armes de véhicules' } +/* -------------------------------------------- */ +// 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}"`) + /* -------------------------------------------- */ + } +} + /************************************************************************************/ Hooks.once('ready', () => { //FolderTranslate.translateFolders() + registerUsageCount("swade-fr") }); +