#!/usr/bin/python # -*- coding: GBK -*- #------------------------------------------------------------------------------- # ##@package Player.PlayerTravel # # @todo:ÓÎÀú # @author hxp # @date 2025-11-25 # @version 1.0 # # ÏêϸÃèÊö: ÓÎÀú # #------------------------------------------------------------------------------- #"""Version = 2025-11-25 17:30""" #------------------------------------------------------------------------------- import ChConfig import PlayerControl import IpyGameDataPY import ChPyNetSendPack import NetPackCommon import ItemControler import PlayerBeauty import GameWorld import ObjPool import random import time GridState_None = 0 # δµã»÷ GridState_Opend = 1 # ÒÑ´ò¿ª GridState_Crack = 2 # ÁÑÎÆµÄ£¬ÐèÔٴεã»÷¿ªÆô # ¾°¹ÛÀàÐÍÏà¹ØÉèÖà {¾°¹ÛÀàÐÍ:[Õ¼µØÐÐ,ÁÐ], ...} SceneryTypeSet = { 1:[1, 1], 4:[2, 2], 6:[3, 2], } # СÓÚ99µÄΪ¾°¹ÛÐÐÁбàºÅʼþ±ê¼Ç: 1~n EventID_Portal = 99 # ´«ËÍÃÅ EventID_Blank = 100 # ¿Õ°× EventID_Bomb = 101 # Ê®×ÖÕ¨µ¯ #¹Ì¶¨µÄÌØÊâʼþID SpecEventIDList = [EventID_Portal, EventID_Blank, EventID_Bomb] # ºó¶Ë´¦Àí ( Result_None, # ÎÞ£¬ºó¶ËÖ÷¶¯Í¬²½£¬ÈçµÇ¼¡¢GMµÈ 0 Result_Comm, # ³£¹æµã»÷·µ»Ø 1 Result_Bomb, # Âí³µÕ¨µ¯ 2 Result_Portal, # µã»÷´«ËÍÃÅ 3 Result_SceneryUp, # Éý¼¶¾°¹Û 4 Result_Reset, # ÖØÐ¿ªÊ¼ 5 ) = range(6) def DoTravelOpen(curPlayer): energy = IpyGameDataPY.GetFuncCfg("TravelSet", 1) PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TravelEnergy, energy) ResetTravelGrid(curPlayer) return def OnPlayerLogin(curPlayer): if curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TravelState) == 2: ResetTravelGrid(curPlayer) else: SyncTravelInfo(curPlayer, isAll=True) return ## Def_PDict_TravelGridInfo ¸ñ×ÓÐÅÏ¢£¬ ʼþID*100+ÊÇ·ñË«±¶*10+¿ªÆô״̬ def GetGridState(curPlayer, row, col): ## ¸ñ×Ó״̬£º 0-먦Æô£»1-ÒÑ¿ªÆô£»2-ÁÑÎÆ return curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TravelGridInfo % (row, col)) % 10 def SetGridState(curPlayer, row, col, state): dataValue = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TravelGridInfo % (row, col)) updValue = dataValue / 10 * 10 + min(state, 9) return PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TravelGridInfo % (row, col), updValue) def GetGridMulti(curPlayer, row, col): ## ½±Àø±¶Öµ dataValue = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TravelGridInfo % (row, col)) return max(1, GameWorld.GetValue(dataValue, 2, 1)) def SetGridMulti(curPlayer, row, col, multi=1): dataValue = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TravelGridInfo % (row, col)) updValue = GameWorld.SetValue(dataValue, 2, 1, multi) return PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TravelGridInfo % (row, col), updValue) def GetGridEventID(curPlayer, row, col): ## ¸ñ×ÓʼþID return curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TravelGridInfo % (row, col)) / 100 def SetGridEventID(curPlayer, row, col, eventID): dataValue = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TravelGridInfo % (row, col)) updValue = eventID * 100 + dataValue % 100 return PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TravelGridInfo % (row, col), updValue) def ResetTravelGrid(curPlayer, sceneryType=0): ## ÖØÖÃÓÎÀúÍø¸ñ rowMax, colMax = IpyGameDataPY.GetFuncEvalCfg("TravelSet", 3) # ÐÐÁÐ for row in range(1, 1 + rowMax): for col in range(1, 1 + colMax): PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TravelGridInfo % (row, col), 0) # ³õʼ»¯¾°¹ÛÀàÐÍ¡¢Î»Öà if sceneryType in SceneryTypeSet: # GMÖ¸¶¨ÁËÀàÐÍ pass else: sceneryTypeWeightList = IpyGameDataPY.GetFuncEvalCfg("TravelRate", 3) sceneryType = GameWorld.GetResultByWeightList(sceneryTypeWeightList) if sceneryType not in SceneryTypeSet: sceneryType = SceneryTypeSet.keys()[0] rowSet, colSet = SceneryTypeSet[sceneryType] randRowMax = rowMax - rowSet + 1 randColMax = colMax - colSet + 1 GameWorld.DebugLog("ÖØÖÃÓÎÀúÍø¸ñ: sceneryType=%s,rowSet=%s,colSet=%s,randRowMax=%s,randColMax=%s" % (sceneryType, rowSet, colSet, randRowMax, randColMax)) randRow = random.randint(1, randRowMax) randCol = random.randint(1, randColMax) sceneryValue = randRow * 100 + randCol * 10 + sceneryType PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TravelScenery, sceneryValue) PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TravelSceneryLVInfo, 0) PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TravelState, 0) GameWorld.DebugLog(" ¾°¹ÛλÖÃ: randRow=%s,randCol=%s,sceneryValue=%s" % (randRow, randCol, sceneryValue)) for row in range(randRow, randRow + rowSet): for col in range(randCol, randCol + colSet): eventID = (row - randRow) * colSet + (col - randCol) + 1 # ¾°¹Û¸÷λÖöÔӦʼþID£¬1~n SetGridEventID(curPlayer, row, col, eventID) GameWorld.DebugLog(" row=%s,col=%s,eventID=%s" % (row, col, eventID)) SyncTravelInfo(curPlayer, result=Result_Reset, isAll=True) return sceneryType, randRow, randCol def __getSceneryInfo(curPlayer): sceneryValue = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TravelScenery) sRow = sceneryValue / 100 sCol = sceneryValue % 100 / 10 sceneryType = sceneryValue % 10 return sceneryType, sRow, sCol def __checkSceneryOpend(curPlayer): ## ¼ì²é¾°¹ÛÏà¹Ø¸ñ×ÓÊÇ·ñÒÑÈ«²¿´ò¿ª sceneryType, sRow, sCol = __getSceneryInfo(curPlayer) if sceneryType not in SceneryTypeSet: return rowSet, colSet = SceneryTypeSet[sceneryType] for row in range(sRow, sRow + rowSet): for col in range(sCol, sCol + colSet): gridState = GetGridState(curPlayer, row, col) if gridState != GridState_Opend: GameWorld.DebugLog("»¹Óо°¹Û¸ñ×Ó먦Æô: row=%s,col=%s,gridState=%s" % (row, col, gridState)) return return True def OnProcess(curPlayer): CheckTravelEnergyRecover(curPlayer) return def GetTravelEnergyMax(curPlayer): initEnergy = IpyGameDataPY.GetFuncCfg("TravelSet", 1) addEnergy = PlayerBeauty.GetBeautyEffInfo(curPlayer, PlayerBeauty.EffType_TravelEnergy)[0] return initEnergy + addEnergy def CheckTravelEnergyRecover(curPlayer, isNotify=True): ## ¼ì²éÌåÁ¦»Ö¸´ maxEnergy = GetTravelEnergyMax(curPlayer) curEnergy = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TravelEnergy) lastRecoverTime = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TravelEnergyTime) if curEnergy >= maxEnergy: if lastRecoverTime: GameWorld.DebugLog("ÓÎÀúÌåÁ¦ÒÑÂú! curEnergy=%s/%s" % (curEnergy, maxEnergy)) PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TravelEnergyTime, 0) isNotify and SyncTravelInfo(curPlayer) return curTime = int(time.time()) passSeconds = curTime - lastRecoverTime if not lastRecoverTime or passSeconds < 0: GameWorld.DebugLog("ÖØÉèÓÎÀúÌåÁ¦»Ö¸´Ê±¼ä! curEnergy=%s/%s" % (curEnergy, maxEnergy)) PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TravelEnergyTime, curTime) isNotify and SyncTravelInfo(curPlayer) return cdSeconds = IpyGameDataPY.GetFuncCfg("TravelSet", 2) * 60 if passSeconds < cdSeconds: return recoverCnt = passSeconds / cdSeconds recoverCnt = min(recoverCnt, maxEnergy - curEnergy) updEnergy = curEnergy + recoverCnt updRecoverTime = curTime - passSeconds % cdSeconds PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TravelEnergy, updEnergy) PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TravelEnergyTime, updRecoverTime) GameWorld.DebugLog("»Ö¸´ÓÎÀúÌåÁ¦: %s,curEnergy=%s,updEnergy=%s/%s,passSeconds=%s,Éϴλָ´:%s" % (recoverCnt, curEnergy, updEnergy, maxEnergy, passSeconds, GameWorld.ChangeTimeNumToStr(lastRecoverTime))) if updEnergy >= maxEnergy: GameWorld.DebugLog("ÌåÁ¦ÒÑÂú!") PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TravelEnergyTime, 0) isNotify and SyncTravelInfo(curPlayer) return def AddTravelEnergy(curPlayer, addEnergy): ## Ôö¼ÓÌåÁ¦ energy = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TravelEnergy) updEnergy = energy + addEnergy updEnergy = PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TravelEnergy, updEnergy) SyncTravelInfo(curPlayer) return #// B0 40 ÓÎÀúµã»÷ #tagCSTravelClick # #struct tagCSTravelClick #{ # tagHead Head; # BYTE Row; //ÐУ¬´Ó1¿ªÊ¼ # BYTE Col; //ÁУ¬´Ó1¿ªÊ¼ #}; def OnTravelClick(index, curPackData, tick): curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index) row = curPackData.Row col = curPackData.Col if curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TravelState) == 2: GameWorld.DebugLog("ÇëÇóÖØÖÃÓÎÀú¸ñ×Ó") ResetTravelGrid(curPlayer) return gridState = GetGridState(curPlayer, row, col) GameWorld.DebugLog("ÓÎÀúµã»÷: row=%s,col=%s,gridState=%s" % (row, col, gridState)) rowMax, colMax = IpyGameDataPY.GetFuncEvalCfg("TravelSet", 3) # ÐÐÁÐ if row <= 0 or col <= 0 or row > rowMax or col > colMax: GameWorld.DebugLog("²»´æÔڸøñ×Ó: row=%s,col=%s,rowMax=%s,colMax=%s" % (row, col, rowMax, colMax)) return if gridState in [GridState_None, GridState_Crack]: energy = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TravelEnergy) if not energy: GameWorld.DebugLog("ÓÎÀúûÓÐÌåÁ¦") return __doClickUnOpendGrid(curPlayer, row, col) energy -= 1 PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TravelEnergy, energy) travelCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TravelCnt) + 1 travelCnt = PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TravelCnt, travelCnt) GameWorld.DebugLog("¸üÐÂÌåÁ¦: energy=%s,travelCnt=%s" % (energy, travelCnt)) CheckTravelEnergyRecover(curPlayer, False) SyncTravelInfo(curPlayer, [[row, col]], Result_Comm) else: __doClickGridEvent(curPlayer, row, col) return def __doClickUnOpendGrid(curPlayer, row, col): ## Ö´Ðеã»÷먦ÆôµÄ¸ñ×Ó gridState = GetGridState(curPlayer, row, col) if gridState == GridState_None: crackRate = IpyGameDataPY.GetFuncCfg("TravelRate", 1) if GameWorld.CanHappen(crackRate): GameWorld.DebugLog("´¥·¢ÁÑÎÆ: row=%s,col=%s,crackRate=%s" % (row, col, crackRate)) SetGridState(curPlayer, row, col, GridState_Crack) else: __openGridRandEvent(curPlayer, row, col) # Ôٴεã»÷ÁÑÎÆ elif gridState == GridState_Crack: __openGridRandEvent(curPlayer, row, col) else: return return True def __openGridRandEvent(curPlayer, row, col): ## Ö´Ðдò¿ª¸ñ×ÓËæ»úÉú³Éʼþ SetGridState(curPlayer, row, col, GridState_Opend) eventID = GetGridEventID(curPlayer, row, col) if eventID: GameWorld.DebugLog("¸ÃÓÎÀú¸ñ×ÓÒѾ­ÓÐʼþIDÁË! row=%s,col=%s,eventID=%s" % (row, col, eventID)) return # Éú³ÉʼþID eventWeightList = [] ipyDataMgr = IpyGameDataPY.IPY_Data() for index in range(ipyDataMgr.GetTravelEventCount()): ipyData = ipyDataMgr.GetTravelEventByIndex(index) eventID = ipyData.GetEventID() eventWeight = ipyData.GetEventWeight() eventWeightList.append([eventWeight, ipyData]) multi = 1 ipyData = GameWorld.GetResultByWeightList(eventWeightList) if not ipyData: eventID = EventID_Blank else: eventID = ipyData.GetEventID() if ipyData.GetAwardItemID(): multiRate = IpyGameDataPY.GetFuncCfg("TravelRate", 2) if GameWorld.CanHappen(multiRate): multi = 2 SetGridMulti(curPlayer, row, col, multi) SetGridEventID(curPlayer, row, col, eventID) GameWorld.DebugLog("Ëæ»ú¸ñ×Óʼþ: row=%s,col=%s,eventID=%s,multi=%s" % (row, col, eventID, multi)) return def __doClickGridEvent(curPlayer, row, col): ## µã»÷½áËã¸ñ×ÓµÄʼþ eventID = GetGridEventID(curPlayer, row, col) if not eventID: GameWorld.DebugLog("¸ÃÓÎÀú¸ñ×Ó»¹Î´Éú³Éʼþ! row=%s,col=%s,eventID=%s" % (row, col, eventID)) return if eventID == EventID_Blank: GameWorld.DebugLog("¿Õ°×ʼþ²»´¦Àí! row=%s,col=%s,eventID=%s" % (row, col, eventID)) return syncGridList = [] # Ê®×ÖÕ¨µ¯ if eventID == EventID_Bomb: GameWorld.DebugLog("µã»÷Âí³µÕ¨µ¯! row=%s,col=%s,eventID=%s" % (row, col, eventID)) result = Result_Bomb rowMax, colMax = IpyGameDataPY.GetFuncEvalCfg("TravelSet", 3) # ÐÐÁÐ # ͬÐÐ for c in range(1, 1 + colMax): if __doClickUnOpendGrid(curPlayer, row, c): syncGridList.append([row, c]) # ͬÁÐ for r in range(1, 1 + rowMax): if __doClickUnOpendGrid(curPlayer, r, col): syncGridList.append([r, col]) # ´«ËÍÃÅ elif eventID == EventID_Portal: GameWorld.DebugLog("µã»÷´«ËÍÃÅ! row=%s,col=%s,eventID=%s" % (row, col, eventID)) result = Result_Portal __giveAwardEvent(curPlayer, syncGridList, "TravelPortal") PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TravelState, 2) # ±ê¼ÇÒѵ㴫ËÍÃÅ if not syncGridList: GameWorld.DebugLog("µã»÷´«ËÍÃÅʱûÓÐδÁìÈ¡µÄ£¬Ö±½ÓÖØÐ¿ªÊ¼") ResetTravelGrid(curPlayer) return # ¾°¹Û elif eventID < EventID_Portal: GameWorld.DebugLog("µã»÷¾°¹Û! row=%s,col=%s,eventID=%s" % (row, col, eventID)) result = Result_SceneryUp if not __checkSceneryOpend(curPlayer): return # ÆäËûĬÈϰ´ÎïÆ·½±Àø´¦Àí else: GameWorld.DebugLog("ÁìÈ¡ËùÓÐÒÑ¿ªÆôµÄ¸ñ×Ó½±Àø! row=%s,col=%s,eventID=%s" % (row, col, eventID)) result = Result_Comm __giveAwardEvent(curPlayer, syncGridList, "TravelAward") SyncTravelInfo(curPlayer, syncGridList, result) return def __giveAwardEvent(curPlayer, syncGridList, eventName): ## ½áËãËùÓÐδÁìÈ¡µÄ½±ÀøÊ¼þ itemDict = {} rowMax, colMax = IpyGameDataPY.GetFuncEvalCfg("TravelSet", 3) for row in range(1, 1 + rowMax): for col in range(1, 1 + colMax): eventID = GetGridEventID(curPlayer, row, col) if eventID in SpecEventIDList or eventID < EventID_Portal: continue ipyData = IpyGameDataPY.GetIpyGameDataNotLog("TravelEvent", eventID) if not ipyData: continue itemID = ipyData.GetAwardItemID() itemCount = ipyData.GetAwardItemCnt() if not itemID or not itemCount: continue multi = GetGridMulti(curPlayer, row, col) itemDict[itemID] = itemDict.get(itemID, 0) + itemCount * multi SetGridEventID(curPlayer, row, col, EventID_Blank) # ´¦ÀíÍê½±ÀøºóÉèÖÃΪ¿Õ°× syncGridList.append([row, col]) GameWorld.DebugLog(" ¸ñ×Ó½±Àø: row=%s,col=%s,eventID=%s,itemID=%s,itemCount=%s,multi=%s,%s" % (row, col, eventID, itemID, itemCount, multi, itemDict)) if not itemDict: return itemList = [[itemID, itemCount] for itemID, itemCount in itemDict.items()] GameWorld.DebugLog(" ½±Àø»ã×Ü: itemList=%s" % (itemList)) ItemControler.GivePlayerItemOrMail(curPlayer, itemList, event=[eventName, False, {}]) return #// B0 41 ÓÎÀú¾°¹ÛÉý¼¶ #tagCSTravelSceneryUP # #struct tagCSTravelSceneryUP #{ # tagHead Head; #}; def OnTravelSceneryUP(index, curPackData, tick): curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index) if curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TravelState): GameWorld.DebugLog("¾°¹Û½±ÀøÒѾ­½áËã¹ýÁË!") return if not __checkSceneryOpend(curPlayer): return sceneryType, sRow, sCol = __getSceneryInfo(curPlayer) ipyDataList = IpyGameDataPY.GetIpyGameDataList("TravelScenery", sceneryType) if not ipyDataList: return qualityCnt = len(ipyDataList) sceneryLVInfo = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TravelSceneryLVInfo) GameWorld.DebugLog("¾°¹ÛÉý¼¶: sceneryType=%s,sRow=%s,sCol=%s,qualityCnt=%s,sceneryLVInfo=%s" % (sceneryType, sRow, sCol, qualityCnt, sceneryLVInfo)) upRetList = [] # Éý¼¶½á¹ûÁбí upSuccCnt = 0 for upBit in range(1, qualityCnt): upRet = GameWorld.GetValue(sceneryLVInfo, upBit, 1) if not upRet: break upRetList.append(upRet) if upRet == 1: upSuccCnt += 1 awardIpyData = ipyDataList[upSuccCnt] if len(ipyDataList) > upSuccCnt else ipyDataList[-1] awardQuality = awardIpyData.GetAwardQuality() GameWorld.DebugLog("upSuccCnt=%s,upRetList=%s,awardQuality=%s" % (upSuccCnt, upRetList, awardQuality)) if len(upRetList) < qualityCnt - 1: upRate = awardIpyData.GetUpRate() upRet = 1 if GameWorld.CanHappen(upRate) else 2 updSceneryLVInfo = GameWorld.SetValue(sceneryLVInfo, len(upRetList) + 1, 1, upRet) GameWorld.DebugLog("Éý¼¶½á¹û=%s,upRate=%s,updSceneryLVInfo=%s" % (upRet, upRate, updSceneryLVInfo)) PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TravelSceneryLVInfo, updSceneryLVInfo) SyncTravelInfo(curPlayer, result=Result_SceneryUp) return GameWorld.DebugLog("¾°¹ÛÉý¼¶´ÎÊýÒÑ´ïÉÏÏÞ£¬Ö±½Ó·¢·Å½±Àø!") awardItemList = [] awardItemRandCntList = awardIpyData.GetAwardItemRandCntList() for itemID, itemCntA, itemCntB in awardItemRandCntList: awardItemList.append([itemID, random.randint(itemCntA, itemCntB)]) GameWorld.DebugLog("Ëæ»úÎïÆ·¸öÊý½±Àø: %s" % awardItemList) awardItemExWeightList = awardIpyData.GetAwardItemExWeightList() awardItemExCnt = awardIpyData.GetAwardItemExCnt() for _ in range(awardItemExCnt): randItemInfo = GameWorld.GetResultByWeightList(awardItemExWeightList) if not randItemInfo or len(randItemInfo) != 2: continue itemID, itemCount = randItemInfo awardItemList.append([itemID, itemCount]) GameWorld.DebugLog("¸½¼Ó¶îÍâÎïÆ·½±Àø: %s" % awardItemList) PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TravelState, 1) # ±ê¼ÇÒÑÁìÈ¡¾°¹Û½±Àø ItemControler.GivePlayerItemOrMail(curPlayer, awardItemList, event=["TravelScenery", False, {}]) # ¾°¹ÛÌæ»»Îª´«ËÍÃÅ syncGridList = [] rowSet, colSet = SceneryTypeSet[sceneryType] for row in range(sRow, sRow + rowSet): for col in range(sCol, sCol + colSet): if row == sRow and col == sCol: GameWorld.DebugLog("ÉèÖÃΪ´«ËÍÃÅ: row=%s,col=%s" % (row, col)) SetGridEventID(curPlayer, row, col, EventID_Portal) syncGridList.append([row, col]) else: GameWorld.DebugLog("ÉèÖÃΪ¿Õ°×: row=%s,col=%s" % (row, col)) SetGridEventID(curPlayer, row, col, EventID_Blank) syncGridList.append([row, col]) SyncTravelInfo(curPlayer, syncGridList, result=Result_SceneryUp) return def SyncTravelInfo(curPlayer, syncGridList=[], result=Result_None, isAll=False): if isAll: syncGridList = [] rowMax, colMax = IpyGameDataPY.GetFuncEvalCfg("TravelSet", 3) for row in range(1, 1 + rowMax): for col in range(1, 1 + colMax): syncGridList.append([row, col]) gridList = [] for row, col in syncGridList: grid = ObjPool.GetPoolMgr().acquire(ChPyNetSendPack.tagSCTravelGrid) grid.Row = row grid.Col = col grid.State = GetGridState(curPlayer, row, col) grid.Multi = GetGridMulti(curPlayer, row, col) grid.EventID = GetGridEventID(curPlayer, row, col) gridList.append(grid) sceneryType, sRow, sCol = __getSceneryInfo(curPlayer) clientPack = ObjPool.GetPoolMgr().acquire(ChPyNetSendPack.tagSCTravelInfo) clientPack.Energy = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TravelEnergy) clientPack.EnergyTime = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TravelEnergyTime) clientPack.TravelCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TravelCnt) clientPack.SceneryType = sceneryType clientPack.SceneryRow = sRow clientPack.SceneryCol = sCol clientPack.SceneryLVInfo = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TravelSceneryLVInfo) clientPack.Result = result clientPack.GridList = gridList clientPack.GridCnt = len(clientPack.GridList) NetPackCommon.SendFakePack(curPlayer, clientPack) return