From e4c7eb72844c7a3ee3b131a3a99fcea49a13f65e Mon Sep 17 00:00:00 2001 From: hxp <ale99527@vip.qq.com> Date: 星期一, 13 十二月 2021 16:51:25 +0800 Subject: [PATCH] 9363 【BT5】【后端】新增魔化之地(增加特殊灵宠可配置不同升阶道具支持) --- ServerPython/CoreServerGroup/GameServer/Script/Player/ChPlayer.py | 96 ++++++++++++++++++++++++++++++++++++----------- 1 files changed, 73 insertions(+), 23 deletions(-) diff --git a/ServerPython/CoreServerGroup/GameServer/Script/Player/ChPlayer.py b/ServerPython/CoreServerGroup/GameServer/Script/Player/ChPlayer.py index 0d71834..17c406e 100644 --- a/ServerPython/CoreServerGroup/GameServer/Script/Player/ChPlayer.py +++ b/ServerPython/CoreServerGroup/GameServer/Script/Player/ChPlayer.py @@ -44,7 +44,7 @@ #import PlayerFamilyStore import PlayerSocial import PlayerFamilyParty -import PlayerSealDemon +#import PlayerSealDemon import PlayerBillboard import PlayerLVAward import PlayerDuJie @@ -56,13 +56,19 @@ import GameWorldActionControl import GameWorldFamilyWar import PlayerFBHelpBattle +import GameWorldSkyTower import GMT_CTG import PyGameData import GMShell import IPY_PlayerDefine +import GameWorldArena +import CrossLuckyCloudBuy import CrossRealmPK import AuctionHouse +import PlayerAssist import PlayerFB +import PlayerLove +import PlayerCharm #--------------------------------------------------------------------- #--------------------------------------------------------------------- @@ -87,9 +93,7 @@ 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()) + GameWorld.RaiseException("玩家上线逻辑错误\r\n%s" % traceback.format_exc()) return #--------------------------------------------------------------------- @@ -159,7 +163,7 @@ #仙盟宴会 PlayerFamilyParty.OnPlayerLogin(curPlayer) #封魔坛 - PlayerSealDemon.OnPlayerLogin(curPlayer) + #PlayerSealDemon.OnPlayerLogin(curPlayer) #仙魔之争 PlayerXMZZ.OnXMZZOnLogin(curPlayer) #等级奖励 @@ -168,28 +172,61 @@ PlayerStore.OnPlayerLogin(curPlayer) #通知世界boss信息 GameWorldBoss.OnPlayerLogin(curPlayer) - #家族副本boss状态通知 - PlayerFamilyBoss.OnLogin(curPlayer) #渡劫 PlayerDuJie.OnPlayerLogin(curPlayer) #守卫人皇 PlayerFamilySWRH.OnLogin(curPlayer) PlayerTalk.LoginChatMi(curPlayer) PlayerTalk.NotifyTalkCache(curPlayer) - PlayerGeTui.CleanNewGuyCallBackGeTui(curPlayer.GetID()) + #PlayerGeTui.CleanNewGuyCallBackGeTui(curPlayer.GetID()) #活动 GameWorldActionControl.OnPlayerLogin(curPlayer) #玩家等级记录 PyGameData.g_todayPlayerLVDict[curPlayer.GetID()] = curPlayer.GetLV() - #副本助战 - PlayerFBHelpBattle.OnHelpPlayerLogin(curPlayer) + #竞技场 + GameWorldArena.OnPlayerLogin(curPlayer) #跨服PK CrossRealmPK.OnPlayerLogin(curPlayer) + #幸运云购 + CrossLuckyCloudBuy.OnPlayerLogin(curPlayer) #诛仙BOSS PlayerZhuXianBoss.OnPlayerLogin(curPlayer) #骑宠boss状态通知 PlayerHorsePetBoss.OnLogin(curPlayer) + #协助 + PlayerAssist.OnPlayerLogin(curPlayer, False) + #天星塔 + GameWorldSkyTower.OnPlayerLogin(curPlayer) GMT_CTG.OnPlayerLogin(curPlayer) + + else: + #协助 + PlayerAssist.OnPlayerLogin(curPlayer, True) + + return + +def DoPlayerRealLoginOK(curPlayer, loginMsg, tick): + ''' 玩家最终登录成功处理, 由 MapServer DoPlayerRealLoginOK 通知 + 该函数为地图最终登录成功才会执行到,以后一些功能类的登录处理建议均写到这里 + 旧的功能先不动( __DoPlayerLoginServer 函数中的功能),如果有登录相关的bug再考虑是否移动到此函数 + ''' + isMixServerFirstLogin = loginMsg[0] + GameWorld.Log("GameServer->DoPlayerRealLoginOK, isMixServerFirstLogin=%s" % isMixServerFirstLogin, curPlayer.GetPlayerID()) + + if GameWorld.IsCrossServer(): + return + + if not PlayerControl.GetIsTJG(curPlayer): + #家族副本boss状态通知 + PlayerFamilyBoss.OnLogin(curPlayer) + #魅力 + PlayerCharm.OnPlayerLogin(curPlayer) + #情缘 + PlayerLove.OnPlayerLogin(curPlayer) + + if isMixServerFirstLogin: + PlayerCharm.OnMixServerFirstLogin(curPlayer) + return def __UpdOnedayJobPlayerLoginoffTime(curPlayer): @@ -510,9 +547,7 @@ __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()) + GameWorld.RaiseException("玩家下线逻辑错误\r\n%s" % traceback.format_exc()) #调用底层下线 curPlayer.DoDisconnect() return @@ -537,11 +572,15 @@ PlayerFriend.OnPlayerDisconnect(curPlayer, tick) __UpdOnedayJobPlayerLoginoffTime(curPlayer) - PlayerGeTui.NewGuyCallBackGeTui(curPlayer, tick) + #PlayerGeTui.NewGuyCallBackGeTui(curPlayer, tick) # 设置家族成员离线时间 SetPlayerOfflineTime(curPlayer) #拍卖行 AuctionHouse.OnPlayerLeaveServer(curPlayer) + #协助 + PlayerAssist.OnLeaveServer(curPlayer) + #红包 + PlayerFamilyRedPacket.OnLeaveServer(curPlayer) #------------镖车逻辑 #TruckPlayerDisconnectProcess(curPlayer, tick) @@ -556,8 +595,8 @@ # @return None # @remarks 函数详细说明. def SetPlayerOfflineTime(curPlayer): - if PlayerControl.GetIsTJG(curPlayer): - return + #if PlayerControl.GetIsTJG(curPlayer): + # return curPlayerID = curPlayer.GetPlayerID() curFamily = curPlayer.GetFamily() @@ -611,6 +650,7 @@ playerStatePack = IPY_GameServer.IPY_GRefreshPlayerProperty() packValue = playerStatePack.GetValue() + packValueEx = playerStatePack.GetValueEx() packType = playerStatePack.GetType() #---特殊逻辑处理--- @@ -618,6 +658,10 @@ PlayerControl.SetGMForbidenTalk(curPlayer, packValue) return + if packType == ShareDefine.CDBPlayerRefresh_ExAttr17: + PlayerControl.SetPlayerAccState(curPlayer, packValue) + return + if packType == IPY_GameServer.CDBPlayerRefresh_State: # 脱机在线 PlayerControl.SetIsTJG(curPlayer, packValue) @@ -633,7 +677,7 @@ return if packType == IPY_GameServer.CDBPlayerRefresh_FightPower: - curPlayer.SetFightPower(packValue) + curPlayer.SetFightPower(packValue, packValueEx) return if packType == IPY_GameServer.CDBPlayerRefresh_ExAttr2: @@ -641,11 +685,19 @@ PlayerTeam.SetTeamCheckState(curPlayer, packValue) return + #if packType == IPY_GameServer.CDBPlayerRefresh_ExAttr1: + # PlayerControl.SetAssistTagPlayerID(curPlayer, packValue) + # return + + if packType == IPY_GameServer.CDBPlayerRefresh_ExAttr3: + PlayerControl.SetFBFuncLineID(curPlayer, packValue) + return + #---常规逻辑处理--- elif packType == IPY_GameServer.CDBPlayerRefresh_LV: curPlayer.SetLV(packValue) - PlayerSocial.UpdateSocialInfo(curPlayer, packType, packValue) + PlayerSocial.UpdateSocialInfo(curPlayer.GetID(), packType, packValue) #玩家等级记录 playerID = curPlayer.GetID() if playerID in PyGameData.g_todayPlayerLVDict: @@ -684,9 +736,6 @@ 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_ExAttr13: PlayerControl.SetPlayerServerGroupID(curPlayer, packValue) @@ -695,7 +744,7 @@ elif packType == IPY_GameServer.CDBPlayerRefresh_OfficialRank: curPlayer.SetOfficialRank(packValue) - PlayerSocial.UpdateSocialInfo(curPlayer, packType, packValue) + PlayerSocial.UpdateSocialInfo(curPlayer.GetID(), packType, packValue) #更新排行榜的境界 PlayerBillboard.UpdateBillboardRealm(curPlayer) @@ -1170,7 +1219,8 @@ serverDateTime.Hour = serverTime.hour serverDateTime.Minute = serverTime.minute serverDateTime.Second = serverTime.second - serverDateTime.MicSecond = serverTime.microsecond + serverDateTime.MicSecond = serverTime.microsecond + serverDateTime.CrossServerTime = GameWorld.GetCrossServerTimeStr() # 通知客户端同步时间 NetPackCommon.SendFakePack(curPlayer, serverDateTime) -- Gitblit v1.8.0