| #!/usr/bin/python  | 
| # -*- coding: GBK -*-  | 
|   | 
| ##@package FobidLoginByIP  | 
| # Êý¾Ý¿âGMÃüÁîÖ´ÐÐ->IP½ûµÇ¼  | 
| #  | 
| # @author mark  | 
| # @date 2010-3-31  | 
| # @version 1.0  | 
| #  | 
| # ÐÞ¸Äʱ¼ä ÐÞ¸ÄÈË ÐÞ¸ÄÄÚÈÝ  | 
| # VER = "2010-05-14 9:30" zhengyang Ìí¼Ó×¢ÊÍ  | 
| #  | 
| # Ä£¿éÏêϸ˵  | 
| #½Å±¾ËµÃ÷  | 
| #---------------------------------------------------------------------  | 
| #µ¼Èë  | 
| import IPY_GameServer  | 
| import GMCommon  | 
| import ChConfig  | 
| import GameWorld  | 
| #---------------------------------------------------------------------  | 
| #È«¾Ö±äÁ¿  | 
| #---------------------------------------------------------------------  | 
|   | 
| #---------------------------------------------------------------------  | 
| #Â߼ʵÏÖ(ÕâÀïcurPlayer = None)  | 
| ## Ö´ÐÐÂß¼  | 
| #  @param curPlayer µ±Ç°Íæ¼Ò None  | 
| #  @param gmList [cmdIndex,gmAccID,forbidAccIP]  | 
| #  @return None  | 
| #  @remarks º¯ÊýÏêϸ˵Ã÷.  | 
| def OnExec( curPlayer, gmList ):  | 
|     cmdIndex = gmList[0]  | 
|     gmAccID = gmList[1]  | 
|     forbidAccIP = str(gmList[2])  | 
|       | 
|     #²Ù×÷·û  | 
|     gmOper = IPY_GameServer.gmForbidAcc  | 
|     ipManager = GameWorld.GetGameWorld().GetAllDBIPManage()  | 
|     #ÒѾ´æÔÚ´ËIP,²»Öظ´Ìí¼Ó  | 
|     if ipManager.FindIPManage( forbidAccIP, gmOper ):  | 
|         GMCommon.Send_DataServer_GMCommandResult( cmdIndex, ChConfig.Def_GMTool_Fail )  | 
|         return  | 
|       | 
|     addIP = ipManager.AddIP()  | 
|     addIP.SetIP( forbidAccIP )  | 
|     addIP.SetOper( gmOper )  | 
|       | 
|     #¹ã²¥ËùÓеØÍ¼ , Èç¹ûÍæ¼ÒÔÚÏßÖ´Ðд˲Ù×÷  | 
|     playerManager = GameWorld.GetPlayerManager()  | 
|       | 
|     for index in range( playerManager.GetPlayerCount() ):  | 
|         curPlayer = playerManager.GetPlayerByIndex( index )  | 
|         if not curPlayer.GetID():  | 
|             continue  | 
|           | 
|         if curPlayer.GetIP() != forbidAccIP:  | 
|             continue  | 
|           | 
|         curPlayer.Kick( IPY_GameServer.disGMKick )  | 
|           | 
|     GMCommon.Send_DataServer_GMCommandResult(cmdIndex, ChConfig.Def_GMTool_Succeed)  | 
|     return  | 
|   | 
|   | 
|   | 
|   |