Compare commits

...

2 Commits

Author SHA1 Message Date
286b10947d 外网insertMany报错兼容 2024-01-12 17:51:01 +08:00
xichaoyin
a2e3fc1aa9 fix:
1:头像框脚本
2:添加监控数据
2024-01-12 17:50:37 +08:00
4 changed files with 96 additions and 11 deletions

View File

@ -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();

View File

@ -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,

View File

@ -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])));
}

View File

@ -78,16 +78,17 @@ export class XstaskFun {
uid: uid,
};
});
let result = await G.mongodb.collection('xstask').insertMany(taskList);
this.uidTask[uid] = this.uidTask[uid] || [];
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];
}