ServerPython/CoreServerGroup/GameServer/Script/Player/ChPlayer.py
@@ -41,7 +41,6 @@
import PlayerBourse
import GameWorldActionTeHui
import PlayerXMZZ
import GameWorldMergePK
import GameWorldShopItem
import MergeChildMsg
import PlayerTruck
@@ -63,9 +62,14 @@
import IpyGameDataPY
import PlayerTalk
import PlayerGeTui
import PlayerStore
import GameWorldActionControl
import PlayerFBHelpBattle
import GMT_CTG
import PyGameData
import GMShell
import IPY_PlayerDefine
import CrossRealmPK
#---------------------------------------------------------------------
#---------------------------------------------------------------------
@@ -75,7 +79,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 +96,10 @@
#  @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)
    #玩家响应信息初始化
@@ -109,8 +121,8 @@
        #通知玩家登陆信息,来自运营方
        #DoLogic_LoginUserData(curPlayer)
    
        #通知开服天数
        PlayerEventCounter.Sync_OpenServerDay(curPlayer)
        #通知开服天数, 登录时改为地图通知,因为GameServer的PlayerLogin在地图之后,前端有些功能处理需要提前得到开服天
        #PlayerEventCounter.Sync_OpenServerDay(curPlayer)
        # 通知广播信息
        GMCommon.SendBroadCastToClient(curPlayer)
    
@@ -142,7 +154,8 @@
        PlayerXMZZ.OnXMZZOnLogin(curPlayer)
        #等级奖励
        PlayerLVAward.OnPlayerLogin(curPlayer)
        #商店购买次数
        PlayerStore.OnPlayerLogin(curPlayer)
        #通知世界boss信息
        GameWorldBoss.OnPlayerLogin(curPlayer)
        #家族副本boss状态通知
@@ -157,7 +170,12 @@
        GameWorldActionControl.OnPlayerLogin(curPlayer)
        #玩家等级记录
        PyGameData.g_todayPlayerLVDict[curPlayer.GetID()] = curPlayer.GetLV()
        #副本助战
        PlayerFBHelpBattle.OnHelpPlayerLogin(curPlayer)
        #跨服PK
        CrossRealmPK.OnPlayerLogin(curPlayer)
        
        GMShell.OnPlayerLogin(curPlayer)
        GMT_CTG.OnPlayerLogin(curPlayer)
        
    #通知地图服务器自己初始化成功
@@ -268,19 +286,6 @@
def MSGetReward(curPlayer):
    #PlayerCanGetReward.SynClient_CanGetRewardList(curPlayer)
    return
## 通知首次开服时间
#  @param curPlayer: 玩家实例
#  @return: None
def Sync_InitOpenServerTime(curPlayer):
#    initOpenServerTime = PlayerDBGSEvent.GetDBGSTrig_ByKey(PlayerDBGSEvent.Def_InitOpenServerTime)
#    packData = ChPyNetSendPack.tagInitOpenServerTime()
#    packData.Clear()
#    packData.Time = initOpenServerTime
#    NetPackCommon.SendFakePack(curPlayer, packData)
    return
## 运营登陆信息处理
#  @param curPlayer
@@ -492,7 +497,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
## 玩家下线(封包参数)
@@ -500,11 +514,10 @@
#  @param tick 当前时间
#  @return None
#  @remarks 函数详细说明.
def __Func_PlayerDisconnect(index, tick):
    curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
def __Func_PlayerDisconnect(curPlayer, tick):
    
    #跨服匹配PK
    #GameWorldMergePK.OnLeaveServer(curPlayer)
    CrossRealmPK.OnLeaveServer(curPlayer)
    
    #组队玩家离线
    PlayerTeam.DoPlayerLogOffTeamLogic(curPlayer, tick)
@@ -519,8 +532,6 @@
    #MergePlayer.OnPlayerLeaveGotoMergeServer(curPlayer, tick)
    #------------镖车逻辑
    #TruckPlayerDisconnectProcess(curPlayer, tick)
    #调用底层下线
    curPlayer.DoDisconnect()
    return
## 设置玩家离线时间
@@ -608,11 +619,6 @@
        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)
@@ -656,6 +662,12 @@
    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);
    
@@ -669,7 +681,8 @@
    PlayerTeam.PlayerTeamMemberRefresh(curPlayer, packType, packValue, tick)
    #家族刷新
    PlayerFamily.PlayerRefresh(curPlayer, tick)
    #副本助战
    PlayerFBHelpBattle.UpdateCheckInPlayerInfoByRefresh(curPlayer, packType, packValue)
    return
## 玩家切换地图的响应(参数 -> 当前玩家,当前时间)
@@ -765,7 +778,7 @@
    #改到mapServer登录成功通知
    #Sync_PyServerDataTimeToClient(curPlayer, tick)
    
    #PlayerTeam.OnPlayerReadMapOK(curPlayer, tick)
    PlayerTeam.OnPlayerReadMapOK(curPlayer, tick)
    
    #刷新人物日期状态
    PlayerEventCounter.UpdatePlayerLoginTime(curPlayer)