notification功能开发

This commit is contained in:
hahwu 2026-02-25 18:30:26 +08:00
parent c26c3086af
commit a10b2fefa7
3 changed files with 4 additions and 9 deletions

View File

@ -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()

View File

@ -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) {

View File

@ -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))
}