hxp
2018-12-26 3a3ad99a1761438e31bc6860e94b43cb4f165513
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
#!/usr/bin/python
# -*- coding: GBK -*-
#---------------------------------------------------------------------
#
#---------------------------------------------------------------------
##@package GameWorldActionControl
# @todo: Ö»×öÊÀ½ç֪ͨºÍ»î¶¯µÄ×Ü¿ª¹ØÂß¼­£¨°´Ê±¼ä£©
#
# @author: hch
# @date 2010-3-31
# @version 1.1
#
# @note: Ö»×öÊÀ½ç֪ͨºÍ»î¶¯µÄ×Ü¿ª¹ØÂß¼­(°´Ê±¼ä)
#
# @change: "2018-7-16 12:00" hxp Ôö¼ÓÔËÓª»î¶¯Ê±¼ä¿ØÖÆÖ§³Ö£»Ôö¼Ó¶à±¶¾­Ñé»î¶¯¡¢Ïû·Ñ·µÀû»î¶¯
#
#---------------------------------------------------------------------
#"""Version = 2018-7-16 12:00"""
#---------------------------------------------------------------------
import ChConfig
import datetime
import GameWorld
import ReadChConfig
import PlayerControl
import ShareDefine
#import PlayerExam
import PlayerDBGSEvent
#import PlayerManorWar
#import GameWorldShopItem
#import GameWorldActionTeHui
import GameWorldAverageLv
import CrossRealmPK
import GameWorldFamilyWar
import PlayerFamilyParty
import IpyGameDataPY
import PlayerXMZZ
import PlayerFamilySWRH
import GameWorldBoss
import PlayerFairyCeremony
import GameWorldProcess
import ChPyNetSendPack
import NetPackCommon
import PlayerStore
 
from types import IntType
import time
#---------------------------------------------------------------------
 
#ÄêÔÂÈÕʱ¼ä¸ñʽ
Time_YmdFormat = ChConfig.TYPE_Time_YmdFormat
 
ATTR_CALL_TIME = ['weekday', 'year', 'month', 'day', 'hour', 'minute']
 
(
OperationAction_ReloadSign, # ÐÅÏ¢ÖØÔØ±ê¼Ç
OperationAction_TodayInfo, # µ±ÈյĻÐÅÏ¢
OperationAction_MapServerInfo, # Í¬²½µØÍ¼µÄ»î¶¯ÐÅÏ¢
) = range(3)
 
def OnPlayerLogin(curPlayer):
    
    isReload, OperationActionInfo = __GetOperationActionInfo()
    operationActionDict = OperationActionInfo[OperationAction_TodayInfo]
    
    if isReload:
        return
    
    # ¶à±¶¾­Ñé»î¶¯½øÐÐÖÐ
    if ShareDefine.OperationActionName_ExpRate in operationActionDict:
        ipyData = operationActionDict[ShareDefine.OperationActionName_ExpRate][0]
        if ipyData:
            Sync_OperationAction_ExpRate(ipyData, curPlayer)
 
    # ÏɽçÊ¢µä»î¶¯½øÐÐÖÐ
    if ShareDefine.OperationActionName_FairyCeremony in operationActionDict:
        ipyData = operationActionDict[ShareDefine.OperationActionName_FairyCeremony][0]
        if ipyData:
            PlayerFairyCeremony.Sync_OperationAction_FairyCeremony(ipyData, curPlayer)
        
    # ¶à±¶ÐÞÐеã»î¶¯½øÐÐÖÐ
    if ShareDefine.OperationActionName_RealmPoint in operationActionDict:
        ipyData = operationActionDict[ShareDefine.OperationActionName_RealmPoint][0]
        if ipyData:
            Sync_OperationAction_RealmPoint(ipyData, curPlayer)
    return
 
def SendMapServerOperationActionState():
    # µØÍ¼Æô¶¯³É¹¦Ê±Í¨Öª±¾ÈÕÔËÐлÏà¹Ø×´Ì¬
    
    isReload, OperationActionInfo = __GetOperationActionInfo()
    mapServerInfoDict = OperationActionInfo[OperationAction_MapServerInfo]
    
    if isReload:
        # Èç¹ûÊÇÖØ¶ÁµÄ£¬ÔòÔÚÄÚ²ãÒѾ­Í¬²½ÁË£¬´Ë´¦²»Öظ´Í¬²½
        return
    
    gameWorld = GameWorld.GetGameWorld()
    for actName in ShareDefine.OperationActionNameList:
        dictName = ChConfig.Def_WorldKey_OperationActionState % actName
        state = gameWorld.GetDictByKey(dictName)
        
        sendMapServerMsgDict = mapServerInfoDict.get(actName, {})
        sendMapServerMsgDict[ShareDefine.ActKey_State] = state
        GameWorld.SendMapServerMsgEx(ShareDefine.Def_Notify_WorldKey_OperationActionInfo % actName, sendMapServerMsgDict)
        
    return
 
def __GetOperationActionInfo(isRefreshState=True):
    # @return: isReload, OperationActionInfo
    
    key = "OperationActionInfo"
    openServerDay = PlayerDBGSEvent.GetDBGSTrig_ByKey(PlayerDBGSEvent.Def_ServerDay) + 1
    OperationActionInfo = IpyGameDataPY.GetConfigEx(key)
    serverTime = GameWorld.GetServerTime()
    curHour = serverTime.hour
    reloadSignHour = 0 if curHour < 5 else 5
    reloadSign = "%s_%s" % (openServerDay, reloadSignHour)
    if OperationActionInfo and OperationActionInfo[OperationAction_ReloadSign] == reloadSign:
        #GameWorld.DebugLog("ÒѾ­¼ÓÔØ¹ý±¾ÈÕÔËÓª»î¶¯´¦ÀíÐÅÏ¢£¡openServerDay=%s" % openServerDay)
        return False, OperationActionInfo
    
    # ÒòΪºóÃæµÄʱ¼äÅж϶¼ÊǾ«È·µ½·ÖµÄ£¬¶ø´¦Àí´ËÂß¼­µÄʱºò¿ÉÄܲ»ÊÇ0Ã룬ËùÒÔÕâÀïµÄdatetimeÈ¡µ±Ç°Ê±¼ä¾«È·µ½·ÖµÄ
    curDateTimeStr = "%d-%d-%d %02d:%02d:00" % (serverTime.year, serverTime.month, serverTime.day, serverTime.hour, serverTime.minute)
    curDateTime = datetime.datetime.strptime(curDateTimeStr, ChConfig.TYPE_Time_Format)
    
    customMaxServerDay = IpyGameDataPY.GetFuncCfg("OperationAction", 1) # ¶¨ÖÆÔËÓª»î¶¯×î´ó¿ª·þÌì
    operationActionDict = {}
    mapServerOperationActionDict = {}
    serverID = GameWorld.GetServerID()
    ipyDataMgr = IpyGameDataPY.IPY_Data()
    
    GameWorld.Log("===== ¼ÓÔØ±¾ÈÕÔËÓª»î¶¯ÐÅÏ¢: %s, serverID=%s,openServerDay=%s,customMaxServerDay=%s,reloadSign=%s =====" 
                  % (curDateTime, serverID, openServerDay, customMaxServerDay, reloadSign))
    
    for actName in ShareDefine.OperationActionNameList:
        
        # È¡³ö±¾»î¶¯ËùÊô±¾·þIDµÄËùÓÐÅäÖÃ
        curServerActIpyDataList = __GetOperationActionServerIpyDataList(ipyDataMgr, serverID, actName)
        GameWorld.Log("¼ÓÔØÔËÓª»î¶¯: actName=%s,¿É´¦ÀíÌõÊý=%s" % (actName, len(curServerActIpyDataList)))
        needStartList = [] # [startDateTime, ...]
        needEndList = [] # [endDateTime, ...]
        needNotifyDict = {} # {notifyDateTime:[notifyKey, [²ÎÊý]], ...}
        activityIpyData = None # »î¶¯ÖеĵÄÅäÖã¬È¡ÐèÒª´¦ÀíµÄÅäÖÃÖпªÊ¼Ê±¼ä×îÍíµÄ£¬·´Ö®¿ª¹ØÊ±¼äͷβÏàÁ¬µÄʱºòÎÞ·¨¿ªÆôºóÃæµÄ»î¶¯
        # ×¢Ò⣺ÿ¸ö»î¶¯ÅäÖûáÓжà¸ö»î¶¯Ê±¼äµã£¬µ«ÊÇÓÐÇÒÖ»ÄÜÉúЧһÌõ»î¶¯ÅäÖ㬻»¾ä»°Ëµ¾ÍÊÇÿ¸ö»î¶¯ÅäÖÃʱ¼ä²»ÔÊÐí½»²æ
        for ipyData in curServerActIpyDataList:
            
            cfgID = ipyData.GetCfgID()
            startDateStr = ipyData.GetStartDate()
            endDateStr = ipyData.GetEndDate()
            GameWorld.Log("    cfgID=%s,mark=%s,serverIDList=%s,startDateStr=%s,endDateStr=%s,openServerDay=%s,curDateTime=%s" 
                          % (cfgID, ipyData.GetActMark(), ipyData.GetServerIDList(), startDateStr, endDateStr, openServerDay, curDateTime))
            # °´¿ª·þÌ쿪µÄ
            if startDateStr.isdigit() and endDateStr.isdigit():
                startServerDay, endServerDay = int(startDateStr), int(endDateStr)
                #½áÊøÈÕ¿ÉÄÜ»¹ÐèÒª´¦Àí¹ã²¥Ö®À࣬ËùÒÔÕâÀïÐèÒª+1
                if openServerDay > endServerDay + 1:
                    GameWorld.Log("        µ±Ç°¿ª·þÌ쳬¹ý»î¶¯½áÊø¿ª·þÌ죬²»´¦Àí! cfgID=%s,%s ~ %s < openServerDay(%s)" % (cfgID, startDateStr, endDateStr, openServerDay))
                    continue
                openServerDateTime = curDateTime + datetime.timedelta(days=(startServerDay-openServerDay))
                endServerDateTime = curDateTime + datetime.timedelta(days=(endServerDay-openServerDay))
                startDateStr = "%d-%d-%d" % (openServerDateTime.year, openServerDateTime.month, openServerDateTime.day)
                endDateStr = "%d-%d-%d" % (endServerDateTime.year, endServerDateTime.month, endServerDateTime.day)
                GameWorld.Log("        ¿ª·þÌìת»¯ÎªÈÕÆÚ: %s ~ %s" % (startDateStr, endDateStr))
            else:
                if openServerDay <= customMaxServerDay:
                    GameWorld.Log("        °´ÈÕÆÚ¿ªµÄÔÚ¿ª·þ¶¨ÖÆÏÞÖÆÌìÄÚ£¬²»´¦Àí! cfgID=%s,%s ~ %s,openServerDay=%s" % (cfgID, startDateStr, endDateStr, openServerDay))
                    continue
                customMaxServerDateTime = curDateTime + datetime.timedelta(days=(customMaxServerDay-openServerDay))
                curStartDateTime = datetime.datetime.strptime("%s %02d:%02d:%02d" % (startDateStr, customMaxServerDateTime.hour, customMaxServerDateTime.minute, 
                                                                                     customMaxServerDateTime.second), ChConfig.TYPE_Time_Format)
                if curStartDateTime <= customMaxServerDateTime:
                    GameWorld.Log("        °´ÈÕÆÚ¿ªµÄ¿ªÊ¼ÈÕÆÚÔÚ¿ª·þ¶¨ÖÆÏÞÖÆÌìÄÚ£¬²»´¦Àí! cfgID=%s,curStartDateTime=%s,customMaxServerDateTime=%s" % (cfgID, curStartDateTime, customMaxServerDateTime))
                    continue
                
            if hasattr(ipyData, "GetStartTimeList") and hasattr(ipyData, "GetEndTimeList"):
                startHMStrList = ipyData.GetStartTimeList()
                endHMStrList = ipyData.GetEndTimeList()
            else:
                startHMStrList = []
                endHMStrList = []
                
            notifyInfoDictStart = ipyData.GetNotifyInfoStart() if hasattr(ipyData, "GetNotifyInfoStart") else {}
            notifyInfoDictEnd = ipyData.GetNotifyInfoEnd() if hasattr(ipyData, "GetNotifyInfoEnd") else {}
            notifyInfoLoopInfo = ipyData.GetNotifyInfoLoop() if hasattr(ipyData, "GetNotifyInfoLoop") else {} # [Ñ­»··ÖÖÓ, ¹ã²¥key, [¹ã²¥²ÎÊýÁбí¿ÉÑ¡]]
            
            if len(startHMStrList) != len(endHMStrList):
                GameWorld.ErrLog("        »î¶¯ÅäÖÿªÊ¼¼°½áÊøÊ±¼ä¸öÊý²»Æ¥Åä! actName=%s,cfgID=%s,startHMStrList=%s,endHMStrList=%s" 
                                 % (actName, cfgID, startHMStrList, endHMStrList))
                continue
            
            resetType = 0 if not hasattr(ipyData, "GetResetType") else ipyData.GetResetType() # ÖØÖÃÀàÐÍ£¬0-0µãÖØÖã»1-5µãÖØÖÃ
            if resetType == 1:
                startDayDate = datetime.datetime.strptime("%s 05:00:00" % (startDateStr), ChConfig.TYPE_Time_Format)
                endDayDate = datetime.datetime.strptime("%s 05:00:00" % (endDateStr), ChConfig.TYPE_Time_Format) # ½áÊøÈÕÆÚ5µã
            elif resetType == 2:
                startDayDate = datetime.datetime.strptime("%s 05:00:00" % (startDateStr), ChConfig.TYPE_Time_Format)       
                endDayDate = datetime.datetime.strptime("%s 00:00:00" % (endDateStr), ChConfig.TYPE_Time_Format) + datetime.timedelta(days=1) # ½áÊøÈÕÆÚ¸ôÌì0µã
            else:
                startDayDate = datetime.datetime.strptime("%s 00:00:00" % (startDateStr), ChConfig.TYPE_Time_Format)
                endDayDate = datetime.datetime.strptime("%s 00:00:00" % (endDateStr), ChConfig.TYPE_Time_Format) + datetime.timedelta(days=1) # ½áÊøÈÕÆÚ¸ôÌì0µã
                
            advanceMinutes = 0 if not hasattr(ipyData, "GetAdvanceMinutes") else ipyData.GetAdvanceMinutes() # Ìáǰ֪ͨʱ¼ä£¬·ÖÖÓ£¬ÔÝÖ»Ö§³Ö°´ÌìµÄ
            GameWorld.Log("        resetType=%s,startDayDate=%s,endDayDate=%s,startHMStrList=%s,endHMStrList=%s,advanceMinutes=%s" 
                          % (resetType, startDayDate, endDayDate, startHMStrList, endHMStrList, advanceMinutes))
            
            startList = [] # [startDateTime, ...]
            endList = [] # [endDateTime, ...]
            startNotifyDict = {} # {notifyDateTime:notifyInfo, ...}
            endNotifyDict = {} # {notifyDateTime:notifyInfo, ...}
            loopNotifyDict = {} # {notifyDateTime:notifyInfo, ...}
            isActivity = False # ÓÐÐèÒª´¦Àí¿ª¹ØÊ±¼äµÄ£¨¿ªÊ¼¡¢½áÊø£©
            isNotify = False
            isAdvanceNotice = False
            isEnd = False
            # Ã»ÅäÖÃʱ·ÖµÄ´ú±íÈ«Ìì, Ö»Òª¿ªÊ¼»ò½áÊøÊ±·ÖûÅä¶¼Ëã
            if not startHMStrList or not endHMStrList:
                startDateTime = startDayDate
                endDateTime = endDayDate
                startList.append(startDateTime)
                endList.append(endDateTime)
                # Í¬Ò»¸ö»î¶¯ÀàÐÍÊDz»ÔÊÐíʱ¼äÉÏÅäÖÃÓÐÖØµþµÄ£¬ËùÒÔÒ»¸ö»î¶¯ÀàÐÍÂú×ã»î¶¯ÖеÄʱ¼äµÄÓÐÇÒ½öÓÐÒ»ÌõÅäÖÃ
                # ²ß»®¿ÉÄÜͬʱÅäÖöà¸öʱ¼ä£¬µ«ÊǻÖеÄÓÐÇÒ½öÓÐÒ»ÌõÅäÖÃ
                if startDayDate <= curDateTime <= endDayDate:
                    needStartList.append(startDateTime)
                    needEndList.append(endDateTime)
                    isActivity = True
                    isEnd = (curDateTime == endDayDate)
                    
            # Ã¿Ì찴ʱ¶Î¿ªÆôµÄ£¬Ö§³Ö¶àʱ¶Î
            else:
                if startDayDate <= curDateTime <= endDayDate:
                    isEnd = (curDateTime == endDayDate)
                    for hmIndex, startHMStr in enumerate(startHMStrList):
                        endHMStr = endHMStrList[hmIndex]
                        # Ã¿Ì쿪µÄ, Êµ¼Ê¿ª¹ØÊ±¼äֻȡ½ñÌìµÄÈÕÆÚ£» ÕâÀïÓиöÎÊÌ⣬ȫ·þ¹ã²¥µÄʱ¼ä²»ÊǽñÌìµÄ, Ôݲ»×öÖ§³Ö£¬Ö®ºóÕæÓÐÕâÖÖÐèÇóÔÙ˵
                        startTimeStr = "%d-%d-%d %s:00" % (curDateTime.year, curDateTime.month, curDateTime.day, startHMStr)
                        endTimeStr = "%d-%d-%d %s:00" % (curDateTime.year, curDateTime.month, curDateTime.day, endHMStr)
                        startDateTime = datetime.datetime.strptime(startTimeStr, ChConfig.TYPE_Time_Format)
                        endDateTime = datetime.datetime.strptime(endTimeStr, ChConfig.TYPE_Time_Format)
                        
                        startList.append(startDateTime)
                        endList.append(endDateTime)
                        
                        needStartList.append(startDateTime)
                        needEndList.append(endDateTime)
                        isActivity = True
                        
            if advanceMinutes and startDayDate:
                advanceNoticeDateTime = startDayDate + datetime.timedelta(minutes=-advanceMinutes)
                if advanceNoticeDateTime.year == curDateTime.year and advanceNoticeDateTime.month == curDateTime.month and advanceNoticeDateTime.day == curDateTime.day:
                    isAdvanceNotice = True
                GameWorld.Log("        advanceNoticeDateTime=%s,isAdvanceNotice=%s" % (advanceNoticeDateTime, isAdvanceNotice))
            GameWorld.Log("        startList=%s" % (startList))
            GameWorld.Log("        end  List=%s" % (endList))
            GameWorld.Log("        needStartList=%s" % (needStartList))
            GameWorld.Log("        need  EndList=%s" % (needEndList))
            
            for dtIndex, startDateTime in enumerate(startList):
                endDateTime = endList[dtIndex]
                # ¹ã²¥ - Ïà¶Ôʵ¼Ê¿ªÊ¼Ê±¼ä
                for notifyMinute, notifyInfo in notifyInfoDictStart.items():
                    notifyDateTime = startDateTime + datetime.timedelta(minutes=notifyMinute)
                    if notifyDateTime.year == curDateTime.year and notifyDateTime.month == curDateTime.month and notifyDateTime.day == curDateTime.day:
                        startNotifyDict[notifyDateTime] = notifyInfo
                        isNotify = True
                    
                # ¹ã²¥ - Ïà¶Ôʵ¼Ê½áÊøÊ±¼ä
                for notifyMinute, notifyInfo in notifyInfoDictEnd.items():
                    notifyDateTime = endDateTime + datetime.timedelta(minutes=notifyMinute)
                    if notifyDateTime.year == curDateTime.year and notifyDateTime.month == curDateTime.month and notifyDateTime.day == curDateTime.day:
                        endNotifyDict[notifyDateTime] = notifyInfo
                        isNotify = True
                        
                # ¹ã²¥ - Ñ­»·¹ã²¥
                if notifyInfoLoopInfo and len(notifyInfoLoopInfo) >= 2:
                    loopMinutes, loopNotifyKey = notifyInfoLoopInfo[:2]
                    loopNotifyParamList = notifyInfoLoopInfo[2] if len(notifyInfoLoopInfo) > 2 else []
                    notifyInfo = [loopNotifyKey, loopNotifyParamList] # Ñ­»·¹ã²¥µÄĬÈÏÎÞ²ÎÊý
                    loopCount, loopMaxCount = 0, 100
                    while loopMinutes and loopNotifyKey and loopCount < loopMaxCount:
                        loopCount += 1
                        notifyDateTime = startDateTime + datetime.timedelta(minutes=loopMinutes*loopCount)
                        if notifyDateTime >= endDateTime:
                            break
                        if notifyDateTime.year == curDateTime.year and notifyDateTime.month == curDateTime.month and notifyDateTime.day == curDateTime.day:
                            loopNotifyDict[notifyDateTime] = notifyInfo
                            isNotify = True
                            
            if startNotifyDict or endNotifyDict or loopNotifyDict:
                GameWorld.Log("        startNotifyDict: minutes=%s, %s" % (notifyInfoDictStart.keys(), startNotifyDict))
                GameWorld.Log("        end  NotifyDict: minutes=%s, %s" % (notifyInfoDictEnd.keys(), endNotifyDict))
                GameWorld.Log("        loop NotifyDict: lopInfo=%s, %s" % (notifyInfoLoopInfo, loopNotifyDict.keys()))
                needNotifyDict.update(startNotifyDict)
                needNotifyDict.update(endNotifyDict)
                needNotifyDict.update(loopNotifyDict)
                
            if not isActivity and not isNotify and not isAdvanceNotice:
                continue
            
            GameWorld.Log("        ÐèÒª´¦ÀíµÄÔËÓª»î¶¯ÐÅÏ¢: cfgID=%s,isAdvanceNotice=%s,isActivity=%s,isEnd=%s,isNotify=%s" % (cfgID, isAdvanceNotice, isActivity, isEnd, isNotify))
            # µ±ÌìÓÐÐèÒª¼¤»î»î¶¯»òÕßÌáǰԤ¸æ»î¶¯µÄÈ¡·Ç½áÊøµÄΪ׼£¬Èç¹ûÓжà¸ö·Ç½áÊøµÄÒ»°ã¾ÍÊDz߻®Ôڻʱ¼äÉÏÅäÖý»²æ£¬ÕâÖÖÊDz»ÔÊÐíµÄ
            if isActivity or isAdvanceNotice:
                if not activityIpyData or (isActivity and not isEnd):
                    activityIpyData = ipyData
                    activityInfoDict = {ShareDefine.ActKey_CfgID:cfgID}
                    
                    if startDayDate <= curDateTime < endDayDate:
                        dayIndex = 0
                        actIDDateTime = startDayDate
                        isDayRest = 0 if not hasattr(ipyData, "GetIsDayReset") else ipyData.GetIsDayReset()
                        # °´Ê±¶Î¿ªµÄĬÈÏÿÌìÖØÖÃ
                        if isDayRest or (startHMStrList and endHMStrList):
                            dayIndex = (curDateTime - startDayDate).days
                            actIDDateTime += datetime.timedelta(days=dayIndex)
                        actID = int(time.mktime(actIDDateTime.timetuple())) # Ä¬ÈÏÈ¡¿ªÊ¼Ê±¼äµãµÄtimeÖµ×÷Ϊ»î¶¯ID
                        activityInfoDict[ShareDefine.ActKey_DayIndex] = dayIndex
                        activityInfoDict[ShareDefine.ActKey_ID] = actID
                        GameWorld.Log("        isDayRest=%s,actIDDateTime=%s,actID=%s" % (isDayRest, actIDDateTime, actID))
                        
                    needStartList.sort()
                    needEndList.sort()
                    
                    mapServerOperationActionDict[actName] = activityInfoDict
                    GameWorld.Log("        activityInfoDict=%s" % (activityInfoDict))
                    
        if activityIpyData or needStartList or needEndList or needNotifyDict:
            # activityIpyData ¿ÉÄÜΪNone
            operationActionDict[actName] = [activityIpyData, needStartList, needEndList, needNotifyDict]
            
    OperationActionInfo = IpyGameDataPY.SetConfigEx(key, [reloadSign, operationActionDict, mapServerOperationActionDict])
    
    GameWorld.Log("±¾ÈÕÔËÓª»î¶¯ÐÅÏ¢¼ÓÔØÍê±Ï!reloadSign=%s,isRefreshState=%s" % (reloadSign, isRefreshState))
    GameWorld.Log("    operationActionDict=%s" % operationActionDict)
    GameWorld.Log("    mapServerOperationActionDict=%s" % mapServerOperationActionDict)
    GameWorld.Log("=============================================================")
    if isRefreshState:
        Dispose_OperationActionState(True)
        
    return True, OperationActionInfo
 
def __GetOperationActionServerIpyDataList(ipyDataMgr, serverID, actName):
    ## »ñÈ¡ÔËÓª»î¶¯±¾·þÎñÆ÷¶ÔÓ¦µÄÅäÖÃÊý¾ÝÁбí
    
    # ËùÓÐÅäÖÃÏȰ´»î¶¯±êʶ¹é×é
    platform = GameWorld.GetPlatform()
    actGroupDict = {} # {ActMark:{ServerIDTuple:[ipyData, ...], ...}, ...}
    actCfgCount = getattr(ipyDataMgr, "Get%sCount" % actName)()
    for cfgIndex in xrange(actCfgCount):
        ipyData = getattr(ipyDataMgr, "Get%sByIndex" % actName)(cfgIndex)
        actMark = ipyData.GetActMark()
        platformList = [] if not hasattr(ipyData, "GetPlatformList") else ipyData.GetPlatformList()
        if platformList and platform not in platformList:
            GameWorld.Log("·Ç±¾Æ½Ì¨»î¶¯£¬²»È¡£¡platform=%s,platformList=%s,actName=%s,cfgID=%s" % (platform, platformList, actName, ipyData.GetCfgID()))
            continue
        serverIDTuple = tuple(ipyData.GetServerIDList())
        
        serverIpyDataDict = actGroupDict.get(actMark, {})
        ipyDataList = serverIpyDataDict.get(serverIDTuple, [])
        ipyDataList.append(ipyData)
        serverIpyDataDict[serverIDTuple] = ipyDataList
        actGroupDict[actMark] = serverIpyDataDict
        
    # È¡³öËùÊô±¾·þIDµÄËùÓÐÅäÖÃ
    curServerActIpyDataList = []
    for actMark, serverIpyDataDict in actGroupDict.items():
        generalIpyDataList = []
        isGeneral = True
        for serverIDTuple, ipyDataList in serverIpyDataDict.items():
            if not serverIDTuple:
                generalIpyDataList = ipyDataList
                continue
            for serverIDInfo in serverIDTuple:
                if (isinstance(serverIDInfo, int) and serverIDInfo == serverID) \
                    or ((isinstance(serverIDInfo, list) or isinstance(serverIDInfo, tuple)) \
                        and len(serverIDInfo) == 2 and serverIDInfo[0] <= serverID <= serverIDInfo[1]):
                    curServerActIpyDataList += ipyDataList
                    isGeneral = False
                    break
        if isGeneral:
            curServerActIpyDataList += generalIpyDataList
    return curServerActIpyDataList
 
def Dispose_OperationActionState(reloadRefresh=False):
    # ÔËÓª»î¶¯×´Ì¬´¦Àí, Ã¿Ìì0µã»áÇ¿ÖÆÍ¬²½µ±ÌìµÄÔËÓª»î¶¯ÏêÇéµ½µØÍ¼·þÎñÆ÷
    
    isReload, OperationActionInfo = __GetOperationActionInfo(False) # ÕâÀï±ØÐë´«False
    isReload = isReload or reloadRefresh
    operationActionDict = OperationActionInfo[OperationAction_TodayInfo]
    mapServerInfoDict = OperationActionInfo[OperationAction_MapServerInfo]
    
    gameWorld = GameWorld.GetGameWorld()
    
    # ÕâÀïʱ¼äÐ辫ȷµ½·ÖÖÓ£¬²»È»ºóÃæµÄ±È½Ï»áÆ¥Åä²»µ½
    curDateTime = GameWorld.GetServerTime()
    curDateTime = datetime.datetime.strptime("%d-%d-%d %d:%d:00" % (curDateTime.year, curDateTime.month, curDateTime.day,
                                                                    curDateTime.hour, curDateTime.minute), ChConfig.TYPE_Time_Format)
    
    for actName in ShareDefine.OperationActionNameList:
        
        state = 0 # Ä¬ÈϹرÕ
        ipyData = None
        
        if actName in operationActionDict:
            
            #startList = [] # [startDateTime, ...]
            #endList = [] # [endDateTime, ...]
            #notifyDict = {} # {notifyDateTime:[notifyKey, [²ÎÊý]], ...}
            #ipyData ¿ÉÄÜΪ None
            ipyData, startList, endList, notifyDict = operationActionDict[actName]
            # ¾«È·Æ¥Å俪Æô
            if curDateTime in startList:
                state = startList.index(curDateTime) + 1 # Ò²ÊÇ´ú±íµÚ¼¸¸öʱ¼ä¶Î
            # ¾«È·Æ¥Å乨±Õ
            elif curDateTime in endList:
                state = 0
            # goon ×´Ì¬
            else:
                for dIndex, startDateTime in enumerate(startList):
                    endDateTime = endList[dIndex]
                    if startDateTime < curDateTime < endDateTime:
                        state = dIndex + 1
                        break
                    
            # È«·þ¹ã²¥ÌáʾÐÅÏ¢
            if curDateTime in notifyDict:
                notifyKey, paramList = notifyDict[curDateTime]
                PlayerControl.WorldNotify(0, notifyKey, paramList)
                
        dictName = ChConfig.Def_WorldKey_OperationActionState % actName
        preState = gameWorld.GetDictByKey(dictName)
        if not isReload and preState == state:
            #ÒѾ­ÊÇÕâ¸ö״̬ÁË
            continue
        #¸üÐÂ×ÖµäÖµ
        gameWorld.SetDict(dictName, state)
        sendMapServerMsgDict = mapServerInfoDict.get(actName, {})
        
        dbOperationActIDKey = PlayerDBGSEvent.Def_OperationActID % actName
        curActID = sendMapServerMsgDict.get(ShareDefine.ActKey_ID)
        if state >= 1 and curActID and PlayerDBGSEvent.GetDBGSTrig_ByKey(dbOperationActIDKey) != curActID:
            PlayerDBGSEvent.SetDBGSTrig_ByKey(dbOperationActIDKey, curActID)
            if actName in ShareDefine.NeedWorldLVOperationActNameList:
                #¼Ç¼¿ªÆôʱÊÀ½çµÈ¼¶
                worldLV = PlayerDBGSEvent.GetDBGSTrig_ByKey(ShareDefine.Def_Notify_WorldKey_WorldAverageLv)
                PlayerDBGSEvent.SetDBGSTrig_ByKey(PlayerDBGSEvent.Def_OActWorldLV % actName, worldLV)
                
            #´Ë´¦Îª»î¶¯¿ªÆôʱ
            if actName == ShareDefine.OperationActionName_BossReborn:
                #ÖØÖÃBOSS¸´»îµã
                GameWorldBoss.ResetBossRebornPoint()
            elif actName == ShareDefine.OperationActionName_FairyCeremony:
                #ÖØÖÃÏɽçÊ¢µä
                PlayerFairyCeremony.ResetFairyCeremony()
            
            
                
        if state >= 1 and actName in ShareDefine.NeedWorldLVOperationActNameList:
            actWorldLV = PlayerDBGSEvent.GetDBGSTrig_ByKey(PlayerDBGSEvent.Def_OActWorldLV % actName)
            sendMapServerMsgDict[ShareDefine.ActKey_WorldLV] = actWorldLV
        
        if actName == ShareDefine.OperationActionName_ExpRate:
            if isReload and ipyData:
                Sync_OperationAction_ExpRate(ipyData)
                
        elif actName == ShareDefine.OperationActionName_CostRebate:
            if isReload and ipyData:
                pass
        elif actName == ShareDefine.OperationActionName_BossReborn:
            if isReload and ipyData:
                GameWorldBoss.SetBossRebornNeedPoint(True)
 
        elif actName == ShareDefine.OperationActionName_FairyCeremony:
            if isReload and ipyData:
                PlayerFairyCeremony.Sync_OperationAction_FairyCeremony(ipyData)
            if preState != state and state == 0:
                PlayerFairyCeremony.OnFairyCeremonyEnd()
        elif actName == ShareDefine.OperationActionName_RealmPoint:
            if isReload and ipyData:
                Sync_OperationAction_RealmPoint(ipyData)
        elif actName == ShareDefine.OperationActionName_FlashSale:
            if ipyData and preState != state:
                dayIndex = sendMapServerMsgDict.get(ShareDefine.ActKey_DayIndex, 0)
                PlayerStore.ResetFlashSaleBuyCnt(ipyData, dayIndex, state)
                
        #֪ͨMapserver,ÉèÖÃ×Öµä
        #GameWorld.SendMapServerMsgEx(dictName, state) # ÔËÓª»î¶¯²»µ¥¶À֪ͨ»î¶¯×´Ì¬£¬ÐèÓë»î¶¯ÐÅÏ¢ÕûºÏºóÒ»Æð֪ͨ
        
        sendMapServerMsgDict[ShareDefine.ActKey_State] = state
        GameWorld.SendMapServerMsgEx(ShareDefine.Def_Notify_WorldKey_OperationActionInfo % actName, sendMapServerMsgDict)
        
        GameWorld.Log("ÔËÓª»î¶¯±ä¸ü: actName=%s,preState=%s,state=%s,dictName=%s, %s" % (actName, preState, state, dictName, sendMapServerMsgDict))
    return
 
def Sync_OperationAction_ExpRate(ipyData, curPlayer=None):
    if not ipyData:
        return
    if len(ipyData.GetStartTimeList()) != len(ipyData.GetEndTimeList()):
        return
    openServerDay = PlayerDBGSEvent.GetDBGSTrig_ByKey(PlayerDBGSEvent.Def_ServerDay) + 1
    multiExpRateInfo = ChPyNetSendPack.tagGCMultiExpRateInfo()
    multiExpRateInfo.Clear()
    multiExpRateInfo.StartDate = GameWorld.GetOperationActionDateStr(ipyData.GetStartDate(), openServerDay)
    multiExpRateInfo.EndtDate = GameWorld.GetOperationActionDateStr(ipyData.GetEndDate(), openServerDay)
    multiExpRateInfo.ActivityTime = []
    for i, startTime in enumerate(ipyData.GetStartTimeList()):
        endTime = ipyData.GetEndTimeList()[i]
        timeInfo = ChPyNetSendPack.tagGCMultiExpRateTime()
        timeInfo.StartTime = startTime
        timeInfo.EndtTime = endTime
        multiExpRateInfo.ActivityTime.append(timeInfo)
    multiExpRateInfo.ActivityTimeCount = len(multiExpRateInfo.ActivityTime)
    multiExpRateInfo.LimitLV = ipyData.GetLVLimit()
    multiExpRateInfo.AddExpRate = ipyData.GetAddExpRate()
    
    if not curPlayer:
        # È«·þ¹ã²¥ÔÚÏßÍæ¼Ò
        playerManager = GameWorld.GetPlayerManager()
        for i in xrange(playerManager.GetPlayerCount()):
            curPlayer = playerManager.GetPlayerByIndex(i)
            if curPlayer == None or not curPlayer.GetInitOK():
                continue
            NetPackCommon.SendFakePack(curPlayer, multiExpRateInfo)
    else:
        NetPackCommon.SendFakePack(curPlayer, multiExpRateInfo)
    return
 
 
def Sync_OperationAction_RealmPoint(ipyData, curPlayer=None):
    ##¶à±¶ÐÞÐеã»î¶¯ÐÅϢ֪ͨ
    if not ipyData:
        return
    openServerDay = PlayerDBGSEvent.GetDBGSTrig_ByKey(PlayerDBGSEvent.Def_ServerDay) + 1
    multiRealmPointInfo = ChPyNetSendPack.tagGCMultiRealmPointInfo()
    multiRealmPointInfo.Clear()
    multiRealmPointInfo.StartDate = GameWorld.GetOperationActionDateStr(ipyData.GetStartDate(), openServerDay)
    multiRealmPointInfo.EndtDate = GameWorld.GetOperationActionDateStr(ipyData.GetEndDate(), openServerDay)
    multiRealmPointInfo.Multiple = ipyData.GetMultiple()
    multiRealmPointInfo.LimitLV = ipyData.GetLVLimit()
    multiRealmPointInfo.LimitPoint = ipyData.GetPointLimit()
    if not curPlayer:
        # È«·þ¹ã²¥ÔÚÏßÍæ¼Ò
        playerManager = GameWorld.GetPlayerManager()
        for i in xrange(playerManager.GetPlayerCount()):
            curPlayer = playerManager.GetPlayerByIndex(i)
            if curPlayer == None or not curPlayer.GetInitOK():
                continue
            NetPackCommon.SendFakePack(curPlayer, multiRealmPointInfo)
    else:
        NetPackCommon.SendFakePack(curPlayer, multiRealmPointInfo)
    return
 
 
##--------------------------------------------------------------------------------------------------
 
def __GetTodayDailyActionInfo():
    # »ñÈ¡±¾ÈÕ´ý´¦ÀíµÄÈÕ³£»î¶¯ÐÅÏ¢
    key = "TodayDailyActionInfo"
    openServerDay = PlayerDBGSEvent.GetDBGSTrig_ByKey(PlayerDBGSEvent.Def_ServerDay) + 1
    TodayDailyActionInfo = IpyGameDataPY.GetConfigEx(key)
    if TodayDailyActionInfo and TodayDailyActionInfo[0] == openServerDay:
        #GameWorld.DebugLog("ÒѾ­¼ÓÔØ¹ý±¾ÈÕÈÕ³£»î¶¯´¦ÀíÐÅÏ¢£¡openServerDay=%s" % openServerDay)
        return TodayDailyActionInfo[1]
    
    todayActionInfo = []
    
    dayTime = GameWorld.GetServerTime()
    weekDay = str(dayTime.weekday() + 1) # ¸ñʽΪjson, µ±Ç°ÐÇÆÚ¼¸, 1´ú±íÐÇÆÚ1
    curTime = int(time.time())
    curDateStr = GameWorld.ChangeTimeNumToStr(curTime, ChConfig.TYPE_Time_YmdFormat) # µ±ÌìÈÕÆÚ
    
    openServerWeekday = GameWorldProcess.GetOpenServerWeekday() # ·þÎñÆ÷¿ª·þʱÊÇÐÇÆÚ¼¸
    curMaxCustomServerDay = IpyGameDataPY.GetFuncCfg("OperationAction", 1) - openServerWeekday + 1 # ×î´óÓÐЧ¶¨ÖÆ¿ª·þÌì
    GameWorld.Log("===== ¼ÓÔØ½ñÌìÈÕ³£»î¶¯ÐÅÏ¢ =====")
    GameWorld.Log("    ¿ª·þÊÇÐÇÆÚ%s, ¿ª·þµÚ%sÌì, µ±Ç°ÐÇÆÚ%s" % (openServerWeekday, openServerDay, weekDay))
    GameWorld.Log("    ×î´óÓÐЧ¶¨ÖÆ¿ª·þÌì: %s" % (curMaxCustomServerDay))
    
    customDailyIDList = []
    dailyTimeInfoList = []
    # Ôݹ̶¨Ç°2Öܶ¨ÖÆÓÐЧ, Îª·½±ãGMÃüÁî²âÊÔ£¬ÕâÀïÓÿª·þÌì×öÅжϣ¬²»Óÿª·þÖÜ
    if openServerDay <= curMaxCustomServerDay:
        customIpyDataList = IpyGameDataPY.GetIpyGameDataListNotLog("DailyActionCustom", openServerWeekday)
        GameWorld.Log("    ±¾Öܶ¨ÖƵÄÈÕ³£»î¶¯ÌõÊý: %s" % len(customIpyDataList))
        customIDList = []
        todayCustomIDList = []
        for customIpyData in customIpyDataList:
            dataID = customIpyData.GetID()
            dailyID = customIpyData.GetDailyID()
            if dailyID not in customDailyIDList:
                customDailyIDList.append(dailyID)
            customIDList.append(dataID)
            if customIpyData.GetOpenServerDay() == openServerDay:
                todayCustomIDList.append(dataID)
                isCustom = True
                dailyTimeInfoList.append([isCustom, customIpyData.GetOpenTimeList(), customIpyData])
                GameWorld.Log("    Ôö¼Ó±¾ÈÕÈÕ³£»î¶¯ÐÅÏ¢: isCustom=%s,dailyID=%s,dataID=%s" % (isCustom, dailyID, dataID))
        GameWorld.Log("    ±¾Öܶ¨ÖƵÄÈÕ³£ÅäÖñíIDÁбí: %s" % (customIDList))
        GameWorld.Log("    ±¾Öܶ¨ÖƵÄÈÕ³£»î¶¯IDÁбí: %s" % (customDailyIDList))
        GameWorld.Log("    ½ñÌì¶¨ÖÆµÄÈÕ³£±íIDÁбí=%s" % (todayCustomIDList))
    else:
        GameWorld.Log("    ³¬¹ý×î´ó¶¨ÖÆ¿ª·þÌ죬²»¶¨ÖÆ£¬×ß³£¹æÈÕ³£ÅäÖã¡")
    
    GameWorld.Log("    ´¦Àí³£¹æÈÕ³£»î¶¯ÅäÖÃ")
    ipyDataMgr = IpyGameDataPY.IPY_Data()
    dailyActionCount = ipyDataMgr.GetDailyActionCount()
    for i in xrange(dailyActionCount):
        dailyIpyData = ipyDataMgr.GetDailyActionByIndex(i)
        dailyID = dailyIpyData.GetDailyID()
        
        # Êǵ±Ì쿪·þÌì¶¨ÖÆ»î¶¯µÄ²»´¦Àí³£¹æ»î¶¯
        if dailyID in customDailyIDList:
            GameWorld.Log("    ³£¹æ»î¶¯IDÅäÖÃÊǽñÌìµÄ¶¨ÖƻID£¬²»´¦Àí£¡: dailyID=%s" % dailyID)
            continue
        
        openTimeDict = dailyIpyData.GetOpenTimeDict()
        # Ã»ÓÐʱ¼ä¿ØÖƵ쬴ú±íÓÀ¾Ã¿ª·Å
        if not openTimeDict:
            todayActionInfo.append([dailyID])
            GameWorld.Log("    Ôö¼Ó±¾ÈÕ³£¿ªÈÕ³£»î¶¯ÐÅÏ¢: dailyID=%s" % dailyID)
            continue
        
        #Èç¹ûÐÇÆÚkeyÖдæÔÚ "0" ´ú±íÿÈÕ¶¼¿ªÆô
        if "0" not in openTimeDict and weekDay not in openTimeDict:
            GameWorld.Log("    ²»ÊÇÈÕ³£»î¶¯¿ªÆôÐÇÆÚ: dailyID=%s,openWeekLimit=%s" % (dailyID, openTimeDict.keys()))
            continue
        openTimeList = openTimeDict["0"] if "0" in openTimeDict else openTimeDict[weekDay]
        dailyTimeInfoList.append([False, openTimeList, dailyIpyData])
        
    GameWorld.Log("    -----------------------")
    for isCustom, openTimeList, ipyData in dailyTimeInfoList:
        dailyID = ipyData.GetDailyID()
        notifyInfoDict = ipyData.GetNotifyInfo()
        
        openList = [] # [(ʱ,·Ö), ...]
        overList = [] # [(ʱ,·Ö), ...]
        goonStateDict = {} # {״̬:[(aDateTime, bDateTime)], ...}
        notifyDict = {} # {(ʱ,·Ö):[notifyKey, [²ÎÊý]], ...}
        OpenState = 1 # ¶¨Ò忪Æô״̬Ϊ1
        
        for hour, minute in openTimeList:  
            openTimeStr = "%s %02d:%02d:%02d" % (curDateStr, hour, minute, 0)
            
            # ¾«È·¿ªÆôʱ¼ä
            openDateTime = datetime.datetime.strptime(openTimeStr, ChConfig.TYPE_Time_Format)
            openList.append((openDateTime.hour, openDateTime.minute))
            
            # ¾«È·¹Ø±Õʱ¼ä
            overDateTime = openDateTime + datetime.timedelta(minutes=ipyData.GetDuration())
            overList.append((overDateTime.hour, overDateTime.minute))
            
            # goon ¿ªÆô״̬
            openStateTimeList = goonStateDict.get(OpenState, [])
            openStateTimeList.append((openDateTime, overDateTime))
            goonStateDict[OpenState] = openStateTimeList
            
            # goon ÆäËû״̬£¬´ýÀ©Õ¹
            # ...
            
            # ¹ã²¥
            for notifyMinute, notifyInfo in notifyInfoDict.items():
                notifyDateTime = openDateTime + datetime.timedelta(minutes=notifyMinute)
                notifyDict[(notifyDateTime.hour, notifyDateTime.minute)] = notifyInfo
                
        todayActionInfo.append([dailyID, openList, overList, goonStateDict, notifyDict])
        GameWorld.Log("    Ôö¼Ó±¾ÈÕÈÕ³£»î¶¯ÐÅÏ¢: isCustom=%s,dailyID=%s,openList=%s,overList=%s,goonStateDict=%s,notifyDict=%s" 
                      % (int(isCustom), dailyID, openList, overList, goonStateDict, notifyDict))
        
    TodayDailyActionInfo = IpyGameDataPY.SetConfigEx(key, [openServerDay, todayActionInfo])
    GameWorld.Log("±¾ÈÕÈÕ³£»î¶¯ÐÅÏ¢¼ÓÔØÍê±Ï!")
    GameWorld.Log("=============================================================")
    return TodayDailyActionInfo[1]
 
def Dispose_DailyActionState():
    # ÈÕ³£»î¶¯×´Ì¬±ä¸ü¼ì²é´¦Àí
    
    todayDailyActionInfo = __GetTodayDailyActionInfo()
    if not todayDailyActionInfo:
        return
    
    gameWorld = GameWorld.GetGameWorld()
    dayTime = GameWorld.GetServerTime()
    curHourMinute = (dayTime.hour, dayTime.minute)
    
    for actionInfo in todayDailyActionInfo:
        dailyActionID = actionInfo[0]
        state = 0 # Ä¬ÈϹرÕ
        
        # ³¤¶ÈΪ1µÄ´ú±í³£¿ªµÄ»î¶¯
        if len(actionInfo) == 1:
            state = 1
        else:
            #openList = [] # [(ʱ,·Ö), ...]
            #overList = [] # [(ʱ,·Ö), ...]
            #goonStateDict = {} # {״̬:[(aDateTime, bDateTime)], ...}
            #notifyDict = {} # {(ʱ,·Ö):[notifyKey, [²ÎÊý]], ...}
            openList, overList, goonStateDict, notifyDict = actionInfo[1:]
            
            # ¾«È·Æ¥Å俪Æô
            if curHourMinute in openList:
                state = 1
            # ¾«È·Æ¥Å乨±Õ
            elif curHourMinute in overList:
                state = 0
            # goon ×´Ì¬
            else:
                for goonState, openStateTimeList in goonStateDict.items():
                    for dateTimeInfo in openStateTimeList:
                        if dateTimeInfo[0] < dayTime < dateTimeInfo[1]:
                            state = goonState
                            break
                        
            # È«·þ¹ã²¥ÌáʾÐÅÏ¢
            if curHourMinute in notifyDict:
                notifyKey, paramList = notifyDict[curHourMinute]
                PlayerControl.WorldNotify(0, notifyKey, paramList)
                
        dictName = ShareDefine.Def_Notify_WorldKey_DailyActionState % dailyActionID
        if gameWorld.GetDictByKey(dictName) == state:
            #ÒѾ­ÊÇÕâ¸ö״̬ÁË
            continue
        
        if state:
            # Æï³èÕù¶á»î¶¯¿ªÊ¼Ç°Í¬²½ÓÐЧÈËÊýµ½µØÍ¼
            if dailyActionID == ShareDefine.DailyActionID_FamilyRobBoss:
                GameWorldBoss.SyncMapServer_HorsePetRobBossPlayerCount()
                
        #֪ͨMapserver,ÉèÖÃ×Öµä
        GameWorld.SendMapServerMsgEx(dictName, state)
        #¸üÐÂ×ÖµäÖµ
        gameWorld.SetDict(dictName, state)
        GameWorld.Log("ÈÕ³£»î¶¯×´Ì¬±ä¸ü: dailyActionID=%s,state=%s,dictName=%s" % (dailyActionID, state, dictName))
        __DoLogic_GameServer_ActionState(dictName, state)
        
    return
 
def SendMapServerDailyActionState():
    # µØÍ¼Æô¶¯³É¹¦Ê±Í¨Öª±¾ÈÕ½øÐÐÖеÄÈÕ³£»î¶¯×´Ì¬
    
    todayDailyActionInfo = __GetTodayDailyActionInfo()
    if not todayDailyActionInfo:
        return
    
    gameWorld = GameWorld.GetGameWorld()
    for actionInfo in todayDailyActionInfo:
        dailyActionID = actionInfo[0]
        dictName = ShareDefine.Def_Notify_WorldKey_DailyActionState % dailyActionID 
        state = gameWorld.GetDictByKey(dictName)
        if state:
            GameWorld.SendMapServerMsgEx(dictName, state)
    return
 
## -------------------------------------------------------------------------------------------------
def __GetFBStateEndTimeNotResetIDList():
    key = "FBStateEndTimeNotReset" # ½áÊøÊ±¼ä״̬²»ÖØÖÃΪ0µÄÊý¾ÝID
    notResetIDList = IpyGameDataPY.GetConfigEx(key)
    if notResetIDList == None:
        mapStateTimeDict = {}
        ipyDataMgr = IpyGameDataPY.IPY_Data()
        for i in xrange(ipyDataMgr.GetFBStateTimeCount()):
            fbStateTimeIpyData = ipyDataMgr.GetFBStateTimeByIndex(i)
            dataID = fbStateTimeIpyData.GetID()
            dataMapID = fbStateTimeIpyData.GetDataMapID()
            startWeekDay, startHour, startMinute = fbStateTimeIpyData.GetStartWeekday(), fbStateTimeIpyData.GetStartHour(), fbStateTimeIpyData.GetStartMinute()
            endWeekDay, endHour, endMinute = startWeekDay, fbStateTimeIpyData.GetEndHour(), fbStateTimeIpyData.GetEndMinute()
            startTimeList, endTimeDict = mapStateTimeDict.get(dataMapID, [[], {}])
            startTimeList.append([startWeekDay, startHour, startMinute])
            endTimeDict[dataID] = [endWeekDay, endHour, endMinute]
            mapStateTimeDict[dataMapID] = [startTimeList, endTimeDict]
            
        FBStateEndTimeNotResetIDList = []
        for dataMapID, timeInfo in mapStateTimeDict.items():
            startTimeList, endTimeDict = timeInfo
            for dataID, endTime in endTimeDict.items():
                # ½áÊøÊ±¼äÊôÓÚijһÌõµÄ¿ªÆôʱ¼ä£¬Ôò²»ÖØÖ㬾ßÌå״̬ÓÉÁíÒ»Ìõ¾ö¶¨
                if endTime in startTimeList:
                    FBStateEndTimeNotResetIDList.append(dataID)
        FBStateEndTimeNotResetIDList.sort()
        
        # ¼ÓÔØ¶¨ÖƱí
        customStateTimeDict = {}
        for i in xrange(ipyDataMgr.GetFBStateTimeCustomCount()):
            customIpyData = ipyDataMgr.GetFBStateTimeCustomByIndex(i)
            dataID = customIpyData.GetID()
            dataMapID = customIpyData.GetDataMapID()
            openWeek, openDay = customIpyData.GetOpenServerWeek(), customIpyData.GetOpenServerDay()
            startHour, startMinute = customIpyData.GetStartHour(), customIpyData.GetStartMinute()
            endHour, endMinute = customIpyData.GetEndHour(), customIpyData.GetEndMinute()
            startTimeList, endTimeDict = customStateTimeDict.get(dataMapID, [[], {}])
            startTimeList.append([openWeek, openDay, startHour, startMinute])
            endTimeDict[dataID] = [openWeek, openDay, endHour, endMinute]
            customStateTimeDict[dataMapID] = [startTimeList, endTimeDict]
            
        FBStateEndTimeNotResetCustomIDList = []
        for dataMapID, timeInfo in customStateTimeDict.items():
            startTimeList, endTimeDict = timeInfo
            for dataID, endTime in endTimeDict.items():
                # ½áÊøÊ±¼äÊôÓÚijһÌõµÄ¿ªÆôʱ¼ä£¬Ôò²»ÖØÖ㬾ßÌå״̬ÓÉÁíÒ»Ìõ¾ö¶¨
                if endTime in startTimeList:
                    FBStateEndTimeNotResetCustomIDList.append(dataID)
        FBStateEndTimeNotResetCustomIDList.sort()
        
        notResetIDList = IpyGameDataPY.SetConfigEx(key, [FBStateEndTimeNotResetIDList, FBStateEndTimeNotResetCustomIDList])
        GameWorld.Log("¼ÓÔØ¸±±¾×´Ì¬½áÊøÊ±¼ä²»ÐèÒªÖØÖÃ״ֵ̬µÄÊý¾ÝIDÁбí:")
        GameWorld.Log("    ²»ÐèÒªÖØÖõij£¹æID: %s" % FBStateEndTimeNotResetIDList)
        GameWorld.Log("    ²»ÐèÒªÖØÖõ͍֯ID: %s" % FBStateEndTimeNotResetCustomIDList)
    return notResetIDList
 
def __GetTodayFBStateTimeInfo():
    key = "TodayFBStateTimeInfo"
    openServerDay = PlayerDBGSEvent.GetDBGSTrig_ByKey(PlayerDBGSEvent.Def_ServerDay) + 1
    TodayFBStateTimeInfo = IpyGameDataPY.GetConfigEx(key)
    if TodayFBStateTimeInfo and TodayFBStateTimeInfo[0] == openServerDay:
        #GameWorld.DebugLog("ÒѾ­¼ÓÔØ¹ý±¾ÈÕ¸±±¾×´Ì¬´¦ÀíÐÅÏ¢£¡openServerDay=%s" % openServerDay)
        return TodayFBStateTimeInfo[1]
    
    openServerDay = PlayerDBGSEvent.GetDBGSTrig_ByKey(PlayerDBGSEvent.Def_ServerDay) + 1
    curDateTime = GameWorld.GetServerTime()
    curWeekDay, curHour, curMinute = curDateTime.weekday() + 1, curDateTime.hour, curDateTime.minute
    
    openServerWeekday = GameWorldProcess.GetOpenServerWeekday() # ·þÎñÆ÷¿ª·þʱÊÇÐÇÆÚ¼¸
    if openServerWeekday <= 0:
        GameWorld.ErrLog("»ñÈ¡¿ª·þÊÇÐÇÆÚ¼¸Êý¾Ý´íÎó£¡openServerWeekday=%s" % openServerWeekday)
        return []
    
    curMaxCustomServerDay = IpyGameDataPY.GetFuncCfg("OperationAction", 1) - openServerWeekday + 1 # ×î´óÓÐЧ¶¨ÖÆ¿ª·þÌì
    GameWorld.Log("===== ¼ÓÔØ½ñÌ츱±¾×´Ì¬Ê±¼ä±í =====")
    GameWorld.Log("    ¿ª·þÊÇÐÇÆÚ%s, ¿ª·þµÚ%sÌì, µ±Ç°ÐÇÆÚ%s,%sµã%s·Ö £¡" % (openServerWeekday, openServerDay, curWeekDay, curHour, curMinute))
    GameWorld.Log("    ×î´óÓÐЧ¶¨ÖÆ¿ª·þÌì: %s" % (curMaxCustomServerDay))
    
    ipyDataMgr = IpyGameDataPY.IPY_Data()
    
    customMapIDList = [] # ±¾ÖÜÓж¨ÖƵĸ±±¾Êý¾ÝµØÍ¼IDÁбí
    fbStateTimeInfoList = []
    # Ôݹ̶¨Ç°2Öܶ¨ÖÆÓÐЧ, Îª·½±ãGMÃüÁî²âÊÔ£¬ÕâÀïÓÿª·þÌì×öÅжϣ¬²»Óÿª·þÖÜ
    if openServerDay <= curMaxCustomServerDay:
        customIpyDataList = IpyGameDataPY.GetIpyGameDataListNotLog("FBStateTimeCustom", openServerWeekday)
        GameWorld.Log("    ±¾Öܶ¨ÖƵĸ±±¾»î¶¯ÌõÊý: %s" % len(customIpyDataList))
        customIDList = [] # ±¾Öܶ¨ÖƵÄÊý¾Ý±íID
        todayCustomIDList = [] # ½ñÌì¶¨ÖÆµÄÊý¾Ý±íID
        for customIpyData in customIpyDataList:
            dataID = customIpyData.GetID()
            dataMapID = customIpyData.GetDataMapID()
            if dataMapID not in customMapIDList:
                customMapIDList.append(dataMapID)
            customIDList.append(dataID)
            if customIpyData.GetOpenServerDay() == openServerDay:
                todayCustomIDList.append(dataID)
                isCustom, startWeekDay, endWeekDay = True, curWeekDay, curWeekDay
                fbStateTimeInfoList.append([isCustom, startWeekDay, endWeekDay, customIpyData])
                GameWorld.Log("    ½ñÌìÒª´¦ÀíµÄ¸±±¾×´Ì¬ÅäÖÃ: ÊÇ·ñ¶¨ÖÆ=%s,dataID=%s" % (isCustom, dataID))
        GameWorld.Log("    ±¾Öܶ¨ÖƵÄÅäÖñíIDÁбí: %s" % (customIDList))
        GameWorld.Log("    ±¾Öܶ¨ÖƵĸ±±¾µØÍ¼Áбí: %s" % (customMapIDList))
        GameWorld.Log("    ½ñÌì¶¨ÖÆµÄ±íIDÁбí=%s" % (todayCustomIDList))
    else:
        GameWorld.Log("    ³¬¹ý×î´ó¶¨ÖÆ¿ª·þÌ죬²»¶¨ÖÆ£¬×ß³£¹æ¸±±¾×´Ì¬Ê±¼ä£¡")
        
    GameWorld.Log("    ´¦Àí³£¹æ¸±±¾×´Ì¬Ê±¼äÅäÖÃ")
    for i in xrange(ipyDataMgr.GetFBStateTimeCount()):
        fbStateTimeIpyData = ipyDataMgr.GetFBStateTimeByIndex(i)
        dataID = fbStateTimeIpyData.GetID()
        dataMapID = fbStateTimeIpyData.GetDataMapID()
        # Êǵ±Ì쿪·þÌì¶¨ÖÆ»î¶¯µÄ²»´¦Àí³£¹æ»î¶¯
        if dataMapID in customMapIDList:
            GameWorld.Log("    dataID=%s,dataMapID=%s, ÔÚ±¾Öܶ¨ÖƵĸ±±¾µØÍ¼ÁбíÀï,²»´¦Àí£¡" % (dataID, dataMapID))
            continue
        # Ôݲ»Ö§³Ö¿çÌìµÄ»î¶¯
        isCustom, startWeekDay, endWeekDay = False, fbStateTimeIpyData.GetStartWeekday(), fbStateTimeIpyData.GetStartWeekday()
        if curWeekDay != startWeekDay:
            GameWorld.Log("    dataID=%s,dataMapID=%s, ²»ÊDZ¾ÌìµÄ¸±±¾»î¶¯,²»´¦Àí£¡curWeekDay=%s,startWeekDay=%s" 
                          % (dataID, dataMapID, curWeekDay, startWeekDay))
            continue 
        fbStateTimeInfoList.append([isCustom, startWeekDay, endWeekDay, fbStateTimeIpyData])
        GameWorld.Log("    ½ñÌìÒª´¦ÀíµÄ¸±±¾×´Ì¬ÅäÖÃ: ÊÇ·ñ¶¨ÖÆ=%s,dataID=%s" % (isCustom, dataID))
        
    TodayFBStateTimeInfo = IpyGameDataPY.SetConfigEx(key, [openServerDay, fbStateTimeInfoList])
    GameWorld.Log("±¾ÈÕ¸±±¾»î¶¯×´Ì¬ÐÅÏ¢¼ÓÔØÍê±Ï!")
    GameWorld.Log("=============================================================")
    return TodayFBStateTimeInfo[1]
 
def Dispose_FBStateTime():
    ## ¸±±¾×´Ì¬Ê±¼ä±í״̬´¦Àí, Ö§³Ö goon×÷Ó㬿ª¹Ø·þ״̬²»ÊÜÓ°Ï죬·þÎñÆ÷ÖØÐÂÆô¶¯»á×Ô¶¯±ä¸üΪËùÓÐʱ¼ä¶ÎµÄ״ֵ̬
    
 
    FBStateEndTimeNotResetIDList, FBStateEndTimeNotResetCustomIDList = __GetFBStateEndTimeNotResetIDList()
    openServerDay = PlayerDBGSEvent.GetDBGSTrig_ByKey(PlayerDBGSEvent.Def_ServerDay) + 1
    curDateTime = GameWorld.GetServerTime()
    curWeekDay, curHour, curMinute = curDateTime.weekday() + 1, curDateTime.hour, curDateTime.minute
    
    curTimeWHM = curWeekDay * 10000 + curHour * 100 + curMinute
    
    openServerWeekday = GameWorldProcess.GetOpenServerWeekday() # ·þÎñÆ÷¿ª·þʱÊÇÐÇÆÚ¼¸
    GameWorld.DebugLog("¸±±¾×´Ì¬Ê±¼ä±í״̬´¦Àí...¿ª·þÊÇÐÇÆÚ%s, ¿ª·þµÚ%sÌì, µ±Ç°ÐÇÆÚ%s,%sµã%s·Ö" 
                       % (openServerWeekday, openServerDay, curWeekDay, curHour, curMinute))
    GameWorld.DebugLog("    FBStateEndTimeNotResetIDList=%s" % (FBStateEndTimeNotResetIDList))
    GameWorld.DebugLog("    FBStateEndTimeNotResetCustomIDList=%s" % (FBStateEndTimeNotResetCustomIDList))
    
    gameWorld = GameWorld.GetGameWorld()
    fbStateTimeInfoList = __GetTodayFBStateTimeInfo()
    
    for isCustom, startWeekDay, endWeekDay, ipyData in fbStateTimeInfoList:
        dataID = ipyData.GetID()
        dataMapID = ipyData.GetDataMapID()
        GameWorld.DebugLog("    isCustom=%s,dataID=%s,dataMapID=%s" % (isCustom, dataID, dataMapID))
        startHour, startMinute = ipyData.GetStartHour(), ipyData.GetStartMinute()
        endHour, endMinute = ipyData.GetEndHour(), ipyData.GetEndMinute()
        # ÐÇÆÚÅäÖÃ0´ú±íÿÌì
        if startWeekDay == 0:
            startWeekDay = curWeekDay
        if endWeekDay == 0:
            endWeekDay = curWeekDay
        startTimeWHM = startWeekDay * 10000 + startHour * 100 + startMinute # °üº¬¸ÃÖµ
        endTimeWHM = endWeekDay * 10000 + endHour * 100 + endMinute # ²»º¬¸ÃÖµ
        #GameWorld.DebugLog("    ID=%s,dataMapID=%s,curTimeWHM=%s,startTimeWHM=%s,endTimeWHM=%s" % (dataID, dataMapID, curTimeWHM, startTimeWHM, endTimeWHM))
        
        # È«·þ¹ã²¥key·ÖÖÓ²îÖµ¶Ô±Èʱ¼äΪ¿ªÊ¼Ê±¼ä, Ö§³ÖÕý¸ºÊ±¼ä²î
        notifyInfoDict = ipyData.GetNotifyInfoDict()
        if notifyInfoDict:
            startDateTime = curDateTime + datetime.timedelta(days=(startWeekDay - curWeekDay))
            startDateTime = datetime.datetime(startDateTime.year, startDateTime.month, startDateTime.day, startHour, startMinute, 0)
            diffDateTime = curDateTime - startDateTime
            diffMinute = (diffDateTime.days * 24 * 3600 + diffDateTime.seconds) / 60 # µ±Ç°Ê±¼äÓ뿪ʼʱ¼äÏà²î·ÖÖÓÊý
            #GameWorld.DebugLog("        ¹ã²¥ÅжÏ: curDateTime=%s,startDateTime=%s,diffDays=%s,diffSeconds=%s,diffMinute=%s" 
            #                   % (curDateTime, startDateTime, diffDateTime.days, diffDateTime.seconds, diffMinute))
            if diffMinute in notifyInfoDict:
                notifyKey, paramList = notifyInfoDict[diffMinute]
                PlayerControl.WorldNotify(0, notifyKey, paramList)
                #GameWorld.DebugLog("        Ö´Ðй㲥: notifyKey=%s, paramList=%s" % (notifyKey, paramList))
                
        isUpdate, isReset = False, False
        # Ö§³ÖÖ»ÅäÖÿªÆôʱ¼äʱ£¬×ö¾«È·Æ¥Åä
        if curTimeWHM == startTimeWHM:
            isUpdate = True
            #GameWorld.DebugLog("        µ±Ç°ÊÇ¿ªÊ¼Ê±¼ä!")
        # ÊǽáÊøÊ±¼ä
        elif curTimeWHM == endTimeWHM:
            if (isCustom and dataID not in FBStateEndTimeNotResetCustomIDList) or (not isCustom and dataID not in FBStateEndTimeNotResetIDList):
                isReset = True
            #GameWorld.DebugLog("        µ±Ç°ÊǽáÊøÊ±¼ä! isReset=%s,FBStateEndTimeNotResetIDList=%s" % (isReset, FBStateEndTimeNotResetIDList))
        # ½áÊøÊ±¼äÊÇÏÂÖÜ
        elif endTimeWHM and endTimeWHM <= startTimeWHM:
            isUpdate = (curTimeWHM > startTimeWHM or curTimeWHM < endTimeWHM)
            #GameWorld.DebugLog("        ½áÊøÊ±¼äÊÇÏÂÖÜ! isUpdate=%s" % isUpdate)
        else:
            isUpdate = (startTimeWHM < curTimeWHM < endTimeWHM)
            #GameWorld.DebugLog("        ³£¹æÅжÏ: isUpdate=%s" % isUpdate)
            
        if isReset:
            updCanEnter = 0
            updStateValue = 0
        elif isUpdate:
            updCanEnter = ipyData.GetCanEnter()
            updStateValue = ipyData.GetStateValue()
        else:
            #GameWorld.DebugLog("        µ±Ç°Ê±¼ä¸±±¾×´Ì¬²»±ä£¡")
            continue
        
        canEnterKey = ShareDefine.Def_Notify_WorldKey_FBCanEnter % dataMapID
        if gameWorld.GetDictByKey(canEnterKey) != updCanEnter:
            GameWorld.SendMapServerMsgEx(canEnterKey, updCanEnter) #֪ͨMapserver,ÉèÖÃ×Öµä
            gameWorld.SetDict(canEnterKey, updCanEnter) #¸üÐÂ×ÖµäÖµ
            if updCanEnter:
                SaveFBOpenRecord(dataMapID)
            GameWorld.Log("¸±±¾ÊÇ·ñ¿É½øÈë±ä¸ü: dataMapID=%s,updCanEnter=%s,canEnterKey=%s" % (dataMapID, updCanEnter, canEnterKey))
        #else:
        #    GameWorld.DebugLog("        ¸±±¾¿É·ñ½øÈëÒѾ­ÊǸÃÖµ: dataMapID=%s,updCanEnter=%s,canEnterKey=%s" % (dataMapID, updCanEnter, canEnterKey))            
            
        fbFuncStateKey = ShareDefine.Def_Notify_WorldKey_FBFuncState % dataMapID
        if gameWorld.GetDictByKey(fbFuncStateKey) != updStateValue:
            GameWorld.SendMapServerMsgEx(fbFuncStateKey, updStateValue) #֪ͨMapserver,ÉèÖÃ×Öµä
            gameWorld.SetDict(fbFuncStateKey, updStateValue) #¸üÐÂ×ÖµäÖµ
            GameWorld.Log("¸±±¾×´Ì¬±ä¸ü: dataMapID=%s,updStateValue=%s,fbFuncStateKey=%s" % (dataMapID, updStateValue, fbFuncStateKey))
            __DoLogic_GameServer_ActionState(fbFuncStateKey, updStateValue)
        #else:
        #    GameWorld.DebugLog("        ¸±±¾×´Ì¬ÒѾ­ÊǸÃÖµ: dataMapID=%s,updStateValue=%s,fbFuncStateKey=%s" % (dataMapID, updStateValue, fbFuncStateKey))
            
            
    return
 
def SaveFBOpenRecord(mapID):
    #¼Ç¼¸±±¾¿ªÆôʱ¼ä
    #{mapid:['0315','0316'],..}
    curTime = GameWorld.GetServerTime()
    curDayStr = '%02d%02d' % (curTime.month, curTime.day)
    
    fbOpenRecord = {}
    recType = ShareDefine.Def_UniversalGameRecType_LimitFBOpenRecord
    universalRecMgr = GameWorld.GetUniversalRecMgr()  
    recTypeListData = universalRecMgr.GetTypeList(recType)
    findRecData = None
    for index in range(recTypeListData.Count()):
        universalRecData = recTypeListData.At(index)
        recMapID = universalRecData.GetValue1()
        if recMapID == mapID:
            findRecData = universalRecData
        fbOpenRecord[recMapID] = eval(universalRecData.GetStrValue1())
        
    if not findRecData:
        findRecData = recTypeListData.AddRec()
        findRecData.SetValue1(mapID)
        findRecData.SetStrValue1(str([curDayStr]))
        fbOpenRecord[mapID] = [curDayStr]
    else:
        recordList = eval(findRecData.GetStrValue1())
        if curDayStr not in recordList:
            recordList.append(curDayStr)
            if len(recordList) > 3: #Ö»´æ×î½ü3´Î
                del recordList[0]
            findRecData.SetStrValue1(str(recordList))
            fbOpenRecord[mapID] = recordList
        else:
            return
    GameWorld.SendMapServerMsgEx(ShareDefine.Def_Notify_WorldKey_FBOpenRecord, fbOpenRecord)
    return
 
def GetFBOpenRecord():
    #»ñÈ¡¸±±¾¿ªÆôʱ¼ä¼Ç¼
    fbOpenRecord = {}
    recType = ShareDefine.Def_UniversalGameRecType_LimitFBOpenRecord
    universalRecMgr = GameWorld.GetUniversalRecMgr()  
    recTypeListData = universalRecMgr.GetTypeList(recType)
    for index in range(recTypeListData.Count()):
        universalRecData = recTypeListData.At(index)
        recMapID = universalRecData.GetValue1()
        recordList = eval(universalRecData.GetStrValue1())
        fbOpenRecord[recMapID] = recordList
    return fbOpenRecord
 
def SendMapServerFBFuncState():
    # µØÍ¼Æô¶¯³É¹¦Ê±Í¨Öª±¾ÈÕ½øÐÐÖеĸ±±¾×´Ì¬
    
    fbEnterTimeLimitMapIDList = []
    
    sendMapIDList = []
    gameWorld = GameWorld.GetGameWorld()
    ipyDataMgr = IpyGameDataPY.IPY_Data()
    for i in xrange(ipyDataMgr.GetFBStateTimeCount()):
        fbStateTimeIpyData = ipyDataMgr.GetFBStateTimeByIndex(i)
        dataMapID = fbStateTimeIpyData.GetDataMapID()
        
        if fbStateTimeIpyData.GetCanEnter() and dataMapID not in fbEnterTimeLimitMapIDList:
            fbEnterTimeLimitMapIDList.append(dataMapID)
            
        if dataMapID not in sendMapIDList:
            canEnterKey = ShareDefine.Def_Notify_WorldKey_FBCanEnter % dataMapID 
            canEnter = gameWorld.GetDictByKey(canEnterKey)
            if canEnter:
                GameWorld.SendMapServerMsgEx(canEnterKey, canEnter)
                
            fbFuncStateKey = ShareDefine.Def_Notify_WorldKey_FBFuncState % dataMapID 
            fbFuncState = gameWorld.GetDictByKey(fbFuncStateKey)
            if fbFuncState:
                GameWorld.SendMapServerMsgEx(fbFuncStateKey, fbFuncState)
                
            sendMapIDList.append(dataMapID)
        
    GameWorld.SendMapServerMsgEx(ShareDefine.Def_Notify_WorldKey_FBEnterTimeLimiitMapID, fbEnterTimeLimitMapIDList)
    fbOpenRecord = GetFBOpenRecord()
    GameWorld.SendMapServerMsgEx(ShareDefine.Def_Notify_WorldKey_FBOpenRecord, fbOpenRecord)
    return
 
## ´¦ÀíÖØ¿ª·þÎñÆ÷ºó, »î¶¯¼ÌÐø¿ªÆôÂß¼­¸ù¾ÝÌìÊý
#  @param tick µ±Ç°Ê±¼ä 
#  @return None
def Dispose_Action_GoOn_ByDay(tick):
    #Òѹ̶¨ÔÚÿÕû·ÖÖÓ´¥·¢£¬¹ÊÔݲ»ÐèҪʱ¼ä¼ä¸ô¿ØÖÆ
    #if not GameWorld.SetWorldDictKey(ChConfig.TYPE_ActionOpenAndCloseByDayCountGoOn, tick):
    #    #¼ä¸ôδµ½
    #    return
    
    if GameWorld.IsCrossServer():
        return
    
    Dispose_ActionGoOnByDayKey()
    return
 
 
## É趨ÉϴοªÆô»î¶¯Ê±¼ä¾àÀëÏÖÔÚÌìÊýʼþ
#  @param None: 
#  @return: None
def DoLogic_ServerLastOpenActionDay():
    
    #ÊÇ¿ç·þ·þÎñÆ÷
    if GameWorld.IsCrossServer():
        if not PlayerDBGSEvent.GetDBGSTrig_ByKey(PlayerDBGSEvent.Def_MergeServerOpenActionDay):
            return
        
        PlayerDBGSEvent.SetDBGSTrig_ServerTime(PlayerDBGSEvent.Def_MergeServerOpenActionDay)
        
        #֪ͨ×Ó·þÎñÆ÷ÌìÊý
        SendBroadcastMergeOpenActionDay()
        return
    
    DoLogic_ActionByDayKeyOnDay()
    
    #ÉϴοªÆô»î¶¯Ê±¼ä¾àÀëÏÖÔÚÌìÊý
    lastOpenActionDay = PlayerDBGSEvent.GetDBGSTrig_ByKey(PlayerDBGSEvent.Def_ServerLastOpenActionDay)
    openServerDay = PlayerDBGSEvent.GetDBGSTrig_ByKey(PlayerDBGSEvent.Def_ServerDay)
    initDayList = ReadChConfig.GetEvalChConfig('ActionControlByDayInitOpenServerDay')
    if openServerDay < initDayList[0]:
        #¿ª·þʱ¼ä䳬¹ý30Ìì
        return
    
    #ÐÂÒ»Âֻ´ÓÍ·¿ªÊ¼
    if lastOpenActionDay >= initDayList[1] or openServerDay == initDayList[2]:
        NewRingOpenActionDay()
        return
 
    PlayerDBGSEvent.SetDBGSTrig_ServerTime(PlayerDBGSEvent.Def_ServerLastOpenActionDay)
    return
            
 
## ÐÂÒ»Âֻ¿ªÊ¼
#  @param None: 
#  @return: 
def NewRingOpenActionDay():
    
    #ÉèÖÃ×ÖµäÖµ´Ó1¿ªÊ¼, ¸úSetDBGSTrig_ServerTime½Ó¿Úͬ²½
    PlayerDBGSEvent.SetDBGSTrig_ByKey(PlayerDBGSEvent.Def_ServerLastOpenActionDay, 1)
    
    # »î¶¯ÌìÊýÖØÉè
    OpenActionDay_Reset()      
    return
      
#------------------------------------------------------------------------------
## »î¶¯ÌìÊýÖØÉè
#  @param None
#  @return None
def OpenActionDay_Reset():    
    # ÉèÖùúÍõÕ½¿ªÊ¼
    #PlayerDBGSEvent.SetDBGSTrig_ByKey(PlayerDBGSEvent.Def_MergeWarStart, 1)
    return
 
### ¼ì²ékeyÊÇ·ñ´¦Àí
#def __CheckIsProcessDictName(dictName):
#    
#    # ·Ç¿ç·þ·þÎñÆ÷²»´¦ÀíijЩkey
#    if dictName in [ShareDefine.Def_Notify_WorldKey_Merge_King] and not GameWorld.IsCrossServer():
#        return False
#    
#    return True
 
## µ±Ç°Ê±¼äÓëÖ¸¶¨Ê±¼ä±È½Ï
#  @param curTime µ±Ç°·þÎñÆ÷ʱ¼ä 
#  @param timeInfo Ö¸¶¨Ê±¼ä [[3,4(ÐÇÆÚ¼¸)], Ä꣬Ô£¬ÈÕ£¬Ê±£¬·Ö] 
#  @return ´óÓÚ·µ»Ø1£¬Ð¡ÓÚ·µ»Ø-1£¬Ïàͬ·µ»Ø0
#  @remarks º¯ÊýÏêϸ˵Ã÷.Òì³£ºÍ²»³É±È½ÏÌõ¼þ(ÐÇÆÚ¼¸²»¶Ô)·µ»ØNone
def CompareActTime(curTime, timeInfo):
    for index, callObj in enumerate(ATTR_CALL_TIME):
        #È¥³ý²»±È½ÏµÄÔªËØ
        if timeInfo[index] == '-':
            continue
        
        if hasattr(curTime, callObj) != True:
            GameWorld.Log('###ϵͳʱ¼ä»ñµÃÒì³££¬ÎÞ´ËÊôÐÔ')
            return
        
        curCallObj = getattr(curTime, callObj)
 
        #ÓÅÏÈÐÇÆÚ¼¸ÌØÊâÑéÖ¤
        if type(curCallObj) != IntType:
            wday = curCallObj() + 1
            if wday not in timeInfo[index]:
                return
            
            continue
        
        if curCallObj == timeInfo[index]:
            continue
        
        #µ±Ç°Ê±¼ä´óÓÚÖ¸¶¨Ê±¼ä
        if curCallObj > timeInfo[index]:
            return ChConfig.Def_Cmp_Greater
        #СÓÚ
        return ChConfig.Def_Cmp_Lower
    #µÈÓÚ
    return ChConfig.Def_Cmp_Equ
 
## ÑéÖ¤»î¶¯ÊÇ·ñÔڻʱ¼ä¶Î£¨³¤Ê±¼ä¶Î£©
#  @param curTime µ±Ç°Ê±¼ä
#  @param actSect Ê±¼ä¶Î
#  @return ²¼¶ûÖµ
#  @remarks º¯ÊýÏêϸ˵Ã÷.
def IsAtActTime(curTime, actSect):
    #ÎÞʱ¼ä¶ÎÏÞÖÆ
    if not actSect:
        return True
    
    #Ôڻʱ¼ä¶Î
    if GameWorld.GetDateTimeByStr(actSect[0]) \
                <= curTime <= GameWorld.GetDateTimeByStr(actSect[1]):
        return True
    
    return False
 
#---------------------------------------------------------------------
##´¦ÀíGameServer»î¶¯×´Ì¬
# @param dictName ×ÖµäÃû
# @param isOpen ÊÇ·ñ¿ªÆô
# @return ·µ»ØÖµÎÞÒâÒå
# @remarks 
def __DoLogic_GameServer_ActionState(dictName, isOpen):
    #===============================================================================================
    # #ÁìµØÕù¶áÕ½
    # if dictName == ShareDefine.Def_Notify_WorldKey_ManorWar:
    #    PlayerManorWar.ManorWar_ChangeState(isOpen)
    # #´ðÌâ»î¶¯
    # elif dictName == ShareDefine.Def_Notify_WorldKey_Game_EXAM:
    #    PlayerExam.Exam_ChangeState(isOpen)
    # #ÌØ»Ý»î¶¯
    # elif dictName in ShareDefine.TeHuiTypeKeyDict.values():
    #    GameWorldActionTeHui.OnTeHuiActionChange(dictName, isOpen)
    # #É̵ê״̬±ä¸ü
    # elif dictName.startswith(ShareDefine.Def_Notify_WorldKey_ShopState[:-2]):
    #    GameWorldShopItem.OnShopStateChange(dictName, isOpen)
    #===============================================================================================
        
    #ÏÉÃËÑç»á 
    if dictName == ShareDefine.Def_Notify_WorldKey_FBFuncState % ChConfig.Def_FBMapID_FamilyParty:
        PlayerFamilyParty.FamilyPartyStateChange(isOpen)
    #ÏÉÃËÁªÈü
    elif dictName == ShareDefine.Def_Notify_WorldKey_FBFuncState % ChConfig.Def_FBMapID_FamilyWar:
        GameWorldFamilyWar.OnFamilyWarStateChange(isOpen)
    #ÏÉħ֮Õù
    elif dictName == ShareDefine.Def_Notify_WorldKey_FBFuncState % ChConfig.Def_FBMapID_XMZZ:
        PlayerXMZZ.OnXMZZStateChange(dictName, isOpen)
    #ÊØÎÀÈË»Ê
    elif dictName == ShareDefine.Def_Notify_WorldKey_FBFuncState % ChConfig.Def_FBMapID_FamilyInvade:
        PlayerFamilySWRH.OnSWRHStateChange(dictName, isOpen)
    #Æï³èÕù¶á
    elif dictName == ShareDefine.Def_Notify_WorldKey_DailyActionState % ShareDefine.DailyActionID_FamilyRobBoss:
        GameWorldBoss.OnHorsePetRobBossActionChange(isOpen)
    #¿ç·þPK
    elif dictName == ShareDefine.Def_Notify_WorldKey_DailyActionState % ShareDefine.DailyActionID_CrossReamPK:
        CrossRealmPK.OnCrossRealmPKDailyActionStateChange(isOpen)
    return
 
#------------------------------------------------------------------------------ 
## Í¨Öª×Ó·þÎñÆ÷ÌìÊý
#  @param param: None
#  @return: None
def SendBroadcastMergeOpenActionDay():
    mergeServerOpenActionDay = PlayerDBGSEvent.GetDBGSTrig_ByKey(PlayerDBGSEvent.Def_MergeServerOpenActionDay)
    #.SendBroadcastMerge(ChConfig.Def_MergeServerOpenActionDay, 0, {"Day":mergeServerOpenActionDay})
    return
 
#-------------------------------------------------------------------------------
 
## ¸ù¾Ý»î¶¯¿ªÆôµÄ»î¶¯Ê¼þOnDay
#  @param None: 
#  @return: None
def DoLogic_ActionByDayKeyOnDay():
    openServerDay = PlayerDBGSEvent.GetDBGSTrig_ByKey(PlayerDBGSEvent.Def_ServerDay)
    isMixServer = PlayerDBGSEvent.GetDBGSTrig_ByKey(PlayerDBGSEvent.Def_IsMixServer)
    mixServerDay = PlayerDBGSEvent.GetDBGSTrig_ByKey(PlayerDBGSEvent.Def_MixServerDay)
    repeatDayInfo = ReadChConfig.GetEvalChConfig('ActionControlByDayKeyRepeat')
    startRepeatOpenDay, startRepeatMixDay, repeatList = repeatDayInfo
    # ²»ÊÇÑ­»·½×¶Î 
    if openServerDay < startRepeatOpenDay or (isMixServer and mixServerDay < startRepeatMixDay):
        GameWorld.Log("ûÓÐÕýʽ½øÈëÖÜÆÚÑ­»·£¬²»´¦Àí!")
        return
    
    Def_RepeatOrderKey = PlayerDBGSEvent.Def_TeHuiRepeatOrderKey
    Def_RepeatNumKey = PlayerDBGSEvent.Def_TeHuiRepeatNumKey
    
    # Ç¿ÖƸüÐÂÒ»´ÎÊÀ½çµÈ¼¶
    GameWorldAverageLv.OpenWorldAverageLv()
    
    repeatOrder = PlayerDBGSEvent.GetDBGSTrig_ByKey(Def_RepeatOrderKey)
    repeatOrder = "" if not repeatOrder else str(repeatOrder)
    preRepeatNum = PlayerDBGSEvent.GetDBGSTrig_ByKey(Def_RepeatNumKey)
    preRepeatNum = "" if not preRepeatNum else str(preRepeatNum)
    worldAverageLV = PlayerDBGSEvent.GetDBGSTrig_ByKey(ShareDefine.Def_Notify_WorldKey_WorldAverageLv)
    GameWorld.Log("´¦ÀíÖÜÆÚÑ­»·: openServerDay=%s,isMixServer=%s,mixServerDay=%s" % (openServerDay, isMixServer, mixServerDay))
    GameWorld.Log("    startRepeatOpenDay=%s,startRepeatMixDay=%s,repeatOrder=%s,preRepeatNum=%s,worldAverageLV=%s" 
                  % (startRepeatOpenDay, startRepeatMixDay, repeatOrder, preRepeatNum, worldAverageLV))
    
    # ¿ªÊ¼Ñ­»·
    if openServerDay == startRepeatOpenDay or (isMixServer and mixServerDay == startRepeatMixDay):
        repeatOrder = ""
        for i, repeatInfo in enumerate(repeatList, 1):
            if i > 9:
                break
            needWorldAverageLV = repeatInfo[0]
            if worldAverageLV < needWorldAverageLV:
                continue
            repeatOrder = "%s%s" % (repeatOrder, i)
        PlayerDBGSEvent.SetDBGSTrig_ByKey(Def_RepeatOrderKey, GameWorld.ToIntDef(repeatOrder))
        GameWorld.Log("    ¿ªÊ¼Ñ­»·, Éú³ÉÑ­»·±àºÅ˳Ðò: %s" % repeatOrder)
        
    # »¹Ã»È«²¿¿ªÊ¼Ñ­»·£¬ÔòÅжÏÊÇ·ñÓж¯Ì¬Ð²åÈëµÄÑ­»·
    elif len(repeatOrder) < len(repeatList):
        GameWorld.Log("    »¹Ã»È«²¿¿ªÊ¼Ñ­»·£¬ÅжÏÊÇ·ñÓж¯Ì¬Ð²åÈëµÄÑ­»·..")
        for i, repeatInfo in enumerate(repeatList, 1):
            if i > 9:
                break
            if str(i) in repeatOrder: # ÒѾ­ÔÚÑ­»·ÀïµÄ²»´¦Àí
                continue
            needWorldAverageLV = repeatInfo[0]
            if worldAverageLV < needWorldAverageLV:
                continue
            
            # ²åÈëÐÂÑ­»·
            if preRepeatNum in repeatOrder:
                insertIndex = repeatOrder.index(preRepeatNum)
                repeatOrder = repeatOrder[:insertIndex + 1] + str(i) + repeatOrder[insertIndex + 1:]
            else:
                repeatOrder = str(i)
            PlayerDBGSEvent.SetDBGSTrig_ByKey(Def_RepeatOrderKey, GameWorld.ToIntDef(repeatOrder))
            GameWorld.Log("        ±àºÅ%s, needWorldAverageLV=%s,²åÈëÑ­»·,¸üÐÂÑ­»·±àºÅ˳Ðò: %s" % (i, needWorldAverageLV, repeatOrder))
            break
            
    if not repeatOrder:
        GameWorld.Log("    Ã»ÓпÉÑ­»·µÄ»î¶¯!")
        return
    
    # ½øÈëÏÂÒ»ÌìÑ­»·±àºÅ
    if preRepeatNum and preRepeatNum in repeatOrder:
        nextRepeatIndex = repeatOrder.index(preRepeatNum) + 1
        nextRepeatIndex = 0 if nextRepeatIndex >= len(repeatOrder) else nextRepeatIndex
    else:
        nextRepeatIndex = 0
    nextRepeatNum = GameWorld.ToIntDef(repeatOrder[nextRepeatIndex])
    PlayerDBGSEvent.SetDBGSTrig_ByKey(Def_RepeatNumKey, nextRepeatNum)
    if nextRepeatNum <= 0 or nextRepeatNum > len(repeatList):
        GameWorld.Log("    ÏÂÒ»¸öÑ­»·±àºÅ´íÎó!nextRepeatNum=%s" % nextRepeatNum)
        return
    
    GameWorld.Log("    ¹ýÌì±ä¸üÑ­»·»î¶¯×´Ì¬, nextRepeatNum=%s" % nextRepeatNum)
    
    gameWorld = GameWorld.GetGameWorld()
    nextRepeatDict = repeatList[nextRepeatNum - 1][1]
    for dictName, signID in nextRepeatDict.items():
        # ÒѾ­ÊÇÕâ¸öÖµ²»´¦Àí
        if gameWorld.GetDictByKey(dictName) == signID:
            #GameWorld.DebugLog("    ÒѾ­ÊÇÕâ¸öÖµ²»´¦ÀídictName=%s,signID=%s"  % (dictName,signID))
            continue
        
        # Ä¬Èϵ±Ç°µÄ0µã¿ªÊ¼µ½µ±ÌìµÄ23µã59·Ö
        curDay, beginDay, beginH, beginM, endDay, endH, endM = 0, 0, 0, 0, 0, 23, 59
        __ChangeDA_ActionSign(gameWorld, dictName, signID, curDay, beginDay, beginH, beginM, endDay, endH, endM)
            
    return
 
 
 
## ´¦ÀíÖØ¿ª·þÎñÆ÷ºó, »î¶¯¼ÌÐø¿ªÆôÂß¼­¸ù¾ÝÌìÊýkey
#  @param None
#  @return None
def Dispose_ActionGoOnByDayKey():
    if GameWorld.IsCrossServer():
        return
    GameWorld.DebugLog("´¦ÀíÌØ»Ý״̬ÐÅÏ¢...")
    openServerDay = PlayerDBGSEvent.GetDBGSTrig_ByKey(PlayerDBGSEvent.Def_ServerDay)
    isMixServer = PlayerDBGSEvent.GetDBGSTrig_ByKey(PlayerDBGSEvent.Def_IsMixServer)
    mixServerDay = PlayerDBGSEvent.GetDBGSTrig_ByKey(PlayerDBGSEvent.Def_MixServerDay)
    allActionGoOnInfo = ReadChConfig.GetEvalChConfig("ActionControlByDayKeyGoOn")
    
    if not isMixServer:
        __DoActionGoOnByDayKeyCheck(allActionGoOnInfo[0], openServerDay)
    else:
        __DoActionGoOnByDayKeyCheck(allActionGoOnInfo[1], mixServerDay)
        
    return
 
 
## °´Ì쿪Æô¿ÉÑ­»·»î¶¯¼ì²é
#  @param controlList: 
#  @return: None
def __DoActionGoOnByDayKeyCheck(goOnList, curDay):
    curTime = GameWorld.GetServerTime()
    gameWorld = GameWorld.GetGameWorld()
    for goOnControl in goOnList:
        beginDay, beginH, beginM = goOnControl[0]
        endDay, endH, endM = goOnControl[1]
        if curDay < beginDay or curDay > endDay:
            #»î¶¯²»ÔÚÕâһʱ¼ä¶Î
            #GameWorld.DebugLog("»î¶¯²»ÔÚÕâһʱ¼ä¶ÎcurDay=%s < beginDay=%s or curDay > endDay=%s" 
            #                   % (curDay,beginDay,endDay))
            continue
        
        dictName = goOnControl[2]  # ×ÖµäÃû
        signID = goOnControl[3]  # ±ê¼Ç
        
        # ÒѾ­ÊÇÕâ¸öÖµ²»´¦Àí
        if gameWorld.GetDictByKey(dictName) == signID:
            #GameWorld.DebugLog("ÒѾ­ÊÇÕâ¸öÖµ²»´¦ÀídictName=%s,signID=%s"  % (dictName,signID))
            continue
 
        beginTime = ['-', '-', '-', '-', beginH, beginM]
        endTime = ['-', '-', '-', '-', endH, endM]
        #»¹Ã»¿ªÊ¼
        if curDay == beginDay and CompareActTime(curTime, beginTime) == ChConfig.Def_Cmp_Lower:
            #GameWorld.DebugLog("»¹Ã»¿ªÊ¼...")
            continue
        
        #ÒѾ­½áÊø
        if curDay == endDay and CompareActTime(curTime, endTime) == ChConfig.Def_Cmp_Greater:
            #GameWorld.DebugLog("ÒѾ­½áÊø...")
            continue
        
        __ChangeDA_ActionSign(gameWorld, dictName, signID, curDay, beginDay, beginH, beginM, endDay, endH, endM)
                
    return
 
def __ChangeDA_ActionSign(gameWorld, dictName, signID, curDay, beginDay, beginH, beginM, endDay, endH, endM):
    # ¼ÆË㿪ʼ¼°½áÊøÈÕÆÚ
    beginTime, endTime = GetBeginEndTimeByDay(dictName, curDay, beginDay, beginH, beginM, endDay, endH, endM)
    
    actionID = int(time.time())
    GameWorld.Log('»î¶¯×´Ì¬±ä¸ü: dictName=%s,signID=%s,beginTime=%s,endTime=%s,actionID=%s' 
                  % (dictName, signID, beginTime, endTime, actionID))
    
    #DZ¹æÔò£ºÔÚChConfig»î¶¯Ïà¹ØÉèÖÃÖУ¬ÌáÈ¡ÁË×ÖµäÃû
    gameWorld.SetDict(dictName, signID)
    gameWorld.SetDict(ShareDefine.Def_Notify_WorldKey_DayAction_BeginTime % dictName, beginTime)
    gameWorld.SetDict(ShareDefine.Def_Notify_WorldKey_DayAction_EndTime % dictName, endTime)
    # ±ê¼Ç»î¶¯Î¨Ò»id
    actionIDKey = ShareDefine.Def_Notify_WorldKey_DayAction_ID % dictName
    gameWorld.SetDict(actionIDKey, actionID)
    
    #֪ͨMapserver,ÉèÖÃ×Öµä
    GameWorld.SendMapServerMsgEx(actionIDKey, actionID)
    GameWorld.SendMapServerMsgEx(dictName, signID)
            
    #´¦ÀíGameServer»î¶¯Âß¼­
    __DoLogic_GameServer_ActionState(dictName, signID)
    return
 
## »ñÈ¡¿ªÆô½áÊøÊ±¼ä
#  @param tick 
#  @return None
def GetBeginEndTimeByDay(dictName, curDay, beginDay, beginH, beginM, endDay, endH, endM):
    beginDiffDays = max(0, curDay - beginDay)
    beginDateTime = GameWorld.GetDatetimeBySubDays(beginDiffDays)
    beginDateTimeStr = str(beginDateTime).split(".")[0]
    beginDateTimeStr = "%s %02d:%02d:00" % (beginDateTimeStr[:10], beginH, beginM)
    beginTimeNum = GameWorld.ChangeTimeStrToNum(beginDateTimeStr, ChConfig.TYPE_Time_Format)
 
    endDiffDays = max(0, endDay - curDay)
    endDateTime = GameWorld.GetDatetimeByDiffDays(endDiffDays)
    endDateTimeStr = str(endDateTime).split(".")[0]
    endDateTimeStr = "%s %02d:%02d:59" % (endDateTimeStr[:10], endH, endM)
    endTimeNum = GameWorld.ChangeTimeStrToNum(endDateTimeStr, ChConfig.TYPE_Time_Format)
    return beginTimeNum, endTimeNum