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