| | |
| | | import NetPackCommon
|
| | | import IpyGameDataPY
|
| | | import ShareDefine
|
| | | import PlayerFlashGiftbag
|
| | | import PlayerDailyGiftbag
|
| | | import PlayerGoldGift
|
| | | import PlayerActTotalRecharge
|
| | | import PlayerActRechargeRebateGold
|
| | | import PlayerActFamilyCTGAssist
|
| | | import PlayerActManyDayRecharge
|
| | | import PlayerActSingleRecharge
|
| | | import PlayerActRechargePrize
|
| | | import CrossActCTGBillboard
|
| | | import CrossActAllRecharge
|
| | | import PlayerActGrowupBuy
|
| | | import PlayerWeekParty
|
| | | import PlayerActHeroAppear
|
| | | import PlayerGoldInvest
|
| | | import PlayerActTurntable
|
| | | import PlayerTongTianLing
|
| | | import PlayerZhanling
|
| | | import PlayerGoldRush
|
| | | import PlayerLLMJ
|
| | | import ItemCommon
|
| | | import PyGameData
|
| | | import DBDataMgr
|
| | | import CommFunc
|
| | |
|
| | | import time
|
| | |
| | | ## 充值相关过天
|
| | |
|
| | | #在重置之前需要处理的
|
| | | PlayerActGrowupBuy.DoUpdateGrowupBuyStateOnDay(curPlayer) # 成长必买
|
| | |
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TodayCTGCoinTotal, 0)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_CTGRealToday, 0)
|
| | |
| | | PlayerControl.SendMailByKey("ExchangeToPayCoin", [playerID], addItemList, paramList)
|
| | |
|
| | | if payOrderType != PayOrderType_PayCoin:
|
| | | serverDay = GameWorld.GetGameWorld().GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_ServerDay) + 1
|
| | | serverDay = DBDataMgr.GetEventTrigMgr().GetValue(ShareDefine.Def_ServerDay) + 1
|
| | | addDRDict.update({"coinType":ChConfig.CoinType_ExchangePayCoin, "PayCoin":[befPayCoin, aftPayCoin],
|
| | | "VIPLv":curPlayer.GetVIPLv(), "ServerDay":serverDay, "eventName":eventName})
|
| | | DataRecordPack.DR_CTGOK(curPlayer, addDRDict)
|
| | |
| | | return
|
| | | moneyType, addGold, prizeGold, giveItemList, ctgIpyData = ctgResultInfo
|
| | |
|
| | | elif ipyData.GetGiftbagID():
|
| | | giftbagID = ipyData.GetGiftbagID()
|
| | | if 100 <= giftbagID < 199:
|
| | | if not PlayerDailyGiftbag.OnPlayerOrderDailyGiftbag(curPlayer, giftbagID, addDRDict):
|
| | | return
|
| | | elif not PlayerFlashGiftbag.OnPlayerOrderGiftbag(curPlayer, [ipyData.GetGiftbagID()], addDRDict):
|
| | | return
|
| | | else:
|
| | | #用于支付其他的商品,待扩展...
|
| | | DataRecordPack.DR_CTGError(curPlayer, "The orderInfo is useless!", addDRDict)
|
| | |
| | |
|
| | | addDRDict.update({"recordID":recordID})
|
| | |
|
| | | # 成长必买类型
|
| | | if ipyData.GetPayType() == PayType_GrowupBuy:
|
| | | canBuy, errInfo = PlayerActGrowupBuy.CheckGrowupBuyState(curPlayer, recordID)
|
| | | if not canBuy:
|
| | | DataRecordPack.DR_CTGError(curPlayer, errInfo, addDRDict)
|
| | | return
|
| | | |
| | | totalBuyCountLimit = ipyData.GetTotalBuyCount()
|
| | | totalBuyCount = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_CTGGoodsBuyCount % recordID)
|
| | | if totalBuyCountLimit:
|
| | |
| | | giveItemList = []
|
| | | giveItemList += GetCTGGiveItemList(ipyData)
|
| | | giveItemList += selectItemList
|
| | | giveItemList += PlayerActHeroAppear.GetCTGActItemList(curPlayer, recordID) # 武将登场
|
| | |
|
| | | #payType = ipyData.GetPayType()
|
| | | moneyType = ipyData.GetMoneyType() # 获得货币类型
|
| | |
| | | gainGoldPrize = ipyData.GetGainGoldPrize() # 赠送货币数,首次充值赠送仙玉时,此仙玉不给
|
| | | firstGoldPrize = ipyData.GetFirstGoldPrize() # 首次充值赠送的仙玉
|
| | | prizeGold = firstGoldPrize if (not totalBuyCount and firstGoldPrize) else gainGoldPrize
|
| | | if moneyType == IPY_GameWorld.TYPE_Price_Gold_Money:
|
| | | #if payType in [PayType_Gold, PayType_GoldPlus] and PlayerGoldInvest.GetInvestState(curPlayer, ChConfig.InvestType_Life):
|
| | | # prizeGold = addGold # bt tqxbqy 版本,永久卡仙玉直充固定双倍
|
| | | actPrizeGold = PlayerActRechargePrize.DoAddPlayerActRechargePrizeCount(curPlayer, recordID)
|
| | | if actPrizeGold:
|
| | | prizeGold += actPrizeGold
|
| | | addDRDict.update({"actRechargePrize":1})
|
| | | |
| | | |
| | | syncRecordIDList = [recordID]
|
| | | # 打包购买 - 目前用于每日特惠,有需要可扩展为通用
|
| | | if recordID == IpyGameDataPY.GetFuncCfg("DailyTehui", 2):
|
| | |
| | | syncRecordIDList.append(ctgID)
|
| | | ctgItemList = GetCTGGiveItemList(ctgIpyData)
|
| | | packCTGIDDict[ctgID] = ctgItemList
|
| | | for itemID, itemCount, _ in ctgItemList:
|
| | | for itemInfo in ctgItemList:
|
| | | itemID, itemCount = itemInfo[:2]
|
| | | packItemDict[itemID] = packItemDict.get(itemID, 0) + itemCount
|
| | | __addCTGIDBuyCnt(curPlayer, ctgID)
|
| | | if packCTGIDDict:
|
| | |
| | | return []
|
| | |
|
| | | gainItemList = ipyData.GetGainItemList()
|
| | | actWorldLVGainItemInfo = ipyData.GetActWorldLVGainItemInfo()
|
| | | giveItemList = []
|
| | | # 活动世界等级对应物品信息,如果有对应活动支持 且 该配置有配,则默认走该配置,否则使用常规的默认物品配置
|
| | | payTypeActNameDict = {PayType_GrowupBuy:ShareDefine.OperationActionName_GrowupBuy,
|
| | | |
| | | # ... 有新增的活动需要支持,则在此新增配置上即可,后面取物品的逻辑都是一样的
|
| | | }
|
| | | if actWorldLVGainItemInfo and ipyData.GetPayType() in payTypeActNameDict:
|
| | | actName = payTypeActNameDict[ipyData.GetPayType()]
|
| | | actInfo = PyGameData.g_operationActionDict.get(actName, {}) # 注:相关状态在前置逻辑已经判断过,这里不再判断
|
| | | actWorldLV = actInfo.get(ShareDefine.ActKey_WorldLV, 0)
|
| | | actWorldLVList = [int(strWorldLV) for strWorldLV in actWorldLVGainItemInfo.keys()]
|
| | | actWorldLVList.sort() # 使用 int 的值排,否则可能引起排序错误
|
| | | for worldLV in actWorldLVList:
|
| | | if actWorldLV <= worldLV:
|
| | | giveItemList = actWorldLVGainItemInfo[str(worldLV)]
|
| | | break
|
| | | if not giveItemList:
|
| | | giveItemList = actWorldLVGainItemInfo[str(actWorldLVList[-1])] # 没有匹配到的话默认取最后一个等级配置
|
| | | else:
|
| | | giveItemList = gainItemList
|
| | | #actWorldLVGainItemInfo = ipyData.GetActWorldLVGainItemInfo()
|
| | | #giveItemList = []
|
| | | giveItemList = gainItemList
|
| | | return giveItemList
|
| | |
|
| | | def __OnCTGReal(curPlayer, orderCoin):
|
| | |
| | |
|
| | | if ctgIpyData and ctgIpyData.GetPayType() == PayType_PayCoin:
|
| | | # 代币充值,仅给代币,不触发其他内容
|
| | | ctgID = ctgIpyData.GetRecordID()
|
| | | coinType = ChConfig.CoinType_PayCoin
|
| | | orderInfo = addDRDict.get("orderInfo", "")
|
| | | orderCoin = addDRDict.get("orderCoin", 0)
|
| | | payOrderType = addDRDict.get("payOrderType", PayOrderType_Default)
|
| | | playerID = curPlayer.GetPlayerID()
|
| | | moneyInfo = {}
|
| | | befPayCoin = PlayerControl.GetPayCoin(curPlayer)
|
| | | if addGold and moneyType == ShareDefine.TYPE_Price_PayCoin:
|
| | | drDict = {ChConfig.Def_Give_Reason_SonKey:orderInfo, "payOrderType":payOrderType, "orderInfo":orderInfo}
|
| | | PlayerControl.GiveMoney(curPlayer, moneyType, addGold, eventName, drDict)
|
| | | moneyInfo[moneyType] = addGold
|
| | | aftPayCoin = PlayerControl.GetPayCoin(curPlayer)
|
| | | # 三国版本充代币支持赠送元宝
|
| | | prizeMoneyType = IPY_GameWorld.TYPE_Price_Gold_Money
|
| | | if prizeGold > 0:
|
| | | PlayerControl.GiveMoney(curPlayer, prizeMoneyType, prizeGold, eventName, addDRDict, isGiveBourseMoney=isAddBourseMoney)
|
| | | moneyInfo[prizeMoneyType] = prizeGold
|
| | | |
| | | if moneyInfo:
|
| | | ItemControler.NotifyGiveAwardInfo(curPlayer, [], ChConfig.ItemGive_CTG, moneyInfo=moneyInfo, |
| | | dataEx={"orderInfo":orderInfo, "ctgID":ctgID})
|
| | |
|
| | | isRealMoney = True if addDRDict.get("orderID") else False # tqxbqy 真实订单充代币算真实充值
|
| | | if isRealMoney:
|
| | |
| | | ctgRealToday = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_CTGRealToday) # 当日真实货币充值Coin数 ,不含后台充值- 今日
|
| | | ctgRealTotal = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_CTGRealTotal) # 累计真实货币充值Coin数 ,不包后台充值 - 总计
|
| | | ctgRealFirstTime = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_CTGRealFirstTime) # 首次真实货币充值时间戳
|
| | | serverDay = GameWorld.GetGameWorld().GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_ServerDay) + 1
|
| | | addDRDict.update({"coinType":coinType, "PayCoin":[befPayCoin, aftPayCoin], |
| | | serverDay = DBDataMgr.GetEventTrigMgr().GetValue(ShareDefine.Def_ServerDay) + 1
|
| | | addDRDict.update({"coinType":coinType, "PayCoin":[befPayCoin, aftPayCoin], "moneyInfo":moneyInfo,
|
| | | "VIPLv":curPlayer.GetVIPLv(), "ServerDay":serverDay, "eventName":eventName,
|
| | | "ctgRealToday":ctgRealToday, "ctgRealTotal":ctgRealTotal, "ctgRealFirstTime":GameWorld.ChangeTimeNumToStr(ctgRealFirstTime) if ctgRealFirstTime else ""})
|
| | | DataRecordPack.DR_CTGOK(curPlayer, addDRDict)
|
| | |
| | |
|
| | | # 所有真实充值均有效的
|
| | | if coinType in [ChConfig.CoinType_Gold, ChConfig.CoinType_Buy, ChConfig.CoinType_UsePayCoin]:
|
| | | #跨服充值排行活动
|
| | | CrossActCTGBillboard.AddCTGRMB(curPlayer, orderCoin)
|
| | | #跨服全民充值
|
| | | CrossActAllRecharge.AddCTGRMB(curPlayer, orderCoin)
|
| | | PlayerActManyDayRecharge.AddManyDayRechargeValue(curPlayer, orderCoin) # 多日连充
|
| | | |
| | | # 只算充仙玉的
|
| | | if coinType == ChConfig.CoinType_Gold:
|
| | | PlayerActRechargeRebateGold.AddRechargeRebateGoldRMB(curPlayer, addGold)
|
| | |
|
| | | #累积充值X元
|
| | | PlayerActTotalRecharge.AddTotalRechargeGold(curPlayer, orderCoin, coinType)
|
| | | PlayerActSingleRecharge.UpdSingleRechargeValue(curPlayer, orderCoin, coinType) # 单笔累充
|
| | | PlayerActTurntable.OnPlayerRecharge(curPlayer, orderCoin, coinType) # 转盘
|
| | | PlayerWeekParty.AddWeekPartyActionCnt(curPlayer, ChConfig.Def_WPAct_Recharge, addVIPExp)
|
| | | #投资
|
| | | if ctgIpyData:
|
| | | ctgID = ctgIpyData.GetRecordID()
|
| | | #PlayerActFamilyCTGAssist.OnPlayerCTG(curPlayer, ctgID)
|
| | | PlayerGoldInvest.InvestByCTG(curPlayer, ctgID)
|
| | | PlayerGoldGift.OnGiftByCTGID(curPlayer, ctgID)
|
| | | PlayerZhanling.OnActiviteByCTGID(curPlayer, ctgID)
|
| | | PlayerGoldRush.OnGoldRushByCTGID(curPlayer, ctgID)
|
| | | PlayerTongTianLing.OnActiviteTTTByCTGID(curPlayer, ctgID)
|
| | | PlayerLLMJ.OnActiviteByCTGID(curPlayer, ctgID)
|
| | |
|
| | | serverDay = GameWorld.GetGameWorld().GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_ServerDay) + 1
|
| | | serverDay = DBDataMgr.GetEventTrigMgr().GetValue(ShareDefine.Def_ServerDay) + 1
|
| | | addDRDict.update({"gold":[goldBefore, goldAfter], "changeCoinPoint":[changeCoinPointBefore, changeCoinPointAfter], "todayCTGCoinTotal":todayCTGCoinTotal,
|
| | | "bourseMoney":[bourseMoneyBefore, bourseMoneyAfter], "addGold":addGold, "prizeGold":prizeGold, "giveItemList":giveItemList, "coinType":coinType,
|
| | | "coinExp":coinExp, "addVIPExp":addVIPExp, "VIPLv":curPlayer.GetVIPLv(), "ServerDay":serverDay,
|