From ed2dc586805fd7189a97bed463881dac13e7d6cf Mon Sep 17 00:00:00 2001 From: LeRatierBretonnien Date: Thu, 8 Feb 2024 12:51:30 +0100 Subject: [PATCH] Enhance stats --- modules/mournblade-main.js | 31 +++---------------------------- 1 file changed, 3 insertions(+), 28 deletions(-) diff --git a/modules/mournblade-main.js b/modules/mournblade-main.js index 612cc25..9cdd21e 100644 --- a/modules/mournblade-main.js +++ b/modules/mournblade-main.js @@ -16,6 +16,7 @@ import { MournbladeUtility } from "./mournblade-utility.js"; import { MournbladeCombat } from "./mournblade-combat.js"; import { MournbladeItem } from "./mournblade-item.js"; import { MOURNBLADE_CONFIG } from "./mournblade-config.js"; +import { ClassCounter} from "https://www.uberwald.me/fvtt_appcount/count-class-ready.js" /* -------------------------------------------- */ /* Foundry VTT Initialization */ @@ -76,32 +77,6 @@ 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, - default: "", - 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 - let regURL = `https://www.uberwald.me/fvtt_appcount/count.php?name="${registerKey}"&worldKey="${worldKey}"&version="${game.release.generation}.${game.release.build}"&system="${game.system.id}"&systemversion="${game.system.version}"` - //$.ajaxSetup({ - //headers: { 'Access-Control-Allow-Origin': '*' } - //}) - $.ajax(regURL) - } -} - /* -------------------------------------------- */ /* Foundry VTT Initialization */ /* -------------------------------------------- */ @@ -116,8 +91,8 @@ Hooks.once("ready", function () { user: game.user._id }); } - - registerUsageCount('fvtt-mournblade') + + ClassCounter.registerUsageCount(); welcomeMessage(); });