6459 【后端】【2.0】缥缈仙域开发单(优化跨服掉线重上后目标线路已关闭时跨服标记重置逻辑)
| | |
| | |
|
| | | sendMapOverInfo = [roomID, zoneID, seasonID, timeStr, overType, winnerID, roundWinnerIDList, pkScore, danLV, cWinCount, addScore, tagPlayerID, tagPlayerName, notifyState]
|
| | | player = GameWorld.GetPlayerManager().FindPlayerByID(playerID)
|
| | | if not player:
|
| | | CrossRealmPlayer.DoOfflinePlayerExitCrossServer(playerID)
|
| | | if not player or PlayerControl.GetIsTJG(player):
|
| | | GameWorld.DebugLog(" 玩家不在线 或脱机中,先缓存,玩家上线后再同步,playerID=%s" % (playerID))
|
| | | overInfoData = PyGameDataStruct.tagDBCrossPKUnNotifyOverInfo()
|
| | |
| | | elif packType == IPY_GameServer.CDBPlayerRefresh_VIPLv:
|
| | | curPlayer.SetVIPLv(packValue);
|
| | | # __RefreshTeamState(curPlayer)
|
| | | |
| | | elif packType == IPY_GameServer.CDBPlayerRefresh_ExAttr5:
|
| | | PlayerControl.SetCrossMapID(curPlayer, packValue, False)
|
| | | |
| | | elif packType == IPY_GameServer.CDBPlayerRefresh_ExAttr9:
|
| | | PlayerControl.SetVIPExpireTime(curPlayer, packValue)
|
| | |
|
| | |
| | | import NetPackCommon
|
| | | import IpyGameDataPY
|
| | | import PyGameData
|
| | | import PlayerDBOper
|
| | |
|
| | | # 获取玩家跨服服务器上的名字
|
| | | #===============================================================================
|
| | | # def GetCrossPlayerName(curPlayer):
|
| | |
| | | curPlayer = GameWorld.GetPlayerManager().FindPlayerByID(playerID)
|
| | | if not curPlayer:
|
| | | GameWorld.Log(" 退出跨服时本服玩家不在线!", playerID)
|
| | | DoOfflinePlayerExitCrossServer(playerID)
|
| | | return
|
| | | PlayerControl.SetCrossMapID(curPlayer, 0)
|
| | | return
|
| | |
|
| | | def DoOfflinePlayerExitCrossServer(playerID):
|
| | | ## 处理离线玩家退出跨服服务器更新DB数据逻辑
|
| | | |
| | | PlayerDBOper.UpdateDBOper(PlayerDBOper.Table_DBPlayer, {"PlayerID":playerID}, {"ExAttr5":0})
|
| | | return
|
| | |
|
| | | def SendCrossRealmReg(curPlayer, registerMap, mapID=0, dataMapID=0, copyMapID=0, posX=0, posY=0, lineID=0):
|
| | | # 发送跨服账号注册上传数据
|
| | |
|
| | |
| | |
|
| | | ## 跨服状态所在地图ID: 0-非跨服状态,非0-跨服状态对应的地图ID
|
| | | def GetCrossMapID(curPlayer): return curPlayer.GetExAttr5()
|
| | | def SetCrossMapID(curPlayer, value):
|
| | | def SetCrossMapID(curPlayer, value, isNotifyMapServer=True):
|
| | | curPlayer.SetExAttr5(value)
|
| | | if isNotifyMapServer:
|
| | | SetMapServerPlayerAttrValue(curPlayer, "SetExAttr5", value)
|
| | | return
|
| | |
|
| | |
| | | import IPY_PlayerDefine
|
| | | import CrossRealmPlayer
|
| | | import CrossRealmMsg
|
| | | import ChPyNetSendPack
|
| | | import NetPackCommon
|
| | | import ShareDefine
|
| | | import CrossBoss
|
| | |
|
| | | import random
|
| | | #---------------------------------------------------------------------
|
| | |
|
| | | ## 跨服地图动态分配的功能线路,如果有人数上限的,则同分区同地图玩法的可能同时存在多个相同功能线路的数据
|
| | |
| | | self.openState = IPY_PlayerDefine.fbosClosed
|
| | | self.fbPlayerDict = {} # 副本中的玩家信息 {playerID:serverGroupID, ...}
|
| | | self.waitPlayerDict = {} # 等待进入的玩家信息 {playerID:[serverGroupID, tick], ...}
|
| | | self.offlinePlayerDict = {} # 掉线的玩家信息,非主动退出的 {playerID:serverGroupID, ...}
|
| | | return
|
| | |
|
| | | def OnRequestEnterCrossCopyMap(self, playerID, serverGroupID, tick, copyMapPlayerMax):
|
| | |
| | | funcLineID = copyMapObj.funcLineID
|
| | | playerCountInfo = [playerCount]
|
| | | SyncClientServerCrossFBFuncLinePlayerCount(zoneID, mapID, funcLineID, playerCountInfo)
|
| | | |
| | | #如果虚拟分线关闭时,有掉线的玩家,则通知子服重置这些玩家的跨服状态
|
| | | for playerID, serverGroupID in copyMapObj.offlinePlayerDict.items():
|
| | | CrossRealmMsg.SendMsgToClientServer(ShareDefine.CrossServerMsg_ExitCrossServer, playerID, [serverGroupID])
|
| | | |
| | | return
|
| | |
|
| | | def OnCrossDynamicMapReset(msgList):
|
| | |
| | | playerID = curPlayer.GetPlayerID()
|
| | | serverGroupID = PlayerControl.GetPlayerServerGroupID(curPlayer)
|
| | | copyMapObj.waitPlayerDict.pop(playerID, None)
|
| | | copyMapObj.offlinePlayerDict.pop(playerID, None)
|
| | | copyMapObj.fbPlayerDict[playerID] = serverGroupID
|
| | |
|
| | | #GameWorld.DebugLog("玩家登录动态分配的跨服地图: GetMapID=%s,GetRealMapID=%s,GetFBID()=%s,serverGroupID=%s"
|
| | | # % (curPlayer.GetMapID(), mapID, copyMapID, serverGroupID), playerID)
|
| | | #GameWorld.DebugLog(" 副本中的玩家ID: %s" % copyMapObj.fbPlayerDict)
|
| | | #GameWorld.DebugLog(" 等待中的玩家ID: %s" % copyMapObj.waitPlayerDict)
|
| | | #GameWorld.DebugLog(" 离线中的玩家ID: %s" % copyMapObj.offlinePlayerDict)
|
| | |
|
| | | playerCount = len(copyMapObj.fbPlayerDict) # 等待进入的暂时不算
|
| | | zoneID = copyMapObj.zoneID
|
| | |
| | | copyMapObj.waitPlayerDict.pop(playerID, None)
|
| | | copyMapObj.fbPlayerDict.pop(playerID, None)
|
| | |
|
| | | #GameWorld.DebugLog("玩家退出动态分配的跨服地图: GetMapID=%s,GetRealMapID=%s,GetFBID()=%s" |
| | | # % (curPlayer.GetMapID(), mapID, copyMapID), playerID)
|
| | | crossMapID = PlayerControl.GetCrossMapID(curPlayer)
|
| | | # 不是主动退出的
|
| | | if crossMapID:
|
| | | copyMapObj.offlinePlayerDict[playerID] = PlayerControl.GetPlayerServerGroupID(curPlayer)
|
| | | |
| | | #GameWorld.DebugLog("玩家退出动态分配的跨服地图: GetMapID=%s,GetRealMapID=%s,GetFBID()=%s,crossMapID=%s" |
| | | # % (curPlayer.GetMapID(), mapID, copyMapID, crossMapID), playerID)
|
| | | #GameWorld.DebugLog(" 副本中的玩家ID: %s" % copyMapObj.fbPlayerDict)
|
| | | #GameWorld.DebugLog(" 等待中的玩家ID: %s" % copyMapObj.waitPlayerDict)
|
| | | #GameWorld.DebugLog(" 离线中的玩家ID: %s" % copyMapObj.offlinePlayerDict)
|
| | | return
|
| | |
|
| | | def CrossServerMsg_FBPlayerCount(msgData):
|
| | |
| | | attrName, value = setInfo[:2]
|
| | | if hasattr(curPlayer, attrName):
|
| | | # 要在更新值之前处理
|
| | | if attrName == "SetExAttr5":
|
| | | if attrName == "SetExAttr5" and not GameWorld.IsCrossServer():
|
| | | if value:
|
| | | CrossRealmPlayer.DoEnterCrossRealm(curPlayer)
|
| | | elif PlayerControl.GetCrossMapID(curPlayer):
|