This commit is contained in:
Kim Ravn Hansen
2025-09-14 13:04:48 +02:00
parent 8c196bb6a1
commit ed91a7f2f7
43 changed files with 2279 additions and 1727 deletions

View File

@@ -0,0 +1,37 @@
import { PasswordPrompt } from "./passwordPrompt.js";
import { Player } from "../../models/player.js";
import { Scene } from "../scene.js";
import { UsernamePrompt } from "./usernamePrompt.js";
/** @property {Session} session */
export class AuthenticationScene extends Scene {
introText = [
"= Welcome", //
];
/** @type {Player} */
player;
onReady() {
// current prompt
this.doPrompt(new UsernamePrompt(this));
}
/** @param {Player} player */
usernameAccepted(player) {
this.player = player;
this.doPrompt(new PasswordPrompt(this));
}
passwordAccepted() {
this.player.loggedIn = true;
this.session.player = this.player;
if (this.player.admin) {
this.session.setScene("new AdminJustLoggedInScene");
} else {
this.session.setScene("new JustLoggedInScene");
}
}
}