| | |
| | | value5:lotteryTime 开奖时间
|
| | |
|
| | | StrValue1:luckyPlayerName 中奖玩家名
|
| | | StrValue2:templateID 使用模板ID
|
| | | StrValue3:lotteryInfo 分区信息|大奖信息|中奖玩家账号
|
| | | '''
|
| | |
|
| | | Def_SyncBuyRec_Count = 50
|
| | |
|
| | | class LuckyCloudBuyNum():
|
| | | ''' 幸运云购购买号码记录
|
| | |
| | | self.serverIDRangeList = [] # 分区信息
|
| | | self.superItemInfo = [] # 大奖信息
|
| | | self.luckyPlayerAccID = "" # 中奖玩家账号
|
| | | self.templateID = 0 # 使用模板ID
|
| | | return
|
| | |
|
| | | def GetString(self):
|
| | | return {"idTime":self.idTime, "cfgID":self.cfgID, "zoneID":self.zoneID, "roundNum":self.roundNum, "luckyPlayerID":self.luckyPlayerID,
|
| | | "lotteryNum":self.lotteryNum, "lotteryTime":self.lotteryTime, "luckyPlayerName":self.luckyPlayerName, |
| | | "lotteryNum":self.lotteryNum, "lotteryTime":self.lotteryTime, "luckyPlayerName":self.luckyPlayerName, "templateID":self.templateID,
|
| | | "serverIDRangeList":self.serverIDRangeList, "superItemInfo":self.superItemInfo, "luckyPlayerAccID":self.luckyPlayerAccID}
|
| | |
|
| | | def SetAttrByDict(self, attrDict):
|
| | |
| | | lotteryRec.lotteryTime = recData.GetValue5()
|
| | |
|
| | | lotteryRec.luckyPlayerName = recData.GetStrValue1()
|
| | | lotteryRec.templateID = GameWorld.ToIntDef(recData.GetStrValue2())
|
| | | strValue3 = recData.GetStrValue3()
|
| | | lotteryRec.serverIDRangeList, lotteryRec.superItemInfo, lotteryRec.luckyPlayerAccID = [], [], ""
|
| | | if strValue3:
|
| | |
| | | recData.SetValue5(lotteryRec.lotteryTime)
|
| | |
|
| | | recData.SetStrValue1(lotteryRec.luckyPlayerName)
|
| | | recData.SetStrValue2("%s" % lotteryRec.templateID)
|
| | | recData.SetStrValue3("%s|%s|%s" % (str(lotteryRec.serverIDRangeList).replace(" ", ""),
|
| | | str(lotteryRec.superItemInfo).replace(" ", ""),
|
| | | lotteryRec.luckyPlayerAccID))
|
| | |
| | | return
|
| | |
|
| | | Sync_LuckyCloudBuyRoundInfo(curPlayer)
|
| | | Sync_LuckyCloudBuyNumRecInfo(curPlayer)
|
| | | __LoginNotifyMapCloudBuyNumInfo(curPlayer)
|
| | | return
|
| | |
|
| | |
| | | lotteryRec.cfgID = cfgID
|
| | | lotteryRec.zoneID = zoneID
|
| | | lotteryRec.roundNum = nextRoundNum
|
| | | lotteryRec.templateID = templateID
|
| | |
|
| | | lotteryRec.serverIDRangeList = serverIDRangeList
|
| | | lotteryRec.superItemInfo = superItemInfo
|
| | |
| | | zoneLotteryInfo = {zoneID:[lotteryRec.GetString()]}
|
| | | dataMsg = {"syncType":"New", "zoneLotteryInfo":zoneLotteryInfo}
|
| | | CrossRealmMsg.SendMsgToClientServer(ShareDefine.CrossServerMsg_LuckyCloudBuyLottery, dataMsg)
|
| | | |
| | | maxBuyCount = IpyGameDataPY.GetFuncCfg("LuckyCloudBuySet", 2)
|
| | | dataMsg = {"syncType":"All", "zoneID":zoneID, "zoneBuyNumList":[], "remainCount":maxBuyCount}
|
| | | CrossRealmMsg.SendMsgToClientServer(ShareDefine.CrossServerMsg_LuckyCloudBuyNum, dataMsg)
|
| | | return True
|
| | |
|
| | | def Sync_LuckyCloudBuyDataToClientServer(tick, serverGroupID=0):
|
| | |
| | | for zoneID in PyGameData.g_luckyCloudBuyLotteryDict.keys():
|
| | | zoneBuyNumList = []
|
| | | buyRecList = PyGameData.g_luckyCloudBuyNumDict.get(zoneID, [])
|
| | | for buyRec in buyRecList:
|
| | | for buyRec in buyRecList[-Def_SyncBuyRec_Count:]:
|
| | | zoneBuyNumList.append(buyRec.GetString())
|
| | |
|
| | | dataMsg = {"syncType":"All", "zoneID":zoneID, "zoneBuyNumList":zoneBuyNumList}
|
| | | maxBuyCount = IpyGameDataPY.GetFuncCfg("LuckyCloudBuySet", 2)
|
| | | remainCount = max(0, maxBuyCount - len(buyRecList))
|
| | | dataMsg = {"syncType":"All", "zoneID":zoneID, "zoneBuyNumList":zoneBuyNumList, "remainCount":remainCount}
|
| | | CrossRealmMsg.SendMsgToClientServer(ShareDefine.CrossServerMsg_LuckyCloudBuyNum, dataMsg)
|
| | |
|
| | | return
|
| | |
| | | DataRecordPack.SendEventPack("LuckyCloudBuyNum", dataDict)
|
| | |
|
| | | # 通知子服
|
| | | dataMsg = {"syncType":"New", "zoneID":zoneID, "zoneBuyNumList":zoneBuyNumList, "buyPlayer":[serverGroupID, playerID, roundID, buyCount]}
|
| | | remainCount -= buyCount
|
| | | dataMsg = {"syncType":"New", "zoneID":zoneID, "zoneBuyNumList":zoneBuyNumList, "buyPlayer":[serverGroupID, playerID, roundID, buyCount], "remainCount":remainCount}
|
| | | CrossRealmMsg.SendMsgToClientServer(ShareDefine.CrossServerMsg_LuckyCloudBuyNum, dataMsg)
|
| | |
|
| | | # 结算开奖
|
| | | if remainCount == buyCount:
|
| | | if remainCount <= 0:
|
| | | DoLuckyCloudBuyLottery(lotteryRec, False, "SoldOut")
|
| | |
|
| | | return
|
| | |
| | | zoneBuyNumList.append(buyRec.GetString())
|
| | |
|
| | | # 通知子服
|
| | | dataMsg = {"syncType":"New", "zoneID":zoneID, "zoneBuyNumList":zoneBuyNumList}
|
| | | remainCount -= buyCount
|
| | | dataMsg = {"syncType":"New", "zoneID":zoneID, "zoneBuyNumList":zoneBuyNumList, "remainCount":remainCount}
|
| | | CrossRealmMsg.SendMsgToClientServer(ShareDefine.CrossServerMsg_LuckyCloudBuyNum, dataMsg)
|
| | |
|
| | | # 结算开奖
|
| | | if remainCount == buyCount:
|
| | | if remainCount <= 0:
|
| | | DoLuckyCloudBuyLottery(lotteryRec, False, "SoldOut")
|
| | | return
|
| | |
|
| | |
| | | syncType = msgData["syncType"] # All New
|
| | | zoneID = msgData["zoneID"]
|
| | | zoneBuyNumList = msgData["zoneBuyNumList"]
|
| | | remainCount = msgData["remainCount"]
|
| | |
|
| | | curServerGroupID = GameWorld.GetServerGroupID()
|
| | | actInfo = CrossActionControl.GetCrossActInfoByServerGroupID(ShareDefine.CrossActName_LuckyCloudBuy, curServerGroupID)
|
| | |
| | | GameWorld.DebugLog("不是本服务器分区的云购记录不处理! curServerGroupID=%s,serverZoneID(%s) != zoneID(%s)"
|
| | | % (curServerGroupID, serverZoneID, zoneID))
|
| | | return
|
| | | |
| | | PyGameData.g_luckyCloudBuyRemainCountDict[zoneID] = remainCount
|
| | |
|
| | | if syncType == "All":
|
| | | PyGameData.g_luckyCloudBuyNumDict = {}
|
| | |
| | | if serverGroupID != curServerGroupID:
|
| | | return
|
| | |
|
| | | templateIDList = ipyDataInfo.get("TemplateIDList")
|
| | | if not templateIDList:
|
| | | lotteryRecList = PyGameData.g_luckyCloudBuyLotteryDict.get(zoneID, [])
|
| | | lotteryRec = None if not lotteryRecList else lotteryRecList[-1] # 取最新一期的
|
| | | if not lotteryRec:
|
| | | return
|
| | | |
| | | dayIndex = actInfo.get(ShareDefine.ActKey_DayIndex, 0)
|
| | | templateID = templateIDList[dayIndex] if len(templateIDList) > dayIndex else templateIDList[-1]
|
| | | templateID = lotteryRec.templateID
|
| | | templateIpyData = IpyGameDataPY.GetIpyGameData("CrossActLuckyCloudBuyTemplate", templateID)
|
| | | if not templateIpyData:
|
| | | return
|
| | |
| | | if not zoneID:
|
| | | return
|
| | |
|
| | | templateIDList = ipyDataInfo.get("TemplateIDList")
|
| | | if not templateIDList:
|
| | | lotteryRecList = PyGameData.g_luckyCloudBuyLotteryDict.get(zoneID, [])
|
| | | lotteryRec = None if not lotteryRecList else lotteryRecList[-1] # 取最新一期的
|
| | | if not lotteryRec:
|
| | | return
|
| | | templateID = lotteryRec.templateID
|
| | |
|
| | | dayIndex = actInfo.get(ShareDefine.ActKey_DayIndex, 0)
|
| | | templateID = templateIDList[dayIndex] if len(templateIDList) > dayIndex else templateIDList[-1]
|
| | | templateIpyData = IpyGameDataPY.GetIpyGameData("CrossActLuckyCloudBuyTemplate", templateID)
|
| | | if not templateIpyData:
|
| | | return
|
| | | baseAwardInfo = templateIpyData.GetBaseAwardInfo()
|
| | | randAwardWeightInfo = templateIpyData.GetRandAwardWeightInfo()
|
| | | |
| | | lotteryRecList = PyGameData.g_luckyCloudBuyLotteryDict.get(zoneID, [])
|
| | | lotteryRec = None if not lotteryRecList else lotteryRecList[-1] # 取最新一期的
|
| | | if not lotteryRec:
|
| | | return
|
| | |
|
| | | roundTimeList = []
|
| | | StartTimeList = ipyDataInfo.get("StartTimeList")
|
| | |
| | | lotteryRec = None if not lotteryRecList else lotteryRecList[-1] # 取最新一期的
|
| | | if not lotteryRec:
|
| | | return
|
| | | syncRecList = buyRecList[-50:]
|
| | | |
| | | maxBuyCount = IpyGameDataPY.GetFuncCfg("LuckyCloudBuySet", 2)
|
| | | syncRecList = buyRecList[-Def_SyncBuyRec_Count:]
|
| | |
|
| | | clientPack = ChPyNetSendPack.tagGCLuckyCloudBuyNumRecInfo()
|
| | | clientPack.RemainCount = max(0, maxBuyCount - len(buyRecList))
|
| | | clientPack.RemainCount = PyGameData.g_luckyCloudBuyRemainCountDict.get(zoneID, 0)
|
| | | clientPack.BuyNumRecList = []
|
| | | for buyRec in syncRecList:
|
| | | buyNumInfo = ChPyNetSendPack.tagGCLuckyCloudBuyNumRec()
|