#!/usr/bin/python  
 | 
# -*- coding: GBK -*-  
 | 
#---------------------------------------------------------------------  
 | 
#  
 | 
#---------------------------------------------------------------------  
 | 
##@package GameDataRecord.py  
 | 
# ÓÎϷʹÓõÄͳ¼ÆÊý¾Ý  
 | 
# ×òÌì(Íæ¼ÒµÇÈëÊýÁ¿£¬³äÖµÊý)ͳ¼Æ  
 | 
#  
 | 
# @author wdb  
 | 
# @date 2012-07-09  
 | 
# @version 1.1  
 | 
# @note  
 | 
# @change: "2013-01-15 14:00" wdb ·À·¶Íæ¼ÒÏÂÏßʱ¼äΪ¿Õ  
 | 
#---------------------------------------------------------------------  
 | 
"""Version = 2013-01-15 14:00"""  
 | 
#---------------------------------------------------------------------  
 | 
import GameWorld  
 | 
import ChConfig  
 | 
import ShareDefine  
 | 
import DataRecordPack  
 | 
#---------------------------------------------------------------------  
 | 
# ¼ÇÂ¼Íæ¼ÒµÇÈëÊýÁ¿  
 | 
g_yedayLoginPlayerCnt = 0  
 | 
# Í³¼Æ½ñÈÕÍæ¼ÒµÇÈëµÄÊýÁ¿  
 | 
g_todayLoginPlayerCnt = 0  
 | 
  
 | 
# ¼Ç¼ȫ·þ³äÖµµãȯÊý  
 | 
g_yodayNewCoinCnt = 0  
 | 
# Í³¼Æ½ñÈÕÈ«·þ³äÖµµãȯÊý  
 | 
g_todayNewCoinCnt = 0  
 | 
  
 | 
#---------------------------------------------------------------------  
 | 
## Í³¼ÆµÇÈëÈËÊý  
 | 
#  @param curPlayer£ºµÇÈëµÄÍæ¼Ò  
 | 
#  @param tick:µ±Ç°Ê±¼ä   
 | 
#  @return None  
 | 
def PlayerLoginRecord(curPlayer, tick):  
 | 
    global g_todayLoginPlayerCnt  
 | 
         
 | 
    # ÏÂÏßʱ¼ä  
 | 
    logoffTime = curPlayer.GetLogoffTime()  
 | 
    if not logoffTime:  
 | 
        return  
 | 
      
 | 
    logoffTime = GameWorld.GetDateTimeByStr(logoffTime)  
 | 
    # ·þÎñÆ÷ʱ¼ä  
 | 
    curTime = GameWorld.GetServerTime()  
 | 
      
 | 
    # ÅжÏÊÇ·ñÔÚ½ñÌìÏÂÏß  
 | 
    if logoffTime != None:  
 | 
        if logoffTime.day == curTime.day \  
 | 
         and logoffTime.month == curTime.month \  
 | 
          and logoffTime.year == curTime.year:  
 | 
            return  
 | 
      
 | 
    g_todayLoginPlayerCnt += 1  
 | 
    return  
 | 
  
 | 
  
 | 
## Í³¼Æ³äÖµµãȯÊý  
 | 
#  @param curPlayer£ºµÇÈëµÄÍæ¼Ò  
 | 
#  @param tick:µ±Ç°Ê±¼ä   
 | 
#  @return None  
 | 
def ChangeCoinCnt(coinCnt):  
 | 
    global g_todayNewCoinCnt  
 | 
      
 | 
    if g_todayNewCoinCnt > ChConfig.Def_UpperLimit_DWord:  
 | 
        return  
 | 
      
 | 
    g_todayNewCoinCnt += coinCnt  
 | 
    return  
 | 
  
 | 
  
 | 
## onday, Í³¼ÆÊý¾Ý¸üР 
 | 
#  @param None£º  
 | 
#  @return None  
 | 
def OnDayResetRecord():  
 | 
    global g_yedayLoginPlayerCnt  
 | 
    global g_todayLoginPlayerCnt  
 | 
    global g_yodayNewCoinCnt  
 | 
    global g_todayNewCoinCnt  
 | 
      
 | 
    # ÖØÐÂͳ¼ÆÍæ¼ÒµÇÈëµÄÊýÁ¿  
 | 
    g_yedayLoginPlayerCnt = g_todayLoginPlayerCnt  
 | 
    g_todayLoginPlayerCnt = GameWorld.GetPlayerManager().GetActivePlayerCount()  
 | 
      
 | 
    # ÖØÐÂͳ¼ÆÈ«·þ³äÖµµãȯÊý  
 | 
    g_yodayNewCoinCnt = g_todayNewCoinCnt  
 | 
    g_todayNewCoinCnt = 0  
 | 
      
 | 
    # ¼Ç¼Á÷Ïò  
 | 
    DataRecordPack.DR_ResetGameDataRecord(g_yedayLoginPlayerCnt, g_yodayNewCoinCnt)  
 | 
      
 | 
    # Í¨Öª¸ø¿Í»§¶Ë  
 | 
    GameWorld.SendMapServerMsgEx(ShareDefine.Def_Notify_WorldKey_YdayLoginCnt, g_yedayLoginPlayerCnt)  
 | 
    GameWorld.SendMapServerMsgEx(ShareDefine.Def_Notify_WorldKey_YdayNewCoinCnt, g_yodayNewCoinCnt)  
 | 
    return  
 | 
  
 |