koishi-plugin-ggcevo-game 1.0.27 → 1.1.0

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 +3 -2
  2. package/package.json +1 -1
package/lib/index.js CHANGED
@@ -1544,11 +1544,12 @@ ${achievementList.join("\n")}`;
1544
1544
  const nowChina = convertUTCtoChinaTime(/* @__PURE__ */ new Date());
1545
1545
  const todayStart = new Date(nowChina);
1546
1546
  todayStart.setUTCHours(0, 0, 0, 0);
1547
+ const adjustedTime = new Date(todayStart.getTime() - 8 * 60 * 60 * 1e3);
1547
1548
  if (config.sameOpponentLimit) {
1548
1549
  const sameOpponentCount = await ctx.database.select("ggcevo_pk_logs").where({
1549
1550
  initiator_handle: initiatorHandle,
1550
1551
  target_handle: targetHandle,
1551
- date: { $gte: todayStart }
1552
+ date: { $gte: adjustedTime }
1552
1553
  }).execute((row) => import_koishi.$.count(row.id));
1553
1554
  if (sameOpponentCount > 0) {
1554
1555
  return "您今天已经挑战过该玩家,请明天再试";
@@ -1557,7 +1558,7 @@ ${achievementList.join("\n")}`;
1557
1558
  if (config.maxDailyBeChallenged > 0) {
1558
1559
  const beChallengedCount = await ctx.database.select("ggcevo_pk_logs").where({
1559
1560
  target_handle: targetHandle,
1560
- date: { $gte: todayStart }
1561
+ date: { $gte: adjustedTime }
1561
1562
  }).execute((row) => import_koishi.$.count(row.id));
1562
1563
  if (beChallengedCount >= config.maxDailyBeChallenged) {
1563
1564
  return `该玩家今日已被挑战太多次(最多${config.maxDailyBeChallenged}次)`;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "koishi-plugin-ggcevo-game",
3
3
  "description": "星际争霸2游戏大厅咕咕虫-Evo地图专属插件",
4
- "version": "1.0.27",
4
+ "version": "1.1.0",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
7
7
  "files": [