| | |
| | | lastUpdTick = curPlayer.GetDictByKey(Key_UpdViewCacheTick)
|
| | | tick = GameWorld.GetGameWorld().GetTick()
|
| | | if lastUpdTick and tick - lastUpdTick < 60000:
|
| | | GameWorld.DebugLog("1分钟内只更新一次玩家缓存", playerID)
|
| | | #GameWorld.DebugLog("1分钟内只更新一次玩家缓存", playerID)
|
| | | return
|
| | | curPlayer.SetDict(Key_UpdViewCacheTick, tick)
|
| | | return UpdPlayerViewCache(curPlayer)
|
| | |
| | |
|
| | | tick = GameWorld.GetGameWorld().GetTick()
|
| | | curPlayer.SetDict(Key_UpdViewCacheTick, tick)
|
| | | GameWorld.DebugLog("更新玩家查看缓存数据! isOffline=%s" % isOffline, playerID)
|
| | | #GameWorld.DebugLog("更新玩家查看缓存数据! isOffline=%s" % isOffline, playerID)
|
| | | curCache.SetAccID(curPlayer.GetAccID())
|
| | | curCache.SetPlayerName(curPlayer.GetPlayerName())
|
| | | curCache.SetLV(curPlayer.GetLV())
|
| | |
| | | def UpdPlayerViewCacheByDB(playerID):
|
| | | '''更新玩家查看缓存数据,直接从db数据更新,仅更新dbPlayer表有的属性,
|
| | | '''
|
| | | GameWorld.DebugLog("UpdPlayerViewCacheByDB", playerID)
|
| | | curCache = None
|
| | | dbPlayer = PyMongoMain.GetUserCtrlDB().findDBPlayer(playerID)
|
| | | if not dbPlayer:
|
| | | GameWorld.DebugLog("1111111111111111", playerID)
|
| | | GameWorld.ErrLog("UpdPlayerViewCacheByDB找不到玩家!", playerID)
|
| | | return curCache
|
| | | viewCacheMgr = DBDataMgr.GetPlayerViewCacheMgr()
|
| | | curCache = viewCacheMgr.GetPlayerViewCache(playerID)
|