diff --git a/client/public/favicon.ico b/client/public/favicon.ico new file mode 100644 index 0000000..7f4ba56 Binary files /dev/null and b/client/public/favicon.ico differ diff --git a/client/public/scrabble/network.js b/client/public/scrabble/network.js index 2d210b8..d78410d 100644 --- a/client/public/scrabble/network.js +++ b/client/public/scrabble/network.js @@ -116,8 +116,8 @@ function onGameBegin(socket, args) return; } - + } diff --git a/server/src/game-logic.js b/server/src/game-logic.js index 17e6256..83b37c5 100644 --- a/server/src/game-logic.js +++ b/server/src/game-logic.js @@ -7,23 +7,58 @@ const Helpers = require('./helpers.js'); /* GAME OBJECT { - // reference UID + // Reference UID (of lobby) uid: uid, locale: en, players: [{ uid: uid, name: username, activetiles: [tile: { - tile: tile, + letter: letter, score: int }], score: int }], - // index of players whos turn it is + // Index of players whos turn it is turn: int, + // Array of GAMESTATEs, latest at head of array + gamestates: [], tilebag: [], tileset: [] } +GAMESTATE OBJECT +{ + // UID of the player that played the turn + playeruid: uid, + turn: int, + // Generated after turn is processed + outcome: { + valid: bool, + points: pointsgained, + words: [{ + word: word, + points: points, + tiles: [{ + pos: {x: x, y: y}, + modifier: modifier, + letter: letter, + score: int + }] + }], + } + oldboardtiles: [{ + pos: {x: x, y: y}, + modifier: modifier, + letter: letter, + score: int + }] + boardtiles: [{ + pos: {x: x, y: y}, + modifier: modifier, + letter: letter, + score: int + }] +} NOTES - The locale is the language of the *owner of the lobby*, the dictionary will reflect this language choice @@ -31,6 +66,7 @@ NOTES score thing in letter-distributions.js TILEBAG is not to be confused with tileset as those are active game tiles and are modified as turns are played + - A GAMESTATE refers to a turn */ let ActiveGames = []; @@ -88,7 +124,7 @@ NOTES returning an error or a validation object including the next players turn */ -function PlayTurn(game, turn) +function PlayTurn(gameuid, playeruid, newstate) { } diff --git a/server/src/letter-distributions.js b/server/src/letter-distributions.js index e34c919..54b9a09 100644 --- a/server/src/letter-distributions.js +++ b/server/src/letter-distributions.js @@ -15,10 +15,11 @@ DISTRIBUTIONS OBJECT ... ] } +NOTES + - TODO: JSON-ise it */ let Distributions = []; - Distributions['en'] = { tileset: ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'], blanktiles: 2,