新增login打点

Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
hahwu 2026-04-27 12:10:18 +08:00
parent ecfed14cbb
commit 89b8aa5455
2 changed files with 46 additions and 32 deletions

View File

@ -199,6 +199,11 @@ func HandleClientReq(args []interface{}) {
p.(*Player).PushClientRes(ResLogin)
p.(*Player).LoginBackData()
p.(*Player).TeLog("Login_log", nil)
if newPlayer {
p.(*Player).TeLog("login", map[string]interface{}{
"is_first": !p.(*Player).PlayMod.getBaseMod().GetIsRegisterLogined(), // 是否注册登录过
})
}
p.(*Player).ProcessTrigger()
}
log.Debug("uid : %d, init user process : %s, execTime : %v , isNew: %v", p.(*Player).M_DwUin, m.GetFunc(), time.Since(start), newPlayer)

View File

@ -14,38 +14,39 @@ const (
)
type Base struct {
Account string
Uid int64
Level int
Exp int
PExp int
Energy int
Star int
Diamond int
LoginTime int64
LoginDay int // 登录天数
LogoutTime int64
RecoverTime int64
FackBookId string
EnergyMul int
IsFirstBuy bool
EnergyBuy int
NickName string
PetName string
FacebookUrl string
Cumulative int // 累计在线时间
TodayCumulative int // 今日累计在线时间
LoginBack bool // 回归补偿
EnergyAD int // 每日看广告获得的能量次数
Seed bool
Source int // 体力资源
Lang msg.LANG_TYPE // 语言
IdCardName string
IdCardNum string
AddCode string // 用于添加好友的code
DiviceId string // 设备id
RegisterTime int64 // 注册时间
CountryCode string // 国家码
Account string
Uid int64
Level int
Exp int
PExp int
Energy int
Star int
Diamond int
LoginTime int64
LoginDay int // 登录天数
LogoutTime int64
RecoverTime int64
FackBookId string
EnergyMul int
IsFirstBuy bool
EnergyBuy int
NickName string
PetName string
FacebookUrl string
Cumulative int // 累计在线时间
TodayCumulative int // 今日累计在线时间
LoginBack bool // 回归补偿
EnergyAD int // 每日看广告获得的能量次数
Seed bool
Source int // 体力资源
Lang msg.LANG_TYPE // 语言
IdCardName string
IdCardNum string
AddCode string // 用于添加好友的code
DiviceId string // 设备id
RegisterTime int64 // 注册时间
CountryCode string // 国家码
IsRegisterLogined bool // 是否注册登录过
}
func (b *Base) InitData(Uid int, Ip string) {
@ -70,6 +71,14 @@ func (b *Base) InitData(Uid int, Ip string) {
}
}
func (b *Base) GetIsRegisterLogined() bool {
is := b.IsRegisterLogined
if !is {
b.IsRegisterLogined = true
}
return is
}
func (b *Base) Login() int64 {
now := GoUtil.Now()
if !GoUtil.IsSameDay(b.LoginTime, now) {