notification功能开发
This commit is contained in:
parent
d310ce93f6
commit
d1111725ef
@ -10,20 +10,20 @@ func init() {
|
|||||||
gamedata.InitCfg(CFG_NOTIFICATION)
|
gamedata.InitCfg(CFG_NOTIFICATION)
|
||||||
}
|
}
|
||||||
|
|
||||||
func GetFriendApplyNotificationColdown() int {
|
func GetFriendApplyNotificationCooldown() int {
|
||||||
data, err := gamedata.GetDataByIntKey(CFG_NOTIFICATION, 2)
|
data, err := gamedata.GetDataByIntKey(CFG_NOTIFICATION, 2)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
return gamedata.GetIntValue(data, "Coldown")
|
return gamedata.GetIntValue(data, "Cooldown")
|
||||||
}
|
}
|
||||||
|
|
||||||
func GetPetroomGameNotificationColdown() (int, int) {
|
func GetPetroomGameNotificationCooldown() (int, int) {
|
||||||
data, err := gamedata.GetDataByIntKey(CFG_NOTIFICATION, 1)
|
data, err := gamedata.GetDataByIntKey(CFG_NOTIFICATION, 1)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return 0, 0
|
return 0, 0
|
||||||
}
|
}
|
||||||
return gamedata.GetIntValue(data, "Coldown"), gamedata.GetIntValue(data, "DailyLimit")
|
return gamedata.GetIntValue(data, "Cooldown"), gamedata.GetIntValue(data, "DailyLimit")
|
||||||
}
|
}
|
||||||
|
|
||||||
func GetPetroomGameNotificationMsg() (string, string) {
|
func GetPetroomGameNotificationMsg() (string, string) {
|
||||||
|
|||||||
@ -19,11 +19,11 @@ func NotifyPetroomGame(PlayerId int) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
count, last := GetPetroomGameNotification(PlayerId)
|
count, last := GetPetroomGameNotification(PlayerId)
|
||||||
coldown, dailyLimit := notification_cfg.GetPetroomGameNotificationColdown()
|
cooldown, dailyLimit := notification_cfg.GetPetroomGameNotificationCooldown()
|
||||||
if count >= dailyLimit {
|
if count >= dailyLimit {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if GoUtil.Now()-last < int64(coldown) {
|
if GoUtil.Now()-last < int64(cooldown) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
titlekey, infokey := notification_cfg.GetPetroomGameNotificationMsg()
|
titlekey, infokey := notification_cfg.GetPetroomGameNotificationMsg()
|
||||||
|
|||||||
@ -6,6 +6,7 @@ import (
|
|||||||
baseCfg "server/conf/base"
|
baseCfg "server/conf/base"
|
||||||
friendCfg "server/conf/friend"
|
friendCfg "server/conf/friend"
|
||||||
languageCfg "server/conf/language"
|
languageCfg "server/conf/language"
|
||||||
|
notification_cfg "server/conf/notification"
|
||||||
playroomCfg "server/conf/playroom"
|
playroomCfg "server/conf/playroom"
|
||||||
userCfg "server/conf/user"
|
userCfg "server/conf/user"
|
||||||
GoUtil "server/game_util"
|
GoUtil "server/game_util"
|
||||||
@ -42,3 +43,26 @@ func TestGetEnergyByADNum(t *testing.T) {
|
|||||||
r := baseCfg.GetEnergyByADNum()
|
r := baseCfg.GetEnergyByADNum()
|
||||||
fmt.Println("r:", r)
|
fmt.Println("r:", r)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestGetFriendApplyNotificationCooldown(t *testing.T) {
|
||||||
|
Cooldown := notification_cfg.GetFriendApplyNotificationCooldown()
|
||||||
|
fmt.Println("Cooldown:", Cooldown)
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestGetPetroomGameNotificationCooldown(t *testing.T) {
|
||||||
|
Cooldown, dailyLimit := notification_cfg.GetPetroomGameNotificationCooldown()
|
||||||
|
fmt.Println("Cooldown:", Cooldown)
|
||||||
|
fmt.Println("dailyLimit:", dailyLimit)
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestGetPetroomGameNotificationMsg(t *testing.T) {
|
||||||
|
titlekey, infokey := notification_cfg.GetPetroomGameNotificationMsg()
|
||||||
|
fmt.Println("titlekey:", titlekey)
|
||||||
|
fmt.Println("infokey:", infokey)
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestGetFriendApplyNotificationMsg(t *testing.T) {
|
||||||
|
titlekey, infokey := notification_cfg.GetFriendApplyNotificationMsg()
|
||||||
|
fmt.Println("titlekey:", titlekey)
|
||||||
|
fmt.Println("infokey:", infokey)
|
||||||
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user