Merge branch 'bugfix' into dev

This commit is contained in:
xichaoyin 2024-01-12 18:20:04 +08:00
commit 715efd504c
13 changed files with 201 additions and 105 deletions

View File

@ -17,7 +17,7 @@ export default async function (call: ApiCall<ReqGetUser, ResGetUser>) {
arr.map(i=>{
res[i.uid] = {
data: i.data,
jifen:i.jifen,
jifen:i?.jifen||0,
};
});

View File

@ -5,7 +5,7 @@ import {ReqYanShi, ResYanShi} from "../../shared/protocols/kuangdong/PtlYanShi";
export default async function (call: ApiCall<ReqYanShi, ResYanShi>) {
return call.errorCode(1)
//return call.errorCode(1)
let hdid = call.req.hdid
let con = await KuangDongfun.getCon(hdid)

View File

@ -41,14 +41,17 @@ export default async function (call: ApiCall<ReqOpen, ResOpen>) {
},
{ 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({
...ops,

View File

@ -5,11 +5,12 @@ 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];
@ -56,4 +57,5 @@ async function main() {
process.exit();
}, 3000);
}
main();

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": "huangqijiuguan/ZhaoMu",
"limit": 1000,
"tips": "单日获取黄旗招募超过1000抽"
},
{
"key":"tanxian/FastGuaJi",
"limit":30,

View File

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

View File

@ -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){

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

@ -233,6 +233,11 @@ export class PlayerFun {
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经验的任务监听
if (atn.t == "payExp" && atn.n > 0) {
G.emit("Class_task_157", 'Class_task_157', call, atn.n, 0);

View File

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

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

View File

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