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