10077 游戏代币方案(充值转化代币邮件通知代币参数修改;后台增加直接发放代币)
New file |
| | |
| | | #!/usr/bin/python
|
| | | # -*- coding: GBK -*-
|
| | | #-------------------------------------------------------------------------------
|
| | | #
|
| | | ##@package GM.Commands.GMT_AddPayCoin
|
| | | #
|
| | | # @todo:发放代币
|
| | | # @author hxp
|
| | | # @date 2024-01-02
|
| | | # @version 1.0
|
| | | #
|
| | | # 详细描述: 发放代币
|
| | | #
|
| | | #-------------------------------------------------------------------------------
|
| | | #"""Version = 2024-01-02 14:00"""
|
| | | #-------------------------------------------------------------------------------
|
| | |
|
| | | import GMCommon
|
| | | import ChConfig
|
| | | import GameWorld
|
| | | import GMShell
|
| | |
|
| | | ## 执行逻辑
|
| | | # @param curPlayer 当前玩家
|
| | | # @param gmCmdDict: 命令字典
|
| | | # @return None
|
| | | # @remarks 函数详细说明.
|
| | | def OnExec(orderId, gmCmdDict):
|
| | | queryType = gmCmdDict.get(GMCommon.Def_GMKey_QueryType, '')
|
| | | playerFind = gmCmdDict.get(GMCommon.Def_GMKey_PlayerFind, '')
|
| | | value = GameWorld.ToIntDef(gmCmdDict.get('value', ''))
|
| | | |
| | | tagPlayer = None
|
| | | playerManager = GameWorld.GetPlayerManager()
|
| | | |
| | | if queryType == GMCommon.Def_GMKey_PlayerAccID:
|
| | | queryType = ChConfig.queryType_sqtPlayerByAccID
|
| | | tagPlayer = playerManager.FindPlayerByAccID(str(playerFind))
|
| | | |
| | | elif queryType == GMCommon.Def_GMKey_PlayerName:
|
| | | queryType = ChConfig.queryType_sqtPlayerByName
|
| | | tagPlayer = playerManager.FindPlayerByName(str(playerFind))
|
| | | |
| | | else:
|
| | | GMCommon.GMCommandResult(orderId, gmCmdDict, GMCommon.Def_ParamErr)
|
| | | return
|
| | | |
| | | if not tagPlayer:
|
| | | # 玩家不在线,先记录,等玩家上线后处理
|
| | | GMShell.AddOfflinePlayerGMTInfo(orderId, queryType, playerFind, gmCmdDict)
|
| | | return
|
| | | |
| | | isOnlineGMT = True
|
| | | GMCommon.GMTool_MapServer_Query(queryType, orderId, playerFind, gmCmdDict, 'GMTAddPayCoin', [orderId, value, isOnlineGMT], False)
|
| | | return
|
| | |
|
| | | def OnOfflineCTGInfo(curPlayer, tagMapID, gmCmdDict):
|
| | | orderId = gmCmdDict.get('orderId', '')
|
| | | value = GameWorld.ToIntDef(gmCmdDict.get('value', ''), 0)
|
| | | isOnlineGMT = False # 是否是在线接收的GM工具命令
|
| | | cmdStr = str([orderId, value, isOnlineGMT])
|
| | | GameWorld.GetPlayerManager().MapServer_QueryPlayer(0, 0, curPlayer.GetPlayerID(), tagMapID, 'GMTAddPayCoin', cmdStr, len(cmdStr), curPlayer.GetRouteServerIndex())
|
| | | return
|
| | |
| | | % (orderInfo, orderCoin, payOrderType, eventName, befPayCoin, aftPayCoin, errorInfo), playerID)
|
| | |
|
| | | addItemList = []
|
| | | paramList = [orderInfo, CommFunc.CoinToYuan(orderCoin)]
|
| | | paramList = [orderInfo, orderCoin]
|
| | | PlayerControl.SendMailByKey("ExchangeToPayCoin", [playerID], addItemList, paramList)
|
| | |
|
| | | if payOrderType != PayOrderType_PayCoin:
|
New file |
| | |
| | | #!/usr/bin/python
|
| | | # -*- coding: GBK -*-
|
| | | #-------------------------------------------------------------------------------
|
| | | #
|
| | | ##@package Player.RemoteQuery.GY_Query_GMTAddPayCoin
|
| | | #
|
| | | # @todo:发放代币
|
| | | # @author hxp
|
| | | # @date 2024-01-02
|
| | | # @version 1.0
|
| | | #
|
| | | # 详细描述: 发放代币
|
| | | #
|
| | | #-------------------------------------------------------------------------------
|
| | | #"""Version = 2024-01-02 14:00"""
|
| | | #-------------------------------------------------------------------------------
|
| | |
|
| | | import GameWorld
|
| | | import DataRecordPack
|
| | | import PlayerControl
|
| | | import ShareDefine
|
| | | import GMCommon
|
| | |
|
| | | #逻辑实现 |
| | | ## 请求逻辑 |
| | | # @param query_Type 请求类型
|
| | | # @param query_ID 玩家ID
|
| | | # @param packCMDList 发包命令 |
| | | # @param tick 当前时间
|
| | | # @return "True" or "False" or ""
|
| | | # @remarks 函数详细说明.
|
| | | def DoLogic(query_Type, query_ID, packCMDList, tick):
|
| | | curPlayer = GameWorld.GetPlayerManager().FindPlayerByID(query_ID)
|
| | | |
| | | if not curPlayer or curPlayer.IsEmpty():
|
| | | return
|
| | | |
| | | Result = GMCommon.Def_Success
|
| | | orderId, value, isOnlineGMT = packCMDList
|
| | | |
| | | PlayerControl.GiveMoney(curPlayer, ShareDefine.TYPE_Price_PayCoin, value, "GMTAdd")
|
| | | |
| | | resultDict = {"value":value, "isOnlineGMT":isOnlineGMT, "nowPayCoin":PlayerControl.GetMoney(curPlayer, ShareDefine.TYPE_Price_PayCoin)}
|
| | | GameWorld.Log("GMTAddPayCoin: value=%s,isOnlineGMT=%s,resultDict=%s" % (value, isOnlineGMT, resultDict), curPlayer.GetPlayerID())
|
| | | #流向 记录
|
| | | DataRecordPack.DR_ToolGMOperate(query_ID, curPlayer.GetPlayerName(), curPlayer.GetAccID(), 'GMT_AddPayCoin', resultDict)
|
| | | |
| | | if isOnlineGMT:
|
| | | resultMsg = str([orderId, resultDict, 'GMT_AddPayCoin', Result])
|
| | | GameWorld.GetPlayerManager().GameServer_QueryPlayerResult(0, 0, 0, 'GMToolResult', resultMsg, len(resultMsg))
|
| | | return
|
| | |
|
| | | #执行结果
|
| | | ## 执行结果
|
| | | # @param curPlayer 发出请求的玩家
|
| | | # @param callFunName 功能名称
|
| | | # @param funResult 查询的结果
|
| | | # @param tick 当前时间
|
| | | # @return None
|
| | | # @remarks 函数详细说明.
|
| | | def DoResult(curPlayer, callFunName, funResult, tick):
|
| | | return
|