From f020649c241123c91520a7416be43f5ebfa6d6f9 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期三, 11 十二月 2024 15:01:39 +0800
Subject: [PATCH] 10297 【越南】【英语】【砍树】【tqxbqy】轮回殿-服务端(轮回殿活动时间表增加配置轮回类型对应的CTGID跟商店类型)

---
 ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerFamilyAction.py |   72 +++++++++++++++++++++++++++++++----
 1 files changed, 63 insertions(+), 9 deletions(-)

diff --git a/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerFamilyAction.py b/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerFamilyAction.py
index 2ac4979..463e12b 100644
--- a/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerFamilyAction.py
+++ b/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerFamilyAction.py
@@ -34,7 +34,7 @@
 import PlayerControl
 import IPY_GameServer
 import DataRecordPack
-import json
+import cPickle
 #---------------------------------------------------------------------
 
 ## 设置玩家家族行为
@@ -45,7 +45,7 @@
 #  @return None
 def MapServer_PlayerFamilyActionNote(curPlayer, actionType, actionData, tick):
     
-    actionDataList = json.loads(actionData)
+    actionDataList = cPickle.loads(actionData)
     
     familyId = curPlayer.GetFamilyID()
     
@@ -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):
@@ -583,7 +636,8 @@
         #GameWorld.DebugLog("普通成员不记录家族官员模型装备信息!")
         return
     
-    modelEquipInfoList = PlayerViewCache.GetPlayerCacheEquipView(playerID)
+    modelEquipInfoList = []
+    #modelEquipInfoList = PlayerViewCache.GetPlayerCacheEquipView(playerID)
     if not modelEquipInfoList:
         #GameWorld.DebugLog("找不到家族官员模型装备信息, 不记录!familyID=%s,playerID=%s" % (familyID, playerID))
         return

--
Gitblit v1.8.0