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
69
70
71
72
73
74
75
76
77
78
79
80
81
#!/usr/bin/python
# -*- coding: GBK -*-
#-------------------------------------------------------------------------------
#
##@package GM.Commands.GMT_Face
#
# @todo:Í·Ïñ¹ÜÀí
# @author hxp
# @date 2024-09-12
# @version 1.0
#
# ÏêϸÃèÊö: Í·Ïñ¹ÜÀí
#
#-------------------------------------------------------------------------------
#"""Version = 2024-09-12 12:00"""
#-------------------------------------------------------------------------------
 
import GMCommon
import ChConfig
import GameWorld
import GMShell
 
## Ö´ÐÐÂß¼­
#  @param curPlayer µ±Ç°Íæ¼Ò
#  @param gmCmdDict: ÃüÁî×Öµä
#  @return None
#  @remarks º¯ÊýÏêϸ˵Ã÷.
def OnExec(orderId, gmCmdDict):
    queryType = gmCmdDict.get(GMCommon.Def_GMKey_QueryType, '')
    playerFind = gmCmdDict.get(GMCommon.Def_GMKey_PlayerFind, '')
    opID = GameWorld.ToIntDef(gmCmdDict.get('opID', ''), 0)
    expireTime = GameWorld.ToIntDef(gmCmdDict.get('expireTime', ''), None)
    setValue = GameWorld.ToIntDef(gmCmdDict.get('setValue', ''), 0)
    faceType = gmCmdDict.get('faceType', '')
    opType = gmCmdDict.get('opType', '')
    
    if opID <= 0:
        GMCommon.GMCommandResult(orderId, gmCmdDict, GMCommon.Def_ParamErr)
        return
    
    tagPlayer = None
    playerManager = GameWorld.GetPlayerManager()
    
    if queryType == GMCommon.Def_GMKey_PlayerAccID:
        queryType = ChConfig.queryType_sqtPlayerByAccID
        tagPlayer = playerManager.FindPlayerByAccID(str(playerFind))
    
    elif queryType == GMCommon.Def_GMKey_PlayerName:
        queryType = ChConfig.queryType_sqtPlayerByName
        tagPlayer = playerManager.FindPlayerByName(str(playerFind))
    
    else:
        GMCommon.GMCommandResult(orderId, gmCmdDict, GMCommon.Def_ParamErr)
        return
    
    if not tagPlayer:
        if opType == "query":
            GMCommon.GMCommandResult(orderId, gmCmdDict, GMCommon.Def_PlayerOfLine)
            return
        # Íæ¼Ò²»ÔÚÏߣ¬ÏȼǼ£¬µÈÍæ¼ÒÉÏÏߺó´¦Àí
        GMShell.AddOfflinePlayerGMTInfo(orderId, queryType, playerFind, gmCmdDict)
        return
    
    isOnlineGMT = True # ÊÇ·ñÊÇÔÚÏß½ÓÊÕµÄGM¹¤¾ßÃüÁî
    GMCommon.GMTool_MapServer_Query(queryType, orderId, playerFind, gmCmdDict, "GMTFace", [orderId, isOnlineGMT, faceType, opID, expireTime, opType, setValue], False)
    return
 
def OnOfflineGMTInfo(curPlayer, tagMapID, gmCmdDict):
    orderId = gmCmdDict.get('orderId', '')
    opID = GameWorld.ToIntDef(gmCmdDict.get('opID', ''), 0)
    expireTime = GameWorld.ToIntDef(gmCmdDict.get('expireTime', ''), None)
    setValue = GameWorld.ToIntDef(gmCmdDict.get('setValue', ''), 0)
    faceType = gmCmdDict.get('faceType', '')
    opType = gmCmdDict.get('opType', '')
    isOnlineGMT = False # ÊÇ·ñÊÇÔÚÏß½ÓÊÕµÄGM¹¤¾ßÃüÁî
    cmdStr = str([orderId, isOnlineGMT, faceType, opID, expireTime, opType, setValue])
    GameWorld.GetPlayerManager().MapServer_QueryPlayer(0, 0, curPlayer.GetPlayerID(), tagMapID, 'GMTFace',
                                                       cmdStr, len(cmdStr), curPlayer.GetRouteServerIndex())
    return