game_sync/worldsrv/invitecode.go

36 lines
786 B
Go

package main
import (
"time"
"mongo.games.com/game/common"
"mongo.games.com/game/model"
"mongo.games.com/game/mq"
)
// SaveInviteScore 保存玩家操作
// 绑定,充值成功,充值;及产生的积分,充值金额
func SaveInviteScore(data *model.InviteScore) {
if data == nil {
return
}
cfg := PlatformMgrSingleton.GetConfig(data.Platform).ActInviteConfig
data.Rate = cfg.GetRates()
mq.Write(&model.EvtInviteMsg{
InviteScore: *data,
RechargeScore: cfg.GetRechargeScore(),
})
}
// CheckNewWeek 每周重置积分
func CheckNewWeek(platform string, snid int32) {
mq.Write(&model.EvtInviteMsg{
InviteScore: model.InviteScore{
Platform: platform,
SnId: snid,
Tp: common.InviteScoreCheckWeek,
Ts: time.Now().Unix(),
},
})
}