#!/usr/bin/python  
 | 
# -*- coding: GBK -*-  
 | 
#---------------------------------------------------------------------  
 | 
#Writer £ºMark  
 | 
#---------------------------------------------------------------------  
 | 
#½Å±¾ËµÃ÷  
 | 
#---------------------------------------------------------------------  
 | 
#µ¼Èë  
 | 
##@package test_OnDay  
 | 
# Ä£¿éµÄ¼òҪ˵Ã÷. É¾³ý¶ÓÎé  
 | 
#  
 | 
# @author Kilua  
 | 
# @date 2010-3-31  
 | 
# @version 1.1  
 | 
#  
 | 
# @change: "2012-05-16 14:30" jiang C++½Ó¿ÚÐÞ¸ÄMapServer_QueryPlayerResultºÍMapServer_QueryPlayerÐÞ¸Ä  
 | 
#------------------------------------------------------------------------------   
 | 
#"""Version = 2012-05-16 14:30"""  
 | 
#------------------------------------------------------------------------------   
 | 
  
 | 
import GameWorld  
 | 
import GameWorldProcess  
 | 
import ShareDefine  
 | 
#---------------------------------------------------------------------  
 | 
#È«¾Ö±äÁ¿  
 | 
#---------------------------------------------------------------------  
 | 
  
 | 
#---------------------------------------------------------------------  
 | 
#Â߼ʵÏÖ ÕâÀïcurPlayer  
 | 
## Ö´ÐÐÂß¼  
 | 
#  @param curPlayer µ±Ç°Íæ¼Ò  
 | 
#  @param playerList ÃüÁîÖ´ÐеĴÎÊý Ð¡ÓÚ=ÓÚ5 Èë¹ý´óÓÚµÈÓÚ5µÄ»° ÓÃtest_OnWeek »ò×éºÏ  
 | 
#  @return None  
 | 
#  @remarks º¯ÊýÏêϸ˵Ã÷. ÓеÄÈÎÎñÒ»ÌìÖ»ÄÜ×öÏÞ¶¨´ÎÊý£¬»òÓеIJÙ×÷Ò»ÌìÖ»ÄÜ×öÒ»´Î  
 | 
#  ÓÃÀ´Ë¢ÐÂÈÎÎñ״̬»òÆäËü  
 | 
def OnExec(curPlayer,playerList):  
 | 
    timeStr = GameWorld.GetCurrentDataTimeStr()  
 | 
    tick = GameWorld.GetGameWorld().GetTick()  
 | 
      
 | 
    if len(playerList) == 0:  
 | 
        DoLogic_GM_OnDay( timeStr , tick )  
 | 
        return  
 | 
      
 | 
    count = playerList[0]  
 | 
      
 | 
    if count > 5:  
 | 
        return  
 | 
      
 | 
    for i in range( count ):  
 | 
        DoLogic_GM_OnDay( timeStr , tick )  
 | 
              
 | 
    return  
 | 
  
 | 
## ÊÀ½ç·þÎñÆ÷Ö´ÐР test_OnHour test_OnDay Ò»´Î ²¢Í¨ÖªÔÚÏßËùÓÐÍæ¼Ò  
 | 
#  @param timeStr   Ê±¼ä´Á  
 | 
#  @param tick     µ±Ç°tick  
 | 
#  @return ÎÞ·µ»ØÖµ  
 | 
#  @remarks º¯ÊýÏêϸ˵Ã÷£ºÊÀ½ç·þÎñÆ÷Ö´ÐРtest_OnHour test_OnDay Ò»´Î  
 | 
def DoLogic_GM_OnDay( 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', 'GMOnDay', len("GMOnDay"))  
 | 
          
 | 
    GameWorld.SendMapServerMsgEx(ShareDefine.Def_Notify_WorldKey_OnDayEx, 0)  
 | 
      
 | 
    GameWorldProcess.OnHour( timeStr , tick )  
 | 
    GameWorldProcess.OnDay( timeStr , tick )  
 | 
    GameWorldProcess.OnDayEx(tick)  
 | 
    return  
 |