From db9769e37b8e3c5f5a5346e9e4fb17c89614100b Mon Sep 17 00:00:00 2001
From: xdh <xiefantasy@qq.com>
Date: 星期三, 20 三月 2019 17:27:49 +0800
Subject: [PATCH] 6374 【后端】【2.0】删除无用功能代码、封包、配置(删除修复代码)

---
 ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerCompensation.py |   23 ++++++++++++++++++++++-
 1 files changed, 22 insertions(+), 1 deletions(-)

diff --git a/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerCompensation.py b/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerCompensation.py
index 704baf5..75bf6eb 100644
--- a/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerCompensation.py
+++ b/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerCompensation.py
@@ -77,7 +77,7 @@
     curItemData.ItemID = curItemDict['ItemID']
     curItemData.Count = curItemDict['Count']
     #curItemData.IsBind = curItemDict.get('IsBind',0)
-    curItemData.IsBind = 1 if not curItemDict.get('IsAuctionItem',0) else 0
+    curItemData.IsBind = curItemDict.get('IsAuctionItem',0)
     curItemData.UserData = curItemDict.get('UserData', '')
     return curItemData
 
@@ -913,6 +913,11 @@
     #在个人补偿中
     curPersonalCompensation = GameWorld.GetCompensationMgr().FindPersonalCompensation(curPlayerID, GUID)
     if curPersonalCompensation.PlayerID == curPlayerID:
+        if not CheckCanDelCompensation(curPersonalCompensation, GUID):
+            #有附件不可删除
+            NotifyCompensationResult(curPlayer, GUID, 0)
+            return
+        
         ClearPersonalCompensation(curPlayerID, GUID)
         NotifyCompensationResult(curPlayer, GUID, 1)
         #GameWorld.DebugLog("个人补偿中OnDelCompensation:%s"%GUID)
@@ -928,12 +933,28 @@
     #全服邮件
     curEntireRequire = GameWorld.GetCompensationMgr().FindEntireCompensation(GUID)
     if curEntireRequire.GUID == GUID:
+        if not CheckCanDelCompensation(curEntireRequire, GUID):
+            #有附件不可删除
+            NotifyCompensationResult(curPlayer, GUID, 0)
+            return
+        
         SetPrizeState(curPlayerID, GUID, Disable_State, GameWorld.GetCompensationMgr().FindPlayerRecState(curPlayerID, GUID)/10)
         NotifyCompensationResult(curPlayer, GUID, 1)
         #GameWorld.DebugLog("全服邮件OnDelCompensation:%s"%GUID)
         return
 
     NotifyCompensationResult(curPlayer, GUID, 0)
+       
+# 有附件的情况玩家不可主动删除邮件,避免误操作;系统可删除不用调用此接口
+def CheckCanDelCompensation(mailObj, GUID):
+    if mailObj.Gold or mailObj.GoldPaper or mailObj.Silver:
+        # 有附加货币不可删除
+        return False
+    
+    if GameWorld.GetCompensationMgr().FindItemCount(GUID):
+        # 有附件物品不可删除
+        return False
+    return True
         
 # 邮件删除情况   
 def NotifyCompensationResult(curPlayer, GUID, result):    

--
Gitblit v1.8.0