From a54fba3894b5d528bed16147f096b6a706a1fc0c Mon Sep 17 00:00:00 2001 From: hxp <ale99527@vip.qq.com> Date: 星期四, 27 六月 2019 15:58:03 +0800 Subject: [PATCH] Merge branch 'master' of http://192.168.0.87:10010/r/SnxxServerCode --- ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerCoin.py | 41 +++++++++++++++++++++++++++++------------ 1 files changed, 29 insertions(+), 12 deletions(-) diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerCoin.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerCoin.py index 83afe91..a8d46ac 100644 --- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerCoin.py +++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerCoin.py @@ -49,6 +49,7 @@ import PlayerActTotalRecharge import OpenServerCampaign import PlayerWeekParty +import PlayerGoldInvest import ItemCommon import time @@ -96,6 +97,8 @@ for i in xrange(ipyDataMgr.GetCTGCount()): ipyData = ipyDataMgr.GetCTGByIndex(i) recordID = ipyData.GetRecordID() + if not ipyData.GetCanResetBuyCount(): + continue totalBuyCount = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_CTGGoodsBuyCount % recordID) todayBuyCount = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TodayCTGCount % recordID) if not totalBuyCount and not todayBuyCount: @@ -214,7 +217,7 @@ DataRecordPack.DR_CTGError(curPlayer, "The orderInfo is useless!", addDRDict) return - DoCTGLogic(curPlayer, orderCoin, addGold, prizeGold, giveItemList, isAddBourseMoney, eventName, addDRDict, notifyMark) + DoCTGLogic(curPlayer, orderCoin, addGold, prizeGold, giveItemList, isAddBourseMoney, eventName, addDRDict, notifyMark, ipyData) #充值成功主动查询一次,无充值数量就不会继续查询 if orderID: @@ -233,31 +236,42 @@ DataRecordPack.DR_CTGError(curPlayer, "Can not find CTG ipyData!", addDRDict) return - dailyBuyCount = ipyData.GetDailyBuyCount() addDRDict.update({"recordID":recordID}) + + totalBuyCountLimit = ipyData.GetTotalBuyCount() + totalBuyCount = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_CTGGoodsBuyCount % recordID) + if totalBuyCountLimit: + addDRDict.update({"totalBuyCountLimit":totalBuyCountLimit, "totalBuyCount":totalBuyCount}) + if totalBuyCount >= totalBuyCountLimit: + DataRecordPack.DR_CTGError(curPlayer, "Pay count limit total!totalBuyCount=%s" % totalBuyCount, addDRDict) + return + + dailyBuyCountLimit = ipyData.GetDailyBuyCount() todayBuyCount = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TodayCTGCount % recordID) - if dailyBuyCount: - addDRDict.update({"dailyCanBuyCount":dailyBuyCount, "todayBuyCount":todayBuyCount}) - if todayBuyCount >= dailyBuyCount: + if dailyBuyCountLimit: + addDRDict.update({"dailyBuyCountLimit":dailyBuyCountLimit, "todayBuyCount":todayBuyCount}) + if todayBuyCount >= dailyBuyCountLimit: DataRecordPack.DR_CTGError(curPlayer, "Pay count limit today!todayBuyCount=%s" % todayBuyCount, addDRDict) return - PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TodayCTGCount % recordID, todayBuyCount + 1) - + + if totalBuyCountLimit: + PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_CTGGoodsBuyCount % recordID, totalBuyCount + 1) + addDRDict.update({"totalBuyCountUpd":(totalBuyCount + 1)}) + if dailyBuyCountLimit: + PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TodayCTGCount % recordID, todayBuyCount + 1) + addDRDict.update({"todayBuyCountUpd":(todayBuyCount + 1)}) + giveItemList = ipyData.GetGainItemList() addGold = ipyData.GetGainGold() # 获得仙玉数 gainGoldPrize = ipyData.GetGainGoldPrize() # 赠送仙玉数,首次充值赠送仙玉时,此仙玉不给 firstGoldPrize = ipyData.GetFirstGoldPrize() # 首次充值赠送的仙玉 notifyMark = ipyData.GetNotifyMark() - totalBuyCount = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_CTGGoodsBuyCount % recordID) - PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_CTGGoodsBuyCount % recordID, totalBuyCount + 1) prizeGold = firstGoldPrize if (not totalBuyCount and firstGoldPrize) else gainGoldPrize - - addDRDict.update({"totalBuyCount":(totalBuyCount + 1)}) Sync_CoinToGoldCountInfo(curPlayer, [recordID]) return addGold, prizeGold, giveItemList, notifyMark -def DoCTGLogic(curPlayer, orderCoin, addGold, prizeGold, giveItemList, isAddBourseMoney, eventName, addDRDict, notifyMark=''): +def DoCTGLogic(curPlayer, orderCoin, addGold, prizeGold, giveItemList, isAddBourseMoney, eventName, addDRDict, notifyMark='', ipyData=None): goldBefore = curPlayer.GetGold() bourseMoneyBefore = PlayerControl.GetMoney(curPlayer, ShareDefine.TYPE_Price_BourseMoney) @@ -305,6 +319,9 @@ #开服活动 OpenServerCampaign.AddOpenServerCampaignRecordData(curPlayer, ShareDefine.Def_Campaign_Type_Recharge, orderCoin) PlayerWeekParty.AddWeekPartyActionCnt(curPlayer, ChConfig.Def_WPAct_Recharge, addVIPExp) + #投资 + if ipyData: + PlayerGoldInvest.InvestByCTG(curPlayer, ipyData.GetCTGID()) GameWorld.Log("Billing: eventName=%s, %s" % (eventName, addDRDict), curPlayer.GetPlayerID()) return -- Gitblit v1.8.0