抽奖活动中奖广播
This commit is contained in:
parent
016406407e
commit
721ff30fb8
|
@ -148,53 +148,36 @@ func (l *LotteryData) sendAward() {
|
|||
return
|
||||
}
|
||||
l.IsSend = true
|
||||
|
||||
var lotteryAward []*welfare.PropInfo
|
||||
for _, v := range l.Reward {
|
||||
lotteryAward = append(lotteryAward, &welfare.PropInfo{
|
||||
ItemId: v.ItemId,
|
||||
ItemNum: v.ItemNum,
|
||||
})
|
||||
}
|
||||
|
||||
pack := &welfare.NotifyLotteryAward{
|
||||
Info: &welfare.LotteryInfo{
|
||||
Id: l.CId,
|
||||
StartTs: l.StartTs,
|
||||
Index: int32(l.Num),
|
||||
Award: lotteryAward,
|
||||
SnId: l.SnId,
|
||||
Name: l.Name,
|
||||
RoleId: l.RoleId,
|
||||
Price: l.Price,
|
||||
},
|
||||
}
|
||||
|
||||
// 广播中奖结果
|
||||
PlayerMgrSington.BroadcastMessageToPlatform(l.Platform, int(welfare.SPacketID_PACKET_NotifyLotteryAward), pack)
|
||||
logger.Logger.Tracef("NotifyLotteryAward: %v", pack)
|
||||
|
||||
if l.IsRobot {
|
||||
return
|
||||
}
|
||||
AddMailLottery(l.Platform, l.SnId, l.Reward)
|
||||
// 通知
|
||||
if p := PlayerMgrSington.GetPlayerBySnId(l.SnId); p != nil {
|
||||
|
||||
var lotteryAward []*welfare.PropInfo
|
||||
for _, v := range l.Reward {
|
||||
lotteryAward = append(lotteryAward, &welfare.PropInfo{
|
||||
ItemId: v.ItemId,
|
||||
ItemNum: v.ItemNum,
|
||||
})
|
||||
}
|
||||
|
||||
var codes []string
|
||||
info := PlayerInfoMgrSingle.Players[p.SnId]
|
||||
if info != nil {
|
||||
if lt := info.Lottery[l.CId]; lt != nil && lt.StartTs == l.StartTs {
|
||||
codes = lt.Code
|
||||
}
|
||||
}
|
||||
|
||||
pack := &welfare.NotifyLotteryAward{
|
||||
Info: &welfare.LotteryInfo{
|
||||
Id: l.CId,
|
||||
StartTs: l.StartTs,
|
||||
EndTs: l.EndTs,
|
||||
WinTs: l.WinTs,
|
||||
RemainCode: int64(l.GetRemainCode()),
|
||||
TotalCode: l.TotalCode,
|
||||
Award: lotteryAward,
|
||||
State: common.LotteryStateOver,
|
||||
WinCode: l.WinCode,
|
||||
SnId: l.SnId,
|
||||
Name: l.Name,
|
||||
Index: int32(l.Num),
|
||||
Price: l.Price,
|
||||
NeedRoomCard: LotteryRoomCard,
|
||||
ImageURL: l.ImageURL,
|
||||
CostRoomCard: l.WinCostCard,
|
||||
Codes: codes,
|
||||
},
|
||||
}
|
||||
p.SendToClient(int(welfare.SPacketID_PACKET_NotifyLotteryAward), pack)
|
||||
logger.Logger.Tracef("NotifyLotteryAward: %v", pack)
|
||||
}
|
||||
}
|
||||
|
||||
func (l *LotteryData) sendRobotCode(a, b int) {
|
||||
|
|
Loading…
Reference in New Issue