From bc5f3f1c88d225109fa39a85b209ef13f5fb52a9 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期五, 06 二月 2026 21:28:13 +0800
Subject: [PATCH] 66 【公会】基础主体-服务端(跨服公会所有基本功能支持、跨服砍价支持;修改查看目标公会、查看目标玩家方式;)
---
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/ChPlayer.py | 37 +++++++++++++++++++++----------------
1 files changed, 21 insertions(+), 16 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 2deb268..a51bd7d 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/ChPlayer.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/ChPlayer.py
@@ -870,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:
--
Gitblit v1.8.0