10090 【后端】越南货币价格(coin与越南盾默认1:1;充值表增加货币类型字段;充值表配置代币充值;)
10个文件已修改
125 ■■■■ 已修改文件
PySysDB/PySysDBPY.h 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/CoreServerGroup/GameServer/Script/CommFunc.py 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/CommFunc.py 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/CrossActAllRecharge.py 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/CrossActCTGBillboard.py 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerActManyDayRecharge.py 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerActTotalRecharge.py 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerCoin.py 80 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
PySysDB/PySysDBPY.h
@@ -1532,8 +1532,9 @@
    BYTE        DailyBuyCount;    //每日限购次数
    BYTE        WeekBuyCount;    //每周限购次数
    BYTE        MonthBuyCount;    //每月限购次数
    WORD        GainGold;    //获得仙玉数
    WORD        GainGoldPrize;    //赠送仙玉数
    BYTE        MoneyType;    //获得货币类型
    WORD        GainGold;    //获得货币数
    WORD        GainGoldPrize;    //赠送货币数
    WORD        FirstGoldPrize;    //首次充值该档位赠送仙玉
    list        GainItemList;    //获得物品列表[[物品ID,个数,是否绑定], ...]
    dict        ActWorldLVGainItemInfo;    //根据活动世界等级获得物品信息,活动专用 {"世界等级":[[物品ID,个数,是否绑定], ...], ...}
ServerPython/CoreServerGroup/GameServer/Script/CommFunc.py
@@ -560,10 +560,11 @@
    return ""
def RMBToCoin(floatRMB):
    ''' 元转为分,统一函数,方便修改及搜索
    ''' 元转为coin,统一函数,方便修改及搜索
    @param floatRMB: 单位元,float 类型,支持 RMB 或 美元
    @return: 转化为分数值
    @return: 转化为coin数值
    '''
    # 由于float会有不精确的现象出现xxx.9999999的问题,所以这里计算出的结果向上取整
    return int(math.ceil(floatRMB * 100))
    # 由于float会有不精确的现象出现xxx.9999999或xxx.0000000000001的问题,所以这里计算出的结果向上取整
    rate = 1 # 越南版本配表及coin均使用越南盾原值,即比例为1:1
    return int(math.ceil(round(floatRMB * rate)))
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
@@ -6053,4 +6053,5 @@
CoinType_4,
CoinType_5,
CoinType_ExchangePayCoin, # 代表转换 6
) = range(7)
CoinType_PayCoin, # 代币充值 7
) = range(8)
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/CommFunc.py
@@ -593,17 +593,20 @@
    return ""
def CoinToYuan(orderCoin):
    '''分转化为元
    '''coin转化为元
    '''
    yuan = orderCoin / 100.0
    rate = 1
    yuan = orderCoin / float(rate)
    if str(yuan).endswith(".0"):
        return int(yuan)
    return yuan
def RMBToCoin(floatRMB):
    ''' 元转为分,统一函数,方便修改及搜索
    ''' 元转为coin,统一函数,方便修改及搜索
    @param floatRMB: 单位元,float 类型,支持 RMB 或 美元
    @return: 转化为分数值
    @return: 转化为coin数值
    '''
    # 由于float会有不精确的现象出现xxx.9999999或xxx.0000000000001的问题,所以这里计算出的结果向上取整
    return int(math.ceil(round(floatRMB * 100)))
    rate = 1 # 越南版本配表及coin均使用越南盾原值,即比例为1:1
    return int(math.ceil(round(floatRMB * rate)))
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py
@@ -1223,6 +1223,7 @@
                        ("BYTE", "DailyBuyCount", 0),
                        ("BYTE", "WeekBuyCount", 0),
                        ("BYTE", "MonthBuyCount", 0),
                        ("BYTE", "MoneyType", 0),
                        ("WORD", "GainGold", 0),
                        ("WORD", "GainGoldPrize", 0),
                        ("WORD", "FirstGoldPrize", 0),
@@ -4711,6 +4712,7 @@
        self.DailyBuyCount = 0
        self.WeekBuyCount = 0
        self.MonthBuyCount = 0
        self.MoneyType = 0
        self.GainGold = 0
        self.GainGoldPrize = 0
        self.FirstGoldPrize = 0
@@ -4726,8 +4728,9 @@
    def GetDailyBuyCount(self): return self.DailyBuyCount # 每日限购次数
    def GetWeekBuyCount(self): return self.WeekBuyCount # 每周限购次数
    def GetMonthBuyCount(self): return self.MonthBuyCount # 每月限购次数
    def GetGainGold(self): return self.GainGold # 获得仙玉数
    def GetGainGoldPrize(self): return self.GainGoldPrize # 赠送仙玉数
    def GetMoneyType(self): return self.MoneyType # 获得货币类型
    def GetGainGold(self): return self.GainGold # 获得货币数
    def GetGainGoldPrize(self): return self.GainGoldPrize # 赠送货币数
    def GetFirstGoldPrize(self): return self.FirstGoldPrize # 首次充值该档位赠送仙玉
    def GetGainItemList(self): return self.GainItemList # 获得物品列表[[物品ID,个数,是否绑定], ...]
    def GetActWorldLVGainItemInfo(self): return self.ActWorldLVGainItemInfo # 根据活动世界等级获得物品信息,活动专用 {"世界等级":[[物品ID,个数,是否绑定], ...], ...}
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/CrossActAllRecharge.py
@@ -139,7 +139,7 @@
        GameWorld.DebugLog("跨服全民充值非活动中! playerServerID=%s" % GameWorld.GetPlayerServerID(curPlayer), curPlayer.GetPlayerID())
        return
    
    totalRMB = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_CA_AllRechargeRMB) + addRMB
    totalRMB = min(curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_CA_AllRechargeRMB) + addRMB, ChConfig.Def_UpperLimit_DWord)
    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_CA_AllRechargeRMB, totalRMB)
    
    GameWorld.DebugLog("跨服全民充值活动增加玩家累计充值RMB: addRMB=%s,totalRMB=%s" % (addRMB, totalRMB), curPlayer.GetPlayerID())
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/CrossActCTGBillboard.py
@@ -185,7 +185,7 @@
        GameWorld.DebugLog("玩家区服ID跨服充值排行非活动中!playerServerID=%s" % GameWorld.GetPlayerServerID(curPlayer))
        return
    
    totalRMB = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_CA_CTGBillboardRMB) + addRMB
    totalRMB = min(curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_CA_CTGBillboardRMB) + addRMB, ChConfig.Def_UpperLimit_DWord)
    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_CA_CTGBillboardRMB, totalRMB)
    
    GameWorld.DebugLog("跨服充值排行活动增加玩家累计充值RMB: addRMB=%s,totalRMB=%s" % (addRMB, totalRMB), curPlayer.GetPlayerID())
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerActManyDayRecharge.py
@@ -160,7 +160,7 @@
            continue
        
        curRechargeValue = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ManyDayRechargeValue % (actNum, dayIndex))
        updRechargeValue = curRechargeValue + addValue
        updRechargeValue = min(curRechargeValue + addValue, ChConfig.Def_UpperLimit_DWord)
        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ManyDayRechargeValue % (actNum, dayIndex), updRechargeValue)
        Sync_ManyDayRechargePlayerInfo(curPlayer, actNum)
        GameWorld.DebugLog("多日连充充值活动增加充值额度: actNum=%s,dayIndex=%s,curRechargeValue=%s,addValue=%s,updRechargeValue=%s" 
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerActTotalRecharge.py
@@ -180,7 +180,7 @@
        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TotalRechargeTemplateID % actNum, templateID)
        
        curRechargeGold = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TotalRechargeGold % actNum)
        updRechargeGold = curRechargeGold + addGold
        updRechargeGold = min(curRechargeGold + addGold, ChConfig.Def_UpperLimit_DWord)
        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TotalRechargeGold % actNum, updRechargeGold)
        Sync_TotalRechargeInfo(curPlayer, actNum)
        GameWorld.DebugLog("玩家累计充值活动: actNum=%s,actID=%s,templateID=%s,curRechargeGold=%s,addGold=%s,updRechargeGold=%s" 
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerCoin.py
@@ -80,10 +80,13 @@
PayOrderType_PayCoin, # 代币 6
) = range(1, 1 + 6)
PayOrderType_Default = PayOrderType_VND
# 充值类型定义
PayType_Gold = 2  # 常规仙玉充值
PayType_GoldPlus = 3  # 至尊仙玉充值
PayType_GrowupBuy = 16  # 成长必买
PayType_PayCoin = 17  # 代币充值
#---------------------------------------------------------------------
#注意: GetChangeCoinPointTotal 充值点和赠送点总和
@@ -266,12 +269,8 @@
    ipyData = IpyGameDataPY.GetIpyGameData("OrderInfo", orderInfo, appID)
    if not ipyData:
        return
    if "@9997@" in curPlayer.GetAccID():
        orderCoin = CommFunc.RMBToCoin(ipyData.GetUsdMoney())
    else:
        orderCoin = CommFunc.RMBToCoin(ipyData.GetPayRMBNum())
    cPlayerCoin = CPY_PlayerCoinToGold()
    cPlayerCoin.useCoin = orderCoin
    cPlayerCoin.useCoin = CommFunc.RMBToCoin(ipyData.GetPayRMBNum())
    cPlayerCoin.orderInfo = orderInfo
    cPlayerCoin.appID = appID
    cPlayerCoin.orderID = ""
@@ -285,7 +284,7 @@
    '''
    orderInfo = addDRDict.get("orderInfo", "")
    orderCoin = addDRDict.get("orderCoin", 0)
    payOrderType = addDRDict.get("payOrderType", PayOrderType_RMB)
    payOrderType = addDRDict.get("payOrderType", PayOrderType_Default)
    if not orderCoin or not orderInfo:
        DataRecordPack.DR_CTGError(curPlayer, errorInfo, addDRDict)
        return
@@ -368,9 +367,6 @@
        return
    
    cPlayerCoin = CPY_PlayerCoinToGold()
    if "@9997@" in curPlayer.GetAccID():
        cPlayerCoin.useCoin = CommFunc.RMBToCoin(ipyData.GetUsdMoney())
    else:
        cPlayerCoin.useCoin = CommFunc.RMBToCoin(ipyData.GetPayRMBNum())
    cPlayerCoin.orderInfo = orderInfo
    cPlayerCoin.appID = appID
@@ -383,9 +379,9 @@
# @param useCoin 使用的点卷
# @param eventName 兑换事件名
# @return None
def PlayerCoinToGold(curPlayer, chargeInfo, eventName, payOrderType=PayOrderType_RMB):
def PlayerCoinToGold(curPlayer, chargeInfo, eventName, payOrderType=PayOrderType_Default):
    ## 按商品编号充值
    orderCoin = chargeInfo.GetCoin() # 金额 已乘以100  人民币单位为分
    orderCoin = chargeInfo.GetCoin()
    #notePrizeCoin = chargeInfo.GetPrizeCoin()
    orderInfo = chargeInfo.GetOrderInfo() # 商品编号
    orderID = chargeInfo.GetOrderID() #订单号,兑换成功后清除
@@ -408,27 +404,10 @@
        DataRecordPack.DR_CTGError(curPlayer, "Can not found the orderInfo.", addDRDict)
        return
    
    # quick海外用美元验证
    if "@9997@" in curPlayer.GetAccID():
        GameWorld.Log("quikc海外充值验证美元: orderInfo=%s,orderCoin=%s,orderID=%s" % (orderInfo, orderCoin, orderID), curPlayer.GetPlayerID())
        orderCoinUsd = orderCoin # 入库的是美元分
        orderCoin = CommFunc.RMBToCoin(ipyData.GetPayRMBNum()) # 游戏内orderCoin转化为人民币
        usdMoney = ipyData.GetUsdMoney()
        GameWorld.Log("    转化后: orderInfo=%s,orderCoin=%s,orderCoinUsd=%s" % (orderInfo, orderCoin, orderCoinUsd), curPlayer.GetPlayerID())
        addDRDict["orderCoin"] = orderCoin
        addDRDict["orderCoinUsd"] = orderCoinUsd
        if orderCoinUsd != CommFunc.RMBToCoin(usdMoney):
            DataRecordPack.DR_CTGError(curPlayer, "The orderCoinUsd is not equal to the ipyData's UsdMoney(%s)!" % usdMoney, addDRDict)
            return
    else:
        payRMBNum = ipyData.GetPayRMBNum() # 单位,元
    payRMBNum = ipyData.GetPayRMBNum() # 越南版本配表及coin均使用越南盾原值
        if orderCoin != CommFunc.RMBToCoin(payRMBNum):
            DataRecordPack.DR_CTGError(curPlayer, "The orderCoin is not equal to the ipyData's RMB(%s)!" % payRMBNum, addDRDict)
            return
    # 港台0.1折特殊处理:游戏内部逻辑按原版原价处理,所以验证完金额后需要乘100
    orderCoin *= 100
    addDRDict["orderCoin"] = orderCoin
    
    if payOrderType == PayOrderType_PayCoin:
        #直接扣,类似充值扣钱,这里是发放物品,可能会有发放失败的当做 CTGError 处理
@@ -439,13 +418,13 @@
        
    addDRDict["payOrderType"] = payOrderType
    
    addGold, prizeGold, giveItemList, ctgIpyData = 0, 0, [], None
    moneyType, addGold, prizeGold, giveItemList, ctgIpyData = 0, 0, 0, [], None
    
    if ipyData.GetCTGID():
        ctgResultInfo = __GetCTGInfoByID(curPlayer, ipyData.GetCTGID(), addDRDict)
        if not ctgResultInfo:
            return
        addGold, prizeGold, giveItemList, ctgIpyData = ctgResultInfo
        moneyType, addGold, prizeGold, giveItemList, ctgIpyData = ctgResultInfo
        
    elif ipyData.GetGiftbagID():
        giftbagID = ipyData.GetGiftbagID()
@@ -461,7 +440,7 @@
    
    coinExp = ipyData.GetCoinExp()
    coinType = ChConfig.CoinType_Gold if (ctgIpyData and ctgIpyData.GetPayType() in [PayType_Gold, PayType_GoldPlus]) else ChConfig.CoinType_Buy # 规定2为直充,其他为直购
    if not DoCTGLogic(curPlayer, coinType, orderCoin, addGold, prizeGold, giveItemList, isAddBourseMoney, eventName, addDRDict, ctgIpyData, coinExp):
    if not DoCTGLogic(curPlayer, coinType, orderCoin, addGold, prizeGold, giveItemList, isAddBourseMoney, eventName, addDRDict, ctgIpyData, moneyType, coinExp):
        return
    
    #充值成功主动查询一次,无充值数量就不会继续查询
@@ -542,17 +521,19 @@
    addDRDict.update({"monthBuyCountUpd":monthBuyCountUpd})
    
    giveItemList = GetCTGGiveItemList(ipyData)
    addGold = ipyData.GetGainGold() # 获得仙玉数
    gainGoldPrize = ipyData.GetGainGoldPrize() # 赠送仙玉数,首次充值赠送仙玉时,此仙玉不给
    moneyType = ipyData.GetMoneyType() # 获得货币类型
    addGold = ipyData.GetGainGold() # 获得货币数
    gainGoldPrize = ipyData.GetGainGoldPrize() # 赠送货币数,首次充值赠送仙玉时,此仙玉不给
    firstGoldPrize = ipyData.GetFirstGoldPrize() # 首次充值赠送的仙玉
    prizeGold = firstGoldPrize if (not totalBuyCount and firstGoldPrize) else gainGoldPrize
    if moneyType == IPY_GameWorld.TYPE_Price_Gold_Money:
    actPrizeGold = PlayerActRechargePrize.DoAddPlayerActRechargePrizeCount(curPlayer, recordID)
    if actPrizeGold:
        prizeGold += actPrizeGold
        addDRDict.update({"actRechargePrize":1})
        
    Sync_CoinToGoldCountInfo(curPlayer, [recordID])
    return addGold, prizeGold, giveItemList, ipyData
    return moneyType, addGold, prizeGold, giveItemList, ipyData
def GetCTGGiveItemList(ipyData):
    ## 获取充值ID对应给物品列表
@@ -583,14 +564,35 @@
        giveItemList = gainItemList
    return giveItemList
def DoCTGLogic(curPlayer, coinType, orderCoin, addGold, prizeGold, giveItemList, isAddBourseMoney, eventName, addDRDict, ctgIpyData=None, coinExp=0):
def DoCTGLogic(curPlayer, coinType, orderCoin, addGold, prizeGold, giveItemList, isAddBourseMoney, eventName, addDRDict, ctgIpyData=None, moneyType=IPY_GameWorld.TYPE_Price_Gold_Money, coinExp=0):
    if ctgIpyData and ctgIpyData.GetPayType() == PayType_PayCoin:
        # 代币充值,仅给代币,不触发其他内容
        coinType = ChConfig.CoinType_PayCoin
        orderInfo = addDRDict.get("orderInfo", "")
        orderCoin = addDRDict.get("orderCoin", 0)
        payOrderType = addDRDict.get("payOrderType", PayOrderType_Default)
        playerID = curPlayer.GetPlayerID()
        befPayCoin = PlayerControl.GetPayCoin(curPlayer)
        if addGold and moneyType == ShareDefine.TYPE_Price_PayCoin:
            drDict = {ChConfig.Def_Give_Reason_SonKey:orderInfo, "payOrderType":payOrderType}
            PlayerControl.GiveMoney(curPlayer, moneyType, addGold, eventName, drDict)
        aftPayCoin = PlayerControl.GetPayCoin(curPlayer)
        GameWorld.Log("充值代币: orderInfo=%s,orderCoin=%s,payOrderType=%s,eventName=%s,befPayCoin=%s,aftPayCoin=%s"
                      % (orderInfo, orderCoin, payOrderType, eventName, befPayCoin, aftPayCoin), playerID)
        serverDay = GameWorld.GetGameWorld().GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_ServerDay) + 1
        addDRDict.update({"coinType":coinType, "PayCoin":[befPayCoin, aftPayCoin],
                          "VIPLv":curPlayer.GetVIPLv(), "ServerDay":serverDay, "eventName":eventName})
        DataRecordPack.DR_CTGOK(curPlayer, addDRDict)
        return True
    
    if coinType not in [ChConfig.CoinType_Gold, ChConfig.CoinType_Buy, ChConfig.CoinType_ItemSuper]:
        DataRecordPack.DR_CTGError(curPlayer, "coinType error! coinType(%s)!" % coinType, addDRDict)
        return
    
    isRealMoney = True if addDRDict.get("orderID") else False # 是否真实货币充值,仅真实货币充值订单有orderID,后台充值的不算真实货币充值
    payOrderType = addDRDict.get("payOrderType", PayOrderType_RMB)
    payOrderType = addDRDict.get("payOrderType", PayOrderType_Default)
    if payOrderType == PayOrderType_PayCoin:
        isRealMoney = True # 代币充值在游戏内容上算真实充值
    ctgRealToday = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_CTGRealToday) # 当日真实货币充值Coin数 ,不含后台充值- 今日
@@ -610,10 +612,10 @@
    bourseMoneyBefore = PlayerControl.GetMoney(curPlayer, ShareDefine.TYPE_Price_BourseMoney)
    
    if addGold:
        PlayerControl.GiveMoney(curPlayer, IPY_GameWorld.TYPE_Price_Gold_Money, addGold, eventName, addDRDict, isGiveBourseMoney=isAddBourseMoney)
        PlayerControl.GiveMoney(curPlayer, moneyType, addGold, eventName, addDRDict, isGiveBourseMoney=isAddBourseMoney)
        
    if prizeGold:
        PlayerControl.GiveMoney(curPlayer, IPY_GameWorld.TYPE_Price_Gold_Money, prizeGold, eventName, addDRDict, isGiveBourseMoney=isAddBourseMoney)
        PlayerControl.GiveMoney(curPlayer, moneyType, prizeGold, eventName, addDRDict, isGiveBourseMoney=isAddBourseMoney)
        
    if giveItemList:
        ItemControler.GivePlayerItemOrMail(curPlayer, giveItemList, "", event=[ChConfig.ItemGive_CTG, True, copy.deepcopy(addDRDict)])