10011 【主干】【港台】【后台】邮件增加类型区分(个人、全服邮件发送及管理支持邮件类型)
| | |
| | | # @remarks 函数详细说明.
|
| | | def OnExec(orderId, gmCmdDict):
|
| | | gmCmdDict = ClearEmptyFromDict(gmCmdDict)
|
| | | |
| | | GameWorld.DebugLog("GMT_AddEntireCompensation gmCmdDict:%s" % gmCmdDict)
|
| | | LimitTime = gmCmdDict.get('EndTime', '2050-12-13 00:00:00')
|
| | | curServerTime = GameWorld.GetCurrentDataTimeStr()
|
| | | # 当前时间已经超过领取时间
|
| | |
| | | GMCommon.GMCommandResult(orderId, gmCmdDict, GMCommon.Def_InvalidTime)
|
| | | return
|
| | |
|
| | | MailType = int(gmCmdDict.get('MailType', '0'))
|
| | | Title = gmCmdDict.get('Title', '')
|
| | | Text = gmCmdDict.get('Text', '')
|
| | | GUID = gmCmdDict.get('GUID', '') # GM工具需要对全服邮件进行多服批量管理,所以这里GUID暂由GM工具决定
|
| | |
| | | # GMCommon.GMCommandResult(orderId, gmCmdDict, GMCommon.Def_ParamErr)
|
| | | # return
|
| | | PlayerCompensation.AddEntireItem(GUID, addItemDictList, LimitTime,
|
| | | mailInfo, PlayerJob, "%s<$_$>%s<$_$>%s"%(sender, Title, Text),
|
| | | mailInfo, PlayerJob, PlayerCompensation.GetMailText(Title, Text, MailType, sender),
|
| | | gold, goldPaper, silver, detail, serverID)
|
| | |
|
| | | #执行成功
|
| | |
| | | def OnExec(orderId, gmCmdDict):
|
| | | strMsg = ""
|
| | | gmCmdDict = ClearEmptyFromDict(gmCmdDict)
|
| | | GameWorld.DebugLog("GMT_AddPersonalCompensation gmCmdDict:%s" % gmCmdDict)
|
| | | queryType = gmCmdDict.get(GMCommon.Def_GMKey_QueryType, '')
|
| | | if queryType == GMCommon.Def_GMKey_FamilyID:
|
| | | sendFamilyIDList = []
|
| | |
| | | GMCommon.GMCommandResult(orderId, gmCmdDict, GMCommon.Def_InvalidTime)
|
| | | return
|
| | |
|
| | | MailType = int(gmCmdDict.get('MailType', '0'))
|
| | | Title = gmCmdDict.get('Title', '')
|
| | | Text = gmCmdDict.get('Text', '')
|
| | | GUID = str(uuid.uuid1())
|
| | |
| | | # GMCommon.GMCommandResult(orderId, gmCmdDict, GMCommon.Def_ParamErr)
|
| | | # return
|
| | | PlayerCompensation.AddPersonalItem(GUID, addItemDictList, PlayerIDList,
|
| | | LimitTime, "%s<$_$>%s<$_$>%s"%(sender, Title, Text),
|
| | | LimitTime, PlayerCompensation.GetMailText(Title, Text, MailType, sender),
|
| | | gold, goldPaper, silver, detail=detail)
|
| | |
|
| | | #执行成功
|
| | |
| | | # @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
|
| | |
|
| | |
| | | return
|
| | |
|
| | | Text = curPackData.Text
|
| | | _, _, content = Text.split("<$_$>")
|
| | | contentList = Text.split("<$_$>")
|
| | | content = contentList[2] if len(contentList) > 2 else ""
|
| | | isPaimaiMail = "<MailTemplate>PaimaiMail3</MailTemplate>" in content
|
| | |
|
| | | for i in xrange(curPackData.Count):
|