Enhance stats

This commit is contained in:
LeRatierBretonnien 2024-02-08 12:56:25 +01:00
parent 62c3787cea
commit 63d15e82bb

View File

@ -17,6 +17,7 @@ import { HeritiersUtility } from "./heritiers-utility.js";
import { HeritiersCombat } from "./heritiers-combat.js";
import { HeritiersItem } from "./heritiers-item.js";
import { HERITIERS_CONFIG } from "./heritiers-config.js";
import { ClassCounter} from "https://www.uberwald.me/fvtt_appcount/count-class-ready.js"
/* -------------------------------------------- */
/* Foundry VTT Initialization */
@ -78,31 +79,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 */
@ -119,8 +95,8 @@ Hooks.once("ready", function () {
user: game.user._id
});
}
registerUsageCount(game.system.id)
ClassCounter.registerUsageCount()
welcomeMessage()
});