notification功能开发
This commit is contained in:
parent
c26c3086af
commit
a10b2fefa7
@ -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()
|
||||
|
||||
@ -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) {
|
||||
|
||||
@ -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))
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user