SoS : Minor v9 update

This commit is contained in:
2022-01-29 16:45:09 +01:00
parent 6df412b1b3
commit 07ea4477cd
2 changed files with 24 additions and 3 deletions

View File

@ -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();
});