| | |
| | | import PlayerBourse
|
| | | import GameWorldActionTeHui
|
| | | import PlayerXMZZ
|
| | | import GameWorldMergePK
|
| | | import GameWorldShopItem
|
| | | import MergeChildMsg
|
| | | import PlayerTruck
|
| | | import PlayerMergeEvent
|
| | | import HighLadder
|
| | | import EventReport
|
| | | import MergePlayer
|
| | | import PlayerCompensation
|
| | | import PlayerFamilyRedPacket
|
| | | import PlayerFamilyStore
|
| | |
| | | import IpyGameDataPY
|
| | | import PlayerTalk
|
| | | import PlayerGeTui
|
| | | import PlayerStore
|
| | | import GameWorldActionControl
|
| | | import PlayerFBHelpBattle
|
| | | import GMT_CTG
|
| | | import PyGameData
|
| | | import GMShell
|
| | | import IPY_PlayerDefine
|
| | | import CrossRealmPK
|
| | | #---------------------------------------------------------------------
|
| | |
|
| | | #---------------------------------------------------------------------
|
| | |
| | | # @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)
|
| | | #玩家响应信息初始化
|
| | |
| | | # 通知广播信息
|
| | | GMCommon.SendBroadCastToClient(curPlayer)
|
| | |
|
| | | |
| | | # 在非跨服服务器上线时,在跨服PK赛期间如果roomID不为0则重置
|
| | | #if not GameWorld.IsMergeServer() and GameWorldMergePK.IsMergePKMatchOpen() \
|
| | | # and curPlayer.GetVsRoomId() != 0:
|
| | | # PlayerControl.SetVsRoomId(curPlayer, 0)
|
| | | |
| | | PlayerTruck.SyncPlayerTruckStartTime(curPlayer)
|
| | | #通知玩家交易所挂单情况
|
| | | PlayerBourse.OnPlayerLogin(curPlayer)
|
| | |
|
| | | #上线广播
|
| | | __CheckWorldNotifyOnLogin(curPlayer, tick)
|
| | | #上线奖励处理
|
| | | #PlayerMergeEvent.MergeEventOnPlayerLogin(curPlayer)
|
| | | #MergePlayer.OnPlayerLogin(curPlayer)
|
| | |
|
| | | #仙盟红包
|
| | | PlayerFamilyRedPacket.OnPlayerLogin(curPlayer)
|
| | |
| | | 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)
|
| | | #跨服PK
|
| | | CrossRealmPK.OnPlayerLogin(curPlayer)
|
| | |
|
| | | GMShell.OnPlayerLogin(curPlayer)
|
| | | GMT_CTG.OnPlayerLogin(curPlayer)
|
| | |
| | | # @return None
|
| | | def __CheckWorldNotifyOnLogin(curPlayer, tick):
|
| | | # 跨服服务器不广播
|
| | | if GameWorld.IsMergeServer():
|
| | | if GameWorld.IsCrossServer():
|
| | | return
|
| | |
|
| | | limitLV = IpyGameDataPY.GetFuncCfg("BillBoardPlayerLoginNotify", 2) # 最低等级限制
|
| | |
| | | diff_Time = loginTime - logoffTime
|
| | | #天数 * 24小时 * 60 分钟 + 秒
|
| | | return diff_Time.days * 24 * 60 * 60 + diff_Time.seconds
|
| | |
|
| | | ## 统计客户端跨服赛激活时间
|
| | | # @param index 玩家索引
|
| | | # @return None
|
| | | def SendMergeWarOpen(curPlayer):
|
| | | # 发送跨服赛服务器信息
|
| | | mapConfig = GameConfig.GetConfig()
|
| | | mergeServerIP = mapConfig.get("MergeServerIP")
|
| | | mergeServerPort = mapConfig.get("MergeServerPort")
|
| | | if not mergeServerIP:
|
| | | return
|
| | | mergeServerInfo = ChPyNetSendPack.tagMergeServerInfo()
|
| | | mergeServerInfo.ServerIPLen = len(mergeServerIP)
|
| | | mergeServerInfo.ServerIP = mergeServerIP
|
| | | mergeServerInfo.Port = mergeServerPort
|
| | | mergeServerInfo.IsMergeServer = GameWorld.IsMergeServer()
|
| | | NetPackCommon.SendFakePack(curPlayer, mergeServerInfo)
|
| | | return
|
| | |
|
| | | ## 跨服赛通知奖励
|
| | | # @param curPlayer: 玩家实例
|
| | | # @return: None
|
| | | def MSGetReward(curPlayer):
|
| | | #PlayerCanGetReward.SynClient_CanGetRewardList(curPlayer)
|
| | | return
|
| | |
|
| | | ## 运营登陆信息处理
|
| | | # @param 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)
|
| | | CrossRealmPK.OnLeaveServer(curPlayer)
|
| | |
|
| | | #组队玩家离线
|
| | | PlayerTeam.DoPlayerLogOffTeamLogic(curPlayer, tick)
|
| | |
| | | # 设置家族成员离线时间
|
| | | SetPlayerOfflineTime(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)
|