hxp
2025-02-13 b4c65eee7a595d44e2282e50f96d0e43283b730e
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#!/usr/bin/python
# -*- coding: GBK -*-
#-------------------------------------------------------------------------------
#
##@package GM.Commands.GMT_CompensationQueryPersonal
#
# @todo:¸öÈ˲¹³¥²éѯ¹ÜÀí
# @author hxp
# @date 2020-12-21
# @version 1.0
#
# ÏêϸÃèÊö: ¸öÈ˲¹³¥²éѯ¹ÜÀí
#
#-------------------------------------------------------------------------------
#"""Version = 2020-12-21 19:00"""
#-------------------------------------------------------------------------------
 
import GMCommon
import DataRecordPack
import GameWorld
import PlayerCompensation
 
## Ö´ÐÐÂß¼­
#  @param curPlayer µ±Ç°Íæ¼Ò
#  @param gmCmdDict: ÃüÁî×Öµä
#  @return None
#  @remarks º¯ÊýÏêϸ˵Ã÷.
def OnExec(orderId, gmCmdDict):
    
    GameWorld.DebugLog("GMT_CompensationQueryPersonal %s" % gmCmdDict)
    PlayerIDList = eval(gmCmdDict.get('PlayerIDList', '[]'))
    if PlayerIDList == []:
        GMCommon.GMCommandResult(orderId, gmCmdDict, GMCommon.Def_ParamErr)
        return
    playerID = GameWorld.ToIntDef(PlayerIDList[0]) # Ö»Õë¶Ôµ¥Íæ¼Ò´¦Àí
    if not playerID:
        GMCommon.GMCommandResult(orderId, gmCmdDict, GMCommon.Def_ParamErr)
        return
    opType = gmCmdDict.get('opType', 'query')
    
    # Ôݽö×öɾ³ý¼°²éѯ
    if opType == "del":
        GUIDInfo = gmCmdDict.get('GUIDInfo', '')
        if not GUIDInfo:
            GMCommon.GMCommandResult(orderId, gmCmdDict, GMCommon.Def_ParamErr)
            return
        
        delGUIDList = GUIDInfo.split(",")
        if not delGUIDList:
            GMCommon.GMCommandResult(orderId, gmCmdDict, GMCommon.Def_ParamErr)
            return
        curPlayer = GameWorld.GetPlayerManager().FindPlayerByID(playerID)
        for delGUID in delGUIDList:
            PlayerCompensation.ClearPersonalCompensation(playerID, delGUID, "GMT")
            if curPlayer:
                PlayerCompensation.NotifyCompensationResult(curPlayer, delGUID, 1)
    else:
        pass
    
    ResultList = PlayerCompensation.QueryCompensationPersonalInfo(playerID)
    
    #Ö´Ðгɹ¦
    GMCommon.GMCommandResult(orderId, gmCmdDict, GMCommon.Def_Success, {"QueryCmdInfo":gmCmdDict, "ResultList":ResultList})
    #Á÷Ïò
    DataRecordPack.DR_ToolGMOperate(0, '', '', 'GMT_CompensationQueryPersonal', str(gmCmdDict))
    return