From 758c00df67da77c14c0b84390a23d49c3e64429a Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期三, 15 十月 2025 17:00:33 +0800
Subject: [PATCH] 66 【公会】基础主体-服务端(增加称号同步:公会成员A520 A522,排行榜Value2,演武场匹配A922; 修复演武场战斗日志记录json格式错误bug;)
---
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerFamily.py | 18 ++++++
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/DB/StructData/DBGameRec.py | 6 +-
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py | 79 +++++++++++++++++++++++++-
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerViewCache.py | 8 +-
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerBillboard.py | 7 +-
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/DB/StructData/DBFamily.py | 26 ++++----
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_Arena.py | 2
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerArena.py | 1
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/PyMongoDB/LogicProcess/UserCtrlDB.py | 1
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/PyMongoDB/Collections/DataServerPlayerData.py | 9 ++
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerOnline.py | 2
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerFace.py | 5 +
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerControl.py | 5 +
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/DB/DBStruct.py | 4 +
14 files changed, 144 insertions(+), 29 deletions(-)
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py
index bae733d..465a0be 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py
@@ -13021,6 +13021,7 @@
RealmLV = 0 #(BYTE RealmLV)//境界
Face = 0 #(DWORD Face)//基本脸型
FacePic = 0 #(DWORD FacePic)//头像框
+ TitleID = 0 #(DWORD TitleID)//称号
FightPower = 0 #(DWORD FightPower)//战力,求余亿部分
FightPowerEx = 0 #(DWORD FightPowerEx)//战力,整除亿部分
ServerID = 0 #(DWORD ServerID)//所属区服ID
@@ -13042,6 +13043,7 @@
self.RealmLV,_pos = CommFunc.ReadBYTE(_lpData, _pos)
self.Face,_pos = CommFunc.ReadDWORD(_lpData, _pos)
self.FacePic,_pos = CommFunc.ReadDWORD(_lpData, _pos)
+ self.TitleID,_pos = CommFunc.ReadDWORD(_lpData, _pos)
self.FightPower,_pos = CommFunc.ReadDWORD(_lpData, _pos)
self.FightPowerEx,_pos = CommFunc.ReadDWORD(_lpData, _pos)
self.ServerID,_pos = CommFunc.ReadDWORD(_lpData, _pos)
@@ -13058,6 +13060,7 @@
self.RealmLV = 0
self.Face = 0
self.FacePic = 0
+ self.TitleID = 0
self.FightPower = 0
self.FightPowerEx = 0
self.ServerID = 0
@@ -13078,6 +13081,7 @@
length += 4
length += 4
length += 4
+ length += 4
length += 1
return length
@@ -13093,6 +13097,7 @@
data = CommFunc.WriteBYTE(data, self.RealmLV)
data = CommFunc.WriteDWORD(data, self.Face)
data = CommFunc.WriteDWORD(data, self.FacePic)
+ data = CommFunc.WriteDWORD(data, self.TitleID)
data = CommFunc.WriteDWORD(data, self.FightPower)
data = CommFunc.WriteDWORD(data, self.FightPowerEx)
data = CommFunc.WriteDWORD(data, self.ServerID)
@@ -13110,6 +13115,7 @@
RealmLV:%d,
Face:%d,
FacePic:%d,
+ TitleID:%d,
FightPower:%d,
FightPowerEx:%d,
ServerID:%d,
@@ -13125,6 +13131,7 @@
self.RealmLV,
self.Face,
self.FacePic,
+ self.TitleID,
self.FightPower,
self.FightPowerEx,
self.ServerID,
@@ -13755,6 +13762,7 @@
RealmLV = 0 #(BYTE RealmLV)//境界
Face = 0 #(DWORD Face)//基本脸型
FacePic = 0 #(DWORD FacePic)//头像框
+ TitleID = 0 #(DWORD TitleID)//称号
FightPower = 0 #(DWORD FightPower)//战力,求余亿部分
FightPowerEx = 0 #(DWORD FightPowerEx)//战力,整除亿部分
ServerID = 0 #(DWORD ServerID)//所属区服ID
@@ -13781,6 +13789,7 @@
self.RealmLV,_pos = CommFunc.ReadBYTE(_lpData, _pos)
self.Face,_pos = CommFunc.ReadDWORD(_lpData, _pos)
self.FacePic,_pos = CommFunc.ReadDWORD(_lpData, _pos)
+ self.TitleID,_pos = CommFunc.ReadDWORD(_lpData, _pos)
self.FightPower,_pos = CommFunc.ReadDWORD(_lpData, _pos)
self.FightPowerEx,_pos = CommFunc.ReadDWORD(_lpData, _pos)
self.ServerID,_pos = CommFunc.ReadDWORD(_lpData, _pos)
@@ -13802,6 +13811,7 @@
self.RealmLV = 0
self.Face = 0
self.FacePic = 0
+ self.TitleID = 0
self.FightPower = 0
self.FightPowerEx = 0
self.ServerID = 0
@@ -13830,6 +13840,7 @@
length += 4
length += 4
length += 4
+ length += 4
length += 1
length += 4
@@ -13847,6 +13858,7 @@
data = CommFunc.WriteBYTE(data, self.RealmLV)
data = CommFunc.WriteDWORD(data, self.Face)
data = CommFunc.WriteDWORD(data, self.FacePic)
+ data = CommFunc.WriteDWORD(data, self.TitleID)
data = CommFunc.WriteDWORD(data, self.FightPower)
data = CommFunc.WriteDWORD(data, self.FightPowerEx)
data = CommFunc.WriteDWORD(data, self.ServerID)
@@ -13869,6 +13881,7 @@
RealmLV:%d,
Face:%d,
FacePic:%d,
+ TitleID:%d,
FightPower:%d,
FightPowerEx:%d,
ServerID:%d,
@@ -13889,6 +13902,7 @@
self.RealmLV,
self.Face,
self.FacePic,
+ self.TitleID,
self.FightPower,
self.FightPowerEx,
self.ServerID,
@@ -17400,6 +17414,7 @@
FightPowerEx = 0 #(DWORD FightPowerEx)//战力整除亿部分
Face = 0 #(DWORD Face)//基本脸型
FacePic = 0 #(DWORD FacePic)//头像框
+ TitleID = 0 #(DWORD TitleID)//称号
data = None
def __init__(self):
@@ -17415,6 +17430,7 @@
self.FightPowerEx,_pos = CommFunc.ReadDWORD(_lpData, _pos)
self.Face,_pos = CommFunc.ReadDWORD(_lpData, _pos)
self.FacePic,_pos = CommFunc.ReadDWORD(_lpData, _pos)
+ self.TitleID,_pos = CommFunc.ReadDWORD(_lpData, _pos)
return _pos
def Clear(self):
@@ -17425,6 +17441,7 @@
self.FightPowerEx = 0
self.Face = 0
self.FacePic = 0
+ self.TitleID = 0
return
def GetLength(self):
@@ -17432,6 +17449,7 @@
length += 4
length += 33
length += 2
+ length += 4
length += 4
length += 4
length += 4
@@ -17448,6 +17466,7 @@
data = CommFunc.WriteDWORD(data, self.FightPowerEx)
data = CommFunc.WriteDWORD(data, self.Face)
data = CommFunc.WriteDWORD(data, self.FacePic)
+ data = CommFunc.WriteDWORD(data, self.TitleID)
return data
def OutputString(self):
@@ -17458,7 +17477,8 @@
FightPower:%d,
FightPowerEx:%d,
Face:%d,
- FacePic:%d
+ FacePic:%d,
+ TitleID:%d
'''\
%(
self.PlayerID,
@@ -17467,7 +17487,8 @@
self.FightPower,
self.FightPowerEx,
self.Face,
- self.FacePic
+ self.FacePic,
+ self.TitleID
)
return DumpString
@@ -52354,4 +52375,56 @@
m_NAtagMCStartEnterCrossServer=tagMCStartEnterCrossServer()
-ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCStartEnterCrossServer.Cmd,m_NAtagMCStartEnterCrossServer.SubCmd))] = m_NAtagMCStartEnterCrossServer
\ No newline at end of file
+ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCStartEnterCrossServer.Cmd,m_NAtagMCStartEnterCrossServer.SubCmd))] = m_NAtagMCStartEnterCrossServer
+
+
+#------------------------------------------------------
+# C2 01 跨服服务器间的测试包 #tagSSTest
+
+class tagSSTest(Structure):
+ _pack_ = 1
+ _fields_ = [
+ ("Cmd", c_ubyte),
+ ("SubCmd", c_ubyte),
+ ("Data", c_int), #测试
+ ]
+
+ def __init__(self):
+ self.Clear()
+ self.Cmd = 0xC2
+ self.SubCmd = 0x01
+ return
+
+ def ReadData(self, stringData, _pos=0, _len=0):
+ self.Clear()
+ memmove(addressof(self), stringData[_pos:], self.GetLength())
+ return _pos + self.GetLength()
+
+ def Clear(self):
+ self.Cmd = 0xC2
+ self.SubCmd = 0x01
+ self.Data = 0
+ return
+
+ def GetLength(self):
+ return sizeof(tagSSTest)
+
+ def GetBuffer(self):
+ return string_at(addressof(self), self.GetLength())
+
+ def OutputString(self):
+ DumpString = '''// C2 01 跨服服务器间的测试包 //tagSSTest:
+ Cmd:%s,
+ SubCmd:%s,
+ Data:%d
+ '''\
+ %(
+ self.Cmd,
+ self.SubCmd,
+ self.Data
+ )
+ return DumpString
+
+
+m_NAtagSSTest=tagSSTest()
+ChNetPackDict[eval("0x%02x%02x"%(m_NAtagSSTest.Cmd,m_NAtagSSTest.SubCmd))] = m_NAtagSSTest
\ No newline at end of file
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/DB/DBStruct.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/DB/DBStruct.py
index 21833b2..52484e8 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/DB/DBStruct.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/DB/DBStruct.py
@@ -907,6 +907,7 @@
('ContribDay', ctypes.c_ulong),
('DonateCntTotal', ctypes.c_ulong),
('DonateCntDay', ctypes.c_ubyte),
+ ('TitleID', ctypes.c_ulong),
('ADOResult', ctypes.c_ulong),
]
@@ -942,6 +943,7 @@
self.ContribDay, pos = CommFunc.ReadDWORD(buf, pos)
self.DonateCntTotal, pos = CommFunc.ReadDWORD(buf, pos)
self.DonateCntDay, pos = CommFunc.ReadBYTE(buf, pos)
+ self.TitleID, pos = CommFunc.ReadDWORD(buf, pos)
return self.getLength()
@@ -973,6 +975,7 @@
ContribDay = %s,
DonateCntTotal = %s,
DonateCntDay = %s,
+ TitleID = %s,
ADOResult = %s,
'''%(
self.PlayerID,
@@ -993,6 +996,7 @@
self.ContribDay,
self.DonateCntTotal,
self.DonateCntDay,
+ self.TitleID,
self.ADOResult,
)
return output
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/DB/StructData/DBFamily.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/DB/StructData/DBFamily.py
index ee25408..7d2b5b7 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/DB/StructData/DBFamily.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/DB/StructData/DBFamily.py
@@ -173,6 +173,7 @@
self.__dbData = DBStruct.tagDBFamilyMem() if not dbData else dbData
return
+ def GetFamily(self): return DBDataMgr.GetFamilyMgr().FindFamily(self.__dbData.FamilyID)
def GetPlayerID(self): return self.__dbData.PlayerID
def GetFamilyID(self): return self.__dbData.FamilyID
def GetJoinTime(self): return self.__dbData.JoinTime
@@ -188,6 +189,8 @@
def SetFace(self, face): self.__dbData.Face = face
def GetFacePic(self): return self.__dbData.FacePic
def SetFacePic(self, facePic): self.__dbData.FacePic = facePic
+ def GetTitleID(self): return self.__dbData.TitleID
+ def SetTitleID(self, titleID): self.__dbData.TitleID = titleID
def GetFightPower(self): return self.__dbData.FightPower
def GetFightPowerEx(self): return self.__dbData.FightPowerEx
def GetFightPowerTotal(self): return self.__dbData.FightPowerEx * ChConfig.Def_PerPointValue + self.__dbData.FightPower
@@ -224,12 +227,16 @@
self.SetRealmLV(viewCache.GetRealmLV())
self.SetFace(viewCache.GetFace())
self.SetFacePic(viewCache.GetFacePic())
+ self.SetTitleID(viewCache.GetTitleID())
self.SetServerID(viewCache.GetServerID())
fpChange = False
fightPowerTotal = viewCache.GetFightPowerTotal()
if self.GetFightPowerTotal() < fightPowerTotal:
self.SetFightPowerTotal(fightPowerTotal)
fpChange = True
+ family = self.GetFamily()
+ if family:
+ family.SetMemFightPowerChange()
return fpChange
def RefreshMember(self, curPlayer):
@@ -244,10 +251,15 @@
self.SetRealmLV(curPlayer.GetOfficialRank())
self.SetFace(curPlayer.GetFace())
self.SetFacePic(curPlayer.GetFacePic())
+ self.SetTitleID(PlayerControl.GetTitleID(curPlayer))
self.SetServerID(GameWorld.GetPlayerServerID(curPlayer))
fightPowerTotal = PlayerControl.GetFightPower(curPlayer)
fpChange = self.GetFightPowerTotal() != fightPowerTotal
self.SetFightPowerTotal(fightPowerTotal)
+ if fpChange:
+ family = self.GetFamily()
+ if family:
+ family.SetMemFightPowerChange()
return fpChange
class Family():
@@ -349,19 +361,7 @@
mem = FamilyMem()
return mem
- def RefreshFamilyMember(self, curPlayer):
- ## 刷新在线成员信息
- playerID = curPlayer.GetPlayerID()
- familyID = curPlayer.GetFamilyID()
- if self.GetID() != familyID:
- return
- member = self.FindMember(playerID)
- if not member:
- return
- if member.RefreshMember(curPlayer):
- self.__memFightPowerChange = True
- return
-
+ def SetMemFightPowerChange(self): self.__memFightPowerChange = True
def RefrshFightPowerTotal(self, checkChange=False):
## 刷新总战力
if checkChange and self.__memFightPowerChange == False: # 默认None,首次必刷新
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/DB/StructData/DBGameRec.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/DB/StructData/DBGameRec.py
index 0118ee1..9e5e0d5 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/DB/StructData/DBGameRec.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/DB/StructData/DBGameRec.py
@@ -107,10 +107,10 @@
@param dbData: 实例对应绑定的dbData
@return: 成功返回实例对象,失败返回None
'''
- dataToJson = False
- # 如果需要 dataToJson,可根据 RecType 在这里处理
+ dataToJson = True
+ # 默认使用 dataToJson,如果不需要的可根据 RecType 在这里处理
if dbData.RecType in []:
- dataToJson = True
+ dataToJson = False
recData = GameRecData(dbData, dataToJson)
self.__dataList.append(recData)
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_Arena.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_Arena.py
index 0b1393d..d073275 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_Arena.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_Arena.py
@@ -176,7 +176,7 @@
# 被击方
if tagPlayerID < ShareDefine.RealPlayerIDStart:
- GameWorld.DebugLog("目标非真实玩家不处理! tagPlayerID=%s" % tagPlayerID, playerID)
+ #GameWorld.DebugLog("目标非真实玩家不处理! tagPlayerID=%s" % tagPlayerID, playerID)
return
# 以战斗记录作为最新积分的更新记录,支持离线玩家上线后更新最新积分
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerArena.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerArena.py
index 4033b07..8ac66e3 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerArena.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerArena.py
@@ -336,6 +336,7 @@
matchInfo.FacePic = viewCache.GetFacePic()
matchInfo.FightPower = viewCache.GetFightPower()
matchInfo.FightPowerEx = viewCache.GetFightPowerEx()
+ matchInfo.TitleID = viewCache.GetTitleID()
else:
matchInfo.PlayerName = "p%s" % matchID
clientPack.MatchList.append(matchInfo)
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerBillboard.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerBillboard.py
index bde256f..67ca5a6 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerBillboard.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerBillboard.py
@@ -17,6 +17,7 @@
import GameWorld
import ShareDefine
+import PlayerControl
import ChPyNetSendPack
import NetPackCommon
import IpyGameDataPY
@@ -155,7 +156,7 @@
#
# return True
-def UpdatePlayerBillboard(curPlayer, bType, cmpValue, cmpValue2=0, cmpValue3=0, value1=None, value2=0, autoSort=False, **kwargs):
+def UpdatePlayerBillboard(curPlayer, bType, cmpValue, cmpValue2=0, cmpValue3=0, autoSort=False, **kwargs):
## 更新玩家排行榜
#if not cmpValue and not cmpValue2 and not cmpValue3:
@@ -165,8 +166,8 @@
playerID = curPlayer.GetID()
playerName = curPlayer.GetPlayerName()
playerOpInfo = GetBillboardOperateInfo(curPlayer)
- if value1 == None:
- value1 = curPlayer.GetOfficialRank()
+ value1 = curPlayer.GetOfficialRank()
+ value2 = PlayerControl.GetTitleID(curPlayer)
kwargs["value3"] = curPlayer.GetFace()
kwargs["value4"] = curPlayer.GetFacePic()
kwargs["value5"] = curPlayer.GetModelMark()
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerControl.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerControl.py
index f2e7c54..97f1f95 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerControl.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerControl.py
@@ -4408,7 +4408,10 @@
## 获取佩戴的称号ID
def GetTitleID(curPlayer): return curPlayer.GetExAttr3()
-def SetTitleID(curPlayer, titleID): curPlayer.SetExAttr3(titleID, False, False)
+def SetTitleID(curPlayer, titleID):
+ curPlayer.SetExAttr3(titleID, False, False)
+ PlayerFamily.RefreshFamilyMember(curPlayer)
+ return
## 协助目标玩家ID
def GetAssistTagPlayerID(curPlayer): return 0
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerFace.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerFace.py
index e1c405f..e252abc 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerFace.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerFace.py
@@ -16,6 +16,7 @@
#-------------------------------------------------------------------------------
import GameWorld
+import PlayerFamily
import PlayerControl
import IPY_GameWorld
import ChPyNetSendPack
@@ -148,6 +149,7 @@
randFace = random.choice(defaultFaceIDList) if defaultFaceIDList else 0
curPlayer.SetFace(randFace)
GameWorld.DebugLog("玩家佩戴的头像被删除,随机重置默认头像! randFace=%s" % randFace, playerID)
+ PlayerFamily.RefreshFamilyMember(curPlayer)
if isRefreshAttr:
RefreshFaceAttr(curPlayer)
@@ -198,6 +200,7 @@
return
GameWorld.DebugLog("头像幻化! faceID=%s" % (faceID), playerID)
curPlayer.SetFace(faceID)
+ PlayerFamily.RefreshFamilyMember(curPlayer)
return
def OnFaceStarUP(curPlayer, faceID):
@@ -351,6 +354,7 @@
randFacePic = random.choice(defaultFacePicIDList) if defaultFacePicIDList else 0
curPlayer.SetFacePic(randFacePic)
GameWorld.DebugLog("玩家佩戴的头像框过期,随机重置默认头像框! randFacePic=%s" % randFacePic, playerID)
+ PlayerFamily.RefreshFamilyMember(curPlayer)
if isRefreshAttr:
RefreshFacePicAttr(curPlayer)
@@ -396,6 +400,7 @@
return
GameWorld.DebugLog("头像框幻化! facePicID=%s" % (facePicID), playerID)
curPlayer.SetFacePic(facePicID)
+ PlayerFamily.RefreshFamilyMember(curPlayer)
return
def OnFacePicStarUP(curPlayer, facePicID):
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerFamily.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerFamily.py
index e5b7047..f00bd6d 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerFamily.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerFamily.py
@@ -180,6 +180,22 @@
PlayerFamilyEmblem.CheckExpireEmblem()
return
+def RefreshFamilyMember(curPlayer):
+ ## 玩家成员相关属性变更时同步更新家族成员信息
+ familyID = curPlayer.GetFamilyID()
+ if not familyID:
+ return
+ familyMgr = DBDataMgr.GetFamilyMgr()
+ family = familyMgr.FindFamily(familyID)
+ if not family:
+ return
+ playerID = curPlayer.GetPlayerID()
+ member = family.FindMember(playerID)
+ if not member:
+ return
+ member.RefreshMember(curPlayer)
+ return
+
#// A6 04 创建家族 #tagCMCreateFamily
#
#struct tagCMCreateFamily
@@ -506,6 +522,7 @@
memInfo.RealmLV = member.GetRealmLV()
memInfo.Face = member.GetFace()
memInfo.FacePic = member.GetFacePic()
+ memInfo.TitleID = member.GetTitleID()
memInfo.FightPower = member.GetFightPower()
memInfo.FightPowerEx = member.GetFightPowerEx()
memInfo.FmLV = member.GetFmLV()
@@ -776,6 +793,7 @@
reqInfo.RealmLV = viewCache.GetRealmLV()
reqInfo.Face = viewCache.GetFace()
reqInfo.FacePic = viewCache.GetFacePic()
+ reqInfo.TitleID = viewCache.GetTitleID()
reqInfo.FightPower = viewCache.GetFightPower()
reqInfo.FightPowerEx = viewCache.GetFightPowerEx()
reqInfo.ServerID = viewCache.GetServerID()
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerOnline.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerOnline.py
index fb9f7fa..d140f9c 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerOnline.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerOnline.py
@@ -24,6 +24,7 @@
import IpyGameDataPY
import FormulaControl
import PlayerPrestigeSys
+import PlayerFamily
import PlayerGubao
import PlayerHero
import PlayerHJG
@@ -824,6 +825,7 @@
else:
GameWorld.DebugLog("主阵容没有在战斗中,不需要处理", playerID)
+ PlayerFamily.RefreshFamilyMember(curPlayer) # 更新公会
# 更新排行榜
return
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerViewCache.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerViewCache.py
index f5c5daf..a6c0330 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerViewCache.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerViewCache.py
@@ -208,11 +208,11 @@
curCache.SetFace(curPlayer.GetFace())
curCache.SetFacePic(curPlayer.GetFacePic())
curCache.SetModelMark(curPlayer.GetModelMark())
+ curCache.SetTitleID(PlayerControl.GetTitleID(curPlayer))
curCache.SetFamilyID(familyID)
curCache.SetFamilyName(family.GetName() if family else "")
curCache.SetFamilyEmblemID(family.GetEmblemID() if family else 0)
curCache.SetFamilyEmblemWord(family.GetEmblemWord() if family else "")
- curCache.SetTitleID(PlayerControl.GetTitleID(curPlayer))
curCache.SetFightPowerTotal(PlayerControl.GetFightPower(curPlayer))
curCache.SetServerID(GameWorld.GetPlayerServerID(curPlayer))
if isOffline:
@@ -240,7 +240,7 @@
# 其他
- plusDict= {"Equip":equipDict, "Lineup":lineupDict}
+ plusDict = {"Equip":equipDict, "Lineup":lineupDict}
curCache.SetPlusDict(plusDict)
return curCache
@@ -267,12 +267,12 @@
curCache.SetFace(dbPlayer.Face)
curCache.SetFacePic(dbPlayer.FacePic)
curCache.SetModelMark(dbPlayer.ModelMark)
+ curCache.SetTitleID(dbPlayer.ExAttr3)
curCache.SetFamilyID(familyID)
family = DBDataMgr.GetFamilyMgr().FindFamily(familyID) if familyID else None
curCache.SetFamilyName(family.GetName() if family else "")
curCache.SetFamilyEmblemID(family.GetEmblemID() if family else 0)
curCache.SetFamilyEmblemWord(family.GetEmblemWord() if family else "")
- #curCache.SetTitleID(PlayerControl.GetTitleID(curPlayer))
curCache.SetFightPowerTotal(dbPlayer.FightPowerEx * ChConfig.Def_PerPointValue + dbPlayer.FightPower)
curCache.SetServerID(GameWorld.GetAccIDServerID(dbPlayer.AccID))
curCache.SetOffTime(GameWorld.ChangeTimeStrToNum(dbPlayer.LogoffTime) if dbPlayer.LogoffTime else 0)
@@ -289,6 +289,7 @@
"RealmLV" : curCache.GetRealmLV(),
"Face" : curCache.GetFace(),
"FacePic" : curCache.GetFacePic(),
+ "TitleID" : curCache.GetTitleID(),
"ModelMark" : curCache.GetModelMark(),
"FightPower" : curCache.GetFightPowerTotal(),
"PlusData" : curCache.GetPlusDict(),
@@ -317,6 +318,7 @@
curCache.SetRealmLV(robotInfo.get("RealmLV", 0))
curCache.SetFace(robotInfo.get("Face", 0))
curCache.SetFacePic(robotInfo.get("FacePic", 0))
+ curCache.SetTitleID(robotInfo.get("TitleID", 0))
curCache.SetModelMark(robotInfo.get("ModelMark", 0))
#机器人暂定没有仙盟、称号
#curCache.SetFamilyID(familyID)
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/PyMongoDB/Collections/DataServerPlayerData.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/PyMongoDB/Collections/DataServerPlayerData.py
index d4b4f01..d76dcac 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/PyMongoDB/Collections/DataServerPlayerData.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/PyMongoDB/Collections/DataServerPlayerData.py
@@ -27633,6 +27633,7 @@
('ContribDay', ctypes.c_ulong),
('DonateCntTotal', ctypes.c_ulong),
('DonateCntDay', ctypes.c_ubyte),
+ ('TitleID', ctypes.c_ulong),
('ADOResult', ctypes.c_ulong),
]
@@ -27671,6 +27672,7 @@
self.ContribDay, pos = CommFunc.ReadDWORD(buf, pos)
self.DonateCntTotal, pos = CommFunc.ReadDWORD(buf, pos)
self.DonateCntDay, pos = CommFunc.ReadBYTE(buf, pos)
+ self.TitleID, pos = CommFunc.ReadDWORD(buf, pos)
return self.getLength()
@@ -27703,6 +27705,7 @@
rec[u'ContribDay'] = self.ContribDay
rec[u'DonateCntTotal'] = self.DonateCntTotal
rec[u'DonateCntDay'] = self.DonateCntDay
+ rec[u'TitleID'] = self.TitleID
return rec
def readRecord(self, rec):
@@ -27725,6 +27728,7 @@
self.ContribDay = rec.get(u'ContribDay', 0)
self.DonateCntTotal = rec.get(u'DonateCntTotal', 0)
self.DonateCntDay = rec.get(u'DonateCntDay', 0)
+ self.TitleID = rec.get(u'TitleID', 0)
def adoLoad(self, collection):
'''使用KEY查找并读取'''
@@ -27894,6 +27898,7 @@
ContribDay = %s,
DonateCntTotal = %s,
DonateCntDay = %s,
+ TitleID = %s,
ADOResult = %s,
'''%(
self.PlayerID,
@@ -27914,12 +27919,13 @@
self.ContribDay,
self.DonateCntTotal,
self.DonateCntDay,
+ self.TitleID,
self.ADOResult,
)
return output
def dumpString(self):
- output = '''%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s'''%(
+ output = '''%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s'''%(
self.PlayerID,
self.FamilyID,
self.JoinTime,
@@ -27938,6 +27944,7 @@
self.ContribDay,
self.DonateCntTotal,
self.DonateCntDay,
+ self.TitleID,
)
return output
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/PyMongoDB/LogicProcess/UserCtrlDB.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/PyMongoDB/LogicProcess/UserCtrlDB.py
index 1e22643..fda4278 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/PyMongoDB/LogicProcess/UserCtrlDB.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/PyMongoDB/LogicProcess/UserCtrlDB.py
@@ -4138,7 +4138,6 @@
for i in xrange(0, recCnt):
rec.clear()
readLen = rec.readData(data, pos, len(data))
- rec.dumpString()
if -1 == readLen:
mylog.error('%s.%s readData failed, index = %s'%(self.__class__.__name_, inspect.stack()[0][3], i) )
raise CommonDefine.ShortBuf(collectionName) #如果读取出错,后面全错了
--
Gitblit v1.8.0