Merge branch 'feature/playerhead' into dev

This commit is contained in:
dy 2023-12-21 16:10:47 +08:00
commit 8ca2772e30
2 changed files with 37 additions and 2 deletions

View File

@ -0,0 +1,35 @@
import {ctor} from "./global";
import {initMongoDB} from "./setMongodb";
async function start() {
await initMongoDB()
// 刷新活动配置
console.log(`修复玩家model数据开始...`);
await G.mongodb.collection("user").updateMany({},{
$set:{
upModel:{id: "1", time: -1},
model: {
'1': {id: "1", time: -1},
'2': {id: "2", time: -1}
}
}
})
console.log(`修复玩家model数据完成...`);
}
ctor();
start().then(() => {
let s = 0;
setInterval(() => {
s += 1;
console.log(new Date().format("MM-dd hh:mm:ss"));
if (s >= 3) process.exit(1);
}, 1000)
console.log("逻辑执行完成...等待退出!!!");
});

View File

@ -406,10 +406,10 @@ export class UserFun {
if (conf?.cond?.[0] == 'time') {
let val = conf.cond[1];
if (val == -1 && gud.model[conf.id]) {
if (val == -1) {
change = true;
gud.model[conf.id] = {id: conf.id + '', time: -1};
} else if (!gud.model[conf.id] || gud.model[conf.id].time < G.time) {
} else if (gud.model[conf.id].time < G.time) {
change = true;
gud.model[conf.id] = {id: conf.id + '', time: G.time + val * v};
} else {