diff --git a/worldsrv/awardlogmgr.go b/worldsrv/awardlogmgr.go index 6647614..ec14c4d 100644 --- a/worldsrv/awardlogmgr.go +++ b/worldsrv/awardlogmgr.go @@ -33,7 +33,13 @@ func (this *AwardLogManager) GetAwardLog(plt string, typeId int32) map[int32]int // 1 话费 2实物 switch typeId { case 1: - + for _, v := range srvdata.GameItemMgr.GetArr(plt) { + if v.GetType() == common.ItemTypeChange { + if d.AwardMap[v.GetId()] > 0 { + ret[v.GetId()] += d.AwardMap[v.GetId()] + } + } + } case 2: for _, v := range srvdata.GameItemMgr.GetArr(plt) { if v.GetType() == common.ItemTypeObjective { @@ -62,7 +68,10 @@ func (this *AwardLogManager) GetAnnouncerLog(plt string, typeId int32) []model.A // 已兑换数据 func (this *AwardLogManager) UpdateAwardLog(plt string, itemId int32, num int64) { - PlatformMgrSingleton.AddAwardItem(plt, itemId, num) + if srvdata.GameItemMgr.Get(plt, itemId).Type == common.ItemTypeObjective || + srvdata.GameItemMgr.Get(plt, itemId).Type == common.ItemTypeChange { + PlatformMgrSingleton.AddAwardItem(plt, itemId, num) + } } // 实时播报数据 diff --git a/worldsrv/bagmgr.go b/worldsrv/bagmgr.go index e9f3b24..02d0f00 100644 --- a/worldsrv/bagmgr.go +++ b/worldsrv/bagmgr.go @@ -761,8 +761,8 @@ func (this *BagMgr) ItemExchangeCard(p *Player, itemId int32, money, cardType in if p != nil { p.AddMessage(newMsg) //已兑换log - //itemData := srvdata.GameItemMgr.Get(p.Platform, itemId) - //AwardLogMgr.UpdateAwardLog(itemData.Id, int32(1), itemData.Type) + itemData := srvdata.GameItemMgr.Get(p.Platform, itemId) + AwardLogMgr.UpdateAwardLog(p.Platform, itemData.Id, int64(1)) } p.SendToClient(int(bag.SPacketID_PACKET_SC_ITEM_EXCHANGE_RES), pack) }), fmt.Sprintf("ItemExChange%d", p.SnId)).Start() diff --git a/worldsrv/shopmgr.go b/worldsrv/shopmgr.go index 2e3f331..65c80a1 100644 --- a/worldsrv/shopmgr.go +++ b/worldsrv/shopmgr.go @@ -924,7 +924,7 @@ func (this *ShopMgr) Exchange(p *Player, goodsId int32, username, mobile, commen }*/ item := srvdata.GameItemMgr.Get(p.Platform, cdata.ItemId) //已兑换记录 - //AwardLogMgr.UpdateAwardLog(item.Id, int32(1), item.Type) + AwardLogMgr.UpdateAwardLog(p.Platform, item.Id, int64(1)) awardLog := model.AnnouncerLog{ Platform: p.Platform, Snid: p.SnId, @@ -940,7 +940,7 @@ func (this *ShopMgr) Exchange(p *Player, goodsId int32, username, mobile, commen item := srvdata.GameItemMgr.Get(p.Platform, cdata.ItemId) if item.Type == common.ItemTypeObjective { //已兑换记录 - //AwardLogMgr.UpdateAwardLog(item.Id, int32(1), item.Type) + AwardLogMgr.UpdateAwardLog(p.Platform, item.Id, int64(1)) awardLog := model.AnnouncerLog{ Platform: p.Platform, Snid: p.SnId,