#!/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
|
|
|
|