|  |  | 
 |  |  | import IpyGameDataPY
 | 
 |  |  | import PlayerTalk
 | 
 |  |  | import PlayerGeTui
 | 
 |  |  | import PlayerStore
 | 
 |  |  | import GameWorldActionControl
 | 
 |  |  | import PlayerFBHelpBattle
 | 
 |  |  | import GMT_CTG
 | 
 |  |  | import PyGameData
 | 
 |  |  | import GMShell
 | 
 |  |  | import IPY_PlayerDefine
 | 
 |  |  | #---------------------------------------------------------------------
 | 
 |  |  | 
 | 
 |  |  | #---------------------------------------------------------------------
 | 
 |  |  | 
 |  |  | #  @return None
 | 
 |  |  | #  @remarks 登陆顺序, PlayerLogin->PlayerLoadMapState(PlayerLoginLoadMapOK), 此处未设置初始化状态
 | 
 |  |  | def PlayerLogin(index, tick):
 | 
 |  |  |     GameWorld.GetPsycoFunc(__Func_PlayerLogin)(index, tick)
 | 
 |  |  |     curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
 | 
 |  |  |     try:
 | 
 |  |  |         __Func_PlayerLogin(curPlayer, tick)
 | 
 |  |  |     except:
 | 
 |  |  |         curPlayer.Kick(IPY_PlayerDefine.disWaitForPlayerLoinError)
 | 
 |  |  |         import traceback
 | 
 |  |  |         GameWorld.ErrLog("玩家上线逻辑错误~~~~~\r\n%s" % traceback.format_exc())
 | 
 |  |  |         if GameWorld.GetGameWorld().GetDebugLevel():
 | 
 |  |  |             raise Exception("玩家上线逻辑错误~~~~\r\n%s" % traceback.format_exc())
 | 
 |  |  |     return
 | 
 |  |  | 
 | 
 |  |  | #---------------------------------------------------------------------
 | 
 |  |  | 
 |  |  | #  @param tick 当前时间
 | 
 |  |  | #  @return None
 | 
 |  |  | #  @remarks 登陆顺序, PlayerLogin->PlayerLoadMapState(PlayerLoginLoadMapOK), 此处未设置初始化状态
 | 
 |  |  | def __Func_PlayerLogin(index, tick):
 | 
 |  |  | def __Func_PlayerLogin(curPlayer, tick):
 | 
 |  |  |     
 | 
 |  |  |     #玩家登录初始化
 | 
 |  |  |     curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
 | 
 |  |  |     GameWorld.Log("__Func_PlayerLogin mapID=%s" % curPlayer.GetMapID(), curPlayer.GetPlayerID())
 | 
 |  |  |     curPlayer.SetDict(ChConfig.Def_PDict_LoginMapID, curPlayer.GetMapID())
 | 
 |  |  |     #玩家在线时间初始化
 | 
 |  |  |     InitPlayerOnLineTime(curPlayer, tick)
 | 
 |  |  |     #玩家响应信息初始化
 | 
 |  |  | 
 |  |  |         PlayerXMZZ.OnXMZZOnLogin(curPlayer)
 | 
 |  |  |         #等级奖励
 | 
 |  |  |         PlayerLVAward.OnPlayerLogin(curPlayer)
 | 
 |  |  |      | 
 |  |  |         #商店购买次数
 | 
 |  |  |         PlayerStore.OnPlayerLogin(curPlayer)
 | 
 |  |  |         #通知世界boss信息
 | 
 |  |  |         GameWorldBoss.OnPlayerLogin(curPlayer)
 | 
 |  |  |         #家族副本boss状态通知
 | 
 |  |  | 
 |  |  |         GameWorldActionControl.OnPlayerLogin(curPlayer)
 | 
 |  |  |         #玩家等级记录
 | 
 |  |  |         PyGameData.g_todayPlayerLVDict[curPlayer.GetID()] = curPlayer.GetLV()
 | 
 |  |  |         #副本助战
 | 
 |  |  |         PlayerFBHelpBattle.OnHelpPlayerLogin(curPlayer)
 | 
 |  |  |         
 | 
 |  |  |         GMShell.OnPlayerLogin(curPlayer)
 | 
 |  |  |         GMT_CTG.OnPlayerLogin(curPlayer)
 | 
 |  |  |         
 | 
 |  |  |     #通知地图服务器自己初始化成功
 | 
 |  |  | 
 |  |  | #  @return None
 | 
 |  |  | #  @remarks 函数详细说明.
 | 
 |  |  | def PlayerDisconnect(index, tick):
 | 
 |  |  |     GameWorld.GetPsycoFunc(__Func_PlayerDisconnect)(index, tick)
 | 
 |  |  |     curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
 | 
 |  |  |     try:
 | 
 |  |  |         __Func_PlayerDisconnect(curPlayer, tick)
 | 
 |  |  |     except:
 | 
 |  |  |         import traceback
 | 
 |  |  |         GameWorld.ErrLog("玩家下线逻辑错误~~~~~\r\n%s" % traceback.format_exc())
 | 
 |  |  |         if GameWorld.GetGameWorld().GetDebugLevel():
 | 
 |  |  |             raise Exception("玩家下线逻辑错误~~~~\r\n%s" % traceback.format_exc())
 | 
 |  |  |     #调用底层下线
 | 
 |  |  |     curPlayer.DoDisconnect()
 | 
 |  |  |     return
 | 
 |  |  | 
 | 
 |  |  | ## 玩家下线(封包参数)
 | 
 |  |  | 
 |  |  | #  @param tick 当前时间
 | 
 |  |  | #  @return None
 | 
 |  |  | #  @remarks 函数详细说明.
 | 
 |  |  | def __Func_PlayerDisconnect(index, tick):
 | 
 |  |  |     curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
 | 
 |  |  | def __Func_PlayerDisconnect(curPlayer, tick):
 | 
 |  |  |     
 | 
 |  |  |     #跨服匹配PK
 | 
 |  |  |     #GameWorldMergePK.OnLeaveServer(curPlayer)
 | 
 |  |  | 
 |  |  |     #MergePlayer.OnPlayerLeaveGotoMergeServer(curPlayer, tick)
 | 
 |  |  |     #------------镖车逻辑
 | 
 |  |  |     #TruckPlayerDisconnectProcess(curPlayer, tick)
 | 
 |  |  |     #调用底层下线
 | 
 |  |  |     curPlayer.DoDisconnect()
 | 
 |  |  |     return
 | 
 |  |  | 
 | 
 |  |  | ## 设置玩家离线时间
 | 
 |  |  | 
 |  |  |         curPlayer.SetFightPower(packValue)
 | 
 |  |  |         return
 | 
 |  |  | 
 | 
 |  |  |     if packType == IPY_GameServer.CDBPlayerRefresh_ExAttr10:
 | 
 |  |  |         #设置玩家跨服预赛排位
 | 
 |  |  |         PlayerControl.SetMergeWarRank(curPlayer, packValue)
 | 
 |  |  |         return
 | 
 |  |  | 
 | 
 |  |  |     if packType == IPY_GameServer.CDBPlayerRefresh_ExAttr2:
 | 
 |  |  |         #队伍相关相关审核开关状态
 | 
 |  |  |         PlayerTeam.SetTeamCheckState(curPlayer, packValue)
 | 
 |  |  | 
 |  |  |     elif packType == IPY_GameServer.CDBPlayerRefresh_ExAttr9:
 | 
 |  |  |         PlayerControl.SetVIPExpireTime(curPlayer, packValue)
 | 
 |  |  |         
 | 
 |  |  |     elif packType == IPY_GameServer.CDBPlayerRefresh_ExAttr10:
 | 
 |  |  |         PlayerControl.SetChatBubbleBox(curPlayer, packValue)
 | 
 |  |  |          | 
 |  |  |     elif packType == IPY_GameServer.CDBPlayerRefresh_ExAttr11:
 | 
 |  |  |         PlayerControl.SetTodayXianyuanCoin(curPlayer, packValue)
 | 
 |  |  | 
 | 
 |  |  |     elif packType == IPY_GameServer.CDBPlayerRefresh_OperateInfo:
 | 
 |  |  |         curPlayer.SetOperateInfo(packValue);
 | 
 |  |  |     
 | 
 |  |  | 
 |  |  |     PlayerTeam.PlayerTeamMemberRefresh(curPlayer, packType, packValue, tick)
 | 
 |  |  |     #家族刷新
 | 
 |  |  |     PlayerFamily.PlayerRefresh(curPlayer, tick)
 | 
 |  |  | 
 | 
 |  |  |     #副本助战
 | 
 |  |  |     PlayerFBHelpBattle.UpdateCheckInPlayerInfoByRefresh(curPlayer, packType, packValue)
 | 
 |  |  |     return
 | 
 |  |  | 
 | 
 |  |  | ## 玩家切换地图的响应(参数 -> 当前玩家,当前时间)
 | 
 |  |  | 
 |  |  |     #改到mapServer登录成功通知
 | 
 |  |  |     #Sync_PyServerDataTimeToClient(curPlayer, tick)
 | 
 |  |  |     
 | 
 |  |  |     #PlayerTeam.OnPlayerReadMapOK(curPlayer, tick)
 | 
 |  |  |     PlayerTeam.OnPlayerReadMapOK(curPlayer, tick)
 | 
 |  |  |     
 | 
 |  |  |     #刷新人物日期状态
 | 
 |  |  |     PlayerEventCounter.UpdatePlayerLoginTime(curPlayer)
 |