hxp
2019-08-09 b8db02d69c95fa1f94e304ab6a7714c54517a9e0
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
#!/usr/bin/python
# -*- coding: GBK -*-
 
##@package GMT_LockIP
# Êý¾Ý¿âGMÃüÁîÖ´ÐÐ->IPËø¶¨
#
# @author whx
# @date 2012-08-10 17:00
# @version 1.0
#
# ÐÞ¸Äʱ¼ä ÐÞ¸ÄÈË ÐÞ¸ÄÄÚÈÝ
# @note
# Ä£¿éÏêϸ˵
#½Å±¾ËµÃ÷
#---------------------------------------------------------------------
#µ¼Èë
import IPY_GameServer
import GMCommon
import ChConfig
import GameWorld
import DataRecordPack
#---------------------------------------------------------------------
#È«¾Ö±äÁ¿
#---------------------------------------------------------------------
VER = "2012-08-10 17:00" 
#---------------------------------------------------------------------
#Âß¼­ÊµÏÖ(ÕâÀïcurPlayer = None)
## Ö´ÐÐÂß¼­
#  @param curPlayer µ±Ç°Íæ¼Ò
#  @param gmList 
#  @return None
#  @remarks º¯ÊýÏêϸ˵Ã÷.
def OnExec(orderId, gmCmdDict):
    queryType = gmCmdDict.get(GMCommon.Def_GMKey_QueryType, '')
    
    #IP´¦·ÖÐÅÏ¢
    if queryType == "allPlayer":
        GMCommon.GMCommandResult(orderId, gmCmdDict, GMCommon.Def_ParamErr)  
        return 
    
    forbidLoginList = []
    forbidTalkList = []
    
    allIPManager = GameWorld.GetGameWorld().GetAllDBIPManage()
    
    ipManageCnt = allIPManager.GetCount()
    
    if ipManageCnt <= 0:
        GMCommon.GMCommandResult(orderId, gmCmdDict, GMCommon.Def_NoTag)  
        return
    
    for i in range(ipManageCnt):
        ipMgr = allIPManager.GetAt(i)
        gmOper = ipMgr.GetOper()
        
        #½ûÖ¹µÇ½
        if gmOper == IPY_GameServer.gmForbidAcc:
            forbidLoginList.append(ipMgr.GetIP())
        
        #½ûÑÔ
        if gmOper == IPY_GameServer.gmForbidTalk:
            forbidTalkList.append(ipMgr.GetIP())
    
    forbidInfo = {
              'forbidLoginList':forbidLoginList,  #ÊÇ·ñËø¶¨
              'forbidTalkList':forbidTalkList,  #ÊÇ·ñ½ûÑÔ
              }
    
    if len(forbidInfo) > pow(2, 14):
        #Êý¾Ý¹ý´ó
        GMCommon.GMCommandResult(orderId, gmCmdDict, GMCommon.Def_MaxLimit)   
        return
    
    #Ö´Ðгɹ¦
    GMCommon.GMCommandResult(orderId, gmCmdDict, GMCommon.Def_Success, forbidInfo)        
    return