From 1c256ab58b6e78e39c773be93b96c3bf76ab4b64 Mon Sep 17 00:00:00 2001 From: yushunrui <364203175@qq.com> Date: Tue, 9 Jan 2024 22:00:30 +0800 Subject: [PATCH 01/42] =?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/public/user.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/public/user.ts b/src/public/user.ts index 5914259..a89f392 100644 --- a/src/public/user.ts +++ b/src/public/user.ts @@ -305,8 +305,11 @@ export class UserFun { gud.headFrames[conf.id] += val * v; } } + else if(conf?.cond?.[0] == "jjc_rank") { + change = true; + gud.headFrames[conf.id] = -1; + } } - if (change) { PlayerFun.changeAttr(uid, {headFrames: gud.headFrames}); G.server.sendMsgByUid(uid, 'msg_s2c/PlayerChange', {headFrames: gud.headFrames}); From 24cae9a4e9f7ac7ceb7509c05ced71f027b3d59e Mon Sep 17 00:00:00 2001 From: yushunrui <364203175@qq.com> Date: Wed, 10 Jan 2024 16:19:56 +0800 Subject: [PATCH 02/42] =?UTF-8?q?fix:=E6=88=98=E4=BB=A4=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E6=AF=8F=E8=BD=AE=E9=87=8D=E7=BD=AE=E8=BF=9B=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api_s2c/event/zhanling/ApiOpen.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/api_s2c/event/zhanling/ApiOpen.ts b/src/api_s2c/event/zhanling/ApiOpen.ts index e6dc37b..183f741 100644 --- a/src/api_s2c/event/zhanling/ApiOpen.ts +++ b/src/api_s2c/event/zhanling/ApiOpen.ts @@ -24,7 +24,10 @@ export default async function (call: ApiCall) { await PayFun.delPayLog( call.uid, { payId: G.gc.zhanling.payId, val: [] } ); - + // 战令重置的时候需要删除所有的任务进度,但是每天的任务进度不做处理,因为每天会自然重置,怕玩家会刷 + // ZhanLingTasks.clearLog(call.uid, 'day'); + ZhanLingTasks.clearLog(call.uid, 'week'); + ZhanLingTasks.clearLog(call.uid, 'round'); data = (await G.mongodb.cEvent('zhanling').findOneAndUpdate({ uid: call.uid, type: 'zhanling' From b0a3c17927a1d3fbbd4d8c7d8ce93203fb8a15ea Mon Sep 17 00:00:00 2001 From: yushunrui <364203175@qq.com> Date: Wed, 10 Jan 2024 18:32:23 +0800 Subject: [PATCH 03/42] =?UTF-8?q?fix:=E7=8E=A9=E5=AE=B6=E9=81=93=E5=85=B7?= =?UTF-8?q?=E6=89=A3=E9=99=A4=E9=80=BB=E8=BE=91=E8=84=9A=E6=9C=AC=E6=8F=90?= =?UTF-8?q?=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/fix_patch/patch_20240109.ts | 727 ++++++++++++++++++++++++++++++++ 1 file changed, 727 insertions(+) create mode 100644 src/fix_patch/patch_20240109.ts diff --git a/src/fix_patch/patch_20240109.ts b/src/fix_patch/patch_20240109.ts new file mode 100644 index 0000000..e4d4230 --- /dev/null +++ b/src/fix_patch/patch_20240109.ts @@ -0,0 +1,727 @@ +import { log } from "console"; +import { patchFun, patchInit } from "../patch"; +import { TanXianFun } from "../public/tanxian"; +import { PublicShared } from "../shared/public/public"; + + + + +class Path { + + async fun1(a: any) { + const con = { + "1001_659cf813920babad7462d78f":{ + "item": { + "1": 100, + "12": 100, + "2": 100, + "6": 100 + }, + "attr": { + "rmbmoney": 100000, + "jinbi": 200000 + } + }, + "16_6575db20f6ef8b7da5c8f1fd": { + "item": { + "1": 55400000, + "12": 10600, + "2": 223000, + "6": 690 + }, + "attr": { + "rmbmoney": 30500, + "jinbi": 2850000000 + } + }, + "15_6575a14b2f930bd5e51ccde9": { + "item": { + "1": 137200000, + "12": 16600, + "2": 273700, + "6": 1735 + }, + "attr": { + "rmbmoney": 35200, + "jinbi": 3420000000 + } + }, + "10_6573c51480a92f081d78e1d9": { + "item": { + "1": 35600000, + "12": 13000, + "2": 67800, + "6": 1180 + }, + "attr": { + "rmbmoney": 12400, + "jinbi": 630000000 + } + }, + "13_6574d24964743d942d4c2621": { + "item": { + "1": 20600000, + "18": 1920, + "12": 17800, + "2": 85400, + "6": 255 + }, + "attr": { + "rmbmoney": 15400, + "jinbi": 1060000000 + } + }, + "10_6573ecd9a884822d24482a1a": { + "item": { + "1": 103200000, + "18": 9490, + "12": 28000, + "2": 421600, + "6": 1300 + }, + "attr": { + "rmbmoney": 53400, + "jinbi": 5210000000 + } + }, + "11_657412487fe3541fe7241a60": { + "item": { + "1": 35000000, + "12": 99300, + "2": 110900, + "6": 460 + }, + "attr": { + "rmbmoney": 19200, + "jinbi": 1830000000 + } + }, + "11_657436eb3bc021c4e335f356": { + "item": { + "1": 197200000, + "12": 243700, + "2": 597200, + "6": 2475 + }, + "attr": { + "rmbmoney": 97400, + "jinbi": 9930000000 + } + }, + "11_657428e87fe3541fe7245b75": { + "item": { + "1": 71200000, + "12": 64300, + "2": 219300, + "6": 910 + }, + "attr": { + "rmbmoney": 37300, + "jinbi": 3630000000 + } + }, + "10_6573aeb2602e0a72e8279b54": { + "item": { + "1": 17800000, + "12": 22300, + "2": 58100, + "6": 240 + }, + "attr": { + "rmbmoney": 10500, + "jinbi": 940000000 + } + }, + "11_657447453bc021c4e3362403": { + "item": { + "1": 322000000, + "18": 31290, + "12": 134800, + "2": 1297200, + "6": 4035 + }, + "attr": { + "rmbmoney": 162900, + "jinbi": 16160000000 + } + }, + "11_657405957b27be6c2f4cac11": { + "item": { + "1": 18600000, + "18": 1050, + "12": 74500, + "2": 79900, + "6": 245 + }, + "attr": { + "rmbmoney": 12000, + "jinbi": 980000000 + } + }, + "14_6575004f7aecd430eb86fbb5": { + "item": { + "1": 44000000, + "18": 3440, + "12": 104800, + "2": 182600, + "6": 545 + }, + "attr": { + "rmbmoney": 25300, + "jinbi": 2270000000 + } + }, + "16_6575d6ac2e4ba33a00a04cbc": { + "item": { + "1": 36600000, + "12": 13000, + "2": 108200, + "6": 470 + }, + "attr": { + "rmbmoney": 19100, + "jinbi": 1870000000 + } + }, + "12_6574823b27bd4264da470583": { + "item": { + "1": 8800000, + "12": 123000, + "2": 37500, + "6": 115 + }, + "attr": { + "rmbmoney": 7300, + "jinbi": 530000000 + } + }, + "16_6575b61caff1b610d8bc6c96": { + "item": { + "24": 6, + "10": 200, + "12": 55000, + "600": 20, + "18": 1400, + "1": 16200000, + "2": 64900, + "6": 180, + "9": 3500 + }, + "attr": { + "rmbmoney": 14400, + "jinbi": 840000000 + } + }, + "14_6574f2e66c7af0fe3713b718": { + "item": { + "1": 48800000, + "12": 12700, + "2": 90900, + "6": 655 + }, + "attr": { + "rmbmoney": 12400, + "jinbi": 1100000000 + } + }, + "11_65740da4deb68620911e96ef": { + "item": { + "1": 64200000, + "18": 5580, + "12": 28300, + "2": 265400, + "6": 820 + }, + "attr": { + "rmbmoney": 33800, + "jinbi": 3270000000 + } + }, + "15_657594c3a7981612a8ea7e0e": { + "item": { + "1": 96800000, + "18": 8870, + "12": 3700, + "2": 397200, + "6": 1230 + }, + "attr": { + "rmbmoney": 50400, + "jinbi": 4920000000 + } + }, + "11_657434f8290f4393568f16fe": { + "item": { + "1": 129000000, + "12": 198300, + "2": 392100, + "6": 1630 + }, + "attr": { + "jinbi": 6500000000 + } + }, + "14_657512ee7aecd430eb872b5d": { + "item": { + "1": 121800000, + "12": 36400, + "2": 363400, + "6": 1530 + }, + "attr": { + "rmbmoney": 31500, + "jinbi": 6150000000 + } + }, + "11_657454089beef4c060edab88": { + "item": { + "1": 96600000, + "18": 8660, + "12": 149200, + "2": 392900, + "6": 1215 + }, + "attr": { + "rmbmoney": 49800, + "jinbi": 4890000000 + } + }, + "10_6573e8aa80a92f081d7930b4": { + "item": { + "1": 242400000, + "18": 16210, + "12": 84100, + "2": 978800, + "6": 3040 + }, + "attr": { + "rmbmoney": 123100, + "jinbi": 12180000000 + } + }, + "11_6573fd7a08e89e5a6859446e": { + "item": { + "1": 178200000, + "18": 16230, + "12": 10900, + "2": 717000, + "6": 2225 + }, + "attr": { + "rmbmoney": 92000, + "jinbi": 8990000000 + } + }, + "11_65744fe2d0256beb85eed193": { + "item": { + "1": 262800000, + "18": 25540, + "12": 55800, + "2": 1057600, + "6": 3275 + }, + "attr": { + "rmbmoney": 134000, + "jinbi": 13190000000 + } + }, + "11_657440e7ee44bd9935bbbd7c": { + "item": { + "1": 83000000, + "18": 7160, + "12": 250900, + "2": 341800, + "6": 1055 + }, + "attr": { + "rmbmoney": 43300, + "jinbi": 4220000000 + } + }, + "11_657420932dd070117eb15e92": { + "item": { + "1": 307400000, + "18": 29210, + "12": 50200, + "2": 1239200, + "6": 3880 + }, + "attr": { + "jinbi": 15470000000 + } + }, + "14_65750da36439ef15582d6e6d": { + "item": { + "1": 105000000, + "12": 93900, + "2": 361000, + "6": 1335 + }, + "attr": { + "rmbmoney": 54100, + "jinbi": 5310000000 + } + }, + "12_6574762427bd4264da46ce63": { + "item": { + "1": 44400000, + "18": 3390, + "12": 15900, + "2": 185000, + "6": 555 + }, + "attr": { + "rmbmoney": 25000, + "jinbi": 2290000000 + } + }, + "16_6575e1625685671e63fe001f": { + "item": { + "1": 12600000, + "2": 51400, + "6": 155 + }, + "attr": { + "rmbmoney": 9200, + "jinbi": 710000000 + } + }, + "10_6573e236a884822d244816a0": { + "item": { + "1": 76200000, + "18": 6760, + "12": 79600, + "2": 310200, + "6": 945 + }, + "attr": { + "rmbmoney": 40700, + "jinbi": 3870000000 + } + }, + "10_6573a17268053554fe606611": { + "item": { + "1": 109200000, + "18": 9410, + "12": 58000, + "2": 428000, + "6": 2365 + }, + "attr": { + "rmbmoney": 55000, + "jinbi": 5240000000 + } + }, + "15_657595a3a7981612a8ea8009": { + "item": { + "1": 19200000, + "18": 830, + "12": 74800, + "2": 84100, + "6": 1115 + }, + "attr": { + "rmbmoney": 11300, + "jinbi": 990000000 + } + }, + "11_657438a83bc021c4e335f86e": { + "item": { + "1": 71200000, + "18": 6300, + "12": 55600, + "2": 292500, + "6": 905 + }, + "attr": { + "rmbmoney": 37200, + "jinbi": 3600000000 + } + }, + "10_6573e0395fe4caaf29a9b83c": { + "item": { + "1": 9000000, + "12": 184000, + "2": 45800, + "6": 135 + }, + "attr": { + "rmbmoney": 6400, + "jinbi": 530000000 + } + }, + "10_6573e596dc05fa03150d7db1": { + "item": { + "1": 12800000, + "18": 410, + "12": 15400, + "2": 60000, + "6": 175 + }, + "attr": { + "rmbmoney": 8200, + "jinbi": 690000000 + } + }, + "14_65752c79c85dd4cf1a874893": { + "item": { + "1": 14200000, + "12": 33700, + "2": 64500, + "6": 185 + }, + "attr": { + "rmbmoney": 8900, + "jinbi": 790000000 + } + }, + "12_657455ed6b804f4a6d4b53a2": { + "item": { + "1": 160800000, + "18": 14900, + "12": 4800, + "2": 650900, + "6": 2025 + }, + "attr": { + "rmbmoney": 82000, + "jinbi": 8080000000 + } + }, + "12_657481316ad7b8861da8a914": { + "item": { + "1": 5600000, + "18": 450, + "12": 34600, + "2": 25500, + "6": 65 + }, + "attr": { + "rmbmoney": 7800, + "jinbi": 300000000 + } + }, + "4_6571c11bb0b5337a4d3a63a0": { + "item": { + "24": 7, + "10": 400, + "12": 15600, + "600": 50, + "18": 190, + "1": 5200000, + "2": 16300, + "6": 10, + "9": 8500 + }, + "attr": { + "rmbmoney": 8800, + "jinbi": 310000000 + } + }, + "10_6573714bc7069a58e96ba077": { + "item": { + "1": 14400000, + "18": 610, + "12": 11800, + "2": 66400, + "6": 190 + }, + "attr": { + "rmbmoney": 9000, + "jinbi": 770000000 + } + }, + "11_65744ba29beef4c060ed803c": { + "item": { + "1": 331800000, + "12": 14800, + "2": 1001400, + "6": 4155 + }, + "attr": { + "rmbmoney": 167500, + "jinbi": 16670000000 + } + }, + "16_6575d57c5685671e63fdb6ee": { + "item": { + "1": 13600000, + "12": 42700, + "2": 44500, + "6": 420 + }, + "attr": { + "rmbmoney": 7000, + "jinbi": 430000000 + } + }, + "13_658796c52d0c66fa1adb86fc": { + "item": { + "1": 21000000, + "12": 81300, + "2": 69800, + "6": 275 + }, + "attr": { + "rmbmoney": 12400, + "jinbi": 1140000000 + } + }, + "11_65743bb09beef4c060ed46e7": { + "item": { + "10": 300, + "12": 8100, + "600": 30, + "18": 920, + "1": 18400000, + "2": 69600, + "6": 170, + "9": 4500 + }, + "attr": { + "rmbmoney": 13700, + "jinbi": 950000000 + } + }, + "10_6573bb4b68053554fe60940c": { + "item": { + "1": 19400000, + "18": 1080, + "12": 63000, + "2": 83100, + "6": 235 + }, + "attr": { + "rmbmoney": 12300, + "jinbi": 1010000000 + } + }, + "16_6575d97df2211cd2ff29ba12": { + "item": { + "1": 3400000, + "12": 11100, + "2": 16700, + "6": 50 + }, + "attr": { + "rmbmoney": 5000, + "jinbi": 250000000 + } + }, + "11_657434c6d0256beb85ee6fae": { + "item": { + "1": 80600000, + "18": 7360, + "12": 232000, + "2": 332200, + "6": 1025 + }, + "attr": { + "rmbmoney": 42100, + "jinbi": 4090000000 + } + }, + "16_6575b6d0f6ef8b7da5c84bf0": { + "item": { + "1": 70600000, + "12": 29700, + "2": 218200, + "6": 900 + }, + "attr": { + "rmbmoney": 36000, + "jinbi": 3610000000 + } + }, + "10_6587fbf00c11d852663c5bbb": { + "item": { + "1": 26800000, + "18": 1940, + "12": 168000, + "2": 118300, + "6": 350 + }, + "attr": { + "rmbmoney": 15300, + "jinbi": 1410000000 + } + }, + "10_657397c2f31ed0c046ef3730": { + "item": { + "1": 220800000, + "18": 1900, + "12": 8800, + "2": 701400, + "6": 2780 + }, + "attr": { + "rmbmoney": 112100, + "jinbi": 11100000000 + } + } +} + + const uids = Object.keys(con); + let _users = await G.mongodb.find('user',{uid:{$in: uids}}) + for(let i = 0; i < _users.length; i++) { + let user = _users[i] + const uid = user.uid + const _delattr = con[uid]["attr"] + const _delitem= con[uid]["item"] + let _setUserData = {} + let _dellog = {"attr": {}, "item":{}} + for (let t in _delattr) { + if (t == "rmbmoney") { + let v = user.rmbmoney - _delattr[t] + if (v < 0){ v = 0} + _setUserData[t] = v + _dellog["attr"][t] = {"old":user.rmbmoney, "new": v} + } + else if (t == "jinbi") { + let v = user.jinbi - _delattr[t] + if (v < 0){ v = 0} + _setUserData[t] = v + _dellog["attr"][t] = {"old":user.jinbi, "new": v} + } + } + + const itemIds = Object.keys(_delitem); + // 删除item + let _itemlist = await G.mongodb.collection('item').find({"uid":uid, "itemId":{"$in": itemIds}}).toArray(); + for(let i = 0; i < _itemlist.length; i++) { + const _item = _itemlist[i] + const _itemid = _item.itemId + const del = _delitem[_itemid] || 0 + let v = _item.num - del + if (v < 0){ v = 0} + let _setItemData = {} + _setItemData["num"] = v + _dellog["item"][_itemid] = {"old":_item.num, "new": v} + await G.mongodb.collection('item').updateOne({"uid":uid, "itemId":_itemid}, {"$set": _setItemData}); + } + await G.mongodb.collection('user').updateOne({"uid":uid}, {"$set": _setUserData}); + // 输出日志 + console.log(uid,":", _dellog); + } + + return "sucess!!!" + } + + + + 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 0d736e485434d68356dbb11ddd3b981bf1136785 Mon Sep 17 00:00:00 2001 From: xichaoyin Date: Tue, 9 Jan 2024 22:14:56 +0800 Subject: [PATCH 04/42] =?UTF-8?q?fix:jjc=E6=88=98=E6=96=97=E6=97=A5?= =?UTF-8?q?=E5=BF=97=E6=B7=BB=E5=8A=A0=5Fid=E5=80=92=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/fix_patch/patch_20240109-1.ts | 119 +++ src/fix_patch/patch_20240109.ts | 1387 ++++++++++++++--------------- src/public/fight.ts | 62 +- 3 files changed, 824 insertions(+), 744 deletions(-) create mode 100644 src/fix_patch/patch_20240109-1.ts diff --git a/src/fix_patch/patch_20240109-1.ts b/src/fix_patch/patch_20240109-1.ts new file mode 100644 index 0000000..d20f380 --- /dev/null +++ b/src/fix_patch/patch_20240109-1.ts @@ -0,0 +1,119 @@ +import { patchFun, patchInit } from "../patch"; +import { PublicShared } from "../shared/public/public"; +import { JJCFun } from "../public/jjc"; + +function getRankPrize(rank: number, conf?: typeof G.gc.jjc_ph['']) { + if (!conf) { + conf = Object.values(G.gc.jjc_ph).filter(v => rank >= v.ph[0] && rank <= v.ph[1])[0]; + } + if (conf) { + return [...conf.prize, { a: 'item', t: '11', n: typeof conf.rongyuprize == 'number' ? conf.rongyuprize : PublicShared.eval(conf.rongyuprize, { a: rank }) }]; + } else { + return []; + } +} + +class Path { + + async addEmail(email, isCross = false) { + let { prize, uid, ...e } = email; + let lng = await G.redis.rawGet(`user:lng:${uid}`); + let sendEmail = { + _id: null, + uid: uid, + type: e.type, + title: e.lngTitle ? (e.lngTitle[lng] || e.lngTitle['ja']) : e.title, + content: e.lngContent ? (e.lngContent[lng] || e.lngContent['ja']) : e.content, + createTime: e.createTime || G.time, + contentInsertArr: e.contentInsertArr || [] + } as any; + + /**跨服邮件给sid标识*/ + // if (isCross) { + // sendEmail.sid = uid.split('_')[0]; + // } + if ((prize === null || prize === void 0 ? void 0 : prize.length) > 0) { + sendEmail.prizeData = { + prize: email.prize, + isGet: false + }; + } + if (email.g123log && Object.keys(email.g123log).length > 0) + sendEmail.g123log = email.g123log; + + if (email.lngTitle) { + sendEmail.lngTitle = email.lngTitle; + sendEmail.lngContent = email.lngContent; + } + //太亏了!换其他清理机制,getAllEmail是性能消耗大户 + //todo.. 换其他清理机制 + // if (!isCross) { + // let emailList = await this.getAllEmail(uid); + // if (emailList.length >= 50) { + // emailList.sort((a, b) => { + // let noPrizeA = a.prizeData == undefined ? 0 : 1; + // let noPrizeB = b.prizeData == undefined ? 0 : 1; + // let getA = a.prizeData?.isGet == true ? 0 : 1; + // let getB = b.prizeData?.isGet == true ? 0 : 1; + // if (noPrizeA != noPrizeB) { + // return noPrizeA - noPrizeB; + // } else if (getA != getB) { + // return getA - getB; + // } + // return a.createTime - b.createTime; + // }); + // this.removeEmail(uid, emailList[0]._id); + // G.server.sendMsgByUid(uid, 'msg_s2c/EmailDel', emailList[0]._id); + // } + // } + //@ts-ignore + await G.mongodb.collection('email').insertOne({ + ttl: new Date(), ...G.mongodb.conversionIdObj(sendEmail) + }) + } + + async sendEmail(uid: string, rank: number, prize: atn[]) { + + if (uid.indexOf('npc_') != -1) return; + + await this.addEmail({ + uid: uid, + type: 'system', + title: G.gc.jjc_com.email.titel, + content: G.gc.jjc_com.email.content, + prize: prize, + contentInsertArr: [rank] + }); + } + async fun1(a: any) { + for (let conf of Object.values(G.gc.jjc_ph)) { + let players = await JJCFun.getRankListUid(conf.ph[0] - 1, conf.ph[1]); + + for (let index = 0; index < players.length; index++) { + let uid = players[index]; + await this.sendEmail(uid, conf.ph[0] + index, getRankPrize(conf.ph[0] + index, conf)); + console.log("sendEmail", uid, conf.ph[0] + index) + } + } + + return "sucess!!!" + } + + + + 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(); diff --git a/src/fix_patch/patch_20240109.ts b/src/fix_patch/patch_20240109.ts index e4d4230..fa6453e 100644 --- a/src/fix_patch/patch_20240109.ts +++ b/src/fix_patch/patch_20240109.ts @@ -1,727 +1,684 @@ -import { log } from "console"; import { patchFun, patchInit } from "../patch"; -import { TanXianFun } from "../public/tanxian"; -import { PublicShared } from "../shared/public/public"; - - - class Path { - async fun1(a: any) { - const con = { - "1001_659cf813920babad7462d78f":{ - "item": { - "1": 100, - "12": 100, - "2": 100, - "6": 100 - }, - "attr": { - "rmbmoney": 100000, - "jinbi": 200000 - } - }, - "16_6575db20f6ef8b7da5c8f1fd": { - "item": { - "1": 55400000, - "12": 10600, - "2": 223000, - "6": 690 - }, - "attr": { - "rmbmoney": 30500, - "jinbi": 2850000000 + async fun1(a: any) { + const con = { + "16_6575db20f6ef8b7da5c8f1fd": { + "item": { + "1": 55400000, + "12": 10600, + "2": 223000, + "6": 690 + }, + "attr": { + "rmbmoney": 30500, + "jinbi": 2850000000 + } + }, + "15_6575a14b2f930bd5e51ccde9": { + "item": { + "1": 137200000, + "12": 16600, + "2": 273700, + "6": 1735 + }, + "attr": { + "rmbmoney": 35200, + "jinbi": 3420000000 + } + }, + "10_6573c51480a92f081d78e1d9": { + "item": { + "1": 35600000, + "12": 13000, + "2": 67800, + "6": 1180 + }, + "attr": { + "rmbmoney": 12400, + "jinbi": 630000000 + } + }, + "10_6573ecd9a884822d24482a1a": { + "item": { + "1": 103200000, + "18": 9490, + "12": 28000, + "2": 421600, + "6": 1300 + }, + "attr": { + "rmbmoney": 53400, + "jinbi": 5210000000 + } + }, + "11_657412487fe3541fe7241a60": { + "item": { + "1": 35000000, + "12": 99300, + "2": 110900, + "6": 460 + }, + "attr": { + "rmbmoney": 19200, + "jinbi": 1830000000 + } + }, + "11_657436eb3bc021c4e335f356": { + "item": { + "1": 197200000, + "12": 243700, + "2": 597200, + "6": 2475 + }, + "attr": { + "rmbmoney": 97400, + "jinbi": 9930000000 + } + }, + "11_657428e87fe3541fe7245b75": { + "item": { + "1": 71200000, + "12": 64300, + "2": 219300, + "6": 910 + }, + "attr": { + "rmbmoney": 37300, + "jinbi": 3630000000 + } + }, + "10_6573aeb2602e0a72e8279b54": { + "item": { + "1": 17800000, + "12": 22300, + "2": 58100, + "6": 240 + }, + "attr": { + "rmbmoney": 10500, + "jinbi": 940000000 + } + }, + "11_657447453bc021c4e3362403": { + "item": { + "1": 322000000, + "18": 31290, + "12": 134800, + "2": 1297200, + "6": 4035 + }, + "attr": { + "rmbmoney": 162900, + "jinbi": 16160000000 + } + }, + "11_657405957b27be6c2f4cac11": { + "item": { + "1": 18600000, + "18": 1050, + "12": 74500, + "2": 79900, + "6": 245 + }, + "attr": { + "rmbmoney": 12000, + "jinbi": 980000000 + } + }, + "14_6575004f7aecd430eb86fbb5": { + "item": { + "1": 44000000, + "18": 3440, + "12": 104800, + "2": 182600, + "6": 545 + }, + "attr": { + "rmbmoney": 25300, + "jinbi": 2270000000 + } + }, + "16_6575d6ac2e4ba33a00a04cbc": { + "item": { + "1": 36600000, + "12": 13000, + "2": 108200, + "6": 470 + }, + "attr": { + "rmbmoney": 19100, + "jinbi": 1870000000 + } + }, + "12_6574823b27bd4264da470583": { + "item": { + "1": 8800000, + "12": 123000, + "2": 37500, + "6": 115 + }, + "attr": { + "rmbmoney": 7300, + "jinbi": 530000000 + } + }, + "16_6575b61caff1b610d8bc6c96": { + "item": { + "24": 6, + "10": 200, + "12": 55000, + "600": 20, + "18": 1400, + "1": 16200000, + "2": 64900, + "6": 180, + "9": 3500 + }, + "attr": { + "rmbmoney": 14400, + "jinbi": 840000000 + } + }, + "14_6574f2e66c7af0fe3713b718": { + "item": { + "1": 48800000, + "12": 12700, + "2": 90900, + "6": 655 + }, + "attr": { + "rmbmoney": 12400, + "jinbi": 1100000000 + } + }, + "11_65740da4deb68620911e96ef": { + "item": { + "1": 64200000, + "18": 5580, + "12": 28300, + "2": 265400, + "6": 820 + }, + "attr": { + "rmbmoney": 33800, + "jinbi": 3270000000 + } + }, + "15_657594c3a7981612a8ea7e0e": { + "item": { + "1": 96800000, + "18": 8870, + "12": 3700, + "2": 397200, + "6": 1230 + }, + "attr": { + "rmbmoney": 50400, + "jinbi": 4920000000 + } + }, + "11_657434f8290f4393568f16fe": { + "item": { + "1": 129000000, + "12": 198300, + "2": 392100, + "6": 1630 + }, + "attr": { + "jinbi": 6500000000 + } + }, + "14_657512ee7aecd430eb872b5d": { + "item": { + "1": 121800000, + "12": 36400, + "2": 363400, + "6": 1530 + }, + "attr": { + "rmbmoney": 31500, + "jinbi": 6150000000 + } + }, + "11_657454089beef4c060edab88": { + "item": { + "1": 96600000, + "18": 8660, + "12": 149200, + "2": 392900, + "6": 1215 + }, + "attr": { + "rmbmoney": 49800, + "jinbi": 4890000000 + } + }, + "10_6573e8aa80a92f081d7930b4": { + "item": { + "1": 242400000, + "18": 16210, + "12": 84100, + "2": 978800, + "6": 3040 + }, + "attr": { + "rmbmoney": 123100, + "jinbi": 12180000000 + } + }, + "11_6573fd7a08e89e5a6859446e": { + "item": { + "1": 178200000, + "18": 16230, + "12": 10900, + "2": 717000, + "6": 2225 + }, + "attr": { + "rmbmoney": 92000, + "jinbi": 8990000000 + } + }, + "11_65744fe2d0256beb85eed193": { + "item": { + "1": 262800000, + "18": 25540, + "12": 55800, + "2": 1057600, + "6": 3275 + }, + "attr": { + "rmbmoney": 134000, + "jinbi": 13190000000 + } + }, + "11_657440e7ee44bd9935bbbd7c": { + "item": { + "1": 83000000, + "18": 7160, + "12": 250900, + "2": 341800, + "6": 1055 + }, + "attr": { + "rmbmoney": 43300, + "jinbi": 4220000000 + } + }, + "11_657420932dd070117eb15e92": { + "item": { + "1": 307400000, + "18": 29210, + "12": 50200, + "2": 1239200, + "6": 3880 + }, + "attr": { + "jinbi": 15470000000 + } + }, + "14_65750da36439ef15582d6e6d": { + "item": { + "1": 105000000, + "12": 93900, + "2": 361000, + "6": 1335 + }, + "attr": { + "rmbmoney": 54100, + "jinbi": 5310000000 + } + }, + "12_6574762427bd4264da46ce63": { + "item": { + "1": 44400000, + "18": 3390, + "12": 15900, + "2": 185000, + "6": 555 + }, + "attr": { + "rmbmoney": 25000, + "jinbi": 2290000000 + } + }, + "16_6575e1625685671e63fe001f": { + "item": { + "1": 12600000, + "2": 51400, + "6": 155 + }, + "attr": { + "rmbmoney": 9200, + "jinbi": 710000000 + } + }, + "10_6573e236a884822d244816a0": { + "item": { + "1": 76200000, + "18": 6760, + "12": 79600, + "2": 310200, + "6": 945 + }, + "attr": { + "rmbmoney": 40700, + "jinbi": 3870000000 + } + }, + "10_6573a17268053554fe606611": { + "item": { + "1": 109200000, + "18": 9410, + "12": 58000, + "2": 428000, + "6": 2365 + }, + "attr": { + "rmbmoney": 55000, + "jinbi": 5240000000 + } + }, + "15_657595a3a7981612a8ea8009": { + "item": { + "1": 19200000, + "18": 830, + "12": 74800, + "2": 84100, + "6": 1115 + }, + "attr": { + "rmbmoney": 11300, + "jinbi": 990000000 + } + }, + "11_657438a83bc021c4e335f86e": { + "item": { + "1": 71200000, + "18": 6300, + "12": 55600, + "2": 292500, + "6": 905 + }, + "attr": { + "rmbmoney": 37200, + "jinbi": 3600000000 + } + }, + "10_6573e0395fe4caaf29a9b83c": { + "item": { + "1": 9000000, + "12": 184000, + "2": 45800, + "6": 135 + }, + "attr": { + "rmbmoney": 6400, + "jinbi": 530000000 + } + }, + "10_6573e596dc05fa03150d7db1": { + "item": { + "1": 12800000, + "18": 410, + "12": 15400, + "2": 60000, + "6": 175 + }, + "attr": { + "rmbmoney": 8200, + "jinbi": 690000000 + } + }, + "14_65752c79c85dd4cf1a874893": { + "item": { + "1": 14200000, + "12": 33700, + "2": 64500, + "6": 185 + }, + "attr": { + "rmbmoney": 8900, + "jinbi": 790000000 + } + }, + "12_657455ed6b804f4a6d4b53a2": { + "item": { + "1": 160800000, + "18": 14900, + "12": 4800, + "2": 650900, + "6": 2025 + }, + "attr": { + "rmbmoney": 82000, + "jinbi": 8080000000 + } + }, + "12_657481316ad7b8861da8a914": { + "item": { + "1": 5600000, + "18": 450, + "12": 34600, + "2": 25500, + "6": 65 + }, + "attr": { + "rmbmoney": 7800, + "jinbi": 300000000 + } + }, + "4_6571c11bb0b5337a4d3a63a0": { + "item": { + "24": 7, + "10": 400, + "12": 15600, + "600": 50, + "18": 190, + "1": 5200000, + "2": 16300, + "6": 10, + "9": 8500 + }, + "attr": { + "rmbmoney": 8800, + "jinbi": 310000000 + } + }, + "10_6573714bc7069a58e96ba077": { + "item": { + "1": 14400000, + "18": 610, + "12": 11800, + "2": 66400, + "6": 190 + }, + "attr": { + "rmbmoney": 9000, + "jinbi": 770000000 + } + }, + "11_65744ba29beef4c060ed803c": { + "item": { + "1": 331800000, + "12": 14800, + "2": 1001400, + "6": 4155 + }, + "attr": { + "rmbmoney": 167500, + "jinbi": 16670000000 + } + }, + "16_6575d57c5685671e63fdb6ee": { + "item": { + "1": 13600000, + "12": 42700, + "2": 44500, + "6": 420 + }, + "attr": { + "rmbmoney": 7000, + "jinbi": 430000000 + } + }, + "11_65743bb09beef4c060ed46e7": { + "item": { + "10": 300, + "12": 8100, + "600": 30, + "18": 920, + "1": 18400000, + "2": 69600, + "6": 170, + "9": 4500 + }, + "attr": { + "rmbmoney": 13700, + "jinbi": 950000000 + } + }, + "10_6573bb4b68053554fe60940c": { + "item": { + "1": 19400000, + "18": 1080, + "12": 63000, + "2": 83100, + "6": 235 + }, + "attr": { + "rmbmoney": 12300, + "jinbi": 1010000000 + } + }, + "16_6575d97df2211cd2ff29ba12": { + "item": { + "1": 3400000, + "12": 11100, + "2": 16700, + "6": 50 + }, + "attr": { + "rmbmoney": 5000, + "jinbi": 250000000 + } + }, + "11_657434c6d0256beb85ee6fae": { + "item": { + "1": 80600000, + "18": 7360, + "12": 232000, + "2": 332200, + "6": 1025 + }, + "attr": { + "rmbmoney": 42100, + "jinbi": 4090000000 + } + }, + "16_6575b6d0f6ef8b7da5c84bf0": { + "item": { + "1": 70600000, + "12": 29700, + "2": 218200, + "6": 900 + }, + "attr": { + "rmbmoney": 36000, + "jinbi": 3610000000 + } + }, + "10_6587fbf00c11d852663c5bbb": { + "item": { + "1": 26800000, + "18": 1940, + "12": 168000, + "2": 118300, + "6": 350 + }, + "attr": { + "rmbmoney": 15300, + "jinbi": 1410000000 + } + }, + "10_657397c2f31ed0c046ef3730": { + "item": { + "1": 220800000, + "18": 1900, + "12": 8800, + "2": 701400, + "6": 2780 + }, + "attr": { + "rmbmoney": 112100, + "jinbi": 11100000000 + } + } } - }, - "15_6575a14b2f930bd5e51ccde9": { - "item": { - "1": 137200000, - "12": 16600, - "2": 273700, - "6": 1735 - }, - "attr": { - "rmbmoney": 35200, - "jinbi": 3420000000 - } - }, - "10_6573c51480a92f081d78e1d9": { - "item": { - "1": 35600000, - "12": 13000, - "2": 67800, - "6": 1180 - }, - "attr": { - "rmbmoney": 12400, - "jinbi": 630000000 - } - }, - "13_6574d24964743d942d4c2621": { - "item": { - "1": 20600000, - "18": 1920, - "12": 17800, - "2": 85400, - "6": 255 - }, - "attr": { - "rmbmoney": 15400, - "jinbi": 1060000000 - } - }, - "10_6573ecd9a884822d24482a1a": { - "item": { - "1": 103200000, - "18": 9490, - "12": 28000, - "2": 421600, - "6": 1300 - }, - "attr": { - "rmbmoney": 53400, - "jinbi": 5210000000 - } - }, - "11_657412487fe3541fe7241a60": { - "item": { - "1": 35000000, - "12": 99300, - "2": 110900, - "6": 460 - }, - "attr": { - "rmbmoney": 19200, - "jinbi": 1830000000 - } - }, - "11_657436eb3bc021c4e335f356": { - "item": { - "1": 197200000, - "12": 243700, - "2": 597200, - "6": 2475 - }, - "attr": { - "rmbmoney": 97400, - "jinbi": 9930000000 - } - }, - "11_657428e87fe3541fe7245b75": { - "item": { - "1": 71200000, - "12": 64300, - "2": 219300, - "6": 910 - }, - "attr": { - "rmbmoney": 37300, - "jinbi": 3630000000 - } - }, - "10_6573aeb2602e0a72e8279b54": { - "item": { - "1": 17800000, - "12": 22300, - "2": 58100, - "6": 240 - }, - "attr": { - "rmbmoney": 10500, - "jinbi": 940000000 - } - }, - "11_657447453bc021c4e3362403": { - "item": { - "1": 322000000, - "18": 31290, - "12": 134800, - "2": 1297200, - "6": 4035 - }, - "attr": { - "rmbmoney": 162900, - "jinbi": 16160000000 - } - }, - "11_657405957b27be6c2f4cac11": { - "item": { - "1": 18600000, - "18": 1050, - "12": 74500, - "2": 79900, - "6": 245 - }, - "attr": { - "rmbmoney": 12000, - "jinbi": 980000000 - } - }, - "14_6575004f7aecd430eb86fbb5": { - "item": { - "1": 44000000, - "18": 3440, - "12": 104800, - "2": 182600, - "6": 545 - }, - "attr": { - "rmbmoney": 25300, - "jinbi": 2270000000 - } - }, - "16_6575d6ac2e4ba33a00a04cbc": { - "item": { - "1": 36600000, - "12": 13000, - "2": 108200, - "6": 470 - }, - "attr": { - "rmbmoney": 19100, - "jinbi": 1870000000 - } - }, - "12_6574823b27bd4264da470583": { - "item": { - "1": 8800000, - "12": 123000, - "2": 37500, - "6": 115 - }, - "attr": { - "rmbmoney": 7300, - "jinbi": 530000000 - } - }, - "16_6575b61caff1b610d8bc6c96": { - "item": { - "24": 6, - "10": 200, - "12": 55000, - "600": 20, - "18": 1400, - "1": 16200000, - "2": 64900, - "6": 180, - "9": 3500 - }, - "attr": { - "rmbmoney": 14400, - "jinbi": 840000000 - } - }, - "14_6574f2e66c7af0fe3713b718": { - "item": { - "1": 48800000, - "12": 12700, - "2": 90900, - "6": 655 - }, - "attr": { - "rmbmoney": 12400, - "jinbi": 1100000000 - } - }, - "11_65740da4deb68620911e96ef": { - "item": { - "1": 64200000, - "18": 5580, - "12": 28300, - "2": 265400, - "6": 820 - }, - "attr": { - "rmbmoney": 33800, - "jinbi": 3270000000 - } - }, - "15_657594c3a7981612a8ea7e0e": { - "item": { - "1": 96800000, - "18": 8870, - "12": 3700, - "2": 397200, - "6": 1230 - }, - "attr": { - "rmbmoney": 50400, - "jinbi": 4920000000 - } - }, - "11_657434f8290f4393568f16fe": { - "item": { - "1": 129000000, - "12": 198300, - "2": 392100, - "6": 1630 - }, - "attr": { - "jinbi": 6500000000 - } - }, - "14_657512ee7aecd430eb872b5d": { - "item": { - "1": 121800000, - "12": 36400, - "2": 363400, - "6": 1530 - }, - "attr": { - "rmbmoney": 31500, - "jinbi": 6150000000 - } - }, - "11_657454089beef4c060edab88": { - "item": { - "1": 96600000, - "18": 8660, - "12": 149200, - "2": 392900, - "6": 1215 - }, - "attr": { - "rmbmoney": 49800, - "jinbi": 4890000000 - } - }, - "10_6573e8aa80a92f081d7930b4": { - "item": { - "1": 242400000, - "18": 16210, - "12": 84100, - "2": 978800, - "6": 3040 - }, - "attr": { - "rmbmoney": 123100, - "jinbi": 12180000000 - } - }, - "11_6573fd7a08e89e5a6859446e": { - "item": { - "1": 178200000, - "18": 16230, - "12": 10900, - "2": 717000, - "6": 2225 - }, - "attr": { - "rmbmoney": 92000, - "jinbi": 8990000000 - } - }, - "11_65744fe2d0256beb85eed193": { - "item": { - "1": 262800000, - "18": 25540, - "12": 55800, - "2": 1057600, - "6": 3275 - }, - "attr": { - "rmbmoney": 134000, - "jinbi": 13190000000 - } - }, - "11_657440e7ee44bd9935bbbd7c": { - "item": { - "1": 83000000, - "18": 7160, - "12": 250900, - "2": 341800, - "6": 1055 - }, - "attr": { - "rmbmoney": 43300, - "jinbi": 4220000000 - } - }, - "11_657420932dd070117eb15e92": { - "item": { - "1": 307400000, - "18": 29210, - "12": 50200, - "2": 1239200, - "6": 3880 - }, - "attr": { - "jinbi": 15470000000 - } - }, - "14_65750da36439ef15582d6e6d": { - "item": { - "1": 105000000, - "12": 93900, - "2": 361000, - "6": 1335 - }, - "attr": { - "rmbmoney": 54100, - "jinbi": 5310000000 - } - }, - "12_6574762427bd4264da46ce63": { - "item": { - "1": 44400000, - "18": 3390, - "12": 15900, - "2": 185000, - "6": 555 - }, - "attr": { - "rmbmoney": 25000, - "jinbi": 2290000000 - } - }, - "16_6575e1625685671e63fe001f": { - "item": { - "1": 12600000, - "2": 51400, - "6": 155 - }, - "attr": { - "rmbmoney": 9200, - "jinbi": 710000000 - } - }, - "10_6573e236a884822d244816a0": { - "item": { - "1": 76200000, - "18": 6760, - "12": 79600, - "2": 310200, - "6": 945 - }, - "attr": { - "rmbmoney": 40700, - "jinbi": 3870000000 - } - }, - "10_6573a17268053554fe606611": { - "item": { - "1": 109200000, - "18": 9410, - "12": 58000, - "2": 428000, - "6": 2365 - }, - "attr": { - "rmbmoney": 55000, - "jinbi": 5240000000 - } - }, - "15_657595a3a7981612a8ea8009": { - "item": { - "1": 19200000, - "18": 830, - "12": 74800, - "2": 84100, - "6": 1115 - }, - "attr": { - "rmbmoney": 11300, - "jinbi": 990000000 - } - }, - "11_657438a83bc021c4e335f86e": { - "item": { - "1": 71200000, - "18": 6300, - "12": 55600, - "2": 292500, - "6": 905 - }, - "attr": { - "rmbmoney": 37200, - "jinbi": 3600000000 - } - }, - "10_6573e0395fe4caaf29a9b83c": { - "item": { - "1": 9000000, - "12": 184000, - "2": 45800, - "6": 135 - }, - "attr": { - "rmbmoney": 6400, - "jinbi": 530000000 - } - }, - "10_6573e596dc05fa03150d7db1": { - "item": { - "1": 12800000, - "18": 410, - "12": 15400, - "2": 60000, - "6": 175 - }, - "attr": { - "rmbmoney": 8200, - "jinbi": 690000000 - } - }, - "14_65752c79c85dd4cf1a874893": { - "item": { - "1": 14200000, - "12": 33700, - "2": 64500, - "6": 185 - }, - "attr": { - "rmbmoney": 8900, - "jinbi": 790000000 - } - }, - "12_657455ed6b804f4a6d4b53a2": { - "item": { - "1": 160800000, - "18": 14900, - "12": 4800, - "2": 650900, - "6": 2025 - }, - "attr": { - "rmbmoney": 82000, - "jinbi": 8080000000 - } - }, - "12_657481316ad7b8861da8a914": { - "item": { - "1": 5600000, - "18": 450, - "12": 34600, - "2": 25500, - "6": 65 - }, - "attr": { - "rmbmoney": 7800, - "jinbi": 300000000 - } - }, - "4_6571c11bb0b5337a4d3a63a0": { - "item": { - "24": 7, - "10": 400, - "12": 15600, - "600": 50, - "18": 190, - "1": 5200000, - "2": 16300, - "6": 10, - "9": 8500 - }, - "attr": { - "rmbmoney": 8800, - "jinbi": 310000000 - } - }, - "10_6573714bc7069a58e96ba077": { - "item": { - "1": 14400000, - "18": 610, - "12": 11800, - "2": 66400, - "6": 190 - }, - "attr": { - "rmbmoney": 9000, - "jinbi": 770000000 - } - }, - "11_65744ba29beef4c060ed803c": { - "item": { - "1": 331800000, - "12": 14800, - "2": 1001400, - "6": 4155 - }, - "attr": { - "rmbmoney": 167500, - "jinbi": 16670000000 - } - }, - "16_6575d57c5685671e63fdb6ee": { - "item": { - "1": 13600000, - "12": 42700, - "2": 44500, - "6": 420 - }, - "attr": { - "rmbmoney": 7000, - "jinbi": 430000000 - } - }, - "13_658796c52d0c66fa1adb86fc": { - "item": { - "1": 21000000, - "12": 81300, - "2": 69800, - "6": 275 - }, - "attr": { - "rmbmoney": 12400, - "jinbi": 1140000000 - } - }, - "11_65743bb09beef4c060ed46e7": { - "item": { - "10": 300, - "12": 8100, - "600": 30, - "18": 920, - "1": 18400000, - "2": 69600, - "6": 170, - "9": 4500 - }, - "attr": { - "rmbmoney": 13700, - "jinbi": 950000000 - } - }, - "10_6573bb4b68053554fe60940c": { - "item": { - "1": 19400000, - "18": 1080, - "12": 63000, - "2": 83100, - "6": 235 - }, - "attr": { - "rmbmoney": 12300, - "jinbi": 1010000000 - } - }, - "16_6575d97df2211cd2ff29ba12": { - "item": { - "1": 3400000, - "12": 11100, - "2": 16700, - "6": 50 - }, - "attr": { - "rmbmoney": 5000, - "jinbi": 250000000 - } - }, - "11_657434c6d0256beb85ee6fae": { - "item": { - "1": 80600000, - "18": 7360, - "12": 232000, - "2": 332200, - "6": 1025 - }, - "attr": { - "rmbmoney": 42100, - "jinbi": 4090000000 - } - }, - "16_6575b6d0f6ef8b7da5c84bf0": { - "item": { - "1": 70600000, - "12": 29700, - "2": 218200, - "6": 900 - }, - "attr": { - "rmbmoney": 36000, - "jinbi": 3610000000 - } - }, - "10_6587fbf00c11d852663c5bbb": { - "item": { - "1": 26800000, - "18": 1940, - "12": 168000, - "2": 118300, - "6": 350 - }, - "attr": { - "rmbmoney": 15300, - "jinbi": 1410000000 - } - }, - "10_657397c2f31ed0c046ef3730": { - "item": { - "1": 220800000, - "18": 1900, - "12": 8800, - "2": 701400, - "6": 2780 - }, - "attr": { - "rmbmoney": 112100, - "jinbi": 11100000000 + + const uids = Object.keys(con); + let _users = await G.mongodb.find('user', { uid: { $in: uids } }) + for (let i = 0; i < _users.length; i++) { + let user = _users[i] + const uid = user.uid + const _delattr = con[uid]["attr"] + const _delitem = con[uid]["item"] + let _setUserData = {} + let _dellog = { "attr": {}, "item": {} } + for (let t in _delattr) { + if (t == "rmbmoney") { + let v = user.rmbmoney - _delattr[t] + if (v < 0) { v = 0 } + _setUserData[t] = v + _dellog["attr"][t] = { "old": user.rmbmoney, "new": v } + } + else if (t == "jinbi") { + let v = user.jinbi - _delattr[t] + if (v < 0) { v = 0 } + _setUserData[t] = v + _dellog["attr"][t] = { "old": user.jinbi, "new": v } + } + } + + const itemIds = Object.keys(_delitem); + // 删除item + let _itemlist = await G.mongodb.collection('item').find({ "uid": uid, "itemId": { "$in": itemIds } }).toArray(); + for (let i = 0; i < _itemlist.length; i++) { + const _item = _itemlist[i] + const _itemid = _item.itemId + const del = _delitem[_itemid] || 0 + let v = _item.num - del + if (v < 0) { v = 0 } + let _setItemData = {} + _setItemData["num"] = v + _dellog["item"][_itemid] = { "old": _item.num, "new": v } + await G.mongodb.collection('item').updateOne({ "uid": uid, "itemId": _itemid }, { "$set": _setItemData }); + } + await G.mongodb.collection('user').updateOne({ "uid": uid }, { "$set": _setUserData }); + // 输出日志 + console.log(uid, ":", _dellog); } + + return "sucess!!!" + } + + + + async run() { + await this.fun1(1); } } - const uids = Object.keys(con); - let _users = await G.mongodb.find('user',{uid:{$in: uids}}) - for(let i = 0; i < _users.length; i++) { - let user = _users[i] - const uid = user.uid - const _delattr = con[uid]["attr"] - const _delitem= con[uid]["item"] - let _setUserData = {} - let _dellog = {"attr": {}, "item":{}} - for (let t in _delattr) { - if (t == "rmbmoney") { - let v = user.rmbmoney - _delattr[t] - if (v < 0){ v = 0} - _setUserData[t] = v - _dellog["attr"][t] = {"old":user.rmbmoney, "new": v} - } - else if (t == "jinbi") { - let v = user.jinbi - _delattr[t] - if (v < 0){ v = 0} - _setUserData[t] = v - _dellog["attr"][t] = {"old":user.jinbi, "new": v} - } - } - - const itemIds = Object.keys(_delitem); - // 删除item - let _itemlist = await G.mongodb.collection('item').find({"uid":uid, "itemId":{"$in": itemIds}}).toArray(); - for(let i = 0; i < _itemlist.length; i++) { - const _item = _itemlist[i] - const _itemid = _item.itemId - const del = _delitem[_itemid] || 0 - let v = _item.num - del - if (v < 0){ v = 0} - let _setItemData = {} - _setItemData["num"] = v - _dellog["item"][_itemid] = {"old":_item.num, "new": v} - await G.mongodb.collection('item').updateOne({"uid":uid, "itemId":_itemid}, {"$set": _setItemData}); - } - await G.mongodb.collection('user').updateOne({"uid":uid}, {"$set": _setUserData}); - // 输出日志 - console.log(uid,":", _dellog); - } - - return "sucess!!!" - } - - - - 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); + await patchInit() + let patch = new Path(); + await patch.run(); + console.log("逻辑执行完成,等待退出"); + setTimeout(function () { + console.log('结束程序'); + process.exit(); + }, 3000); } main(); diff --git a/src/public/fight.ts b/src/public/fight.ts index b2029a4..22abc1b 100644 --- a/src/public/fight.ts +++ b/src/public/fight.ts @@ -1,43 +1,43 @@ -import {ApiCall, TsrpcError} from 'tsrpc'; -import {FightControl} from '../shared/fightControl/fightCntrol'; -import {formatNpcData} from '../shared/fightControl/fightFun'; -import {fightResult, joinFightData, roleDataType} from '../shared/fightControl/fightType'; -import {rankInfo} from '../shared/protocols/type'; -import {HeroShared} from '../shared/public/hero'; -import {PlayerShared} from '../shared/public/player'; -import {HeroFun} from './hero'; -import {UserFun} from './user'; -import {re, string} from "mathjs"; -import {getGud} from './gud'; -import {PushGiftFun} from "./pushgift"; +import { ApiCall, TsrpcError } from 'tsrpc'; +import { FightControl } from '../shared/fightControl/fightCntrol'; +import { formatNpcData } from '../shared/fightControl/fightFun'; +import { fightResult, joinFightData, roleDataType } from '../shared/fightControl/fightType'; +import { rankInfo } from '../shared/protocols/type'; +import { HeroShared } from '../shared/public/hero'; +import { PlayerShared } from '../shared/public/player'; +import { HeroFun } from './hero'; +import { UserFun } from './user'; +import { re, string } from "mathjs"; +import { getGud } from './gud'; +import { PushGiftFun } from "./pushgift"; type fightType = 'tanxian' | 'pata' | 'jjc' | 'gbtx' | 'qjzzd' | 'meirishilian' | 'wzrycross'; -let fights:{[key:string]:FightControl} = { - +let fights: { [key: string]: FightControl } = { + }; -function clearFights (){ +function clearFights() { //定时清理战斗 - setInterval(()=>{ + setInterval(() => { let now = Date.now(); - for (let key in fights){ - if (now - fights[key].startTime > 30000){ - console.log("清理战斗",key); - try{ + for (let key in fights) { + if (now - fights[key].startTime > 30000) { + console.log("清理战斗", key); + try { fights[key].release(); - }catch(e){ + } catch (e) { console.error(e); } delete fights[key]; } } - },5000); + }, 5000); } clearFights(); export class FightFun { - static fightIndex:number = 0; + static fightIndex: number = 0; static fight(data: joinFightData[], maxRoundNums = 30, fightType: "pvp" | "pve" = 'pvp') { this.fightIndex++; @@ -80,16 +80,20 @@ export class FightFun { }); return { - player: {...player, buff: PlayerShared.getBuff(player)}, + player: { ...player, buff: PlayerShared.getBuff(player) }, roles: roles }; } /**挑战竞技场 */ static async fightJJc(call: ApiCall, rankInfo: rankInfo) { - if (rankInfo.player.uid.indexOf('npc_') != -1) return await this.fightNpc(call, G.gc.jjc_npc[rankInfo.player.uid].npcId, 'jjc', await this.getPlayerFightData(call.conn.uid)); + let result; - let result = this.fight([await this.getPlayerFightData(call.conn.uid), await this.getPlayerFightData(rankInfo.player.uid)]); + if (rankInfo.player.uid.indexOf('npc_') != -1) { + result = await this.fightNpc(call, G.gc.jjc_npc[rankInfo.player.uid].npcId, 'jjc', await this.getPlayerFightData(call.conn.uid)); + } else { + result = this.fight([await this.getPlayerFightData(call.conn.uid), await this.getPlayerFightData(rankInfo.player.uid)]); + } // 竞技场 战败触发推送礼包 if (result.winSide != 0) { @@ -130,14 +134,14 @@ export class FightFun { * @param result */ static async saveLog(uid: string, type: string, result: fightResult) { - let writeList = ['ganhai', 'jjc', 'hbzbJfs', 'hbzbZbs', 'slzd', 'clsl'] + let writeList = ['ganhai', 'jjc', 'hbzbJfs', 'hbzbZbs', 'slzd', 'clsl'] if (uid.indexOf('npc') != -1 || !writeList.includes(type)) return; - G.mongodb.collection('fightLog').insertOne({uid, type, ...result}) + G.mongodb.collection('fightLog').insertOne({ uid, type, ...result }) } static async readLog(uid: string, type: string, len = 20) { - return await G.mongodb.collection('fightLog').find({uid, type}).limit(len).toArray() || [] + return await G.mongodb.collection('fightLog').find({ uid, type }).limit(len).sort({ _id: -1 }).toArray() || [] } } \ No newline at end of file From 666b7e51c51d5aa7de609f7d561e0bd3df8c11f3 Mon Sep 17 00:00:00 2001 From: xichaoyin Date: Tue, 9 Jan 2024 22:23:42 +0800 Subject: [PATCH 05/42] =?UTF-8?q?fix:fightlog=E6=B7=BB=E5=8A=A0ttl?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/module/collection_fightLog.ts | 2 +- src/public/fight.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/module/collection_fightLog.ts b/src/module/collection_fightLog.ts index a0bc0d5..58f84d9 100644 --- a/src/module/collection_fightLog.ts +++ b/src/module/collection_fightLog.ts @@ -1,4 +1,4 @@ import {fightResult} from '../shared/fightControl/fightType'; -export type CollectionFightLog = fightResult & { uid: string, type: string }; \ No newline at end of file +export type CollectionFightLog = fightResult & { uid: string, type: string, ttl: Date}; \ No newline at end of file diff --git a/src/public/fight.ts b/src/public/fight.ts index 22abc1b..2b211b9 100644 --- a/src/public/fight.ts +++ b/src/public/fight.ts @@ -137,7 +137,7 @@ export class FightFun { let writeList = ['ganhai', 'jjc', 'hbzbJfs', 'hbzbZbs', 'slzd', 'clsl'] if (uid.indexOf('npc') != -1 || !writeList.includes(type)) return; - G.mongodb.collection('fightLog').insertOne({ uid, type, ...result }) + G.mongodb.collection('fightLog').insertOne({ uid, type, ...result, ttl: new Date() }) } From 0ddd611c593a41849d7f772b2066d89c3ed5d68c Mon Sep 17 00:00:00 2001 From: ciniao <4041990@qq.com> Date: Tue, 9 Jan 2024 22:30:35 +0800 Subject: [PATCH 06/42] =?UTF-8?q?=E5=8E=BB=E6=8E=89=E6=97=A0=E6=95=88?= =?UTF-8?q?=E5=88=B7=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api_s2c/jjc/ApiOpen.ts | 2 +- src/public/jjc.ts | 58 +++++++++++++++++++------------------- src/public/player.ts | 37 ++++++++++++++++++++++++ 3 files changed, 67 insertions(+), 30 deletions(-) diff --git a/src/api_s2c/jjc/ApiOpen.ts b/src/api_s2c/jjc/ApiOpen.ts index 700ada3..0d6b0ee 100644 --- a/src/api_s2c/jjc/ApiOpen.ts +++ b/src/api_s2c/jjc/ApiOpen.ts @@ -30,6 +30,6 @@ export default async function (call: ApiCall) { }); UserFun.activeHeadFrame(call.uid, 'jjc_rank', data["rank"] + 1); - JJCFun.checkUpdatePlayer() + //JJCFun.checkUpdatePlayer() } \ No newline at end of file diff --git a/src/public/jjc.ts b/src/public/jjc.ts index d571417..67726f1 100644 --- a/src/public/jjc.ts +++ b/src/public/jjc.ts @@ -94,37 +94,37 @@ export class JJCFun { * @param uTimeOffset * @param isUpdate 是否更新数据 */ - static async checkUpdatePlayer(min: number = 0, max: number = 1000, uTimeOffset: number = 600, isUpdate: boolean = true) { - // 获取指定排名用户uid - let sortInfo = await this.getRankListUid(min, max) - if (!sortInfo.length) return [] - let updateArr = [] + // static async checkUpdatePlayer(min: number = 0, max: number = 1000, uTimeOffset: number = 600, isUpdate: boolean = true) { + // // 获取指定排名用户uid + // let sortInfo = await this.getRankListUid(min, max) + // if (!sortInfo.length) return [] + // let updateArr = [] - let users = await G.redis.hGetAll('rank:jjc:data') + // let users = await G.redis.hGetAll('rank:jjc:data') - for (let i = 0; i < sortInfo.length; i++) { - let uid = sortInfo[i] - let rankInfo = users[uid] - if (!rankInfo?.player) continue - // 比对utime,判断是否更新数据 - if (!rankInfo.player.isNpc) { - if (!rankInfo.utime || (rankInfo.utime && rankInfo.utime < (G.time - uTimeOffset))) { - updateArr.push(rankInfo) - } - } - } - // 更新数据 - if (isUpdate && updateArr.length > 0) { - let playerArrInfo = await G.mongodb.collection("user").find({uid: {$in: updateArr.map(i => i.uid)}}).toArray() - for (let i = 0; i < playerArrInfo.length; i++) { - let playerInfo = playerArrInfo[i] - let index = updateArr.findIndex(x => x.player.uid == playerInfo.uid) - updateArr[index].player = playerInfo - updateArr[index].utime = G.time - this.updatePlayerData(playerInfo.uid, updateArr[index]); - } - } - } + // for (let i = 0; i < sortInfo.length; i++) { + // let uid = sortInfo[i] + // let rankInfo = users[uid] + // if (!rankInfo?.player) continue + // // 比对utime,判断是否更新数据 + // if (!rankInfo.player.isNpc) { + // if (!rankInfo.utime || (rankInfo.utime && rankInfo.utime < (G.time - uTimeOffset))) { + // updateArr.push(rankInfo) + // } + // } + // } + // // 更新数据 + // if (isUpdate && updateArr.length > 0) { + // let playerArrInfo = await G.mongodb.collection("user").find({uid: {$in: updateArr.map(i => i.uid)}}).toArray() + // for (let i = 0; i < playerArrInfo.length; i++) { + // let playerInfo = playerArrInfo[i] + // let index = updateArr.findIndex(x => x.player.uid == playerInfo.uid) + // updateArr[index].player = playerInfo + // updateArr[index].utime = G.time + // this.updatePlayerData(playerInfo.uid, updateArr[index]); + // } + // } + // } /** * 获取指定范围排名的用户,仅返回uid[] diff --git a/src/public/player.ts b/src/public/player.ts index 2647bce..1cf7ef2 100644 --- a/src/public/player.ts +++ b/src/public/player.ts @@ -19,6 +19,8 @@ import {getGud, setGud} from './gud'; import {addGameLog} from "../gameLog"; import {PushGiftFun} from "./pushgift"; import { ActionLog } from './actionLog/actionLog'; +import { roleDataType } from '../shared/fightControl/fightType'; +import { PlayerShared } from '../shared/public/player'; export type call = { @@ -41,6 +43,41 @@ export type call = { }; export class PlayerFun { + /** + * 通过uid获取战斗数据 + * @param uid + * @returns + */ + static async getDefaultFightDataByUid(uid:string){ + let gud = await getGud(uid); + let posObj = gud.heroPos; + let roles: k_v = {}; + if (gud.selectMatrix && gud.matrixPos) { + posObj = gud.matrixPos[gud.selectMatrix]; + } + let heros = await HeroFun.getHeros({uid:uid}, Object.values(posObj).filter(_id => _id != '') as string[]); + let otherBuff = UserFun.getOtherBuff(gud) + + Object.entries(posObj).forEach(obj => { + let pos = obj[0]; + let _id = obj[1]; + let hero = heros.filter(h => h._id == _id)[0]; + + if (hero) { + roles[pos] = { + ...hero, + attr: { + ...HeroShared.getHeroBasicAttr(hero, { ...otherBuff, allBuff: HeroShared.getAllBuff(heros) }, Number(pos)) + } + }; + } + }); + + return { + player: { ...gud, buff: PlayerShared.getBuff(gud) }, + roles: roles + }; + } /** * 获取玩家atn数量 */ From 51ddb556375fa7191facfaed04138537e9138ee8 Mon Sep 17 00:00:00 2001 From: xichaoyin Date: Wed, 10 Jan 2024 13:38:27 +0800 Subject: [PATCH 07/42] =?UTF-8?q?fix:=E7=8E=A9=E5=AE=B6=E9=82=AE=E4=BB=B6?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=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_20240110.ts | 51 +++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 src/fix_patch/patch_20240110.ts diff --git a/src/fix_patch/patch_20240110.ts b/src/fix_patch/patch_20240110.ts new file mode 100644 index 0000000..103ec36 --- /dev/null +++ b/src/fix_patch/patch_20240110.ts @@ -0,0 +1,51 @@ +import { patchInit } from "../patch"; + + +class Path { + + async fun1(a: any) { + let taskType = 2; + let users = await G.mongodb.collection('user').find({ loginTime: { $gte: 1704643200 } }).toArray(); + for (let i = 0; i < users.length; i++) { + let user = users[i]; + let unFinishTask = (await G.mongodb.collection('task').find({ + uid: user.uid, type: taskType, finish: 0 + }, { projection: { taskid: 1 } }).toArray()).map(i => i.taskid); + + if (unFinishTask.length >= 2) { + for (let taskid of unFinishTask) { + let con = G.gc.task[taskType][taskid]; + if (!con) { + await G.mongodb.collection("task").deleteOne({ + uid: user.uid, taskid: taskid + }); + console.log(`删除玩家${user.uid}任务:${taskid}`); + } + if (unFinishTask.includes(con.pretask)) { + await G.mongodb.collection("task").deleteOne({ + uid: user.uid, taskid: taskid + }); + console.log(`删除玩家${user.uid}任务:${taskid}`); + } + } + } + } + } + + + 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 f802242b352bcb201a690b14b787bf23409dc983 Mon Sep 17 00:00:00 2001 From: ciniao <4041990@qq.com> Date: Wed, 10 Jan 2024 14:00:48 +0800 Subject: [PATCH 08/42] =?UTF-8?q?fix:=E8=87=AA=E9=80=89=E7=A4=BC=E5=8C=85?= =?UTF-8?q?=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/public/pay.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/public/pay.ts b/src/public/pay.ts index bf4deb7..6052922 100644 --- a/src/public/pay.ts +++ b/src/public/pay.ts @@ -260,7 +260,10 @@ export class PayFun { let selectPrize = await G.ioredis.get(`pay:${payId}:${player.uid}`); if (selectPrize) { prize.push(...JSON.parse(selectPrize)) - G.ioredis.del(`pay:${payId}:${player.uid}`) + //支付A check -> 玩家支付 -> 网络延迟 + //支付B check -> 玩家支付 -> pay -> del + //支付A -> pay 时,这里可能被清了,导致给玩家发放了空的奖励,因此,这里不清除 + //G.ioredis.del(`pay:${payId}:${player.uid}`) } } From 0a296d739a7074393305037f7a6e78b41528a841 Mon Sep 17 00:00:00 2001 From: xichaoyin Date: Wed, 10 Jan 2024 14:52:41 +0800 Subject: [PATCH 09/42] =?UTF-8?q?fix:=E5=B1=8F=E8=94=BD=E6=A3=80=E6=B5=8B?= =?UTF-8?q?=E7=94=9F=E6=88=90=E6=96=B0=E7=9A=84=E4=BB=BB=E5=8A=A1=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/public/task.ts | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/src/public/task.ts b/src/public/task.ts index 89da6db..aef5687 100644 --- a/src/public/task.ts +++ b/src/public/task.ts @@ -261,28 +261,28 @@ export class TaskFun { delete _w["finish"]; } let _tmp = await this.getUserTaksList(call.uid, _w); - // 没有未完成任务 - // 检测是否有新加任务 - if (_tmp.length == 0) { - let rectask = (await G.mongodb.collection('task').find( - { uid: call.uid, type: _type }, { projection: { taskid: 1, _id: 0 } } - ).toArray()).map(e => e.taskid); + // // 没有未完成任务 后续添加任务直接使用脚本刷任务 + // // 检测是否有新加任务 + // if (_tmp.length == 0) { + // let rectask = (await G.mongodb.collection('task').find( + // { uid: call.uid, type: _type }, { projection: { taskid: 1, _id: 0 } } + // ).toArray()).map(e => e.taskid); - for (let taskid of rectask) { - let conf = G.gc.task[_type][taskid]; - // 配置不存在 - // 没有后续任务 - // 后续任务已完成 - if (!conf || !conf.followtask || rectask.includes(conf.followtask)) { - continue - } + // for (let taskid of rectask) { + // let conf = G.gc.task[_type][taskid]; + // // 配置不存在 + // // 没有后续任务 + // // 后续任务已完成 + // if (!conf || !conf.followtask || rectask.includes(conf.followtask)) { + // continue + // } - // 生成后续任务 - await this.setTaskInfo(call, conf.followtask, { type: _type }); - break; - } - _tmp = await this.getUserTaksList(call.uid, _w); - } + // // 生成后续任务 + // await this.setTaskInfo(call, conf.followtask, { type: _type }); + // break; + // } + // _tmp = await this.getUserTaksList(call.uid, _w); + // } _r[_type] = _tmp; } return _r; From 452f5f3d149454a01bef45d21fd6b5ca7007215f Mon Sep 17 00:00:00 2001 From: xichaoyin Date: Wed, 10 Jan 2024 15:19:38 +0800 Subject: [PATCH 10/42] =?UTF-8?q?patch:=E4=BB=BB=E5=8A=A1=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=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_20240110.ts | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/src/fix_patch/patch_20240110.ts b/src/fix_patch/patch_20240110.ts index 103ec36..1597954 100644 --- a/src/fix_patch/patch_20240110.ts +++ b/src/fix_patch/patch_20240110.ts @@ -13,21 +13,11 @@ class Path { }, { projection: { taskid: 1 } }).toArray()).map(i => i.taskid); if (unFinishTask.length >= 2) { - for (let taskid of unFinishTask) { - let con = G.gc.task[taskType][taskid]; - if (!con) { - await G.mongodb.collection("task").deleteOne({ - uid: user.uid, taskid: taskid - }); - console.log(`删除玩家${user.uid}任务:${taskid}`); - } - if (unFinishTask.includes(con.pretask)) { - await G.mongodb.collection("task").deleteOne({ - uid: user.uid, taskid: taskid - }); - console.log(`删除玩家${user.uid}任务:${taskid}`); - } - } + unFinishTask.sort().slice(1); + await G.mongodb.collection("task").deleteOne({ + uid: user.uid, taskid: { $in: unFinishTask } + }); + console.log(`删除玩家${user.uid}任务:${unFinishTask}`); } } } From 0932d3ee4741688c0c209afd2253c7b462b17bed Mon Sep 17 00:00:00 2001 From: xichaoyin Date: Wed, 10 Jan 2024 15:46:41 +0800 Subject: [PATCH 11/42] =?UTF-8?q?patch:=E7=BB=88=E8=BA=AB=E5=8D=A1?= =?UTF-8?q?=E5=91=A8=E5=A5=96=E5=8A=B1=E8=A1=A5=E5=8F=91=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_20240110.ts | 82 +++++++++++++++++++++++++++++++-- 1 file changed, 78 insertions(+), 4 deletions(-) diff --git a/src/fix_patch/patch_20240110.ts b/src/fix_patch/patch_20240110.ts index 1597954..8f48a19 100644 --- a/src/fix_patch/patch_20240110.ts +++ b/src/fix_patch/patch_20240110.ts @@ -1,8 +1,44 @@ +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 addEmail(email: ReqEmail & { createTime?: number; }) { + let { prize, uid, ...e } = email; + let lng = await G.redis.rawGet(`user:lng:${uid}`) + + let sendEmail: MsgEmail = { + _id: null, + uid: uid, + type: e.type, + title: e.lngTitle ? (e.lngTitle[lng] || e.lngTitle['ja']) : e.title, + content: e.lngContent ? (e.lngContent[lng] || e.lngContent['ja']) : e.content, + createTime: e.createTime || G.time, + contentInsertArr: e.contentInsertArr || [] + }; + + if (prize?.length > 0) { + sendEmail.prizeData = { + prize: email.prize, + isGet: false + }; + } + + if (email.g123log && Object.keys(email.g123log).length > 0) sendEmail.g123log = email.g123log; + + if (email.lngTitle) { + sendEmail.lngTitle = email.lngTitle + sendEmail.lngContent = email.lngContent + } + + await G.mongodb.collection('email').insertOne({ + ttl: new Date(), ...G.mongodb.conversionIdObj(sendEmail) + }); + } + async fun1(a: any) { let taskType = 2; let users = await G.mongodb.collection('user').find({ loginTime: { $gte: 1704643200 } }).toArray(); @@ -13,18 +49,56 @@ class Path { }, { projection: { taskid: 1 } }).toArray()).map(i => i.taskid); if (unFinishTask.length >= 2) { - unFinishTask.sort().slice(1); + let deltask = unFinishTask.sort().slice(1); await G.mongodb.collection("task").deleteOne({ - uid: user.uid, taskid: { $in: unFinishTask } + uid: user.uid, taskid: { $in: deltask } }); - console.log(`删除玩家${user.uid}任务:${unFinishTask}`); + console.log(`删除玩家${user.uid}任务:${deltask}`); + } + } + } + /** + * 补发玩家终身卡奖励 + */ + async fun2(a: any) { + let logs = await G.mongodb.collection("payLogNew").find( + { key: "zhongshenka", del_time: { $exists: false } }, { projection: { _id: 0, } } + ).toArray(); + + if (logs.length == 0) { + console.log("没有终身卡数据,不发放终身卡"); + } + let wzt = PublicShared.getToWeekMondayZeroTime(); + let con = G.gc.payEmail.zhongshenka.filter(e => e.day == 7)[0]; + for (let i = 0; i < logs.length; i++) { + + // 查询玩家邮件 + let emails = await G.mongodb.collection('email').find({ + uid: logs[i].uid, title: con.title, createTime: { $gte: wzt } + }).toArray(); + + + if (emails.length == 0) { + // 发送邮件 + this.addEmail({ + uid: logs[i].uid, + type: "system", + title: con.title, + content: con.content, + contentInsertArr: [], + createTime: G.time, + prize: con.prize, + }) + console.log("发放终身卡", logs[i].uid); + } else { + console.log("本周已发送过 不发放终身卡", logs[i].uid); } } } - async run() { await this.fun1(1); + await this.fun2(1); } } From ca3e973afd18a2cf44bb76e35bdc320d341bcdc2 Mon Sep 17 00:00:00 2001 From: xichaoyin Date: Wed, 10 Jan 2024 15:50:49 +0800 Subject: [PATCH 12/42] =?UTF-8?q?patch:=E7=BB=88=E8=BA=AB=E5=8D=A1?= =?UTF-8?q?=E5=91=A8=E5=A5=96=E5=8A=B1=E8=A1=A5=E5=8F=91=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_20240110.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/fix_patch/patch_20240110.ts b/src/fix_patch/patch_20240110.ts index 8f48a19..9bfeeec 100644 --- a/src/fix_patch/patch_20240110.ts +++ b/src/fix_patch/patch_20240110.ts @@ -67,7 +67,9 @@ class Path { if (logs.length == 0) { console.log("没有终身卡数据,不发放终身卡"); + return } + let wzt = PublicShared.getToWeekMondayZeroTime(); let con = G.gc.payEmail.zhongshenka.filter(e => e.day == 7)[0]; for (let i = 0; i < logs.length; i++) { From a26aa7dab33ecdcf50d6fe0e4237531b2df43f37 Mon Sep 17 00:00:00 2001 From: yushunrui <364203175@qq.com> Date: Wed, 10 Jan 2024 16:44:53 +0800 Subject: [PATCH 13/42] =?UTF-8?q?fix:=E5=A4=84=E7=90=86=E5=BC=BA=E5=8C=96?= =?UTF-8?q?=E4=BC=99=E4=BC=B4=E6=B4=BB=E5=8A=A8=E5=88=9D=E5=A7=8B=E6=B2=A1?= =?UTF-8?q?=E6=9C=89=E4=BB=BB=E5=8A=A1=E8=BF=9B=E5=BA=A6=E7=9A=84=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api_s2c/event/chuanshuozhilu/ApiOpen.ts | 30 +++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/src/api_s2c/event/chuanshuozhilu/ApiOpen.ts b/src/api_s2c/event/chuanshuozhilu/ApiOpen.ts index 27dd5d5..a1d648d 100644 --- a/src/api_s2c/event/chuanshuozhilu/ApiOpen.ts +++ b/src/api_s2c/event/chuanshuozhilu/ApiOpen.ts @@ -12,11 +12,37 @@ export default async function (call: ApiCall) { // 无此活动 return call.error('', { code: -1, message: globalThis.lng.huodong_open_1 }) } - let db = await G.mongodb.cEvent(`chuanshuozhilu${call.req.hdid}`).findOne({ uid: call.uid, type: `chuanshuozhilu${call.req.hdid}` }); + let _info = db?.info || {} + // 如果初始没有数据,就判断玩家是否有活动对应的影响,生成一下初始化数据 + if (!db) { + + let _dbType: `chuanshuozhilu${number}` = `chuanshuozhilu${call.req.hdid}` + const hid = _hdinfo.data.hid + let heros = await G.mongodb.collection("hero").find({uid: call.uid, heroId: hid}) + .sort({ "zhanli": -1 }).limit(1).toArray(); + + if (heros) { + let hero = heros[0] + const lv = hero.lv || 0 + const jieji = hero.jieji || 0 + let setInfo = {"lv": lv, "jieji": jieji} + await G.mongodb.cEvent(_dbType).updateOne( + { uid: call.uid, type: _dbType }, + { $set: G.mongodb.createTreeObj({ key: `info.${hid}`, val: setInfo})}, + { upsert: true} + ) + if (!cache[call.uid]) cache[call.uid] = {hid:{}}; + if (!cache[call.uid][hid]) cache[call.uid][hid] = setInfo; + _info[hid] = setInfo + G.server.sendMsgByUid(call.uid, 'msg_s2c/HongDianChange', ['huodonghd']); + } + + } + call.succ({ - info: db?.info || {}, + info: _info, hdinfo: _hdinfo }); } From 104a1edadcd40f45bcd939ce518d2601c3ae9440 Mon Sep 17 00:00:00 2001 From: ciniao <4041990@qq.com> Date: Wed, 10 Jan 2024 16:57:11 +0800 Subject: [PATCH 14/42] =?UTF-8?q?=E5=A4=A9=E8=B5=8B=E6=8A=80=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/shared/fightControl/fightCntrol.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/shared/fightControl/fightCntrol.ts b/src/shared/fightControl/fightCntrol.ts index 4db74c9..e13a18e 100644 --- a/src/shared/fightControl/fightCntrol.ts +++ b/src/shared/fightControl/fightCntrol.ts @@ -152,7 +152,7 @@ export class FightControl { this.eachLiveRoles((role) => { let heroId = role.roleData.heroId; // let shiwu = role.roleData?.shiwu || {}; - // let talent = role.roleData?.talent || {}; + let talent = role.roleData?.talent || {}; let skills = G.gc.heroskill[heroId][role.roleData.jieji || 0].bdskill || []; skills = skills.concat(role.roleData.attr.skillArr); @@ -161,15 +161,15 @@ export class FightControl { // if (!zhushuan) continue; // if (zhushuan.skill) skills.push(zhushuan.skill); // }; - // const hero_tf = G.gc.hero_tf; - // for (let key in talent) { - // let cdata = hero_tf[key][talent[key]]; - // if (cdata && cdata.skill_effect) skills.push(cdata.skill_effect); - // } + const hero_tf = G.gc.hero_tf; + for (let key in talent) { + let cdata = hero_tf[key][talent[key]]; + if (cdata && cdata.skill_effect) skills.push(cdata.skill_effect); + } // skills.push('tx06309'); - // if (!skills) return; + if (!skills) return; skills.forEach(_skill => { let askillconf = getSkillConf(_skill); if (!askillconf) return console.log('没有技能配置-->', _skill); From 48cd24d309b9209d87df05ae9d6a8913bd6e6bea Mon Sep 17 00:00:00 2001 From: yushunrui <364203175@qq.com> Date: Thu, 11 Jan 2024 18:45:59 +0800 Subject: [PATCH 15/42] =?UTF-8?q?fix:=E8=B6=85=E5=80=BC=E5=9F=BA=E9=87=91?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E5=A5=96=E5=8A=B1=E9=80=BB=E8=BE=91=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E4=B8=BA=E5=90=8C=E6=AD=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api_s2c/event/yuedujijin/ApiRec.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/api_s2c/event/yuedujijin/ApiRec.ts b/src/api_s2c/event/yuedujijin/ApiRec.ts index 039f191..0db9481 100644 --- a/src/api_s2c/event/yuedujijin/ApiRec.ts +++ b/src/api_s2c/event/yuedujijin/ApiRec.ts @@ -16,8 +16,8 @@ export default async function (call: ApiCall) { if (call.req.index > day) return call.errorCode(-3); if (rec.includes(call.req.index)) return call.errorCode(-4); - - G.mongodb.cEvent(type).updateOne({uid: call.uid, type: type}, {$push: {rec: call.req.index}}, {upsert: true}); + // 从异步改成同步 + await G.mongodb.cEvent(type).updateOne({uid: call.uid, type: type}, {$push: {rec: call.req.index}}, {upsert: true}); await PlayerFun.sendPrize(call, [].concat(conf.prize[call.req.index])); From 8aab7b6322b88524b480318a3a95be2eaddf9531 Mon Sep 17 00:00:00 2001 From: yushunrui <364203175@qq.com> Date: Wed, 10 Jan 2024 20:37:58 +0800 Subject: [PATCH 16/42] =?UTF-8?q?fix:=E5=A4=84=E7=90=86=E4=BA=BA=E6=89=8D?= =?UTF-8?q?=E8=AE=A1=E5=88=92=E4=BB=BB=E5=8A=A1=E9=A2=86=E5=8F=96=E6=A0=87?= =?UTF-8?q?=E8=AF=86=E5=9C=A8=E5=88=B7=20=E6=96=B0=E4=B8=80=E8=BD=AE?= =?UTF-8?q?=E7=9A=84=E6=97=B6=E5=80=99=E6=B2=A1=E6=9C=89=E9=87=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api_s2c/event/yangchengmubiao/ApiRec.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/api_s2c/event/yangchengmubiao/ApiRec.ts b/src/api_s2c/event/yangchengmubiao/ApiRec.ts index c7c1bae..6d0efa0 100644 --- a/src/api_s2c/event/yangchengmubiao/ApiRec.ts +++ b/src/api_s2c/event/yangchengmubiao/ApiRec.ts @@ -35,6 +35,7 @@ export default async function (call: ApiCall) { _mydata.lunci += 1 _setData["taskval"] = _mydata.taskval _setData["lunci"] = _mydata.lunci + _setData["finishid"] = _mydata.finishid } // 设置任务改变数据 From 0a94965e3020eaa99c02a1749d467bf25716f80d Mon Sep 17 00:00:00 2001 From: yushunrui <364203175@qq.com> Date: Wed, 10 Jan 2024 21:14:10 +0800 Subject: [PATCH 17/42] =?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/api_s2c/event/chuanshuozhilu/ApiOpen.ts | 1 + src/localConfig.ts | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/api_s2c/event/chuanshuozhilu/ApiOpen.ts b/src/api_s2c/event/chuanshuozhilu/ApiOpen.ts index a1d648d..cad12c5 100644 --- a/src/api_s2c/event/chuanshuozhilu/ApiOpen.ts +++ b/src/api_s2c/event/chuanshuozhilu/ApiOpen.ts @@ -17,6 +17,7 @@ export default async function (call: ApiCall) { // 如果初始没有数据,就判断玩家是否有活动对应的影响,生成一下初始化数据 if (!db) { + let _dbType: `chuanshuozhilu${number}` = `chuanshuozhilu${call.req.hdid}` const hid = _hdinfo.data.hid let heros = await G.mongodb.collection("hero").find({uid: call.uid, heroId: hid}) diff --git a/src/localConfig.ts b/src/localConfig.ts index 5b04b02..d8bcfee 100644 --- a/src/localConfig.ts +++ b/src/localConfig.ts @@ -17,7 +17,7 @@ export default { /**redis url */ redisUrl: 'redis://:lyMaple525458@10.0.1.20:6379/0', /**mongodb url */ - mongodbUrl: 'mongodb://root:lyMaple525458@10.0.1.20:27017/heijiao?authSource=admin', + mongodbUrl: 'mongodb://root:lyMaple525458@10.0.1.20:27017/heijiao_ysr?authSource=admin', /**cross redis url */ crossRedisUrl: 'redis://:lyMaple525458@10.0.1.20:6379/1', /**cross mongodb url */ @@ -27,7 +27,7 @@ export default { /**服务器时间 */ time: '', /**开服时间 */ - openTime: '2023-12-11 1:0:0', + openTime: '2024-01-05 1:0:0', /**项目名称 */ projectName: 'heijiao', /**加密key */ From 363787fb394586da2571baf7d3c02fc4dda4e0bd Mon Sep 17 00:00:00 2001 From: yushunrui <364203175@qq.com> Date: Wed, 10 Jan 2024 21:16:13 +0800 Subject: [PATCH 18/42] =?UTF-8?q?Revert=20"fix:=E7=AB=9E=E6=8A=80=E5=9C=BA?= =?UTF-8?q?=E7=AC=AC=E4=B8=80=E5=90=8D=E5=A4=B4=E5=83=8F=E7=89=B9=E6=AE=8A?= =?UTF-8?q?=E5=A4=84=E7=90=86=EF=BC=8C=E5=8F=AF=E4=BB=A5=E7=94=A8=E9=81=93?= =?UTF-8?q?=E5=85=B7=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 This reverts commit 0a94965e3020eaa99c02a1749d467bf25716f80d. --- src/api_s2c/event/chuanshuozhilu/ApiOpen.ts | 1 - src/localConfig.ts | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/api_s2c/event/chuanshuozhilu/ApiOpen.ts b/src/api_s2c/event/chuanshuozhilu/ApiOpen.ts index cad12c5..a1d648d 100644 --- a/src/api_s2c/event/chuanshuozhilu/ApiOpen.ts +++ b/src/api_s2c/event/chuanshuozhilu/ApiOpen.ts @@ -17,7 +17,6 @@ export default async function (call: ApiCall) { // 如果初始没有数据,就判断玩家是否有活动对应的影响,生成一下初始化数据 if (!db) { - let _dbType: `chuanshuozhilu${number}` = `chuanshuozhilu${call.req.hdid}` const hid = _hdinfo.data.hid let heros = await G.mongodb.collection("hero").find({uid: call.uid, heroId: hid}) diff --git a/src/localConfig.ts b/src/localConfig.ts index d8bcfee..5b04b02 100644 --- a/src/localConfig.ts +++ b/src/localConfig.ts @@ -17,7 +17,7 @@ export default { /**redis url */ redisUrl: 'redis://:lyMaple525458@10.0.1.20:6379/0', /**mongodb url */ - mongodbUrl: 'mongodb://root:lyMaple525458@10.0.1.20:27017/heijiao_ysr?authSource=admin', + mongodbUrl: 'mongodb://root:lyMaple525458@10.0.1.20:27017/heijiao?authSource=admin', /**cross redis url */ crossRedisUrl: 'redis://:lyMaple525458@10.0.1.20:6379/1', /**cross mongodb url */ @@ -27,7 +27,7 @@ export default { /**服务器时间 */ time: '', /**开服时间 */ - openTime: '2024-01-05 1:0:0', + openTime: '2023-12-11 1:0:0', /**项目名称 */ projectName: 'heijiao', /**加密key */ From b80263ed16ac6f2910136123dbb5b016c27155dd Mon Sep 17 00:00:00 2001 From: yushunrui <364203175@qq.com> Date: Wed, 10 Jan 2024 21:17:04 +0800 Subject: [PATCH 19/42] =?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/api_s2c/event/chuanshuozhilu/ApiOpen.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/api_s2c/event/chuanshuozhilu/ApiOpen.ts b/src/api_s2c/event/chuanshuozhilu/ApiOpen.ts index a1d648d..bd9bf35 100644 --- a/src/api_s2c/event/chuanshuozhilu/ApiOpen.ts +++ b/src/api_s2c/event/chuanshuozhilu/ApiOpen.ts @@ -35,6 +35,7 @@ export default async function (call: ApiCall) { if (!cache[call.uid]) cache[call.uid] = {hid:{}}; if (!cache[call.uid][hid]) cache[call.uid][hid] = setInfo; _info[hid] = setInfo + G.server.sendMsgByUid(call.uid, 'msg_s2c/HongDianChange', ['huodonghd']); } From c09c9dec89ad097e8a8adaae156caa153411db87 Mon Sep 17 00:00:00 2001 From: ciniao <4041990@qq.com> Date: Wed, 10 Jan 2024 21:55:02 +0800 Subject: [PATCH 20/42] =?UTF-8?q?=E9=85=8D=E4=BB=B6=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api_s2c/hero/ApiGetList.ts | 56 +++++++++++++++++++------------ src/api_s2c/peijian/ApiGetList.ts | 46 +++++++++++++++++++++---- 2 files changed, 74 insertions(+), 28 deletions(-) diff --git a/src/api_s2c/hero/ApiGetList.ts b/src/api_s2c/hero/ApiGetList.ts index aafd7e2..4969794 100644 --- a/src/api_s2c/hero/ApiGetList.ts +++ b/src/api_s2c/hero/ApiGetList.ts @@ -51,16 +51,24 @@ export default async function (call: ApiCall) { async function checkDataAndFix(call: ApiCall, list: ResGetList['list']) { try { // 修复配件数据 - let peijianids = []; - Object.values(list).map(hero => { - hero.peijian && Object.values(hero.peijian).map( - i => peijianids.push(G.mongodb.conversionId(PeijianShared.fmt(i)._id)) - ) - }); + //hero数据里,所有英雄穿戴中的配件的 _id(objectId) + // let peijianids = []; + // Object.values(list).map(hero => { + // hero.peijian && Object.values(hero.peijian).map( + // i => peijianids.push(G.mongodb.conversionId(PeijianShared.fmt(i)._id)) + // ) + // }); - let peijians = (await G.mongodb.collection("peijian").find( - {uid: call.uid, _id: {$in: peijianids}}, {projection: {_id: 1}} - ).toArray()).map(temp => G.mongodb.conversionId(temp._id)); + //通过上述的_id,去配件表查询所有配件 + // let wearedPeiJian = (await G.mongodb.collection("peijian").find( + // {uid: call.uid, _id: {$in: peijianids}}, {projection: {_id: 1, wearId:1}} + // ).toArray()); + + // //peijians = 所有从db里查到的peijian的 _id字符串数据集合 + // let peijians = wearedPeiJian.map(temp => { + // let idstr = G.mongodb.conversionId(temp._id) + // return idstr; + // }); let shiwuIds = R.flatten(R.values(list).map(hero => R.values(hero.shiwu).map(i => G.mongodb.conversionId(i._id)))) @@ -68,15 +76,19 @@ async function checkDataAndFix(call: ApiCall, list: ResGetList['list']) { {uid: call.uid, _id: {$in: shiwuIds}}, {projection: {_id: 1}} ).toArray()).map(i => G.mongodb.conversionId(i._id)); - let peijianChanges = {}; + //let peijianChanges = {}; let shiwuChanges = {}; Object.values(list).map(hero => { - for (let pos in hero.peijian) { - if (!peijians.includes(PeijianShared.fmt(hero.peijian[pos])._id)) { - hero.peijian[pos] = ""; - peijianChanges[hero._id] = hero.peijian; - } - } + // for (let pos in hero.peijian) { + // //hero该位置记录的穿戴中的配件_id + // let _pid = PeijianShared.fmt(hero.peijian[pos])._id; + + // if (!peijians.includes(_pid) || peijianWearTo?.[_pid] != hero._id ) { + // //这个配件,实际在peijian表里不存在 或 配件表里该配件并不是在这个英雄身上 + // hero.peijian[pos] = ""; + // peijianChanges[hero._id] = hero.peijian; + // } + // } for (let pos in hero.shiwu) { if (!shiwus.includes(hero.shiwu[pos]._id)) { hero.shiwu = R.omit([pos], hero.shiwu) @@ -85,12 +97,12 @@ async function checkDataAndFix(call: ApiCall, list: ResGetList['list']) { } }) - for (let oid in peijianChanges) { - // 修复数据 - G.mongodb.collection("hero").updateOne( - G.mongodb.conversionIdObj({_id: oid}), {$set: {peijian: peijianChanges[oid]}} - ) - } + // for (let oid in peijianChanges) { + // // 修复数据 + // G.mongodb.collection("hero").updateOne( + // G.mongodb.conversionIdObj({_id: oid}), {$set: {peijian: peijianChanges[oid]}} + // ) + // } for (let oid in shiwuChanges) { // 修复数据 diff --git a/src/api_s2c/peijian/ApiGetList.ts b/src/api_s2c/peijian/ApiGetList.ts index 6a74c13..28d6559 100644 --- a/src/api_s2c/peijian/ApiGetList.ts +++ b/src/api_s2c/peijian/ApiGetList.ts @@ -1,12 +1,38 @@ import {ApiCall} from "tsrpc"; -import {ReqGetList, ResGetList} from "../../shared/protocols/peijian/PtlGetList"; +import { connGameLogDB } from "../../gameLog"; +import {PeiJian, ReqGetList, ResGetList} from "../../shared/protocols/peijian/PtlGetList"; +import { PeijianShared } from "../../shared/public/peijian"; export default async function (call: ApiCall) { let _maxLv = 0 let color = {} let peijianCon = G.gc.peijian + //所有上阵的英雄_id + let heroIds = R.values(call.conn.gud.heroPos) + //将所有未上阵的英雄的配件卸下 + if(heroIds.length>0){ + let _ids = heroIds.map(_id => G.mongodb.conversionId(_id)); + await G.mongodb.collection("hero").updateMany({uid: call.conn.uid},{ + $set:{ + peijian:{} + } + }); + } + //如果配件穿戴在了未上阵的hero身上,则执行卸下操作 + await G.mongodb.collection('peijian').updateMany({uid: call.conn.uid, wearId: {$nin: heroIds}}, {$set: {wearId: ''}}) + + + let heroPeiJian = {}; let dbList = (await G.mongodb.collection('peijian').find({uid: call.uid}).toArray()).map(p => { + + if(p.wearId){ + if(!heroPeiJian[ p.wearId ]){ + heroPeiJian[ p.wearId ] = {}; + } + heroPeiJian[ p.wearId ][ Object.keys(heroPeiJian[ p.wearId ]).length + 1 ] = PeijianShared.fmt( p as any ) + } + let np = G.mongodb.conversionIdObj(p); let {uid, ...ops} = np; @@ -16,17 +42,25 @@ export default async function (call: ApiCall) { return ops; }); - // 修复配件穿戴在不存在的英雄身上 - let heroIds = R.values(call.conn.gud.heroPos) - let fixIds = dbList.filter(i => i.wearId && !heroIds.includes(i.wearId)).map(i => G.mongodb.conversionId(i._id)) - if (fixIds.length) { - await G.mongodb.collection('peijian').updateMany({_id: {$in: fixIds}}, {$set: {wearId: ''}}) + //对hero的peijian字段进行修正 + if(Object.keys(heroPeiJian).length > 0){ + for(let heroid in heroPeiJian){ + await G.mongodb.collection("hero").updateOne({ + uid : call.conn.uid, + _id : G.mongodb.conversionId(heroid) + },{ + $set:{ + peijian : heroPeiJian[heroid] + } + }); + } } // 记录玩家最大等级,颜色相关数据 注册任务用 await G.mongodb.collection('playerInfo', 'usertasklog').updateOne({uid: call.conn.uid, type: 'usertasklog'}, {$set: {maxpeijianlv: _maxLv, peijiancolor: color}}, {upsert: true}) + let list = Object.fromEntries(dbList.map(p => [G.formatRedisKey(p._id), p])); G.redis.set('peijian', call.uid, list); From 45c5a195ed9967cbbc3afa0db2543ec35db39629 Mon Sep 17 00:00:00 2001 From: ciniao <4041990@qq.com> Date: Wed, 10 Jan 2024 23:08:14 +0800 Subject: [PATCH 21/42] =?UTF-8?q?addhp=E4=B8=8D=E5=BA=94=E8=AF=A5=E5=8F=96?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/shared/public/hero.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/shared/public/hero.ts b/src/shared/public/hero.ts index dbddc83..261d609 100644 --- a/src/shared/public/hero.ts +++ b/src/shared/public/hero.ts @@ -305,7 +305,7 @@ export class HeroShared { static amendAttr(buff: k_v) { for (let k in buff) { if (typeof buff[k] != 'number') continue; - if (k.indexOf('pro') != -1 || k.indexOf('drop') != -1) continue; + if (k.indexOf('pro') != -1 || k.indexOf('drop') != -1 || k=='addhp') continue; buff[k] = Math.floor(buff[k]); } } From 325ed8745cc09f246017d664f1a5aef0759ed9e0 Mon Sep 17 00:00:00 2001 From: xichaoyin Date: Thu, 11 Jan 2024 11:20:14 +0800 Subject: [PATCH 22/42] =?UTF-8?q?fix:=E6=97=B6=E5=8C=BA=E8=84=9A=E6=9C=AC?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- zoeninfo.sh | 4 ---- 1 file changed, 4 deletions(-) diff --git a/zoeninfo.sh b/zoeninfo.sh index 3decece..254ea0e 100644 --- a/zoeninfo.sh +++ b/zoeninfo.sh @@ -1,9 +1,5 @@ - # "Asia/Shanghai" # "Asia/Tokyo" - cp "/usr/share/zoneinfo/$1" "/etc/localtime" - echo "$1" > /etc/timezone -pm2 restart all || true \ No newline at end of file From 2c3d53899e61bbc52238949603432be0d2bd6545 Mon Sep 17 00:00:00 2001 From: ciniao <4041990@qq.com> Date: Thu, 11 Jan 2024 11:23:08 +0800 Subject: [PATCH 23/42] =?UTF-8?q?=E5=8E=BB=E6=8E=89=E5=A4=9A=E4=BD=99?= =?UTF-8?q?=E7=9A=84=E7=8E=AF=E5=A2=83=E5=8F=98=E9=87=8F=EF=BC=8C=E8=A7=A3?= =?UTF-8?q?=E5=86=B3pm2=E9=9B=86=E7=BE=A4=E5=90=AF=E5=8A=A8=E5=A4=B1?= =?UTF-8?q?=E8=B4=A5=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- zoeninfo.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/zoeninfo.sh b/zoeninfo.sh index 254ea0e..de007f2 100644 --- a/zoeninfo.sh +++ b/zoeninfo.sh @@ -3,3 +3,8 @@ cp "/usr/share/zoneinfo/$1" "/etc/localtime" echo "$1" > /etc/timezone +for i in `env | grep -E -i 'SERVER_GAME' | sed 's/=.*//'` ; do + unset $i +done + + From 847613db4a52e272107a76efb98beb6e23ab4fb2 Mon Sep 17 00:00:00 2001 From: xichaoyin Date: Thu, 11 Jan 2024 14:51:17 +0800 Subject: [PATCH 24/42] =?UTF-8?q?fix:=E4=B8=9B=E6=9E=97=E7=8B=A9=E7=8C=8E?= =?UTF-8?q?=E5=AE=9A=E6=97=B6=E5=99=A8=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/public/scheduler/scheduler_clsl.ts | 30 +++++++++++++++----------- src/setStartAfther.ts | 4 ++-- 2 files changed, 20 insertions(+), 14 deletions(-) diff --git a/src/public/scheduler/scheduler_clsl.ts b/src/public/scheduler/scheduler_clsl.ts index b068a8b..117fe01 100644 --- a/src/public/scheduler/scheduler_clsl.ts +++ b/src/public/scheduler/scheduler_clsl.ts @@ -1,7 +1,7 @@ -import {PublicShared} from '../../shared/public/public'; -import {EmailFun} from '../email'; -import {RankClslCross} from '../rank/rank_clsl'; -import {Scheduler, schedulerType} from './scheduler'; +import { PublicShared } from '../../shared/public/public'; +import { EmailFun } from '../email'; +import { RankClslCross } from '../rank/rank_clsl'; +import { Scheduler, schedulerType } from './scheduler'; /** * 丛林猎手赛季重置 @@ -26,12 +26,12 @@ export class SchedulerClslLocalCtor extends Scheduler { // 修改clslCrossUser表中的uid为del_uid_week 并且 设置ttltime为当前时间 await G.mongodb.collection('clslCrossUser').updateMany( { - ttltime: {$exists: false} - }, {$rename: {"uid": `del_uid_${week}`}, $set: {"ttltime": new Date()}} + ttltime: { $exists: false } + }, { $rename: { "uid": `del_uid_${week}` }, $set: { "ttltime": new Date() } } ); // 获取分组信息 重置排行榜 - let groups = await G.mongodb.collection('clslCrossGroup').findOne({week}); + let groups = await G.mongodb.collection('clslCrossGroup').findOne({ week }); Object.keys(groups.groups).forEach((group) => { // 清理排行数据 new RankClslCross(group).clear(); @@ -64,7 +64,7 @@ export class SchedulerClslCrossCtor extends Scheduler { async start() { let week = PublicShared.getToWeek(); let users = await G.mongodb.collection('clslCrossUser').find({ - ttltime: {$exists: false} + ttltime: { $exists: false } }, { projection: { "uid": 1, @@ -118,15 +118,15 @@ export class SchedulerClslCrossCtor extends Scheduler { // 更新玩家分组id for (let group in groups) { - await G.mongodb.collection('clslCrossUser').updateMany({uid: {$in: groups[group].users}}, {$set: {group: group}}); + await G.mongodb.collection('clslCrossUser').updateMany({ uid: { $in: groups[group].users } }, { $set: { group: group } }); } // 记录分组 - await G.mongodb.collection("clslCrossGroup").updateOne({week: week}, {$set: {groups: groups}}, {upsert: true}); + await G.mongodb.collection("clslCrossGroup").updateOne({ week: week }, { $set: { groups: groups } }, { upsert: true }); // 初始化丛林猎手排行榜 G.mongodb.collection('clslCrossUser').find({ - allStar: {$gte: this.star}, ttltime: {$exists: false} + allStar: { $gte: this.star }, ttltime: { $exists: false } }).toArray().then(users => { users.forEach(u => { new RankClslCross(u.group).addNew({ @@ -161,7 +161,13 @@ export class SchedulerClslPrize extends Scheduler { async start() { // 排名奖励 let group2users: { [group: string]: string[] } = {}; - (await G.mongodb.collection('clslCrossUser').find({allStar: {$gte: this.star}}).toArray()).forEach(u => { + (await G.mongodb.collection('clslCrossUser').find( + { + uid: { $exists: true }, + allStar: { $gte: this.star } + }, + { sort: { allStar: -1 } } + ).limit(10).toArray()).forEach(u => { if (u.group in group2users) { group2users[u.group].push(u.uid); } else { diff --git a/src/setStartAfther.ts b/src/setStartAfther.ts index 19ebf83..bd0eb16 100644 --- a/src/setStartAfther.ts +++ b/src/setStartAfther.ts @@ -86,8 +86,8 @@ export async function startAfter() { new SchedulerSlzdClean().init(); new SchedulerSlzdPrize().init(); - new SchedulerClslPrize().init(); - new SchedulerClslLocalCtor().init(); + // new SchedulerClslPrize().init(); + // new SchedulerClslLocalCtor().init(); new SchedulerWzryAutoBaoMing().init(); new SchedulerWzryjingcaiSendPrize().init(); new SchedulerWzryendDel().init(); From ac4432fea87114d30473dee178d996541b5f2bd9 Mon Sep 17 00:00:00 2001 From: yushunrui <364203175@qq.com> Date: Fri, 12 Jan 2024 22:52:56 +0800 Subject: [PATCH 25/42] =?UTF-8?q?fix:=E5=A4=B4=E5=83=8F=E6=A1=86=20?= =?UTF-8?q?=E8=81=8A=E5=A4=A9=E6=A1=86=EF=BC=8C=E9=80=A0=E5=9E=8B=E9=80=BB?= =?UTF-8?q?=E8=BE=91=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/public/user.ts | 30 +++++++++++------------------- 1 file changed, 11 insertions(+), 19 deletions(-) diff --git a/src/public/user.ts b/src/public/user.ts index a89f392..851f82c 100644 --- a/src/public/user.ts +++ b/src/public/user.ts @@ -297,12 +297,10 @@ export class UserFun { if (val == -1 && !gud.headFrames[conf.id]) { change = true; gud.headFrames[conf.id] = -1; - } else if (!gud.headFrames[conf.id] || gud.headFrames[conf.id] < G.time) { + } + else if (val >= 0) { change = true; gud.headFrames[conf.id] = G.time + val * v; - } else { - change = true; - gud.headFrames[conf.id] += val * v; } } else if(conf?.cond?.[0] == "jjc_rank") { @@ -344,19 +342,15 @@ export class UserFun { if (conf?.cond?.[0] == 'time') { let val = conf.cond[1]; - if (val == -1 && !gud.chatFrames[conf.id]) { + if (val == -1 && !gud.headFrames[conf.id]) { change = true; - gud.chatFrames[conf.id] = -1; - } else if (!gud.chatFrames[conf.id] || gud.chatFrames[conf.id] < G.time) { + gud.headFrames[conf.id] = -1; + } else if (val >= 0) { change = true; - gud.chatFrames[conf.id] = G.time + val * v; - } else { - change = true; - gud.chatFrames[conf.id] += val * v; + gud.headFrames[conf.id] = G.time + val * v; } } } - if (change) { PlayerFun.changeAttr(uid, {chatFrames: gud.chatFrames}); G.server.sendMsgByUid(uid, 'msg_s2c/PlayerChange', {chatFrames: gud.chatFrames}); @@ -391,15 +385,13 @@ export class UserFun { if (conf?.cond?.[0] == 'time') { let val = conf.cond[1]; - if (val == -1) { + if (val == -1 && !gud.headFrames[conf.id]) { change = true; - gud.model[conf.id] = {id: conf.id + '', time: -1}; - } else if (gud.model[conf.id].time < G.time) { + gud.headFrames[conf.id] = -1; + } + else if (val >= 0) { change = true; - gud.model[conf.id] = {id: conf.id + '', time: G.time + val * v}; - } else { - change = true; - gud.model[conf.id] = {id: conf.id + '', time: gud.model[conf.id].time += val * v} + gud.headFrames[conf.id] = G.time + val * v; } } } From c7ce70fcc0ca7abbbcb588b83df73e84200f4e0f Mon Sep 17 00:00:00 2001 From: yushunrui <364203175@qq.com> Date: Fri, 12 Jan 2024 23:10:39 +0800 Subject: [PATCH 26/42] =?UTF-8?q?fix:=E5=A4=84=E7=90=86=E4=BA=86=E5=A4=B4?= =?UTF-8?q?=E5=83=8F=E6=A1=86=E5=92=8C=E8=81=8A=E5=A4=A9=E6=A1=86=E5=BE=97?= =?UTF-8?q?=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/public/user.ts | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/src/public/user.ts b/src/public/user.ts index 851f82c..a9270b0 100644 --- a/src/public/user.ts +++ b/src/public/user.ts @@ -297,8 +297,7 @@ export class UserFun { if (val == -1 && !gud.headFrames[conf.id]) { change = true; gud.headFrames[conf.id] = -1; - } - else if (val >= 0) { + } else if (val > 0 && gud.headFrames[conf.id] != -1) { change = true; gud.headFrames[conf.id] = G.time + val * v; } @@ -342,15 +341,16 @@ export class UserFun { if (conf?.cond?.[0] == 'time') { let val = conf.cond[1]; - if (val == -1 && !gud.headFrames[conf.id]) { + if (val == -1 && !gud.chatFrames[conf.id]) { change = true; - gud.headFrames[conf.id] = -1; - } else if (val >= 0) { + gud.chatFrames[conf.id] = -1; + } else if (val > 0 && gud.chatFrames[conf.id] != -1) { change = true; - gud.headFrames[conf.id] = G.time + val * v; + gud.chatFrames[conf.id] = G.time + val * v; } } } + if (change) { PlayerFun.changeAttr(uid, {chatFrames: gud.chatFrames}); G.server.sendMsgByUid(uid, 'msg_s2c/PlayerChange', {chatFrames: gud.chatFrames}); @@ -385,13 +385,15 @@ export class UserFun { if (conf?.cond?.[0] == 'time') { let val = conf.cond[1]; - if (val == -1 && !gud.headFrames[conf.id]) { + if (val == -1) { change = true; - gud.headFrames[conf.id] = -1; - } - else if (val >= 0) { + gud.model[conf.id] = {id: conf.id + '', time: -1}; + } else if (gud.model[conf.id].time < G.time) { change = true; - gud.headFrames[conf.id] = G.time + val * v; + gud.model[conf.id] = {id: conf.id + '', time: G.time + val * v}; + } else { + change = true; + gud.model[conf.id] = {id: conf.id + '', time: gud.model[conf.id].time += val * v} } } } From 184bdd304e0e4d3dd857b8101f4d6c0ef2ad12ba Mon Sep 17 00:00:00 2001 From: yushunrui <364203175@qq.com> Date: Fri, 12 Jan 2024 23:32:40 +0800 Subject: [PATCH 27/42] =?UTF-8?q?=E8=84=9A=E6=9C=AC=E6=8F=90=E4=BA=A4?= =?UTF-8?q?=EF=BC=8C=E5=85=91=E6=8D=A2=E6=8E=89=E8=90=BD=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E7=A4=BC=E5=8C=85=E5=86=85=E5=AE=B9=EF=BC=8C=20=E7=8E=A9?= =?UTF-8?q?=E5=AE=B6=E6=96=B0=E5=B9=B4=E5=A4=B4=E5=83=8F=E6=A1=86=E5=88=B7?= =?UTF-8?q?=E6=88=90=E6=B0=B8=E4=B9=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/fix_patch/patch_20240112.ts | 48 +++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 src/fix_patch/patch_20240112.ts diff --git a/src/fix_patch/patch_20240112.ts b/src/fix_patch/patch_20240112.ts new file mode 100644 index 0000000..2a03906 --- /dev/null +++ b/src/fix_patch/patch_20240112.ts @@ -0,0 +1,48 @@ +import { patchFun, patchInit } from "../patch"; + +class Path { + + async huodong2(a: any) { + const hdids = [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": {}} }); + console.log(hdinfo.hdid,"finish") + } + + return "sucess!!!" + } + + async headFrame(a: any) { + const users = await G.mongodb.find('user', {"headFrames.25": {"$exists": 1}}) + for (let i = 0; i < users.length; i++) { + let user = users[i] + user.headFrames["25"] = -1 + await G.mongodb.collection('user').updateOne({ "uid": user.uid}, { "$set": {"headFrames": user.headFrames} }); + console.log(user.uid, user.headFrames) + } + + return "sucess!!!" + } + + + async run() { + await this.huodong2(1); + await this.headFrame(1); + } +} + +async function main() { + await patchInit() + let patch = new Path(); + await patch.run(); + console.log("逻辑执行完成,等待退出"); + setTimeout(function () { + console.log('结束程序'); + process.exit(); + }, 3000); +} +main(); From 6eb61ece9c1c5cf4357d67337ea83d060818d75b Mon Sep 17 00:00:00 2001 From: yushunrui <364203175@qq.com> Date: Fri, 12 Jan 2024 23:53:59 +0800 Subject: [PATCH 28/42] =?UTF-8?q?fix:=E5=A4=84=E7=90=86=E6=B4=BB=E5=8A=A8?= =?UTF-8?q?=E5=92=8C=E6=96=B0=E5=B9=B4=E5=A4=B4=E5=83=8F=E6=A1=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/fix_patch/patch_20240112.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/fix_patch/patch_20240112.ts b/src/fix_patch/patch_20240112.ts index 2a03906..a51f304 100644 --- a/src/fix_patch/patch_20240112.ts +++ b/src/fix_patch/patch_20240112.ts @@ -12,7 +12,6 @@ class Path { await G.mongodb.collection('hdinfo').updateOne({ "hdid": hdinfo.hdid}, { "$set": {"data.figt": {}} }); console.log(hdinfo.hdid,"finish") } - return "sucess!!!" } @@ -24,7 +23,6 @@ class Path { await G.mongodb.collection('user').updateOne({ "uid": user.uid}, { "$set": {"headFrames": user.headFrames} }); console.log(user.uid, user.headFrames) } - return "sucess!!!" } From 7d85f554f4ee77d06ba45ce03f52494f5d8ffe89 Mon Sep 17 00:00:00 2001 From: ciniao <4041990@qq.com> Date: Thu, 11 Jan 2024 16:06:35 +0800 Subject: [PATCH 29/42] =?UTF-8?q?=E8=81=8A=E5=A4=A9=E5=88=86=E7=BB=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/public/chat.ts | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/src/public/chat.ts b/src/public/chat.ts index 877f6fd..4787ef0 100644 --- a/src/public/chat.ts +++ b/src/public/chat.ts @@ -4,6 +4,7 @@ import { MsgChat } from '../shared/protocols/msg_s2c/MsgChat'; import { player } from '../shared/protocols/user/type'; import { chatLog, chatMsgLog } from '../shared/protocols/type' import { PublicShared } from '../shared/public/public'; +import { clusterRunOnce } from '../clusterUtils'; const msgListLen = { 'cross': 30, @@ -28,13 +29,9 @@ export function getCrossChatGroupByOpenDay(){ export class ChatFun { /**新增消息 */ static async newMsg(sendData: MsgChat) { - G.mongodb.collection('chat').updateOne( - { type: `${sendData.type}${sendData.type == 'guild' ? (sendData.sender as player)?.ghId : ''}` }, - { $push: { list: { $each: [sendData], $slice: -msgListLen[sendData.type] } } }, - { upsert: true } - ); - + let addToDB = 0; if (sendData.type == 'guild') { + addToDB = 1; G.server.broadcastClusterMsg('msg_s2c/Chat', sendData,{ghId:(sendData.sender as player)?.ghId}); }else if(sendData.type == 'cross'){ //所有的子进程都会收到,不需要集群内分别广播 @@ -42,9 +39,27 @@ export class ChatFun { //如果时候同一个分组的 delete sendData?.otherData?.group; G.server.broadcastMsg('msg_s2c/Chat', sendData); + addToDB = 2; } }else{ G.server.broadcastClusterMsg('msg_s2c/Chat', sendData); + addToDB = 1; + } + + if(addToDB == 1){ + G.mongodb.collection('chat').updateOne( + { type: `${sendData.type}${sendData.type == 'guild' ? (sendData.sender as player)?.ghId : ''}` }, + { $push: { list: { $each: [sendData], $slice: -msgListLen[sendData.type] } } }, + { upsert: true } + ); + }else if(addToDB == 2){ + clusterRunOnce(()=>{ + G.mongodb.collection('chat').updateOne( + { type: `${sendData.type}${sendData.type == 'guild' ? (sendData.sender as player)?.ghId : ''}` }, + { $push: { list: { $each: [sendData], $slice: -msgListLen[sendData.type] } } }, + { upsert: true } + ); + }) } } From fd7b8d945d31cd934811dcaa3ba6b93e667f6148 Mon Sep 17 00:00:00 2001 From: xichaoyin Date: Thu, 11 Jan 2024 17:06:39 +0800 Subject: [PATCH 30/42] =?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 31/42] =?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); From b5a9f6f53076316becaaa5802c74dd69a6bcc6bd Mon Sep 17 00:00:00 2001 From: ciniao <4041990@qq.com> Date: Thu, 11 Jan 2024 19:14:56 +0800 Subject: [PATCH 32/42] =?UTF-8?q?=E7=A7=AF=E5=88=86=E5=AE=B9=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api_cross/hbzb/ApiGetUser.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/api_cross/hbzb/ApiGetUser.ts b/src/api_cross/hbzb/ApiGetUser.ts index 8360c0d..2e4e6ac 100644 --- a/src/api_cross/hbzb/ApiGetUser.ts +++ b/src/api_cross/hbzb/ApiGetUser.ts @@ -17,7 +17,7 @@ export default async function (call: ApiCall) { arr.map(i=>{ res[i.uid] = { data: i.data, - jifen:i.jifen, + jifen:i?.jifen||0, }; }); From 00804b9b49cf62ca857a8f71f5d3b5ce99b5df14 Mon Sep 17 00:00:00 2001 From: ciniao <4041990@qq.com> Date: Thu, 11 Jan 2024 20:23:08 +0800 Subject: [PATCH 33/42] =?UTF-8?q?=E7=9F=BF=E6=B4=9E=E7=BB=93=E7=AE=97bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api_s2c/kuangdong/ApiYanShi.ts | 2 +- src/public/kuangdong.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/api_s2c/kuangdong/ApiYanShi.ts b/src/api_s2c/kuangdong/ApiYanShi.ts index 4ab56b8..62efd2f 100644 --- a/src/api_s2c/kuangdong/ApiYanShi.ts +++ b/src/api_s2c/kuangdong/ApiYanShi.ts @@ -5,7 +5,7 @@ import {ReqYanShi, ResYanShi} from "../../shared/protocols/kuangdong/PtlYanShi"; export default async function (call: ApiCall) { - return call.errorCode(1) + //return call.errorCode(1) let hdid = call.req.hdid let con = await KuangDongfun.getCon(hdid) diff --git a/src/public/kuangdong.ts b/src/public/kuangdong.ts index 942759d..597556e 100644 --- a/src/public/kuangdong.ts +++ b/src/public/kuangdong.ts @@ -179,14 +179,14 @@ export class KuangDongfun { } if (!kdInfo) return [] let _con = await this.getCon(hdid) - let _kcTime = G.time + kdInfo.yanshi - kdInfo.ctime + let _kcTime = G.time - kdInfo.ctime //let _gud = await G.mongodb.collection('user').findOne({uid: kdInfo.uid}) let _gud = await getGud(kdInfo.uid) let gamer_lv = _gud.lv // @ts-ignore let prize: prizeType[] = _con.reward // let prize: prizeType[] = [{ a: 'attr', t: 'rmbmoney', n: 50 }] // todo 待接入配置 - if (_kcTime > 8 * 3600) _kcTime = 8 * 3600 + kdInfo.yanshi // 设置最大时长 + if (_kcTime > 8 * 3600 + kdInfo.yanshi) _kcTime = 8 * 3600 + kdInfo.yanshi // 设置最大时长 prize[0]["n"] = Math.floor(eval(_con.formula) * _kcTime) if (_con.public_map == 1){ From 69945c396471ff2134ebb7435b90b689a9f727db Mon Sep 17 00:00:00 2001 From: ciniao <4041990@qq.com> Date: Thu, 11 Jan 2024 21:01:00 +0800 Subject: [PATCH 34/42] =?UTF-8?q?=E5=9B=9E=E9=80=80=E5=B1=82=E6=95=B0?= =?UTF-8?q?=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/public/dxlt.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/public/dxlt.ts b/src/public/dxlt.ts index 008e62f..e1d36b0 100644 --- a/src/public/dxlt.ts +++ b/src/public/dxlt.ts @@ -19,7 +19,8 @@ export class DxltFun { } /**回退层数 */ static backLayer(data: ResOpen) { - let num = data.curLayer - G.gc.dxlt_com.dayResetBackLayer; + //let num = data.curLayer - G.gc.dxlt_com.dayResetBackLayer; + let num = (data.curLayer-30) - (data.curLayer-30)%5+1 data.curLayer = num < 1 ? 1 : num; data.over = G.gc.dxlt_layer[data.curLayer].type == 2; } From b23d311dbd2958a9165f838b7a66f99c5f69736a Mon Sep 17 00:00:00 2001 From: ciniao <4041990@qq.com> Date: Thu, 11 Jan 2024 21:19:48 +0800 Subject: [PATCH 35/42] =?UTF-8?q?slzd=E4=B8=8D=E9=9C=80=E8=A6=81=E5=9B=9E?= =?UTF-8?q?=E5=A4=8D=E6=AC=A1=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api_s2c/slzd/ApiOpen.ts | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/api_s2c/slzd/ApiOpen.ts b/src/api_s2c/slzd/ApiOpen.ts index 85903be..2ac2ccc 100644 --- a/src/api_s2c/slzd/ApiOpen.ts +++ b/src/api_s2c/slzd/ApiOpen.ts @@ -41,13 +41,16 @@ export default async function (call: ApiCall) { }, { upsert: true } ); - } else if (data.fightNum < G.gc.slzd.maxFightNum && G.time - data.replyCd > G.gc.slzd.replyCd) { - let addNum = Math.floor((G.time - data.replyCd) / G.gc.slzd.replyCd); - let maxAddNum = G.gc.slzd.maxFightNum - data.fightNum; - data.fightNum += addNum > maxAddNum ? maxAddNum : addNum; - data.replyCd = G.time; - G.mongodb.collection('slzdUser').updateOne({ uid: call.uid }, { $set: { 'data.fightNum': data.fightNum, 'data.replyCd': data.replyCd } }); } + + //不需要回复次数 + // else if (data.fightNum < G.gc.slzd.maxFightNum && G.time - data.replyCd > G.gc.slzd.replyCd) { + // let addNum = Math.floor((G.time - data.replyCd) / G.gc.slzd.replyCd); + // let maxAddNum = G.gc.slzd.maxFightNum - data.fightNum; + // data.fightNum += addNum > maxAddNum ? maxAddNum : addNum; + // data.replyCd = G.time; + // G.mongodb.collection('slzdUser').updateOne({ uid: call.uid }, { $set: { 'data.fightNum': data.fightNum, 'data.replyCd': data.replyCd } }); + // } let { refreshTime, ...ops } = data; call.succ({ From 08a9dd335a040e3c4c36ea8da7fae87ffc423241 Mon Sep 17 00:00:00 2001 From: ciniao <4041990@qq.com> Date: Thu, 11 Jan 2024 22:52:24 +0800 Subject: [PATCH 36/42] =?UTF-8?q?=E5=8F=91=E5=A5=96=E5=8F=91=E9=94=99?= =?UTF-8?q?=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/public/scheduler/scheduler_wzry.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/public/scheduler/scheduler_wzry.ts b/src/public/scheduler/scheduler_wzry.ts index a3f276c..4aca35f 100644 --- a/src/public/scheduler/scheduler_wzry.ts +++ b/src/public/scheduler/scheduler_wzry.ts @@ -299,7 +299,7 @@ export class SchedulerWzryZuanshiSendPrize extends SchedulerWzryAutoBaoMing { await this.record() return } - let _prizeCon = this.typeprzie=='zhuanshi'?G.gc.wangzherongyao.wangzhe.jiangli.zuanshi:G.gc.wangzherongyao.wangzhe.jiangli.wangzhe; + let _prizeCon = this.typeprzie=='zuanshi'?G.gc.wangzherongyao.wangzhe.jiangli.zuanshi:G.gc.wangzherongyao.wangzhe.jiangli.wangzhe; let _u = [] for (let index = 0; index < _user.length; index++) { const element = _user[index]; From 8780716d44fb1b0622378bf6eba16143d2827483 Mon Sep 17 00:00:00 2001 From: xichaoyin Date: Fri, 12 Jan 2024 15:44:56 +0800 Subject: [PATCH 37/42] =?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 | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/fix_patch/patch_20240111.ts b/src/fix_patch/patch_20240111.ts index ea06ce0..159aadd 100644 --- a/src/fix_patch/patch_20240111.ts +++ b/src/fix_patch/patch_20240111.ts @@ -1,23 +1,24 @@ -import { ReqEmail } from "../monopoly/protocols/PtlEmail"; -import { patchInit } from "../patch"; -import { MsgEmail } from "../shared/protocols/msg_s2c/MsgEmail"; -import { PublicShared } from "../shared/public/public"; +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(); + let users = await G.mongodb.collection('user').find({}, { + projection: {uid: 1} + }).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 } + }, {projection: {taskid: 1, finish: 1}}).toArray()).map(i => { + return {[i.taskid]: i.finish} })) let deltask = []; @@ -34,7 +35,7 @@ class Path { if (deltask.length > 0) { await G.mongodb.collection("task").deleteMany( - { uid: user.uid, taskid: { $in: deltask } } + {uid: user.uid, taskid: {$in: deltask}} ) console.log(`删除玩家${user.uid}任务:${deltask}`) } @@ -56,4 +57,5 @@ async function main() { process.exit(); }, 3000); } + main(); From af03f2f6c530f9c705affcaa6aefda2b38d59120 Mon Sep 17 00:00:00 2001 From: ciniao <4041990@qq.com> Date: Fri, 12 Jan 2024 16:08:30 +0800 Subject: [PATCH 38/42] =?UTF-8?q?=E5=A4=96=E7=BD=91insertMany=E6=8A=A5?= =?UTF-8?q?=E9=94=99=E5=85=BC=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/public/pay.ts | 3 ++- src/public/xstask.ts | 17 +++++++++-------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/public/pay.ts b/src/public/pay.ts index 6052922..7fe7252 100644 --- a/src/public/pay.ts +++ b/src/public/pay.ts @@ -66,7 +66,8 @@ export class PayFun { ); }) - G.mongodb.collection('payLogNew').insertMany(args.map(i => ({key: i.payId, uid: uid, values: i.val}))); + let colls = args.map(i => ({key: i.payId, uid: uid, values: i.val})) + if(colls.length>0)G.mongodb.collection('payLogNew').insertMany(colls); G.server.sendMsgByUid(uid, 'msg_s2c/PayChange', Object.fromEntries(args.map(a => [a.payId, a.val]))); } diff --git a/src/public/xstask.ts b/src/public/xstask.ts index cfdce3d..2b0de09 100644 --- a/src/public/xstask.ts +++ b/src/public/xstask.ts @@ -78,16 +78,17 @@ export class XstaskFun { uid: uid, }; }); - let result = await G.mongodb.collection('xstask').insertMany(taskList); - this.uidTask[uid] = this.uidTask[uid] || []; - taskList.forEach((task, index) => { - this.uidTask[uid].push(G.mongodb.conversionIdObj({ - _id: result.insertedIds[index], - ...task - })); - }); + if(taskList.length > 0){ + let result = await G.mongodb.collection('xstask').insertMany(taskList); + taskList.forEach((task, index) => { + this.uidTask[uid].push(G.mongodb.conversionIdObj({ + _id: result.insertedIds[index], + ...task + })); + }); + } return this.uidTask[uid]; } From a46b8f671c831280db7e952944ec6966b36bd591 Mon Sep 17 00:00:00 2001 From: ciniao <4041990@qq.com> Date: Fri, 12 Jan 2024 16:32:09 +0800 Subject: [PATCH 39/42] =?UTF-8?q?=E5=85=88=E4=B8=8D=E6=B8=85=E7=A9=BA?= =?UTF-8?q?=EF=BC=8C=E6=9C=80=E5=90=8E=E4=B8=80=E4=B8=AA=E7=8E=A9=E5=AE=B6?= =?UTF-8?q?=E6=97=B6=E5=8F=AF=E8=83=BD=E4=BC=9A=E6=9C=89=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/setRedis.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/setRedis.ts b/src/setRedis.ts index 6e6b155..a966efc 100644 --- a/src/setRedis.ts +++ b/src/setRedis.ts @@ -78,8 +78,8 @@ async function clearRedis() { G.redis.fromatKey('equip'), G.redis.fromatKey('shiwu'), G.redis.fromatKey('tanxian'), - G.redis.fromatKey('gbtx'), - G.redis.fromatKey('dxlt'), + //G.redis.fromatKey('gbtx'), + //G.redis.fromatKey('dxlt'), ]) } From e9fba7ed05d1871d871a7d0b7c854d6e6b760034 Mon Sep 17 00:00:00 2001 From: xichaoyin Date: Fri, 12 Jan 2024 17:50:10 +0800 Subject: [PATCH 40/42] =?UTF-8?q?fix:=201=EF=BC=9A=E5=A4=B4=E5=83=8F?= =?UTF-8?q?=E6=A1=86=E8=84=9A=E6=9C=AC=202=EF=BC=9A=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E7=9B=91=E6=8E=A7=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/fix_patch/patch_20240112-1.ts | 68 +++++++++++++++++++++++++++++++ src/oss/watchdog.json | 19 ++++++++- 2 files changed, 85 insertions(+), 2 deletions(-) create mode 100644 src/fix_patch/patch_20240112-1.ts diff --git a/src/fix_patch/patch_20240112-1.ts b/src/fix_patch/patch_20240112-1.ts new file mode 100644 index 0000000..a77c559 --- /dev/null +++ b/src/fix_patch/patch_20240112-1.ts @@ -0,0 +1,68 @@ +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 uids = [ + "4_6571ab682b3f80154e724f2a", + "16_6575e1625685671e63fe001f", + "13_6574ad08e7cc32b4bd1334e8", + "13_65749bc319cab1affec349fb", + ]; + + // 删除玩家背包中的头像框 + let items = await G.mongodb.collection("item").find({ uid: { $nin: uids }, itemId: { $in: ["47", "48"] } }).toArray(); + for (let item of items) { + console.log(`删除玩家${item.uid}的头像框道具${item.itemId}`); + await G.mongodb.collection("item").updateOne({ _id: item._id }, { $set: { uid: `patch_del_${item.uid}` } }); + } + + // 删除玩家存在的头像框 + let users = await G.mongodb.collection("user").find({ + uid: { $nin: uids }, $or: [ + { ["headFrame.id"]: "8" }, + { ["headFrame.id"]: "14" }, + { ["headFrames.8"]: { $exists: true } }, + { ["headFrames.14"]: { $exists: true } }, + ] + }).toArray(); + for (let user of users) { + let change = { $set: {}, $unset: {} }; + if (user.headFrame?.id == "8" || user.headFrame?.id == "14") { + change.$set = { headFrame: { id: "1", time: -1 } }; + } + + if (user.headFrames["8"] != undefined) { + change.$unset["headFrames.8"] = 1; + } + + if (user.headFrames["14"] != undefined) { + change.$unset["headFrames.14"] = 1; + } + if (Object.keys(change.$set).length > 0 || Object.keys(change.$unset).length > 0) { + console.log(`处理玩家${user.uid}数据:${JSON.stringify(change)}`); + await G.mongodb.collection("user").updateOne({ _id: user._id }, change); + } + } + } + + 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(); diff --git a/src/oss/watchdog.json b/src/oss/watchdog.json index 6a8027b..1cd80d8 100644 --- a/src/oss/watchdog.json +++ b/src/oss/watchdog.json @@ -11,14 +11,29 @@ }, { "key":"got_rmbmoney", - "limit":50000, - "tips":"钻石获取达到5万" + "limit":100000, + "tips":"钻石获取达到10万" }, { "key":"use_attr_rmbmoney", "limit":100000, "tips":"钻石消耗达到10万" }, + { + "key":"got_huangqijinbi", + "limit":5000, + "tips":"单日获取黄旗金币达到5000" + }, + { + "key":"got_huangqiduihuan", + "limit":10000, + "tips":"单日获取黄旗兑换达到10000" + }, + { + "key": "event/huangqijiuguan/ZhaoMu", + "limit": 1000, + "tips": "单日获取黄旗招募超过1000抽" + }, { "key":"tanxian/FastGuaJi", "limit":30, From 1060c5ccc78d83a1c131173a35738403359a2d04 Mon Sep 17 00:00:00 2001 From: xichaoyin Date: Fri, 12 Jan 2024 18:18:08 +0800 Subject: [PATCH 41/42] =?UTF-8?q?fix:=E6=B7=BB=E5=8A=A0=E9=BB=84=E6=97=97?= =?UTF-8?q?=E9=87=91=E5=B8=81=E5=92=8C=E9=BB=84=E6=97=97=E5=85=91=E6=8D=A2?= =?UTF-8?q?=E5=B8=81=E7=9A=84=E7=9B=91=E6=8E=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/oss/watchdog.json | 2 +- src/public/player.ts | 151 ++++++++++++++++++++++-------------------- 2 files changed, 79 insertions(+), 74 deletions(-) diff --git a/src/oss/watchdog.json b/src/oss/watchdog.json index 1cd80d8..1e97ac3 100644 --- a/src/oss/watchdog.json +++ b/src/oss/watchdog.json @@ -30,7 +30,7 @@ "tips":"单日获取黄旗兑换达到10000" }, { - "key": "event/huangqijiuguan/ZhaoMu", + "key": "huangqijiuguan/ZhaoMu", "limit": 1000, "tips": "单日获取黄旗招募超过1000抽" }, diff --git a/src/public/player.ts b/src/public/player.ts index 1cf7ef2..bc903cf 100644 --- a/src/public/player.ts +++ b/src/public/player.ts @@ -1,23 +1,23 @@ -import {ObjectId, OptionalId} from 'mongodb'; -import {ApiCall, BaseConnection, TsrpcError} from 'tsrpc'; -import {checkPlayerGift} from '../api_s2c/event/xianshilibao/fun'; -import {md_redPoint_check} from '../api_s2c/gongyu/mingdao/ApiOpen'; -import {CollectionPeiJian} from '../module/collection_peijian'; -import {Wjjl} from '../module/collection_wjjl'; -import {MongodbCollections} from '../module/mongodb'; -import {G123} from '../sdk/G123'; -import {ResGetList} from '../shared/protocols/item/PtlGetList'; -import {ResLogin} from '../shared/protocols/user/PtlLogin'; -import {player} from '../shared/protocols/user/type'; -import {HeroShared, otherBuff} from '../shared/public/hero'; -import {PublicShared} from '../shared/public/public'; -import {HeroFun} from './hero'; -import {ShiwuFun} from './shiwu'; -import {UserFun} from './user'; -import {getItemByItemId, getItemNum} from './item'; -import {getGud, setGud} from './gud'; -import {addGameLog} from "../gameLog"; -import {PushGiftFun} from "./pushgift"; +import { ObjectId, OptionalId } from 'mongodb'; +import { ApiCall, BaseConnection, TsrpcError } from 'tsrpc'; +import { checkPlayerGift } from '../api_s2c/event/xianshilibao/fun'; +import { md_redPoint_check } from '../api_s2c/gongyu/mingdao/ApiOpen'; +import { CollectionPeiJian } from '../module/collection_peijian'; +import { Wjjl } from '../module/collection_wjjl'; +import { MongodbCollections } from '../module/mongodb'; +import { G123 } from '../sdk/G123'; +import { ResGetList } from '../shared/protocols/item/PtlGetList'; +import { ResLogin } from '../shared/protocols/user/PtlLogin'; +import { player } from '../shared/protocols/user/type'; +import { HeroShared, otherBuff } from '../shared/public/hero'; +import { PublicShared } from '../shared/public/public'; +import { HeroFun } from './hero'; +import { ShiwuFun } from './shiwu'; +import { UserFun } from './user'; +import { getItemByItemId, getItemNum } from './item'; +import { getGud, setGud } from './gud'; +import { addGameLog } from "../gameLog"; +import { PushGiftFun } from "./pushgift"; import { ActionLog } from './actionLog/actionLog'; import { roleDataType } from '../shared/fightControl/fightType'; import { PlayerShared } from '../shared/public/player'; @@ -48,21 +48,21 @@ export class PlayerFun { * @param uid * @returns */ - static async getDefaultFightDataByUid(uid:string){ + static async getDefaultFightDataByUid(uid: string) { let gud = await getGud(uid); let posObj = gud.heroPos; let roles: k_v = {}; if (gud.selectMatrix && gud.matrixPos) { posObj = gud.matrixPos[gud.selectMatrix]; } - let heros = await HeroFun.getHeros({uid:uid}, Object.values(posObj).filter(_id => _id != '') as string[]); + let heros = await HeroFun.getHeros({ uid: uid }, Object.values(posObj).filter(_id => _id != '') as string[]); let otherBuff = UserFun.getOtherBuff(gud) Object.entries(posObj).forEach(obj => { let pos = obj[0]; let _id = obj[1]; let hero = heros.filter(h => h._id == _id)[0]; - + if (hero) { roles[pos] = { ...hero, @@ -72,7 +72,7 @@ export class PlayerFun { }; } }); - + return { player: { ...gud, buff: PlayerShared.getBuff(gud) }, roles: roles @@ -107,13 +107,13 @@ export class PlayerFun { if (err) { // 消耗不足 触发推送礼包 PushGiftFun.chkItemGift(call.uid, atn) - throw new TsrpcError('', {code: -104, atn: atn}); + throw new TsrpcError('', { code: -104, atn: atn }); } else { - return {isOk: false, atn: atn}; + return { isOk: false, atn: atn }; } } } - return {isOk: true, atn: null}; + return { isOk: true, atn: null }; } /** @@ -131,7 +131,7 @@ export class PlayerFun { atn: need }; if (args.length < 1) { - throw new TsrpcError('', {code: -104, atn: meet.atn}); + throw new TsrpcError('', { code: -104, atn: meet.atn }); } return await this.checkNeedByArgs(call, ...args); } @@ -154,10 +154,10 @@ export class PlayerFun { all.push(this.addItem(call, item)); } // 记录消耗 - addGameLog(call.uid, call.service.name, call.req, {need: val}) + addGameLog(call.uid, call.service.name, call.req, { need: val }) await Promise.all(all); G.emit('USE_ITEM', call.conn.gud, needArr.map(need => { - return {...need, n: Math.abs(need.n)}; + return { ...need, n: Math.abs(need.n) }; })); } @@ -175,7 +175,7 @@ export class PlayerFun { let peijian = prizeList.filter(atn => atn.a == 'peijian' && atn.n != 0); // 记录获得 - addGameLog(call.uid, call.service.name, call.req, {prize: prizeList}) + addGameLog(call.uid, call.service.name, call.req, { prize: prizeList }) await Promise.all([ attr.length > 0 && this.addAttr(call, attr), item.length > 0 && this.addItem(call, item), @@ -217,9 +217,14 @@ export class PlayerFun { } } - if( (atn.t == 'rmbmoney' || atn.t == 'jinbi') && atn.n > 0 ){ + if ((atn.t == 'rmbmoney' || atn.t == 'jinbi') && atn.n > 0) { //统计今日获取的金币和钻石 - ActionLog.addDayLog(call.conn.uid, { key: 'got_'+atn.t, val: atn.n }); + ActionLog.addDayLog(call.conn.uid, { key: 'got_' + atn.t, val: atn.n }); + } + + if (["huangqijinbi", "huangqiduihuan"].includes(atn.t) && atn.n > 0) { + //统计今日获取的黄旗金币和黄旗对换币 + ActionLog.addDayLog(call.conn.uid, { key: 'got_' + atn.t, val: atn.n }); } // 增加vip经验的任务监听 @@ -227,7 +232,7 @@ export class PlayerFun { G.emit("Class_task_157", 'Class_task_157', call, atn.n, 0); } all.push(this.changeAttr(call.conn.uid, change)); - all.push(this.upAttr(call, {...atn, n: change[atn.t]})); + all.push(this.upAttr(call, { ...atn, n: change[atn.t] })); //await this.changeAttr(call.conn.uid, change); //await this.upAttr(call, {...atn, n: change[atn.t]}); } @@ -270,17 +275,17 @@ export class PlayerFun { G.mongodb.collection('rmbuse').insertOne(data); // 消费竞赛开启时写入跨服数据库 if (G.huodong.xfjs && !data.isAdd && typeof data.change == 'number') { - G.crossmongodb.collection('rmbuse').updateOne({uid: data.uid, type: `xfjs_${G.huodong.xfjsId}`}, { - $set: {time: G.time}, - $inc: {change: data.change} - }, {upsert: true}); + G.crossmongodb.collection('rmbuse').updateOne({ uid: data.uid, type: `xfjs_${G.huodong.xfjsId}` }, { + $set: { time: G.time }, + $inc: { change: data.change } + }, { upsert: true }); } } static async changeAttr(uid: string, change: Partial) { setGud(uid, change); - G.mongodb.collection('user').updateOne({uid: uid}, {$set: change}); + G.mongodb.collection('user').updateOne({ uid: uid }, { $set: change }); if (G.server.uid_connections[uid]) { checkPlayerGift(G.server.uid_connections[uid].gud, change); @@ -302,9 +307,9 @@ export class PlayerFun { const curLv = call.conn.gud.lv; while (conf[curLv + addLv + 1] && atn.n >= conf[curLv + addLv + 1].need) { addLv++; - G123.sendUserLevelUp({...call.conn.gud, lv: curLv + addLv, nexp: atn.n}); + G123.sendUserLevelUp({ ...call.conn.gud, lv: curLv + addLv, nexp: atn.n }); } - addLv && await this.addAttr(call, {lv: curLv + addLv}); + addLv && await this.addAttr(call, { lv: curLv + addLv }); break; case 'payExp': let addVip = 0; @@ -313,7 +318,7 @@ export class PlayerFun { while (vipConf[curVip + addVip + 1] && atn.n >= vipConf[curVip + addVip + 1].exp) { addVip++; } - addVip && await this.addAttr(call, {vip: curVip + addVip}); + addVip && await this.addAttr(call, { vip: curVip + addVip }); break; } } @@ -324,7 +329,7 @@ export class PlayerFun { static async addItem(call: call, val: atn[]) { for (let atn of val) { let upObj = { - filter: {uid: call.uid, itemId: atn.t}, + filter: { uid: call.uid, itemId: atn.t }, update: { $setOnInsert: { firstTime: G.time, @@ -356,7 +361,7 @@ export class PlayerFun { }; G.mongodb.collection('item').updateOne(upObj.filter, upObj.update, upObj.options); call.addEventMsg('msg_s2c/ItemChange', atn.t, data); - addGameLog(call.uid, "_itemChange", {"additem": 1}, { + addGameLog(call.uid, "_itemChange", { "additem": 1 }, { "filter": upObj.filter, "update": upObj.update, "options": upObj.options @@ -364,10 +369,10 @@ export class PlayerFun { } else { if (item.num + atn.n <= 0) { await Promise.all([ - G.mongodb.collection('item').deleteOne({uid: call.uid, itemId: atn.t}) + G.mongodb.collection('item').deleteOne({ uid: call.uid, itemId: atn.t }) ]); - call.addEventMsg('msg_s2c/ItemChange', atn.t, {num: 0}); - addGameLog(call.uid, "_itemChange", {"delitem": 1}, {"itemId": atn.t}) + call.addEventMsg('msg_s2c/ItemChange', atn.t, { num: 0 }); + addGameLog(call.uid, "_itemChange", { "delitem": 1 }, { "itemId": atn.t }) } else { await Promise.all([ G.mongodb.collection('item').updateOne(upObj.filter, upObj.update, upObj.options) @@ -376,7 +381,7 @@ export class PlayerFun { num: item.num + atn.n, lastTime: upObj.update.$set.lastTime }); - addGameLog(call.uid, "_itemChange", {"attritem": 1}, { + addGameLog(call.uid, "_itemChange", { "attritem": 1 }, { "filter": upObj.filter, "update": upObj.update, "options": upObj.options, @@ -411,7 +416,7 @@ export class PlayerFun { insertData.forEach((v, key) => { let id = result.insertedIds[key].toHexString(); - let {_id, ...ops} = v; + let { _id, ...ops } = v; Wjjl.setVal(call.uid, `has_equip_color_${G.gc.equip[ops.equipId].colour}`, 1, false); @@ -445,10 +450,10 @@ export class PlayerFun { */ static async cutEquip(call: call, _idArr: string[]) { for (let _id of _idArr) { - G.mongodb.collection('equip').deleteOne({uid: call.uid, _id: new ObjectId(_id)}); - call.addEventMsg('msg_s2c/EquipChange', _id, {num: 0}); + G.mongodb.collection('equip').deleteOne({ uid: call.uid, _id: new ObjectId(_id) }); + call.addEventMsg('msg_s2c/EquipChange', _id, { num: 0 }); - addGameLog(call.uid, "_cutEquip", {}, {_id: _id}) + addGameLog(call.uid, "_cutEquip", {}, { _id: _id }) } } @@ -482,7 +487,7 @@ export class PlayerFun { let v = insertData[key] let id = result.insertedIds[key].toHexString(); - let {_id, ...ops} = v; + let { _id, ...ops } = v; call.addEventMsg('msg_s2c/HeroChange', id, { _id: id, @@ -515,9 +520,9 @@ export class PlayerFun { static async cutHero(call: call, _idArr: string[]) { for (let _id of _idArr) { await HeroFun.delHero(call, _id); - G.mongodb.collection('hero').deleteOne({uid: call.uid, _id: new ObjectId(_id)}); - call.addEventMsg('msg_s2c/HeroChange', _id, {num: 0}); - addGameLog(call.uid, "_cutHero", {}, {_id: _id}) + G.mongodb.collection('hero').deleteOne({ uid: call.uid, _id: new ObjectId(_id) }); + call.addEventMsg('msg_s2c/HeroChange', _id, { num: 0 }); + addGameLog(call.uid, "_cutHero", {}, { _id: _id }) } } @@ -532,7 +537,7 @@ export class PlayerFun { colour: v.colour, wearId: '', shiwuId: v.t, - jichu: ShiwuFun.randomJichu({colour: v.colour, shiwuId: v.t}), + jichu: ShiwuFun.randomJichu({ colour: v.colour, shiwuId: v.t }), fujia: [] }; if (v.shiwuBuff) { @@ -552,7 +557,7 @@ export class PlayerFun { insertData.forEach((v, key) => { let id = result.insertedIds[key].toHexString(); - let {_id, ...ops} = v; + let { _id, ...ops } = v; call.addEventMsg('msg_s2c/ShiwuChange', id, { _id: id, ...ops @@ -571,9 +576,9 @@ export class PlayerFun { */ static async cutShiwu(call: call, _idArr: string[]) { for (let _id of _idArr) { - G.mongodb.collection('shiwu').deleteOne({uid: call.uid, _id: new ObjectId(_id)}); - call.addEventMsg('msg_s2c/ShiwuChange', _id, {num: 0}); - addGameLog(call.uid, "_cutShiwu", {}, {_id: _id}) + G.mongodb.collection('shiwu').deleteOne({ uid: call.uid, _id: new ObjectId(_id) }); + call.addEventMsg('msg_s2c/ShiwuChange', _id, { num: 0 }); + addGameLog(call.uid, "_cutShiwu", {}, { _id: _id }) } } @@ -598,7 +603,7 @@ export class PlayerFun { addGameLog(call.uid, "_addPeiJian", {}, insertData) insertData.forEach((v, key) => { - let {_id, uid, ...ops} = v; + let { _id, uid, ...ops } = v; let id = _id.toHexString(); if (G.gc.peijian[v.peijianId].colour != 5) { @@ -606,8 +611,8 @@ export class PlayerFun { lshd[v.peijianId]++; } - G.redis.set('peijian', call.uid, id, {_id: id, ...ops}); - call.addEventMsg('msg_s2c/PeijianChange', id, {_id: id, ...ops}); + G.redis.set('peijian', call.uid, id, { _id: id, ...ops }); + call.addEventMsg('msg_s2c/PeijianChange', id, { _id: id, ...ops }); }); G.mongodb.collection('playerInfo', 'lshd_peijian').updateOne( @@ -634,9 +639,9 @@ export class PlayerFun { static async cutPeijian(call: call, _idArr: string[]) { for (let _id of _idArr) { G.redis.del('peijian', call.uid, _id); - G.mongodb.collection('peijian').deleteOne({uid: call.uid, _id: new ObjectId(_id)}); - call.addEventMsg('msg_s2c/PeijianChange', _id, {num: 0}); - addGameLog(call.uid, "_cutPeijian", {}, {_id: _id}) + G.mongodb.collection('peijian').deleteOne({ uid: call.uid, _id: new ObjectId(_id) }); + call.addEventMsg('msg_s2c/PeijianChange', _id, { num: 0 }); + addGameLog(call.uid, "_cutPeijian", {}, { _id: _id }) } } @@ -645,7 +650,7 @@ export class PlayerFun { */ static async getAttr(uid: string, where: { ctype: string; }) { let _w = where; - Object.assign(_w, {uid: uid}); + Object.assign(_w, { uid: uid }); const _res = await G.mongodb.collection('playattr').find(_w).toArray(); _res.forEach(v => { if (v._id) { @@ -660,7 +665,7 @@ export class PlayerFun { */ static async getAttrOne(uid: string, where: { ctype: string; }) { let _w = where; - Object.assign(_w, {uid: uid}); + Object.assign(_w, { uid: uid }); const _res = await G.mongodb.collection('playattr').findOne(_w); if (_res) { delete _res['_id']; @@ -676,10 +681,10 @@ export class PlayerFun { time = G.time; } let _zeroTime = PublicShared.getToDayZeroTime(time); - let _tmp = {lasttime: {$gte: _zeroTime, $lte: _zeroTime + 24 * 60 * 60 - 1}}; + let _tmp = { lasttime: { $gte: _zeroTime, $lte: _zeroTime + 24 * 60 * 60 - 1 } }; let _w = where; - Object.assign(_w, {uid: uid, ..._tmp}); + Object.assign(_w, { uid: uid, ..._tmp }); const _res = await G.mongodb.collection('playattr').find(_w).toArray(); _res.forEach(v => { if (v._id) { @@ -694,7 +699,7 @@ export class PlayerFun { */ static async setAttr(uid: string, where: { ctype: string; }, data: {}, islasttime = 1) { let _w = where; - Object.assign(_w, {uid: uid}); + Object.assign(_w, { uid: uid }); if (islasttime == 1) { data["lasttime"] = G.time; @@ -705,7 +710,7 @@ export class PlayerFun { // 加入创建数据时间 data["ctime"] = G.time; } - let _res = await G.mongodb.collection('playattr').updateMany(_w, {$set: data}, {upsert: true}); + let _res = await G.mongodb.collection('playattr').updateMany(_w, { $set: data }, { upsert: true }); return _res; } } \ No newline at end of file From 6370e8811661c9155bf54e82520d1212c1bfa950 Mon Sep 17 00:00:00 2001 From: xichaoyin Date: Fri, 12 Jan 2024 20:12:18 +0800 Subject: [PATCH 42/42] =?UTF-8?q?fix:=E7=9A=AE=E8=82=A4=E5=A4=B4=E5=83=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/shared/public/user.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/shared/public/user.ts b/src/shared/public/user.ts index fe19f59..ecc3db3 100644 --- a/src/shared/public/user.ts +++ b/src/shared/public/user.ts @@ -37,6 +37,7 @@ export class UserShared { // else if (conf.cond[0] == 'time') return collection.active[fmtId] == -1 || collection.active[fmtId] > G.time; else if (conf.cond[0] == 'time') return conf.cond[1] == -1 || collection.active?.[fmtId] > G.time; else if (conf.cond[0] == 'model') return Object.values(collection.model).find(i => i.id == conf.cond[1]); + else if (conf.cond[0] == 'heroskin') return conf.cond[1] in (collection.heroskin || {}); else return false; } } \ No newline at end of file