From 4cdd576855c6e22d986ece4b18f7c80d82cefe38 Mon Sep 17 00:00:00 2001 From: hxp <ale99527@vip.qq.com> Date: 星期二, 03 六月 2025 14:21:15 +0800 Subject: [PATCH] 16 卡牌服务端(GMT命令:GMT_AddPayCoin、GMT_CTG) --- ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/PyMongoDB/GMToolLogicProcess/Commands/GMT_CTG.py | 67 +++++++++++---------------------- 1 files changed, 23 insertions(+), 44 deletions(-) diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/PyMongoDB/GMToolLogicProcess/Commands/GMT_CTG.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/PyMongoDB/GMToolLogicProcess/Commands/GMT_CTG.py index feab2a7..9929b80 100644 --- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/PyMongoDB/GMToolLogicProcess/Commands/GMT_CTG.py +++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/PyMongoDB/GMToolLogicProcess/Commands/GMT_CTG.py @@ -1,66 +1,47 @@ #!/usr/bin/python # -*- coding: GBK -*- -#--------------------------------------------------------------------- +#------------------------------------------------------------------------------- # -#--------------------------------------------------------------------- -##@package GMT_CTG -# GM命令CTG +##@package PyMongoDB.GMToolLogicProcess.Commands.GMT_CTG # -# @author whx -# @date 2012-08-27 13:59 +# @todo:GM工具命令 - CTG充值 +# @author hxp +# @date 2025-06-03 # @version 1.0 # -# @note -#--------------------------------------------------------------------- -"""Version = 2012-08-27 13:59""" -#--------------------------------------------------------------------- -#导入 +# 详细描述: GM工具命令 - CTG充值 +# +#------------------------------------------------------------------------------- +#"""Version = 2025-06-03 14:00""" +#------------------------------------------------------------------------------- + import GMCommon -from MangoDBCommon import fix_incomingText import GameWorld from Player import (PlayerControl, PlayerCoin) import IpyGameDataPY import IPY_GameWorld -import ShareDefine import DataRecordPack +import ShareDefine import ChConfig -from PyMongoDB.GMToolLogicProcess import GMToolPyInterface -import json -#--------------------------------------------------------------------- -#全局变量 - -#--------------------------------------------------------------------- ## 收到gm命令执行 # @param gmCmdDict:gm命令字典 # @return None def OnExec(gmCmdDict): - queryType = gmCmdDict.get(GMCommon.Def_GMKey_QueryType, '') - playerFind = gmCmdDict.get(GMCommon.Def_GMKey_PlayerFind, '') - Result = GMCommon.Def_ParamErr + errorMsg = "" - - if queryType not in [GMCommon.Def_GMKey_PlayerAccID, GMCommon.Def_GMKey_PlayerName]: + from GMToolLogicProcess import ProjSpecialProcess + Result, curPlayer = ProjSpecialProcess.GMCmdPlayerValidation(gmCmdDict) + if Result != GMCommon.Def_Success: return Result, errorMsg + if not curPlayer: + return Result, "玩家不在线,上线后处理" - if len(playerFind) <= 0: - return Result, errorMsg - - curPlayer = None - if queryType == GMCommon.Def_GMKey_PlayerName: - curPlayer = GameWorld.GetPlayerManager().FindPlayerByName(playerFind) - else: - curPlayer = GameWorld.GetPlayerManager().FindPlayerByAccID(playerFind) - - if not curPlayer or curPlayer.IsEmpty(): - Result = GMCommon.Def_Success - # 不在线 - return Result, errorMsg - + # 玩家在线,可处理 playerID = curPlayer.GetPlayerID() - Result = GMCommon.Def_Unknow - + GMT_Name = gmCmdDict.get(GMCommon.Def_GMKey_Type, '') + value = gmCmdDict.get('value', '') appID = gmCmdDict.get('appID', '') isAddBourseMoney = GameWorld.ToIntDef(gmCmdDict.get('isAddBourseMoney', ''), 0) @@ -69,7 +50,6 @@ changeCoinPointBefore = curPlayer.GetChangeCoinPointTotal() bourseMoneyBefore = PlayerControl.GetMoney(curPlayer, ShareDefine.TYPE_Price_BourseMoney) - orderInfoIpyData = None if appID: orderInfoIpyData = IpyGameDataPY.GetIpyGameDataNotLog("OrderInfo", value, appID) @@ -105,8 +85,7 @@ "bourseMoney":[bourseMoneyBefore, bourseMoneyAfter]} #流向 增加金额记录 - DataRecordPack.DR_ToolGMOperate(playerID, curPlayer.GetPlayerName(), curPlayer.GetAccID(), 'GMT_CTG', resultDict) + DataRecordPack.DR_ToolGMOperate(playerID, curPlayer.GetPlayerName(), curPlayer.GetAccID(), GMT_Name, resultDict) return Result, resultDict - - \ No newline at end of file + \ No newline at end of file -- Gitblit v1.8.0