@hieuzest/koishi-plugin-mahjongpub 0.2.9 → 0.2.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/lib/index.js +5 -1
  2. package/package.json +2 -2
package/lib/index.js CHANGED
@@ -357,7 +357,7 @@ var ContestExtra = class {
357
357
  };
358
358
  function getRowPlayer(contest, team, rowi) {
359
359
  const roleList = contest.t_type.split(/\s+/);
360
- const roleSet = new Set(roleList).values().toArray();
360
+ const roleSet = [...new Set(roleList).values()];
361
361
  const index = roleSet.indexOf(roleList[rowi]);
362
362
  return team.players[index]?.split("##", 1)[0];
363
363
  }
@@ -468,6 +468,10 @@ var ContestManager = class {
468
468
  return;
469
469
  }
470
470
  const rowi = lastRecord ? lastRecord.rowi + 1 : 0;
471
+ if (rowi >= contest.t_type.split(/\s+/).filter((x) => x).length) {
472
+ cextra.broadcast(`[${tag}] 已经全部完成`);
473
+ return;
474
+ }
471
475
  const round = Object.values(rounds).find((x) => x.round === (cextra.round ?? contest.c_round) && x.t_class === cls);
472
476
  const players = round.tids.map((tid) => getRowPlayer(contest, teams[tid], rowi));
473
477
  if (!players.every((x) => x)) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@hieuzest/koishi-plugin-mahjongpub",
3
3
  "description": "Mahjong.pub API",
4
- "version": "0.2.9",
4
+ "version": "0.2.11",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
7
7
  "files": [
@@ -15,8 +15,8 @@
15
15
  "plugin"
16
16
  ],
17
17
  "peerDependencies": {
18
- "@hieuzest/koishi-plugin-riichi-city": "^0.5.2",
19
18
  "@hieuzest/koishi-plugin-majsoul-dhs": "^2.5.0",
19
+ "@hieuzest/koishi-plugin-riichi-city": "^0.5.2",
20
20
  "koishi": "^4.17.1"
21
21
  },
22
22
  "dependencies": {