diff --git a/src/server/game/notification.go b/src/server/game/notification.go index 542b4d3d..bf6460a6 100644 --- a/src/server/game/notification.go +++ b/src/server/game/notification.go @@ -23,7 +23,7 @@ func NotifyPetroomGame(PlayerId int) { if count >= dailyLimit { return } - if GoUtil.Now()-last < int64(cooldown) { + if GoUtil.Now()-last < int64(cooldown*onehour) { return } titlekey, infokey := notification_cfg.GetPetroomGameNotificationMsg() diff --git a/src/server/game/var.go b/src/server/game/var.go index 1a667f6c..5d166455 100644 --- a/src/server/game/var.go +++ b/src/server/game/var.go @@ -231,15 +231,11 @@ func GetPetroomGameNotification(PlayerId int) (int, int64) { if data == nil { return 0, 0 } - info, ok := data.(*VarExpireData) + info, ok := data.(map[string]interface{}) if !ok { return 0, 0 } - if info.T > 0 && info.T < GoUtil.Now() { - return 0, 0 - } - v, ok := info.D.(map[string]interface{}) - return GoUtil.Int(v["count"]), GoUtil.Int64(v["send"]) + return GoUtil.Int(info["count"]), GoUtil.Int64(info["send"]) } func SetPetroomGameNotification(PlayerId int, Count int) { diff --git a/src/server/game_util/GoUtil.go b/src/server/game_util/GoUtil.go index c6ecb145..c1009684 100644 --- a/src/server/game_util/GoUtil.go +++ b/src/server/game_util/GoUtil.go @@ -607,7 +607,6 @@ func NotifyPlayer(uid, pushid int, title, content string) { req.Header.Add("Timestamp", strconv.Itoa(int(timestamp))) req.Header.Add("Signature", signature) req.Header.Add("Content-Type", "application/json") - fmt.Println(payload) res, err := client.Do(req) if err != nil { fmt.Println(err) @@ -620,5 +619,5 @@ func NotifyPlayer(uid, pushid int, title, content string) { fmt.Println(err) return } - log.Debug("notification send uid %d, type %d , res %v", uid, pushid, String(body)) + log.Debug("notification send uid %d, type %d , res %s", uid, pushid, string(body)) }