#!/usr/bin/python # -*- coding: GBK -*- #------------------------------------------------------------------------------- # ##@package PyMongoDB.GMToolLogicProcess.Commands.GMT_AddPersonalCompensation # # @todo:GM¹¤¾ßÃüÁî - Ìí¼Ó¸öÈËÓʼþ # @author hxp # @date 2025-06-04 # @version 1.0 # # ÏêϸÃèÊö: GM¹¤¾ßÃüÁî - Ìí¼Ó¸öÈËÓʼþ # #------------------------------------------------------------------------------- #"""Version = 2025-06-04 15:00""" #------------------------------------------------------------------------------- import GameWorld import GMCommon import DataRecordPack import PlayerMail ## ÊÕµ½gmÃüÁîÖ´ÐÐ # @param gmCmdDict:gmÃüÁî×Öµä # @return None def OnExec(gmCmdDict): from GMToolLogicProcess import ProjSpecialProcess ret = ProjSpecialProcess.GMCmdPlayerListValidationID(gmCmdDict) Result = ret[0] if Result != GMCommon.Def_Success: return Result, ret[1] playerIDList = ret[1] 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 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