| | |
| | |
|
| | | return successGUIDList
|
| | |
|
| | | def SendEntireMail(mailTypeKey, getDays, limitLV, limitLVType, addItemList=[], paramList=[], \
|
| | | gold=0, goldPaper=0, silver=0, detail="", moneySource=ChConfig.Def_GiveMoney_Mail, GUID=""):
|
| | | ''' 发送全服邮件
|
| | | @param mailTypeKey: 邮件模板key
|
| | | @param getDays: 有效天数
|
| | | @param limitLV: 领取最低等级限制
|
| | | @param limitLVType: 等级不足的升级后是否可领 0-不可,1-可以
|
| | | '''
|
| | | |
| | | if not mailTypeKey or getDays <= 0:
|
| | | return
|
| | | |
| | | addItemDictList = []
|
| | | for itemInfo in addItemList:
|
| | | if isinstance(itemInfo, dict):
|
| | | addItemDictList.append(itemInfo)
|
| | | continue
|
| | | |
| | | if len(itemInfo) == 3:
|
| | | itemID, itemCnt, isAuctionItem = itemInfo
|
| | | else:
|
| | | continue
|
| | | |
| | | addItemDict = {}
|
| | | addItemDict['ItemID'] = itemID
|
| | | addItemDict['Count'] = itemCnt
|
| | | addItemDict['IsAuctionItem'] = isAuctionItem
|
| | | addItemDictList.append(addItemDict)
|
| | | |
| | | if not GUID:
|
| | | GUID = str(uuid.uuid1())
|
| | | |
| | | limitTime = str(GameWorld.GetDatetimeByDiffDays(getDays))
|
| | | limitTime = limitTime.split(".")[0]
|
| | | |
| | | sender = ChConfig.Def_Mail_SenderSys
|
| | | title = ""
|
| | | content = "<MailTemplate>%s</MailTemplate>%s" % (mailTypeKey, json.dumps(paramList, ensure_ascii=False))
|
| | | |
| | | checkState = 0 # 邮件审核状态,为兼容老邮件,默认0-已审核,1-未审核
|
| | | mailInfo = GetEntireCompensationInfo(checkState, limitLVType, limitLV)
|
| | | PlayerJob = 127 # 默认全职业可领
|
| | | serverID = 0 # 默认所有服务器ID
|
| | | |
| | | AddEntireItem(GUID, addItemDictList, limitTime, mailInfo, PlayerJob, "%s<$_$>%s<$_$>%s" % (sender, title, content), |
| | | gold, goldPaper, silver, detail, serverID)
|
| | | return
|
| | |
|
| | | ## 添加全服补偿
|
| | | # @param addItemDictList, LimitTime, mailInfo, PlayerJob, Text
|
| | | # @return None
|