| | |
| | |
|
| | | import GameWorld
|
| | | import MirrorAttack
|
| | | import PlayerViewCacheTube
|
| | | import PyGameData
|
| | | #---------------------------------------------------------------------
|
| | |
|
| | |
| | | return
|
| | | msgType = funResult[0]
|
| | | msgData = funResult[1]
|
| | | |
| | | if msgType == "PackDataSyncState":
|
| | | PlayerViewCacheTube.UpdPackDataSyncState(curPlayer, msgData)
|
| | | if msgData.get("PackDataCross"): # 如果跨服需要的,立即同步一次
|
| | | PlayerViewCacheTube.UpdateGameServerPlayerCache(curPlayer, tick)
|
| | | elif msgType == "PullPlayerPackData":
|
| | | msgInfo = msgData
|
| | | __DoPullPlayerPackData(curPlayer, msgInfo, tick)
|
| | | |
| | | elif msgType == "PullPlayerViewCache":
|
| | | msgInfo = msgData
|
| | | __DoPullPlayerViewCache(curPlayer, msgInfo, tick)
|
| | | |
| | | # |
| | | # if msgType == "PackDataSyncState":
|
| | | # PlayerViewCacheTube.UpdPackDataSyncState(curPlayer, msgData)
|
| | | # if msgData.get("PackDataCross"): # 如果跨服需要的,立即同步一次
|
| | | # PlayerViewCacheTube.UpdateGameServerPlayerCache(curPlayer, tick)
|
| | | # elif msgType == "PullPlayerPackData":
|
| | | # msgInfo = msgData
|
| | | # __DoPullPlayerPackData(curPlayer, msgInfo, tick)
|
| | | # |
| | | # elif msgType == "PullPlayerViewCache":
|
| | | # msgInfo = msgData
|
| | | # __DoPullPlayerViewCache(curPlayer, msgInfo, tick)
|
| | | # |
| | | return
|
| | |
|
| | | def __DoPullPlayerPackData(curPlayer, msgInfo, tick):
|
| | | pullFrom = msgInfo.get("pullFrom")
|
| | | # 0 或 非本服代表跨服需要
|
| | | if pullFrom == 0 or (pullFrom > 0 and pullFrom != GameWorld.GetServerGroupID()):
|
| | | PlayerViewCacheTube.SetPackDataCrossSyncState(curPlayer)
|
| | | else:
|
| | | PlayerViewCacheTube.SetPackDataSyncState(curPlayer)
|
| | | PlayerViewCacheTube.UpdateGameServerPlayerCache(curPlayer, tick, forcePackData=True, packMsg=msgInfo)
|
| | | # if pullFrom == 0 or (pullFrom > 0 and pullFrom != GameWorld.GetServerGroupID()):
|
| | | # PlayerViewCacheTube.SetPackDataCrossSyncState(curPlayer)
|
| | | # else:
|
| | | # PlayerViewCacheTube.SetPackDataSyncState(curPlayer)
|
| | | # PlayerViewCacheTube.UpdateGameServerPlayerCache(curPlayer, tick, forcePackData=True, packMsg=msgInfo)
|
| | | return
|
| | |
|
| | | def __DoPullPlayerViewCache(curPlayer, msgInfo, tick):
|
| | | viewFrom = msgInfo.get("viewFrom")
|
| | | # 0 或 非本服代表跨服需要
|
| | | if viewFrom == 0 or (viewFrom > 0 and viewFrom != GameWorld.GetServerGroupID()):
|
| | | PlayerViewCacheTube.SetViewCacheCrossSyncState(curPlayer)
|
| | | PlayerViewCacheTube.UpdateGameServerPlayerCache(curPlayer, tick, packMsg=msgInfo, isOnlyViewCache=True)
|
| | | # if viewFrom == 0 or (viewFrom > 0 and viewFrom != GameWorld.GetServerGroupID()):
|
| | | # PlayerViewCacheTube.SetViewCacheCrossSyncState(curPlayer)
|
| | | # PlayerViewCacheTube.UpdateGameServerPlayerCache(curPlayer, tick, packMsg=msgInfo, isOnlyViewCache=True)
|
| | | return
|
| | |
|