#!/usr/bin/python # -*- coding: GBK -*- #------------------------------------------------------------------------------- # ##@package Player.RemoteQuery.GY_Query_PlayerMirror # # @todo:Íæ¼Ò¾µÏñ´ò°üÊý¾Ý # @author hxp # @date 2024-10-17 # @version 1.0 # # ÏêϸÃèÊö: Íæ¼Ò¾µÏñ´ò°üÊý¾Ý # #------------------------------------------------------------------------------- #"""Version = 2024-10-17 15:00""" #------------------------------------------------------------------------------- import GameWorld import MirrorAttack import PlayerViewCacheTube #--------------------------------------------------------------------- # @param query_Type ÇëÇóÀàÐÍ # @param query_ID ÇëÇóµÄÍæ¼ÒID # @param packCMDList ·¢°üÃüÁî # @param tick µ±Ç°Ê±¼ä # @return "True" or "False" or "" def DoLogic(query_Type, query_ID, packCMDList, tick): GameWorld.DebugLog("GY_Query_PlayerMirror DoLogic", query_ID) msgInfo, packDataDict = packCMDList msgType = msgInfo["msgType"] # ¾µÏñÕ½¶· if msgType == "MirrorBattle": curPlayer = None playerID = msgInfo.get("playerID", 0) if playerID: curPlayer = GameWorld.GetPlayerManager().FindPlayerByID(playerID) if not curPlayer or curPlayer.IsEmpty(): return '' MirrorAttack.OnMirrorBattleInit(msgInfo, packDataDict, curPlayer) # ÆäËû¹¦ÄÜ elif msgType == "": pass return '' def DoResult(curPlayer , callFunName , funResult , tick): GameWorld.DebugLog("GY_Query_PlayerMirror DoResult %s" % str(funResult), curPlayer.GetPlayerID()) funResult = eval(funResult) if not funResult: 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) 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, 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) return