#!/usr/bin/python # -*- coding: GBK -*- #------------------------------------------------------------------------------- # ##@package PyMongoDB.GMToolLogicProcess.Commands.GMT_DelPlayerMoney # # @todo:GM¹¤¾ßÃüÁî - ¿Û³ýÍæ¼Ò»õ±Ò # @author hxp # @date 2026-02-10 # @version 1.0 # # ÏêϸÃèÊö: GM¹¤¾ßÃüÁî - ¿Û³ýÍæ¼Ò»õ±Ò # #------------------------------------------------------------------------------- #"""Version = 2026-02-10 20:00""" #------------------------------------------------------------------------------- import GMCommon import GameWorld import DataRecordPack import PlayerControl import ShareDefine import ChConfig ## ÊÕµ½gmÃüÁîÖ´ÐÐ # @param gmCmdDict:gmÃüÁî×Öµä # @return None def OnExec(gmCmdDict): errorMsg = "" from GMToolLogicProcess import ProjSpecialProcess Result, curPlayer = ProjSpecialProcess.GMCmdPlayerValidation(gmCmdDict, False) if Result != GMCommon.Def_Success: return Result, errorMsg if not curPlayer: return Result, "Íæ¼Ò²»ÔÚÏß" # Íæ¼ÒÔÚÏߣ¬Ö±½Ó´¦Àí playerID = curPlayer.GetPlayerID() Result = GMCommon.Def_Unknow GMT_Name = gmCmdDict.get(GMCommon.Def_GMKey_Type, '') moneyType = GameWorld.ToIntDef(gmCmdDict.get("moneyType")) moneyValue = GameWorld.ToIntDef(gmCmdDict.get("moneyValue")) delRemark = gmCmdDict.get("delRemark", "") retMsg = "" Result = GMCommon.Def_Success if moneyType not in [1, 2, 3, 4, ShareDefine.TYPE_Price_PayCoin] and moneyType not in ShareDefine.TYPE_Price_CurrencyDict: Result = GMCommon.Def_MoneyTypeErr elif not moneyValue: Result = GMCommon.Def_ParamErr retMsg = "money value error." #ÏÉÓñ¡¢°óÓñºǫֱ́½Ó¿Û³ýµÄ²»¼ì²é»õ±ÒÊÇ·ñ×ã¹»£¬Ö§³ÖÖ±½Ó¿Û³É¸ºÖµ elif moneyType not in ShareDefine.MoneyMinusRefreshDict and not PlayerControl.HaveMoney(curPlayer, moneyType, moneyValue, False): Result = GMCommon.Def_ParamErr retMsg = "money is not enough. only %s" % PlayerControl.GetMoney(curPlayer, moneyType) if Result == GMCommon.Def_Success: infoDict = {ChConfig.Def_Cost_Reason_SonKey:delRemark} if not PlayerControl.PayMoney(curPlayer, moneyType, moneyValue, ChConfig.Def_Cost_GM, infoDict, isNotify=False, isMinus=True): Result = GMCommon.Def_Unknow retMsg = "pay money error." else: retMsg = "remaining money %s" % PlayerControl.GetMoneyReal(curPlayer, moneyType) resultDict = {"retMsg":retMsg} Result = GMCommon.Def_Success #Á÷Ïò Ôö¼Ó½ð¶î¼Ç¼ DataRecordPack.DR_ToolGMOperate(playerID, curPlayer.GetPlayerName(), curPlayer.GetAccID(), GMT_Name, resultDict) return Result, resultDict