hxp
2025-06-04 71d77df560af421d106484e9276e89297b88e40a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/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}