| | |
| | | import GameWorldFamilyWar
|
| | | import PlayerFBHelpBattle
|
| | | import GameWorldSkyTower
|
| | | import GMT_CTG
|
| | | import PyGameData
|
| | | import GMShell
|
| | | import IPY_PlayerDefine
|
| | |
| | | import PlayerFuncTeam
|
| | | import PyDataManager
|
| | | import GameWorldMineArea
|
| | | import PlayerPackData
|
| | | import PlayerRecData
|
| | | import GameWorship
|
| | | import GameXiangong
|
| | | import CrossFamilyGCZ
|
| | | #---------------------------------------------------------------------
|
| | |
|
| | | #---------------------------------------------------------------------
|
| | |
| | | return
|
| | |
|
| | | def IsOnline(self, playerID): return playerID in self.onlinePlayerDict
|
| | | |
| | | def GetOLPlayerServerGroupID(self, playerID): return self.onlinePlayerDict.get(playerID, 0)
|
| | |
|
| | | def __SetOnline(self, playerID, serverGroupID):
|
| | | self.onlinePlayerDict[playerID] = serverGroupID
|
| | |
| | | ''' 玩家登录需要处理的内容,本服及跨服服务器分开
|
| | | '''
|
| | | if GameWorld.IsCrossServer():
|
| | | #跨服PK
|
| | | CrossRealmPK.OnPlayerLoginCrossServer(curPlayer)
|
| | | #协助
|
| | | PlayerAssist.OnPlayerLoginCrossServer(curPlayer)
|
| | | return
|
| | |
| | | GameWorldSkyTower.OnPlayerLogin(curPlayer)
|
| | | #福地
|
| | | GameWorldMineArea.OnPlayerLogin(curPlayer)
|
| | | GMT_CTG.OnPlayerLogin(curPlayer)
|
| | |
|
| | | else:
|
| | | pass
|
| | |
| | | CrossBattlefield.OnPlayerLogin(curPlayer)
|
| | | #跨服排位
|
| | | CrossChampionship.OnPlayerLogin(curPlayer, tick)
|
| | | #仙盟攻城战
|
| | | CrossFamilyGCZ.OnPlayerLogin(curPlayer)
|
| | | #跨服全民充值
|
| | | CrossActAllRecharge.OnPlayerLogin(curPlayer)
|
| | | #跨服妖魔boss
|
| | | CrossYaomoBoss.OnPlayerLogin(curPlayer)
|
| | | #玩家记录
|
| | | PlayerRecData.OnPlayerLogin(curPlayer)
|
| | | |
| | | PlayerPackData.OnPlayerLogin(curPlayer)
|
| | | #在线状态变更,放最后
|
| | | __OnPlayerOnlineStateChange(curPlayer, True)
|
| | |
|
| | |
| | | PlayerFB.OnPlayerDisconnectCrossServer(curPlayer)
|
| | | return
|
| | |
|
| | | #跨服匹配PK
|
| | | CrossRealmPK.OnLeaveServer(curPlayer)
|
| | | |
| | | #组队玩家离线
|
| | | PlayerTeam.DoPlayerLogOffTeamLogic(curPlayer, tick)
|
| | | #家族玩家离线
|
| | |
| | | #offlineValue = olMgr.GetOfflineValue(playerID, PlayerViewCache.FindViewCache(playerID))
|
| | | #SyncRelatedPlayerOnlineState(playerID, offlineValue, relatedPlayerIDList)
|
| | |
|
| | | if not PlayerControl.GetFuncCanUse(curPlayer, ShareDefine.GameFuncID_CrossRealmPK) \
|
| | | and not PlayerControl.GetFuncCanUse(curPlayer, ShareDefine.GameFuncID_CrossBattlefield):
|
| | | GameWorld.DebugLog("跨服相关功能未开启,不同步在线状态到跨服服务器! LV=%s" % curPlayer.GetLV(), curPlayer.GetPlayerID())
|
| | | syncLV = IpyGameDataPY.GetFuncCfg("CrossSyncSet", 1)
|
| | | if curPlayer.GetLV() < syncLV:
|
| | | #GameWorld.DebugLog("跨服相关功能未开启,不同步在线状态到跨服服务器! LV=%s < %s" % (curPlayer.GetLV(), syncLV), curPlayer.GetPlayerID())
|
| | | return
|
| | |
|
| | | cacheBase = PlayerViewCache.GetSyncCrossCacheBase(curPlayer)
|
| | |
| | | cacheBase = msgData["cacheBase"]
|
| | |
|
| | | isLogout = not isOnline
|
| | | olMgr = GetOnlinePlayerMgr()
|
| | | olMgr.SetOnlineState(playerID, isOnline, cacheBase.get("ServerGroupID", 0))
|
| | | |
| | | PlayerViewCache.UpdCrossCacheBase(playerID, cacheBase, isLogout)
|
| | | serverID = GameWorld.GetAccIDServerID(cacheBase["AccID"])
|
| | |
|
| | | # 上线
|
| | | if isOnline:
|
| | | # 需要管理跨服在线状态时,默认需要同步缓存信息、打包数据信息
|
| | | syncStateInfo = {"playerID":playerID, "ViewCacheCross":1, "PackDataCross":1}
|
| | | CrossRealmMsg.SendMsgToClientServer(ShareDefine.CrossServerMsg_PlayerPackDataState, syncStateInfo, [serverGroupID])
|
| | | |
| | | GameXiangong.OnPlayerLogin_CrossLogic(serverGroupID, serverID, playerID)
|
| | | #仙盟攻城战
|
| | | CrossFamilyGCZ.OnPlayerLogin_CrossLogic(serverGroupID, serverID, playerID)
|
| | |
|
| | | # 下线
|
| | | else:
|
| | |
| | | packValue = playerStatePack.GetValue()
|
| | | packValueEx = playerStatePack.GetValueEx()
|
| | | packType = playerStatePack.GetType()
|
| | | #packValueTotal = packValue + packValueEx * ChConfig.Def_PerPointValue
|
| | |
|
| | | #---特殊逻辑处理---
|
| | | if packType == ShareDefine.CDBPlayerRefresh_ForbidenTalk:
|
| | |
| | | if packType == ShareDefine.CDBPlayerRefresh_ExAttr17:
|
| | | PlayerControl.SetPlayerAccState(curPlayer, packValue)
|
| | | return
|
| | |
|
| | | |
| | | if packType == ShareDefine.CDBPlayerRefresh_ExAttr19:
|
| | | PlayerControl.SetLeaveFamilyTimeEx(curPlayer, packValue)
|
| | | return
|
| | | |
| | | if packType == IPY_GameServer.CDBPlayerRefresh_State:
|
| | | # 脱机在线
|
| | | PlayerControl.SetIsTJG(curPlayer, packValue)
|