| | |
| | |
|
| | | # 跨服登录处理
|
| | | else:
|
| | | # 比如验证房间ID是否合法
|
| | | pass
|
| | | |
| | | mapID = curPlayer.GetMapID()
|
| | | mapIDList = IpyGameDataPY.GetFuncCfg("CrossRealmPKMatch", 4)
|
| | | if mapID not in mapIDList:
|
| | | return
|
| | | |
| | | GameWorld.Log("玩家登录跨服PK地图, mapID=%s" % mapID, curPlayer.GetPlayerID())
|
| | | if not __CheckCanLoginCrossServerPKMap(curPlayer):
|
| | | CrossRealmPlayer.PlayerExitCrossServer(curPlayer)
|
| | | return
|
| | | |
| | | return
|
| | |
|
| | | def __CheckCanLoginCrossServerPKMap(curPlayer):
|
| | | # 检查玩家可否登录跨服PK房间
|
| | | |
| | | playerID = curPlayer.GetPlayerID()
|
| | | vsRoomID = curPlayer.GetVsRoomId()
|
| | | if not vsRoomID:
|
| | | GameWorld.ErrLog("玩家没有对战房间ID,不可进入对战地图! 强制踢出跨服服务器!", playerID)
|
| | | return False
|
| | | |
| | | if vsRoomID not in PyGameData.g_crossPKRoomDict:
|
| | | GameWorld.ErrLog("玩家对战房间ID已经不存在,不可进入对战地图! 强制踢出跨服服务器!vsRoomID=%s" % vsRoomID, playerID)
|
| | | return False
|
| | | |
| | | vsRoom = PyGameData.g_crossPKRoomDict[vsRoomID]
|
| | | if playerID not in vsRoom.roomPlayerIDList:
|
| | | GameWorld.ErrLog("玩家对战房间ID不存在该玩家ID,不可进入对战地图! 强制踢出跨服服务器!vsRoomID=%s,roomPlayerIDList=%s" |
| | | % (vsRoomID, vsRoom.roomPlayerIDList), playerID)
|
| | | return False
|
| | | |
| | | return True
|
| | |
|
| | | ## 玩家离线处理
|
| | | def OnLeaveServer(curPlayer):
|
| | |
| | | ondayScore = playerInfoDict["ondayScore"] # 过天时的积分
|
| | |
|
| | | zoneMatchPlayerList = PyGameData.g_crossPKZoneMatchPlayerDict.get(pkZoneID, [])
|
| | | # if playerID in zoneMatchPlayerList:
|
| | | # GameWorld.Log("玩家正在匹配中,无法重复发起匹配!playerID=%s,accID=%s" % (playerID, accID))
|
| | | # CrossRealmMsg.SendMsgToClientServer(ShareDefine.CrossServerMsg_PKMatchReqRet, [playerID, 1], [serverGroupID])
|
| | | # return
|
| | | # if playerID in PyGameData.g_crossPKPlayerDict:
|
| | | # GameWorld.Log("玩家正在战斗中,无法重复发起匹配!playerID=%s,accID=%s" % (playerID, accID))
|
| | | # CrossRealmMsg.SendMsgToClientServer(ShareDefine.CrossServerMsg_PKMatchReqRet, [playerID, -2], [serverGroupID])
|
| | | # return
|
| | | if playerID in zoneMatchPlayerList:
|
| | | GameWorld.Log("玩家正在匹配中,无法重复发起匹配!playerID=%s,accID=%s" % (playerID, accID))
|
| | | CrossRealmMsg.SendMsgToClientServer(ShareDefine.CrossServerMsg_PKMatchReqRet, [playerID, 1], [serverGroupID])
|
| | | return
|
| | | if playerID in PyGameData.g_crossPKPlayerDict:
|
| | | GameWorld.Log("玩家正在战斗中,无法重复发起匹配!playerID=%s,accID=%s" % (playerID, accID))
|
| | | CrossRealmMsg.SendMsgToClientServer(ShareDefine.CrossServerMsg_PKMatchReqRet, [playerID, -2], [serverGroupID])
|
| | | return
|
| | |
|
| | | pkPlayer = CrossPKPlayer()
|
| | | pkPlayer.accID = accID
|
| | |
| | | PyGameData.g_crossPKUnNotifyOverInfo[playerID] = sendMapOverInfo
|
| | | continue
|
| | |
|
| | | PlayerControl.SetVsRoomId(player, 0)
|
| | | sysMsg = str(sendMapOverInfo)
|
| | | player.MapServer_QueryPlayerResult(0, 0, "CrossPKOverInfo", sysMsg, len(sysMsg))
|
| | | GameWorld.Log("通知地图跨服PK结算: roomID=%s,zoneID=%s,seasonID=%s,timeStr=%s,overType=%s,winnerID=%s,roundWinnerIDList=%s, pkScore=%s,danLV=%s,cWinCount=%s,addScore=%s,tagPlayerID=%s,notifyState=%s,mapID=%s"
|
| | |
| | | return
|
| | | overInfo = PyGameData.g_crossPKUnNotifyOverInfo.pop(playerID)
|
| | | PlayerControl.SetCrossRealmState(curPlayer, 0)
|
| | | PlayerControl.SetVsRoomId(curPlayer, 0)
|
| | | sysMsg = str(overInfo)
|
| | | curPlayer.MapServer_QueryPlayerResult(0, 0, "CrossPKOverInfo", sysMsg, len(sysMsg))
|
| | | GameWorld.Log("玩家上线通知地图未结算的跨服PK结算: mapID=%s,overInfo=%s" % (curPlayer.GetMapID(), overInfo), playerID)
|