package rank

import (
	"mongo.games.com/goserver/core/logger"

	"mongo.games.com/game/model"
	"mongo.games.com/game/ranksrv/com"
)

var RankInviteMgrInstance = com.NewListMgr[*model.PlayerRankInvite](
	func() int64 {
		return int64(model.GameParamData.RankTimeout)
	},
	func(platform string, index int32) ([]*model.PlayerRankInvite, error) {
		logger.Logger.Tracef("load rank invite platform:%s rankType:%d", platform, index)
		InviteList, err := model.FindPlayerRankInviteList(&model.FindPlayerRankInviteListArgs{
			Platform: platform,
			RankType: index,
		})
		if err != nil {
			return nil, err
		}
		return InviteList.List, nil
	})
