Add launchable

This commit is contained in:
usernames122
2025-10-23 20:58:19 +02:00
parent 300bb16e5e
commit d9d5460856
27 changed files with 1743 additions and 85 deletions

28
js/core/AuthStub.js Normal file
View File

@@ -0,0 +1,28 @@
// For whoever is going to use this engine later, please modify this file to actually do authentication.
export class Auth {
/**
* Verifies a session token and returns a user ID.
* In this dummy version, it just returns a random numeric ID.
*
* @param {string} token - The player's session token.
* @returns {number|null} - The verified user ID, or null if invalid.
*/
verifySessionToken(token) {
// Dummy implementation: always "verifies" successfully.
if (token === "fake") return null; // Simulate invalid token
return Math.floor(Math.random() * 1000);
}
/**
* Gets a user's display name by their ID.
* Replace this with a real lookup (e.g., database or API call).
*
* @param {number|string} userId - The player's user ID.
* @returns {string} - The player's display name.
*/
getUserNameById(userId) {
// Dummy implementation
return `User${userId}`;
}
}