| | |
| | | import GameWorld
|
| | | import ChConfig
|
| | |
|
| | | ## 是否匹配中
|
| | | def SetIsCrossPKMatching(curPlayer, isMatching):
|
| | | curPlayer.SetDict(ChConfig.Def_PlayerKey_IsCrossPKMatching, isMatching)
|
| | | return
|
| | | def GetIsCrossPKMatching(curPlayer): return curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_IsCrossPKMatching)
|
| | |
|
| | | def DoPlayerOnDay(curPlayer):
|
| | | if GameWorld.IsCrossServer():
|
| | | return
|
| | |
| | | requestType = clientData.Type
|
| | |
|
| | | if GameWorld.IsCrossServer():
|
| | | GameWorld.DebugLog("跨服服务器无法发起匹配!")
|
| | | GameWorld.DebugLog("跨服服务器无法发起匹配!", playerID)
|
| | | return
|
| | | |
| | | if GameWorld.GetMap().GetMapFBType() != IPY_GameWorld.fbtNull:
|
| | | GameWorld.DebugLog("副本中,无法进行跨服匹配!", playerID)
|
| | | return
|
| | | |
| | | if curPlayer.GetPlayerAction() == IPY_GameWorld.paDie or curPlayer.GetHP() == 0:
|
| | | #GameWorld.DebugLog("已死亡,无法进行跨服匹配!", playerID)
|
| | | return
|
| | |
|
| | | if GameWorld.GetGameWorld().GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_CrossPKSeasonState) != 1:
|
| | | GameWorld.DebugLog("OnCrossRealmPKMatch 跨服赛季未开启,不可进行匹配!", playerID)
|
| | | PlayerControl.NotifyCode(curPlayer, "SeasonIsNotOpen")
|
| | | #PlayerControl.NotifyCode(curPlayer, "SeasonIsNotOpen")
|
| | | return
|
| | |
|
| | | if not IsCrossRealmPKMatchState():
|
| | | GameWorld.DebugLog("OnCrossRealmPKMatch 跨服匹配未开启,不可进行匹配!", playerID)
|
| | | PlayerControl.NotifyCode(curPlayer, "MatchIsNotOpen")
|
| | | #PlayerControl.NotifyCode(curPlayer, "MatchIsNotOpen")
|
| | | return
|
| | |
|
| | | GameWorld.Log("收到跨服PK匹配: type=%s,accID=%s" % (requestType, accID), playerID)
|
| | |
| | |
|
| | | # 取消匹配
|
| | | else:
|
| | | sendMsg = "Client Cancel!"
|
| | | sendMsg = "ClientCancel"
|
| | | GameWorld.GetPlayerManager().GameServer_QueryPlayerResult(playerID, 0, 0, "CrossRealmPKCancel", sendMsg, len(sendMsg))
|
| | | GameWorld.Log(" 发送取消匹配到GameServer sendMsg=%s" % str(sendMsg), playerID)
|
| | |
|