feat:黄旗酒馆

This commit is contained in:
xichaoyin 2024-01-11 22:26:21 +08:00
parent be0923c849
commit ba124d82c9
2 changed files with 10 additions and 2 deletions

View File

@ -413,7 +413,7 @@ export default class HQJGFun {
mydata.giftbuy[gift.id].num++; mydata.giftbuy[gift.id].num++;
// 发送奖励 // 发送奖励
await PlayerFun.sendPrize(call, prize) await PlayerFun.sendPrize(call, prize, true);
await this.setMyData(call.uid, hd.hdid, { giftbuy: mydata.giftbuy }); await this.setMyData(call.uid, hd.hdid, { giftbuy: mydata.giftbuy });
} }

View File

@ -127,7 +127,7 @@ export class PlayerFun {
/** /**
* *
*/ */
static async sendPrize(call: call, prizeList: atn[]) { static async sendPrize(call: call, prizeList: atn[], pushToClient=false) {
prizeList = PublicShared.mergePrize(prizeList); prizeList = PublicShared.mergePrize(prizeList);
let attr = prizeList.filter(atn => atn.a == 'attr' && atn.n != 0); let attr = prizeList.filter(atn => atn.a == 'attr' && atn.n != 0);
@ -148,6 +148,14 @@ export class PlayerFun {
peijian.length > 0 && this.addPeijian(call, peijian) peijian.length > 0 && this.addPeijian(call, peijian)
]); ]);
if(pushToClient){
G.server.sendMsgByUid(call.uid, 'msg_s2c/Collection', {
fromApi: `PlayerFun_sendPrize`,
msg: call.eventMsg
});
call.eventMsg = {};
}
return prizeList; return prizeList;
}; };