From d50410deaed69bc1a07dcb02b0816f9321a34a69 Mon Sep 17 00:00:00 2001
From: xdh <xiefantasy@qq.com>
Date: 星期五, 19 四月 2019 17:39:36 +0800
Subject: [PATCH] 6457 【后端】【2.0】缥缈仙域开发单(宝藏流程调整)
---
ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerCompensation.py | 47 ++++++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 46 insertions(+), 1 deletions(-)
diff --git a/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerCompensation.py b/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerCompensation.py
index 704baf5..e52e73f 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
@@ -853,11 +853,35 @@
return
+##清理超时30天的个人邮件, 否则流失玩家在不断合服情况下数据会累积
+# 个人邮件暂无过期时间设定,只有30天清理逻辑,以创建时间为准
+# @param None
+# @return None
+def ClearUpPersonalCompensation():
+ #校验过期补偿
+ curTime = datetime.datetime.today()
+ needClearGUIDList = []
+ allCnt = GameWorld.GetCompensationMgr().GetAllPersonalCompensationCount()
+ for i in xrange(allCnt):
+ curMail = GameWorld.GetCompensationMgr().AtAllPersonalCompensation(i)
+ # 超过接收邮件30天则完全删除此邮件
+ limitTime = datetime.datetime.strptime(curMail.CreateTime, ChConfig.TYPE_Time_Format) + datetime.timedelta(days = 30)
+ if limitTime < curTime:
+ needClearGUIDList.append([curMail.PlayerID, curMail.GUID])
+
+ GameWorld.Log("ClearUpPersonalCompensation count=%s"%len(needClearGUIDList))
+
+ #删除过期补偿信息, 没有主动通知在线玩家
+ for playerID, GUID in needClearGUIDList:
+ ClearPersonalCompensation(playerID, GUID)
+ return
+
## 清理超时补偿, 个人邮件在超过上限后才会自动删除
# @param None
# @return None
def ClearUpTimeOutCompensation():
+ ClearUpPersonalCompensation()
ClearUpEntireCompensation()
return
@@ -913,6 +937,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 +957,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