| | |
| | | self.serverGroupID = 0 # 所属服务器ID,一个服务器ID由多个服组成
|
| | | self.pkZoneID = 0 # 所属赛区ID,一个赛区由多个服务器ID组成
|
| | | self.seasonID = 0 # 赛季ID
|
| | | self.notifyMatchRobotTick = 0 # 通知匹配到机器人的tick
|
| | | return
|
| | |
|
| | | def GetDRInfo(self):
|
| | |
| | | if danIpyData:
|
| | | matchRobotRate = danIpyData.GetMatchRobotRate() + danIpyData.GetMatchRobotRateEx() * cLoseCount
|
| | | if matchRobotRate and GameWorld.CanHappen(matchRobotRate, 100):
|
| | | pkPlayer.notifyMatchRobotTick = tick + random.randint(3, 5) * 1000
|
| | | PyGameData.g_crossPKZoneMatchRobotPlayerDict[playerID] = pkPlayer
|
| | | GameWorld.DebugLog("玩家加入匹配: seasonID=%s,pkZoneID=%s,serverGroupID=%s,accID=%s,playerID=%s,pkScore=%s,fightPower=%s,cWinCount=%s"
|
| | | % (seasonID, pkZoneID, serverGroupID, accID, playerID, pkScore, fightPower, cWinCount))
|
| | | GameWorld.DebugLog(" 本次匹配到机器人: danLV=%s,cLoseCount=%s,概率=%s" % (danLV, cLoseCount, matchRobotRate), playerID)
|
| | | CrossRealmMsg.SendMsgToClientServer(ShareDefine.CrossServerMsg_PKMatchReqRet, [playerID, 2], [serverGroupID])
|
| | | #这里优化下暂通知开始匹配,实际匹配到机器人做延迟通知
|
| | | CrossRealmMsg.SendMsgToClientServer(ShareDefine.CrossServerMsg_PKMatchReqRet, [playerID, 1], [serverGroupID])
|
| | | return
|
| | |
|
| | | PyGameData.g_crossPKPlayerDict[playerID] = pkPlayer
|
| | |
| | | % (seasonID, pkZoneID, serverGroupID, accID, playerID, pkScore, fightPower, cWinCount, cLoseCount, matchRobotRate, len(zoneMatchPlayerList)))
|
| | |
|
| | | CrossRealmMsg.SendMsgToClientServer(ShareDefine.CrossServerMsg_PKMatchReqRet, [playerID, 1], [serverGroupID])
|
| | | return
|
| | |
|
| | | def __DelayNotifyMatchRobot(tick):
|
| | | ## 做体验,延迟通知匹配到机器人
|
| | | for playerID, pkPlayer in PyGameData.g_crossPKZoneMatchRobotPlayerDict.items():
|
| | | if pkPlayer.notifyMatchRobotTick == -1:
|
| | | #GameWorld.DebugLog("已通知过玩家匹配到机器人", playerID)
|
| | | continue
|
| | | if tick < pkPlayer.notifyMatchRobotTick:
|
| | | continue
|
| | | pkPlayer.notifyMatchRobotTick = -1
|
| | | serverGroupID = pkPlayer.serverGroupID
|
| | | GameWorld.DebugLog("延迟通知玩家匹配到机器人: serverGroupID=%s" % (serverGroupID), playerID)
|
| | | CrossRealmMsg.SendMsgToClientServer(ShareDefine.CrossServerMsg_PKMatchReqRet, [playerID, 2], [serverGroupID])
|
| | | |
| | | return
|
| | |
|
| | | def ClientServerMsg_PKCancel(playerInfoDict, tick):
|
| | |
| | | return
|
| | | GameWorld.GetGameWorld().SetDict(processTickKey, tick)
|
| | |
|
| | | # 延迟通知匹配到机器人的
|
| | | __DelayNotifyMatchRobot(tick)
|
| | | # 处理超时的房间
|
| | | __DoCheckRoomTimeout(tick)
|
| | | # 通知已准备好的房间玩家可进入跨服
|