| | |
| | | return zoneIpyData.GetZoneID()
|
| | | return 0
|
| | |
|
| | | def OnPlayerLogin(curPlayer):
|
| | | |
| | | # 本服登录处理
|
| | | if not GameWorld.IsCrossServer():
|
| | | # 本服没有分配赛区不处理
|
| | | if not GameWorld.GetGameWorld().GetDictByKey(ShareDefine.Def_Notify_WorldKey_CrossPKZoneID):
|
| | | return
|
| | | __OnLoginNotifyPKOverInfo(curPlayer)
|
| | | |
| | | # 同步所有赛区赛季信息
|
| | | zoneSeasonInfo = ChPyNetSendPack.tagGCCrossRealmPKSeasonInfo()
|
| | | zoneSeasonInfo.ZoneList = []
|
| | | ipyDataMgr = IpyGameDataPY.IPY_Data()
|
| | | for index in xrange(ipyDataMgr.GetCrossRealmPKZoneCount()):
|
| | | zoneIpyData = ipyDataMgr.GetCrossRealmPKZoneByIndex(index)
|
| | | zoneID = zoneIpyData.GetZoneID()
|
| | | zoneInfo = ChPyNetSendPack.tagGCCrossRealmPKZone()
|
| | | zoneInfo.ZoneID = zoneID
|
| | | zoneInfo.ZoneName = zoneIpyData.GetZoneName().decode(ShareDefine.Def_Game_Character_Encoding).encode(GameWorld.GetCharacterEncoding())
|
| | | zoneInfo.ZoneNameLen = len(zoneInfo.ZoneName)
|
| | | zoneInfo.SeasonList = []
|
| | | seasonList = IpyGameDataPY.GetIpyGameDataList("CrossRealmPKSeason", zoneID)
|
| | | seasonList = [] if not seasonList else seasonList
|
| | | for seasonIpyData in seasonList:
|
| | | seasonInfo = ChPyNetSendPack.tagGCCrossRealmPKSeason()
|
| | | seasonInfo.SeasonID = seasonIpyData.GetSeasonID()
|
| | | seasonInfo.StartDate = seasonIpyData.GetStartDate()
|
| | | seasonInfo.EndDate = seasonIpyData.GetEndDate()
|
| | | seasonInfo.EndTime = seasonIpyData.GetEndTime()
|
| | | zoneInfo.SeasonList.append(seasonInfo)
|
| | | zoneInfo.SeasonCount = len(zoneInfo.SeasonList)
|
| | | zoneSeasonInfo.ZoneList.append(zoneInfo)
|
| | | zoneSeasonInfo.ZoneCount = len(zoneSeasonInfo.ZoneList)
|
| | | NetPackCommon.SendFakePack(curPlayer, zoneSeasonInfo)
|
| | | |
| | | # 同步本服赛季状态
|
| | | gameWorld = GameWorld.GetGameWorld()
|
| | | seasonStatePack = ChPyNetSendPack.tagGCCrossRealmPKSeasonState()
|
| | | seasonStatePack.ZoneID = gameWorld.GetDictByKey(ShareDefine.Def_Notify_WorldKey_CrossPKZoneID)
|
| | | seasonStatePack.SeasonID = gameWorld.GetDictByKey(ShareDefine.Def_Notify_WorldKey_CrossPKSeasonID)
|
| | | seasonStatePack.SeasonState = gameWorld.GetDictByKey(ShareDefine.Def_Notify_WorldKey_CrossPKSeasonState)
|
| | | seasonStatePack.MatchState = gameWorld.GetDictByKey(ShareDefine.Def_Notify_WorldKey_CrossDailyActionState % ShareDefine.DailyActionID_CrossReamPK)
|
| | | NetPackCommon.SendFakePack(curPlayer, seasonStatePack)
|
| | | |
| | | def OnPlayerLoginCrossServer(curPlayer):
|
| | | # 跨服登录处理
|
| | | else:
|
| | | 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
|
| | | |
| | | 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 OnPlayerLogin(curPlayer):
|
| | | # 本服登录处理
|
| | | |
| | | # 本服没有分配赛区不处理
|
| | | if not GameWorld.GetGameWorld().GetDictByKey(ShareDefine.Def_Notify_WorldKey_CrossPKZoneID):
|
| | | return
|
| | | __OnLoginNotifyPKOverInfo(curPlayer)
|
| | | |
| | | # 同步所有赛区赛季信息
|
| | | zoneSeasonInfo = ChPyNetSendPack.tagGCCrossRealmPKSeasonInfo()
|
| | | zoneSeasonInfo.ZoneList = []
|
| | | ipyDataMgr = IpyGameDataPY.IPY_Data()
|
| | | for index in xrange(ipyDataMgr.GetCrossRealmPKZoneCount()):
|
| | | zoneIpyData = ipyDataMgr.GetCrossRealmPKZoneByIndex(index)
|
| | | zoneID = zoneIpyData.GetZoneID()
|
| | | zoneInfo = ChPyNetSendPack.tagGCCrossRealmPKZone()
|
| | | zoneInfo.ZoneID = zoneID
|
| | | zoneInfo.ZoneName = zoneIpyData.GetZoneName().decode(ShareDefine.Def_Game_Character_Encoding).encode(GameWorld.GetCharacterEncoding())
|
| | | zoneInfo.ZoneNameLen = len(zoneInfo.ZoneName)
|
| | | zoneInfo.SeasonList = []
|
| | | seasonList = IpyGameDataPY.GetIpyGameDataList("CrossRealmPKSeason", zoneID)
|
| | | seasonList = [] if not seasonList else seasonList
|
| | | for seasonIpyData in seasonList:
|
| | | seasonInfo = ChPyNetSendPack.tagGCCrossRealmPKSeason()
|
| | | seasonInfo.SeasonID = seasonIpyData.GetSeasonID()
|
| | | seasonInfo.StartDate = seasonIpyData.GetStartDate()
|
| | | seasonInfo.EndDate = seasonIpyData.GetEndDate()
|
| | | seasonInfo.EndTime = seasonIpyData.GetEndTime()
|
| | | zoneInfo.SeasonList.append(seasonInfo)
|
| | | zoneInfo.SeasonCount = len(zoneInfo.SeasonList)
|
| | | zoneSeasonInfo.ZoneList.append(zoneInfo)
|
| | | zoneSeasonInfo.ZoneCount = len(zoneSeasonInfo.ZoneList)
|
| | | NetPackCommon.SendFakePack(curPlayer, zoneSeasonInfo)
|
| | | |
| | | # 同步本服赛季状态
|
| | | gameWorld = GameWorld.GetGameWorld()
|
| | | seasonStatePack = ChPyNetSendPack.tagGCCrossRealmPKSeasonState()
|
| | | seasonStatePack.ZoneID = gameWorld.GetDictByKey(ShareDefine.Def_Notify_WorldKey_CrossPKZoneID)
|
| | | seasonStatePack.SeasonID = gameWorld.GetDictByKey(ShareDefine.Def_Notify_WorldKey_CrossPKSeasonID)
|
| | | seasonStatePack.SeasonState = gameWorld.GetDictByKey(ShareDefine.Def_Notify_WorldKey_CrossPKSeasonState)
|
| | | seasonStatePack.MatchState = gameWorld.GetDictByKey(ShareDefine.Def_Notify_WorldKey_CrossDailyActionState % ShareDefine.DailyActionID_CrossReamPK)
|
| | | NetPackCommon.SendFakePack(curPlayer, seasonStatePack)
|
| | |
|
| | | return
|
| | |
|
| | |
| | | # return
|
| | |
|
| | | vsRoomID = curPlayer.GetVsRoomId()
|
| | | if vsRoomID and PlayerControl.GetCrossRealmState(curPlayer) == 1:
|
| | | if vsRoomID and PlayerControl.GetCrossMapID(curPlayer) == ChConfig.Def_FBMapID_CrossRealmPK:
|
| | | GameWorld.DebugLog("玩家跨服PK状态,不能取消匹配!vsRoomID=%s" % vsRoomID, curPlayer.GetPlayerID())
|
| | | return
|
| | |
|
| | |
| | | def CrossServerMsg_PKMatchResult(vsRoomDict):
|
| | | ## 跨服PK匹配结果
|
| | | curServerGroupID = GameWorld.GetServerGroupID()
|
| | | actionType = ShareDefine.Def_CrossAction_PK
|
| | | mapPosList = IpyGameDataPY.GetFuncEvalCfg("CrossRealmPKMatch", 5)
|
| | | GameWorld.DebugLog("=== 收到PK匹配结果处理 === curServerGroupID=%s" % curServerGroupID)
|
| | | if not mapPosList:
|
| | |
| | | PlayerControl.SetVsRoomId(player, roomID, True)
|
| | | # 通知地图玩家匹配成功, 上传数据, 准备进入跨服服务器
|
| | | posX, posY = mapPosList[i] if len(mapPosList) > i else mapPosList[0]
|
| | | CrossRealmPlayer.SendCrossRealmReg(player, actionType, mapID, mapID, 0, posX, posY)
|
| | | CrossRealmPlayer.SendCrossRealmReg(player, ChConfig.Def_FBMapID_CrossRealmPK, mapID, mapID, 0, posX, posY)
|
| | |
|
| | | return
|
| | |
|
| | |
| | | matchPlayer.MaxProDef = readyPlayerInfo["MaxProDef"]
|
| | | break
|
| | |
|
| | | PlayerControl.SetCrossRealmState(player, 1)
|
| | | PlayerControl.SetCrossMapID(player, ChConfig.Def_FBMapID_CrossRealmPK)
|
| | | SetIsCrossPKMatching(player, 0)
|
| | |
|
| | | # 通知匹配成功,可进入跨服
|
| | |
| | | GameWorld.DebugLog(" 房间ID不同, playerID=%s" % (playerID))
|
| | | continue
|
| | | player.SetDict(ChConfig.Def_PlayerKey_IsLoginToMergeServer, 0)
|
| | | PlayerControl.SetCrossRealmState(player, 0)
|
| | | PlayerControl.SetCrossMapID(player, 0)
|
| | |
|
| | | return
|
| | |
|
| | |
| | | overInfoData = PyDataManager.GetCrossPKUnNotifyOverInfoManager().GetPlayerUnNotifyOverInfo(playerID)
|
| | | if not overInfoData:
|
| | | return
|
| | | PlayerControl.SetCrossRealmState(curPlayer, 0)
|
| | | PlayerControl.SetCrossMapID(curPlayer, 0)
|
| | | PlayerControl.SetVsRoomId(curPlayer, 0)
|
| | |
|
| | | zoneID = overInfoData.ZoneID
|