From fd7b8d945d31cd934811dcaa3ba6b93e667f6148 Mon Sep 17 00:00:00 2001 From: xichaoyin Date: Thu, 11 Jan 2024 17:06:39 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix:=E4=BB=BB=E5=8A=A1=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/fix_patch/patch_20240111.ts | 59 +++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 src/fix_patch/patch_20240111.ts diff --git a/src/fix_patch/patch_20240111.ts b/src/fix_patch/patch_20240111.ts new file mode 100644 index 0000000..ea06ce0 --- /dev/null +++ b/src/fix_patch/patch_20240111.ts @@ -0,0 +1,59 @@ +import { ReqEmail } from "../monopoly/protocols/PtlEmail"; +import { patchInit } from "../patch"; +import { MsgEmail } from "../shared/protocols/msg_s2c/MsgEmail"; +import { PublicShared } from "../shared/public/public"; + + +class Path { + + async fun1(a: any) { + let taskType = 2; + // let users = await G.mongodb.collection('user').find({}).toArray(); + let users = await G.mongodb.collection('user').find({ loginTime: { $gte: 1704643200 } }).toArray(); + for (let i = 0; i < users.length; i++) { + let user = users[i]; + + console.log(`处理玩家${user.uid}数据`); + let task = Object.assign({}, ...(await G.mongodb.collection('task').find({ + uid: user.uid, type: taskType + }, { projection: { taskid: 1, finish: 1 } }).toArray()).map(i => { + return { [i.taskid]: i.finish } + })) + + let deltask = []; + let sortTask = Object.keys(task).sort(); + + for (let taskid of sortTask) { + if (task[taskid] == 1) continue; + let con = G.gc.task[taskType][taskid]; + if (task[con.followtask]) { + let i = sortTask.indexOf(taskid); + deltask.push(...sortTask.slice(i + 1).map(i => Number(i))); + } + } + + if (deltask.length > 0) { + await G.mongodb.collection("task").deleteMany( + { uid: user.uid, taskid: { $in: deltask } } + ) + console.log(`删除玩家${user.uid}任务:${deltask}`) + } + } + } + + async run() { + await this.fun1(1); + } +} + +async function main() { + await patchInit() + let patch = new Path(); + await patch.run(); + console.log("逻辑执行完成,等待退出"); + setTimeout(function () { + console.log('结束程序'); + process.exit(); + }, 3000); +} +main(); From d6bafb7704fa0ccb014fbf734421e05a80cf9e8a Mon Sep 17 00:00:00 2001 From: yushunrui <364203175@qq.com> Date: Thu, 11 Jan 2024 18:20:06 +0800 Subject: [PATCH 2/2] =?UTF-8?q?fix:=E7=AB=9E=E6=8A=80=E5=9C=BA=E7=AC=AC?= =?UTF-8?q?=E4=B8=80=E5=90=8D=E5=A4=B4=E5=83=8F=E7=89=B9=E6=AE=8A=E5=A4=84?= =?UTF-8?q?=E7=90=86=EF=BC=8C=E5=8F=AF=E4=BB=A5=E7=94=A8=E9=81=93=E5=85=B7?= =?UTF-8?q?=E7=9B=B4=E6=8E=A5=E8=A7=A3=E9=94=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/fix_patch/patch_20240112.ts | 44 +++++++++++++++++++++++++++++---- 1 file changed, 39 insertions(+), 5 deletions(-) diff --git a/src/fix_patch/patch_20240112.ts b/src/fix_patch/patch_20240112.ts index a51f304..102981f 100644 --- a/src/fix_patch/patch_20240112.ts +++ b/src/fix_patch/patch_20240112.ts @@ -3,13 +3,48 @@ import { patchFun, patchInit } from "../patch"; class Path { async huodong2(a: any) { - const hdids = [2002,2003] + const con ={ + 2000:[ + { payId: '', num: 1, prize: [{a: 'item', t: '49', n: 20}, {a: 'attr', t: 'rmbmoney', n: 200}], free: true }, + { payId: 'duihuan_1_1', prize: [{a: 'item', t: '49', n: 50}, {a: 'attr', t: 'rmbmoney', n: 600}], free: false }, + { payId: 'duihuan_1_2', prize: [{a: 'item', t: '49', n: 100}, {a: 'attr', t: 'rmbmoney', n: 1360}], free: false }, + { payId: 'duihuan_1_3', prize: [{a: 'item', t: '49', n: 200}, {a: 'attr', t: 'rmbmoney', n: 2560}], free: false }, + { payId: 'duihuan_1_4', prize: [{a: 'item', t: '49', n: 600}, {a: 'attr', t: 'rmbmoney', n: 6560}], free: false }, + { payId: 'duihuan_1_5', prize: [{a: 'item', t: '49', n: 1200}, {a: 'attr', t: 'rmbmoney', n: 12960}], free: false }, + ], + 2001: [ + { payId: '', num: 1, prize: [{a: 'item', t: '49', n: 20}, {a: 'attr', t: 'rmbmoney', n: 200}], free: true }, + { payId: 'duihuan_3_1', prize: [{a: 'item', t: '49', n: 50}, {a: 'attr', t: 'rmbmoney', n: 600}], free: false }, + { payId: 'duihuan_3_2', prize: [{a: 'item', t: '49', n: 100}, {a: 'attr', t: 'rmbmoney', n: 1360}], free: false }, + { payId: 'duihuan_3_3', prize: [{a: 'item', t: '49', n: 200}, {a: 'attr', t: 'rmbmoney', n: 2560}], free: false }, + { payId: 'duihuan_3_4', prize: [{a: 'item', t: '49', n: 600}, {a: 'attr', t: 'rmbmoney', n: 6560}], free: false }, + { payId: 'duihuan_3_5', prize: [{a: 'item', t: '49', n: 1200}, {a: 'attr', t: 'rmbmoney', n: 12960}], free: false }, + ], + 2002: [ + { payId: '', num: 1, prize: [{a: 'item', t: '50', n: 20}, {a: 'attr', t: 'rmbmoney', n: 200}], free: true }, + { payId: 'duihuan_2_1', prize: [{a: 'item', t: '50', n: 50}, {a: 'attr', t: 'rmbmoney', n: 600}], free: false }, + { payId: 'duihuan_2_2', prize: [{a: 'item', t: '50', n: 100}, {a: 'attr', t: 'rmbmoney', n: 1360}], free: false }, + { payId: 'duihuan_2_3', prize: [{a: 'item', t: '50', n: 200}, {a: 'attr', t: 'rmbmoney', n: 2560}], free: false }, + { payId: 'duihuan_2_4', prize: [{a: 'item', t: '50', n: 600}, {a: 'attr', t: 'rmbmoney', n: 6560}], free: false }, + { payId: 'duihuan_2_5', prize: [{a: 'item', t: '50', n: 1200}, {a: 'attr', t: 'rmbmoney', n: 12960}], free: false }, + ], + 2003: [ + { payId: '', num: 1, prize: [{a: 'item', t: '50', n: 20}, {a: 'attr', t: 'rmbmoney', n: 200}], free: true }, + { payId: 'duihuan_4_1', prize: [{a: 'item', t: '50', n: 50}, {a: 'attr', t: 'rmbmoney', n: 600}], free: false }, + { payId: 'duihuan_4_2', prize: [{a: 'item', t: '50', n: 100}, {a: 'attr', t: 'rmbmoney', n: 1360}], free: false }, + { payId: 'duihuan_4_3', prize: [{a: 'item', t: '50', n: 200}, {a: 'attr', t: 'rmbmoney', n: 2560}], free: false }, + { payId: 'duihuan_4_4', prize: [{a: 'item', t: '50', n: 600}, {a: 'attr', t: 'rmbmoney', n: 6560}], free: false }, + { payId: 'duihuan_4_5', prize: [{a: 'item', t: '50', n: 1200}, {a: 'attr', t: 'rmbmoney', n: 12960}], free: false }, + ], + } + + const hdids = [2000,2001,2002,2003] const hdinfos = await G.mongodb.find('hdinfo', { hdid: { $in: hdids } }) for (let i = 0; i < hdinfos.length; i++) { let hdinfo = hdinfos[i] - hdinfo.data.gift = {} - - await G.mongodb.collection('hdinfo').updateOne({ "hdid": hdinfo.hdid}, { "$set": {"data.figt": {}} }); + hdinfo.data.event.gift = con[hdinfo.hdid] + console.log(hdinfo.hdid,hdinfo.data.event.gift) + await G.mongodb.collection('hdinfo').updateOne({ "hdid": hdinfo.hdid}, { "$set": {"data": hdinfo.data}}); console.log(hdinfo.hdid,"finish") } return "sucess!!!" @@ -26,7 +61,6 @@ class Path { return "sucess!!!" } - async run() { await this.huodong2(1); await this.headFrame(1);