From fd1197fd91110938802a68d998e6f45bb65495ed Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期一, 09 二月 2026 20:12:07 +0800
Subject: [PATCH] 66 【公会】基础主体-服务端(公会讨伐支持跨服;test_OnDay等命令支持跨服同步过天等;)

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/Taofa.py |   85 ++++++++++++++++++++++++++++--------------
 1 files changed, 56 insertions(+), 29 deletions(-)

diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/Taofa.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/Taofa.py
index 98ae0cc..6dd6137 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/Taofa.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/Taofa.py
@@ -22,37 +22,37 @@
 import PlayerControl
 import PlayerFamilyTaofa
 import PlayerFamily
+import CrossPlayer
 import DBDataMgr
 import random
 import time
 
-def OnExec(curPlayer, msgList):
-    
+def GetGMServerIDList(curPlayer):
+    ## 获取命令额外发送到其他服务器,如跨服
+    crossServerID = DBDataMgr.GetFamilyMgr().GetCurCrossServerID()
+    if crossServerID:
+        GameWorld.DebugAnswer(curPlayer, "本服公会已互通跨服ID:%s" % crossServerID)
+        return [crossServerID]
+    GameWorld.DebugAnswer(curPlayer, "本服公会未互通")
+    return []
+
+def OnExecCross(crossPlayer, msgList):
     if not msgList:
-        GameWorld.DebugAnswer(curPlayer, "---------- %s" % GameWorld.GetCurrentDataTimeStr())
-        GameWorld.DebugAnswer(curPlayer, "重置公会讨伐: Taofa 0")
-        GameWorld.DebugAnswer(curPlayer, "设置布阵层级: Taofa z 层级 [剩余秒]")
-        GameWorld.DebugAnswer(curPlayer, "设置当前怒气: Taofa a 怒气")
-        GameWorld.DebugAnswer(curPlayer, "设置讨伐次数: Taofa c 已讨伐次数  物品次数")
-        GameWorld.DebugAnswer(curPlayer, "设置宝箱领取: Taofa b 已领取宝箱 未领取")
-        GameWorld.DebugAnswer(curPlayer, "设置宝箱贡献: Taofa g 已贡献宝箱 [累计伤害 历史伤害]")
-        GameWorld.DebugAnswer(curPlayer, "增加成员讨伐: Taofa m 人数 [伤害值A 到B 怒攻概率]")
-        GameWorld.DebugAnswer(curPlayer, "创建仙盟相关使用命令: CreateFamily")
+        return
+    if GameWorld.IsMainServer() and DBDataMgr.GetFamilyMgr().GetCurCrossServerID():
+        # 本服公会已互通不再执行本服命令
         return
     
-    familyID = curPlayer.GetFamilyID()
-    if not familyID:
-        GameWorld.DebugAnswer(curPlayer, "没有仙盟")
-        return
+    familyID = crossPlayer.GetFamilyID()
     curFamily = DBDataMgr.GetFamilyMgr().FindFamily(familyID)
     if not curFamily:
+        GameWorld.DebugAnswer(crossPlayer, "没有公会")
         return
     
     value1 = msgList[0]
     if value1 == 0:
         PlayerFamilyTaofa.OnTaofaReset(curFamily)
-        PlayerFamilyTaofa.OnTaofaResetPlayer(curPlayer)
-        GameWorld.DebugAnswer(curPlayer, "重置公会讨伐OK")
+        GameWorld.DebugAnswer(crossPlayer, "重置公会讨伐OK")
         return
     
     if value1 == "z":
@@ -64,15 +64,42 @@
         PlayerFamilyTaofa.SetFABuzhenLayer(gActionData, gLayer)
         PlayerFamilyTaofa.SetFABuzhenEndTime(gActionData, gEndTime)
         PlayerFamily.SendFamilyAction(gActionData)
-        GameWorld.DebugAnswer(curPlayer, "布阵层:%s,到期:%s" % (gLayer, GameWorld.ChangeTimeNumToStr(gEndTime)))
+        GameWorld.DebugAnswer(crossPlayer, "布阵层:%s,到期:%s" % (gLayer, GameWorld.ChangeTimeNumToStr(gEndTime)))
         return
     
     # 新增成员讨伐
     if value1 == "m":
-        __AddMemTaofaAtk(curPlayer, curFamily, msgList)
+        __AddMemTaofaAtk(crossPlayer, curFamily, msgList)
         return
     
-    elif value1 == "a":
+    return
+
+def OnExec(curPlayer, msgList):
+    if not msgList:
+        GameWorld.DebugAnswer(curPlayer, "-----%s-----" % GameWorld.GetCurrentDataTimeStr())
+        GameWorld.DebugAnswer(curPlayer, "重置公会讨伐: Taofa 0")
+        GameWorld.DebugAnswer(curPlayer, "设置布阵层级: Taofa z 层级 [剩余秒]")
+        GameWorld.DebugAnswer(curPlayer, "设置当前怒气: Taofa a 怒气")
+        GameWorld.DebugAnswer(curPlayer, "设置讨伐次数: Taofa c 已讨伐次数  物品次数")
+        GameWorld.DebugAnswer(curPlayer, "设置宝箱领取: Taofa b 已领取宝箱 未领取")
+        GameWorld.DebugAnswer(curPlayer, "设置宝箱贡献: Taofa g 已贡献宝箱 [累计伤害 历史伤害]")
+        GameWorld.DebugAnswer(curPlayer, "增加成员讨伐: Taofa m 人数 [伤害值A 到B 怒攻概率]")
+        GameWorld.DebugAnswer(curPlayer, "创建公会相关使用命令: CreateFamily")
+        return
+    
+    crossPlayer = CrossPlayer.GetCrossPlayerMgr().FindCrossPlayer(curPlayer.GetPlayerID())
+    if not crossPlayer:
+        return
+    
+    value1 = msgList[0]
+    
+    if value1 == 0:
+        OnExecCross(crossPlayer, msgList)
+        PlayerFamilyTaofa.OnTaofaResetPlayer(curPlayer)
+        GameWorld.DebugAnswer(curPlayer, "重置玩家讨伐OK")
+        return
+    
+    if value1 == "a":
         anger = msgList[1] if len(msgList) > 1 else 0
         PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FamilyTaofaAnger, anger)
         GameWorld.DebugAnswer(curPlayer, "当前怒气: %s" % anger)
@@ -83,7 +110,7 @@
         PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FamilyTaofaCnt, atkCnt)
         PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FamilyTaofaItemAddCnt, itemAddCnt)
         GameWorld.DebugAnswer(curPlayer, "已讨伐次数:%s, 物品增加次数:%s" % (atkCnt, itemAddCnt))
-        
+
     elif value1 == "b":
         totalGetCnt = msgList[1] if len(msgList) > 1 else 0
         unGetCnt = msgList[2] if len(msgList) > 2 else 0
@@ -113,10 +140,10 @@
     PlayerFamilyTaofa.SyncTaofaInfo(curPlayer)
     return
 
-def __AddMemTaofaAtk(curPlayer, curFamily, msgList):
+def __AddMemTaofaAtk(crossPlayer, curFamily, msgList):
     #新增成员讨伐: Taofa m 人数 [伤害值A 到B]
     
-    GameWorld.DebugAnswer(curPlayer, "---------- %s" % GameWorld.GetCurrentDataTimeStr())
+    GameWorld.DebugAnswer(crossPlayer, "---------- %s" % GameWorld.GetCurrentDataTimeStr())
     memCnt = msgList[1] if len(msgList) > 1 else curFamily.GetCount()
     hurtTotalA = msgList[2] if len(msgList) > 2 else 0
     hurtTotalB = msgList[3] if len(msgList) > 3 else hurtTotalA
@@ -125,9 +152,9 @@
     
     if curFamily.GetCount() <= memCnt:
         addMemCnt = memCnt - curFamily.GetCount() + 1
-        GameWorld.DebugAnswer(curPlayer, "添加缺少成员: %s" % addMemCnt)
-        CreateFamily.OnExec(curPlayer, ["m", addMemCnt])
-        GameWorld.DebugAnswer(curPlayer, "当前总成员数: %s" % curFamily.GetCount())
+        GameWorld.DebugAnswer(crossPlayer, "添加缺少成员: %s" % addMemCnt)
+        CreateFamily.OnExecCross(crossPlayer, ["m", addMemCnt])
+        GameWorld.DebugAnswer(crossPlayer, "当前总成员数: %s" % curFamily.GetCount())
         
     actionDataList = []
     for index in range(curFamily.GetCount()):
@@ -144,9 +171,9 @@
         hurtValue = random.randint(hurtTotalA, hurtTotalB)
         isAnger = GameWorld.CanHappen(angerRate) # 概率设置为怒气攻击
         
-        actionData = PlayerFamilyTaofa.GMAddMemTaofaAtk(curPlayer, curFamily, memID, hurtValue, isAnger)
+        actionData = PlayerFamilyTaofa.GMAddMemTaofaAtk(crossPlayer, curFamily, memID, hurtValue, isAnger)
         actionDataList.append(actionData)
-        
-    PlayerFamilyTaofa.RefreshPlayerAwardBoxCnt(curFamily)
+                
     PlayerFamily.SendFamilyAction(actionDataList)
+    PlayerFamilyTaofa.SyncMemContribInfo(curFamily)
     return

--
Gitblit v1.8.0