| | |
| | | RecAtkType_Atk = 1 # 发起攻击
|
| | | RecAtkType_Def = 2 # 被攻击的
|
| | |
|
| | | def GetRecServerID(recData): return recData.GetValue1() # 目标ServerID
|
| | | def SetRecServerID(recData, serverID): return recData.SetValue1(serverID)
|
| | | def GetRecAtkType(recData): return recData.GetValue2() # 攻击类型 1-发起攻击的,2-被攻击的
|
| | | def SetRecAtkType(recData, atkType): return recData.SetValue2(atkType)
|
| | | def GetRecTagPlayerID(recData): return recData.GetValue3() # 相对攻击类型的目标玩家ID
|
| | |
| | |
|
| | | def DoQunyingOpen(curPlayer):
|
| | | storeMax = IpyGameDataPY.GetFuncCfg("QunyingChallenge", 1)
|
| | | PlayerControl.GiveMoney(curPlayer, ShareDefine.TYPE_Price_QunyingTicket, storeMax, "QunyingOpen")
|
| | | curMoney = PlayerControl.GetMoney(curPlayer, ShareDefine.TYPE_Price_QunyingTicket)
|
| | | if curMoney >= storeMax:
|
| | | return
|
| | | giveMoney = storeMax - curMoney
|
| | | PlayerControl.GiveMoney(curPlayer, ShareDefine.TYPE_Price_QunyingTicket, giveMoney, "QunyingOpen")
|
| | | Sync_QunyingInfo(curPlayer) # 开启功能
|
| | | return
|
| | |
|
| | |
| | | if not tagID or playerID == tagID:
|
| | | return
|
| | |
|
| | | matchRankList = PyGameData.g_qunyingPlayerMatchDict.get(playerID, [])
|
| | | _, matchRankList = PyGameData.g_qunyingPlayerMatchDict.get(playerID, [0, []])
|
| | | if tagRank not in matchRankList:
|
| | | GameWorld.DebugLog("群英榜不可攻击不在匹配列表里的目标名次! tagID=%s not in matchRankList=%s" % (tagID, matchRankList), playerID)
|
| | | return
|
| | |
| | | SetRecAtkType(recData, RecAtkType_Atk)
|
| | | SetRecTagPlayerID(recData, tagPlayerID)
|
| | | SetRecIsWin(recData, isWin)
|
| | | SetRecServerID(recData, tagViewCache.GetServerID() if tagViewCache else 0)
|
| | | SetRecFace(recData, tagViewCache.GetFace() if tagViewCache else 0)
|
| | | SetRecFacePic(recData, tagViewCache.GetFacePic() if tagViewCache else 0)
|
| | | SetRecRealmLV(recData, tagViewCache.GetRealmLV() if tagViewCache else 1)
|
| | |
| | | SetRecAtkType(recData, RecAtkType_Def)
|
| | | SetRecTagPlayerID(recData, playerID)
|
| | | SetRecIsWin(recData, not isWin)
|
| | | SetRecServerID(recData, GameWorld.GetPlayerServerID(curPlayer))
|
| | | SetRecFace(recData, curPlayer.GetFace())
|
| | | SetRecFacePic(recData, curPlayer.GetFacePic())
|
| | | SetRecRealmLV(recData, curPlayer.GetOfficialRank())
|
| | |
| | |
|
| | | # 匹配对象缓存
|
| | | if playerID not in PyGameData.g_qunyingPlayerMatchDict:
|
| | | PyGameData.g_qunyingPlayerMatchDict[playerID] = []
|
| | | matchRankList = PyGameData.g_qunyingPlayerMatchDict[playerID]
|
| | | if not isRefresh and matchRankList:
|
| | | PyGameData.g_qunyingPlayerMatchDict[playerID] = [0, []]
|
| | | matchRank, matchRankList = PyGameData.g_qunyingPlayerMatchDict[playerID]
|
| | | # 确保上榜时自己一定在匹配列表里
|
| | | # 当前名次与匹配时的名次不同时强制重刷
|
| | | if not isRefresh and matchRankList and playerRank == matchRank and playerRank in matchRankList:
|
| | | # 非刷新的并且已经有记录的直接同步
|
| | | GameWorld.DebugLog(" 非刷新且有数据,直接同步! matchRankList=%s" % matchRankList, playerID)
|
| | | GameWorld.DebugLog(" 非刷新且有数据,直接同步! playerRank=%s,matchRankList=%s" % (playerRank, matchRankList), playerID)
|
| | | __SyncQunyingMatchList(curPlayer, matchRankList, layerIDList)
|
| | | return
|
| | |
|
| | |
| | |
|
| | | matchRankList.sort()
|
| | | GameWorld.DebugLog(" 匹配名次结果: matchRankList=%s" % (matchRankList), playerID)
|
| | | PyGameData.g_qunyingPlayerMatchDict[playerID] = matchRankList
|
| | | PyGameData.g_qunyingPlayerMatchDict[playerID] = [playerRank, matchRankList]
|
| | | __SyncQunyingMatchList(curPlayer, matchRankList, layerIDList)
|
| | | return
|
| | |
|