Server authority

This commit is contained in:
2026-09-24 19:34:07 -03:00
parent 1bef94ce0c
commit 79faa556de
75 changed files with 2247 additions and 1632 deletions
+26
View File
@@ -0,0 +1,26 @@
let stopped = false;
// replaces the game with a message, for when it can't go on (no server, lost connection)
export function show_fatal_error(message: string) {
if (stopped) {
return;
}
stopped = true;
document.exitPointerLock?.();
const overlay = document.createElement("div");
overlay.style.cssText =
"position:fixed;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;" +
"gap:12px;background:rgba(0,0,0,0.85);color:white;font:20px system-ui,sans-serif;text-align:center;";
const text = document.createElement("div");
text.textContent = message;
const hint = document.createElement("div");
hint.textContent = "Reload the page to try again.";
hint.style.cssText = "font-size:14px;opacity:0.7;";
overlay.append(text, hint);
document.body.append(overlay);
}
export function is_stopped() {
return stopped;
}