refactor!: remove firebase leftovers, admin page on the server (P1-8)
BREAKING CHANGE: admin/cleanup.js, admin/setcoins.js and docs/firebase are gone; the admin page now runs at /admin/.
This commit is contained in:
@@ -479,7 +479,7 @@
|
||||
const fbUser = () => (net && net.enabled ? net.auth.current : null);
|
||||
const fbAcc = () => (fbUser() && !fbUser().guest ? fbUser() : null); // real (e-mail) account
|
||||
const playerName = () => (fbUser() ? fbUser().name : accounts.current && !accounts.current.guest ? accounts.current.name : save ? save.robotName : '');
|
||||
// save slot: Firebase account -> robotclash.save.fb_<uid>, else local profile / guest
|
||||
// save slot: server account -> robotclash.save.fb_<uid>, else local profile / guest
|
||||
// Two completely separate games: the campaign (league, seasons) and online play (PvP).
|
||||
// Money, parts and robots never cross over - they simply live in different saves.
|
||||
// Opening the page always starts in online mode; the campaign keeps the old save key,
|
||||
@@ -489,7 +489,7 @@
|
||||
+ (gameMode === 'online' ? '.online' : '');
|
||||
function setMode(m) {
|
||||
const onlineOk = net && net.enabled && !LIVE.onlineOff;
|
||||
gameMode = onlineOk ? m : 'campaign'; // no Firebase or switched off: campaign only
|
||||
gameMode = onlineOk ? m : 'campaign'; // no server or switched off: campaign only
|
||||
document.body.dataset.gmode = gameMode;
|
||||
}
|
||||
function switchMode(m) {
|
||||
@@ -1912,7 +1912,7 @@
|
||||
if (LIVE.onlineOff && gameMode === 'online' && save) switchMode('campaign');
|
||||
if (mode === 'title') showTitle(); else if (mode === 'lobby') renderLobby();
|
||||
});
|
||||
if (DEV.get('live')) { // dev: &live=event|off|old|lock (no Firebase needed)
|
||||
if (DEV.get('live')) { // dev: &live=event|off|old|lock (no server needed)
|
||||
const k = DEV.get('live'), now = Date.now();
|
||||
const demo = {
|
||||
event: { event: { id: 'demo', name: { de: 'Schwergewichts-Wochenende', en: 'Heavyweight weekend' }, type: 'prize', prizeMul: 2, from: now - 1000, to: now + 36e5 } },
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
drives this pure logic, so the hard-to-test bit here is small and fully covered by tests.
|
||||
|
||||
Every client computes the SAME bracket from the same inputs (frozen player list + seed), so no
|
||||
server is needed to agree on who plays whom. Results come in over Firebase as a map
|
||||
server is needed to agree on who plays whom. Results come in from the server as a map
|
||||
results[round][pairIndex] = winnerUid; a bye (odd player out) advances on its own.
|
||||
|
||||
RC.LTourney.order(uids, seed) -> seeded slot order, padded with null byes to a power of two
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* Robot Clash - player accounts. v1: local profiles on this device (name + password, stored as a
|
||||
salted hash in localStorage - keeps siblings apart, no real security). Later the same interface
|
||||
gets a Firebase Auth backend (docs/firebase) without changing game.js.
|
||||
gets a server backend (server/auth.js) without changing game.js.
|
||||
|
||||
const acc = RC.Accounts('robotclash');
|
||||
acc.list() -> [{ id, name }]
|
||||
|
||||
Reference in New Issue
Block a user