| | |
| | | itemObj = MailItem()
|
| | | return itemObj
|
| | |
|
| | | def GetMailItemList(self, guid):
|
| | | if guid not in self.__mailItemDict:
|
| | | return []
|
| | | itemList = []
|
| | | for mailItem in self.__mailItemDict[guid]:
|
| | | itemID = mailItem.GetItemID()
|
| | | itemCount = mailItem.GetCount()
|
| | | isBind = mailItem.GetIsBind()
|
| | | userData = mailItem.GetUserData()
|
| | | itemInfo = [itemID, itemCount, isBind]
|
| | | if userData:
|
| | | itemInfo.append(userData)
|
| | | itemList.append(itemInfo)
|
| | | return itemList
|
| | | |
| | | def AddServerMail(self, guid, title, text, itemList, limitDays=7, mailType=0):
|
| | | '''添加个人邮件
|
| | | @param guid: 指定的邮件guid,为空时自动生成新guid
|
| | | @param itemList: 元素支持字典{k:v, ...} 或列表 [itemID, itemCount, 可选是否拍品, 物品UserData]
|
| | | '''
|
| | | mailObj = None
|
| | | if not guid:
|
| | | guid = GameWorld.GetGUID()
|
| | | if guid in self.__serverMailDict:
|
| | | # 已经存在的guid不允许重复插入全服邮件,防止多领取,后台发送全服邮件时如果重复推送到某个服务器就可能存在重复情况
|
| | | return mailObj
|
| | | dbData = DBStruct.tagDBMailServer()
|
| | | dbData.GUID = guid
|
| | | dbData.Type = mailType
|