| | |
| | |
|
| | | # 个推基础判定
|
| | | def CanGeTuiByCache(curCache):
|
| | | if not curCache.GetGeTuiID():
|
| | | if not curCache.GeTuiID:
|
| | | return False
|
| | |
|
| | | # 离线超过24小时不再推送,目前极光推送的特点是推送ID同机器不同包都是同一个ID
|
| | | if time.time() - curCache.GetOffTime() > 24*60*60:
|
| | | if time.time() - curCache.OffTime > 24*60*60:
|
| | | return False
|
| | | return True
|
| | |
|
| | |
| | | continue
|
| | |
|
| | | # 离线玩家
|
| | | curCache = PlayerViewCache.ViewCacheMgr.FindCache(playerID)
|
| | | curCache = PlayerViewCache.FindViewCache(playerID)
|
| | | if not curCache:
|
| | | continue
|
| | |
|
| | |
| | | #0-默认未关注, 1-主动关注, 2-自动关注, 9-主动取消关注
|
| | | continue
|
| | |
|
| | | cacheDict = eval(curCache.GetPropData())
|
| | | cacheDict = PlayerViewCache.GetCachePropDataDict(curCache)
|
| | | if not CheckCanGeTui(cacheDict, geTuiType):
|
| | | # 个推逻辑检查
|
| | | continue
|
| | |
| | | if appID not in appIDDict:
|
| | | appIDDict[appID] = []
|
| | |
|
| | | appIDDict[appID].append([curCache.GetGeTuiID(), cacheDict.get("Name", "")])
|
| | | appIDDict[appID].append([curCache.GeTuiID, cacheDict.get("Name", "")])
|
| | |
|
| | |
|
| | | if not appIDDict:
|
| | |
| | |
|
| | | # 私聊
|
| | | def ChatMiGeTui(playerID, playerName, tagPlayerName):
|
| | | curCache = PlayerViewCache.ViewCacheMgr.FindCache(playerID)
|
| | | curCache = PlayerViewCache.FindViewCache(playerID)
|
| | | if not curCache:
|
| | | return
|
| | |
|
| | |
| | | #无推送资格,基础判定
|
| | | return
|
| | |
|
| | | cacheDict = eval(curCache.GetPropData())
|
| | | cacheDict = PlayerViewCache.GetCachePropDataDict(curCache)
|
| | | if not CheckCanGeTui(cacheDict, Def_Onoff_Chat):
|
| | | # 过滤个推
|
| | | return
|
| | |
|
| | | showStr = GameWorld.GbkToCode(IpyGameDataPY.GetFuncCfg("GeTuiOffLine", 3))%(tagPlayerName) # 文字信息
|
| | | GeTuiNotify({cacheDict.get("AppID", ""):[[curCache.GetGeTuiID(), playerName]]}, showStr)
|
| | | GeTuiNotify({cacheDict.get("AppID", ""):[[curCache.GeTuiID, playerName]]}, showStr)
|
| | | return
|
| | |
|
| | | # 下线时,低级玩家没有离线时间的玩家提示, 上线清空
|