From 2f4944db1002e1214db83eefb112a7b04a3eb4ef Mon Sep 17 00:00:00 2001 From: ntr Date: Thu, 25 Apr 2019 15:31:57 +1000 Subject: [PATCH] instance lists --- client/src/components/menu.component.jsx | 9 +++---- client/src/components/menu.container.jsx | 5 ++-- client/src/socket.jsx | 14 +++++----- phaser-client/src/scenes/home.js | 2 +- phaser-client/src/socket.js | 14 +++++----- server/src/account.rs | 19 +++++++++----- server/src/instance.rs | 33 +++++++++++++++++++----- server/src/rpc.rs | 12 ++++----- 8 files changed, 67 insertions(+), 41 deletions(-) diff --git a/client/src/components/menu.component.jsx b/client/src/components/menu.component.jsx index 03dd167f..c83b9d62 100644 --- a/client/src/components/menu.component.jsx +++ b/client/src/components/menu.component.jsx @@ -17,6 +17,7 @@ const COLOURS = [ function Menu(args) { const { + account, cryps, selectedCryps, setSelectedCryps, @@ -31,14 +32,12 @@ function Menu(args) { if (!instances) return
...
; const instancePanels = instances.map(instance => { - const globalInstance = instance.instance === NULL_UUID; - const name = globalInstance - ? 'Global Matchmaking' - : `${instance.instance.substring(0, 5)} | ${instance.score.wins} : ${instance.score.losses}`; + const player = instance.players.find(p => p.account === account.id); + const name = `${instance.name} | ${player.score.wins} : ${player.score.losses}`; return (