| | |
| | | # @return GUID
|
| | | # @remarks addItemList支持append字典
|
| | | def SendPersonalItemMail(title, content, limitTime, playerIDList, addItemList, gold = 0, goldPaper = 0, silver = 0,
|
| | | detail="", moneySource=ChConfig.Def_GiveMoney_Mail, crossMail=False):
|
| | | detail="", moneySource=ChConfig.Def_GiveMoney_Mail, crossMail=False, mailType=0):
|
| | | if not playerIDList:
|
| | | return ""
|
| | |
|
| | |
| | | startIndex = i*perMailItemCnt
|
| | | GUID = str(uuid.uuid1())
|
| | | AddPersonalItem(GUID, addItemDictList[startIndex:startIndex + perMailItemCnt], playerIDList,
|
| | | limitTime, "%s<$_$>%s<$_$>%s" % (ChConfig.Def_Mail_SenderSys, title, content),
|
| | | limitTime, GetMailText(title, content, mailType),
|
| | | gold, goldPaper, silver, detail, moneySource, crossMail)
|
| | | return GUID
|
| | |
|
| | | ## 发送纯文字个人补偿
|
| | | # @param limitTime 可以传空
|
| | | # @return None
|
| | | def SendPersonalAsTextMail(PlayerID, title, content, limitTime):
|
| | | def SendPersonalAsTextMail(PlayerID, title, content, limitTime, mailType=0):
|
| | | if GameWorld.IsCrossServer():
|
| | | return
|
| | | GUID = str(uuid.uuid1())
|
| | | PyAddPersonalCompensation(GUID, PlayerID, GameWorld.GetCurrentDataTimeStr(), limitTime,
|
| | | "%s<$_$>%s<$_$>%s" % (ChConfig.Def_Mail_SenderSys,title, content))
|
| | | GetMailText(title, content, mailType))
|
| | | return
|
| | |
|
| | | def GetMailText(title, content, mailType=0, sender=ChConfig.Def_Mail_SenderSys):
|
| | | ## 获取邮件字段 Text 内容
|
| | | return "%s<$_$>%s<$_$>%s<$_$>%s" % (sender, title, content, mailType)
|
| | |
|
| | | def GetEntireCompensationInfo(checkState, limitLVType, limitLV):
|
| | | return checkState * 1000000 + limitLVType * 100000 + limitLV
|
| | |
| | | compensation = compensationMgr.PersonalCompensationAt(playerID, i)
|
| | |
|
| | | contentList = compensation.Text.split("<$_$>")
|
| | | if len(contentList) != 3:
|
| | | if len(contentList) < 3:
|
| | | continue
|
| | | sender, title, content = contentList
|
| | | sender, title, content = contentList[:3]
|
| | | mailType = GameWorld.ToIntDef(contentList[3]) if len(contentList) > 3 else 0
|
| | |
|
| | | if tempSign in content and tempSignEnd in content:
|
| | | title = content[content.index(tempSign) + len(tempSign):content.index(tempSignEnd)]
|
| | |
| | | recState = compensationMgr.FindPlayerRecState(playerID, GUID)
|
| | |
|
| | | infoDict = {"GUID":GUID, "Gold":compensation.Gold, "GoldPaper":compensation.GoldPaper, "Silver":compensation.Silver,
|
| | | "Sender":sender, "Title":title, "Content":content, "RecState":recState,
|
| | | "Sender":sender, "Title":title, "Content":content, "RecState":recState, "MailType":mailType,
|
| | | "CreateTime":compensation.CreateTime, "LimitTime":compensation.LimitTime, "ItemList":itemList}
|
| | |
|
| | | retList.append(infoDict)
|
| | |
| | | return
|
| | |
|
| | | contentList = compensation.Text.split("<$_$>")
|
| | | if len(contentList) != 3:
|
| | | if len(contentList) < 3:
|
| | | return
|
| | | sender, title, content = contentList
|
| | | sender, title, content = contentList[:3]
|
| | | mailType = GameWorld.ToIntDef(contentList[3]) if len(contentList) > 3 else 0
|
| | |
|
| | | if searchTitle and searchTitle not in title:
|
| | | return
|
| | |
| | | continue
|
| | | itemList.append([itemID, curItem.Count, curItem.IsBind, curItem.UserData])
|
| | |
|
| | | compensationDict = {"GUID":GUID, "CheckState":checkState, "LimitLVType":limitLVType, "LimitLV":limitLV,
|
| | | compensationDict = {"GUID":GUID, "CheckState":checkState, "LimitLVType":limitLVType, "LimitLV":limitLV, "MailType":mailType,
|
| | | "Gold":compensation.Gold, "GoldPaper":compensation.GoldPaper, "Silver":compensation.Silver,
|
| | | "PlayerJob":compensation.PlayerJob, "Sender":sender, "Title":title, "Content":content, "OnlyServerID":compensation.ServerID,
|
| | | "CreateTime":compensation.CreateTime, "LimitTime":compensation.LimitTime, "ItemList":itemList}
|
| | |
| | | return successGUIDList
|
| | |
|
| | | def SendEntireMail(mailTypeKey, getDays, limitLV, limitLVType, addItemList=[], paramList=[], \
|
| | | gold=0, goldPaper=0, silver=0, detail="", moneySource=ChConfig.Def_GiveMoney_Mail, GUID=""):
|
| | | gold=0, goldPaper=0, silver=0, detail="", moneySource=ChConfig.Def_GiveMoney_Mail, GUID="", mailType=0):
|
| | | ''' 发送全服邮件
|
| | | @param mailTypeKey: 邮件模板key
|
| | | @param getDays: 有效天数
|
| | |
| | | PlayerJob = 127 # 默认全职业可领
|
| | | serverID = 0 # 默认所有服务器ID
|
| | |
|
| | | AddEntireItem(GUID, addItemDictList, limitTime, mailInfo, PlayerJob, "%s<$_$>%s<$_$>%s" % (sender, title, content), |
| | | AddEntireItem(GUID, addItemDictList, limitTime, mailInfo, PlayerJob, GetMailText(title, content, mailType, sender), |
| | | gold, goldPaper, silver, detail, serverID)
|
| | | return
|
| | |
|