7064 【后端】【2.0】后端给绑玉防范处理(扣绑玉默认扣仙玉,屏蔽给绑玉并输出流向)
| | |
| | | Def_ItemID_FamilyContribution = 26 # 直接给战盟贡献点
|
| | | Def_ItemID_FamilyActive = 28 # 直接给战盟活跃点
|
| | | Def_ItemID_SP = 29 # 直接给sp
|
| | | Def_ItemID_GoldPaper = 30 # 直接给绑玉
|
| | | #Def_ItemID_GoldPaper = 30 # 直接给绑玉
|
| | | Def_ItemID_RealmPoint = 24 # 直接给修行点
|
| | | Def_ItemID_BossReborn = 21 # 直接给boss复活点
|
| | | Def_ItemID_Ysog = 4306 # 直接给符印融合石
|
| | |
| | | Def_ItemID_SoulSplinters = 701 # 直接给聚魂碎片
|
| | | Def_ItemID_SoulCore = 702 # 直接给核心环
|
| | | Def_ItemID_Honor = 2141 # 直接给荣誉
|
| | | Def_TransformItemIDList = [Def_ItemID_FamilyContribution, Def_ItemID_FamilyActive, Def_ItemID_SP, Def_ItemID_GoldPaper, |
| | | Def_TransformItemIDList = [Def_ItemID_FamilyContribution, Def_ItemID_FamilyActive, Def_ItemID_SP, #Def_ItemID_GoldPaper, |
| | | Def_ItemID_RealmPoint, Def_ItemID_SilverMoney, Def_ItemID_BossReborn, Def_ItemID_Ysog,
|
| | | Def_ItemID_SoulDust, Def_ItemID_SoulSplinters, Def_ItemID_SoulCore, Def_ItemID_Honor, Def_ItemID_GoldMoney]
|
| | | #---------------------------------------------------------------------
|
| | |
| | | #内网GM等级
|
| | | Def_GM_LV_God = 90
|
| | | #---------------------------------------------------------------------
|
| | | #游戏中所有的金钱类型
|
| | | Def_MoneyType_All = [IPY_GameWorld.TYPE_Price_Gold_Money, # 元宝
|
| | | IPY_GameWorld.TYPE_Price_Gold_Paper, # 礼券
|
| | | IPY_GameWorld.TYPE_Price_Silver_Money, # 银子
|
| | | ]
|
| | |
|
| | | #客户端心跳响应封包间隔(毫秒)
|
| | | Def_PlayerOnLineReply_ClientReply = 30000 #30000
|
| | |
| | |
|
| | | return
|
| | |
|
| | | ## 获得金钱失败
|
| | | def DR_GiveMoneyError(curPlayer, priceType, value, giveType, addDataDict):
|
| | | dataDict = {'PlayerID':curPlayer.GetPlayerID(), "PlayerName":curPlayer.GetPlayerName(), |
| | | 'AccID':curPlayer.GetAccID(), "GiveType":giveType, "GiveValue":value, "AddDataDict":addDataDict}
|
| | | SendEventPack("GiveMoneyError_%s" % priceType, dataDict, curPlayer)
|
| | | return
|
| | |
|
| | | ## 获得物品
|
| | | # @param curPlayer: 玩家实例
|
| | | # @param eventName: 功能事件名
|
| | |
| | | #0文不处理
|
| | | if moneyCount < 0:
|
| | | return
|
| | | isOK = False
|
| | | playerMoney = PlayerControl.GetMoney(curPlayer, moneyType)
|
| | | if playerMoney > moneyCount:
|
| | | PlayerControl.PayMoney(curPlayer, moneyType, playerMoney - moneyCount, ChConfig.Def_Cost_GM, {ChConfig.Def_Cost_Reason_SonKey:"SetMoney"})
|
| | | isOK = PlayerControl.PayMoney(curPlayer, moneyType, playerMoney - moneyCount, ChConfig.Def_Cost_GM, {ChConfig.Def_Cost_Reason_SonKey:"SetMoney"})
|
| | | elif playerMoney < moneyCount:
|
| | | PlayerControl.GiveMoney(curPlayer, moneyType, moneyCount - playerMoney, ChConfig.Def_GiveMoney_GM, {ChConfig.Def_Give_Reason_SonKey:"SetMoney"})
|
| | | isOK = PlayerControl.GiveMoney(curPlayer, moneyType, moneyCount - playerMoney, ChConfig.Def_GiveMoney_GM, {ChConfig.Def_Give_Reason_SonKey:"SetMoney"})
|
| | | else:
|
| | | isOK = True
|
| | | if not isOK:
|
| | | GameWorld.DebugAnswer(curPlayer, "设置玩家货币失败,详见日志或流向")
|
| | |
|
| | | return
|
| | |
|
| | |
| | | PlayerControl.GiveMoney(curPlayer, ShareDefine.TYPE_Price_FamilyActivity, itemCount)
|
| | | elif itemID == ChConfig.Def_ItemID_SP:
|
| | | PlayerControl.PlayerAddZhenQi(curPlayer, itemCount)
|
| | | elif itemID == ChConfig.Def_ItemID_GoldPaper:
|
| | | PlayerControl.GiveMoney(curPlayer, IPY_GameWorld.TYPE_Price_Gold_Paper, itemCount)
|
| | | #elif itemID == ChConfig.Def_ItemID_GoldPaper:
|
| | | # PlayerControl.GiveMoney(curPlayer, IPY_GameWorld.TYPE_Price_Gold_Paper, itemCount, eventName, addDict)
|
| | | elif itemID == ChConfig.Def_ItemID_RealmPoint:
|
| | | PlayerControl.GiveMoney(curPlayer, ShareDefine.TYPE_Price_RealmPoint, itemCount)
|
| | | elif itemID == ChConfig.Def_ItemID_BossReborn:
|
| | |
| | |
|
| | | if skillLVNeedMoneyCount > 0:
|
| | | #付钱
|
| | | skillLVNeedMoneyType = PlayerControl.ChangeMoneyType(curPlayer, skillLVNeedMoneyType)
|
| | | if not PlayerControl.PayMoney(curPlayer, skillLVNeedMoneyType, skillLVNeedMoneyCount):
|
| | | return False
|
| | |
|
| | |
| | | return playerlist
|
| | |
|
| | | #---------------------------------------------------------------------
|
| | | ##转变付费货币类型
|
| | | # @param curPlayer 玩家实例
|
| | | # @param moneyType 货币类型 1表示金子,2表示金票,3表示银子,4表示银票, 5:金子/金票 6:银子/银票
|
| | | # @return 返回值, 货币类型
|
| | | # @remarks 转变付费货币类型 |
| | | def ChangeMoneyType(curPlayer, moneyType):
|
| | | # if moneyType == 5:
|
| | | # return curPlayer.GetUseGoldType()
|
| | | # |
| | | # if moneyType == 6:
|
| | | # return curPlayer.GetUseSilverType()
|
| | | if moneyType not in ChConfig.Def_MoneyType_All:
|
| | | GameWorld.ErrLog("金钱类型填写错误 %s" % moneyType)
|
| | | |
| | | return moneyType
|
| | | #---------------------------------------------------------------------
|
| | | ##获取玩家货币数
|
| | | # @param curPlayer 玩家实例
|
| | | # @param TYPE_Price ,货币类型
|
| | |
| | | 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
|
| | | |
| | | #金子支付
|
| | | if type_Price == IPY_GameWorld.TYPE_Price_Gold_Money:
|
| | | curPlayerGold = curPlayer.GetGold()
|
| | |
| | | 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亿, 暂不做上限控制
|
| | |
| | | PlayerSuccess.DoAddSuccessProgress(curPlayer, ShareDefine.SuccType_GetRealmPoint, value)
|
| | | EventShell.EventRespons_GetRealmPoint(curPlayer)
|
| | | else:
|
| | | GameWorld.Log("金钱类型错误, priceType = %s" % (priceType), curPlayer.GetPlayerID())
|
| | | GameWorld.ErrLog("金钱类型错误, priceType=%s,value=%s,giveType=%s" % (priceType, value, giveType), curPlayer.GetPlayerID())
|
| | | DataRecordPack.DR_GiveMoneyError(curPlayer, priceType, value, giveType, addDataDict)
|
| | | return
|
| | |
|
| | | if isSysHint and priceType != ShareDefine.TYPE_Price_BourseMoney:
|