goodddnight (a normalish sleep schedule what)

This commit is contained in:
Ben Kyd
2021-04-13 00:36:32 +01:00
parent 7aee6f02a2
commit 2682c5d680
3 changed files with 16 additions and 9 deletions

View File

@@ -14,7 +14,7 @@ https://www.scrabble3d.info/t2342f139-Default-rules.html
If the scope allowed for it, every function would be (reasonably) unit tested. If the scope allowed for it, every function would be (reasonably) unit tested.
The solution to locale-ise language in HTML is extremely naive and there are a lot better ways to do it, i did what i could in the time without a full refractor and SSR. The solution to locale-ise language in HTML is extremely naive and there are a lot better ways to do it, i did what i could in the time without a full refractor and SSR.
However it is not at much detriment of readability and maintainability of the code so i diddn't deem it neccesary. However it is not at much detriment of readability and maintainability of the code so i didn't deem it neccesary.
The locales are stored in different language files so it is easier for people to contribute and thus more maintanable. The locales are stored in different language files so it is easier for people to contribute and thus more maintanable.

View File

@@ -1,10 +1,19 @@
const Logger = require('./logger.js');
const Registrar = require('./game-registrar.js');
const Lobbies = require('./lobbies.js');
/* /*
GAME OBJECT GAME OBJECT
{ {
// reference UID
locale lobbyuid: uid,
locale: en,
players: [{uid, activetiles, score}],
// index of players
turn: int,
// TODO: vvv
turnstate:
tilebag: []
} }
NOTES NOTES
- The locale is the language of the *owner of the lobby*, the dictionary - The locale is the language of the *owner of the lobby*, the dictionary
@@ -12,14 +21,13 @@ NOTES
*/ */
let ActiveGames = []; let ActiveGames = [];
function StartGame()
function StartGame(lobby)
{ {
} }
module.exports = { module.exports = {
StartGame: StartGame, StartGame: StartGame,
} }

View File

@@ -1,6 +1,5 @@
const Logger = require('./logger.js'); const Logger = require('./logger.js');
const Registrar = require('./game-registrar.js'); const Registrar = require('./game-registrar.js');
const { GetUserByUID } = require('./game-registrar.js');
/* /*
LOBBY OBJECT LOBBY OBJECT
@@ -186,7 +185,7 @@ function UserReady(useruid, callback)
if (Lobbies[lobbyuid].players[player].uid === useruid) if (Lobbies[lobbyuid].players[player].uid === useruid)
Lobbies[lobbyuid].players[player].ready = true; Lobbies[lobbyuid].players[player].ready = true;
callback(GetUserByUID(useruid), GetLobbyByUserUID(useruid), 'user-ready'); callback(Registrar.GetUserByUID(useruid), GetLobbyByUserUID(useruid), 'user-ready');
return true; return true;
} }