From 945b1b54d5041f091bcb2b14a78b6c18bc4d93e5 Mon Sep 17 00:00:00 2001 From: hch <305670599@qq.com> Date: 星期六, 20 四月 2019 15:17:49 +0800 Subject: [PATCH] 860312 修正数据事件发送的格式 --- ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/ChPlayer.py | 167 ++++++++++++++++++++++++++++++++----------------------- 1 files changed, 97 insertions(+), 70 deletions(-) diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/ChPlayer.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/ChPlayer.py index 06c7130..e6e1ff4 100644 --- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/ChPlayer.py +++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/ChPlayer.py @@ -70,6 +70,7 @@ import PlayerEquipDecompose import PlayerGreatMaster import PlayerGatherSoul +import PlayerFairyDomain import PlayerCrossRealmPK import GameFuncComm import PlayerMagicWeapon @@ -114,6 +115,7 @@ import PlayerDogz import PlayerCoat import PlayerQuDaoDoubleBill +import PlayerFB import datetime import time @@ -229,13 +231,26 @@ #struct tagCMClientStartCustomScene #{ # tagHead Head; +# DWORD MapID; +# WORD FuncLineID; #}; def OnClientStartCustomScene(index, clientData, tick): curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index) - DoEnterCustomScene(curPlayer) + DoEnterCustomScene(curPlayer, clientData.MapID, clientData.FuncLineID) return -def DoEnterCustomScene(curPlayer): +#// A2 33 前端退出自定义场景 #tagCMClientExitCustomScene +# +#struct tagCMClientExitCustomScene +#{ +# tagHead Head; +#}; +def OnClientExitCustomScene(index, clientData, tick): + curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index) + DoExitCustomScene(curPlayer) + return + +def DoEnterCustomScene(curPlayer, mapID, lineID): ## 进入自定义场景状态 curPlayer.SetCanAttack(False) curPlayer.SetVisible(False) @@ -244,8 +259,12 @@ if curPet: curPet.SetVisible(False) - curPlayer.SetDict(ChConfig.Def_PlayerKey_ClientCustomScene, 1) + curPlayer.SetDict(ChConfig.Def_PlayerKey_ClientCustomScene, 1) # 由于前端不一定有发mapID,所以这里额外记录这个状态,不能直接用mapID判断 + curPlayer.SetDict(ChConfig.Def_PlayerKey_ClientCustomSceneMapID, mapID) + curPlayer.SetDict(ChConfig.Def_PlayerKey_ClientCustomSceneLineID, lineID) GameWorld.Log("玩家开始自定义场景!", curPlayer.GetPlayerID()) + if mapID: + FBLogic.OnEnterCustomScene(curPlayer, mapID, lineID) return def DoExitCustomScene(curPlayer): @@ -260,6 +279,8 @@ if curPet: curPet.SetVisible(True) curPlayer.SetDict(ChConfig.Def_PlayerKey_ClientCustomScene, 0) + curPlayer.SetDict(ChConfig.Def_PlayerKey_ClientCustomSceneMapID, 0) + curPlayer.SetDict(ChConfig.Def_PlayerKey_ClientCustomSceneLineID, 0) GameWorld.Log("玩家退出自定义场景!", curPlayer.GetPlayerID()) return @@ -473,7 +494,8 @@ # 离线过久恢复为非跨服状态 if PlayerControl.GetCrossMapID(curPlayer): PlayerControl.SetCrossMapID(curPlayer, 0) - + PyGameData.g_customFBPrizeInfo.pop(curPlayer.GetPlayerID(), None) + SyncGuideState(curPlayer) #上线检查一次装备属性 @@ -744,6 +766,10 @@ FBHelpBattle.DoPlayerLogin(curPlayer) # 聚魂 PlayerGatherSoul.PlayerLogin(curPlayer) + #缥缈仙域 + PlayerFairyDomain.OnLogin(curPlayer) + PlayerFB.OnLogin(curPlayer) + curPlayer.SetState(0) # 脱机挂恢复为正常上线 curPlayer.SetFacePic(0) # 通知数据库是否保存还是下线,做一次恢复,1为保存 0为正常下线 tjgTime = PlayerTJG.GetTJGTime(curPlayer) @@ -1066,7 +1092,8 @@ #切地图要清除的buff __CheckClearBuffOnMapChange(curPlayer, tick) #上线和切地图加有限无敌Buff - SkillCommon.AddBuffBySkillType_NoRefurbish(curPlayer, ChConfig.Def_SkillID_LimitSuperBuff, tick) + if curPlayer.GetLV() > 50: + SkillCommon.AddBuffBySkillType_NoRefurbish(curPlayer, ChConfig.Def_SkillID_LimitSuperBuff, tick) #刷新玩家的视野 if not GameWorld.IsCrossServer() and PlayerControl.GetCrossMapID(curPlayer): @@ -1492,11 +1519,6 @@ PlayerTeam.PlayerLoginSetTeam(curPlayer, tick) - #要求数据库得到邮件状态 - #curPlayer.DataServer_GetPlayerMailState() - - #curPlayer.EndLoadMap() - #激活玩家(保证持续性Buff处理间隔) PlayerControl.SetIsNeedProcess(curPlayer, True) @@ -1549,7 +1571,7 @@ GameWorld.Log('玩家登录重置位置失败, 设置附近点 nearPosX = %s nearPosY = %s' % (nearPosX, nearPosY) , curPlayer.GetPlayerID()) #申请得到奖励物品 - curPlayer.DataServer_CheckPrizeItem() + #curPlayer.DataServer_CheckPrizeItem() #=========================================================================== # #if curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_Frist_Lock) == 1 \ @@ -1590,8 +1612,6 @@ #EndLoadMap需放在最后 curPlayer.EndLoadMap() - # 渠道返利 - PlayerQuDaoDoubleBill.OnMapQDDoubleBill(curPlayer) return True ## 切换地图同步一次PK模式 @@ -2582,62 +2602,64 @@ #@return 返回值无意义 #@remarks 客户端封包响应//04 02 获取鼠标左键点击之后对象的详细信息#tagCClickObjGetInfo def __Func_PlayerClickOtherPlayerGetInfo(index, tick): - curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index) - - sendPack = IPY_GameWorld.IPY_CClickObjGetInfo() - sendPack_ID = sendPack.GetObjID() - sendPack_Type = sendPack.GetObjType() - - tagObj = GameWorld.GetObj(sendPack_ID, sendPack_Type) - - if tagObj == None: - #GameWorld.Log("玩家请求其他玩家的相貌信息失败, 对象不存在", curPlayer.GetPlayerID()) - return - - dist = GameWorld.GetDist(curPlayer.GetPosX(), curPlayer.GetPosY(), tagObj.GetPosX(), tagObj.GetPosY()) - #是否可以目标详细信息 - canGetDetail = (dist <= curPlayer.GetSight()) - #目标类型 - tagObjType = tagObj.GetGameObjType() - - #仅处理Player和NPC - if tagObjType not in [IPY_GameWorld.gotPlayer, IPY_GameWorld.gotNPC]: - return - - #---玩家处理--- - if tagObjType == IPY_GameWorld.gotPlayer: - #获取玩家详细信息成功 - if canGetDetail: - extendDataDict = {} - extendDataDict['maxHP'] = tagObj.GetMaxHP() - extendDataDict['maxMP'] = tagObj.GetMaxMP() - extendDataDict['hit'] = tagObj.GetHit() - extendDataDict['miss'] = tagObj.GetMiss() - extendDataDict['atkSpeed'] = PlayerControl.GetAtkSpeed(tagObj) - extendDataDict['superHitRate'] = tagObj.GetSuperHitRate() - extendDataDict['superHit'] = tagObj.GetSuperHit() - extendDataDict['luckyHitRate'] = tagObj.GetLuckyHitRate() - extendDataDict['greatHitRate'] = tagObj.GetGreatHitRate() - extendDataDict['ignoreDefRate'] = tagObj.GetIgnoreDefRate() - extendDataDict['damageReduceRate'] = tagObj.GetDamageReduceRate() - extendDataDict['damageBackRate'] = tagObj.GetDamageBackRate() - - extendData = str(extendDataDict) - extendDataLen = len(extendData) - curPlayer.PlayerClickOtherPlayerDetail(tagObj, extendDataLen, extendData) - return - - #获取玩家详细信息失败 - curPlayer.Sync_GetPlayerInfoFail(sendPack_ID) - return - - #---NPC处理--- - - #获取NPC详细信息成功 - if canGetDetail: - curPlayer.PlayerClickOtherNPCDetail(tagObj) - return - + #=========================================================================== + # curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index) + # + # sendPack = IPY_GameWorld.IPY_CClickObjGetInfo() + # sendPack_ID = sendPack.GetObjID() + # sendPack_Type = sendPack.GetObjType() + # + # tagObj = GameWorld.GetObj(sendPack_ID, sendPack_Type) + # + # if tagObj == None: + # #GameWorld.Log("玩家请求其他玩家的相貌信息失败, 对象不存在", curPlayer.GetPlayerID()) + # return + # + # dist = GameWorld.GetDist(curPlayer.GetPosX(), curPlayer.GetPosY(), tagObj.GetPosX(), tagObj.GetPosY()) + # #是否可以目标详细信息 + # canGetDetail = (dist <= curPlayer.GetSight()) + # #目标类型 + # tagObjType = tagObj.GetGameObjType() + # + # #仅处理Player和NPC + # if tagObjType not in [IPY_GameWorld.gotPlayer, IPY_GameWorld.gotNPC]: + # return + # + # #---玩家处理--- + # if tagObjType == IPY_GameWorld.gotPlayer: + # #获取玩家详细信息成功 + # if canGetDetail: + # extendDataDict = {} + # extendDataDict['maxHP'] = tagObj.GetMaxHP() + # extendDataDict['maxMP'] = tagObj.GetMaxMP() + # extendDataDict['hit'] = tagObj.GetHit() + # extendDataDict['miss'] = tagObj.GetMiss() + # extendDataDict['atkSpeed'] = PlayerControl.GetAtkSpeed(tagObj) + # extendDataDict['superHitRate'] = tagObj.GetSuperHitRate() + # extendDataDict['superHit'] = tagObj.GetSuperHit() + # extendDataDict['luckyHitRate'] = tagObj.GetLuckyHitRate() + # extendDataDict['greatHitRate'] = tagObj.GetGreatHitRate() + # extendDataDict['ignoreDefRate'] = tagObj.GetIgnoreDefRate() + # extendDataDict['damageReduceRate'] = tagObj.GetDamageReduceRate() + # extendDataDict['damageBackRate'] = tagObj.GetDamageBackRate() + # + # extendData = str(extendDataDict) + # extendDataLen = len(extendData) + # curPlayer.PlayerClickOtherPlayerDetail(tagObj, extendDataLen, extendData) + # return + # + # #获取玩家详细信息失败 + # curPlayer.Sync_GetPlayerInfoFail(sendPack_ID) + # return + # + # #---NPC处理--- + # + # #获取NPC详细信息成功 + # if canGetDetail: + # curPlayer.PlayerClickOtherNPCDetail(tagObj) + # return + # + #=========================================================================== #获取NPC详细信息失败 #暂不处理 return @@ -4508,10 +4530,11 @@ #{ # tagHead Head; # DWORD DataMapID; +# WORD LineID; #}; def OnEnterCrossServer(index, clientData, tick): curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index) - PlayerControl.PlayerEnterCrossServer(curPlayer, clientData.DataMapID) + PlayerControl.PlayerEnterCrossServer(curPlayer, clientData.DataMapID, clientData.LineID) return #=============================================================================== @@ -5341,6 +5364,10 @@ # 领取节日巡礼积分奖励 elif rewardType == ChConfig.Def_RewardType_FeastWeekPartyPoint: PlayerFeastWeekParty.GetFeastWeekPartyPointAward(curPlayer, dataEx, dataExStr) + #缥缈奇遇领取 + elif rewardType == ChConfig.Def_RewardType_FairyAdventuresAward: + PlayerFairyDomain.GetFairyAdventuresAward(curPlayer, dataEx, dataExStr) + return -- Gitblit v1.8.0