Commit 536e1ea7 authored by nanahira's avatar nanahira

add getInfo

parent 7f1d5d6d
...@@ -1875,14 +1875,20 @@ export class Room { ...@@ -1875,14 +1875,20 @@ export class Room {
watcherCount: this.watchers.size, watcherCount: this.watchers.size,
players: this.playingPlayers.map((p) => ({ players: this.playingPlayers.map((p) => ({
...pick(p, ['name', 'pos', 'ip']), ...pick(p, ['name', 'pos', 'ip']),
deck: p.deck?.toYGOMobileDeckURL(), deck: p.deck?.toYdkeURL(),
startDeck: p.startDeck?.toYGOMobileDeckURL(),
lp: fieldInfo?.[this.getIngameDuelPos(p)]?.lp, lp: fieldInfo?.[this.getIngameDuelPos(p)]?.lp,
cardCount: fieldInfo?.[this.getIngameDuelPos(p)]?.cardCount, cardCount: fieldInfo?.[this.getIngameDuelPos(p)]?.cardCount,
})), })),
duels: this.duelRecords.map((d) => ({ duels: this.duelRecords.map((d) => {
...pick(d, ['startTime', 'endTime']) 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