| | |
| | | GameWorld.DebugAnswer(curPlayer, "清空邮件: Mail 0")
|
| | | GameWorld.DebugAnswer(curPlayer, "发送邮件: Mail 几封 物品数 [模板key 参数1 ...]")
|
| | | GameWorld.DebugAnswer(curPlayer, "输出邮件: Mail p")
|
| | | GameWorld.DebugAnswer(curPlayer, "发送全服: Mail s 物品数 [天数]")
|
| | | return
|
| | |
|
| | | value = gmList[0]
|
| | |
| | |
|
| | | if value == "p":
|
| | | PrintPlayerMail(curPlayer)
|
| | | return
|
| | | |
| | | if value == "s":
|
| | | SendServerMail(curPlayer, gmList)
|
| | | return
|
| | |
|
| | | if value > 0:
|
| | |
| | | mailTypeKey = gmList[2] if len(gmList) > 2 else ""
|
| | | paramList = gmList[3:]
|
| | |
|
| | | itemIDList = range(3501, 3530 + 1)
|
| | | moneyIDList = [20, 30]
|
| | | |
| | | mailMgr = DBDataMgr.GetMailMgr()
|
| | | mailCntBef = mailMgr.GetPersonalMailCount(playerID)
|
| | | |
| | | isBind = 0
|
| | | for _ in range(sendCnt):
|
| | | |
| | | itemList = []
|
| | | if mailItemCnt:
|
| | | for moneyID in moneyIDList:
|
| | | itemCount = random.choice([100, 1000, 10000, 20000, 50000, 100000, 200000, 300000, 500000])
|
| | | itemList.append([moneyID, itemCount, isBind])
|
| | | if len(itemList) >= mailItemCnt:
|
| | | break
|
| | | |
| | | random.shuffle(itemIDList)
|
| | | for i in range(mailItemCnt):
|
| | | itemID = itemIDList[i]
|
| | | itemCount = random.randint(1, 100000)
|
| | | itemList.append([itemID, itemCount, isBind])
|
| | | if len(itemList) >= mailItemCnt:
|
| | | break
|
| | | |
| | | itemList = __randMailItem(mailItemCnt)
|
| | | PlayerMail.SendMailByKey(mailTypeKey, playerID, itemList, paramList)
|
| | |
|
| | | mailCntAft = mailMgr.GetPersonalMailCount(playerID)
|
| | | GameWorld.DebugAnswer(curPlayer, "发送个人邮件OK:%s, %s~%s" % (sendCnt, mailCntBef, mailCntAft))
|
| | | return
|
| | |
|
| | | def SendServerMail(curPlayer, gmList):
|
| | | mailItemCnt = gmList[1] if len(gmList) > 1 else 5
|
| | | limitDays = gmList[2] if len(gmList) > 2 else 7
|
| | | |
| | | randValue = random.randint(1, 1000)
|
| | | title = GameWorld.GbkToCode("全服邮件标题%s" % randValue)
|
| | | text = GameWorld.GbkToCode(
|
| | | '''全服邮件内容全服邮件内容全服邮件内容全服邮件内容全服邮件内容
|
| | | 全服邮件内容全服邮件内容全服邮件内容全服邮件内容全服邮件内容%s
|
| | | ''' % randValue
|
| | | )
|
| | | itemList = __randMailItem(mailItemCnt)
|
| | | |
| | | PlayerMail.SendSeverMail("", title, text, itemList, limitDays)
|
| | | GameWorld.DebugAnswer(curPlayer, "发送全服邮件OK!")
|
| | | return
|
| | |
|
| | | def __randMailItem(mailItemCnt):
|
| | | itemIDList = range(3501, 3530 + 1)
|
| | | moneyIDList = [20, 30]
|
| | | |
| | | isBind = 0
|
| | | itemList = []
|
| | | if mailItemCnt:
|
| | | for moneyID in moneyIDList:
|
| | | itemCount = random.choice([100, 1000, 10000, 20000, 50000, 100000, 200000, 300000, 500000])
|
| | | itemList.append([moneyID, itemCount, isBind])
|
| | | if len(itemList) >= mailItemCnt:
|
| | | break
|
| | | |
| | | random.shuffle(itemIDList)
|
| | | for i in range(mailItemCnt):
|
| | | itemID = itemIDList[i%len(itemIDList)]
|
| | | itemCount = random.randint(1, 100000)
|
| | | itemList.append([itemID, itemCount, isBind])
|
| | | if len(itemList) >= mailItemCnt:
|
| | | break
|
| | | |
| | | return itemList
|
| | |
|
| | | def ClearMail(curPlayer):
|
| | | notifyGUIDState = {}
|
| | |
| | | DataRecordPack.DR_MailDel(playerID, guid, "GMDel")
|
| | | notifyGUIDState[guid] = ShareDefine.MailState_Del
|
| | | GameWorld.DebugAnswer(curPlayer, "删除个人邮件:%s" % len(guidList))
|
| | | PlayerMail.Sync_PlayerMailState(curPlayer, notifyGUIDState)
|
| | |
|
| | | guidList = mailMgr.GetServerMailGuids()
|
| | | for guid in guidList:
|
| | | playerStateDict = mailMgr.DelServerMail(guid)
|
| | | if playerID in playerStateDict and playerStateDict[playerID] < ShareDefine.MailState_Del:
|
| | | notifyGUIDState[guid] = ShareDefine.MailState_Del
|
| | | PlayerMail.DelServerMail(guid, "GMDel")
|
| | | if len(guidList):
|
| | | GameWorld.DebugAnswer(curPlayer, "删除全服邮件:%s" % len(guidList))
|
| | | PlayerMail.Sync_PlayerMailState(curPlayer, notifyGUIDState)
|
| | | return
|
| | |
|
| | | def PrintPlayerMail(curPlayer):
|