From 5831ac5f8c886bf92182a8a40267881784eb6b4e Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期五, 05 九月 2025 15:12:03 +0800
Subject: [PATCH] 16 卡牌服务端(优化功能开启命令限制的等级、境界;优化任务开启功能,完成任意任务可开启之前已完成任务可开启的功能;)
---
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/PyMongoDB/GMToolLogicProcess/Commands/GMT_AddPersonalCompensation.py | 80 ++++++++++++++++++++++++++--------------
1 files changed, 52 insertions(+), 28 deletions(-)
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/PyMongoDB/GMToolLogicProcess/Commands/GMT_AddPersonalCompensation.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/PyMongoDB/GMToolLogicProcess/Commands/GMT_AddPersonalCompensation.py
index af490fd..70d7893 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/PyMongoDB/GMToolLogicProcess/Commands/GMT_AddPersonalCompensation.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/PyMongoDB/GMToolLogicProcess/Commands/GMT_AddPersonalCompensation.py
@@ -2,45 +2,69 @@
# -*- coding: GBK -*-
#-------------------------------------------------------------------------------
#
-#-------------------------------------------------------------------------------
+##@package PyMongoDB.GMToolLogicProcess.Commands.GMT_AddPersonalCompensation
#
-##@package PyMongoDataServer.GMToolLogicProcess.Commands.GMT_AddPersonalCompensation
-#
-# @todo:个人补偿 - 新
+# @todo:GM工具命令 - 添加个人邮件
# @author hxp
-# @date 2014-09-23
+# @date 2025-06-04
# @version 1.0
#
-# 详细描述: 个人补偿 - 新
+# 详细描述: GM工具命令 - 添加个人邮件
#
-#---------------------------------------------------------------------
-"""Version = 2014-09-23 12:00"""
+#-------------------------------------------------------------------------------
+#"""Version = 2025-06-04 15:00"""
+#-------------------------------------------------------------------------------
+import GameWorld
import GMCommon
-#---------------------------------------------------------------------
-#全局变量
-
-#---------------------------------------------------------------------
-
+import DataRecordPack
+import PlayerMail
## 收到gm命令执行
# @param gmCmdDict:gm命令字典
# @return None
def OnExec(gmCmdDict):
- playerList = gmCmdDict.get("playerList", "") #玩家列表
+ from GMToolLogicProcess import ProjSpecialProcess
+ ret = ProjSpecialProcess.GMCmdPlayerListValidationID(gmCmdDict)
+ Result = ret[0]
+ if Result != GMCommon.Def_Success:
+ return Result, ret[1]
+ playerIDList = ret[1]
- if playerList == "":
- return GMCommon.Def_ParamErr, "Please enter search player info!"
+ LimitDays = int(gmCmdDict.get('LimitDays', '7'))
+ MailType = int(gmCmdDict.get('MailType', '0'))
+ Title = gmCmdDict.get('Title', '')
+ Text = gmCmdDict.get('Text', '')
+ itemList = GetGMTMailItemList(gmCmdDict)
+
+ for playerID in playerIDList:
+ PlayerMail.SendMail(playerID, Title, Text, itemList, LimitDays, MailType)
+
+ # 流向
+ GMT_Name = gmCmdDict.get(GMCommon.Def_GMKey_Type, '')
+ DataRecordPack.DR_ToolGMOperate(0, '', '', GMT_Name, str(gmCmdDict))
+ return GMCommon.Def_Success
- # 回复gm参数错误
- return GMCommon.Def_DoQueryUserDB, ''
-
-## 查询userdb返回
-# @param userdb:userdb
-# @param data:传入的信息
-# @param gmCmdDict:gm命令字典
-# @return None
-def UserDBResponse(userdb, data, gmCmdDict):
- return GMCommon.Def_SendToGameServer, ''
-
-
+def GetGMTMailItemList(gmCmdDict):
+
+ #工具发过来的物品下标依据 'index,index,...' 不一定是从0开始并按顺序连续 =_=#
+ intemIndexStrList = []
+ itemNums = gmCmdDict.get('itemNums', '')
+ if itemNums.strip() != '':
+ intemIndexStrList = itemNums.split(',')
+ #添加物品
+ itemList = []
+ for itemIndexStr in intemIndexStrList:
+ itemID = GameWorld.ToIntDef(gmCmdDict.get('ItemID%s' % itemIndexStr, '0'))
+ if not itemID:
+ continue
+ itemCount = GameWorld.ToIntDef(gmCmdDict.get('ItemCnt%s' % itemIndexStr, '0'))
+ if not itemCount:
+ continue
+ isBind = GameWorld.ToIntDef(gmCmdDict.get('IsBind%s' % itemIndexStr, '0'))
+
+ #添加到物品信息列表
+ itemList.append([itemID, itemCount, isBind])
+
+ GameWorld.DebugLog("GetGMTMailItemList %s" % itemList)
+ return itemList
--
Gitblit v1.8.0