Compare commits

...

6 Commits

Author SHA1 Message Date
xichaoyin
c52f9b4b9a Merge remote-tracking branch 'origin/feature/skin' into release 2024-01-12 17:55:11 +08:00
xichaoyin
129103d061 Merge remote-tracking branch 'origin/feature/huangqijiuguan' into release 2024-01-12 17:55:00 +08:00
xichaoyin
55cb50a27c feat:heroskin 2024-01-12 15:45:56 +08:00
xichaoyin
dd9eeca150 feat:重置bug修复 2024-01-12 14:14:42 +08:00
xichaoyin
8718342e3b feat:log 2024-01-12 14:03:18 +08:00
xichaoyin
b27f8e5c64 feat:黄芪酒馆 2024-01-12 13:42:43 +08:00
2 changed files with 8 additions and 6 deletions

View File

@ -206,10 +206,11 @@ export default class HQJGFun {
/** 设置我的数据 */
static async setMyData(uid: string, hdid: number, update: { [k in keyof Partial<PlayerData>]: PlayerData[k] }) {
let res = await G.mongodb.cEvent(this.dataType(hdid)).updateOne(
{ uid: uid, type: this.dataType(hdid) }, { $set: update }
{ uid: uid, type: this.dataType(hdid) }, { $set: update }, { upsert: true }
);
if (res.modifiedCount <= 0) {
if (res.upsertedCount == 1) {
console.log("===>", uid, hdid, update);
await G.mongodb.cEvent(this.dataType(hdid)).updateOne(
{ uid: uid, type: this.dataType(hdid) }, { $set: Object.assign(this.defaultData, update) }
);
@ -433,7 +434,7 @@ export default class HQJGFun {
return
}
let mydata = await this.getMydata(call);
let mydata = await this.getMydata(call, hd);
if (!mydata.giftbuy[gift.id]) {
mydata.giftbuy[gift.id] = { num: 0, select: [] };
}

View File

@ -124,6 +124,7 @@ export class PublicShared {
else if (atn.a == 'item') return G.gc.item[atn.t];
else if (atn.a == 'hero') return G.gc.hero[atn.t];
else if (atn.a == 'equip') return G.gc.equip[atn.t];
else if (atn.a == 'heroskin') return G.gc.heroSkin[atn.t];
return null;
}