hxp
1 天以前 388823edfe6308cba6f76ca6dc4f20022c5cb2be
10431 【英文】看广告获得限时代金券
9个文件已修改
104 ■■■■ 已修改文件
ServerPython/CoreServerGroup/GameServer/Script/ShareDefine.py 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/ChPlayer.py 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerCoin.py 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerControl.py 56 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerEventCounter.py 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/RemoteQuery/GY_Query_GetPlayerInfo.py 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ShareDefine.py 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/db/PyMongoDataServer/GMToolLogicProcess/Commands/GMT_GetPlayerInfo.py 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/CoreServerGroup/GameServer/Script/ShareDefine.py
@@ -1223,6 +1223,7 @@
TYPE_Price_Tuijinbi = 48    # 推金币次数
TYPE_Price_XianyuanScore = 49    # 仙缘积分
TYPE_Price_HuanjinggeScore = 50    # 幻境阁积分
TYPE_Price_PayCoinDay = 98    # 代币时效,每日过天重置
TYPE_Price_PayCoin = 99    # 代币
#key可用于遍历所有货币,value仅GM相关会用到
@@ -1232,7 +1233,7 @@
                 29:"聚魂碎片", 30:"核心环", 31:"功能特权令", 32:"环保值", 33:"GM令", 34:"古神币", 35:"功德点", 
                 39:"成就积分", 40:"万界积分", 43:"凭证积分", 44:"聚魂精华", 45:"骑宠养成积分", 46:"古宝养成积分", 47:"天道果", 48:"推金币次数", 
                 49:"仙缘积分", 50:"幻境阁积分",
                 99:"代币"
                 98:"代币时效", 99:"代币"
                 }
#需要记录累计消耗的货币类型
@@ -1275,6 +1276,7 @@
                           TYPE_Price_Tuijinbi:CDBPlayerRefresh_Tuijinbi,
                           TYPE_Price_XianyuanScore:CDBPlayerRefresh_XianyuanScore,
                           TYPE_Price_HuanjinggeScore:CDBPlayerRefresh_HuanjinggeScore,
                           TYPE_Price_PayCoinDay:CDBPlayerRefresh_PayCoinDay,
                           }
# 支持负值的货币及对应0418刷新类型
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
@@ -3703,6 +3703,7 @@
Def_PDict_ShareGameAwardState = "ShareGameAwardState"  # 每日分享游戏领奖记录
Def_PDict_GoodGameAwardState = "GoodGameAwardState"  # 游戏好评领奖记录
Def_PDict_LikeGameAwardState = "LikeGameAwardState"  # 游戏点赞领奖记录
Def_PDict_ADAwardCnt = "ADAwardCnt"  # 游戏广告每日奖励次数
Def_PDict_EquipViewCacheState = "EquipViewCacheState"  # 本次上线是否同步过装备缓存
Def_PDict_PackDataSyncState = "PackDataSyncState"  # 本次上线打包数据同步状态,按位存储是否同步 0-本服,1-跨服
Def_PDict_PackDataSyncFightPower = "PackDataSyncFightPower"  # 本次上线打包数据同步时的战力,用于对比,只对比求余亿部分即可
@@ -6113,7 +6114,8 @@
Def_RewardType_LunhuidianAward, # 轮回殿奖励 78
Def_RewardType_RechargeDayAward, # 累充每日奖励 79
Def_RewardType_FamilyGCZ, # 仙盟攻城战 80
)= range(81)
Def_RewardType_ADAward, # 每日广告奖励 81
)= range(82)
#boss复活相关活动定义
BossRebornActIDList = (
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/ChPlayer.py
@@ -969,6 +969,10 @@
    shareGameAwardState = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ShareGameAwardState)
    if shareGameAwardState:
        Sync_RewardGetRecordInfo(curPlayer, ChConfig.Def_RewardType_ShareGame, shareGameAwardState)
    #每日广告奖励
    adAwardCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ADAwardCnt)
    if adAwardCnt:
        Sync_RewardGetRecordInfo(curPlayer, ChConfig.Def_RewardType_ADAward, adAwardCnt)
    #游戏好评奖励
    goodGameAwardState = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_GoodGameAwardState)
    if goodGameAwardState:
@@ -5766,6 +5770,9 @@
    #游戏点赞奖励67
    elif rewardType == ChConfig.Def_RewardType_LikeGame:
        OnGiveAwardByClient(curPlayer, rewardType, ChConfig.Def_PDict_LikeGameAwardState, IpyGameDataPY.GetFuncEvalCfg("GoodGameReward", 4))
    #每日广告奖励
    elif rewardType == ChConfig.Def_RewardType_ADAward:
        OnGetADAward(curPlayer)
    return
    
## 领取创角奖励
@@ -5789,6 +5796,22 @@
    NetPackCommon.SendFakePack(curPlayer, sendPack)
    return
def OnGetADAward(curPlayer):
    ## 每日广告奖励
    maxCnt = IpyGameDataPY.GetFuncCfg("ADAward", 1)
    adAwardCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ADAwardCnt)
    if adAwardCnt >= maxCnt:
        GameWorld.DebugLog("已达每日广告最大领奖次数! adAwardCnt=%s >= %s" % (adAwardCnt, maxCnt))
        return
    if not ItemCommon.GiveAwardItem(curPlayer, IpyGameDataPY.GetFuncEvalCfg("ADAward", 2)):
        return
    updAwardCnt = adAwardCnt + 1
    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ADAwardCnt, updAwardCnt)
    Sync_RewardGetRecordInfo(curPlayer, ChConfig.Def_RewardType_ADAward, updAwardCnt)
    return
def OnGiveAwardByClient(curPlayer, rewardType, dictKey, awardCfg):
    ## 发放前端控制的奖励,后端只负责发放奖励,是否可领奖前端自行判断
    if curPlayer.NomalDictGetProperty(dictKey):
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerCoin.py
@@ -470,8 +470,8 @@
                    return
        #直接扣,类似充值扣钱,这里是发放物品,可能会有发放失败的当做 CTGError 处理
        if not PlayerControl.PayMoney(curPlayer, ShareDefine.TYPE_Price_PayCoin, payCoin, eventName, {ChConfig.Def_Cost_Reason_SonKey:orderInfo, "orderInfo":orderInfo}):
            GameWorld.ErrLog("代币不足! appID=%s,orderInfo=%s,payCoin=%s,curPayCoin=%s"
                             % (appID, orderInfo, payCoin, PlayerControl.GetPayCoin(curPlayer)), curPlayer.GetPlayerID())
            GameWorld.ErrLog("代币不足! appID=%s,orderInfo=%s,payCoin=%s,curPayCoinTotal=%s"
                             % (appID, orderInfo, payCoin, PlayerControl.GetPayCoinTotal(curPlayer)), curPlayer.GetPlayerID())
            return
        
    addDRDict["payOrderType"] = payOrderType
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerControl.py
@@ -3055,7 +3055,7 @@
        
    #代币支付
    elif TYPE_Price == ShareDefine.TYPE_Price_PayCoin:
        needMoneyCount = GetPayCoin(curPlayer)
        needMoneyCount = GetPayCoinTotal(curPlayer)
        
    #自定义货币
    elif TYPE_Price in ShareDefine.TYPE_Price_CurrencyDict:
@@ -3219,10 +3219,21 @@
    #代币支付
    elif type_Price == ShareDefine.TYPE_Price_PayCoin:
        curPlayerPayCoin = GetPayCoin(curPlayer)
        if curPlayerPayCoin < price:
        curPayCoinDay = GetPlayerCurrency(curPlayer, ShareDefine.TYPE_Price_PayCoinDay)
        payCoinTotal = curPlayerPayCoin + curPayCoinDay
        if payCoinTotal < price:
            return False
        #有足够的钱支付
        SetPayCoin(curPlayer, curPlayerPayCoin - price)
        costPayCoinDay = price if (curPayCoinDay >= price) else curPayCoinDay
        costPayCoin = price
        if costPayCoinDay:
            GameWorld.DebugLog("先扣代币时效: curPayCoinDay=%s,price=%s,costPayCoinDay=%s" % (curPayCoinDay, price, costPayCoinDay))
            SetPlayerCurrency(curPlayer, ShareDefine.TYPE_Price_PayCoinDay, curPayCoinDay - costPayCoinDay)
            costPayCoin -= costPayCoinDay
            GameWorld.DebugLog("再扣代币: costPayCoin=%s" % (costPayCoin))
        #时效不够扣除,再扣非时效
        if costPayCoin > 0:
            SetPayCoin(curPlayer, curPlayerPayCoin - costPayCoin)
        
    #自定义货币
    elif type_Price in ShareDefine.TYPE_Price_CurrencyDict:
@@ -3324,17 +3335,19 @@
        and costType == ChConfig.Def_Cost_Unknown:
        #GameWorld.DebugLog("该货币没有指定消费类型不记录!type_Price=%s,costType=%s" % (type_Price, costType))
        return
    if type_Price == ShareDefine.TYPE_Price_PayCoin:
        playerID = curPlayer.GetPlayerID()
        nowMoney = GetMoneyReal(curPlayer, type_Price)
        payCoinDay = GetMoney(curPlayer, ShareDefine.TYPE_Price_PayCoinDay)
        infoDict["PlayerMoneyCount2"] = payCoinDay
        orderInfo = infoDict.get("orderInfo", "")
        GameWorld.Log("记录消耗代币: eventName=%s,price=%s,nowMoney=%s,payCoinDay=%s,orderInfo=%s" % (eventName, price, nowMoney, payCoinDay, orderInfo), playerID)
        GameWorld.AddPlayerRec(playerID, ShareDefine.Def_PlayerRecType_PayCoin, [2, price, nowMoney, payCoinDay], orderInfo, 1)
    # 流向用 eventName
    #if eventName:
    DataRecordPack.DR_UseMoney(curPlayer, eventName, type_Price, price, infoDict) # 流向
    EventReport.WriteEvent_virtual_resource(curPlayer, type_Price, reason_name, quantity,
                                            unitPrice, ShareDefine.Def_UserAction_Money_Use, infoDict)
    if type_Price == ShareDefine.TYPE_Price_PayCoin:
        playerID = curPlayer.GetPlayerID()
        nowMoney = GetMoneyReal(curPlayer, type_Price)
        orderInfo = infoDict.get("orderInfo", "")
        GameWorld.Log("记录消耗代币: eventName=%s,price=%s,nowMoney=%s,orderInfo=%s" % (eventName, price, nowMoney, orderInfo), playerID)
        GameWorld.AddPlayerRec(playerID, ShareDefine.Def_PlayerRecType_PayCoin, [2, price, nowMoney], orderInfo, 1)
    #===========================================================================
    # if type_Price == IPY_GameWorld.TYPE_Price_Gold_Money:
    #    EventReport.WriteEvent_virtual_cost(curPlayer, quantity, unitPrice, reason_name)
@@ -3523,6 +3536,10 @@
        DataRecordPack.DR_GiveMoneyError(curPlayer, priceType, value, giveType, addDataDict)
        return
    
    # 时效代币后续处理均视为代币,包含系统提示、记录、流向等
    if priceType == ShareDefine.TYPE_Price_PayCoinDay:
        priceType = ShareDefine.TYPE_Price_PayCoin
    if isSysHint and priceType != ShareDefine.TYPE_Price_BourseMoney:
        #通知客户端得到金钱
        if priceType == ShareDefine.TYPE_Price_PayCoin:
@@ -3547,16 +3564,18 @@
        eventName = ChConfig.Def_GetType_Dict[giveType]
        addDataDict["eventName"] = eventName
        
    DataRecordPack.DR_GiveMoney(curPlayer, eventName, priceType, value, addDataDict)
    EventReport.WriteEvent_virtual_resource(curPlayer, priceType, giveType, 1, value,
                                            ShareDefine.Def_UserAction_Money_Get, addDataDict)
    if priceType == ShareDefine.TYPE_Price_PayCoin:
        playerID = curPlayer.GetPlayerID()
        nowMoney = GetMoneyReal(curPlayer, priceType)
        payCoinDay = GetMoney(curPlayer, ShareDefine.TYPE_Price_PayCoinDay)
        addDataDict["PlayerMoneyCount2"] = payCoinDay
        orderInfo = addDataDict.get("orderInfo", "")
        GameWorld.Log("记录获得代币: eventName=%s,value=%s,nowMoney=%s,orderInfo=%s" % (eventName, value, nowMoney, orderInfo), playerID)
        GameWorld.AddPlayerRec(playerID, ShareDefine.Def_PlayerRecType_PayCoin, [1, value, nowMoney], orderInfo, 1)
        GameWorld.Log("记录获得代币: eventName=%s,value=%s,nowMoney=%s,payCoinDay=%s,orderInfo=%s" % (eventName, value, nowMoney, payCoinDay, orderInfo), playerID)
        GameWorld.AddPlayerRec(playerID, ShareDefine.Def_PlayerRecType_PayCoin, [1, value, nowMoney, payCoinDay], orderInfo, 1)
    DataRecordPack.DR_GiveMoney(curPlayer, eventName, priceType, value, addDataDict)
    EventReport.WriteEvent_virtual_resource(curPlayer, priceType, giveType, 1, value,
                                            ShareDefine.Def_UserAction_Money_Get, addDataDict)
#===============================================================================
#    reason_name = "Unknown" if not giveType else giveType
#    eventName = reason_name
@@ -6434,8 +6453,15 @@
def SetChatBubbleBox(curPlayer, value): return curPlayer.SetExAttr10(value, False, True)
##游戏充值支付代币
def GetPayCoinTotal(curPlayer): return GetPayCoin(curPlayer) + GetPlayerCurrency(curPlayer, ShareDefine.TYPE_Price_PayCoinDay)
def GetPayCoin(curPlayer): return curPlayer.GetExAttr11()
def SetPayCoin(curPlayer, value): return curPlayer.SetExAttr11(min(value, ChConfig.Def_UpperLimit_DWord), False, False)
def PayCoinOnDay(curPlayer):
    # 每日过天清除时效代币
    payCoinDay = GetPlayerCurrency(curPlayer, ShareDefine.TYPE_Price_PayCoinDay)
    if payCoinDay > 0:
        PayMoney(curPlayer, ShareDefine.TYPE_Price_PayCoin, payCoinDay, "PayCoinOnDay")
    return
## 获取佩戴的称号ID
def GetTitleID(curPlayer):
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerEventCounter.py
@@ -571,6 +571,7 @@
        PlayerLove.DoPlayerOnDay(curPlayer)
        #仙宫
        PlayerXiangong.PlayerOnDay(curPlayer)
        PlayerControl.PayCoinOnDay(curPlayer)
        PlayerSuperDiscount.PlayerOnDay(curPlayer)
        #玩法前瞻奖励
        gameNoticeAwardState = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_GameNoticeAwardState)
@@ -582,6 +583,10 @@
        if shareGameAwardState:
            PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ShareGameAwardState, 0)
            ChPlayer.Sync_RewardGetRecordInfo(curPlayer, ChConfig.Def_RewardType_ShareGame, 0)
        #每日广告奖励
        if curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ADAwardCnt):
            PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ADAwardCnt, 0)
            ChPlayer.Sync_RewardGetRecordInfo(curPlayer, ChConfig.Def_RewardType_ADAward, 0)
    # 特殊时间点X点过天
    elif onEventType == ShareDefine.Def_OnEventTypeEx:
        # 资源找回
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/RemoteQuery/GY_Query_GetPlayerInfo.py
@@ -66,7 +66,7 @@
    
    # 需要额外同步的自定义货币
    CurrencyValueDict = {}
    for moneyType in [ShareDefine.TYPE_Price_PayCoin]:
    for moneyType in [ShareDefine.TYPE_Price_PayCoin, ShareDefine.TYPE_Price_PayCoinDay]:
        CurrencyValueDict['PlayerCurrency_%s' % moneyType] = PlayerControl.GetMoneyReal(curPlayer, moneyType)
    playerInfo.update(CurrencyValueDict)
    
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ShareDefine.py
@@ -1223,6 +1223,7 @@
TYPE_Price_Tuijinbi = 48    # 推金币次数
TYPE_Price_XianyuanScore = 49    # 仙缘积分
TYPE_Price_HuanjinggeScore = 50    # 幻境阁积分
TYPE_Price_PayCoinDay = 98    # 代币时效,每日过天重置
TYPE_Price_PayCoin = 99    # 代币
#key可用于遍历所有货币,value仅GM相关会用到
@@ -1232,7 +1233,7 @@
                 29:"聚魂碎片", 30:"核心环", 31:"功能特权令", 32:"环保值", 33:"GM令", 34:"古神币", 35:"功德点", 
                 39:"成就积分", 40:"万界积分", 43:"凭证积分", 44:"聚魂精华", 45:"骑宠养成积分", 46:"古宝养成积分", 47:"天道果", 48:"推金币次数", 
                 49:"仙缘积分", 50:"幻境阁积分",
                 99:"代币"
                 98:"代币时效", 99:"代币"
                 }
#需要记录累计消耗的货币类型
@@ -1275,6 +1276,7 @@
                           TYPE_Price_Tuijinbi:CDBPlayerRefresh_Tuijinbi,
                           TYPE_Price_XianyuanScore:CDBPlayerRefresh_XianyuanScore,
                           TYPE_Price_HuanjinggeScore:CDBPlayerRefresh_HuanjinggeScore,
                           TYPE_Price_PayCoinDay:CDBPlayerRefresh_PayCoinDay,
                           }
# 支持负值的货币及对应0418刷新类型
ServerPython/db/PyMongoDataServer/GMToolLogicProcess/Commands/GMT_GetPlayerInfo.py
@@ -154,7 +154,7 @@
    
    # 需要额外同步的自定义货币
    CurrencyValueDict = {}
    for moneyType in [99]:
    for moneyType in [99, 98]:
        if moneyType == 99:
            moneyValue = dbPlayer.ExAttr11
        else: