feat:黄芪酒馆
This commit is contained in:
parent
9d3dd2dbc9
commit
036abb80b4
@ -116,7 +116,6 @@ export default class HQJGFun {
|
||||
todaydps: {},
|
||||
recdpstask: []
|
||||
},
|
||||
lasttime: 0
|
||||
}
|
||||
}
|
||||
|
||||
@ -209,15 +208,11 @@ export default class HQJGFun {
|
||||
|
||||
/** 设置我的数据 */
|
||||
static async setMyData(uid: string, hdid: number, update: { [k in keyof Partial<PlayerData>]: PlayerData[k] }) {
|
||||
if (!update.lasttime) {
|
||||
update.lasttime = G.time;
|
||||
}
|
||||
|
||||
let res = await G.mongodb.cEvent(this.dataType(hdid)).updateOne(
|
||||
{ uid: uid, type: this.dataType(hdid) }, { $set: update }
|
||||
);
|
||||
|
||||
if (res.upsertedCount <= 0) {
|
||||
if (res.modifiedCount <= 0) {
|
||||
await G.mongodb.cEvent(this.dataType(hdid)).updateOne(
|
||||
{ uid: uid, type: this.dataType(hdid) }, { $set: Object.assign(this.defaultData, update) }
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user