From 549dc6df101d84e373bc751b8155cbb466d59707 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期四, 16 十月 2025 14:44:53 +0800
Subject: [PATCH] 66 【公会】基础主体-服务端(搜索结果A523增加名次信息;)
---
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/PyMongoDB/GMToolLogicProcess/Commands/GMT_AddPersonalCompensation.py | 94 +++++++++++++++++++++++++++++++++--------------
1 files changed, 66 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..e3efab1 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,83 @@
# -*- 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
+import IpyGameDataPY
+import ShareDefine
+import CommFunc
## 收到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
+ itemData = GameWorld.GetGameData().GetItemByTypeID(itemID)
+ if not itemData:
+ GameWorld.ErrLog("GM发送邮件物品不存在! itemID=%s,itemCount=%s" % (itemID, itemCount))
+ continue
+ isBind = GameWorld.ToIntDef(gmCmdDict.get('IsBind%s' % itemIndexStr, '0'))
+ appointID = GameWorld.ToIntDef(gmCmdDict.get('AppointID%s' % itemIndexStr, '0'))
+ userData = ""
+ if appointID:
+ ipyData = IpyGameDataPY.GetIpyGameData("AppointItem", appointID)
+ if not ipyData:
+ continue
+ userData = CommFunc.JsonDump({ShareDefine.Def_CItemKey_AppointID:appointID})
+
+ #添加到物品信息列表
+ itemList.append([itemID, itemCount, isBind, userData])
+
+ GameWorld.DebugLog("GetGMTMailItemList %s" % itemList)
+ return itemList
--
Gitblit v1.8.0