后台活动记录

This commit is contained in:
by 2024-10-18 13:32:26 +08:00
parent 083dccffb9
commit e476a7e74b
10 changed files with 32 additions and 0 deletions

View File

@ -117,6 +117,14 @@ const (
SystemFreeGive_CoinType_Diamond //钻石
SystemFreeGive_CoinType_Tiem // 道具
)
const (
ActivityLog_Sign = iota + 1 // 签到
ActivityLog_PhoneLottery //积分抽奖
ActivityLog_DiamondLottery //钻石抽奖
ActivityLog_CollectBox //开启礼盒集卡
ActivityLog_WeekCard //领取周卡奖励
ActivityLog_Permit //通行证
)
type PlayerGameCtrlData struct {
CtrlData map[string]*PlayerGameStatics

View File

@ -61,3 +61,15 @@ func GeneratePhoneLottery(snid int32, platform string, items string, lotteryType
params["Ts"] = strconv.Itoa(int(time.Now().Unix()))
return NewRabbitMQData(mq.BackPhoneLottery, params)
}
// GenerateActivityLog 活动参与log
// childType 1-点击行为 2-兑换行为
func GenerateActivityLog(snid int32, platform string, typeId, childType int32) *mq.RabbitMQData {
params := make(map[string]string)
params["Snid"] = strconv.Itoa(int(snid))
params["Platform"] = platform
params["TypeId"] = strconv.Itoa(int(typeId))
params["ChildType"] = strconv.Itoa(int(childType))
params["Ts"] = strconv.FormatInt(time.Now().Unix(), 10)
return NewRabbitMQData(mq.BackActivityLog, params)
}

View File

@ -17,6 +17,7 @@ const (
BackSystemPermitJoin = "back_permitjoin"
BackSystemPermitTask = "back_permittask"
BackSystemJyb = "back_jyblog"
BackActivityLog = "back_activitylog"
)
// mgrsrv

View File

@ -195,6 +195,7 @@ func CSUpBagInfo(s *netlib.Session, packetid int, data interface{}, sid int64) e
}
if !p.IsRob && tp1 >= 0 {
mq.Write(model.GenerateSystemFreeGive(p.SnId, p.Name, p.Platform, p.Channel, model.SystemFreeGive_CollectBox, tp1, v.ItemNum))
mq.Write(model.GenerateActivityLog(p.SnId, p.Platform, model.ActivityLog_CollectBox, 1))
}
}
}

View File

@ -210,6 +210,7 @@ func (this *CSPhoneLotteryHandler) Process(s *netlib.Session, packetid int, data
mq.Write(model.GenerateSystemFreeGive(p.SnId, p.Name, p.Platform, p.Channel, model.SystemFreeGive_PhoneLottery, tp1, v.ItemNum))
}
}
mq.Write(model.GenerateActivityLog(p.SnId, p.Platform, model.ActivityLog_PhoneLottery, 1))
}
return nil
}
@ -419,6 +420,7 @@ func (this *CSDiamondLotteryHandler) Process(s *netlib.Session, packetid int, da
p.SendToClient(int(player_proto.PlayerPacketID_PACKET_SC_DiamondLottery), pack)
logger.Logger.Trace("返回钻石抽奖信息:", pack.String())
}
mq.Write(model.GenerateActivityLog(p.SnId, p.Platform, model.ActivityLog_DiamondLottery, 1))
}
return nil
}

View File

@ -141,6 +141,9 @@ func SendReward(p *Player, m map[int64]int64, tp int32) {
mq.Write(model.GenerateSystemFreeGive(p.SnId, p.Name, p.Platform, p.Channel, giveType, tp, v.ItemNum))
}
}
if giveType == model.SystemFreeGive_GiveType_TaskPermit {
mq.Write(model.GenerateActivityLog(p.SnId, p.Platform, model.ActivityLog_Permit, 1))
}
}
func CSTaskList(s *netlib.Session, packetId int, data interface{}, sid int64) error {

View File

@ -1132,6 +1132,7 @@ func CSPermitExchange(s *netlib.Session, packetid int, data interface{}, sid int
Gain: gain,
Ts: now.Unix(),
})
mq.Write(model.GenerateActivityLog(p.SnId, p.Platform, model.ActivityLog_Permit, 2))
}
}

View File

@ -4466,6 +4466,7 @@ func (this *Player) GetWeekCardAwary(id int32) {
}
ret.WeekCard = info
this.SendToClient(int(playerproto.PlayerPacketID_PACKET_SCGetWeekCardAwary), ret)
mq.Write(model.GenerateActivityLog(this.SnId, this.Platform, model.ActivityLog_WeekCard, 1))
return
}

View File

@ -717,6 +717,7 @@ func (this *ShopMgr) GainShop(shopInfo *model.ShopInfo, p *Player, vipShopId, po
p.AddDiamond(-costNum, 0, gainWay, "sys", shopName)
case ShopConsumePhoneScore:
p.AddPhoneScore(-costNum, 0, gainWay, "sys", shopName)
mq.Write(model.GenerateActivityLog(p.SnId, p.Platform, model.ActivityLog_PhoneLottery, 2))
case ShopConsumeDiamondScore:
BagMgrSingleton.AddItems(&model.AddItemParam{
Platform: p.Platform,
@ -731,6 +732,7 @@ func (this *ShopMgr) GainShop(shopInfo *model.ShopInfo, p *Player, vipShopId, po
Operator: "system",
Remark: "商城购买消耗钻石积分",
})
mq.Write(model.GenerateActivityLog(p.SnId, p.Platform, model.ActivityLog_DiamondLottery, 2))
default:
logger.Logger.Errorf("GainShop ConstType[%v] err", shopInfo.ConstType)
return shop.OpResultCode_OPRC_Error

View File

@ -404,6 +404,7 @@ func (this *WelfareMgr) GetTurnplate(p *Player) {
}
logger.Logger.Tracef("GetTurnplate snid: %v pack: %v", p.SnId, pack)
p.SendToClient(int(welfare.SPacketID_PACKET_SC_WELF_GETTURNPLATE), pack)
mq.Write(model.GenerateActivityLog(p.SnId, p.Platform, model.ActivityLog_Sign, 1))
}
// GetTurnplteVideo 转盘视频奖励