ServerPython/CoreServerGroup/GameServer/Script/Player/ChPlayer.py
@@ -63,9 +63,12 @@
import IpyGameDataPY
import PlayerTalk
import PlayerGeTui
import PlayerStore
import GameWorldActionControl
import GMT_CTG
import PyGameData
import GMShell
import IPY_PlayerDefine
#---------------------------------------------------------------------
#---------------------------------------------------------------------
@@ -75,7 +78,15 @@
#  @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
#---------------------------------------------------------------------
@@ -84,10 +95,8 @@
#  @param tick 当前时间
#  @return None
#  @remarks 登陆顺序, PlayerLogin->PlayerLoadMapState(PlayerLoginLoadMapOK), 此处未设置初始化状态
def __Func_PlayerLogin(index, tick):
def __Func_PlayerLogin(curPlayer, tick):
    
    #玩家登录初始化
    curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
    #玩家在线时间初始化
    InitPlayerOnLineTime(curPlayer, tick)
    #玩家响应信息初始化
@@ -142,7 +151,8 @@
        PlayerXMZZ.OnXMZZOnLogin(curPlayer)
        #等级奖励
        PlayerLVAward.OnPlayerLogin(curPlayer)
        #商店购买次数
        PlayerStore.OnPlayerLogin(curPlayer)
        #通知世界boss信息
        GameWorldBoss.OnPlayerLogin(curPlayer)
        #家族副本boss状态通知
@@ -158,6 +168,7 @@
        #玩家等级记录
        PyGameData.g_todayPlayerLVDict[curPlayer.GetID()] = curPlayer.GetLV()
        
        GMShell.OnPlayerLogin(curPlayer)
        GMT_CTG.OnPlayerLogin(curPlayer)
        
    #通知地图服务器自己初始化成功
@@ -479,7 +490,16 @@
#  @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
## 玩家下线(封包参数)
@@ -487,8 +507,7 @@
#  @param tick 当前时间
#  @return None
#  @remarks 函数详细说明.
def __Func_PlayerDisconnect(index, tick):
    curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
def __Func_PlayerDisconnect(curPlayer, tick):
    
    #跨服匹配PK
    #GameWorldMergePK.OnLeaveServer(curPlayer)
@@ -506,8 +525,6 @@
    #MergePlayer.OnPlayerLeaveGotoMergeServer(curPlayer, tick)
    #------------镖车逻辑
    #TruckPlayerDisconnectProcess(curPlayer, tick)
    #调用底层下线
    curPlayer.DoDisconnect()
    return
## 设置玩家离线时间