From a10b2fefa70d17202ded46f084f21f67a10757de Mon Sep 17 00:00:00 2001 From: hahwu <31872165+hahwu@users.noreply.github.com> Date: Wed, 25 Feb 2026 18:30:26 +0800 Subject: [PATCH] =?UTF-8?q?notification=E5=8A=9F=E8=83=BD=E5=BC=80?= =?UTF-8?q?=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/server/game/notification.go | 2 +- src/server/game/var.go | 8 ++------ src/server/game_util/GoUtil.go | 3 +-- 3 files changed, 4 insertions(+), 9 deletions(-) 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)) }