hxp
2019-09-20 67bcc2ab06912fc3d9cf31ceae533da76e50d5ae
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
#!/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 [cmdIndex,gmAccID,forbidAcc,lastTime]
#  @return None
#  @remarks º¯ÊýÏêϸ˵Ã÷.
def OnExec(orderId, gmCmdDict):
    # »ñµÃ²¢×ª»»×Ö·û´®
    lockIP = gmCmdDict.get(GMCommon.Def_GMKey_IP, '')
    
    #²Ù×÷·û
    gmOper = IPY_GameServer.gmForbidAcc
    ipManager = GameWorld.GetGameWorld().GetAllDBIPManage()
    #ÒѾ­´æÔÚ´ËIP,²»Öظ´Ìí¼Ó
    if ipManager.FindIPManage(lockIP, gmOper):
        GMCommon.GMCommandResult(orderId, gmCmdDict, GMCommon.Def_NoNeed)
        return
    
    addIP = ipManager.AddIP()
    addIP.SetIP(lockIP)
    addIP.SetOper(gmOper)
    
    #¹ã²¥ËùÓеØÍ¼ , Èç¹ûÍæ¼ÒÔÚÏßÖ´Ðд˲Ù×÷
    playerManager = GameWorld.GetPlayerManager()
    
    for index in range(playerManager.GetPlayerCount()):
        curPlayer = playerManager.GetPlayerByIndex(index)
        if not curPlayer.GetID():
            continue
        
        if curPlayer.GetIP() != lockIP:
            continue
        
        curPlayer.Kick(IPY_GameServer.disGMKick)
        
    GMCommon.GMCommandResult(orderId, gmCmdDict, GMCommon.Def_Success)
    #¼Ç¼Á÷Ïò
    DataRecordPack.DR_ToolGMOperate(0, '', '', gmCmdDict.get(GMCommon.Def_GMKey_Type, lockIP))
    return