8701 【主干】【后端】活动相关的充值界面显示优化(永久累充、每日礼包、限时礼包、累计充值);
| | |
| | | {
|
| | | DWORD _GiftbagID; //礼包编号
|
| | | WORD GiftbagType; //礼包类型
|
| | | DWORD OriginalRMB; //原价(RMB)
|
| | | float OriginalRMB; //原价(RMB)
|
| | | WORD BuyCountLimit; //限购次数,0不限购
|
| | | list GiftItemList; //礼包物品信息列表 [(物品ID,个数,是否绑定),...]
|
| | | DWORD MainItemID; //标的物品ID
|
| | |
| | | struct tagTotalRechargeTemplate
|
| | | {
|
| | | DWORD _TemplateID; //模板ID
|
| | | DWORD NeedGold; //需要充值仙玉数
|
| | | float NeedGold; //需要充值RMB,元
|
| | | BYTE AwardIndex; //返利奖励索引0~31,同个模板中不重复
|
| | | dict AwardItem; //返利物品信息列表 {职业:[(物品ID,个数,是否绑定),...]}
|
| | | char NotifyKey; //全服广播key,默认两个参数(玩家名, 档位额度)
|
| | |
| | | struct tagHistoryRechargeAward
|
| | | {
|
| | | BYTE _ID; //id
|
| | | DWORD Recharge; //所需充值元
|
| | | float NeedRMB; //所需充值元
|
| | | dict Reward; //职业对应的奖励内容,每个职业4组数据,物品ID和物品数量(1.枪豪2.道师3.剑修)
|
| | | }; |
| | |
| | |
|
| | | return ""
|
| | |
|
| | | def RMBToCoin(floatRMB):
|
| | | ''' 元转为分,统一函数,方便修改及搜索
|
| | | @param floatRMB: 单位元,float 类型,支持 RMB 或 美元
|
| | | @return: 转化为分数值
|
| | | '''
|
| | | # 由于float会有不精确的现象出现xxx.9999999的问题,所以这里计算出的结果向上取整
|
| | | return int(math.ceil(floatRMB * 100))
|
| | |
| | | "FlashGiftbag":(
|
| | | ("DWORD", "GiftbagID", 1),
|
| | | ("WORD", "GiftbagType", 0),
|
| | | ("DWORD", "OriginalRMB", 0),
|
| | | ("float", "OriginalRMB", 0),
|
| | | ("WORD", "BuyCountLimit", 0),
|
| | | ("list", "GiftItemList", 0),
|
| | | ("DWORD", "MainItemID", 0),
|
| | |
| | |
|
| | | "TotalRechargeTemplate":(
|
| | | ("DWORD", "TemplateID", 1),
|
| | | ("DWORD", "NeedGold", 0),
|
| | | ("float", "NeedGold", 0),
|
| | | ("BYTE", "AwardIndex", 0),
|
| | | ("dict", "AwardItem", 0),
|
| | | ("char", "NotifyKey", 0),
|
| | |
| | |
|
| | | "HistoryRechargeAward":(
|
| | | ("BYTE", "ID", 1),
|
| | | ("DWORD", "Recharge", 0),
|
| | | ("float", "NeedRMB", 0),
|
| | | ("dict", "Reward", 0),
|
| | | ),
|
| | | }
|
| | |
| | | def __init__(self): |
| | | self.GiftbagID = 0
|
| | | self.GiftbagType = 0
|
| | | self.OriginalRMB = 0
|
| | | self.OriginalRMB = 0.0
|
| | | self.BuyCountLimit = 0
|
| | | self.GiftItemList = []
|
| | | self.MainItemID = 0
|
| | |
| | | |
| | | def __init__(self): |
| | | self.TemplateID = 0
|
| | | self.NeedGold = 0
|
| | | self.NeedGold = 0.0
|
| | | self.AwardIndex = 0
|
| | | self.AwardItem = {}
|
| | | self.NotifyKey = "" |
| | | return |
| | | |
| | | def GetTemplateID(self): return self.TemplateID # 模板ID
|
| | | def GetNeedGold(self): return self.NeedGold # 需要充值仙玉数
|
| | | def GetNeedGold(self): return self.NeedGold # 需要充值RMB,元
|
| | | def GetAwardIndex(self): return self.AwardIndex # 返利奖励索引0~31,同个模板中不重复
|
| | | def GetAwardItem(self): return self.AwardItem # 返利物品信息列表 {职业:[(物品ID,个数,是否绑定),...]}
|
| | | def GetNotifyKey(self): return self.NotifyKey # 全服广播key,默认两个参数(玩家名, 档位额度) |
| | |
| | | |
| | | def __init__(self): |
| | | self.ID = 0
|
| | | self.Recharge = 0
|
| | | self.NeedRMB = 0.0
|
| | | self.Reward = {} |
| | | return |
| | | |
| | | def GetID(self): return self.ID # id
|
| | | def GetRecharge(self): return self.Recharge # 所需充值元
|
| | | def GetNeedRMB(self): return self.NeedRMB # 所需充值元
|
| | | def GetReward(self): return self.Reward # 职业对应的奖励内容,每个职业4组数据,物品ID和物品数量(1.枪豪2.道师3.剑修) |
| | |
|
| | |
|
| | |
| | | import ItemCommon
|
| | | import GameWorld
|
| | | import ChConfig
|
| | | import CommFunc
|
| | |
|
| | | def GetTemplateID(cfgID, dayIndex, actNum):
|
| | | if cfgID == None or dayIndex == None:
|
| | |
| | | if awardRecord & pow(2, awardIndex):
|
| | | continue
|
| | |
|
| | | needGold = ipyData.GetNeedGold()
|
| | | needGold = CommFunc.RMBToCoin(ipyData.GetNeedGold())
|
| | | if curRechargeGold < needGold:
|
| | | continue
|
| | | awardRecord |= pow(2, awardIndex)
|
| | |
| | | awardItemList = __GetItemList(ipyData.GetAwardItem(), job, playerWorldLV)
|
| | | batchPlayerIDList.append([playerID])
|
| | | batchAddItemList.append(awardItemList)
|
| | | batchParamList.append([needGold])
|
| | | batchParamList.append([str(ipyData.GetNeedGold())]) # 钱支持小数,显示参数传字符串
|
| | |
|
| | | if batchPlayerIDList:
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TotalRechargeAwardRecord % actNum, awardRecord)
|
| | |
| | | GameWorld.DebugLog("找不到该返利活动档位索引奖励!actNum=%s,templateID=%s,awardIndex=%s" % (actNum, templateID, awardIndex), playerID)
|
| | | return
|
| | |
|
| | | needGold = awardIpyData.GetNeedGold()
|
| | | needGold = CommFunc.RMBToCoin(awardIpyData.GetNeedGold())
|
| | | actWorldLV = actTotalRechargeInfo.get(ShareDefine.ActKey_WorldLV, 0)
|
| | | awardItemList = __GetItemList(ipyData.GetAwardItem(), curPlayer.GetJob(), actWorldLV)
|
| | |
|
| | |
| | |
|
| | | notifyKey = awardIpyData.GetNotifyKey()
|
| | | if notifyKey:
|
| | | PlayerControl.WorldNotify(0, notifyKey, [curPlayer.GetPlayerName(), needGold])
|
| | | PlayerControl.WorldNotify(0, notifyKey, [curPlayer.GetPlayerName(), str(awardIpyData.GetNeedGold())]) # 钱支持小数,显示参数传字符串
|
| | |
|
| | | for itemID, itemCount, _ in awardItemList:
|
| | | ItemControler.GivePlayerItem(curPlayer, itemID, itemCount, 0, [IPY_GameWorld.rptItem])
|
| | |
| | | for ipyData in ipyDataList:
|
| | | awardInfo = ChPyNetSendPack.tagMCTotalRechargeAward()
|
| | | awardInfo.AwardIndex = ipyData.GetAwardIndex()
|
| | | awardInfo.NeedGold = ipyData.GetNeedGold()
|
| | | awardInfo.NeedGold = CommFunc.RMBToCoin(ipyData.GetNeedGold())
|
| | | awardInfo.AwardItem = []
|
| | | awardItemList = __GetItemList(ipyData.GetAwardItem(), job, actWorldLV)
|
| | | for awardItemInfo in awardItemList:
|
| | |
| | | import PlayerWeekParty
|
| | | import PlayerGoldInvest
|
| | | import ItemCommon
|
| | | import CommFunc
|
| | |
|
| | | import time
|
| | |
|
| | |
| | | ## 直接充值自定义金额
|
| | | prizeGold = 0
|
| | | giveItemList = []
|
| | | orderCoin = orderRMB * 100
|
| | | orderCoin = CommFunc.RMBToCoin(orderRMB)
|
| | | addGold = orderRMB * GetCoinRate()
|
| | | addDRDict = {"orderCoin":orderCoin, "isAddBourseMoney":isAddBourseMoney, "eventName":eventName}
|
| | | DoCTGLogic(curPlayer, CoinType_Gold, orderCoin, addGold, prizeGold, giveItemList, isAddBourseMoney, eventName, addDRDict)
|
| | |
| | | ## 使用赠送的物品兑换点券,一般用于bt版
|
| | | prizeGold = 0
|
| | | giveItemList = []
|
| | | orderCoin = orderRMB * 100 # 单位,分
|
| | | orderCoin = CommFunc.RMBToCoin(orderRMB) # 单位,分
|
| | | addGold = orderRMB * GetCoinRate()
|
| | | addDRDict = {"orderCoin":orderCoin, "eventName":eventName}
|
| | | DoCTGLogic(curPlayer, CoinType_Item, orderCoin, addGold, prizeGold, giveItemList, isAddBourseMoney, eventName, addDRDict)
|
| | |
| | | return
|
| | |
|
| | | cPlayerCoin = CPY_PlayerCoinToGold()
|
| | | cPlayerCoin.useCoin = int(ipyData.GetPayRMBNum() * 100)
|
| | | cPlayerCoin.useCoin = CommFunc.RMBToCoin(ipyData.GetPayRMBNum())
|
| | | cPlayerCoin.orderInfo = orderInfo
|
| | | cPlayerCoin.appID = appID
|
| | | cPlayerCoin.isAddBourseMoney = isAddBourseMoney
|
| | |
| | | return
|
| | |
|
| | | payRMBNum = ipyData.GetPayRMBNum() # 单位,元
|
| | | if orderCoin != int(payRMBNum * 100):
|
| | | if orderCoin != CommFunc.RMBToCoin(payRMBNum):
|
| | | DataRecordPack.DR_CTGError(curPlayer, "The orderCoin is not equal to the ipyData's RMB(%s)!" % payRMBNum, addDRDict)
|
| | | return
|
| | |
|
| | |
| | | DataRecordPack.DR_CTGOK(curPlayer, addDRDict)
|
| | |
|
| | | #---充值成功后逻辑---
|
| | | orderRMB = orderCoin / 100
|
| | | # 功能统一以分存储记录,玩家字典不支持存小数
|
| | | |
| | | # 所有真实充值均有效的
|
| | | if coinType in [CoinType_Gold, CoinType_Buy]:
|
| | | #跨服充值排行活动
|
| | | CrossActCTGBillboard.AddCTGRMB(curPlayer, orderRMB)
|
| | | CrossActCTGBillboard.AddCTGRMB(curPlayer, orderCoin)
|
| | |
|
| | | #仙界盛典-充值大礼
|
| | | PlayerFairyCeremony.OnFCRecharge(curPlayer)
|
| | | PlayerNewFairyCeremony.OnFCRecharge(curPlayer)
|
| | | PlayerGoldGift.OnPlayerChargeGold(curPlayer, addGold)
|
| | | PlayerGoldGift.OnPlayerChargeGold(curPlayer)
|
| | | #累积充值X元
|
| | | PlayerActTotalRecharge.AddTotalRechargeGold(curPlayer, orderCoin/100, 1)
|
| | | PlayerActTotalRecharge.AddTotalRechargeGold(curPlayer, orderCoin/100, 2)
|
| | | PlayerFairyCeremony.AddFCCTGRMB(curPlayer, orderCoin/100)
|
| | | PlayerNewFairyCeremony.AddFCCostGold(curPlayer, orderCoin/100)
|
| | | PlayerActTotalRecharge.AddTotalRechargeGold(curPlayer, orderCoin, 1)
|
| | | PlayerActTotalRecharge.AddTotalRechargeGold(curPlayer, orderCoin, 2)
|
| | | PlayerFairyCeremony.AddFCCTGRMB(curPlayer, orderCoin)
|
| | | PlayerNewFairyCeremony.AddFCCostGold(curPlayer, orderCoin)
|
| | | #开服活动
|
| | | #OpenServerCampaign.AddOpenServerCampaignRecordData(curPlayer, ShareDefine.Def_Campaign_Type_Recharge, orderCoin)
|
| | | PlayerWeekParty.AddWeekPartyActionCnt(curPlayer, ChConfig.Def_WPAct_Recharge, addVIPExp)
|
| | |
| | | import ItemCommon
|
| | | import GameWorld
|
| | | import ChConfig
|
| | | import CommFunc
|
| | |
|
| | | def OnPlayerLogin(curPlayer):
|
| | | __CheckPlayerDailyGiftbagAction(curPlayer)
|
| | |
| | | giftBag.OrderInfo = "" if not orderIpyData else orderIpyData.GetOrderInfo()
|
| | | giftBag.OrderInfoLen = len(giftBag.OrderInfo)
|
| | | giftBag.BuyCountLimit = giftIpyData.GetBuyCountLimit()
|
| | | giftBag.RMB = 0 if not orderIpyData else int(orderIpyData.GetPayRMBNum())
|
| | | giftBag.RMB = 0 if not orderIpyData else CommFunc.RMBToCoin(orderIpyData.GetPayRMBNum())
|
| | | giftBag.ItemInfo = []
|
| | | for itemID, itemCount, isBind in __GetJobItemList(giftIpyData.GetGiftItemList(), curPlayer.GetJob()):
|
| | | item = ChPyNetSendPack.tagMCDailyGiftbagItem()
|
| | |
| | | import ItemCommon
|
| | | import GameWorld
|
| | | import ChConfig
|
| | | import CommFunc
|
| | |
|
| | |
|
| | | def GetGiftbagTypeList(cfgID, dayIndex, woldLV):
|
| | |
| | | notifyKey = giftbagIpyData.GetNotifyKey()
|
| | | if notifyKey:
|
| | | orderIpyData = GetFlashGiftbagIDOrderInfoIpyData(giftbagID, appID)
|
| | | rmb = 0 if not orderIpyData else int(orderIpyData.GetPayRMBNum())
|
| | | rmb = "0" if not orderIpyData else str(orderIpyData.GetPayRMBNum()) # RMB支持小数,这里直接转str广播
|
| | | PlayerControl.WorldNotify(0, notifyKey, [curPlayer.GetPlayerName(), rmb, giftbagIpyData.GetMainItemID()])
|
| | |
|
| | | SyncFlashGiftbagBuyCount(curPlayer, [giftbagID])
|
| | |
| | | giftBag.OrderInfo = "" if not orderIpyData else orderIpyData.GetOrderInfo()
|
| | | giftBag.OrderInfoLen = len(giftBag.OrderInfo)
|
| | | giftBag.BuyCountLimit = giftIpyData.GetBuyCountLimit()
|
| | | giftBag.RMB = 0 if not orderIpyData else int(orderIpyData.GetPayRMBNum())
|
| | | giftBag.RMBOriginal = giftIpyData.GetOriginalRMB()
|
| | | giftBag.RMB = 0 if not orderIpyData else CommFunc.RMBToCoin(orderIpyData.GetPayRMBNum())
|
| | | giftBag.RMBOriginal = CommFunc.RMBToCoin(giftIpyData.GetOriginalRMB())
|
| | | giftBag.ItemInfo = []
|
| | | for itemID, itemCount, isBind in __GetJobItemList(giftIpyData.GetGiftItemList(), curPlayer.GetJob()):
|
| | | item = ChPyNetSendPack.tagMCFlashGiftbagItem()
|
| | |
| | | import NetPackCommon
|
| | | import IpyGameDataPY
|
| | | import PlayerTJG
|
| | | import CommFunc
|
| | | import ChEquip
|
| | |
|
| | | import time
|
| | |
| | | # @param curPlayer: 玩家
|
| | | # @param addGold: 充元宝数
|
| | | # @return: None
|
| | | def OnPlayerChargeGold(curPlayer, addGold):
|
| | | def OnPlayerChargeGold(curPlayer):
|
| | | DayChargeRedPackAward(curPlayer)
|
| | |
|
| | | firstGoldServerDay = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_FirstGoldServerDay)
|
| | |
| | | if not ipyData:
|
| | | return
|
| | |
|
| | | getRecharge = ipyData.GetRecharge()
|
| | | needCoin = CommFunc.RMBToCoin(ipyData.GetNeedRMB())
|
| | | # 检查可否领取
|
| | |
|
| | | # 玩家充值小于领取充值
|
| | | if curPlayer.GetChangeCoinPointTotal()/100 < getRecharge:
|
| | | GameWorld.ErrLog("OnGetHistoryRechargeAward error:getRecharge=%s greater than ChangeCoinPointTotal=%s" % (getRecharge, curPlayer.GetChangeCoinPointTotal()))
|
| | | if curPlayer.GetChangeCoinPointTotal() < needCoin:
|
| | | GameWorld.ErrLog("OnGetHistoryRechargeAward error:needCoin=%s greater than ChangeCoinPointTotal=%s" |
| | | % (needCoin, curPlayer.GetChangeCoinPointTotal()))
|
| | | return
|
| | | awardInfo = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_HistoryChargeAwardGetRecord, 0)
|
| | | awardMark = pow(2, awardID)
|
| | | if awardInfo & awardMark:
|
| | | #已领取
|
| | | GameWorld.DebugLog("已领取历史充值奖励!awardID=%s,getRecharge=%s" % (awardID, getRecharge))
|
| | | GameWorld.DebugLog("已领取历史充值奖励!awardID=%s,needCoin=%s" % (awardID, needCoin))
|
| | | return
|
| | |
|
| | | job = curPlayer.GetJob()
|
| | |
| | | Sync_HistoryChargeAwardGetRecordInfo(curPlayer)
|
| | |
|
| | | # 记录领取事件
|
| | | DataRecordPack.SendEventPack("HistoryRechargeAward", {'awardID':awardID, 'getRecharge':getRecharge}, curPlayer)
|
| | | DataRecordPack.SendEventPack("HistoryRechargeAward", {'awardID':awardID, 'needCoin':needCoin}, curPlayer)
|
| | | return
|
| | |
|
| | |
|