package notification_cfg

import "server/gamedata"

const (
	CFG_NOTIFICATION = "Notification"
)

func init() {
	gamedata.InitCfg(CFG_NOTIFICATION)
}

func GetFriendApplyNotificationCooldown() int {
	data, err := gamedata.GetDataByIntKey(CFG_NOTIFICATION, 2)
	if err != nil {
		return 0
	}
	return gamedata.GetIntValue(data, "Cooldown")
}

func GetPetroomGameNotificationCooldown() (int, int) {
	data, err := gamedata.GetDataByIntKey(CFG_NOTIFICATION, 1)
	if err != nil {
		return 0, 0
	}
	return gamedata.GetIntValue(data, "Cooldown"), gamedata.GetIntValue(data, "DailyLimit")
}

func GetPetroomGameNotificationMsg() (string, string) {
	data, err := gamedata.GetDataByIntKey(CFG_NOTIFICATION, 1)
	if err != nil {
		return "", ""
	}
	return gamedata.GetStringValue(data, "TitleKey"), gamedata.GetStringValue(data, "InfoKey")
}

func GetFriendApplyNotificationMsg() (string, string) {
	data, err := gamedata.GetDataByIntKey(CFG_NOTIFICATION, 2)
	if err != nil {
		return "", ""
	}
	return gamedata.GetStringValue(data, "TitleKey"), gamedata.GetStringValue(data, "InfoKey")
}
