From: Benjamin Auder <benjamin.auder@somewhere> Date: Tue, 3 Nov 2020 23:30:35 +0000 (+0100) Subject: Rollback: will not implement a simultaneous games mode X-Git-Url: https://git.auder.net/variants/Apocalypse/scripts/current/pieces/doc/mini-custom.min.css?a=commitdiff_plain;h=50330595f8a3055e0d568289e60c16402a15d320;p=vchess.git Rollback: will not implement a simultaneous games mode --- diff --git a/client/src/components/ChallengeList.vue b/client/src/components/ChallengeList.vue index 5c582631..1107b58c 100644 --- a/client/src/components/ChallengeList.vue +++ b/client/src/components/ChallengeList.vue @@ -15,7 +15,7 @@ div ) td {{ c.vname }} td {{ withWho(c) }} - td(:class="getCadenceClass(c)") {{ c.cadence }} + td {{ c.cadence }} td(:class="getRandomnessClass(c)") p(v-else) | {{ st.tr["No challenges found :( Click on 'New game'!"] }} @@ -66,11 +66,6 @@ export default { return { ["random-" + c.randomness]: true }; - }, - getCadenceClass: function(c) { - return { - "simultaneous": c.cadence.indexOf("/") >= 0 - }; } } }; @@ -87,9 +82,6 @@ tr.fromyou > td tr.toyou > td background-color: #fcd785 -td.simultaneous - background-color: purple - tr > td:last-child &.random-0 background-color: #FF5733 diff --git a/client/src/views/Game.vue b/client/src/views/Game.vue index 6570cb78..9094309b 100644 --- a/client/src/views/Game.vue +++ b/client/src/views/Game.vue @@ -179,15 +179,6 @@ main </template> <script> -// TODO: this will be a component instead ? -// If simultaneous games, no "rematch" button - -// simult : open connexion to rooms from list, in all (if I'm the "simultaneer" --> TODO: indicate sid + side [random,white, black] in challenge) -// if I'm just one of the players (one game), just one game. -// view "Game_s", with pug list of components Game. -// generally only one element, unless I'm the simultaneer. -// Add messages ? - import BaseGame from "@/components/BaseGame.vue"; import UserBio from "@/components/UserBio.vue"; import Chat from "@/components/Chat.vue"; @@ -531,11 +522,7 @@ export default { }, getGameType: function(game) { if (!!game.id.toString().match(/^i/)) return "import"; - return ( - game.cadence.indexOf("d") >= 0 - ? "corr" - : (game.cadence.indexOf("/") >= 0 ? "simul" : "live") - ); + return (game.cadence.indexOf("d") >= 0 ? "corr" : "live"); }, // Notify something after a new move (to opponent and me on MyGames page) notifyMyGames: function(thing, data) { @@ -764,9 +751,9 @@ export default { case "newmove": { // DEBUG: -console.log("Receive move"); -console.log(data.data); -//moveslist not updated when receiving a move? (see in baseGame) +//console.log("Receive move"); +//console.log(data.data); +//moveslist not updated when receiving a move? (see in BaseGame) const movePlus = data.data; const movesCount = this.game.moves.length; diff --git a/client/src/views/Hall.vue b/client/src/views/Hall.vue index 0e4d574b..0b3bb4ef 100644 --- a/client/src/views/Hall.vue +++ b/client/src/views/Hall.vue @@ -563,11 +563,7 @@ export default { // o: challenge or game classifyObject: function(o) { // No imported games here - return ( - o.cadence.indexOf("d") >= 0 - ? "corr" - : (o.cadence.indexOf("/") >= 0 ? "simul" : "live") - ); + return (o.cadence.indexOf("d") >= 0 ? "corr" : "live"); }, setDisplay: function(letter, type, e) { this[letter + "display"] = type; @@ -857,10 +853,6 @@ export default { } break; } - case "entersimul": - // TODO: confirm box accept/refuse. - // If accept, update seat (array in this case) - break; case "game": // Individual request case "newgame": { const game = data.data; @@ -1225,13 +1217,6 @@ export default { alert(this.st.tr["Please log in to accept corr challenges"]); return; } - if (c.type == "simul") { - // Just notify that I wanna enter the simultaneous game(s) - // TODO: dans défi, indiquer si positions aleatoires, si tjours blancs ou noirs - // --> /w30 ou b1h ou juste 30 (random, sans préfixe). - // => message "entersimul" to c.from - return; - } else { c.accepted = true; await import("@/variants/" + c.vname + ".js") @@ -1262,19 +1247,12 @@ export default { { data: { id: c.id } } ); } - else if (c.type == "simul" && !!c.seat && Array.isArray(c.seat)) - // TODO: if some players entered, start game - this.launchSimultaneous(c); this.send("deletechallenge_s", { data: { cid: c.id } }); } // In all cases, the challenge is consumed: ArrayFun.remove(this.challenges, ch => ch.id == c.id); }, // NOTE: when launching game, the challenge is already being deleted - // TODO: adapt for simultaneous games, or just write a new function (better) - launchSimultaneous: function(c) { - // TODO - }, launchGame: function(c) { // White player index 0, black player index 1: let players =