| | |
| | | import ChPyNetSendPack
|
| | | import NetPackCommon
|
| | | import IpyGameDataPY
|
| | | import PlayerMail
|
| | | import DBDataMgr
|
| | |
|
| | | import time
|
| | |
| | | clientPack.ViewIDDataList.append(viewData)
|
| | | clientPack.ViewIDDataCnt = len(clientPack.ViewIDDataList)
|
| | | return clientPack
|
| | |
|
| | | def DoGiveBillboardAwardByMail(billboardType, funcName, billboardAwardDict, mailKey):
|
| | | ## 结算排行奖励邮件发放
|
| | | GameWorld.Log("=== %s结算排行奖励! === " % (funcName))
|
| | | if not billboardAwardDict:
|
| | | return
|
| | | orderList = [int(orderStr) for orderStr in billboardAwardDict.keys()]
|
| | | orderList.sort()
|
| | | GameWorld.Log(" 奖励名次列表: %s" % orderList)
|
| | | |
| | | billboardMgr = DBDataMgr.GetBillboardMgr()
|
| | | billBoard = billboardMgr.GetBillboard(ShareDefine.Def_BT_Arena)
|
| | | if not billBoard:
|
| | | return
|
| | | billBoard.SortDelayDo()
|
| | | |
| | | awardOrder = orderList[0]
|
| | | orderPlayerIDDict = {}
|
| | | billboardCount, billboardMaxCount = billBoard.GetCount(), billBoard.GetMaxCount()
|
| | | GameWorld.Log(" 榜单数据数: %s/%s" % (billboardCount, billboardMaxCount))
|
| | | for index in xrange(billboardCount):
|
| | | billBoardData = billBoard.At(index)
|
| | | if not billBoardData:
|
| | | continue
|
| | | order = index + 1
|
| | | |
| | | if order > awardOrder:
|
| | | nextOrderIndex = orderList.index(awardOrder) + 1
|
| | | if nextOrderIndex >= len(orderList):
|
| | | break
|
| | | awardOrder = orderList[nextOrderIndex]
|
| | | |
| | | playerID = billBoardData.GetID()
|
| | | if playerID < ShareDefine.RealPlayerIDStart:
|
| | | # 非真人不处理
|
| | | continue
|
| | | |
| | | orderPlayerIDDict[playerID] = [order, awardOrder]
|
| | | |
| | | paramList = [order]
|
| | | awardList = billboardAwardDict[str(awardOrder)]
|
| | | PlayerMail.SendMailByKey(mailKey, playerID, awardList, paramList)
|
| | | |
| | | GameWorld.Log(" 奖励玩家名次信息: %s" % orderPlayerIDDict)
|
| | | GameWorld.Log("===================================================")
|
| | | return
|