New file |
| | |
| | | #!/usr/bin/python
|
| | | # -*- coding: GBK -*-
|
| | | #-------------------------------------------------------------------------------
|
| | | #
|
| | | ##@package Player.PlayerGuaji
|
| | | #
|
| | | # @todo:挂机收益
|
| | | # @author hxp
|
| | | # @date 2024-06-12
|
| | | # @version 1.0
|
| | | #
|
| | | # 详细描述: 挂机收益
|
| | | #
|
| | | #-------------------------------------------------------------------------------
|
| | | #"""Version = 2024-06-12 18:00"""
|
| | | #-------------------------------------------------------------------------------
|
| | |
|
| | | import ChConfig
|
| | | import ShareDefine
|
| | | import PlayerControl
|
| | | import ChPyNetSendPack
|
| | | import PlayerWorldAverageLv
|
| | | import FormulaControl
|
| | | import NetPackCommon
|
| | | import IpyGameDataPY
|
| | | import ItemControler
|
| | | import GameFuncComm
|
| | | import GameWorld
|
| | | import PlayerVip
|
| | |
|
| | | import time
|
| | |
|
| | | Def_Process_Seconds = 60 # 在线定时处理间隔,秒,离线上线后一次性处理
|
| | |
|
| | | def DoGuajiOpen(curPlayer):
|
| | | openAwardMinutes = IpyGameDataPY.GetFuncCfg("GuajiTime", 1) # 功能开启获得收益时长,分钟
|
| | | AddGuajiAward(curPlayer, openAwardMinutes * 60)
|
| | | return
|
| | |
|
| | | def OnPlayerLogin(curPlayer):
|
| | | if not GameFuncComm.GetFuncCanUse(curPlayer, ShareDefine.GameFuncID_Guaji):
|
| | | return
|
| | | if not ProcessGuaji(curPlayer):
|
| | | Sync_GuajiAward(curPlayer)
|
| | | return
|
| | |
|
| | | def PlayerOnDay(curPlayer):
|
| | | if not GameFuncComm.GetFuncCanUse(curPlayer, ShareDefine.GameFuncID_Guaji):
|
| | | return
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_GuajiQuickCount, 0)
|
| | | Sync_GuajiAward(curPlayer)
|
| | | return
|
| | |
|
| | | def ProcessGuaji(curPlayer):
|
| | | ## 挂机定时处理收益
|
| | | if GameWorld.IsCrossServer():
|
| | | return
|
| | | if not GameFuncComm.GetFuncCanUse(curPlayer, ShareDefine.GameFuncID_Guaji):
|
| | | return
|
| | | |
| | | curTime = int(time.time())
|
| | | lastCalcTime = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_GuajiCalcTime)
|
| | | if not lastCalcTime:
|
| | | lastCalcTime = curTime
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_GuajiCalcTime, curTime)
|
| | | |
| | | awardSeconds = passSeconds = curTime - lastCalcTime
|
| | | if passSeconds <= Def_Process_Seconds:
|
| | | # 每满x秒统计一次
|
| | | return
|
| | | |
| | | if awardSeconds < Def_Process_Seconds + 10:
|
| | | awardSeconds = Def_Process_Seconds
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_GuajiCalcTime, lastCalcTime + awardSeconds)
|
| | | else:
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_GuajiCalcTime, curTime) |
| | | |
| | | return AddGuajiAward(curPlayer, awardSeconds)
|
| | |
|
| | | def AddGuajiAward(curPlayer, awardSeconds):
|
| | | ## 增加挂机奖励
|
| | | if awardSeconds <= 0:
|
| | | return
|
| | | |
| | | playerID = curPlayer.GetPlayerID()
|
| | | curAwardSeconds = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_GuajiAwardSeconds)
|
| | | maxSeconds = GetGuajiSecondsMax(curPlayer)
|
| | | if curAwardSeconds >= maxSeconds:
|
| | | GameWorld.DebugLog("挂机收益时长已达上限: curAwardSeconds=%s >= %s" % (curAwardSeconds, maxSeconds), playerID)
|
| | | return
|
| | | |
| | | awardSeconds = min(maxSeconds - curAwardSeconds, awardSeconds)
|
| | | if awardSeconds <= 0:
|
| | | return
|
| | | |
| | | addExp, giveMoneyDict, giveItemDict = CalcGuajiAward(curPlayer, awardSeconds, False)
|
| | | |
| | | updAwardSeconds = curAwardSeconds + awardSeconds
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_GuajiAwardSeconds, updAwardSeconds)
|
| | | GameWorld.DebugLog("保存挂机累计收益: curAwardSeconds=%s,updAwardSeconds=%s,maxSeconds=%s" % (curAwardSeconds, updAwardSeconds, maxSeconds), playerID)
|
| | | |
| | | # 经验
|
| | | exp = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_GuajiExpPoint) * ChConfig.Def_PerPointValue \
|
| | | + curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_GuajiExp) + addExp
|
| | | updExpPoint = exp / ChConfig.Def_PerPointValue
|
| | | updExp = exp % ChConfig.Def_PerPointValue
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_GuajiExpPoint, updExpPoint)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_GuajiExp, updExp)
|
| | | GameWorld.DebugLog(" 累计经验: %s亿%s" % (updExpPoint, updExp), playerID)
|
| | | |
| | | # 货币
|
| | | for moneyType, addValue in giveMoneyDict.items():
|
| | | saveNum = GetSaveNum(curPlayer, ChConfig.Def_PDict_GuajiMoneyType, moneyType)
|
| | | if saveNum == None:
|
| | | continue
|
| | | moneyValue = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_GuajiMoneyValue % saveNum)
|
| | | updMoney = min(moneyValue + addValue, ChConfig.Def_UpperLimit_DWord)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_GuajiMoneyType % saveNum, moneyType)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_GuajiMoneyValue % saveNum, updMoney)
|
| | | GameWorld.DebugLog(" 累计货币: moneyType=%s,updMoney=%s,saveNum=%s" % (moneyType, updMoney, saveNum), playerID)
|
| | | |
| | | # 物品
|
| | | for itemID, addCount in giveItemDict.items():
|
| | | saveNum = GetSaveNum(curPlayer, ChConfig.Def_PDict_GuajiItemID, itemID)
|
| | | if saveNum == None:
|
| | | continue
|
| | | curCount = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_GuajiItemCount % saveNum)
|
| | | updCount = min(curCount + addCount, ChConfig.Def_UpperLimit_DWord)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_GuajiItemID % saveNum, itemID)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_GuajiItemCount % saveNum, updCount)
|
| | | GameWorld.DebugLog(" 累计物品: itemID=%s,updCount=%s,saveNum=%s" % (itemID, updCount, saveNum), playerID)
|
| | | |
| | | Sync_GuajiAward(curPlayer)
|
| | | return True
|
| | |
|
| | | def GetSaveNum(curPlayer, key, compValue):
|
| | | for num in range(100):
|
| | | value = curPlayer.NomalDictGetProperty(key % num)
|
| | | if not value or compValue == value:
|
| | | # 空值或者命中
|
| | | return num
|
| | | return
|
| | |
|
| | | def GetGuajiSecondsMax(curPlayer):
|
| | | ## 挂机收益时长上限,秒
|
| | | # 初始
|
| | | initHours = IpyGameDataPY.GetFuncCfg("GuajiTime", 2) # 初始时长,小时
|
| | | |
| | | # 境界增加
|
| | | curRealmLV = curPlayer.GetOfficialRank()
|
| | | realmAddHours = 0
|
| | | realmAddHoursDict = IpyGameDataPY.GetFuncEvalCfg("GuajiTime", 3, {})
|
| | | realmLVList = realmAddHoursDict.keys()
|
| | | realmLVList.sort()
|
| | | for realmLV in realmLVList:
|
| | | if curRealmLV >= realmLV:
|
| | | realmAddHours = realmAddHoursDict[realmLV]
|
| | | else:
|
| | | break
|
| | | |
| | | totalHours = initHours + realmAddHours
|
| | | return totalHours * 3600
|
| | |
|
| | | def GetGuajiAwardInfoSave(curPlayer):
|
| | | ## 获取已保存的累计挂机收益信息
|
| | | lastCalcTime = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_GuajiCalcTime)
|
| | | awardSeconds = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_GuajiAwardSeconds)
|
| | | if lastCalcTime:
|
| | | awardSeconds += max(0, int(time.time() - lastCalcTime))
|
| | | awardSeconds = min(awardSeconds, GetGuajiSecondsMax(curPlayer))
|
| | | |
| | | exp = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_GuajiExpPoint) * ChConfig.Def_PerPointValue + \
|
| | | curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_GuajiExp)
|
| | | |
| | | moneyDict = {}
|
| | | for num in range(100):
|
| | | moneyType = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_GuajiMoneyType % num)
|
| | | if not moneyType:
|
| | | break
|
| | | moneyDict[moneyType] = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_GuajiMoneyValue % num)
|
| | | |
| | | itemDict = {}
|
| | | for num in range(100):
|
| | | itemID = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_GuajiItemID % num)
|
| | | if not itemID:
|
| | | break
|
| | | itemDict[itemID] = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_GuajiItemCount % num)
|
| | | |
| | | return awardSeconds, exp, moneyDict, itemDict
|
| | |
|
| | | def CalcGuajiAward(curPlayer, awardSeconds, isQuick):
|
| | | ## 计算挂机收益,只计算收益,不做结算,结算逻辑由外层决定
|
| | | |
| | | playerID = curPlayer.GetPlayerID()
|
| | | reLV = curPlayer.GetLV()
|
| | | lvIpyData = PlayerControl.GetPlayerLVIpyData(reLV)
|
| | | reExp = lvIpyData.GetReExp() if lvIpyData else 0
|
| | | worldLV = GameWorld.GetGameWorld().GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_WorldAverageLv)
|
| | | GameWorld.DebugLog("计算挂机收益: awardSeconds=%s,isQuick=%s,reLV=%s,reExp=%s,worldLV=%s" |
| | | % (awardSeconds, isQuick, reLV, reExp, worldLV), playerID)
|
| | | |
| | | # 经验
|
| | | expRate = GetGuajiExpRate(curPlayer)
|
| | | secondBaseExp = int(eval(FormulaControl.GetCompileFormula("GuajiExp", IpyGameDataPY.GetFuncCfg("GuajiAward", 1))))
|
| | | secondExp = int(secondBaseExp * expRate / float(ChConfig.Def_MaxRateValue))
|
| | | addExp = awardSeconds * secondExp
|
| | | GameWorld.DebugLog(" 每秒经验: %s, addExp=%s,secondBaseExp=%s,expRate=%s" % (secondExp, addExp, secondBaseExp, expRate), playerID)
|
| | | |
| | | # 每秒产出货币
|
| | | moneyDict = {}
|
| | | perSecondMoneyFromulaDict = IpyGameDataPY.GetFuncEvalCfg("GuajiAward", 2, {}) # 每秒获得货币公式 {货币类型:"每秒获得数量公式", ...}
|
| | | for moneyType, formula in perSecondMoneyFromulaDict.items():
|
| | | secondMoney = int(eval(FormulaControl.GetCompileFormula("GuajiMoney_%s" % moneyType, formula)))
|
| | | moneyValue = awardSeconds * secondMoney
|
| | | moneyDict[moneyType] = moneyValue
|
| | | GameWorld.DebugLog(" 每秒货币: moneyType=%s,secondMoney=%s,moneyValue=%s" % (moneyType, secondMoney, moneyValue), playerID)
|
| | | |
| | | # 每x秒产出1货币
|
| | | perMoneyTimeFromulaDict = IpyGameDataPY.GetFuncEvalCfg("GuajiAward", 3, {}) # 每x秒获得1个货币公式 {货币类型:"x秒公式", ...}
|
| | | for moneyType, formula in perMoneyTimeFromulaDict.items():
|
| | | moneyAwardSeconds = awardSeconds
|
| | | if not isQuick:
|
| | | moneyAwardSeconds += curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_GuajiMoneyUnSeconds % moneyType)
|
| | | oneMoneyNeedSeconds = int(eval(FormulaControl.GetCompileFormula("GuajiMoney_%s" % moneyType, formula)))
|
| | | moneyValue = moneyAwardSeconds / oneMoneyNeedSeconds
|
| | | moneyDict[moneyType] = moneyValue
|
| | | GameWorld.DebugLog(" 每X秒货币: moneyType=%s,oneMoneyNeedSeconds=%s,moneyValue=%s,moneyAwardSeconds=%s" |
| | | % (moneyType, oneMoneyNeedSeconds, moneyValue, moneyAwardSeconds), playerID)
|
| | | |
| | | if not isQuick:
|
| | | unSeconds = moneyAwardSeconds % oneMoneyNeedSeconds
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_GuajiMoneyUnSeconds % moneyType, unSeconds)
|
| | | GameWorld.DebugLog(" moneyType=%s,unSeconds=%s" % (moneyType, unSeconds), playerID)
|
| | | |
| | | # 物品
|
| | | giveItemSecondsSet = IpyGameDataPY.GetFuncCfg("GuajiAward", 4) # 每x秒获得一次随机物品机会
|
| | | lvItemRateDict = IpyGameDataPY.GetFuncEvalCfg("GuajiAward", 5, {})
|
| | | itemAwardSeconds = awardSeconds
|
| | | if not isQuick:
|
| | | itemAwardSeconds += curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_GuajiItemUnSeconds)
|
| | | |
| | | itemAwardTimes = itemAwardSeconds / giveItemSecondsSet # 给物品次数
|
| | | GameWorld.DebugLog(" 给物品次数: %s, itemAwardSeconds=%s,giveItemSecondsSet=%s" % (itemAwardTimes, itemAwardSeconds, giveItemSecondsSet), playerID)
|
| | | |
| | | if not isQuick:
|
| | | unSeconds = itemAwardSeconds % giveItemSecondsSet
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_GuajiItemUnSeconds, unSeconds)
|
| | | GameWorld.DebugLog(" 给物品未处理秒数=%s" % unSeconds, playerID)
|
| | | |
| | | lvList = lvItemRateDict.keys()
|
| | | lvList.sort()
|
| | | itemRateList = []
|
| | | for lv in lvList:
|
| | | if reLV >= lv:
|
| | | itemRateList = lvItemRateDict[lv]
|
| | | else:
|
| | | break
|
| | | |
| | | dropCountTotal = 0
|
| | | itemDict = {}
|
| | | maxRate = itemRateList[-1][0]
|
| | | GameWorld.DebugLog(" itemRateList=%s,maxRate=%s" % (itemRateList, maxRate), playerID)
|
| | | if itemAwardTimes > 100: # 超过x次的,先进行批量处理
|
| | | preRate = 0
|
| | | for rateInfo in itemRateList:
|
| | | rate, itemInfo = rateInfo
|
| | | curRate = rate - preRate
|
| | | preRate = rate
|
| | | if curRate <= 0:
|
| | | continue
|
| | | totalRate = curRate * itemAwardTimes # 总概率
|
| | | dropCount = totalRate / maxRate # 可掉落件数
|
| | | rateEx = totalRate % maxRate # 剩余概率
|
| | | if GameWorld.CanHappen(rateEx, maxRate):
|
| | | dropCount += 1
|
| | | dropCountTotal += dropCount # 产出是是空物品也要算执行掉落次数
|
| | | GameWorld.DebugLog(" 挂机物品: itemInfo=%s,curRate=%s,totalRate=%s,rateEx=%s,dropCount=%s,dropCountTotal=%s" |
| | | % (itemInfo, curRate, totalRate, rateEx, dropCount, dropCountTotal), playerID)
|
| | | if not dropCount:
|
| | | continue
|
| | | |
| | | if not itemInfo:
|
| | | continue
|
| | | itemID, itemCount = itemInfo
|
| | | itemDict[itemID] = itemDict.get(itemID, 0) + itemCount * dropCount
|
| | | |
| | | awardTimesEx = itemAwardTimes - dropCountTotal
|
| | | GameWorld.DebugLog(" awardTimesEx=%s" % awardTimesEx, playerID)
|
| | | if awardTimesEx > 0:
|
| | | for _ in range(awardTimesEx):
|
| | | itemInfo = GameWorld.GetResultByRandomList(itemRateList)
|
| | | if not itemInfo:
|
| | | continue
|
| | | itemID, itemCount = itemInfo
|
| | | itemDict[itemID] = itemDict.get(itemID, 0) + itemCount
|
| | | |
| | | GameWorld.DebugLog(" itemDict=%s" % (itemDict), playerID)
|
| | | return addExp, moneyDict, itemDict
|
| | |
|
| | | def GetGuajiExpRate(curPlayer):
|
| | | ## 挂机收益经验加成
|
| | | expRate = curPlayer.GetFightExpRate() # 系统及功能累加
|
| | | expRate += PlayerWorldAverageLv.GetWorldAverageLvExpRate(curPlayer) # 世界等级
|
| | | expRate += PlayerVip.GetPrivilegeValue(curPlayer, ChConfig.VIPPrivilege_FightExpRate) # VIP加成
|
| | | return expRate
|
| | |
|
| | | def OnGetGuajiAward(curPlayer, isQuick):
|
| | | ## 领取挂机收益
|
| | | # @param isQuick: 是否快速收益
|
| | | |
| | | playerID = curPlayer.GetPlayerID()
|
| | | GameWorld.DebugLog("领取挂机收益! isQuick=%s" % isQuick, playerID)
|
| | | |
| | | if isQuick:
|
| | | quickCountToday = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_GuajiQuickCount)
|
| | | quickCountFree = IpyGameDataPY.GetFuncCfg("GuajiQuick", 2)
|
| | | vipCanBuyCount = PlayerVip.GetPrivilegeValue(curPlayer, ChConfig.VIPPrivilege_GuajiQuickBuy)
|
| | | quickCountMax = quickCountFree + vipCanBuyCount
|
| | | if quickCountToday >= quickCountMax:
|
| | | GameWorld.DebugLog("快速挂机收益次数已达每日上限! quickCountToday=%s" % quickCountToday, playerID)
|
| | | return
|
| | | |
| | | if quickCountToday >= quickCountFree:
|
| | | todayBuyCount = quickCountToday - quickCountFree # 今日已购买次数
|
| | | costMoneyType = IpyGameDataPY.GetFuncCfg("GuajiQuick", 3)
|
| | | costMoneyList = IpyGameDataPY.GetFuncEvalCfg("GuajiQuick", 4)
|
| | | if not costMoneyType or not costMoneyList:
|
| | | return
|
| | | costMoneyValue = costMoneyList[todayBuyCount] if len(costMoneyList) > todayBuyCount else costMoneyList[-1]
|
| | | |
| | | GameWorld.DebugLog(" todayBuyCount=%s,costMoneyType=%s,costMoneyValue=%s" |
| | | % (todayBuyCount, costMoneyType, costMoneyValue), playerID)
|
| | | if not PlayerControl.PayMoney(curPlayer, costMoneyType, costMoneyValue, "Guaji"):
|
| | | return
|
| | | |
| | | awardSeconds = IpyGameDataPY.GetFuncCfg("GuajiQuick", 1) * 3600
|
| | | exp, moneyDict, itemDict = CalcGuajiAward(curPlayer, awardSeconds, True)
|
| | | |
| | | quickCountToday += 1
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_GuajiQuickCount, quickCountToday)
|
| | | GameWorld.DebugLog(" 更新快速挂机收益次数: quickCountToday=%s,quickCountMax=%s" % (quickCountToday, quickCountMax), playerID)
|
| | | else:
|
| | | awardSeconds, exp, moneyDict, itemDict = GetGuajiAwardInfoSave(curPlayer)
|
| | | |
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_GuajiCalcTime, int(time.time())) # 设置统计时间,重新统计 |
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_GuajiAwardSeconds, 0)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_GuajiExp, 0)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_GuajiExpPoint, 0)
|
| | | for num in range(100):
|
| | | if not curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_GuajiMoneyType % num):
|
| | | break
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_GuajiMoneyType % num, 0)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_GuajiMoneyValue % num, 0)
|
| | | for num in range(100):
|
| | | if not curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_GuajiItemID % num):
|
| | | break
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_GuajiItemID % num, 0)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_GuajiItemCount % num, 0)
|
| | | Sync_GuajiAward(curPlayer)
|
| | | |
| | | GameWorld.DebugLog(" 挂机收益: awardSeconds=%s,exp=%s,moneyDict=%s,itemDict=%s" % (awardSeconds, exp, moneyDict, itemDict), playerID)
|
| | | |
| | | playerControl = PlayerControl.PlayerControl(curPlayer)
|
| | | playerControl.AddExp(exp, ShareDefine.Def_ViewExpType_Guaji)
|
| | | |
| | | for moneyType, moneyValue in moneyDict.items():
|
| | | PlayerControl.GiveMoney(curPlayer, moneyType, moneyValue, "Guaji")
|
| | | |
| | | giveItemList = [[itemID, itemCount, 0] for itemID, itemCount in itemDict.items()]
|
| | | ItemControler.GivePlayerItemOrMail(curPlayer, giveItemList, event=["Guaji", False, {}])
|
| | | |
| | | Sync_GuajiAward(curPlayer, 1, awardSeconds, exp, moneyDict, itemDict)
|
| | | return
|
| | |
|
| | | def Sync_GuajiAward(curPlayer, awardType=0, awardSeconds=0, exp=0, moneyDict=None, itemDict=None):
|
| | | ## 同步挂机收益信息
|
| | | |
| | | # 收益类型: 0-已累计预览;1-领取结算结果(包含常规领取跟快速领取)
|
| | | if awardType == 0:
|
| | | awardSeconds, exp, moneyDict, itemDict = GetGuajiAwardInfoSave(curPlayer)
|
| | | |
| | | clientPack = ChPyNetSendPack.tagMCGuajiInfo()
|
| | | clientPack.QuickAwardCount = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_GuajiQuickCount)
|
| | | clientPack.AwardType = awardType
|
| | | clientPack.AwardSeconds = awardSeconds
|
| | | clientPack.Exp = exp % ChConfig.Def_PerPointValue
|
| | | clientPack.ExpPoint = exp / ChConfig.Def_PerPointValue
|
| | | clientPack.MoneyInfo = str([[moneyType, moneyValue] for moneyType, moneyValue in moneyDict.items()]).replace(" ", "") if moneyDict else "[]"
|
| | | clientPack.MoneyInfoLen = len(clientPack.MoneyInfo)
|
| | | clientPack.ItemInfo = str([[itemID, itemCount] for itemID, itemCount in itemDict.items()]).replace(" ", "") if itemDict else "[]"
|
| | | clientPack.ItemInfoLen = len(clientPack.ItemInfo)
|
| | | NetPackCommon.SendFakePack(curPlayer, clientPack)
|
| | | return
|
| | |
|