|  |  |  | 
|---|
|  |  |  | import CrossBattlefield | 
|---|
|  |  |  | import CrossRealmPlayer | 
|---|
|  |  |  | import PyGameDataStruct | 
|---|
|  |  |  | import PlayerPackData | 
|---|
|  |  |  | import IpyGameDataPY | 
|---|
|  |  |  | import PyDataManager | 
|---|
|  |  |  | import CrossRealmPK | 
|---|
|  |  |  | 
|---|
|  |  |  | return True | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if GameWorldSkyTower.IsSkyTowerPassPlayer(playerID): | 
|---|
|  |  |  | return True | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if PlayerPackData.IsPackDataPlayer(playerID): | 
|---|
|  |  |  | return True | 
|---|
|  |  |  |  | 
|---|
|  |  |  | #跨服榜单上的默认保留 | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | def DelOutofTimeViewCacheData(): | 
|---|
|  |  |  | ## 删除过期的查看缓存数据 | 
|---|
|  |  |  |  | 
|---|
|  |  |  | PlayerPackData.DelOutofTimePackData() | 
|---|
|  |  |  |  | 
|---|
|  |  |  | pyViewCacheMgr = PyDataManager.GetPlayerViewCachePyManager() | 
|---|
|  |  |  | playerViewCachePyDict = pyViewCacheMgr.playerViewCachePyDict | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | def UpdCrossCacheBase(playerID, cacheBase, isLogout=False): | 
|---|
|  |  |  | ## 更新同步跨服基础查看缓存 | 
|---|
|  |  |  | #更新跨服在线状态,只要有同步即视为在线,除了指定是Logout的 | 
|---|
|  |  |  | olMgr = ChPlayer.GetOnlinePlayerMgr() | 
|---|
|  |  |  | olMgr.SetOnlineState(playerID, not isLogout, cacheBase.get("ServerGroupID", 0)) | 
|---|
|  |  |  | curCache = FindViewCache(playerID, True) | 
|---|
|  |  |  | if not curCache: | 
|---|
|  |  |  | return {} | 
|---|
|  |  |  | 
|---|
|  |  |  | #    ...         ... | 
|---|
|  |  |  | #    WORD        ItemDataSize20; | 
|---|
|  |  |  | #    char        ItemData20[ItemDataSize20]; | 
|---|
|  |  |  | #    BYTE        PackDataSyncState;    // 打包数据同步状态: 0-不同步;个位-是否同步本服;十位-是否同步跨服 | 
|---|
|  |  |  | #    DWORD       PackDataLen; | 
|---|
|  |  |  | #    char        PackData[PackDataLen]; | 
|---|
|  |  |  | #    WORD        PackMsgLen; | 
|---|
|  |  |  | #    char        PackMsg[PackMsgLen]; | 
|---|
|  |  |  | #}; | 
|---|
|  |  |  | def OnMGUpdatePlayerCache(routeIndex, mapID, curPackData, tick): | 
|---|
|  |  |  | playerID = curPackData.PlayerID | 
|---|
|  |  |  | 
|---|
|  |  |  | setattr(curCache, "ItemDataSize%s" % classLV, itemDataSize) | 
|---|
|  |  |  | #GameWorld.DebugLog("    更新Item数据: classLV=%s,size=%s, %s" % (classLV, itemDataSize, itemData), playerID) | 
|---|
|  |  |  |  | 
|---|
|  |  |  | curPlayer = GameWorld.GetPlayerManager().FindPlayerByID(playerID) | 
|---|
|  |  |  | # 在可能删除之前执行打包数据相关逻辑 | 
|---|
|  |  |  | PlayerPackData.OnMGUpdatePlayerPackData(curPlayer, curPackData) | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if isLogout: | 
|---|
|  |  |  | #不需要保存离线数据的,直接删除缓存数据 | 
|---|
|  |  |  | if not IsSaveDBViewCache(curCache): | 
|---|
|  |  |  | DeleteViewCache(playerID) | 
|---|
|  |  |  | return | 
|---|
|  |  |  | curPlayer = GameWorld.GetPlayerManager().FindPlayerByID(playerID) | 
|---|
|  |  |  | if curPlayer: | 
|---|
|  |  |  | curCache.GeTuiID = curPlayer.GetGeTuiClientID() | 
|---|
|  |  |  | curCache.GeTuiIDSize = len(curCache.GeTuiID) | 
|---|