#!/usr/bin/python
|
# -*- coding: GBK -*-
|
#-------------------------------------------------------------------------------
|
#
|
##@package PyMongoDB.GMToolLogicProcess.Commands.GMT_AddEntireCompensation
|
#
|
# @todo:GM¹¤¾ßÃüÁî - Ìí¼ÓÈ«·þÓʼþ
|
# @author hxp
|
# @date 2025-06-04
|
# @version 1.0
|
#
|
# ÏêϸÃèÊö: GM¹¤¾ßÃüÁî - Ìí¼ÓÈ«·þÓʼþ
|
#
|
#-------------------------------------------------------------------------------
|
#"""Version = 2025-06-04 15:00"""
|
#-------------------------------------------------------------------------------
|
|
import PlayerMail
|
import DataRecordPack
|
import GMT_AddPersonalCompensation
|
import GMCommon
|
|
## Ö´ÐÐÂß¼
|
# @param curPlayer µ±Ç°Íæ¼Ò
|
# @param gmCmdDict: ÃüÁî×Öµä
|
# @return None
|
# @remarks º¯ÊýÏêϸ˵Ã÷.
|
def OnExec(gmCmdDict):
|
|
LimitDays = int(gmCmdDict.get('LimitDays', '7'))
|
MailType = int(gmCmdDict.get('MailType', '0'))
|
Title = gmCmdDict.get('Title', '')
|
Text = gmCmdDict.get('Text', '')
|
GUID = gmCmdDict.get('GUID', '') # GM¹¤¾ßÐèÒª¶ÔÈ«·þÓʼþ½øÐжà·þÅúÁ¿¹ÜÀí£¬ËùÒÔÕâÀïGUIDÔÝÓÉGM¹¤¾ß¾ö¶¨
|
|
if GUID.startswith("{") and GUID.endswith("}"):
|
GUID = GUID[1:-1]
|
if not GUID:
|
return GMCommon.Def_ParamErr
|
|
limitLV = min(99999, int(gmCmdDict.get('PlayerLV', '0'))) # Ö§³ÖµÄ×î´óµÈ¼¶
|
limitLVType = int(gmCmdDict.get('LimitLVType', '0')) # ÔÏÈδ´ïµ½ÓʼþÁìÈ¡µÈ¼¶µÄÍæ¼ÒÖ®ºóÉý¼¶ÉÏÀ´ÊÇ·ñ¿ÉÁìÈ¡Óʼþ, ĬÈÏ0-²»¿É£¬1-¿ÉÒÔ
|
checkState = int(gmCmdDict.get('CheckState', '0')) # ÓʼþÉóºË״̬£¬Îª¼æÈÝÀÏÓʼþ£¬Ä¬ÈÏ0-ÒÑÉóºË£¬1-δÉóºË
|
itemList = GMT_AddPersonalCompensation.GetGMTMailItemList(gmCmdDict)
|
|
mailObj = PlayerMail.SendSeverMail(GUID, Title, Text, itemList, LimitDays, MailType, limitLV, limitLVType, checkState)
|
if not mailObj:
|
return GMCommon.Def_ParamErr, "GUID is exist."
|
|
# Á÷Ïò
|
GMT_Name = gmCmdDict.get(GMCommon.Def_GMKey_Type, '')
|
DataRecordPack.DR_ToolGMOperate(0, '', '', GMT_Name, str(gmCmdDict))
|
return GMCommon.Def_Success, {"GUID":GUID}
|
|