| | |
| | | if not offObj:
|
| | | continue
|
| | | offObj.challengeList.append(challengeDict)
|
| | | GameWorld.Log(" zoneID=%s,officialID=%s,挑战记录=%s" % (zoneID, officialID, challengeDict))
|
| | | #GameWorld.Log(" zoneID=%s,officialID=%s,挑战记录=%s" % (zoneID, officialID, challengeDict))
|
| | |
|
| | | return
|
| | |
|
| | |
| | | pkZoneMgr = champMgr.GetChampPKZoneMgr(zoneID)
|
| | | for guessType, playerGuessDict in pkZoneMgr.guessInfo.items():
|
| | | for guessPlayerID, guessObjList in playerGuessDict.items():
|
| | | GameWorld.Log(" zoneID=%s,guessType=%s,guessPlayerID=%s,guessCount=%s" % (zoneID, guessType, guessPlayerID, len(guessObjList)))
|
| | | #GameWorld.Log(" zoneID=%s,guessType=%s,guessPlayerID=%s,guessCount=%s" % (zoneID, guessType, guessPlayerID, len(guessObjList)))
|
| | | for guessObj in guessObjList:
|
| | | recData = guessRecDataList.AddRec()
|
| | | recData.SetValue1(zoneID)
|
| | |
| | | challengeRecDataList = universalRecMgr.GetTypeList(Def_RecType_CrossChampionshipOffChallenge)
|
| | | for zoneID in offZoneIDList:
|
| | | offZoneMgr = champMgr.GetChampOfficialZoneMgr(zoneID)
|
| | | GameWorld.Log(" zoneID=%s,officialInfoKey=%s" % (zoneID, offZoneMgr.officialInfo.keys()))
|
| | | #GameWorld.Log(" zoneID=%s,officialInfoKey=%s" % (zoneID, offZoneMgr.officialInfo.keys()))
|
| | | for officialID in offZoneMgr.officialInfo.keys():
|
| | | offObj = offZoneMgr.GetOfficialObj(officialID)
|
| | | if not offObj:
|
| | |
| | | strValue3 = strValue3.replace(" ", "")
|
| | | recData.SetStrValue3(strValue3)
|
| | |
|
| | | GameWorld.Log(" zoneID=%s,officialID=%s,playerID=%s,rank=%s,challengeCount=%s" |
| | | % (zoneID, officialID, offObj.playerID, offObj.rank, len(offObj.challengeList)))
|
| | | #GameWorld.Log(" zoneID=%s,officialID=%s,playerID=%s,rank=%s,challengeCount=%s" |
| | | # % (zoneID, officialID, offObj.playerID, offObj.rank, len(offObj.challengeList)))
|
| | | for challengeDict in offObj.challengeList:
|
| | | challRecData = challengeRecDataList.AddRec()
|
| | | challRecData.SetValue1(value1)
|
| | |
| | | if playerID not in pkZoneMgr.syncGuessPlayerIDInfo:
|
| | | sendMsg = {"zoneID":playerZoneID, "playerID":playerID, "exDataType":"ChampionshipGuessQuery"}
|
| | | CrossRealmMsg.SendMsgToCrossServer(ShareDefine.ClientServerMsg_ChampionshipGuess, sendMsg)
|
| | | else:
|
| | | Sync_ChampionshipGuessPriInfo(curPlayer)
|
| | | Sync_ChampionshipGuessPubInfo(playerZoneID, curPlayer)
|
| | |
|
| | | return
|
| | |
|
| | |
| | | stateError = PlayerDBGSEvent.GetDBGSTrig_ByKey(PlayerDBGSEvent.Def_CrossChampionshipStateError)
|
| | |
|
| | | updState = 0
|
| | | crossChampionshipID = 0
|
| | | crossChampionshipID = dbCrossChampionshipID
|
| | |
|
| | | # 这里时间需精确到分钟,不然后面的比较会匹配不到
|
| | | curDateTime = GameWorld.GetServerTime()
|
| | |
| | |
|
| | | champMgr = GetChampionshipMgr()
|
| | |
|
| | | syncKeyList = []
|
| | | syncKeyInfo = {}
|
| | | for attrDict in guessList:
|
| | | zoneID = attrDict["zoneID"]
|
| | | guessType = attrDict["guessType"]
|
| | | guessPlayerID = attrDict["guessPlayerID"]
|
| | | tagPlayerID = attrDict["tagPlayerID"]
|
| | |
|
| | | syncKey = [guessType, tagPlayerID]
|
| | | if syncKey not in syncKeyList:
|
| | | syncKeyList.append(syncKey)
|
| | | |
| | | if guessType not in syncKeyInfo:
|
| | | syncKeyInfo[guessType] = []
|
| | | syncTagPlayerIDList = syncKeyInfo[guessType]
|
| | | syncTagPlayerIDList.append(tagPlayerID)
|
| | | |
| | | # 竞猜列表仅针对玩家个人,所以不是请求方玩家或本服玩家则不处理个人信息,仅处理公共信息
|
| | | if playerID != guessPlayerID:
|
| | | continue
|
| | |
| | | pkZoneMgr = champMgr.GetChampPKZoneMgr(zoneID)
|
| | | pkZoneMgr.syncGuessPlayerIDInfo[playerID] = tick
|
| | | curPlayer = GameWorld.GetPlayerManager().FindPlayerByID(playerID)
|
| | | if curPlayer == None or not curPlayer.GetInitOK():
|
| | | if curPlayer == None:
|
| | | return
|
| | | Sync_ChampionshipGuessPriInfo(curPlayer, syncKeyList)
|
| | | Sync_ChampionshipGuessPubInfo(zoneID, curPlayer, syncKeyList)
|
| | | Sync_ChampionshipGuessPriInfo(curPlayer, syncKeyInfo)
|
| | | Sync_ChampionshipGuessPubInfo(zoneID, curPlayer, syncKeyInfo)
|
| | | return
|
| | |
|
| | | if exDataType == "ChampionshipGuess":
|
| | | # 竞猜的如果有公共信息需要广播全服玩家,个人信息只同步该竞猜玩家
|
| | | zoneID = exData.get("zoneID", 0)
|
| | | if pubInfo != None:
|
| | | Sync_ChampionshipGuessPubInfo(zoneID, None, syncKeyList)
|
| | | Sync_ChampionshipGuessPubInfo(zoneID, None, syncKeyInfo)
|
| | | if not playerID:
|
| | | return
|
| | | if not PlayerControl.GetDBPlayerAccIDByID(playerID):
|
| | |
| | | msgInfo = [exDataType, exData]
|
| | | curPlayer = CrossRealmPlayer.MapServer_QueryCrossPlayerResult(playerID, "Championship", msgInfo, True)
|
| | | if curPlayer:
|
| | | Sync_ChampionshipGuessPriInfo(curPlayer, syncKeyList)
|
| | | Sync_ChampionshipGuessPriInfo(curPlayer, syncKeyInfo)
|
| | | return
|
| | |
|
| | | return
|
| | |
| | | if not tagBatPlayer:
|
| | | GameWorld.ErrLog("该分区不存在该参赛玩家,无法排位竞猜! zoneID=%s,tagPlayerID=%s" % (zoneID, tagPlayerID), playerID)
|
| | | return
|
| | | |
| | | |
| | | guessTagPlayerCountMax = guessType
|
| | | # 4强竞猜
|
| | | if guessType == 4:
|
| | | if not guessRank:
|
| | | if guessRank <= 0 or guessRank > guessTagPlayerCountMax:
|
| | | GameWorld.ErrLog("竞猜名次错误! zoneID=%s,guessType=%s,guessRank=%s" % (zoneID, guessType, guessRank), playerID)
|
| | | return
|
| | | top8PlayerIDList = pkZoneMgr.GetTop8PlayerIDList()
|
| | | if tagPlayerID not in top8PlayerIDList:
|
| | |
| | | playerGuessList = pkZoneMgr.GetPlayerGuessList(playerID, guessType)
|
| | | for guess in playerGuessList:
|
| | | if guess.tagPlayerID == tagPlayerID:
|
| | | if guessType == 4:
|
| | | if guess.guessRank != guessRank:
|
| | | GameWorld.ErrLog("已经存在该竞猜,但是不能修改竞猜名次,无法竞猜! zoneID=%s,guessType=%s,tagPlayerID=%s, guessRank(%s) != guess.guessRank(%s)" |
| | | % (zoneID, guessType, tagPlayerID, guessRank, guess.guessRank), playerID)
|
| | | return
|
| | | guessObj = guess
|
| | | GameWorld.Log("已经存在该竞猜,玩家进行加注! guessInfo=%s" % guess.GetString())
|
| | | GameWorld.Log("已经存在该竞猜,玩家进行加注! guessInfo=%s" % guess.GetString(), playerID)
|
| | | else:
|
| | | if guessType == 4:
|
| | | if guess.guessRank == guessRank:
|
| | |
| | |
|
| | | syncPub = False # 同步公共信息
|
| | | if not guessObj:
|
| | | if len(playerGuessList) >= guessTagPlayerCountMax:
|
| | | GameWorld.ErrLog("超出每个玩家最大竞猜人数,无法竞猜! zoneID=%s,guessType=%s,playerGuessListLen=%s >= guessTagPlayerCountMax=%s" |
| | | % (zoneID, guessType, len(playerGuessList), guessTagPlayerCountMax), playerID)
|
| | | return
|
| | | guessObj = ChampionshipGuess()
|
| | | guessObj.zoneID = zoneID
|
| | | guessObj.guessType = guessType
|
| | |
| | |
|
| | | return
|
| | |
|
| | | def Sync_ChampionshipGuessPriInfo(curPlayer, syncKeyList=None):
|
| | | def Sync_ChampionshipGuessPriInfo(curPlayer, syncKeyInfo=None):
|
| | | ## 同步排位分区竞猜个人信息
|
| | | # @param syncKeyList: 指定同步的 [[guessType, tagPlayerID], ...]
|
| | | # @param syncKeyInfo: 指定同步的 {guessType:[tagPlayerID, ...], ...}
|
| | |
|
| | | playerID = curPlayer.GetPlayerID()
|
| | | champMgr = GetChampionshipMgr()
|
| | |
| | | clientPack.GuessList = []
|
| | |
|
| | | for guessType, playerGuessDict in pkZoneMgr.guessInfo.items():
|
| | | if syncKeyInfo and guessType not in syncKeyInfo:
|
| | | continue
|
| | | syncTagPlayerIDList = [] if not syncKeyInfo else syncKeyInfo.get(guessType, [])
|
| | | |
| | | priListPack = ChPyNetSendPack.tagGCChampionshipGuessPriList()
|
| | | priListPack.GuessType = guessType
|
| | | priListPack.GuessPlayerList = []
|
| | | |
| | | playerGuessList = playerGuessDict.get(playerID, [])
|
| | | for guess in playerGuessList:
|
| | | tagPlayerID = guess.tagPlayerID
|
| | | syncKey = [guessType, tagPlayerID]
|
| | | if syncKeyList and syncKey not in syncKeyList:
|
| | | if syncTagPlayerIDList and tagPlayerID not in syncTagPlayerIDList:
|
| | | continue
|
| | | priPlayerPack = ChPyNetSendPack.tagGCChampionshipGuessPlayerPri()
|
| | | priPlayerPack.PlayerID = tagPlayerID
|
| | |
| | | NetPackCommon.SendFakePack(curPlayer, clientPack)
|
| | | return
|
| | |
|
| | | def Sync_ChampionshipGuessPubInfo(zoneID, curPlayer=None, syncKeyList=None):
|
| | | def Sync_ChampionshipGuessPubInfo(zoneID, curPlayer=None, syncKeyInfo=None):
|
| | | ## 同步排位分区竞猜公共信息
|
| | | # @param syncKeyList: 指定同步的 [[guessType, tagPlayerID], ...]
|
| | | # @param syncKeyInfo: 指定同步的 {guessType:[tagPlayerID, ...], ...}
|
| | |
|
| | | champMgr = GetChampionshipMgr()
|
| | | if curPlayer:
|
| | |
| | | clientPack = ChPyNetSendPack.tagGCChampionshipGuessPubInfo()
|
| | | clientPack.ZoneID = zoneID
|
| | | clientPack.GuessList = []
|
| | | clientPack.Count = len(clientPack.GuessList)
|
| | |
|
| | | for guessType, playerSupportCountDict in pkZoneMgr.supportCountInfo.items():
|
| | | if syncKeyInfo and guessType not in syncKeyInfo:
|
| | | continue
|
| | | syncTagPlayerIDList = [] if not syncKeyInfo else syncKeyInfo.get(guessType, [])
|
| | | |
| | | pubListPack = ChPyNetSendPack.tagGCChampionshipGuessPubList()
|
| | | pubListPack.GuessType = guessType
|
| | | pubListPack.GuessPlayerList = []
|
| | |
|
| | | for tagPlayerID, supportCount in playerSupportCountDict.items():
|
| | | syncKey = [guessType, tagPlayerID]
|
| | | if syncKeyList and syncKey not in syncKeyList:
|
| | | if syncTagPlayerIDList and tagPlayerID not in syncTagPlayerIDList:
|
| | | continue
|
| | | pubPlayerPack = ChPyNetSendPack.tagGCChampionshipGuessPlayerPub()
|
| | | pubPlayerPack.PlayerID = tagPlayerID
|
| | |
| | | pubListPack.PlayerCount = len(pubListPack.GuessPlayerList)
|
| | |
|
| | | clientPack.GuessList.append(pubListPack)
|
| | | |
| | | |
| | | clientPack.Count = len(clientPack.GuessList)
|
| | | |
| | | if curPlayer != None:
|
| | | NetPackCommon.SendFakePack(curPlayer, clientPack)
|
| | | else:
|