X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=client%2Fsrc%2Fviews%2FHall.vue;h=24ec364fe276e16478d4d8271b7ebc5201bba1e6;hb=72ccbd6730241771e6ba86b6a5b62597b4c7e2f4;hp=60f62917226af3c9b2fa3c528e774c1ff25ce1d0;hpb=cd0d7743323309fcfd241ccba959df81a77970c7;p=vchess.git diff --git a/client/src/views/Hall.vue b/client/src/views/Hall.vue index 60f62917..24ec364f 100644 --- a/client/src/views/Hall.vue +++ b/client/src/views/Hall.vue @@ -8,7 +8,7 @@ main p(v-html="infoMessage") input#modalNewgame.modal(type="checkbox") div(role="dialog" aria-labelledby="titleFenedit") - .card.smallpad + .card.smallpad(@keyup.enter="newChallenge") label#closeNewgame.modal-close(for="modalNewgame") fieldset label(for="selectVariant") {{ st.tr["Variant"] }} @@ -26,8 +26,8 @@ main input#inputFen(type="text" v-model="newchallenge.fen") button(@click="newChallenge") {{ st.tr["Send challenge"] }} .row - .col-sm-12.col-md-10.col-md-offset-1.col-lg-8.col-lg-offset-2 - button(onClick="doClick('modalNewgame')") New game + .col-sm-12 + button#newGame(onClick="doClick('modalNewgame')") New game .row .col-sm-12.col-md-10.col-md-offset-1.col-lg-8.col-lg-offset-2 .collapse @@ -54,7 +54,7 @@ main ) | {{ p.name + (!!p.count ? " ("+p.count+")" : "") }} #chat(v-show="pdisplay=='chat'") - h3 Chat (TODO) + Chat(:players="[]") input#gameSection(type="radio" aria-hidden="true" name="accordion") label(for="gameSection" aria-hidden="true") Games div @@ -73,12 +73,14 @@ import { checkChallenge } from "@/data/challengeCheck"; import { ArrayFun } from "@/utils/array"; import { ajax } from "@/utils/ajax"; import { getRandString, shuffle } from "@/utils/alea"; +import Chat from "@/components/Chat.vue"; import GameList from "@/components/GameList.vue"; import ChallengeList from "@/components/ChallengeList.vue"; import { GameStorage } from "@/utils/gameStorage"; export default { name: "my-hall", components: { + Chat, GameList, ChallengeList, }, @@ -221,11 +223,7 @@ export default { // ==> Moves sent by connected remote player(s) if live game let url = "/game/" + g.id; if (g.type == "live") - { - const remotes = g.players.filter(p => this.people.some(pl => pl.sid == p.sid)); - const rIdx = (remotes.length == 1 ? 0 : Math.floor(Math.random()*2)); - url += "?rid=" + remotes[rIdx].sid; - } + url += "?rid=" + g.rid; this.$router.push(url); }, getVname: function(vid) { @@ -276,6 +274,9 @@ export default { const data = JSON.parse(msg.data); switch (data.code) { + case "duplicate": + alert("Warning: duplicate 'offline' connection"); + break; // 0.2] Receive clients list (just socket IDs) case "pollclients": { @@ -595,5 +596,11 @@ export default {