| | |
| | | #!/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', '')
|
| | |
| | | goldBefore = PlayerControl.GetMoneyReal(curPlayer, IPY_GameWorld.TYPE_Price_Gold_Money)
|
| | | changeCoinPointBefore = curPlayer.GetChangeCoinPointTotal()
|
| | | bourseMoneyBefore = PlayerControl.GetMoney(curPlayer, ShareDefine.TYPE_Price_BourseMoney)
|
| | | |
| | |
|
| | | orderInfoIpyData = None
|
| | | if appID:
|
| | |
| | | "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
|
| | | |
| | | |