hxp
2025-05-28 09fef77b16601ee5b0f53f34ccb23804b8448c8c
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
#!/usr/bin/python
# -*- coding: GBK -*-
#-------------------------------------------------------------------------------
#
##@package GM.Commands.test_OnHour
#
# @todo:ģʽ¹ýСʱ
# @author hxp
# @date 2025-05-15
# @version 1.0
#
# ÏêϸÃèÊö: Ä£Ê½¹ýСʱ
#
#-------------------------------------------------------------------------------
#"""Version = 2025-05-15 10:35"""
#-------------------------------------------------------------------------------
 
import GameWorld
import PlayerEventCounter
import GameWorldEvent
 
def OnExec(curPlayer, gmList):
    __DoExec(GameWorld.GetGameWorld().GetTick())
    
    # ÔÝʱͬ²½GameServer£¬Ö®ºó¿ÉÈ¥³ý
    return True
 
def __DoExec(tick):
    playerManager = GameWorld.GetPlayerManager()
    for i in xrange(playerManager.GetPlayerCount()):
        curPlayer = playerManager.GetPlayerByIndex(i)
        if not GameWorld.IsNormalPlayer(curPlayer):
            continue
        PlayerEventCounter.GMDateTime(curPlayer, "GMOnHour")
        
    GameWorldEvent.OnHour(tick)
    return