lobby list
This commit is contained in:
@@ -108,7 +108,7 @@ function Cryp(props) {
|
||||
|
||||
function InstanceComponent(args) {
|
||||
const {
|
||||
// account,
|
||||
account,
|
||||
instance,
|
||||
quit,
|
||||
// clearInfo,
|
||||
@@ -123,7 +123,9 @@ function InstanceComponent(args) {
|
||||
|
||||
if (!instance) return <div>...</div>;
|
||||
|
||||
const cryps = instance.cryps.map((c, i) => Cryp({
|
||||
const player = instance.players.find(p => p.account === account.id);
|
||||
|
||||
const cryps = player.cryps.map((c, i) => Cryp({
|
||||
cryp: c, sendVboxApply, setInfo, activeVar, setActiveCryp,
|
||||
}));
|
||||
|
||||
@@ -134,7 +136,7 @@ function InstanceComponent(args) {
|
||||
}
|
||||
|
||||
function showTeam(e) {
|
||||
setActiveCryp(instance.cryps[0]);
|
||||
setActiveCryp(player.cryps[0]);
|
||||
e.stopPropagation();
|
||||
}
|
||||
|
||||
|
||||
@@ -9,11 +9,11 @@ const addState = connect(
|
||||
const { ws, instance, account, activeVar, activeCryp } = state;
|
||||
|
||||
function sendInstanceReady() {
|
||||
return ws.sendInstanceReady(instance.instance);
|
||||
return ws.sendInstanceReady(instance.id);
|
||||
}
|
||||
|
||||
function sendVboxApply(crypId, i) {
|
||||
return ws.sendVboxApply(instance.instance, crypId, i);
|
||||
return ws.sendVboxApply(instance.id, crypId, i);
|
||||
}
|
||||
|
||||
return { instance, account, sendInstanceReady, sendVboxApply, activeVar, activeCryp };
|
||||
|
||||
@@ -21,7 +21,8 @@ function Vbox(args) {
|
||||
const {
|
||||
activeVar,
|
||||
activeCryp,
|
||||
instance,
|
||||
player,
|
||||
// instance,
|
||||
combiner,
|
||||
reclaiming,
|
||||
sendVboxAccept,
|
||||
@@ -34,8 +35,8 @@ function Vbox(args) {
|
||||
setInfo,
|
||||
} = args;
|
||||
|
||||
const { vbox } = instance;
|
||||
if (!instance.vbox) return false;
|
||||
if (!player) return false;
|
||||
const { vbox } = player;
|
||||
|
||||
//
|
||||
// VBOX
|
||||
|
||||
@@ -9,6 +9,7 @@ const addState = connect(
|
||||
const {
|
||||
ws,
|
||||
instance,
|
||||
player,
|
||||
combiner,
|
||||
reclaiming,
|
||||
activeVar,
|
||||
@@ -17,23 +18,24 @@ const addState = connect(
|
||||
} = state;
|
||||
|
||||
function sendVboxDiscard() {
|
||||
return ws.sendVboxDiscard(instance.instance);
|
||||
return ws.sendVboxDiscard(instance.id);
|
||||
}
|
||||
|
||||
function sendVboxAccept(group, index) {
|
||||
return ws.sendVboxAccept(instance.instance, group, index);
|
||||
return ws.sendVboxAccept(instance.id, group, index);
|
||||
}
|
||||
|
||||
function sendVboxCombine() {
|
||||
return ws.sendVboxCombine(instance.instance, combiner);
|
||||
return ws.sendVboxCombine(instance.id, combiner);
|
||||
}
|
||||
|
||||
function sendVboxReclaim(i) {
|
||||
return ws.sendVboxReclaim(instance.instance, i);
|
||||
return ws.sendVboxReclaim(instance.id, i);
|
||||
}
|
||||
|
||||
return {
|
||||
instance,
|
||||
player,
|
||||
combiner,
|
||||
reclaiming,
|
||||
activeVar,
|
||||
|
||||
Reference in New Issue
Block a user