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
#!/usr/bin/python
# -*- coding: GBK -*-
#-------------------------------------------------------------------------------
#
#-------------------------------------------------------------------------------
#
##@package GM.Commands.test_OnMonth
#
# @todo:test_OnMonth
# @author ljd
# @date 2015-06-17 12:00
# @version 1.0
#
# ÏêϸÃèÊö: test_OnMonth
#
#---------------------------------------------------------------------
#"""Version = 2015-06-17 12:00"""
#--------------------------------------------------------------------- 
import GameWorldProcess
import ShareDefine
import GameWorld
#---------------------------------------------------------------------
#È«¾Ö±äÁ¿
#---------------------------------------------------------------------
 
#---------------------------------------------------------------------
#Âß¼­ÊµÏÖ ÕâÀïcurPlayer
## Ö´ÐÐÂß¼­  Ö´Ðиø¶¨²ÎÊý´ÎonMonth
#  @param curPlayer µ±Ç°Íæ¼Ò
#  @param playerList ÃüÁîÖ´ÐеĴÎÊý Ð¡ÓÚ=ÓÚ3 
#  @return None
#  @remarks º¯ÊýÏêϸ˵Ã÷. ÊÀ½ç·þÎñÆ÷Ö´ÐÐOnMonth
def OnExec(curPlayer, playerList):
    timeStr = GameWorld.GetCurrentDataTimeStr()
    tick = GameWorld.GetGameWorld().GetTick()
    
    if len(playerList) == 0:
        DoLogic_GM_OnMonth(timeStr, tick)
        return
    
    count = playerList[0]
    
    if count > 3:
        return
        
    for i in range(count):
        DoLogic_GM_OnMonth(timeStr, tick)
            
    return
 
## È«¾Öº¯Êý¼òҪ˵Ã÷£ºÊÀ½ç·þÎñÆ÷Ö´ÐР test_OnMonth  Ò»´Î ²¢Í¨ÖªÔÚÏßËùÓÐÍæ¼Ò
#  @param timeStr   Ê±¼ä´Á
#  @param tick     µ±Ç°tick
#  @return ÎÞ·µ»ØÖµ
#  @remarks º¯ÊýÏêϸ˵Ã÷£ºÊÀ½ç·þÎñÆ÷Ö´ÐРtest_OnMonth Ò»´Î ÐèҪͬʱµôÓÃOnWeek OnDay OnHour
def DoLogic_GM_OnMonth(timeStr, tick):
    playerManager = GameWorld.GetPlayerManager()
    
    for i in range(0, playerManager.GetPlayerCount()):
        curPlayer = playerManager.GetPlayerByIndex(i)
        
        if not curPlayer or curPlayer.IsEmpty():
            continue
        
        mapID = GameWorld.GetQueryPlayerMapID(curPlayer)
        
        if not mapID:
            continue
        
        playerManager.MapServer_QueryPlayer(0, 0, curPlayer.GetID(), mapID, 'GMDateTime', 'GMOnMonth', len("GMOnMonth"))
    
    GameWorld.SendMapServerMsgEx(ShareDefine.Def_Notify_WorldKey_OnDayEx, 0)
    GameWorld.SendMapServerMsgEx(ShareDefine.Def_Notify_WorldKey_OnWeekEx, 0)
    GameWorld.SendMapServerMsgEx(ShareDefine.Def_Notify_WorldKey_OnMonthEx, 0)
    
    GameWorldProcess.OnHour(timeStr, tick)
    GameWorldProcess.OnDay(timeStr, tick)
    GameWorldProcess.OnDayEx(tick)
    GameWorldProcess.OnWeek(timeStr, tick)
    GameWorldProcess.OnWeekEx(tick)
    GameWorldProcess.OnMonth(timeStr, tick)
    GameWorldProcess.OnMonthEx(tick)
    return