Commit 536e1ea7 authored by nanahira's avatar nanahira

add getInfo

parent 7f1d5d6d
......@@ -1875,14 +1875,20 @@ export class Room {
watcherCount: this.watchers.size,
players: this.playingPlayers.map((p) => ({
...pick(p, ['name', 'pos', 'ip']),
deck: p.deck?.toYGOMobileDeckURL(),
startDeck: p.startDeck?.toYGOMobileDeckURL(),
deck: p.deck?.toYdkeURL(),
lp: fieldInfo?.[this.getIngameDuelPos(p)]?.lp,
cardCount: fieldInfo?.[this.getIngameDuelPos(p)]?.cardCount,
})),
duels: this.duelRecords.map((d) => ({
...pick(d, ['startTime', 'endTime'])
})),
duels: this.duelRecords.map((d) => {
const firstPos = d.isSwapped ? 1 : 0;
return {
...pick(d, ['startTime', 'endTime', 'winPosition']),
players: d.players.map((p, i) => ({
deck: p.deck.toYdkeURL(),
isFirst: this.getDuelPos(i) === firstPos,
})),
};
}),
};
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment