| | |
| | | #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()
|
| | |
| | | @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):
|
| | | ## 审核全服邮件结果
|
| | |
| | | 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
|
| | |
|
| | |
| | | Sync_PlayerMailState(curPlayer, notifyGUIDState)
|
| | | return
|
| | |
|
| | | def doMailDel(curPlayer, guid, isGM=False):
|
| | | def doMailDel(curPlayer, guid, isGM=False, playerID=0):
|
| | | ## 执行邮件删除
|
| | | # @param isGM: 是否GM删除,无视物品是否已领取,强制删除
|
| | |
|
| | | if curPlayer:
|
| | | playerID = curPlayer.GetPlayerID()
|
| | | mailMgr = DBDataMgr.GetMailMgr()
|
| | |
|
| | |
| | | DataRecordPack.DR_MailDel(playerID, guid, "GMDel")
|
| | | # 这里玩家主动删除的可不记录流向,因为未读未领取不允许主动删除,已领取的已有领取记录,所以可不记录
|
| | |
|
| | | if curPlayer:
|
| | | Sync_PlayerMailState(curPlayer, notifyGUIDState)
|
| | | return
|
| | |
|