From ffa8a645ed6a92a3c723bbf5c7f1eb4d5425c826 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期三, 17 十一月 2021 15:15:34 +0800
Subject: [PATCH] 9341 【BT5】【主干】【后端】情缘系统(优化情缘系统)

---
 ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerFriend.py |   30 ++++++++++++++++++++++++++----
 1 files changed, 26 insertions(+), 4 deletions(-)

diff --git a/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerFriend.py b/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerFriend.py
index c971cf3..f8cadde 100644
--- a/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerFriend.py
+++ b/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerFriend.py
@@ -214,9 +214,9 @@
         GameWorld.Log('DeleteFriend -> 封包异常 ->没有这个玩家', playerID)
         return
     
-    coupleID = PlayerControl.GetCoupleID(curPlayer)
-    if coupleID == friendID:
-        GameWorld.Log('DeleteFriend -> 封包异常 ->伴侣不能删除好友,coupleID=%s' % coupleID, playerID)
+    couple = PyDataManager.GetDBPyCoupleManager().GetCouple(playerID)
+    if couple and couple.GetCoupleID(playerID) == friendID:
+        GameWorld.Log('DeleteFriend -> 封包异常 ->伴侣不能删除好友.friendID=%s' % friendID, playerID)
         return
     
     #离线好友同时删除记录
@@ -229,6 +229,12 @@
     if tagPlayer != None:
         PlayerControl.NotifyCode(tagPlayer, 'Friend_DeleteFriend2', [curPlayer.GetName()])
     PlayerTeam.OnTeamMemFriendChange(curPlayer, friendID, False)
+    
+    # 亲密度减少
+    decIntimacyPer = IpyGameDataPY.GetFuncCfg("IntimacyReduce", 1)
+    if decIntimacyPer:
+        PyDataManager.GetIntimacyManager().DelIntimacyBothPer(playerID, friendID, decIntimacyPer)
+        
     return
 
 
@@ -394,7 +400,8 @@
     #    return
     #===========================================================================
     
-    if tagID == PlayerControl.GetCoupleID(curPlayer):
+    couple = PyDataManager.GetDBPyCoupleManager().GetCouple(curPlayer.GetID())
+    if couple and couple.GetCoupleID(curPlayer.GetID()) == tagID:
         GameWorld.DebugLog("伴侣不能加入黑名单! tagID=%s" % tagID, curPlayer.GetID())
         return
     
@@ -419,6 +426,11 @@
     
     PlayerControl.NotifyCode(curPlayer, 'AddBlackList', [playerName])
     
+    # 亲密度减少
+    decIntimacyPer = IpyGameDataPY.GetFuncCfg("IntimacyReduce", 2)
+    if decIntimacyPer:
+        PyDataManager.GetIntimacyManager().DelIntimacyBothPer(curPlayer.GetPlayerID(), tagID, decIntimacyPer)
+        
     return
 
 
@@ -482,6 +494,15 @@
     players.Sync_SocialsInfo(curPlayer)
     return
 
+#亲密
+def __OnPlayerLoginIntimacylist(curPlayer, tick):
+    intimacys = PyDataManager.GetIntimacyManager().GetIntimacys(curPlayer.GetID())
+    if intimacys == None:
+        return
+    
+    intimacys.Sync_SocialsInfo(curPlayer)
+    return
+
 ## 玩家登陆
 #  @param curPlayer 当前玩家
 #  @param tick 当前时间
@@ -495,6 +516,7 @@
     __OnPlayerLoginEnemy(curPlayer, tick)
     __OnPlayerLoginContacts(curPlayer, tick)
     __OnPlayerLoginBlacklist(curPlayer, tick)
+    __OnPlayerLoginIntimacylist(curPlayer, tick)
     
     # 向当前玩家通知相关联的所有玩家信息
     PlayerSocial.Sync_AllSocialsInfo(curPlayer)

--
Gitblit v1.8.0