hxp
2019-09-17 2f64dfa5d5b4f1106c5985bec7c23615636ccbe2
8266 【后端】货币祈愿改为获得灵石
2个文件已修改
68 ■■■■ 已修改文件
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventSrc/Operate_PlayerBuyZhenQi.py 49 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerControl.py 19 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventSrc/Operate_PlayerBuyZhenQi.py
@@ -50,7 +50,7 @@
#祈愿类型列表
TotalPrayList = [ChConfig.VIPPrivilege_MoneyPray,ChConfig.VIPPrivilege_ExpPray]
TotalPrayList = [ChConfig.VIPPrivilege_MoneyPray, ChConfig.VIPPrivilege_ExpPray]
#struct    tagCMBuySomething
@@ -70,7 +70,7 @@
    buyType = clientData.Type  #购买的类型
    #祈愿类型错误,不处理
    if buyType not in TotalPrayList:
        GameWorld.DebugLog("祈愿类型错误---buyType:%s"%buyType )
        GameWorld.DebugLog("祈愿类型错误---buyType:%s" % buyType)
        return
    if buyType == ChConfig.VIPPrivilege_MoneyPray:
        if not GameFuncComm.GetFuncCanUse(curPlayer, ShareDefine.GameFuncID_RefineMoney):
@@ -82,11 +82,11 @@
            return
    
    totalCnt = PlayerVip.GetPrivilegeValue(curPlayer, buyType)
    curCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_HasPrayCnt%buyType)
    cnt = curCnt+1 #参数用
    curCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_HasPrayCnt % buyType)
    cnt = curCnt + 1 #参数用
    #金币祈愿
    if buyType == ChConfig.VIPPrivilege_MoneyPray:
        historyCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_HistoryPrayCnt%buyType)
        historyCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_HistoryPrayCnt % buyType)
        #判断免费祈愿CD时间
        needTime = __GetFreeCD(curPlayer)
        if needTime:
@@ -109,23 +109,24 @@
                    GameWorld.DebugLog("仙玉不足!costGold=%s" % needGold)
                    return
            if not isCostItem: #用物品不增加次数
                PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_HasPrayCnt%buyType, curCnt + 1)
                PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_HasPrayCnt % buyType, curCnt + 1)
        else:
            curTime = int(time.time())
            PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FreePrayTime, curTime)
        preCnt, fixMoney =IpyGameDataPY.GetFuncEvalCfg('MoneyPray', 4)
        GameWorld.DebugLog('11111fixMoney=%s,historyCnt=%s,preCnt=%s'%(fixMoney,historyCnt,preCnt))
        if fixMoney and historyCnt< preCnt:
        preCnt, fixMoney = IpyGameDataPY.GetFuncEvalCfg("MoneyPray", 4)
        GameWorld.DebugLog('11111fixMoney=%s,historyCnt=%s,preCnt=%s' % (fixMoney, historyCnt, preCnt))
        if fixMoney and historyCnt < preCnt:
            addMoney = fixMoney
            #更新历史次数(特殊收益次数达到后不再更新)
            PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_HistoryPrayCnt%buyType, historyCnt+1)
            PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_HistoryPrayCnt % buyType, historyCnt + 1)
        else:
            addMoney = GetMoneyPrayAward()
        addDataDict = {ChConfig.Def_Give_Reason_SonKey:"MoneyPray"}
        PlayerControl.GiveMoney(curPlayer, IPY_GameWorld.TYPE_Price_Silver_Money, addMoney,
                            ChConfig.Def_GiveMoney_Pray, addDataDict, False)
        PlayerControl.NotifyCode(curPlayer, 'MoneyPray_HowMuch', [addMoney])
        #20190917 by hxp 祈愿金币改为绑玉
        giveMoneyType = IPY_GameWorld.TYPE_Price_Gold_Paper
        PlayerControl.GiveMoney(curPlayer, giveMoneyType, addMoney, ChConfig.Def_GiveMoney_Pray, addDataDict, False)
        PlayerControl.NotifyCode(curPlayer, 'MoneyPray_HowMuch', [addMoney, giveMoneyType])
        PlayerBossReborn.AddBossRebornActionCnt(curPlayer, ChConfig.Def_BRAct_MoneyPray, 1)
        
    #经验祈愿    
@@ -149,7 +150,7 @@
        else:
            infoDict = {ChConfig.Def_Cost_Reason_SonKey:buyType}
            needGold = eval(GetExpPrayCost())
            GameWorld.DebugLog("需要仙玉--needGold--%s"%needGold )
            GameWorld.DebugLog("需要仙玉--needGold--%s" % needGold)
            if not PlayerControl.PayMoney(curPlayer, IPY_GameWorld.TYPE_Price_Gold_Money, needGold, ChConfig.Def_Cost_Pray, infoDict):
                GameWorld.DebugLog("仙玉不足!costGold=%s" % needGold)
                return   
@@ -160,7 +161,7 @@
        PlayerControl.PlayerControl(curPlayer).AddExp(addExp)
        PlayerControl.NotifyCode(curPlayer, 'ExpPray_HowMuch', [addExp])
        if not isCostItem: #用物品不增加次数
            PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_HasPrayCnt%buyType, curCnt + 1)
            PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_HasPrayCnt % buyType, curCnt + 1)
        PlayerBossReborn.AddBossRebornActionCnt(curPlayer, ChConfig.Def_BRAct_ExpPray, 1)
    else:
        return
@@ -184,7 +185,7 @@
    curTime = int(time.time())
    passTime = curTime - lastTime
    cdTime = IpyGameDataPY.GetFuncCfg("MoneyPray", 3)
    needTime = max(0,cdTime - passTime)
    needTime = max(0, cdTime - passTime)
    return needTime
    
## OnDay操作,通知客户端,购买次数变了
@@ -193,10 +194,10 @@
def PlayerOnDay(curPlayer):
    needSyncList = []
    for prayType in TotalPrayList:
        hasPrayCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_HasPrayCnt%prayType)
        hasPrayCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_HasPrayCnt % prayType)
        if not hasPrayCnt:
            continue
        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_HasPrayCnt%prayType, 0)
        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_HasPrayCnt % prayType, 0)
        needSyncList.append(prayType)
    Sync_NotifyDataChange(curPlayer, needSyncList)
    return
@@ -205,7 +206,7 @@
## 通知客户端,购买次数变了
#  @param curPlayer: 玩家实例
#  @return None
def Sync_NotifyDataChange(curPlayer, prayType = []):
def Sync_NotifyDataChange(curPlayer, prayType=[]):
    if prayType == []:
        prayList = TotalPrayList
    else:
@@ -214,13 +215,13 @@
    for buyType in prayList:
        subPack = ChPyNetSendPack.tagMCSingleBuySomethingInfo()
        subPack.Type = buyType
        subPack.BuyCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_HasPrayCnt%buyType)
        subPack.HistoryBuyCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_HistoryPrayCnt%buyType)
        subPack.BuyCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_HasPrayCnt % buyType)
        subPack.HistoryBuyCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_HistoryPrayCnt % buyType)
        
        if buyType == ChConfig.VIPPrivilege_MoneyPray:
            subPack.LastFreeTime = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FreePrayTime)
        pack.Infos.append(subPack)
        GameWorld.DebugLog("通知祈愿次数--buyType:%s--BuyCnt:%s--LastFreeTime%s" % (subPack.Type,subPack.BuyCnt,subPack.LastFreeTime))
        GameWorld.DebugLog("通知祈愿次数--buyType:%s--BuyCnt:%s--LastFreeTime%s" % (subPack.Type, subPack.BuyCnt, subPack.LastFreeTime))
    pack.Cnt = len(pack.Infos)
    NetPackCommon.SendFakePack(curPlayer, pack)
    
@@ -231,4 +232,4 @@
def DoPlayerLogin(curPlayer):
    Sync_NotifyDataChange(curPlayer)
    return
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerControl.py
@@ -2876,8 +2876,9 @@
        GameWorld.Log('###---扣钱异常 = %s' % (price), curPlayer.GetPlayerID())
        return False
    
    if type_Price == IPY_GameWorld.TYPE_Price_Gold_Paper:
        type_Price = IPY_GameWorld.TYPE_Price_Gold_Money #新版无绑玉,原先绑玉再仙玉的扣法改成 扣仙玉 2019/6/3
    #20190917 恢复绑玉
#    if type_Price == IPY_GameWorld.TYPE_Price_Gold_Paper:
#        type_Price = IPY_GameWorld.TYPE_Price_Gold_Money #新版无绑玉,原先绑玉再仙玉的扣法改成 扣仙玉 2019/6/3
        
    #金子支付
    if type_Price == IPY_GameWorld.TYPE_Price_Gold_Money:
@@ -3144,13 +3145,13 @@
            GiveMoney(curPlayer, ShareDefine.TYPE_Price_BourseMoney, value)
            addDataDict["BourseMoney"] = GetMoney(curPlayer, ShareDefine.TYPE_Price_BourseMoney)
            
#    elif priceType == IPY_GameWorld.TYPE_Price_Gold_Paper:
#        if curPlayer.GetGoldPaper() + value > ChConfig.Def_PlayerTotalMoney_Gold:
#            #超过金钱上限
#            NotifyCode(curPlayer, "MoneyIsFull", [priceType])
#            return
#
#        curPlayer.SetGoldPaper(curPlayer.GetGoldPaper() + value)
    elif priceType == IPY_GameWorld.TYPE_Price_Gold_Paper:
        if curPlayer.GetGoldPaper() + value > ChConfig.Def_PlayerTotalMoney_Gold:
            #超过金钱上限
            NotifyCode(curPlayer, "MoneyIsFull", [priceType])
            return
        curPlayer.SetGoldPaper(curPlayer.GetGoldPaper() + value)
        
    elif priceType == IPY_GameWorld.TYPE_Price_Silver_Money:
        # 金钱支持超过20亿, 暂不做上限控制