koishi-plugin-ggcevo-game 0.4.7 → 0.4.8

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.
package/lib/index.d.ts CHANGED
@@ -66,6 +66,7 @@ export interface rank {
66
66
  name: string;
67
67
  rank: number;
68
68
  matches: number;
69
+ Blacklist: boolean;
69
70
  }
70
71
  export interface Punishment {
71
72
  id: number;
package/lib/index.js CHANGED
@@ -96,8 +96,13 @@ function apply(ctx, config) {
96
96
  // 玩家名称
97
97
  rank: "integer",
98
98
  // rank分数(带正负)
99
- matches: "unsigned"
99
+ matches: "unsigned",
100
100
  // 比赛次数
101
+ Blacklist: {
102
+ type: "boolean",
103
+ // 该字段的默认值
104
+ initial: false
105
+ }
101
106
  }, {
102
107
  primary: ["regionId", "realmId", "profileId"]
103
108
  // 复合主键
@@ -823,8 +828,8 @@ ID:${activity.id}
823
828
  if (pageNum < 1) return "请输入有效的页码。";
824
829
  const offset = (pageNum - 1) * 10;
825
830
  const [records, total] = await Promise.all([
826
- ctx.database.select("ggcevo_rank").orderBy("rank", "desc").limit(10).offset(offset).execute(),
827
- ctx.database.select("ggcevo_rank").execute((row) => import_koishi.$.count(row.profileId))
831
+ ctx.database.select("ggcevo_rank").where({ Blacklist: false }).orderBy("rank", "desc").limit(10).offset(offset).execute(),
832
+ ctx.database.select("ggcevo_rank").where({ Blacklist: false }).execute((row) => import_koishi.$.count(row.profileId))
828
833
  ]);
829
834
  const pageSize = 10;
830
835
  const totalPages = Math.ceil(total / pageSize);
@@ -861,7 +866,8 @@ ID:${activity.id}
861
866
  profileId
862
867
  });
863
868
  if (!user) return "未找到您的排名信息。";
864
- const allRanks = await ctx.database.select("ggcevo_rank").orderBy("rank", "desc").execute();
869
+ if (user.Blacklist) return "您已经被禁止参加胜点榜。";
870
+ const allRanks = await ctx.database.select("ggcevo_rank").where({ Blacklist: false }).orderBy("rank", "desc").execute();
865
871
  const userRank = allRanks.findIndex(
866
872
  (u) => u.regionId === regionId && u.realmId === realmId && u.profileId === profileId
867
873
  ) + 1;
@@ -893,7 +899,8 @@ ID:${activity.id}
893
899
  profileId
894
900
  });
895
901
  if (!user) return "未找到他/她的排名信息。";
896
- const allRanks = await ctx.database.select("ggcevo_rank").orderBy("rank", "desc").execute();
902
+ if (user.Blacklist) return "他/她已经被禁止参加胜点榜。";
903
+ const allRanks = await ctx.database.select("ggcevo_rank").where({ Blacklist: false }).orderBy("rank", "desc").execute();
897
904
  const userRank = allRanks.findIndex(
898
905
  (u) => u.regionId === regionId && u.realmId === realmId && u.profileId === profileId
899
906
  ) + 1;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "koishi-plugin-ggcevo-game",
3
3
  "description": "星际争霸2游戏大厅咕咕虫-Evo地图专属插件",
4
- "version": "0.4.7",
4
+ "version": "0.4.8",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
7
7
  "files": [