Explorar el Código

fix: 修复事件数据概率和用户数据处理,更新依赖版本

- 修正 `GroupEventData.json` 中的事件触发概率。
- 清空 `GroupWorldData.json` 中的 `userData` 字段。
- 更新 `bilibiliData.json` 中的数据。
- 更新 `pnpm-lock.yaml` 中的依赖版本。
- 将 `Puppeteer.ts` 中的无头模式设为 `false`。
- 在 `economy.ts` 和 `interface/economy.ts` 中添加 `events` 字段。
- 移除调试文件中的敏感数据。
枫林 hace 1 mes
padre
commit
c8b40fccf9

+ 3 - 0
.gitignore

@@ -91,3 +91,6 @@ src/plugins/*
 
 /src/plugins/mc.ts
 /src/config/mc.yml
+botQQ_screenshots/GroupEventData.json
+botQQ_screenshots/GroupWorldData.json
+botQQ_screenshots/bilibiliData.json

+ 1 - 1
botQQ_screenshots/GroupEventData.json

@@ -1 +1 @@
-{"638236452":{"f0dd89d1-b2ac-43a8-b929-75e7521f8ab3":{"eventContent":"小雪触犯了圣旨被贬下凡间!禁言5分钟","eventRewardType":"禁言","param":"","eventRewardNum":5,"probability":0.006}},"773847213":{"0c835593-4d1b-4f42-8f7d-c15d894524ca":{"eventContent":"红磷偷偷努力写代码,偷偷奋斗!获得100金币","eventRewardType":"金币","param":"","eventRewardNum":10,"probability":0.006},"ed257a67-dba7-4452-848a-4a48006e7ed3":{"eventContent":"枫林删库导致老板变成鼻血喷射战士,奖励100元","eventRewardType":"金币","param":"8","eventRewardNum":100,"probability":0.003},"b232304c-43c2-4d8e-8005-912c0dc4b04f":{"eventContent":"枫林强夺小孩子棒棒糖,被孩子家长暴打,奖励300元","eventRewardType":"金币","param":"","eventRewardNum":300,"probability":0.008},"0766de73-c31b-40e0-8566-d1bacb6b5949":{"eventContent":"枫林扶老奶奶过马路将老奶奶带到火葬场,奖励10元","eventRewardType":"金币","param":"","eventRewardNum":10,"probability":0.008},"9b473ac5-8b9f-49af-a650-acab46582ef9":{"eventContent":"枫林干了太多缺德事被评为缺德之星,奖励100元","eventRewardType":"金币","param":"","eventRewardNum":100,"probability":0.008}},"":{"":{"param":"","eventRewardNum":1,"probability":0.3}}}
+{"638236452":{"f0dd89d1-b2ac-43a8-b929-75e7521f8ab3":{"eventContent":"小雪触犯了圣旨被贬下凡间!禁言5分钟","eventRewardType":"禁言","param":"","eventRewardNum":5,"probability":0.00006}},"773847213":{"0c835593-4d1b-4f42-8f7d-c15d894524ca":{"eventContent":"红磷偷偷努力写代码,偷偷奋斗!获得100金币","eventRewardType":"金币","param":"","eventRewardNum":10,"probability":0.006},"ed257a67-dba7-4452-848a-4a48006e7ed3":{"eventContent":"枫林删库导致老板变成鼻血喷射战士,奖励100元","eventRewardType":"金币","param":"8","eventRewardNum":100,"probability":0.003},"b232304c-43c2-4d8e-8005-912c0dc4b04f":{"eventContent":"枫林强夺小孩子棒棒糖,被孩子家长暴打,奖励300元","eventRewardType":"金币","param":"","eventRewardNum":300,"probability":0.008},"0766de73-c31b-40e0-8566-d1bacb6b5949":{"eventContent":"枫林扶老奶奶过马路将老奶奶带到火葬场,奖励10元","eventRewardType":"金币","param":"","eventRewardNum":10,"probability":0.008},"9b473ac5-8b9f-49af-a650-acab46582ef9":{"eventContent":"枫林干了太多缺德事被评为缺德之星,奖励100元","eventRewardType":"金币","param":"","eventRewardNum":100,"probability":0.008},"bf11f771-b944-4c62-8f53-000686afef6d":{"eventContent":"红磷挂彩票中奖了,奖励一张事件卡","eventRewardType":"道具","param":"eventCard","eventRewardNum":1,"probability":0.008},"08023a16-000c-4b72-909e-fe4c88c0be01":{"eventContent":"红磷打游戏困了,禁言1分钟","eventRewardType":"禁言","param":"","eventRewardNum":1,"probability":0.01}},"":{"":{"param":"","eventRewardNum":1,"probability":0.3}}}

+ 1 - 1
botQQ_screenshots/GroupWorldData.json

@@ -1 +1 @@
-{"638236452":{"worldData":["雪推个小妹","狗群主","gqz","√群主","群主","qz","🐶","🐶柚子","苟柚子"],"createtime":1752389067048,"updatetime":1752404552990,"userData":["2941718631:0.2","2941718631:0.6","2941718631:0.3"]},"":{"worldData":"","createtime":1752388877325,"updatetime":1752413814717}}
+{"638236452":{"worldData":["雪推个小妹","狗群主","gqz","√群主","群主","qz","🐶","🐶柚子","苟柚子"],"createtime":1752389067048,"updatetime":1752404552990,"userData":[]},"":{"worldData":"","createtime":1752388877325,"updatetime":1753081335343}}

+ 1 - 1
botQQ_screenshots/bilibiliData.json

@@ -1 +1 @@
-{"2180323481":{"bilibiliData":{"bili_jct":"dd824efa742a8dbc536875da592c48a9","SESSDATA":"48b568e6%2C1767151027%2C2a0e6%2A72CjBF4lmo9_M4rfAycCE9-8l6Wup4xX9WG10rXRpvUgvm3jAmeihZH5xXXlikN6tpaQsSVkt1VmEyLVE4UERVQjNTb3o1ODFBYS1nOFlCUmNndS1TeDJVRjg1UVRCT01KUDYyVkFORGZkaWVyWHZqZlZONUFCY1JpRHliU3RpbjV6bHdWdExKSGRBIIEC","DedeUserID":"156627564"},"createtime":1751623140913,"updatetime":1751623140913}}
+{"2180323481":{"bilibiliData":{"bili_jct":"bcd934db04ff7c0406b6e1855694a146","SESSDATA":"5043a2b4%2C1768459389%2C1ab35%2A72CjBlgusHSpvQm1app9OjgfkZiEW74fmn_D2xgWv5RA450iou0LNwaPLD59RiKvK-0uwSVm81T0s5M1FfNTdhNURHeUtLU2JabGdlYmhmUW92TDNKNllURVNtYVh6bVQta08ySmxaM2hndHN6WkY0VUhhcHZJV1cybjByREdveENMc1hRZUVwNlNRIIEC","DedeUserID":"156627564"},"createtime":1752908010065,"updatetime":1752908010065}}

+ 0 - 1
botQQ_screenshots/mcData.json

@@ -1 +0,0 @@
-{}

+ 40 - 12
pnpm-lock.yaml

@@ -31,10 +31,10 @@ importers:
         version: 3.0.3
       node-napcat-ts:
         specifier: ^0.4.0
-        version: 0.4.11
+        version: 0.4.11(bufferutil@4.0.9)(utf-8-validate@5.0.10)
       puppeteer:
         specifier: ^23.9.0
-        version: 23.11.1(typescript@4.9.5)
+        version: 23.11.1(bufferutil@4.0.9)(typescript@4.9.5)(utf-8-validate@5.0.10)
       rcon-client:
         specifier: ^4.2.5
         version: 4.2.5
@@ -422,6 +422,10 @@ packages:
   buffer@6.0.3:
     resolution: {integrity: sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==}
 
+  bufferutil@4.0.9:
+    resolution: {integrity: sha512-WDtdLmJvAuNNPzByAYpRo2rF1Mmradw6gvWsQKf63476DDXmomT9zUiGypLcG4ibIM67vhAj8jJRdbmEws2Aqw==}
+    engines: {node: '>=6.14.2'}
+
   call-bind-apply-helpers@1.0.2:
     resolution: {integrity: sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==}
     engines: {node: '>= 0.4'}
@@ -921,6 +925,10 @@ packages:
       encoding:
         optional: true
 
+  node-gyp-build@4.8.4:
+    resolution: {integrity: sha512-LA4ZjwlnUblHVgq0oBF3Jl/6h/Nvs5fzBLwdEF4nuxnFdsfajde4WfxtJr3CaiH+F6ewcIB/q4jQ4UzPyid+CQ==}
+    hasBin: true
+
   node-napcat-ts@0.4.11:
     resolution: {integrity: sha512-T2l8NeDhWr/UOqVKCDnBOWxVZvncNMRyEQExOgqRzJoQkGJFqiBWiW/xIRlye7d5en2bWdIFvWoyR+Vv/As6LA==}
 
@@ -1270,6 +1278,10 @@ packages:
   upper-case@1.1.3:
     resolution: {integrity: sha512-WRbjgmYzgXkCV7zNVpy5YgrHgbBv126rMALQQMrmzOVC4GM2waQ9x7xtm8VU+1yF2kWyPzI9zbZ48n4vSxwfSA==}
 
+  utf-8-validate@5.0.10:
+    resolution: {integrity: sha512-Z6czzLq4u8fPOyx7TU6X3dvUZVvoJmxSQ+IcrlmagKhilxlhZgxPK6C5Jqbkw1IDUmFTM+cz9QDnnLTwDz/2gQ==}
+    engines: {node: '>=6.14.2'}
+
   utif2@4.1.0:
     resolution: {integrity: sha512-+oknB9FHrJ7oW7A2WZYajOcv4FcDR4CfoGB0dPNfxbi4GO05RRnFmt5oa23+9w32EanrYcSJWspUiJkLMs+37w==}
 
@@ -1783,6 +1795,11 @@ snapshots:
       base64-js: 1.5.1
       ieee754: 1.2.1
 
+  bufferutil@4.0.9:
+    dependencies:
+      node-gyp-build: 4.8.4
+    optional: true
+
   call-bind-apply-helpers@1.0.2:
     dependencies:
       es-errors: 1.3.0
@@ -2150,9 +2167,9 @@ snapshots:
 
   is-url@1.2.4: {}
 
-  isomorphic-ws@5.0.0(ws@8.18.2):
+  isomorphic-ws@5.0.0(ws@8.18.2(bufferutil@4.0.9)(utf-8-validate@5.0.10)):
     dependencies:
-      ws: 8.18.2
+      ws: 8.18.2(bufferutil@4.0.9)(utf-8-validate@5.0.10)
 
   jimp@1.6.0:
     dependencies:
@@ -2268,11 +2285,14 @@ snapshots:
     dependencies:
       whatwg-url: 5.0.0
 
-  node-napcat-ts@0.4.11:
+  node-gyp-build@4.8.4:
+    optional: true
+
+  node-napcat-ts@0.4.11(bufferutil@4.0.9)(utf-8-validate@5.0.10):
     dependencies:
-      isomorphic-ws: 5.0.0(ws@8.18.2)
+      isomorphic-ws: 5.0.0(ws@8.18.2(bufferutil@4.0.9)(utf-8-validate@5.0.10))
       nanoid: 5.1.5
-      ws: 8.18.2
+      ws: 8.18.2(bufferutil@4.0.9)(utf-8-validate@5.0.10)
     transitivePeerDependencies:
       - bufferutil
       - utf-8-validate
@@ -2410,27 +2430,27 @@ snapshots:
       end-of-stream: 1.4.4
       once: 1.4.0
 
-  puppeteer-core@23.11.1:
+  puppeteer-core@23.11.1(bufferutil@4.0.9)(utf-8-validate@5.0.10):
     dependencies:
       '@puppeteer/browsers': 2.6.1
       chromium-bidi: 0.11.0(devtools-protocol@0.0.1367902)
       debug: 4.4.1(supports-color@5.5.0)
       devtools-protocol: 0.0.1367902
       typed-query-selector: 2.12.0
-      ws: 8.18.2
+      ws: 8.18.2(bufferutil@4.0.9)(utf-8-validate@5.0.10)
     transitivePeerDependencies:
       - bare-buffer
       - bufferutil
       - supports-color
       - utf-8-validate
 
-  puppeteer@23.11.1(typescript@4.9.5):
+  puppeteer@23.11.1(bufferutil@4.0.9)(typescript@4.9.5)(utf-8-validate@5.0.10):
     dependencies:
       '@puppeteer/browsers': 2.6.1
       chromium-bidi: 0.11.0(devtools-protocol@0.0.1367902)
       cosmiconfig: 9.0.0(typescript@4.9.5)
       devtools-protocol: 0.0.1367902
-      puppeteer-core: 23.11.1
+      puppeteer-core: 23.11.1(bufferutil@4.0.9)(utf-8-validate@5.0.10)
       typed-query-selector: 2.12.0
     transitivePeerDependencies:
       - bare-buffer
@@ -2665,6 +2685,11 @@ snapshots:
 
   upper-case@1.1.3: {}
 
+  utf-8-validate@5.0.10:
+    dependencies:
+      node-gyp-build: 4.8.4
+    optional: true
+
   utif2@4.1.0:
     dependencies:
       pako: 1.0.11
@@ -2722,7 +2747,10 @@ snapshots:
 
   wrappy@1.0.2: {}
 
-  ws@8.18.2: {}
+  ws@8.18.2(bufferutil@4.0.9)(utf-8-validate@5.0.10):
+    optionalDependencies:
+      bufferutil: 4.0.9
+      utf-8-validate: 5.0.10
 
   xml-parse-from-string@1.0.1: {}
 

+ 1 - 0
src/interface/economy.ts

@@ -6,6 +6,7 @@ export interface UserData {
         coins: number;
         logs: Economylogs[];
     },
+    events:number//触发事件时保护次数
     props:UserProp[]
     Permission:string[]
 }

+ 1 - 1
src/lib/Puppeteer.ts

@@ -9,7 +9,7 @@ export class HtmlImg {
     async init() {
         if (!this.browser) {
             const options: PuppeteerLaunchOptions = {
-                headless: true, // 无头模式,可根据需要设置为false,
+                headless: false, // 无头模式,可根据需要设置为false,
                 args: [
                     '--no-sandbox',
                     '--disable-setuid-sandbox',

+ 1 - 0
src/lib/decorators.ts

@@ -271,6 +271,7 @@ export function schedule(cron: string): MethodDecorator {
         // 返回修改后的描述符
         return descriptor;
     };
+
 }
 
 // 添加金币相关的fn装饰器

+ 1 - 0
src/lib/economy.ts

@@ -48,6 +48,7 @@ export function getUserData(userId: string): UserData|null {
                 logs: [],
                 
             },
+            events:0,
             props: [],
             Permission: []
         };