From 306bdb4c6de7b2b595f4bf931ee00e9d53f5cff4 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期二, 02 一月 2024 14:01:03 +0800
Subject: [PATCH] 10077 游戏代币方案(充值转化代币邮件通知代币参数修改;后台增加直接发放代币)

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerCoin.py                         |    2 
 ServerPython/CoreServerGroup/GameServer/Script/GM/Commands/GMT_AddPayCoin.py                                     |   63 +++++++++++++++++++++
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/RemoteQuery/GY_Query_GMTAddPayCoin.py |   62 ++++++++++++++++++++
 3 files changed, 126 insertions(+), 1 deletions(-)

diff --git a/ServerPython/CoreServerGroup/GameServer/Script/GM/Commands/GMT_AddPayCoin.py b/ServerPython/CoreServerGroup/GameServer/Script/GM/Commands/GMT_AddPayCoin.py
new file mode 100644
index 0000000..df07510
--- /dev/null
+++ b/ServerPython/CoreServerGroup/GameServer/Script/GM/Commands/GMT_AddPayCoin.py
@@ -0,0 +1,63 @@
+#!/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
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerCoin.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerCoin.py
index 5905aa3..ad0476a 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerCoin.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerCoin.py
@@ -296,7 +296,7 @@
                   % (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:
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/RemoteQuery/GY_Query_GMTAddPayCoin.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/RemoteQuery/GY_Query_GMTAddPayCoin.py
new file mode 100644
index 0000000..f2a14a8
--- /dev/null
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/RemoteQuery/GY_Query_GMTAddPayCoin.py
@@ -0,0 +1,62 @@
+#!/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

--
Gitblit v1.8.0