From f2cf64ffabcd15d5497aee8914b8d37d8b9a88b0 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期六, 07 二月 2026 15:39:43 +0800
Subject: [PATCH] 66 【公会】基础主体-服务端(公会GM命令支持跨服 CreateFamily、Family、Zhenbaoge;跨服公会聊天支持,包含公会聊天缓存;查看玩家A705回包增加公会所在服务器ID信息;)

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/ChPlayer.py |  159 +++++++---------------------------------------------
 1 files changed, 22 insertions(+), 137 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 a523967..a51bd7d 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/ChPlayer.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/ChPlayer.py
@@ -29,7 +29,6 @@
 import FunctionNPCCommon
 import PlayerGMOper
 import ReadChConfig
-import PetControl
 import OperControlManager
 import ShareDefine
 import NetPackCommon
@@ -39,7 +38,6 @@
 import PlayerLVAward
 import PlayerGoldGift
 import PlayerSignDay
-import PlayerPet
 import PlayerPrestigeSys
 import PlayerFamily
 import PlayerLoginDayAward
@@ -49,53 +47,38 @@
 import PlayerWishingWell
 import PlayerSuccess
 import PlayerFreeGoods
-import PlayerCrossRealmPK
-import PlayerCrossChampionship
 import GameFuncComm
 import PlayerFamilyTaofa
-import PlayerWeekParty
-import PlayerFeastWeekParty
 import PlayerFeastLogin
 import PlayerFeastWish
 import PlayerActLogin
 import PlayerTreasure
-import PlayerRune
 import IpyGameDataPY
 import EventReport
 import PassiveBuffEffMng
 import PlayerFlashSale
 import PlayerFlashGiftbag
 import PlayerDailyGiftbag
-import PlayerCostRebate
 import PlayerActBuyOne
 import PlayerActGrowupBuy
 import PlayerActCollectWords
 import PlayerActTotalRecharge
-import PlayerActRechargePrize
 import PlayerActLianqi
 import PlayerActGodGift
 import PlayerActFamilyCTGAssist
-import PlayerActRechargeRebateGold
 import PlayerActManyDayRecharge
 import PlayerActSingleRecharge
 import PlayerSpringSale
-import PlayerCrossYaomoBoss
-import PlayerLuckyCloudBuy
 import PlayerLuckyTreasure
-import CrossActCTGBillboard
-import CrossActAllRecharge
 import PlayerFuncSysPrivilege
 import PlayerActTurntable
-import PlayerTongTianLing
 import OpenServerActivity
-import CrossRealmPlayer
 import ChNetSendPack
 import PlayerArena
 import PyGameData
 import PlayerCoin
 import PlayerCharm
 import PlayerDogz
-import PlayerCoat
 import PlayerFB
 import PlayerFaQi
 import SkillShell
@@ -257,11 +240,6 @@
     __Sync_ClientBuff(curPlayer)
     
     PlayerState.Sync_PKBossState(curPlayer)
-    
-    if PlayerControl.GetCrossMapID(curPlayer):
-        CrossRealmPlayer.DoExitCrossRealm(curPlayer)
-        
-    PetControl.DoLogic_PetLoadMapOK(curPlayer)
     
     # 恢复视野,刷新自己的视野
     curPlayer.SetVisible(True)
@@ -457,8 +435,6 @@
         
         DataRecordPack.DR_PlayerLogin(curPlayer)
         EventReport.WriteEvent_login(curPlayer)
-        #---玩家上线, 宠物逻辑处理---
-        #PetControl.DoLogic_PetInfo_OnLogin(curPlayer, tick)
         return
     
     leaveServerSecond = PlayerControl.GetPlayerLeaveServerSecond(curPlayer)
@@ -514,10 +490,6 @@
     #PK模式
     #SyncPKModel(curPlayer)
     
-    #---玩家上线, 宠物逻辑处理---
-    #PetControl.DoLogic_PetInfo_OnLogin(curPlayer, tick)
-    #PlayerPet.OnPlayerPetLogin(curPlayer)
-    
     # 通知等级奖励领取记录
     PlayerLVAward.Sync_LVAwardGetRecordInfo(curPlayer)
     
@@ -568,16 +540,6 @@
     
     PlayerFamily.OnPlayerLogin(curPlayer, tick)
     
-    # 时装
-    PlayerCoat.OnLogin_Coat(curPlayer)
-    
-    # 跨服PK
-    PlayerCrossRealmPK.DoPlayerLogin(curPlayer)
-    PlayerCrossChampionship.DoPlayerLogin(curPlayer)
-    
-    # 幸运云购
-    PlayerLuckyCloudBuy.OnPlayerLogin(curPlayer)
-    
     # 竞技场
     PlayerArena.OnLogin(curPlayer)
     
@@ -586,19 +548,8 @@
     PlayerControl.NotifyUseMoneyTotal(curPlayer)
     #通知基础属性
     #NotifyPlayerBasePoint(curPlayer)
-    
-    #跨服充值排行
-    CrossActCTGBillboard.OnPlayerLogin(curPlayer)
-    #跨服全民充值
-    CrossActAllRecharge.OnPlayerLogin(curPlayer)
-    #消费返利
-    PlayerCostRebate.OnPlayerLogin(curPlayer)
     #累计充值
     PlayerActTotalRecharge.OnPlayerLogin(curPlayer)
-    #累计充值返利仙玉
-    PlayerActRechargeRebateGold.OnPlayerLogin(curPlayer)
-    #充值返利
-    PlayerActRechargePrize.OnPlayerLogin(curPlayer)
     #成长必买
     PlayerActGrowupBuy.OnPlayerLogin(curPlayer)
     #限时特惠
@@ -616,16 +567,12 @@
     #集字活动
     PlayerActCollectWords.OnPlayerLogin(curPlayer)
     ChItem.Sync_ItemDayUseCnt(curPlayer)
-    # 符印登录通知
-    PlayerRune.PlayerRuneLogin(curPlayer)
     # 商店物品购买次数登录通知
     FunctionNPCCommon.ShopItemOnLogin(curPlayer)
     # 通知设置的被动功法
     #PassiveBuffEffMng.OnLoginGFPassive(curPlayer)
     # 极品白拿
     PlayerFreeGoods.OnLogin(curPlayer)
-    # 周狂欢活动
-    PlayerWeekParty.OnLogin(curPlayer)
     # 购买次数礼包活动
     PlayerActBuyCountGift.OnPlayerLogin(curPlayer)
     # 任务活动
@@ -636,8 +583,6 @@
     PlayerActLunhuidian.OnPlayerLogin(curPlayer)
     # 登录活动
     PlayerActLoginNew.OnPlayerLogin(curPlayer)
-    # 节日巡礼活动
-    PlayerFeastWeekParty.OnLogin(curPlayer)
     # 节日登录活动
     PlayerFeastLogin.OnPlayerLogin(curPlayer)
     # 节日祝福活动
@@ -669,8 +614,6 @@
     PlayerFB.OnLogin(curPlayer)
     #技能专精信息
     #SkillShell.NotifyElementSkillInfo(curPlayer)
-    #通天令
-    PlayerTongTianLing.OnPlayerLogin(curPlayer)
     #创角奖励
     Sync_CreateRoleAwardInfo(curPlayer)
     #自定义奖励
@@ -927,29 +870,34 @@
     return
 
 def S2C_OnlineState(dataMsg, fromServerID, playerID):
-    ## 收到游戏服玩家在线状态同步
+    '''收到游戏服玩家在线状态同步
+    跨服收到在线状态同步时都视为在跨服上线,需要处理跨服在线/上线的逻辑
+    不然在跨服维护游戏服不维护的情况下,等跨服重开后,游戏服重新同步在线玩家,此时如果跨服不处理登录逻辑,会少同步封包
+    如公会,跨服维护之后登录的玩家会取不到公会数据,等跨服重开后,需视为登录重新同步
+    与跨服重连一样的道理,都是重新同步所有信息
+    '''
     isOnline = dataMsg["isOnline"]
-    isLoginout = dataMsg["isLoginout"]
+    #isLoginout = dataMsg["isLoginout"] # 如果个别跨服功能有需要对真实上下线做特殊处理的可使用该参数判断
     baseInfo = dataMsg["baseInfo"]
     
     crossPlayer = UpdCrossPlayerFromMainServer(fromServerID, playerID, baseInfo, isOnline)
     
     # 其他跨服功能处理,暂时仅上下线时处理
     curServerID = GameWorld.GetGameWorld().GetServerID()
-    if isLoginout:
-        # 公会
-        if "crossFamilyServerID" in dataMsg:
-            crossFamilyServerID = dataMsg["crossFamilyServerID"]
-            if curServerID == crossFamilyServerID:
-                if isOnline:
-                    PlayerFamily.OnCrossPlayerLogin(crossPlayer)
-                else:
-                    PlayerFamily.OnCrossPlayerLogout(crossPlayer)
-                    
-        # 最后处理缓存,先放在更新中处理删除,有问题再放后面
-        #if not isOnline:
-        #    PlayerViewCache.OnCrossPlayerLogout(crossPlayer)
-        #    CrossPlayer.GetCrossPlayerMgr().DeletePlayer(playerID)
+    #if isLoginout:
+    # 公会
+    if "crossFamilyServerID" in dataMsg:
+        crossFamilyServerID = dataMsg["crossFamilyServerID"]
+        if curServerID == crossFamilyServerID:
+            if isOnline:
+                PlayerFamily.OnCrossPlayerLogin(crossPlayer)
+            else:
+                PlayerFamily.OnCrossPlayerLogout(crossPlayer)
+                
+    # 最后处理缓存,先放在更新中处理删除,有问题再放后面
+    #if not isOnline:
+    #    PlayerViewCache.OnCrossPlayerLogout(crossPlayer)
+    #    CrossPlayer.GetCrossPlayerMgr().DeletePlayer(playerID)
             
     # 最后同步处理跨服登录成功
     #if isLoginout and isOnline:
@@ -1373,9 +1321,6 @@
     #    GameObj.SetHPFull(curSummon)
     #===========================================================================
     
-    #初始化宠物 通知客户端
-    PetControl.Sync_PetInfo_ChangeMap(curPlayer, tick)
-
     #通知GameServer自己现在的地图
     #curPlayer.Sync_GameServer_MapID()
     
@@ -1585,9 +1530,6 @@
     
     #如果登录的副本,执行进入副本逻辑, 因为有时间响应, 必须在EndLoadMap之后...
     FBLogic.DoEnterFBLogic(curPlayer, tick)
-    
-    #触发切换地图宠物逻辑
-    PetControl.DoLogic_PetLoadMapOK(curPlayer)
 
     #---检查是否卡障碍---
     curMap = GameWorld.GetMap()
@@ -1989,20 +1931,6 @@
     
     curPlayer.ChangePos(sendPack_DestX, sendPack_DestY)
     #curPlayer.SetClientMoveTick(sendPack_WorldTick)
-    
-    fightPet = curPlayer.GetPetMgr().GetFightPet()
-    #无出战宠物
-    if fightPet == None:
-        return
-    
-    if GameWorld.GetDist(fightPet.GetPosX(), fightPet.GetPosY(), sendPack_DestX, sendPack_DestY) <= 4:
-        #战斗中不频繁移动
-        return
-
-    #出战宠物同时移动
-    PetControl.FightPetFollowMove(curPlayer, sendPack_StartX, sendPack_StartY)
-    
-    
     return
 
 #---------------------------------------------------------------------
@@ -2076,9 +2004,6 @@
     # 在UpdatePos 调用间隔内多次调用move会使 m_StartMoveTick 重置,导致无法移动
     # 而在 CheckMovePos -> PlayerRefreshPos -> __FixPlayerPos -> ChangePos 造成移动的现象
     curPlayer.Move(client_DestX, client_DestY)
-
-    #出战宠物同时移动
-    #PetControl.FightPetFollowMove(curPlayer, client_DestX, client_DestY, client_StartX, client_StartY)
     return
 
 ##移动点检查, checkObj 是移动对象(在人镖合一状态下, 输入为骠车
@@ -2298,9 +2223,6 @@
     PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_RouteServerInitOK, 0)
     
     PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PlayerKey_CrossRegisterMap, 0)
-    
-    #下线召回宠物
-    PetControl.ReCallFightPet(curPlayer)
     
     #离线session
     EventReport.WriteEvent_session(curPlayer)
@@ -2953,8 +2875,6 @@
     elif rebornType == ChConfig.rebornType_MainCity:
         #直接取db中配置的复活点
         PlayerControl.PlayerResetWorldPos(curPlayer, gameMap.GetRebornMapID(), gameMap.GetRebornMapX(), gameMap.GetRebornMapY())
-    #重新召唤宠物
-    PlayerPet.AutoSummonPet(curPlayer)
     
     #复活成功,重置状态
     PlayerControl.ChangePlayerAction(curPlayer, IPY_GameWorld.paNull)
@@ -3014,8 +2934,7 @@
 #    WORD        LineID;
 #};
 def OnEnterCrossServer(index, clientData, tick):
-    curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
-    PlayerControl.PlayerEnterCrossServer(curPlayer, clientData.DataMapID, clientData.LineID)
+    #curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
     return
     
 #===============================================================================
@@ -3423,9 +3342,6 @@
     # 领取极品白拿
     elif rewardType == ChConfig.Def_RewardType_FreeGoods:
         PlayerFreeGoods.OnGetFreeGoods(curPlayer, dataEx)
-    # 领取消费返利奖励
-    elif rewardType == ChConfig.Def_RewardType_CostRebate:
-        PlayerCostRebate.OnGetCostRebateAward(curPlayer, dataEx, dataExStr)
     # 领取累计充值奖励
     elif rewardType == ChConfig.Def_RewardType_TotalRecharge:
         PlayerActTotalRecharge.OnGetTotalRechargeAward(curPlayer, dataEx, dataExStr)
@@ -3438,21 +3354,9 @@
     # 领取许愿池奖励
     elif rewardType == ChConfig.Def_RewardType_WishingWell:
         PlayerWishingWell.DoGetWishingAward(curPlayer)
-    # 领取周狂欢活动奖励
-    elif rewardType == ChConfig.Def_RewardType_WeekPartyAct:
-        PlayerWeekParty.GetWeekPartyActionAward(curPlayer, dataEx, dataExStr)
-    # 领取周狂欢积分奖励
-    elif rewardType == ChConfig.Def_RewardType_WeekPartyPoint:
-        PlayerWeekParty.GetWeekPartyPointAward(curPlayer, dataEx, dataExStr)
     # 领取登录奖励活动奖励
     elif rewardType == ChConfig.Def_RewardType_ActLoginAwardAct:
         PlayerActLogin.GetLoginAwardActionAward(curPlayer, dataEx, dataExStr)
-    # 领取节日巡礼活动奖励
-    elif rewardType == ChConfig.Def_RewardType_FeastWeekPartyAct:
-        PlayerFeastWeekParty.GetFeastWeekPartyActionAward(curPlayer, dataEx, dataExStr)
-    # 领取节日巡礼积分奖励
-    elif rewardType == ChConfig.Def_RewardType_FeastWeekPartyPoint:
-        PlayerFeastWeekParty.GetFeastWeekPartyPointAward(curPlayer, dataEx, dataExStr)
     # 领取节日登录奖励
     elif rewardType == ChConfig.Def_RewardType_FeastLogin:
         PlayerFeastLogin.GetFeastLoginAward(curPlayer, dataEx)
@@ -3465,15 +3369,6 @@
     # 领取任务活动奖励
     elif rewardType == ChConfig.Def_RewardType_ActTask:
         PlayerActTask.OnGetActTaskAward(curPlayer, dataEx, dataExStr)
-    # 领取跨服充值排行活动达标奖励
-    elif rewardType == ChConfig.Def_RewardType_CACTGBillboardDabiao:
-        CrossActCTGBillboard.GetDabiaoAward(curPlayer, dataEx)
-    # 跨服全民充值奖励
-    elif rewardType == ChConfig.Def_RewardType_CAAllRecharge:
-        CrossActAllRecharge.GetCrossActAllRechargeAward(curPlayer, dataEx)
-    # 跨服妖魔boss伤害奖励
-    elif rewardType == ChConfig.Def_RewardType_CrossYaomoBossHurt:
-        PlayerCrossYaomoBoss.GetCrossYaomoBossHurtAward(curPlayer, dataEx, tick)
     # 买一送多活动免费奖励
     elif rewardType == ChConfig.Def_RewardType_BuyOne:
         PlayerActBuyOne.GetBuyOneFreeAward(curPlayer, dataEx, dataExStr)
@@ -4091,16 +3986,6 @@
     curPlayer.ChangePos(sendPack_SeverPosX, sendPack_SeverPosY)
     PyNotifyPlayerMove(curPlayer, moveDir, clientPosX, clientPosY, sendPack_SeverPosX, sendPack_SeverPosY, moveType)
     curPlayer.SetClientMoveTick(sendPack_WorldTick)
-    
-    # 后面必须返回True
-    fightPet = curPlayer.GetPetMgr().GetFightPet()
-    if fightPet:
-        #出战宠物同时移动
-        if moveType == 0 or tick - fightPet.GetActionTick() > 300:
-    
-            PetControl.FightPetFollowMove(curPlayer,sendPack_SeverPosX, sendPack_SeverPosY)
-            fightPet.SetCurAction(IPY_GameWorld.laNPCNull)
-            
     return True
 
 

--
Gitblit v1.8.0