From fff7319fd0fb06d03364c5be64edc5bc22e1fe3f Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期四, 28 八月 2025 18:04:18 +0800
Subject: [PATCH] 129 【战斗】战斗系统-服务端(NPC支持成长属性;NPC支持关联武将;)
---
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerMail.py | 29 +++++++++++++++++++++++------
1 files changed, 23 insertions(+), 6 deletions(-)
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerMail.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerMail.py
index 0d938da..184f1f3 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerMail.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerMail.py
@@ -56,13 +56,15 @@
#GameWorld.DebugLog("全服邮件未超时,不删除! %s,createTime=%s,limitTime=%s" % (guid, mailObj.GetCreateTime(), GameWorld.ChangeTimeNumToStr(limitTime)))
continue
- DelServerMail(guid)
+ DelServerMail(guid, "Timeout")
return
-def DelServerMail(guid):
+def DelServerMail(guid, delEvent=""):
+ GameWorld.Log("删除全服邮件: %s" % (guid))
mailMgr = DBDataMgr.GetMailMgr()
playerStateDict = mailMgr.DelServerMail(guid)
+ DataRecordPack.DR_ServerMail(guid, "Delete" + delEvent)
if not playerStateDict:
return
playerMgr = GameWorld.GetPlayerManager()
@@ -171,18 +173,27 @@
def SendSeverMail(guid, title, text, itemList=None, limitDays=7, mailType=0, limitLV=0, limitLVType=0, checkState=0):
'''发送全服邮件
+ @param guid: 可传入空,则系统自动生成guid
@param limitLV: 限制可领的最低等级
@param limitLVType: 等级达到后是否可领,默认不可
@param checkState: 是否需要审核,默认不需要
+ @return: None - 发送失败; mailObj - 成功发送的邮件实例
'''
mailMgr = DBDataMgr.GetMailMgr()
mailObj = mailMgr.AddServerMail(guid, title, text, itemList, limitDays, mailType)
+ if not mailObj:
+ return mailObj
+ GUID = mailObj.GetGUID()
mailObj.SetLimitLV(limitLV)
mailObj.SetLimitLVType(limitLVType)
mailObj.SetCheckState(checkState)
+ eventName = "Add" if not checkState else "AddToCheck"
+ addDict = {"LimitDays":limitDays, "LimitLV":limitLV, "LimitLVType":limitLVType, "CheckState":checkState,
+ "title":title, "Text":text, "ItemList":itemList}
+ DataRecordPack.DR_ServerMail(GUID, eventName, addDict)
if not checkState:
Sync_ServerMail(mailObj.GetGUID())
- return
+ return mailObj
def CheckServerMailResult(guid, isOK):
## 审核全服邮件结果
@@ -192,8 +203,12 @@
if not mailObj:
return
if not isOK:
+ # 审核不通过的直接删除
+ DelServerMail(guid, "GMDel")
return
+ GameWorld.Log("全服邮件审核通过: %s" % guid)
mailObj.SetCheckState(0) # 设置为0,不需要审核了,即通过
+ DataRecordPack.DR_ServerMail(guid, "CheckOK")
Sync_ServerMail(guid)
return
@@ -324,11 +339,12 @@
Sync_PlayerMailState(curPlayer, notifyGUIDState)
return
-def doMailDel(curPlayer, guid, isGM=False):
+def doMailDel(curPlayer, guid, isGM=False, playerID=0):
## 执行邮件删除
# @param isGM: 是否GM删除,无视物品是否已领取,强制删除
- playerID = curPlayer.GetPlayerID()
+ if curPlayer:
+ playerID = curPlayer.GetPlayerID()
mailMgr = DBDataMgr.GetMailMgr()
# 批量处理,仅针对个人邮件
@@ -356,7 +372,8 @@
DataRecordPack.DR_MailDel(playerID, guid, "GMDel")
# 这里玩家主动删除的可不记录流向,因为未读未领取不允许主动删除,已领取的已有领取记录,所以可不记录
- Sync_PlayerMailState(curPlayer, notifyGUIDState)
+ if curPlayer:
+ Sync_PlayerMailState(curPlayer, notifyGUIDState)
return
def Sync_ServerMail(guid):
--
Gitblit v1.8.0