From 4180ba5f28c47d15a33d99973e2034f5337ab3fc Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期二, 20 十二月 2022 17:04:17 +0800
Subject: [PATCH] 9731 【越南】【主干】【BT7】【BT8】转职业(转职附加重置灵根属性点)
---
ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerSocial.py | 36 +++++++++++++++++++++++++++++++++++-
1 files changed, 35 insertions(+), 1 deletions(-)
diff --git a/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerSocial.py b/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerSocial.py
index 6b70901..0ad02c8 100644
--- a/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerSocial.py
+++ b/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerSocial.py
@@ -38,6 +38,9 @@
# 添加社交对象
def Add(self, tagID, isNotify=True):
+ if not PlayerControl.GetDBPlayerAccIDByID(tagID):
+ GameWorld.ErrLog("试图添加非本服玩家社交对象: tagID=%s,GroupType=%s" % (tagID, self.GroupType))
+ return False
GameWorld.DebugLog("SocialPlayers----Add %s-%s-%s"%(self.GroupType, self.PlayerID, tagID))
if tagID in self.SocialDict:
GameWorld.DebugLog("SocialPlayers----Add 重复")
@@ -329,6 +332,8 @@
if not curPlayer:
return nowIntimacy
+ self.__SyncMapServerCoupleIntimacy(curPlayer, tagID)
+
tagName = ""
socialPlayer = PyDataManager.GetPersonalSocialManager().GetSocialPlayer(tagID)
if socialPlayer:
@@ -349,8 +354,31 @@
return 0
intimacyObj.Intimacy = setValue
if curPlayer:
+ self.__SyncMapServerCoupleIntimacy(curPlayer, tagID)
self.Sync_SocialsInfo(curPlayer, [tagID])
return intimacyObj.Intimacy
+
+ def __SyncMapServerCoupleIntimacy(self, curPlayer, tagID):
+ ## 同步地图玩家伴侣亲密度
+ playerID = curPlayer.GetPlayerID()
+ couple = PyDataManager.GetDBPyCoupleManager().GetCouple(playerID)
+ if not couple:
+ return
+ if couple.GetCoupleID(playerID) != tagID:
+ return
+ self.SyncMapServerIntimacy(curPlayer, tagID)
+ return
+
+ def SyncMapServerIntimacy(self, curPlayer, tagID):
+ ## 同步地图玩家伴侣亲密度
+ playerID = curPlayer.GetPlayerID()
+ intimacyValue = 0
+ intimacyObj = self.GetIntimacyObj(tagID)
+ if intimacyObj:
+ intimacyValue = intimacyObj.Intimacy
+ cmdInfo = ["SyncMapServerIntimacy", [tagID, intimacyValue]]
+ PlayerControl.MapServer_QueryPlayer_DoLogic(curPlayer, "Love", cmdInfo, playerID)
+ return
# 整个游戏的亲密管理
class IntimacyManager(object):
@@ -399,6 +427,9 @@
# 获取亲密组
def GetIntimacys(self, playerID):
+ if not PlayerControl.GetDBPlayerAccIDByID(playerID):
+ GameWorld.ErrLog("试图获取非本服玩家亲密组: playerID=%s" % playerID)
+ return
if playerID not in self.PlayerIntimacys:
self.PlayerIntimacys[playerID] = Intimacys(playerID)
return self.PlayerIntimacys[playerID]
@@ -925,7 +956,10 @@
savaData = ""
cntData = ""
cnt = 0
- for socialPlayer in self.SocialInfo.values():
+ for playerID, socialPlayer in self.SocialInfo.items():
+ if PyGameData.g_dbPlayerIDMap and not PlayerControl.GetDBPlayerAccIDByID(playerID):
+ GameWorld.ErrLog("非本服社交玩家,不存档! playerID=%s" % playerID)
+ continue
cnt += 1
savaData += socialPlayer.playerInfo.getBuffer()
--
Gitblit v1.8.0