mirror of
https://github.com/AeThex-Corporation/AeThex-OS.git
synced 2026-04-17 22:27:19 +00:00
33 lines
937 B
JavaScript
33 lines
937 B
JavaScript
// Generated by AeThex Compiler v1.0.0
|
|
// Target: JavaScript
|
|
|
|
const { SafeInput, Compliance } = require('@aethex.os/core');
|
|
|
|
const SecureLeaderboard = {
|
|
platforms: ["roblox"],
|
|
type: "compliance-exam",
|
|
};
|
|
|
|
function SubmitScore(player, playerName, score) {
|
|
if ((!Compliance.isCOPPACompliant(player.age))) {
|
|
console.log("Players under 13 cannot submit scores publicly");
|
|
return;
|
|
}
|
|
const nameValidation = SafeInput.validate(playerName);
|
|
if ((!nameValidation.valid)) {
|
|
console.log("Invalid name: contains PII");
|
|
return;
|
|
}
|
|
const scoreValidation = SafeInput.validate(score);
|
|
if ((!scoreValidation.valid)) {
|
|
console.log("Invalid score: contains sensitive data");
|
|
return;
|
|
}
|
|
console.log("Score submitted successfully!");
|
|
return { player: nameValidation.clean, score: scoreValidation.clean };
|
|
}
|
|
|
|
function TestCompliance() {
|
|
const player = { age: 15 };
|
|
SubmitScore(player, "PlayerOne", "1000");
|
|
}
|