| | |
| | | giveSuccessDict = {} |
| | | delGUIDDict = {} |
| | | needQueryCenterbak = CommFunc.loopMainServerDR(cfg, startDate, endDate, argvDict, checkDrFileNeedParseFunc_MailSend, |
| | | parseLineFunc_MailSend, drList, playerID, queryTempList, filterList, drNameList=["CompensationPersonal", "CompensationEntire"]) |
| | | parseLineFunc_MailSend, drList, playerID, queryTempList, filterList, drNameList=["MailSend", "MailServerMail"]) |
| | | # 领取的不限制结束日期 |
| | | CommFunc.loopMainServerDR(cfg, startDate, "", argvDict, checkDrFileNeedParseFunc_MailGiveSuccess, |
| | | parseLineFunc_MailGiveSuccess, giveSuccessDict, playerID, drNameList=["CompensationGiveSuccess"]) |
| | | parseLineFunc_MailGiveSuccess, giveSuccessDict, playerID, drNameList=["MailGiveSuccess"]) |
| | | CommFunc.loopMainServerDR(cfg, startDate, "", argvDict, checkDrFileNeedParseFunc_MailDel, |
| | | parseLineFunc_MailDel, delGUIDDict, playerID, drNameList=["CompensationPersonalDel"]) |
| | | parseLineFunc_MailDel, delGUIDDict, playerID, drNameList=["MailDel"]) |
| | | |
| | | if needQueryCenterbak: |
| | | argvDict["playerID"] = playerID |
| | |
| | | tempType = mailInfo["Title"] |
| | | mailInfo["Title"] = tempTitleDict.get(tempType, tempType) |
| | | # 全服邮件 |
| | | if "PlayerIDList" not in mailInfo: |
| | | if "PlayerID" not in mailInfo: |
| | | mailInfo["Title"] = "%s%s" % (CommFunc.encode(mailInfo["Title"]), "<font color='red'>[" + _(u"全服") + "]</font>") |
| | | |
| | | itemInfoStr = "" |
| | | for itemInfo in mailInfo["ItemList"]: |
| | | if itemInfoStr: |
| | | itemInfoStr += "<br/>" |
| | | itemID = itemInfo["ItemID"] |
| | | count = itemInfo["Count"] |
| | | itemID = itemInfo[0] |
| | | count = itemInfo[1] |
| | | isAuctionItem = itemInfo[2] if len(itemInfo) > 2 else 0 |
| | | itemName = itemNameDict.get(str(itemID), "") |
| | | if itemName: |
| | | itemInfoStr += "%s(%s) x%s%s" % (itemName, itemID, count, _(u"个")) |
| | | else: |
| | | itemInfoStr += "<font color='red'>%s(%s) x%s个</font>" % (_(u"未知物品ID"), itemID, count) |
| | | if itemInfo.get("IsAuctionItem"): |
| | | itemInfoStr += "<font color='red'>%s(%s) x%s个</font>" % (_(u"未知物品ID"), itemID, count) |
| | | if isAuctionItem: |
| | | itemInfoStr += "(%s)" % _(u"拍品") |
| | | mailInfo["ItemInfo"] = itemInfoStr |
| | | |
| | |
| | | playerID = CommFunc.toInt(argvDict.get("playerID", "0")) |
| | | |
| | | if not CommFunc.loopCenterbakRarDR(cfg, startDate, endDate, argvDict, checkDrFileNeedParseFunc_MailSend, |
| | | parseLineFunc_MailSend, drList, playerID, queryTempList, filterList, drNameList=["CompensationPersonal", "CompensationEntire"]): |
| | | parseLineFunc_MailSend, drList, playerID, queryTempList, filterList, drNameList=["MailSend", "MailServerMail"]): |
| | | return |
| | | |
| | | if not CommFunc.loopCenterbakRarDR(cfg, startDate, "", argvDict, checkDrFileNeedParseFunc_MailGiveSuccess, |
| | | parseLineFunc_MailGiveSuccess, giveSuccessDict, playerID, drNameList=["CompensationGiveSuccess"]): |
| | | parseLineFunc_MailGiveSuccess, giveSuccessDict, playerID, drNameList=["MailGiveSuccess"]): |
| | | return |
| | | |
| | | if not CommFunc.loopCenterbakRarDR(cfg, startDate, "", argvDict, checkDrFileNeedParseFunc_MailDel, |
| | | parseLineFunc_MailDel, delGUIDDict, playerID, drNameList=["CompensationPersonalDel"]): |
| | | parseLineFunc_MailDel, delGUIDDict, playerID, drNameList=["MailDel"]): |
| | | return |
| | | |
| | | return CommFunc.queryBackupCenterOK([drList, giveSuccessDict, delGUIDDict]) |
| | |
| | | @param *parseArgs: 自定义参数 |
| | | @return: isNeed, checkNeedParseRetInfo |
| | | ''' |
| | | isNeed = drFileName.startswith("CompensationPersonal_") or drFileName.startswith("CompensationEntire_") |
| | | isNeed = drFileName.startswith("MailSend_") or drFileName.startswith("MailServerMail_") |
| | | return isNeed, None |
| | | |
| | | def parseLineFunc_MailSend(drName, dateStr, checkNeedParseRetInfo, line, *parseArgs, **kv): |
| | |
| | | if "Text" not in line: |
| | | return |
| | | |
| | | if drName == "CompensationEntire": |
| | | if drName == "MailServerMail": |
| | | if "Add" not in line and "CheckOK" not in line: |
| | | return |
| | | |
| | |
| | | |
| | | # 减少eval,上面的简单验证,eval后还是要进行严格验证 |
| | | drDict = eval(line) |
| | | if "Title" in drDict: |
| | | title = drDict["Title"] |
| | | elif "title" in drDict: |
| | | title = drDict["title"] |
| | | else: |
| | | title = "" |
| | | Text = drDict["Text"] |
| | | |
| | | if drName == "CompensationEntire": |
| | | if drName == "MailServerMail": |
| | | if drDict["eventName"] not in ["Add", "CheckOK"]: |
| | | return |
| | | |
| | | else: |
| | | if playerID not in drDict["PlayerIDList"]: |
| | | if playerID != drDict["PlayerID"]: |
| | | return |
| | | |
| | | # 是否指定查找 |
| | |
| | | if isFilter: |
| | | return |
| | | |
| | | contentList = Text.split("<$_$>") |
| | | title = contentList[1] |
| | | content = contentList[2] |
| | | drDict["Title"] = title |
| | | if "</MailTemplate>" in content: |
| | | tempType = content[content.index("<MailTemplate>") + len("<MailTemplate>"):content.index("</MailTemplate>")] |
| | | if "</T>" in title: |
| | | tempType = title[title.index("<T>") + len("<T>"):title.index("</T>")] |
| | | drDict["Title"] = tempType |
| | | |
| | | drList.append(drDict) |
| | |
| | | @param *parseArgs: 自定义参数 |
| | | @return: isNeed, checkNeedParseRetInfo |
| | | ''' |
| | | isNeed = drFileName.startswith("CompensationGiveSuccess_") |
| | | isNeed = drFileName.startswith("MailGiveSuccess_") |
| | | return isNeed, None |
| | | |
| | | def parseLineFunc_MailGiveSuccess(drName, dateStr, checkNeedParseRetInfo, line, *parseArgs, **kv): |
| | |
| | | @param *parseArgs: 自定义参数 |
| | | @return: isNeed, checkNeedParseRetInfo |
| | | ''' |
| | | isNeed = drFileName.startswith("CompensationPersonalDel_") |
| | | isNeed = drFileName.startswith("MailDel_") |
| | | return isNeed, None |
| | | |
| | | def parseLineFunc_MailDel(drName, dateStr, checkNeedParseRetInfo, line, *parseArgs, **kv): |