package event

import "github.com/mhaya/game/game_cluster/internal/token"

type PlayerDailyData struct {
	ActorId         string // actor id
	PlayerId        string // player id
	OpenID          string
	ServerID        string
	TargetPath      string
	LoginDays       int // 累计登录天数(每天+1)
	ContinueDays    int // 连续登录天数(超过一天则归零)
	MaxContinueDays int // 最大连续登录天数
}

func NewPlayerDailyData(actorId string, token *token.Token) PlayerLogin {
	event := PlayerLogin{
		ActorId:    actorId,
		PlayerId:   token.PlayerID,
		OpenID:     token.OpenID,
		TargetPath: token.TargetPath,
	}
	return event
}

func (PlayerDailyData) Name() string {
	return PlayerLoginKey
}

func (p PlayerDailyData) UniqueId() string {
	return p.PlayerId
}
