| #!/usr/bin/python  | 
| # -*- coding: GBK -*-  | 
|   | 
| ##@package GY_GM_ViewGame  | 
| # ²éѯ»î¶¯  | 
| #  | 
| # @author mark  | 
| # @date 2010-3-31  | 
| # @version 1.0  | 
| #  | 
| # ÐÞ¸Äʱ¼ä ÐÞ¸ÄÈË ÐÞ¸ÄÄÚÈÝ  | 
| # @change: "2011-09-15 10:50" jiang ÐÞ¸ÄÌáʾÐÅÏ¢µÄ»ñÈ¡·½Ê½  | 
| #  | 
| # Ä£¿éÏêϸ˵  | 
| #µ¼Èë  | 
| import ChConfig  | 
| import PlayerControl  | 
| import GameWorld  | 
| import GMCommon  | 
| #---------------------------------------------------------------------  | 
| """Version = 2011-09-15 10:50"""  | 
| #---------------------------------------------------------------------  | 
|   | 
| #È«¾Ö±äÁ¿  | 
| #---------------------------------------------------------------------  | 
|   | 
| #---------------------------------------------------------------------  | 
| #Â߼ʵÏÖ  | 
| ## Ö´ÐÐÂß¼  | 
| #  @param curPlayer µ±Ç°Íæ¼Ò  | 
| #  @param playerList []  | 
| #  @return None  | 
| #  @remarks º¯ÊýÏêϸ˵Ã÷.  | 
| def OnExec(curPlayer , playerList):  | 
|     eventManager = GameWorld.GetGameWorldEventManager()  | 
|     activeEventDisc = {}  | 
|     #ÒѾ¼¤»îµÄ»î¶¯ÁÐ±í  | 
|     isActiveIDList = []  | 
|       | 
|     for index in range( eventManager.GetActiveEventCount()):  | 
|         event = eventManager.GetActiveEventByIndex(index)  | 
|         eventID = event.GetEventID()  | 
|           | 
|         if eventID in [ChConfig.Def_GY_GM_Game_DoubleExp , ChConfig.Def_GY_GM_Game_Broadcast]:  | 
|             #ÌØÊâ»î¶¯,²»Í¨Öª  | 
|             continue  | 
|            | 
|         isActiveIDList.append(eventID)  | 
|         activeEventDisc.update(   | 
|                                {'%s'%eventID : {  | 
|                                                  'isActive' : '%s'%1                   ,  | 
|                                                  'BeginTime': '%s'%event.GetStartTime(),  | 
|                                                  'EndTime'  : '%s'%event.GetEndTime()  ,  | 
|                                                  'GMACCID'  : '%s'%event.GetAccID()  | 
|                                                 }   | 
|                                 }             | 
|                                 )  | 
|       | 
|     #È«²¿µÄ»î¶¯  | 
|     for evID in GMCommon.GetGameServer_GM_GameID():  | 
|   | 
|         #ÆäËûδ¼¤»îµÄ»î¶¯Õý³£´¦Àí  | 
|         if evID not in isActiveIDList:  | 
|             activeEventDisc.update(  | 
|                                    {  | 
|                                     '%s'%evID :{  | 
|                                                    'isActive' : '%s'%0  | 
|                                                    }  | 
|                                     }  | 
|                                    )  | 
|               | 
|     curPlayer.GMAnswer("%s;%s"%('ViewGame' , '%s'%activeEventDisc))  | 
|     return  | 
|   |