hxp
2025-02-18 ec0c49a3aefe5ca4b8af494366bb0b8141d34a32
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):