From 9d3eb54f791b846ef03ff4e3a9e96dde2bb2b88f Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期五, 10 一月 2025 19:17:14 +0800
Subject: [PATCH] 10263 【越南】【英文】后端支持NPC仿真实玩家战斗和快速战斗(修复战力不变时可能导致打包数据拉取失败bug;)

---
 ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerFamilyAction.py |   65 +++++++++++++++++++++++++++++---
 1 files changed, 59 insertions(+), 6 deletions(-)

diff --git a/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerFamilyAction.py b/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerFamilyAction.py
index 0cf2590..463e12b 100644
--- a/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerFamilyAction.py
+++ b/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerFamilyAction.py
@@ -182,7 +182,7 @@
 def __RequestAddFamilyNote(curPlayer, actionType, actionDataList, tick):
     
     requestAddFamilyID = actionDataList[0]  # 申请进入的家族
-    fightPower = actionDataList[1] if len(actionDataList) > 1 else curPlayer.GetFightPower()
+    fightPower = actionDataList[1] if len(actionDataList) > 1 else PlayerControl.GetFightPower(curPlayer)
     requestPlayerName = curPlayer.GetName()  # 申请的玩家名字
     
     familyManager = GameWorld.GetFamilyManager()
@@ -226,7 +226,7 @@
             return
     
     #玩家Id, 等级,职业,战斗力
-    actionDataList = [curPlayer.GetID(), curPlayer.GetLV(), curPlayer.GetJob(), fightPower]
+    actionDataList = [curPlayer.GetID(), curPlayer.GetLV(), curPlayer.GetJob(), fightPower % ChConfig.Def_PerPointValue, fightPower / ChConfig.Def_PerPointValue]
 
     result = AddFamilyActionNote(requestPlayerName, requestAddFamilyID, actionType, actionDataList, tick, False)
     if not result:
@@ -423,15 +423,15 @@
         playerLV = familyActionData.GetValue2()  # 等级
         playerJob = familyActionData.GetValue3()  # 职业
         fightPower = familyActionData.GetValue4()  # 战斗力
-        
+        fightPower += familyActionData.GetValue5() * ChConfig.Def_PerPointValue
         tagPlayer = GameWorld.GetPlayerManager().FindPlayerByID(playerID)
         if not tagPlayer:
             isOnLine = 0
         else:
             isOnLine = 1
             playerLV = tagPlayer.GetLV()
-            if tagPlayer.GetFightPower() > fightPower:
-                fightPower = tagPlayer.GetFightPower()
+            if PlayerControl.GetFightPower(tagPlayer) > fightPower:
+                fightPower = PlayerControl.GetFightPower(tagPlayer)
             
         memberInfo = ChPyNetSendPack.tagtMemberInfo()
         memberInfo.PlayerID = playerID
@@ -439,7 +439,8 @@
         memberInfo.Name = requestPlayerName
         memberInfo.PlayerLV = playerLV
         memberInfo.PlayeJob = playerJob
-        memberInfo.PlayeFightPower = fightPower
+        memberInfo.PlayeFightPower = fightPower % ChConfig.Def_PerPointValue
+        memberInfo.PlayeFightPowerEx = fightPower / ChConfig.Def_PerPointValue
         memberInfo.RequestTime = requestTime
         memberInfo.IsOnLine = isOnLine
         packList.append(memberInfo)
@@ -556,6 +557,58 @@
         
     return
 
+def SendFamilyAction(actionDataList, curPlayer=None):
+    ## 同步指定action
+    # @param actionDataList: 支持列表或指定actionData
+    if not isinstance(actionDataList, list):
+        actionDataList = [actionDataList]
+    if not actionDataList:
+        return
+    familyActionData = actionDataList[0]
+    familyID = familyActionData.GetFamilyId()
+    
+    actionInfoPack = ChPyNetSendPack.tagGCFamilyActionInfo()
+    actionInfoPack.Clear()
+    actionInfoPack.FamilyID = familyID
+    actionInfoPack.ActionType = familyActionData.GetActionType()
+    actionInfoPack.FamilyActionList = []    
+    
+    for familyActionData in actionDataList:
+        actionData = ChPyNetSendPack.tagGCFamilyAction()
+        actionData.Clear()
+        actionData.Time = familyActionData.GetTime()
+        actionData.Name = familyActionData.GetName()
+        actionData.NameLen = len(actionData.Name)
+        actionData.Value1 = familyActionData.GetValue1()
+        actionData.Value2 = familyActionData.GetValue2()
+        actionData.Value3 = familyActionData.GetValue3()
+        actionData.Value4 = familyActionData.GetValue4()
+        actionData.Value5 = familyActionData.GetValue5()
+        actionData.Value6 = familyActionData.GetValue6()
+        actionData.UseData = familyActionData.GetUseData()
+        actionData.UseDataLen = len(actionData.UseData)
+        actionInfoPack.FamilyActionList.append(actionData)
+        
+    actionInfoPack.Count = len(actionInfoPack.FamilyActionList)
+    
+    if curPlayer:
+        NetPackCommon.SendFakePack(curPlayer, actionInfoPack)
+        return
+    
+    # 没有指定玩家的情况下通知全战盟
+    family = GameWorld.GetFamilyManager().FindFamily(familyID)
+    if not family:
+        return
+    
+    for index in xrange(family.GetCount()):
+        curMember = family.GetAt(index)
+        curPlayer = curMember.GetPlayer()
+        #不在线
+        if curPlayer == None:
+            continue
+        NetPackCommon.SendFakePack(curPlayer, actionInfoPack)
+        
+    return
 
 ## 删除时机: 1-降为普通成员;2-退出家族
 def DelFamilyOfficerModelEquip(familyID, delPlayerID):

--
Gitblit v1.8.0