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 +1 -0
- package/lib/index.js +12 -5
- package/package.json +1 -1
package/lib/index.d.ts
CHANGED
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
|
-
|
|
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
|
-
|
|
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;
|