From 5f3b500dd8efc188323d6e6ec2a74857e82142c8 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期二, 10 二月 2026 19:50:38 +0800
Subject: [PATCH] 1111 【后台】 扣除玩家物品、扣除玩家货币命令支持;

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/PyMongoDB/GMToolLogicProcess/Commands/GMT_DelPlayerItem.py |   66 ++++++++++++++++----------------
 1 files changed, 33 insertions(+), 33 deletions(-)

diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/RemoteQuery/GY_Query_GMTDelPlayerItem.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/PyMongoDB/GMToolLogicProcess/Commands/GMT_DelPlayerItem.py
similarity index 77%
rename from ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/RemoteQuery/GY_Query_GMTDelPlayerItem.py
rename to ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/PyMongoDB/GMToolLogicProcess/Commands/GMT_DelPlayerItem.py
index f391fb9..5f3c0c4 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/RemoteQuery/GY_Query_GMTDelPlayerItem.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/PyMongoDB/GMToolLogicProcess/Commands/GMT_DelPlayerItem.py
@@ -2,47 +2,51 @@
 # -*- coding: GBK -*-
 #-------------------------------------------------------------------------------
 #
-##@package Player.RemoteQuery.GY_Query_GMTDelPlayerItem
+##@package PyMongoDB.GMToolLogicProcess.Commands.GMT_DelPlayerItem
 #
-# @todo:GM工具扣除玩家物品
+# @todo:GM工具命令 - 扣除玩家物品
 # @author hxp
-# @date 2021-03-18
+# @date 2026-02-10
 # @version 1.0
 #
-# 详细描述: GM工具扣除玩家物品
+# 详细描述: GM工具命令 - 扣除玩家物品
 #
 #-------------------------------------------------------------------------------
-#"""Version = 2021-03-18 19:00"""
+#"""Version = 2026-02-10 20:00"""
 #-------------------------------------------------------------------------------
 
 import GMCommon
-import ItemCommon
-import ShareDefine
 import GameWorld
+import DataRecordPack
+import ShareDefine
+import ItemCommon
 import ChConfig
 
-## 请求逻辑
-#  @param query_Type 请求类型
-#  @param query_ID 请求的玩家ID
-#  @param packCMDList 发包命令 [ ]
-#  @param tick 当前时间
-#  @return resultDisc
-#  @remarks 函数详细说明.
-def DoLogic(query_Type, query_ID, packCMDList, tick):
-    curPlayer = GameWorld.GetPlayerManager().FindPlayerByID(query_ID)
+## 收到gm命令执行
+# @param gmCmdDict:gm命令字典
+# @return None 
+def OnExec(gmCmdDict):
     
-    if not curPlayer or curPlayer.IsEmpty():
-        return ''
-    orderId, gmCmdDict = packCMDList
-    GameWorld.Log("GY_Query_GMTDelPlayerItem: %s" % gmCmdDict, query_ID)
+    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, '') 
+    
     itemID = GameWorld.ToIntDef(gmCmdDict.get("itemID", 0))
     delItemCount = GameWorld.ToIntDef(gmCmdDict.get("delItemCount", 0))
     
-    Result = GMCommon.Def_Success
-    retMsg = {"itemID":itemID, "delItemCount":delItemCount, "accID":curPlayer.GetAccID()}
+    resultDict = {"itemID":itemID, "delItemCount":delItemCount, "accID":curPlayer.GetAccID()}
     
     # 删除物品
-    _DoGMDelItem(curPlayer, gmCmdDict, itemID, delItemCount, retMsg)
+    _DoGMDelItem(curPlayer, gmCmdDict, itemID, delItemCount, resultDict)
     
     # 查询剩余物品明细
     findItemDict = {}
@@ -60,12 +64,13 @@
             itemList.append(_GetItemInfo(curItem))
         if itemList:
             findItemDict[str(packIndex)] = itemList
-    retMsg["findItemDict"] = findItemDict
+    resultDict["findItemDict"] = findItemDict
     
-    resultMsg = str([orderId, retMsg, 'GMT_DelPlayerItem', Result])
-    GameWorld.GetPlayerManager().GameServer_QueryPlayerResult(0, 0, 0, 'GMToolResult', resultMsg, len(resultMsg))
-    return ''
-    
+    Result = GMCommon.Def_Success
+    #流向 增加金额记录
+    DataRecordPack.DR_ToolGMOperate(playerID, curPlayer.GetPlayerName(), curPlayer.GetAccID(), GMT_Name, resultDict)
+    return Result, resultDict
+
 def _DoGMDelItem(curPlayer, gmCmdDict, itemID, delItemCount, retMsg):
     
     delRemark = gmCmdDict.get("delRemark", "")
@@ -129,8 +134,3 @@
                    "ItemPlaceIndex":curItem.GetItemPlaceIndex()
                    }
     return curItemInfo
-
-    
-    
-    
-    

--
Gitblit v1.8.0