#!/usr/bin/python  
 | 
# -*- coding: GBK -*-  
 | 
#---------------------------------------------------------------------  
 | 
#  
 | 
#---------------------------------------------------------------------  
 | 
##@package PlayerEventCounter  
 | 
# @todo: Íæ¼ÒʼþÏìÓ¦Æ÷  
 | 
#  
 | 
# @author: panwei  
 | 
# @date 2010-04-28  
 | 
# @version 2.6  
 | 
#  
 | 
# @note: ´¦ÀíÿÖÜ, Ã¿ÈÕ, Ã¿ÔÂʼþ´¦Àí  
 | 
# @change: "2015-07-10 16:00" xdh QQÿÈÕÀñ°ü  
 | 
# @change: "2015-08-13 14:00" ljd ÐÂÊÖ¿¨OnDay  
 | 
# @change: "2015-09-18 19:30" hxp ¿ç·þboss״̬±ä¸ü  
 | 
# @change: "2015-10-25 17:00" hxp ¿ç·þPK״̬±ä¸ü  
 | 
# @change: "2015-11-18 18:30" hxp ¿ç·þÍõÕßÕù°Ô  
 | 
# @change: "2016-02-30 17:00" hxp ÁìÖ÷°ÔÒµ¡¢¶ñħÊÔÁ¶  
 | 
# @change: "2016-04-29 18:00" hxp ³èÎïOnDay  
 | 
# @change: "2016-07-13 18:00" hxp ÔÚÏßÔùËÍѰ±¦Ãâ·Ñ´ÎÊýͳ¼ÆOnHour´¥·¢  
 | 
# @change: "2016-07-26 17:30" hxp Ôö¼Ó»ñʤսÃËÃËÖ÷ID±ä¸ü´¦Àí  
 | 
# @change: "2016-08-05 19:00" hxp ½Å±¾ÈȸüÖ§³Ö  
 | 
# @change: "2016-08-29 23:30" hxp ºé»ÄÖ®Á¦  
 | 
# @change: "2016-09-19 10:30" hxp key״̬±ä¸üʱȫ·þÍæ¼ÒÈËÊý»ñÈ¡·½Ê½ÐÞ¸Ä  
 | 
# @change: "2016-10-26 11:00" hxp Ç©µ½Âß¼ÐÞ¸Ä  
 | 
# @change: "2017-03-22 21:00" hxp ¶þάÂëºì°ü  
 | 
#---------------------------------------------------------------------  
 | 
#"""Version = 2017-05-12 18:00"""   
 | 
#---------------------------------------------------------------------  
 | 
import ReadChConfig  
 | 
import ChConfig  
 | 
import GameWorld  
 | 
import EventShell  
 | 
import FBLogic  
 | 
import IPY_GameWorld  
 | 
import ChPlayer  
 | 
import GameLogInfo  
 | 
import GameServerRefresh  
 | 
import ShareDefine  
 | 
import PlayerGameWallow  
 | 
import Operate_PlayerBuyZhenQi  
 | 
import PlayerSignDay  
 | 
import PlayerCoin  
 | 
import PlayerControl  
 | 
import PlayerWorldAverageLv  
 | 
import PlayerFamily  
 | 
import PlayerOnlinePrize  
 | 
import NPCCustomRefresh  
 | 
import PlayerLoginDayAward  
 | 
import NPCCommon  
 | 
import FunctionNPCCommon  
 | 
import PlayerGoldGift  
 | 
import PlayerActivity  
 | 
import PlayerBindJadeWheel  
 | 
import FBCommon  
 | 
import PlayerSuccess  
 | 
import PlayerFreeGoods  
 | 
import PlayerMagicWeapon  
 | 
import ChItem  
 | 
import PlayerGoldInvest  
 | 
import PlayerNewGuyCard  
 | 
import PlayerCrossRealmPK  
 | 
import PlayerCrossChampionship  
 | 
import PlayerCrossBattlefield  
 | 
import PlayerPet  
 | 
import BossHurtMng  
 | 
import PlayerRecover  
 | 
import GameLogic_FamilyParty  
 | 
import PlayerFamilyRedPacket  
 | 
import GameLogic_FamilyInvade  
 | 
import GameLogic_ElderBattlefield  
 | 
import GameLogic_AllFamilyBoss  
 | 
import GameLogic_HorsePetBoss  
 | 
import GameLogic_FamilyBoss  
 | 
import GameLogic_FamilyWar  
 | 
import OpenServerCampaign  
 | 
import PlayerCostRebate  
 | 
import CrossActCTGBillboard  
 | 
import CrossActAllRecharge  
 | 
import PlayerActCollectWords  
 | 
import PlayerActTotalRecharge  
 | 
import PlayerActGarbageSorting  
 | 
import PlayerActXianXiaMJ  
 | 
import PlayerActGodGift  
 | 
import PlayerActRechargeRebateGold  
 | 
import PlayerActManyDayRecharge  
 | 
import PlayerActSingleRecharge  
 | 
import PlayerActRechargePrize  
 | 
import PlayerActGrowupBuy  
 | 
import PlayerActTurntable  
 | 
import PlayerActBuyOne  
 | 
import PlayerSpringSale  
 | 
import PlayerBossReborn  
 | 
import PlayerWeekParty  
 | 
import PlayerFeastWeekParty  
 | 
import PlayerFeastTravel  
 | 
import PlayerFeastLogin  
 | 
import PlayerFeastWish  
 | 
import PlayerActLogin  
 | 
import PlayerFlashGiftbag  
 | 
import PlayerDailyGiftbag  
 | 
import PlayerFairyCeremony  
 | 
import PlayerNewFairyCeremony  
 | 
import PlayerActHorsePetFeast  
 | 
import PlayerFeastRedPacket  
 | 
import PlayerCrossYaomoBoss  
 | 
import PlayerLuckyCloudBuy  
 | 
import PlayerLuckyTreasure  
 | 
import PlayerAuctionHouse  
 | 
import PlayerTongTianLing  
 | 
import PlayerRefineStove  
 | 
import PlayerFlashSale  
 | 
import PlayerWishingWell  
 | 
import PlayerFairyDomain  
 | 
import CrossPlayerData  
 | 
import PlayerVip  
 | 
import PlayerLove  
 | 
import PlayerDiceEx  
 | 
import IpyGameDataPY  
 | 
import FamilyRobBoss  
 | 
import FBHelpBattle  
 | 
import QuestManager  
 | 
import PlayerAssist  
 | 
import PlayerArena  
 | 
import PyGameData  
 | 
import PlayerTJG  
 | 
  
 | 
import datetime  
 | 
import time  
 | 
#---------------------------------------------------------------------  
 | 
  
 | 
#===============================================================================  
 | 
# //01 01 ÐÂÒ»ÌìµÄÏìÓ¦#tagMOnDay  
 | 
# tagMOnDay       *   GettagMOnDay();  
 | 
#   
 | 
# class   IPY_MOnDay  
 | 
# {  
 | 
# public:  
 | 
#   
 | 
#    char *      GetTime();  
 | 
# };  
 | 
#===============================================================================  
 | 
## ÊÀ½ç·þÎñÆ÷->ÿÈÕÏìÓ¦(·â°ü²ÎÊý)01 01  
 | 
#  @param index Íæ¼ÒË÷Òý  
 | 
#  @param tick µ±Ç°Ê±¼ä  
 | 
#  @return None  
 | 
#  @remarks º¯ÊýÏêϸ˵Ã÷.  
 | 
def GameServer_OnDay(index, tick):  
 | 
    GameWorld.GetPsycoFunc(__Func_GameServer_OnDay)(index, tick)  
 | 
    CheckMachineTick(tick)  
 | 
    return  
 | 
  
 | 
## ÓÃÓÚ·À·¶ÔËά¿ª»úʱ¼ä³¬¹ý24Ììµ¼Ö±¨´í  
 | 
#  @param tick µ±Ç°Ê±¼ä  
 | 
#  @return None  
 | 
def CheckMachineTick(tick):  
 | 
    #ȡһÕŵØÍ¼²âÊÔ£¬ÔÚmapserver×öÂß¼£¬·½±ãÔËά¹Û²ì  
 | 
    if GameWorld.GetMap().GetMapID() != 101:  
 | 
        return  
 | 
      
 | 
    #³¬¹ý24.8Ìì¾Í»á·¢ÉúÓÎÏ·Âß¼³ö´í£¬ÒòΪtick±ä³É¸ºÊý  
 | 
    if tick/1000.0/60/60/24 >= 22:  
 | 
        raise Exception('Start PC > 22 days!!!')  
 | 
      
 | 
    return  
 | 
  
 | 
## ÊÀ½ç·þÎñÆ÷->ÿÈÕÏìÓ¦(·â°ü²ÎÊý)01 01  
 | 
#  @param index Íæ¼ÒË÷Òý  
 | 
#  @param tick µ±Ç°Ê±¼ä  
 | 
#  @return None  
 | 
#  @remarks º¯ÊýÏêϸ˵Ã÷.  
 | 
def __Func_GameServer_OnDay(index, tick):  
 | 
    GameWorld.Log("MapServer -> OnDay!")  
 | 
    playerManager = GameWorld.GetPlayerManager()  
 | 
    #»ñȡÿÈÕÏìÓ¦·â°ü  
 | 
    pack = IPY_GameWorld.IPY_MOnDay()  
 | 
    #ͬ²½ÊÀ½ç·þÎñÆ÷ʱ¼ä  
 | 
    SetMapServerTimeFromGameServer(pack.GetTime())  
 | 
      
 | 
    #´¦ÀíËùÓÐÍæ¼ÒÐżþµÄondayʼþ, °Ñ´æÔÚʱ¼ä+1  
 | 
    playerManager.ProcessAllPlayerMailOnDay()  
 | 
    #Çå¿ÕÿÈÕÈռǼǼÐÅÏ¢  
 | 
    GameLogInfo.ClearGameLogInfo()  
 | 
      
 | 
    #¸±±¾OnDayʼþÏìÓ¦  
 | 
    FBLogic.OnDay(tick)  
 | 
      
 | 
    #ɾ³ýËùÓеÄÈÎÎñ·¢²¼  
 | 
    missionPubManager = GameWorld.GetGameWorld().GetDBMissionPubManager()  
 | 
    missionPubManager.Clear()  
 | 
      
 | 
    for i in xrange(playerManager.GetPlayerCount()):  
 | 
        curPlayer = playerManager.GetPlayerByIndex(i)  
 | 
          
 | 
        if not curPlayer or curPlayer.IsEmpty():  
 | 
            continue  
 | 
          
 | 
        PlayerOnDay(curPlayer)  
 | 
        # ·þÎñÆ÷Onday´¦ÀíÊý¾Ý£¬¼´²»ÄÜÔÚÍæ¼ÒÉÏÏßʱµÄOnday´¥·¢  
 | 
        #PlayerServerDay(curPlayer)  
 | 
      
 | 
    return  
 | 
  
 | 
def __Func_GameServer_OnDayEx(tick):  
 | 
    GameWorld.Log("MapServer -> OnDayEx!")  
 | 
      
 | 
    PlayerControl.RemoveTimeoutLeaveServerPlayerInfo(tick)  
 | 
      
 | 
    playerManager = GameWorld.GetPlayerManager()  
 | 
    for i in xrange(playerManager.GetPlayerCount()):  
 | 
        curPlayer = playerManager.GetPlayerByIndex(i)  
 | 
          
 | 
        if not curPlayer or curPlayer.IsEmpty():  
 | 
            continue  
 | 
          
 | 
        PlayerOnDayEx(curPlayer)  
 | 
    return  
 | 
  
 | 
#---------------------------------------------------------------------  
 | 
#===============================================================================  
 | 
# #//////////////////////////////////////////////////////////////  
 | 
# #//01 06 ÐÂÒ»¸öСʱµÄÏìÓ¦#tagMOnHour  
 | 
# #tagMOnHour       *   GettagMOnHour();  
 | 
# #  
 | 
# #class   IPY_MOnHour  
 | 
# #{  
 | 
# #public:  
 | 
# #  
 | 
# #    char *      GetTime();  
 | 
# #};  
 | 
#===============================================================================  
 | 
## 01 06 ÐÂÒ»¸öСʱµÄÏìÓ¦  
 | 
#  @param index Íæ¼ÒË÷Òý  
 | 
#  @param tick µ±Ç°Ê±¼ä  
 | 
#  @return None  
 | 
#  @remarks º¯ÊýÏêϸ˵Ã÷.  
 | 
def GameServer_OnHour(index, tick):  
 | 
    GameWorld.GetPsycoFunc(__Func_GameServer_OnHour)(index, tick)  
 | 
    return  
 | 
  
 | 
## 01 06 ÐÂÒ»¸öСʱµÄÏìÓ¦  
 | 
#  @param index Íæ¼ÒË÷Òý  
 | 
#  @param tick µ±Ç°Ê±¼ä  
 | 
#  @return None  
 | 
#  @remarks º¯ÊýÏêϸ˵Ã÷.  
 | 
def __Func_GameServer_OnHour(index, tick):  
 | 
    GameWorld.Log("MapServer -> OnHour!")  
 | 
    #»ñȡÿСʱÏìÓ¦·â°ü  
 | 
    pack = IPY_GameWorld.IPY_MOnHour()  
 | 
    time = pack.GetTime()  
 | 
    #ͬ²½ÊÀ½ç·þÎñÆ÷ʱ¼ä  
 | 
    SetMapServerTimeFromGameServer(time)  
 | 
      
 | 
    #¸±±¾OnHourʼþ  
 | 
    FBLogic.OnHour(time, tick)  
 | 
      
 | 
    #ReadCaptchaImage.ReSetCaptcha()  
 | 
      
 | 
    playerManager = GameWorld.GetPlayerManager()  
 | 
    for i in xrange(playerManager.GetPlayerCount()):  
 | 
        curPlayer = playerManager.GetPlayerByIndex(i)  
 | 
          
 | 
        if not curPlayer or curPlayer.IsEmpty():  
 | 
            continue  
 | 
          
 | 
        PlayerOnHour(curPlayer)  
 | 
          
 | 
    return  
 | 
#---------------------------------------------------------------------  
 | 
#===============================================================================  
 | 
# //01 02 ÐÂÒ»¸öÐÇÆÚµÄÏìÓ¦#tagMOnWeek  
 | 
# tagMOnWeek       *   GettagMOnWeek();  
 | 
#   
 | 
# class   IPY_MOnWeek  
 | 
# {  
 | 
# public:  
 | 
#   
 | 
#    char *      GetTime();  
 | 
# };  
 | 
#===============================================================================  
 | 
  
 | 
## ÊÀ½ç·þÎñÆ÷->ÿÖÜÏìÓ¦(·â°ü²ÎÊý) 01 02 ÐÂÒ»¸öÐÇÆÚµÄÏìÓ¦  
 | 
#  @param index Íæ¼ÒË÷Òý  
 | 
#  @param tick µ±Ç°Ê±¼ä  
 | 
#  @return None  
 | 
#  @remarks º¯ÊýÏêϸ˵Ã÷.  
 | 
def GameServer_OnWeek(index, tick):  
 | 
    GameWorld.GetPsycoFunc(__Func_GameServer_OnWeek)(index, tick)  
 | 
    return  
 | 
  
 | 
## ÊÀ½ç·þÎñÆ÷->ÿÖÜÏìÓ¦(·â°ü²ÎÊý) 01 02 ÐÂÒ»¸öÐÇÆÚµÄÏìÓ¦  
 | 
#  @param index Íæ¼ÒË÷Òý  
 | 
#  @param tick µ±Ç°Ê±¼ä  
 | 
#  @return None  
 | 
#  @remarks º¯ÊýÏêϸ˵Ã÷.  
 | 
def __Func_GameServer_OnWeek(index, tick):  
 | 
    GameWorld.Log("MapServer -> OnWeek!")  
 | 
    #»ñµÃÿÖÜÏìÓ¦·â°ü  
 | 
    pack = IPY_GameWorld.IPY_MOnWeek()  
 | 
    #ͬ²½ÊÀ½ç·þÎñÆ÷ʱ¼ä  
 | 
    SetMapServerTimeFromGameServer(pack.GetTime())  
 | 
      
 | 
    playerManager = GameWorld.GetPlayerManager()  
 | 
    for i in xrange(playerManager.GetPlayerCount()):  
 | 
        curPlayer = playerManager.GetPlayerByIndex(i)  
 | 
          
 | 
        if not curPlayer or curPlayer.IsEmpty():  
 | 
            continue  
 | 
          
 | 
        PlayerOnWeek(curPlayer)  
 | 
          
 | 
    #¸±±¾OnWeekʼþÏìÓ¦  
 | 
    FBLogic.OnWeek(tick)  
 | 
    return  
 | 
  
 | 
def __Func_GameServer_OnWeekEx(tick):  
 | 
    GameWorld.Log("MapServer -> OnWeekEx!")  
 | 
      
 | 
    playerManager = GameWorld.GetPlayerManager()  
 | 
    for i in xrange(playerManager.GetPlayerCount()):  
 | 
        curPlayer = playerManager.GetPlayerByIndex(i)  
 | 
          
 | 
        if not curPlayer or curPlayer.IsEmpty():  
 | 
            continue  
 | 
          
 | 
        PlayerOnWeekEx(curPlayer)  
 | 
          
 | 
    return  
 | 
  
 | 
#---------------------------------------------------------------------  
 | 
#===============================================================================  
 | 
# //01 03 ÐÂÒ»¸öÔµÄÏìÓ¦#tagMOnMonth  
 | 
# tagMOnMonth       *   GettagMOnMonth();  
 | 
#   
 | 
# class   IPY_MOnMonth  
 | 
# {  
 | 
# public:  
 | 
#   
 | 
#    char *      GetTime();  
 | 
# };  
 | 
#===============================================================================  
 | 
  
 | 
## ÊÀ½ç·þÎñÆ÷->ÿÔÂÏìÓ¦(·â°ü²ÎÊý)01 03 ÐÂÒ»¸öÔµÄÏìÓ¦  
 | 
#  @param index Íæ¼ÒË÷Òý  
 | 
#  @param tick µ±Ç°Ê±¼ä  
 | 
#  @return None  
 | 
#  @remarks º¯ÊýÏêϸ˵Ã÷.  
 | 
def GameServer_OnMonth(index, tick):  
 | 
    GameWorld.GetPsycoFunc(__Func_GameServer_OnMonth)(index, tick)  
 | 
    return  
 | 
  
 | 
## ÊÀ½ç·þÎñÆ÷->ÿÔÂÏìÓ¦(·â°ü²ÎÊý)01 03 ÐÂÒ»¸öÔµÄÏìÓ¦  
 | 
#  @param index Íæ¼ÒË÷Òý  
 | 
#  @param tick µ±Ç°Ê±¼ä  
 | 
#  @return None  
 | 
#  @remarks º¯ÊýÏêϸ˵Ã÷.  
 | 
def __Func_GameServer_OnMonth(index, tick):  
 | 
    GameWorld.Log("MapServer -> OnMonth!")  
 | 
    #»ñµÃÿÔÂÏìÓ¦·â°ü  
 | 
    pack = IPY_GameWorld.IPY_MOnMonth()  
 | 
    #ͬ²½ÊÀ½ç·þÎñÆ÷ʱ¼ä  
 | 
    SetMapServerTimeFromGameServer(pack.GetTime())  
 | 
      
 | 
    playerManager = GameWorld.GetPlayerManager()  
 | 
    for i in xrange(playerManager.GetPlayerCount()):  
 | 
        curPlayer = playerManager.GetPlayerByIndex(i)  
 | 
          
 | 
        if not curPlayer or curPlayer.IsEmpty():  
 | 
            continue  
 | 
          
 | 
        PlayerOnMonth(curPlayer)  
 | 
      
 | 
    return  
 | 
  
 | 
def __Func_GameServer_OnMonthEx(tick):  
 | 
    GameWorld.Log("MapServer -> OnMonthEx!")  
 | 
      
 | 
    playerManager = GameWorld.GetPlayerManager()  
 | 
    for i in xrange(playerManager.GetPlayerCount()):  
 | 
        curPlayer = playerManager.GetPlayerByIndex(i)  
 | 
          
 | 
        if not curPlayer or curPlayer.IsEmpty():  
 | 
            continue  
 | 
          
 | 
        PlayerOnMonthEx(curPlayer)  
 | 
          
 | 
    return  
 | 
  
 | 
#---------------------------------------------------------------------  
 | 
#===============================================================================  
 | 
# //01 04 ÐÂÒ»ÄêµÄÏìÓ¦#tagMOnYear  
 | 
# tagMOnYear       *   GettagMOnYear();  
 | 
#   
 | 
# class   IPY_MOnYear  
 | 
# {  
 | 
# public:  
 | 
#   
 | 
#    char *      GetTime();  
 | 
# };  
 | 
#===============================================================================  
 | 
  
 | 
## ÊÀ½ç·þÎñÆ÷->ÿÄêÏìÓ¦(·â°ü²ÎÊý)01 04 ÐÂÒ»ÄêµÄÏìÓ¦  
 | 
#  @param index Íæ¼ÒË÷Òý  
 | 
#  @param tick µ±Ç°Ê±¼ä   
 | 
#  @return None  
 | 
#  @remarks º¯ÊýÏêϸ˵Ã÷.  
 | 
def GameServer_OnYear(index, tick):  
 | 
    GameWorld.GetPsycoFunc(__Func_GameServer_OnYear)(index, tick)  
 | 
    return  
 | 
  
 | 
## ÊÀ½ç·þÎñÆ÷->ÿÄêÏìÓ¦(·â°ü²ÎÊý)01 04 ÐÂÒ»ÄêµÄÏìÓ¦  
 | 
#  @param index Íæ¼ÒË÷Òý  
 | 
#  @param tick µ±Ç°Ê±¼ä   
 | 
#  @return None  
 | 
#  @remarks º¯ÊýÏêϸ˵Ã÷.  
 | 
def __Func_GameServer_OnYear(index, tick):  
 | 
    GameWorld.Log("MapServer -> OnYear")  
 | 
    #»ñµÃÐÂÄêÏìÓ¦·â°ü  
 | 
    pack = IPY_GameWorld.IPY_MOnYear()  
 | 
    #ͬ²½ÊÀ½ç·þÎñÆ÷ʱ¼ä  
 | 
    SetMapServerTimeFromGameServer(pack.GetTime())  
 | 
      
 | 
    playerManager = GameWorld.GetPlayerManager()  
 | 
    for i in range(0, playerManager.GetPlayerCount()):  
 | 
        curPlayer = playerManager.GetPlayerByIndex(i)  
 | 
          
 | 
        if not curPlayer or curPlayer.IsEmpty():  
 | 
            continue  
 | 
          
 | 
        PlayerOnYear(curPlayer)  
 | 
      
 | 
    return  
 | 
#---------------------------------------------------------------------  
 | 
## Í¬²½ÊÀ½ç·þÎñÆ÷ʱ¼ä  
 | 
#  @param time µ±Ç°Ê±¼ä  
 | 
#  @return None  
 | 
#  @remarks º¯ÊýÏêϸ˵Ã÷.  
 | 
def SetMapServerTimeFromGameServer(time):  
 | 
    #GameWorld.Log('--------------%s'%time)  
 | 
    GameWorld.GetGameWorld().SetGameServerEventTime(time)  
 | 
    return  
 | 
#---------------------------------------------------------------------  
 | 
## ÊÀ½ç·þÎñÆ÷³õʼ»¯³É¹¦(·â°ü²ÎÊý)  
 | 
#  @param index Íæ¼ÒË÷Òý  
 | 
#  @param tick µ±Ç°Ê±¼ä   
 | 
#  @return None  
 | 
#  @remarks º¯ÊýÏêϸ˵Ã÷.  
 | 
def GameServer_InitOK(index, tick):  
 | 
    curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)  
 | 
    try:  
 | 
        #֪ͨBServer×Ô¼ºOKÁË  
 | 
        curPlayer.SendToBServerServerInitOK()  
 | 
        ChPlayer.OnAllServerInitOK(curPlayer, tick)  
 | 
    except:  
 | 
        curPlayer.Kick(IPY_GameWorld.disWaitForPlayerLoinError)  
 | 
        import traceback  
 | 
        GameWorld.RaiseException("Íæ¼ÒÉÏÏßÂß¼´íÎó\r\n%s" % traceback.format_exc())  
 | 
    return  
 | 
  
 | 
#--------------------------------------------------------  
 | 
def PlayerOnDay(curPlayer):  
 | 
    #¼ÇÂ¼Íæ¼Ò×ÖµäÖµ,´ý³õʼ»¯ºóÖ´ÐÐ  
 | 
    if not curPlayer.GetGameServerInitOK():  
 | 
        GameServerRefresh.Set_PlayerGameServerInitOK_OnDay(curPlayer , 1)  
 | 
        return  
 | 
      
 | 
    ondayValue = __Get_Can_OnDay(curPlayer)  
 | 
    if not ondayValue:  
 | 
        return  
 | 
    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_OnDay, ondayValue)  
 | 
    playerID = curPlayer.GetPlayerID()  
 | 
    GameWorld.Log("PlayerOnDay! ondayValue=%s" % (ondayValue), playerID)  
 | 
      
 | 
    __DoPlayerOnDay(curPlayer, ShareDefine.Def_OnEventType)  
 | 
      
 | 
    GameWorld.Log("PlayerOnDay OK!", playerID)  
 | 
    return  
 | 
      
 | 
def PlayerOnDayEx(curPlayer):  
 | 
    #¼ÇÂ¼Íæ¼Ò×ÖµäÖµ,´ý³õʼ»¯ºóÖ´ÐÐ  
 | 
    if not curPlayer.GetGameServerInitOK():  
 | 
        GameServerRefresh.Set_PlayerGameServerInitOK_OnDayEx(curPlayer , 1)  
 | 
        return  
 | 
      
 | 
    ondayValue = __Get_Can_OnDayEx(curPlayer)  
 | 
    if not ondayValue:  
 | 
        return  
 | 
    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_OnDayEx, ondayValue)  
 | 
    playerID = curPlayer.GetPlayerID()  
 | 
    GameWorld.Log("PlayerOnDayEx! ondayValue=%s" % (ondayValue), playerID)  
 | 
      
 | 
    __DoPlayerOnDay(curPlayer, ShareDefine.Def_OnEventTypeEx)  
 | 
      
 | 
    GameWorld.Log("PlayerOnDayEx OK!", playerID)  
 | 
    return  
 | 
      
 | 
def __DoPlayerOnDay(curPlayer, onEventType):  
 | 
      
 | 
    if GameWorld.IsCrossServer():  
 | 
        return  
 | 
      
 | 
    # ³£¹æ¹ýÌì  
 | 
    if onEventType == ShareDefine.Def_OnEventType:  
 | 
          
 | 
        #¿ª·þ»î¶¯  
 | 
        OpenServerCampaign.OnOpenServerCampaignDay(curPlayer)  
 | 
          
 | 
        #Çå¿ÕÿÈÕʼþ½±Àø  
 | 
        curPlayer.SetDayProcessGameEventCount(0)  
 | 
          
 | 
        #ÖØÖóèÎïÿÌìµÄѵÁ·´ÎÊý  
 | 
        PlayerPet.DoLogic_PetInfo_OnDay(curPlayer)  
 | 
          
 | 
        PlayerGameWallow.RevertHealthGame_OnDay(curPlayer)  
 | 
          
 | 
        PlayerOnlinePrize.ResetPrizeInfoOnDay(curPlayer)  
 | 
          
 | 
          
 | 
        #OnDayʱÇå³ýÿÈÕÇ©µ½µÄÐÅÏ¢  
 | 
        PlayerSignDay.SignDayOnDay(curPlayer)  
 | 
        # ÀۼƵǽÀñ°üµÇ½´ÎÊýˢР 
 | 
        PlayerLoginDayAward.NotePlayerLoginDayCnt(curPlayer)  
 | 
          
 | 
        #------------------------------------------------------------------------------   
 | 
          
 | 
        PlayerVip.VipOnDay(curPlayer)  
 | 
          
 | 
        PlayerCoin.OnDay(curPlayer)  
 | 
          
 | 
        #³É¾Í  
 | 
        PlayerSuccess.SuccOnDay(curPlayer)  
 | 
          
 | 
        # ÐÂÊÖ¿¨  
 | 
        PlayerNewGuyCard.NewGuyCardOnday(curPlayer)  
 | 
          
 | 
        #Ͷ×Ê  
 | 
        PlayerGoldInvest.OnDay(curPlayer)  
 | 
          
 | 
        #·¨±¦  
 | 
        PlayerMagicWeapon.OnDay(curPlayer)  
 | 
        PlayerGoldGift.OnDay(curPlayer)  
 | 
        #Á¶µ¤  
 | 
        PlayerRefineStove.OnDay(curPlayer)  
 | 
        #°óÓñתÅÌ  
 | 
        PlayerBindJadeWheel.OnDay(curPlayer)  
 | 
        #תÅÌ  
 | 
        PlayerActTurntable.PlayerOnDay(curPlayer)  
 | 
        #ÇéÔµ  
 | 
        PlayerLove.DoPlayerOnDay(curPlayer)  
 | 
        #Íæ·¨Ç°Õ°½±Àø  
 | 
        gameNoticeAwardState = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_GameNoticeAwardState)  
 | 
        if gameNoticeAwardState:  
 | 
            PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_GameNoticeAwardState, 0)  
 | 
            ChPlayer.Sync_RewardGetRecordInfo(curPlayer, ChConfig.Def_RewardType_GameNotice, 0)  
 | 
        #ÿÈÕ·ÖÏí½±ÀøÖØÖà  
 | 
        shareGameAwardState = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ShareGameAwardState)  
 | 
        if shareGameAwardState:  
 | 
            PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ShareGameAwardState, 0)  
 | 
            ChPlayer.Sync_RewardGetRecordInfo(curPlayer, ChConfig.Def_RewardType_ShareGame, 0)  
 | 
    # ÌØÊâʱ¼äµãXµã¹ýÌì  
 | 
    elif onEventType == ShareDefine.Def_OnEventTypeEx:  
 | 
        # ×ÊÔ´ÕÒ»Ø  
 | 
        PlayerRecover.RecoverOnDay(curPlayer)  
 | 
        #´¥·¢Ã¿ÈÕÈÎÎñÖØÖýű¾  
 | 
        EventShell.EventResponse_OnDay(curPlayer)  
 | 
        #¹ºÂò´ÎÊýÇå¿Õ  
 | 
        Operate_PlayerBuyZhenQi.PlayerOnDay(curPlayer)  
 | 
          
 | 
        #ÎÒҪ̫¼«¹ýÌì  
 | 
        PlayerDiceEx.OnDay(curPlayer)  
 | 
        # ÊÀ½çboss  
 | 
        BossHurtMng.OnDay(curPlayer)  
 | 
        # ÏÉÃ˹ýÌì  
 | 
        PlayerFamily.FamilyPlayerOnDay(curPlayer)  
 | 
        # ÖØÖÃÎïÆ·Ã¿ÈÕʹÓôÎÊý  
 | 
        ChItem.ResetItemUseCntToday(curPlayer)  
 | 
        # ¼«Æ·°×Äà  
 | 
        PlayerFreeGoods.OnDay(curPlayer)  
 | 
        #²É¼¯´ÎÊýÖØÖà  
 | 
        NPCCommon.CollNPCTimeOnDay(curPlayer)  
 | 
        #¸±±¾ÖúÕ½  
 | 
        FBHelpBattle.DoPlayerOnDay(curPlayer)  
 | 
        #¿ç·þ¾º¼¼³¡  
 | 
        PlayerCrossRealmPK.DoPlayerOnDay(curPlayer)  
 | 
        #¿ç·þÅÅλ  
 | 
        PlayerCrossChampionship.DoPlayerOnDay(curPlayer)  
 | 
        #¿ç·þÕ½³¡  
 | 
        PlayerCrossBattlefield.DoPlayerOnDay(curPlayer)  
 | 
        #çÎç¿ÏÉÓò  
 | 
        PlayerFairyDomain.OnDay(curPlayer)  
 | 
        #ÏÉÃËÑç»á  
 | 
        GameLogic_FamilyParty.OnDayFamilyPartyPlayer(curPlayer)  
 | 
        #¾º¼¼³¡  
 | 
        PlayerArena.OnDayEx(curPlayer)  
 | 
        #ÐÖú  
 | 
        PlayerAssist.DoPlayerOnDay(curPlayer)  
 | 
        #ÌØÊâʱ¼äµã¹ýÌìµÄ£¬Ò»°ãÊÇÓÎÏ·¹¦ÄÜ£¬´ËʱÁ¢¼´Í¬²½Ò»´Î¿ç·þÍæ¼ÒÊý¾Ý  
 | 
        CrossPlayerData.SendMergePlayerDataNow(curPlayer)  
 | 
          
 | 
    PlayerTJG.TJGOnDay(curPlayer, onEventType)  
 | 
    # ÒÔÏÂΪ֧³ÖÁ½ÖÖÖØÖÃģʽÇл»ÅäÖÃµÄ  
 | 
    FBCommon.FBOnDay(curPlayer, onEventType)  
 | 
      
 | 
    #ÈÕ³£»î¶¯OnDay  
 | 
    PlayerActivity.OnDay(curPlayer, onEventType)  
 | 
          
 | 
    # É̵êÎïÆ·¹ºÂò¶Ò»»OnDay  
 | 
    FunctionNPCCommon.ShopItemOnDay(curPlayer, onEventType)  
 | 
      
 | 
    # ÏÉÃ˺ì°üOnDay  
 | 
    PlayerFamilyRedPacket.RedPacketOnDay(curPlayer, onEventType)  
 | 
    #ÐíÔ¸³Ø  
 | 
    PlayerWishingWell.OnDay(curPlayer)  
 | 
    #ͨÌìÁî  
 | 
    PlayerTongTianLing.OnDay(curPlayer, onEventType)  
 | 
    return  
 | 
  
 | 
  
 | 
### ·þÎñÆ÷Onday´¦ÀíÊý¾Ý£¬¼´²»ÄÜÔÚÍæ¼ÒÉÏÏßʱµÄOnday´¥·¢  
 | 
##  @param curPlayer: µ±Ç°Íæ¼ÒʵÀý  
 | 
##  @return: ÎÞ  
 | 
#def PlayerServerDay(curPlayer):  
 | 
#      
 | 
#    # ÉèÖÃÍæ¼ÒÊÇ·ñ¿ÉÒԲμӼÒ×å»î¶¯  
 | 
#    #PlayerFamily.SetForbidFamilyAction(curPlayer, 0)  
 | 
#    return  
 | 
  
 | 
#---------------------------------------------------------------------  
 | 
## °Ñµ±Ç°ÕâÒ»ÖܵÄÔÚÏßʱ¼äËãµ½ÉÏÒ»ÖÜÈ¥  
 | 
#  @param curPlayer µ±Ç°Íæ¼Ò  
 | 
#  @return None  
 | 
#  @remarks º¯ÊýÏêϸ˵Ã÷.  
 | 
def CalcWeekOnlineTime(curPlayer):  
 | 
    #°Ñµ±Ç°ÕâÒ»ÖܵÄÔÚÏßʱ¼äËãµ½ÉÏÒ»ÖÜÈ¥  
 | 
    curPlayer.SetLastWeekOnlineTime(curPlayer.GetWeekOnlineTime())  
 | 
    #±¾ÖÜÔÚÏßʱ¼äÇå0  
 | 
    curPlayer.SetWeekOnlineTime(0)  
 | 
    return  
 | 
  
 | 
#---------------------------------------------------------------------  
 | 
## ÖØÖÃÍæ¼ÒÿÖÜÐèÒªÖØÖõÄÊý¾Ý  
 | 
#  @param curPlayer µ±Ç°Íæ¼Ò  
 | 
#  @return None  
 | 
#  @remarks º¯ÊýÏêϸ˵Ã÷.  
 | 
def ResetPlayerWeekData(curPlayer):  
 | 
    #ÿÖÜÇå¿ÕÐÒÔËÖµ  
 | 
    #curPlayer.SetLuckValue(0)  
 | 
    return  
 | 
  
 | 
#---------------------------------------------------------------------  
 | 
## ÉèÖüÒ×åµÄ»îÔ¾¶È  
 | 
#  @param curPlayer µ±Ç°Íæ¼Ò  
 | 
#  @return None  
 | 
#  @remarks º¯ÊýÏêϸ˵Ã÷.  
 | 
def CalcFamilyActiveValue(curPlayer):  
 | 
    #LastWeekFamilyActiveValue ¸Ä³É¼Ç¼ÀúÊ·×ܹ±Ï×¶È  
 | 
    #curPlayer.SetLastWeekFamilyActiveValue(curPlayer.GetFamilyActiveValue())  
 | 
    curPlayer.SetFamilyActiveValue(0)  
 | 
    return  
 | 
#---------------------------------------------------------------------  
 | 
## ´¥·¢Íæ¼ÒÿÖÜÏìÓ¦(²ÎÊý -> µ±Ç°Íæ¼Ò)  
 | 
#  @param curPlayer µ±Ç°Íæ¼Ò  
 | 
#  @return None  
 | 
#  @remarks º¯ÊýÏêϸ˵Ã÷.  
 | 
def PlayerOnWeek(curPlayer):  
 | 
    #¼ÇÂ¼Íæ¼Ò×ÖµäÖµ,´ý³õʼ»¯ºóÖ´ÐÐ  
 | 
    if not curPlayer.GetGameServerInitOK():  
 | 
        GameServerRefresh.Set_PlayerGameServerInitOK_OnWeek(curPlayer , 1)  
 | 
        return  
 | 
      
 | 
    onWeekValue = __Get_Can_OnWeek(curPlayer)  
 | 
    if not onWeekValue:  
 | 
        return  
 | 
    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_OnWeek, onWeekValue)  
 | 
    playerID = curPlayer.GetPlayerID()  
 | 
    GameWorld.Log("PlayerOnWeek! onWeekValue=%s" % (onWeekValue), playerID)  
 | 
      
 | 
    __DoPlayerOnWeek(curPlayer, ShareDefine.Def_OnEventType)  
 | 
      
 | 
    GameWorld.Log("PlayerOnWeek OK!", playerID)  
 | 
    return  
 | 
  
 | 
def PlayerOnWeekEx(curPlayer):  
 | 
    #¼ÇÂ¼Íæ¼Ò×ÖµäÖµ,´ý³õʼ»¯ºóÖ´ÐÐ  
 | 
    if not curPlayer.GetGameServerInitOK():  
 | 
        GameServerRefresh.Set_PlayerGameServerInitOK_OnWeekEx(curPlayer , 1)  
 | 
        return  
 | 
      
 | 
    onWeekValue = __Get_Can_OnWeekEx(curPlayer)  
 | 
    if not onWeekValue:  
 | 
        return  
 | 
    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_OnWeekEx, onWeekValue)  
 | 
    playerID = curPlayer.GetPlayerID()  
 | 
    GameWorld.Log("PlayerOnWeekEx! onWeekValue=%s" % (onWeekValue), playerID)  
 | 
      
 | 
    __DoPlayerOnWeek(curPlayer, ShareDefine.Def_OnEventTypeEx)  
 | 
      
 | 
    GameWorld.Log("PlayerOnWeekEx OK!", playerID)  
 | 
    return  
 | 
  
 | 
def __DoPlayerOnWeek(curPlayer, onEventType):  
 | 
      
 | 
    if GameWorld.IsCrossServer():  
 | 
        return  
 | 
      
 | 
    if onEventType == ShareDefine.Def_OnEventType:  
 | 
        #¼Ç¼ÉÏÖܹ¤×ÊÏà¹ØÁ÷Ïò  
 | 
        lastWeekOnlineTime = curPlayer.GetLastWeekOnlineTime()  
 | 
        lastWeekFamilyValue = curPlayer.GetLastWeekFamilyActiveValue()  
 | 
          
 | 
        #ÐèÒªÔÚÒ»Öܵ½À´µÄʱºòÖØÖÃÍæ¼ÒÊý¾ÝµÄ²Ù×÷¶¼¿ÉÒԷŵ½º¯ÊýÀïÃæ  
 | 
        ResetPlayerWeekData(curPlayer)  
 | 
          
 | 
        #¼ÆËãÕâÒ»ÖܵÄÔÚÏßʱ¼ä  
 | 
        CalcWeekOnlineTime(curPlayer)  
 | 
          
 | 
        #¼ÆËãÕâÒ»ÖܵļÒ×åµÄ»îÔ¾¶È  
 | 
        CalcFamilyActiveValue(curPlayer)  
 | 
        #³É¾ÍOnweek  
 | 
        PlayerSuccess.OnWeek(curPlayer)  
 | 
          
 | 
        # Ã¿ÖÜÌáÊ¾Íæ¼ÒÌáʾvipµÈ¼¶¼ÓÈë¹ó±ö¾ãÀÖ²¿  
 | 
        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_HasVIPClubNote, 0)  
 | 
          
 | 
    elif onEventType == ShareDefine.Def_OnEventTypeEx:  
 | 
        #´¥·¢Ã¿ÖÜÈÎÎñÖØÖýű¾  
 | 
        EventShell.EventResponse_OnWeek(curPlayer)  
 | 
        #¾º¼¼³¡  
 | 
        PlayerArena.OnWeekEx(curPlayer)  
 | 
        PlayerFamily.OnWeekEx(curPlayer)  
 | 
        PlayerCrossBattlefield.DoPlayerOnWeek(curPlayer)  
 | 
          
 | 
    # ÒÔÏÂΪ֧³ÖÁ½ÖÖÖØÖÃģʽÇл»ÅäÖÃµÄ  
 | 
    FBCommon.FBOnWeek(curPlayer, onEventType)  
 | 
      
 | 
    #ÈÕ³£»î¶¯OnWeek  
 | 
    PlayerActivity.OnWeek(curPlayer, onEventType)  
 | 
      
 | 
    # É̵êÎïÆ·¹ºÂò¶Ò»»OnDay  
 | 
    FunctionNPCCommon.ShopItemOnWeek(curPlayer, onEventType)  
 | 
    return  
 | 
  
 | 
#---------------------------------------------------------------------  
 | 
## ´¥·¢Íæ¼ÒÿÔÂÏìÓ¦(²ÎÊý -> µ±Ç°Íæ¼Ò)  
 | 
#  @param curPlayer µ±Ç°Íæ¼Ò  
 | 
#  @return None  
 | 
#  @remarks º¯ÊýÏêϸ˵Ã÷.  
 | 
def PlayerOnMonth(curPlayer):  
 | 
    #¼ÇÂ¼Íæ¼Ò×ÖµäÖµ,´ý³õʼ»¯ºóÖ´ÐÐ  
 | 
    if not curPlayer.GetGameServerInitOK():  
 | 
        GameServerRefresh.Set_PlayerGameServerInitOK_OnMonth(curPlayer , 1)  
 | 
        return  
 | 
      
 | 
    onMonthValue = __Get_Can_OnMonth(curPlayer)  
 | 
    if not onMonthValue:  
 | 
        return  
 | 
    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_OnMonth, onMonthValue)  
 | 
    playerID = curPlayer.GetPlayerID()  
 | 
    GameWorld.Log("PlayerOnMonth! onMonthValue=%s" % (onMonthValue), playerID)  
 | 
      
 | 
    __DoPlayerOnMonth(curPlayer, ShareDefine.Def_OnEventType)  
 | 
      
 | 
    GameWorld.Log("PlayerOnMonth OK!", playerID)  
 | 
    return  
 | 
  
 | 
def PlayerOnMonthEx(curPlayer):  
 | 
    #¼ÇÂ¼Íæ¼Ò×ÖµäÖµ,´ý³õʼ»¯ºóÖ´ÐÐ  
 | 
    if not curPlayer.GetGameServerInitOK():  
 | 
        GameServerRefresh.Set_PlayerGameServerInitOK_OnMonthEx(curPlayer , 1)  
 | 
        return  
 | 
      
 | 
    onMonthValue = __Get_Can_OnMonthEx(curPlayer)  
 | 
    if not onMonthValue:  
 | 
        return  
 | 
    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_OnMonthEx, onMonthValue)  
 | 
    playerID = curPlayer.GetPlayerID()  
 | 
    GameWorld.Log("PlayerOnMonthEx! onMonthValue=%s" % (onMonthValue), playerID)  
 | 
      
 | 
    __DoPlayerOnMonth(curPlayer, ShareDefine.Def_OnEventTypeEx)  
 | 
      
 | 
    GameWorld.Log("PlayerOnMonthEx OK!", playerID)  
 | 
    return  
 | 
  
 | 
def __DoPlayerOnMonth(curPlayer, onEventType):  
 | 
      
 | 
    if GameWorld.IsCrossServer():  
 | 
        return  
 | 
      
 | 
    if onEventType == ShareDefine.Def_OnEventType:  
 | 
        pass  
 | 
        #Ç©µ½  
 | 
        #PlayerSignDay.SignDayOnMonth(curPlayer)  
 | 
          
 | 
    elif onEventType == ShareDefine.Def_OnEventTypeEx:  
 | 
        pass  
 | 
        #OnMonthEx  
 | 
          
 | 
    # É̵êÎïÆ·¹ºÂò¶Ò»»OnMonth  
 | 
    FunctionNPCCommon.ShopItemOnMonth(curPlayer, onEventType)  
 | 
    return  
 | 
  
 | 
#---------------------------------------------------------------------  
 | 
## ´¥·¢Íæ¼ÒÿÄêÏìÓ¦(²ÎÊý -> µ±Ç°Íæ¼Ò)  
 | 
#  @param curPlayer µ±Ç°Íæ¼Ò  
 | 
#  @return None  
 | 
#  @remarks º¯ÊýÏêϸ˵Ã÷.  
 | 
def PlayerOnYear(curPlayer):  
 | 
    #¼ÇÂ¼Íæ¼Ò×ÖµäÖµ,´ý³õʼ»¯ºóÖ´ÐÐ  
 | 
    if not curPlayer.GetGameServerInitOK():  
 | 
        GameServerRefresh.Set_PlayerGameServerInitOK_OnYear(curPlayer , 1)  
 | 
        return  
 | 
      
 | 
    curPlayerID = curPlayer.GetPlayerID()  
 | 
      
 | 
    if not __Get_Can_OnYear(curPlayer):  
 | 
        #GameWorld.Log("Cancel_PlayerOnYear!" , curPlayerID)  
 | 
        return  
 | 
      
 | 
    GameWorld.Log("PlayerOnYear!" , curPlayerID)  
 | 
      
 | 
    #¼Ç¼  
 | 
    curDateTime = GameWorld.GetCurrentTime()  
 | 
    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_OnYear, curDateTime.year)  
 | 
    #-------------------------------------------------  
 | 
    return  
 | 
#---------------------------------------------------------------------  
 | 
## ´¥·¢Íæ¼ÒÿСʱÏìÓ¦(²ÎÊý -> µ±Ç°Íæ¼Ò)  
 | 
#  @param curPlayer µ±Ç°Íæ¼Ò  
 | 
#  @return None  
 | 
#  @remarks º¯ÊýÏêϸ˵Ã÷.  
 | 
def PlayerOnHour(curPlayer):  
 | 
    #¼ÇÂ¼Íæ¼Ò×ÖµäÖµ,´ý³õʼ»¯ºóÖ´ÐÐ  
 | 
    if not curPlayer.GetGameServerInitOK():  
 | 
        GameServerRefresh.Set_PlayerGameServerInitOK_OnHour(curPlayer , 1)  
 | 
        return  
 | 
      
 | 
    curPlayerID = curPlayer.GetPlayerID()  
 | 
      
 | 
    if not __Get_Can_OnHour(curPlayer):  
 | 
        #GameWorld.Log("Cancel_PlayerOnHour!" , curPlayerID)  
 | 
        return  
 | 
      
 | 
    GameWorld.Log("PlayerOnHour!" , curPlayerID)  
 | 
      
 | 
    tick = GameWorld.GetGameWorld().GetTick()  
 | 
    #PlayerVip.CalcVIPTimeByTick(curPlayer, tick)  
 | 
      
 | 
    #¼Ç¼  
 | 
    curDateTime = GameWorld.GetCurrentTime()  
 | 
    curHour = curDateTime.hour  
 | 
    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_OnHour, curHour)  
 | 
    #---------------------------------------  
 | 
    #ÿÌì1µãÉêÇë²éѯ  
 | 
    if curHour == 1:  
 | 
        #´ÓÊý¾Ý¿âÖвéѯµ±Ç°ÅÅÐаñµÈ¼¶  
 | 
        curPlayer.DataServer_GetBillboardLV()  
 | 
      
 | 
      
 | 
    #´¥·¢Ã¿Ð¡Ê±ÈÎÎñÖØÖýű¾  
 | 
    EventShell.EventResponse_OnHour(curPlayer)  
 | 
    #çÎç¿ÏÉÓò  
 | 
    PlayerFairyDomain.OnHour(curPlayer)  
 | 
    return  
 | 
      
 | 
#---------------------------------------------------------------------  
 | 
#===============================================================================  
 | 
# //01 09 ËùÓеØÍ¼·þÎñÆ÷³õʼ»¯³É¹¦#tagMOnAllMapServerInitOK  
 | 
# tagMOnAllMapServerInitOK       *   GettagMOnAllMapServerInitOK();  
 | 
#   
 | 
# class   IPY_MOnAllMapServerInitOK  
 | 
# {  
 | 
# public:  
 | 
#    //µ±Ç°Ê±¼ä  
 | 
#    char *      GetTime();  
 | 
# };  
 | 
#===============================================================================  
 | 
## GameServer֪ͨMapServerËùÓеØÍ¼·þÎñÆ÷³õʼ»¯³É¹¦  
 | 
#  @param index µØÍ¼Ë÷Òý  
 | 
#  @param tick  µ±Ç°Ê±¼ä  
 | 
#  @return None  
 | 
#  @remarks µ±Ò»¸öµØÍ¼·þÎñÆ÷ÖØÆô»òÕßËùÓзþÎñÆ÷¿ªÆô³É¹¦Ê±µ÷Óà  
 | 
def GameServer_OnAllMapServerInitOK(index , tick):  
 | 
    pack = IPY_GameWorld.IPY_MOnAllMapServerInitOK()  
 | 
    #ͬ²½ÊÀ½ç·þÎñÆ÷ʱ¼ä  
 | 
    SetMapServerTimeFromGameServer(pack.GetTime())  
 | 
    #¿ª·þ¼ì²éÖØÉúµãÐÅÏ¢  
 | 
    __DoLogic_OpenMapCheckRebornPoint()  
 | 
    #¿ª·þ¼ì²éÈÎÎñÊý  
 | 
    __DoLogic_OpenMapCheckMissionCount()  
 | 
    #×¢²á¼¶Áª¼ÆÊ±Æ÷  
 | 
    #GameWorldProcess.RegLvTimer(tick)  
 | 
    return  
 | 
  
 | 
#---------------------------------------------------------------------  
 | 
##¼ì²éÈÎÎñÊýÁ¿  
 | 
# @param ÎÞ  
 | 
# @return None  
 | 
# @remarks ¿ª·þÑéÖ¤ÈÎÎñÊý  
 | 
def __DoLogic_OpenMapCheckMissionCount():  
 | 
    #½öÔÚDebug°æ±¾ÑéÖ¤  
 | 
    if not GameWorld.GetGameWorld().GetDebugLevel():  
 | 
        return  
 | 
      
 | 
    #»ñÈ¡ÈÎÎñ×Ü±í  
 | 
    allMissionDict = ReadChConfig.GetEvalChConfig('MissionAcceptMapID')  
 | 
    #»ñÈ¡ÈÎÎñÊýÁ¿ÏÞÖÆ±í  
 | 
    missionCntList = ReadChConfig.GetEvalChConfig('MissionMaxCount')  
 | 
    #[×ÜÊý, È«ÇøÈ«·þÈÎÎñÊý]  
 | 
    totalAcceptMissionCnt, allMapAcceptMissionCnt = missionCntList  
 | 
      
 | 
    #µ±Ç°ÈÎÎñ×ÜÊý  
 | 
    allMissionCnt = len(allMissionDict)  
 | 
      
 | 
    #---ÑéÖ¤ÈÎÎñÊý---  
 | 
    if allMissionCnt > totalAcceptMissionCnt:  
 | 
        GameWorld.ErrLog('ÈÎÎñ×ÜÊý³¬±ê, maxCnt = %s, curCnt = %s'%(totalAcceptMissionCnt, allMissionCnt))  
 | 
        raise BaseException('ÈÎÎñ×ÜÊý³¬±ê, maxCnt = %s, curCnt = %s'%(totalAcceptMissionCnt, allMissionCnt))  
 | 
        return  
 | 
      
 | 
    #---ÑéÖ¤È«ÇøÈ«·þÈÎÎñÊý---  
 | 
    allMapMissionCnt = 0  
 | 
      
 | 
    for value in allMissionDict.values():  
 | 
        if -1 not in value:  
 | 
            continue  
 | 
          
 | 
        allMapMissionCnt += 1  
 | 
      
 | 
    if allMapMissionCnt > allMapAcceptMissionCnt:  
 | 
        GameWorld.ErrLog('È«ÇøÈ«·þÈÎÎñ×ÜÊý³¬±ê, maxCnt = %s, curCnt = %s'%(allMapAcceptMissionCnt, allMapMissionCnt))  
 | 
        raise BaseException('È«ÇøÈ«·þÈÎÎñ×ÜÊý³¬±ê, maxCnt = %s, curCnt = %s'%(allMapAcceptMissionCnt, allMapMissionCnt))  
 | 
        return  
 | 
      
 | 
    GameWorld.Log('ÑéÖ¤ÈÎÎñÊýÍê±Ï, cnt = %s, maxCnt = %s, allMapCnt = %s, maxAllMapCnt = %s'%(allMissionCnt, totalAcceptMissionCnt, allMapMissionCnt, allMapAcceptMissionCnt))  
 | 
    return  
 | 
#---------------------------------------------------------------------  
 | 
## ¼ì²éÖØÉúµãÐÅÏ¢  
 | 
#  @param ÎÞ  
 | 
#  @return None  
 | 
#  @remarks ¿ª·þÑéÖ¤ÖØÉúµãÐÅÏ¢  
 | 
def __DoLogic_OpenMapCheckRebornPoint():  
 | 
    #½öÔÚDebug°æ±¾ÑéÖ¤  
 | 
    if not GameWorld.GetGameWorld().IsTrueDebug():  
 | 
        return  
 | 
      
 | 
    gameData = GameWorld.GetGameData()  
 | 
    br_Count = gameData.GetBornRefreshCount()  
 | 
    mapManager = GameWorld.GetMap()  
 | 
    mapID = mapManager.GetMapID()  
 | 
      
 | 
    for index in range(0, br_Count):  
 | 
        br_Point = gameData.GetBornRefreshByIndex(index)  
 | 
        br_PointPosX = br_Point.GetPosX()  
 | 
        br_PointPosY = br_Point.GetPosY()  
 | 
        br_Round = br_Point.GetRound()  
 | 
          
 | 
        for checkPosX in range(br_PointPosX - br_Round, br_PointPosX + br_Round + 1):  
 | 
            for checkPosY in range(br_PointPosY - br_Round, br_PointPosY + br_Round + 1):  
 | 
                #¼ì²éͨ¹ý  
 | 
                if mapManager.IsValidPos(checkPosX, checkPosY):  
 | 
                    continue  
 | 
                  
 | 
                GameWorld.ErrLog('µØÍ¼ID = %s ÖØÉúµã×ø±ê²»ºÏ·¨, index = %s, br_PointPosX = %s, br_PointPosY = %s, br_Round = %s, checkPosX = %s, checkPosY = %s '%(mapID, index, br_PointPosX, br_PointPosY, br_Round, checkPosX, checkPosY))  
 | 
                raise BaseException('µØÍ¼ID = %s ÖØÉúµã×ø±ê²»ºÏ·¨, index = %s, br_PointPosX = %s, br_PointPosY = %s, br_Round = %s, checkPosX = %s, checkPosY = %s '%(mapID, index, br_PointPosX, br_PointPosY, br_Round, checkPosX, checkPosY))  
 | 
      
 | 
    GameWorld.Log('ÑéÖ¤ÖØÉúµãÍê±Ï, mapID = %s, cnt = %s'%(mapID, br_Count))  
 | 
    return  
 | 
#---------------------------------------------------------------------  
 | 
## ¸üÐÂÍæ¼ÒÔÚÏßʱ¼ä(²ÎÊý -> µ±Ç°Íæ¼Ò)  
 | 
#  @param curPlayer µ±Ç°Íæ¼Ò  
 | 
#  @return None  
 | 
#  @remarks º¯ÊýÏêϸ˵Ã÷.  
 | 
def UpdatePlayerLoginTime(curPlayer):  
 | 
    lastLoginTimeStr = curPlayer.GetLogoffTime()  
 | 
    lastLoginTimeStr = lastLoginTimeStr.strip()  
 | 
    curTimeStr = GameWorld.GetCurrentDataTimeStr()  
 | 
      
 | 
    if lastLoginTimeStr == "" or lastLoginTimeStr == '0':  
 | 
        curPlayer.SetLogoffTime(curTimeStr)  
 | 
      
 | 
    #OnHourʼþ  
 | 
    if __Get_Can_OnHour(curPlayer):  
 | 
        PlayerOnHour(curPlayer)  
 | 
      
 | 
    #OnDayʼþ  
 | 
    if __Get_Can_OnDay(curPlayer):  
 | 
        PlayerOnDay(curPlayer)  
 | 
          
 | 
    #OnDayExʼþ  
 | 
    if __Get_Can_OnDayEx(curPlayer):  
 | 
        PlayerOnDayEx(curPlayer)  
 | 
          
 | 
    #OnWeekʼþ  
 | 
    if __Get_Can_OnWeek(curPlayer):  
 | 
        PlayerOnWeek(curPlayer)  
 | 
          
 | 
    #OnWeekExʼþ  
 | 
    if __Get_Can_OnWeekEx(curPlayer):  
 | 
        PlayerOnWeekEx(curPlayer)  
 | 
          
 | 
    #OnMonthʼþ  
 | 
    if __Get_Can_OnMonth(curPlayer):  
 | 
        PlayerOnMonth(curPlayer)  
 | 
          
 | 
    #OnMonthExʼþ  
 | 
    if __Get_Can_OnMonthEx(curPlayer):  
 | 
        PlayerOnMonthEx(curPlayer)  
 | 
          
 | 
    #OnYearʼþ  
 | 
    if __Get_Can_OnYear(curPlayer):  
 | 
        PlayerOnYear(curPlayer)  
 | 
    return  
 | 
  
 | 
  
 | 
## ¼ì²éÍæ¼ÒÊÇ·ñ¿ÉÒÔOnHour  
 | 
#  @param curPlayer µ±Ç°Íæ¼Ò  
 | 
#  @param curMission µ±Ç°ÈÎÎñ  
 | 
#  @return None  
 | 
#  @remarks º¯ÊýÏêϸ˵Ã÷.  
 | 
def __Get_Can_OnHour(curPlayer):  
 | 
    #»ñȡϵͳÊý¾Ý  
 | 
    curDateTime = GameWorld.GetCurrentTime()  
 | 
    dateTime_Hour = curDateTime.hour  
 | 
    dateTime_Day = curDateTime.day  
 | 
    dateTime_Month = curDateTime.month  
 | 
    dateTime_Year = curDateTime.year  
 | 
    #»ñÈ¡Íæ¼ÒÊý¾Ý  
 | 
    player_Hour = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_OnHour)  
 | 
    player_Day = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_OnDay)  
 | 
    player_Month = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_OnMonth)  
 | 
    player_Year = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_OnYear)  
 | 
      
 | 
    return (dateTime_Hour != player_Hour or dateTime_Day != player_Day or dateTime_Month != player_Month or dateTime_Year != player_Year)  
 | 
  
 | 
  
 | 
## ¼ì²éÍæ¼ÒÊÇ·ñ¿ÉÒÔOnDay  
 | 
#  @param curPlayer µ±Ç°Íæ¼Ò  
 | 
#  @param curMission µ±Ç°ÈÎÎñ  
 | 
#  @return None  
 | 
#  @remarks º¯ÊýÏêϸ˵Ã÷.  
 | 
def __Get_Can_OnDay(curPlayer):  
 | 
    #»ñȡϵͳÊý¾Ý  
 | 
    curDateTime = GameWorld.GetCurrentTime()  
 | 
    dateTime_Day = curDateTime.day  
 | 
    dateTime_Month = curDateTime.month  
 | 
    dateTime_Year = curDateTime.year  
 | 
    #»ñÈ¡Íæ¼ÒÊý¾Ý  
 | 
    player_Day = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_OnDay)  
 | 
    player_Month = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_OnMonth)  
 | 
    player_Year = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_OnYear)  
 | 
      
 | 
    if (dateTime_Day != player_Day or dateTime_Month != player_Month or dateTime_Year != player_Year):  
 | 
        return dateTime_Day  
 | 
    return 0  
 | 
  
 | 
def __Get_Can_OnDayEx(curPlayer):  
 | 
    '''ÅжϿɷñÁ賿Xµã¹ýÌì  
 | 
    @return: 0-²»¿É£» >0-¿ÉÒÔ, ÇÒ´ú±íµÄÊǹýÌìÐè¼Ç¼µÄÖµ  
 | 
    '''  
 | 
    curDateTime = GameWorld.GetCurrentTime()  
 | 
      
 | 
    # ÉϴιýÌì¼Ç¼¸ñʽ: ÄêÔÂÈÕ, Èç20171027  
 | 
    lastOndayEx = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_OnDayEx)  
 | 
    #GameWorld.DebugLog("__Get_Can_OnDayEx lastOndayEx=%s" % (lastOndayEx))  
 | 
    if lastOndayEx:  
 | 
        lastOndayEx_Year = lastOndayEx / 10000  
 | 
        lastOndayEx_Month = lastOndayEx % 10000 / 100  
 | 
        lastOndayEx_Day = lastOndayEx % 100  
 | 
        #GameWorld.DebugLog("lastOndayEx_Year=%s,lastOndayEx_Month=%s,lastOndayEx_Day=%s" % (lastOndayEx_Year, lastOndayEx_Month, lastOndayEx_Day))  
 | 
          
 | 
        # ÉϴιýÌìµÄÈÕÆÚ0µã  
 | 
        lastDatetime = datetime.datetime(lastOndayEx_Year, lastOndayEx_Month, lastOndayEx_Day, 0, 0, 0)  
 | 
        passTime = curDateTime - lastDatetime  
 | 
        passDays = passTime.days  
 | 
        passSeconds = passTime.seconds  
 | 
          
 | 
        # Èç¹ûʱ¼ä²îûÓг¬¹ý1Ì죬´ú±í»¹Î´¹ýÌì  
 | 
        if passDays == 0:  
 | 
            #GameWorld.DebugLog("Èç¹ûʱ¼ä²îûÓг¬¹ý1Ì죬´ú±í»¹Î´¹ýÌì, passDays=%s" % passDays)  
 | 
            return 0  
 | 
        # µÈÓÚ1ÌìµÄ, Ê±¼ä²îÐè >= Xʱ²Å¿É¹ýÌì, ¼´ X * 3600 Ãë  
 | 
        if passDays == 1 and passSeconds < ShareDefine.Def_OnEventHour * 3600:  
 | 
            #GameWorld.DebugLog("µÈÓÚ1ÌìµÄ, Ê±¼ä²îÐè >= Xʱ²Å¿É¹ýÌì, ¼´ X * 3600 Ãë, passSeconds=%s" % passSeconds)  
 | 
            return 0  
 | 
        #if passDays < 0:  
 | 
        #    GameWorld.DebugLog("ʱ¼äÌì²îСÓÚ0£¬Ò»°ãΪÒì³£Çé¿ö£¬Ö»ÓÐʱ¼äÍù»Øµ÷²Å»Ø³öÏÖ!ĬÈÏÔÊÐí¹ýÌì,passDays=%s" % passDays)  
 | 
        # ´óÓÚ1ÌìµÄÎÞÂÛʲôʱ¼äµã¶¼¿ÉÒÔ¹ýÌì  
 | 
          
 | 
    if curDateTime.hour < ShareDefine.Def_OnEventHour:  
 | 
        curDateTime = curDateTime - datetime.timedelta(days=1)  
 | 
        #GameWorld.Log("OnDayEx ÌØÊâXµã֮ǰ¹ýÌìµÄ£¬´ú±íÌì²î´óÓÚ1ÌìµÄʱ¼ä¹ýÌ죬ÕâʱºòµÄ¹ýÌìÖµÐèÉèÖÃΪ×òÌì %s" % curDateTime)  
 | 
          
 | 
    dateTime_Day = curDateTime.day  
 | 
    dateTime_Month = curDateTime.month  
 | 
    dateTime_Year = curDateTime.year  
 | 
    #GameWorld.DebugLog("¿ÉÒÔ¹ýÌì")  
 | 
    return dateTime_Year * 10000 + dateTime_Month * 100 + dateTime_Day  
 | 
  
 | 
## ¼ì²éÍæ¼ÒÊÇ·ñ¿ÉÒÔOnWeek  
 | 
#  @param curPlayer µ±Ç°Íæ¼Ò  
 | 
#  @param curMission µ±Ç°ÈÎÎñ  
 | 
#  @return None  
 | 
#  @remarks º¯ÊýÏêϸ˵Ã÷.  
 | 
def __Get_Can_OnWeek(curPlayer):  
 | 
    #»ñȡϵͳÊý¾Ý  
 | 
    curDateTime = GameWorld.GetCurrentTime()  
 | 
    dateTime_Week = datetime.datetime.isocalendar(curDateTime)[1]  
 | 
    #»ñÈ¡Íæ¼ÒÊý¾Ý  
 | 
    player_Week = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_OnWeek)  
 | 
    #²»¿¼ÂǸôÄêÇé¿ö£¬Èç2009,12,31ÈÕÏÂÏß->2010,12,31ÈÕÉÏÏß(²»´¥·¢OnWeek)  
 | 
    if (dateTime_Week != player_Week):  
 | 
        return dateTime_Week  
 | 
    return 0  
 | 
  
 | 
def __Get_Can_OnWeekEx(curPlayer):  
 | 
    '''ÅжϿɷñÁ賿Xµã¹ýÖÜ  
 | 
    @return: 0-²»¿É£» >0-¿ÉÒÔ, ÇÒ´ú±íµÄÊǹýÖÜÐè¼Ç¼µÄÖµ  
 | 
    '''  
 | 
    curDateTime = GameWorld.GetCurrentTime()  
 | 
    isocalendar = datetime.datetime.isocalendar(curDateTime)  
 | 
    dateTime_year, dateTime_week, dateTime_day = isocalendar  
 | 
      
 | 
    # ÉϴιýÖܼǼ¸ñʽ: ÄêÖÜ, Èç201752  
 | 
    lastOnWeekEx = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_OnWeekEx)  
 | 
    #GameWorld.DebugLog("__Get_Can_OnWeekEx lastOnWeekEx=%s,dateTime_year=%s,week=%s,day=%s"   
 | 
    #                   % (lastOnWeekEx, dateTime_year, dateTime_week, dateTime_day))  
 | 
    if lastOnWeekEx:  
 | 
        lastOnWeekEx_Year = lastOnWeekEx / 100  
 | 
        lastOnWeekEx_Week = lastOnWeekEx % 100  
 | 
        # ±¾ÖÜÒѾ¹ýÖܹý  
 | 
        if dateTime_year == lastOnWeekEx_Year and dateTime_week == lastOnWeekEx_Week:  
 | 
            #GameWorld.DebugLog("±¾ÖÜÒѾ¹ýÖܹý")  
 | 
            return 0  
 | 
          
 | 
        # µ±Ç°ÌìΪÿÖܵÚÒ»ÌìµÄʱºò£¬ÐèÅжÏÖܲîΪ1ʱµ±Ç°Ê±¼äµãÊÇ·ñ³¬¹ý5µã  
 | 
        if dateTime_day == 1:  
 | 
            preWeekDateTime = curDateTime - datetime.timedelta(days=7) # ÉÏÒ»ÖܵÄdatetime(¼´ÖܲîΪ1)  
 | 
            preWeek_year, preWeek_week, preWeek_day = datetime.datetime.isocalendar(preWeekDateTime)  
 | 
              
 | 
            # ÉϴιýÖܵĸպÃÊÇÖܲî1, ÔòÐèÅжϵ±Ç°Ê±¼äµãÊÇ·ñ³¬¹ýXʱ  
 | 
            if preWeek_year == lastOnWeekEx_Year and preWeek_week == lastOnWeekEx_Week:  
 | 
                if curDateTime.hour < ShareDefine.Def_OnEventHour:  
 | 
                    #GameWorld.DebugLog("±¾ÖܵÚÒ»Ì죬δµ½´ï¹ýÖÜʱ¼äµã, hour=%s" % curDateTime.hour)  
 | 
                    return 0  
 | 
                  
 | 
            # ÖܲΪ1µÄʱºò£¬ÔòÎÞÂÛʲôʱ¼äµã¾ù¿É¹ýÖÜ  
 | 
            else:  
 | 
                #GameWorld.DebugLog("ÖܲΪ1µÄʱºò£¬ÔòÎÞÂÛʲôʱ¼äµã¾ù¿É¹ýÖÜ, ¿ÉÒÔ¹ýÖÜ")  
 | 
                pass  
 | 
              
 | 
        # ²»ÊÇÿÖܵÚÒ»ÌìµÄʱºò£¬ÔòÎÞÂÛʲôʱ¼äµã¾ù¿É¹ýÖÜ  
 | 
        else:  
 | 
            #GameWorld.DebugLog("²»ÊÇÿÖܵÚÒ»ÌìµÄʱºò£¬ÔòÎÞÂÛʲôʱ¼äµã¾ù¿É¹ýÖÜ, ¿ÉÒÔ¹ýÖÜ")  
 | 
            pass  
 | 
          
 | 
    if dateTime_day == 1 and curDateTime.hour < ShareDefine.Def_OnEventHour:  
 | 
        onWeekDateTime = curDateTime - datetime.timedelta(days=7) # ÉÏÒ»ÖܵÄdatetime(¼´ÖܲîΪ1)  
 | 
        dateTime_year, dateTime_week, dateTime_day = datetime.datetime.isocalendar(onWeekDateTime)  
 | 
        #GameWorld.Log("OnWeekEx ÖÜÒ»ÌØÊâXµã֮ǰ¹ýÌìµÄ£¬´ú±íÖܲî´óÓÚ1ÌìµÄÖÜÒ»¹ýÖÜ£¬ÕâʱºòµÄ¹ýÖÜÖµÐèÉèÖÃΪÉÏÖÜ %s" % onWeekDateTime)  
 | 
          
 | 
    #GameWorld.DebugLog("¿ÉÒÔ¹ýÖÜ")  
 | 
    return dateTime_year * 100 + dateTime_week  
 | 
  
 | 
## ¼ì²éÍæ¼ÒÊÇ·ñ¿ÉÒÔOnMonth  
 | 
#  @param curPlayer µ±Ç°Íæ¼Ò  
 | 
#  @param curMission µ±Ç°ÈÎÎñ  
 | 
#  @return None  
 | 
#  @remarks º¯ÊýÏêϸ˵Ã÷.  
 | 
def __Get_Can_OnMonth(curPlayer):  
 | 
    #»ñȡϵͳÊý¾Ý  
 | 
    curDateTime = GameWorld.GetCurrentTime()  
 | 
    dateTime_Month = curDateTime.month  
 | 
    dateTime_Year = curDateTime.year  
 | 
    #»ñÈ¡Íæ¼ÒÊý¾Ý  
 | 
    player_Month = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_OnMonth)  
 | 
    player_Year = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_OnYear)  
 | 
    if (dateTime_Month != player_Month or dateTime_Year != player_Year):  
 | 
        return dateTime_Month  
 | 
    return 0  
 | 
  
 | 
def __Get_Can_OnMonthEx(curPlayer):  
 | 
    '''ÅжϿɷñÁ賿Xµã¹ýÔ  
 | 
    @return: 0-²»¿É£» >0-¿ÉÒÔ, ÇÒ´ú±íµÄÊǹýÔÂÐè¼Ç¼µÄÖµ  
 | 
    '''  
 | 
    curDateTime = GameWorld.GetCurrentTime()  
 | 
    dateTime_day = curDateTime.day  
 | 
    dateTime_month = curDateTime.month  
 | 
    dateTime_year = curDateTime.year  
 | 
      
 | 
    # ÉϴιýԼǼ¸ñʽ: ÄêÔÂ, Èç201712  
 | 
    lastOnMonthEx = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_OnMonthEx)  
 | 
    #GameWorld.DebugLog("__Get_Can_OnMonthEx lastOnMonthEx=%s,dateTime_year=%s,dateTime_month=%s"   
 | 
    #                   % (lastOnMonthEx, dateTime_year, dateTime_month))  
 | 
    if lastOnMonthEx:  
 | 
        lastOnMonthEx_Year = lastOnMonthEx / 100  
 | 
        lastOnMonthEx_Month = lastOnMonthEx % 100  
 | 
        # ±¾ÔÂÒѾ¹ýÔ¹ý  
 | 
        if dateTime_year == lastOnMonthEx_Year and dateTime_month == lastOnMonthEx_Month:  
 | 
            #GameWorld.DebugLog("±¾ÔÂÒѾ¹ýÔ¹ý")  
 | 
            return 0  
 | 
          
 | 
        # µ±Ç°ÌìΪÿÔµÚÒ»ÌìµÄʱºò£¬ÐèÅжÏÔ²îΪ1ʱµ±Ç°Ê±¼äµãÊÇ·ñ³¬¹ý5µã  
 | 
        if dateTime_day == 1:  
 | 
            preMonth_month = 12 if dateTime_month == 1 else dateTime_month - 1 # ÉÏÒ»ÔÂ  
 | 
            preMonth_year = dateTime_year if preMonth_month != 12 else dateTime_year - 1 # ÉÏÒ»ÔÂËùÊôÄê  
 | 
              
 | 
            # ÉϴιýÔµĸպÃÊÇÔ²î1, ÔòÐèÅжϵ±Ç°Ê±¼äµãÊÇ·ñ³¬¹ýXʱ  
 | 
            if preMonth_year == lastOnMonthEx_Year and preMonth_month == lastOnMonthEx_Month:  
 | 
                if curDateTime.hour < ShareDefine.Def_OnEventHour:  
 | 
                    #GameWorld.DebugLog("±¾ÔµÚÒ»Ì죬δµ½´ï¹ýÔÂʱ¼äµã, hour=%s" % curDateTime.hour)  
 | 
                    return 0  
 | 
                  
 | 
            # Ô²Ϊ1µÄʱºò£¬ÔòÎÞÂÛʲôʱ¼äµã¾ù¿É¹ýÔ  
 | 
            else:  
 | 
                #GameWorld.DebugLog("Ô²Ϊ1µÄʱºò£¬ÔòÎÞÂÛʲôʱ¼äµã¾ù¿É¹ýÔÂ, ¿ÉÒÔ¹ýÔÂ")  
 | 
                pass  
 | 
              
 | 
        # ²»ÊÇÿÔµÚÒ»ÌìµÄʱºò£¬ÔòÎÞÂÛʲôʱ¼äµã¾ù¿É¹ýÔ  
 | 
        else:  
 | 
            #GameWorld.DebugLog("²»ÊÇÿÔµÚÒ»ÌìµÄʱºò£¬ÔòÎÞÂÛʲôʱ¼äµã¾ù¿É¹ýÔÂ, ¿ÉÒÔ¹ýÔÂ")  
 | 
            pass  
 | 
          
 | 
    if dateTime_day == 1 and curDateTime.hour < ShareDefine.Def_OnEventHour:  
 | 
        dateTime_month = 12 if dateTime_month == 1 else dateTime_month - 1 # ÉÏÒ»ÔÂ  
 | 
        dateTime_year = dateTime_year if dateTime_month != 12 else dateTime_year - 1 # ÉÏÒ»ÔÂËùÊôÄê  
 | 
        #GameWorld.Log("OnMonthEx ÔÂ1ºÅÌØÊâXµã֮ǰ¹ýÌìµÄ£¬´ú±íÔ²î´óÓÚ1µÄÔÂ1ºÅ¹ýÔ£¬ÕâʱºòµÄ¹ýÔÂÖµÐèÉèÖÃΪÉÏÔ¡£%d%02d" % (dateTime_year, dateTime_month))  
 | 
          
 | 
    #GameWorld.DebugLog("¿ÉÒÔ¹ýÔÂ")  
 | 
    return dateTime_year * 100 + dateTime_month  
 | 
  
 | 
## ¼ì²éÍæ¼ÒÊÇ·ñ¿ÉÒÔOnYear  
 | 
#  @param curPlayer µ±Ç°Íæ¼Ò  
 | 
#  @param curMission µ±Ç°ÈÎÎñ  
 | 
#  @return None  
 | 
#  @remarks º¯ÊýÏêϸ˵Ã÷.  
 | 
def __Get_Can_OnYear(curPlayer):  
 | 
    #»ñȡϵͳÊý¾Ý  
 | 
    curDateTime = GameWorld.GetCurrentTime()  
 | 
    dateTime_Year = curDateTime.year  
 | 
    #»ñÈ¡Íæ¼ÒÊý¾Ý  
 | 
    player_Year = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_OnYear)  
 | 
      
 | 
    return (dateTime_Year != player_Year)  
 | 
#---------------------------------------------------------------------  
 | 
#===============================================================================  
 | 
# //////////////////////////////////////////////////////////////  
 | 
# //01 12 Ê±¼äͬ²½#tagMOnTimeSync  
 | 
# tagMOnTimeSync       *   GettagMOnTimeSync();  
 | 
#   
 | 
# class   IPY_MOnTimeSync  
 | 
# {  
 | 
# public:  
 | 
#   
 | 
#    char *      GetTime();  
 | 
# };  
 | 
#===============================================================================  
 | 
## Í¬²½ÊÀ½ç·þÎñÆ÷ʱ¼ä 01 12 Ê±¼äͬ²½  
 | 
#  @param index Íæ¼ÒË÷Òý  
 | 
#  @param tick µ±Ç°Ê±¼ä  
 | 
#  @return None  
 | 
#  @remarks º¯ÊýÏêϸ˵Ã÷.  
 | 
def GameServer_OnTimeSync(index , tick):  
 | 
    pack = IPY_GameWorld.IPY_MOnTimeSync()  
 | 
    SetMapServerTimeFromGameServer(pack.GetTime())  
 | 
    return  
 | 
#---------------------------------------------------------------------  
 | 
#===============================================================================  
 | 
# //01 13 GameServer¹ã²¥#tagMBroadcastMsg  
 | 
#   
 | 
# struct    tagMBroadcastMsg  
 | 
# {  
 | 
#    tagHead        Head;  
 | 
#    WORD        MsgLen;  
 | 
#    char        Msg[MsgLen];        //size = MsgLen  
 | 
# };  
 | 
#===============================================================================  
 | 
## 01 13 GameServer¹ã²¥  
 | 
#  @param index Íæ¼ÒË÷Òý  
 | 
#  @param tick µ±Ç°Ê±¼ä  
 | 
#  @return None  
 | 
#  @remarks º¯ÊýÏêϸ˵Ã÷.  
 | 
def GameServer_BroadcastMsg(index, tick):  
 | 
    pack = IPY_GameWorld.IPY_MBroadcastMsg()  
 | 
    msg = pack.GetMsg()  
 | 
      
 | 
    if not msg.startswith(ShareDefine.Def_Notify_WorldKey_GameWorldBossReborn[:-3]):  
 | 
        GameWorld.Log('GameServer_BroadcastMsg msg = %s'%(msg))  
 | 
    #---½ÓÊÕÊÀ½ç·þÎñÆ÷·¢À´µÄÏûÏ¢---  
 | 
  
 | 
    #ÓÑÇéÌáʾ: '+'·Ö¸ôkey ºÍValue, ÓÃÓÚMapServerµÄ SetGameWorldDictµÄ²ÎÊý  
 | 
    msgList = msg.split(ShareDefine.Def_Notify_Separator)  
 | 
      
 | 
    if len(msgList) == 2:  
 | 
        key = msgList[0]  
 | 
        msgValue = msgList[1]  
 | 
          
 | 
        if key == ShareDefine.Def_Notify_WorldKey_CommMapLinePlayerCount:  
 | 
            PyGameData.g_commMapLinePlayerCountDict = eval(msgValue)  
 | 
            return  
 | 
          
 | 
        if key == ShareDefine.Def_Notify_WorldKey_BossShuntPlayer:  
 | 
            PyGameData.g_bossShuntPlayerInfo = eval(msgValue)  
 | 
            return  
 | 
          
 | 
        if key == ShareDefine.Def_Notify_WorldKey_BossShuntLineState:  
 | 
            PyGameData.g_bossShuntLineState = eval(msgValue)  
 | 
            return  
 | 
          
 | 
        if key == ShareDefine.Def_Notify_WorldKey_FamilyKillHorsePetRobBossCnt:  
 | 
            PyGameData.g_familyKillHorsePetRobBossCntDict = eval(msgValue)  
 | 
            FamilyRobBoss.OnFamilyKillHorsePetRobBossCntChange(tick)  
 | 
            return  
 | 
          
 | 
        if key == ShareDefine.Def_Notify_WorldKey_FBEnterTimeLimiitMapID:  
 | 
            PyGameData.FBEnterTimeLimiitMapID = eval(msgValue)  
 | 
            return  
 | 
          
 | 
        if key == ShareDefine.Def_Notify_WorldKey_FBOpenRecord:  
 | 
            PyGameData.FBOpenTimeRecord = eval(msgValue)  
 | 
            return  
 | 
          
 | 
        if key == ShareDefine.Def_Notify_WorldKey_VSFamilyInfo:  
 | 
            PyGameData.VSFamilyInfo = eval(msgValue)  
 | 
            return  
 | 
          
 | 
        if key == ShareDefine.Def_Notify_WorldKey_FamilyBossOpenCount:  
 | 
            if GameWorld.GetMap().GetMapID() == ChConfig.Def_FBMapID_FamilyBossMap:  
 | 
                familyID, openCount = eval(msgValue)  
 | 
                GameLogic_FamilyBoss.GameServerOpenFamilyBoss(familyID, openCount)  
 | 
            return  
 | 
          
 | 
        if key == ShareDefine.Def_Notify_WorldKey_FamilyPartyInfo:  
 | 
            if GameWorld.GetMap().GetMapID() == ChConfig.Def_FBMapID_FamilyParty:  
 | 
                PyGameData.g_familyPartyInfo = eval(msgValue)  
 | 
            return  
 | 
          
 | 
        if key == ShareDefine.Def_Notify_WorldKey_FamilyPartyAddFamilyActivity:  
 | 
            mapID, familyID, addFamilyActivity = eval(msgValue)  
 | 
            if GameWorld.GetMap().GetMapID() == mapID:  
 | 
                GameLogic_FamilyParty.DoAddFamilyMemberFamilyActivity(familyID, addFamilyActivity)  
 | 
            return  
 | 
          
 | 
        if key == ShareDefine.Def_Notify_WorldKey_AssistBoss:  
 | 
            assistData = eval(msgValue)  
 | 
            if GameWorld.GetMap().GetMapID() == assistData[0]:  
 | 
                PlayerAssist.GameServer_AssistBossMsg(assistData[1:])  
 | 
            return  
 | 
          
 | 
        if key == ShareDefine.Def_Notify_WorldKey_AddFamilyAuctionItem:  
 | 
            mapID, familyAuctionItemDict = eval(msgValue)  
 | 
            if GameWorld.GetMap().GetMapID() == mapID:  
 | 
                PlayerAuctionHouse.DoAddFamilyAuctionItem(familyAuctionItemDict)  
 | 
            return  
 | 
          
 | 
        if key == ShareDefine.Def_Notify_WorldKey_AddSystemAuctionItem:  
 | 
            mapID, sysAuctionItemList = eval(msgValue)  
 | 
            if GameWorld.GetMap().GetMapID() == mapID:  
 | 
                PlayerAuctionHouse.DoAddSystemAuctionItem(sysAuctionItemList)  
 | 
            return  
 | 
          
 | 
        if key == ShareDefine.Def_Notify_WorldKey_FairyDomainLimit:  
 | 
            isAdd, limitList = eval(msgValue)  
 | 
            if isAdd:  
 | 
                PyGameData.g_fairyDomainLimit += limitList  
 | 
            else:  
 | 
                PyGameData.g_fairyDomainLimit = limitList  
 | 
            return  
 | 
          
 | 
        if key == ShareDefine.Def_Notify_WorldKey_CoupleInfo:  
 | 
            syncCoupleInfo = eval(msgValue)  
 | 
            for playerID, coupleInfo in syncCoupleInfo.items():  
 | 
                PlayerControl.SetCoupleInfo(playerID, coupleInfo)  
 | 
            return  
 | 
          
 | 
        if key.startswith(ShareDefine.Def_Notify_WorldKey_OperationActionInfo[:-2]):   
 | 
            keyHead = ShareDefine.Def_Notify_WorldKey_OperationActionInfo[:-2]  
 | 
            actionName = key[len(keyHead):]  
 | 
            actInfo = eval(msgValue)  
 | 
            actNum = actInfo.get(ShareDefine.ActKey_ActNum, 0)  
 | 
            if actionName in ShareDefine.MultiActNumOperationActNameList:  
 | 
                if not actNum:  
 | 
                    GameWorld.ErrLog('MultiActNumOperation can not found actNum. actionName=%s,msg = %s' % (actionName, msg))  
 | 
                    return  
 | 
                if actionName not in PyGameData.g_operationActionDict:  
 | 
                    PyGameData.g_operationActionDict[actionName] = {}  
 | 
                PyGameData.g_operationActionDict[actionName][actNum] = actInfo  
 | 
            else:  
 | 
                PyGameData.g_operationActionDict[actionName] = actInfo  
 | 
                  
 | 
            if actionName == ShareDefine.OperationActionName_ExpRate:  
 | 
                PlayerControl.RefreshOperationAction_ExpRate()  
 | 
                  
 | 
            elif actionName == ShareDefine.OperationActionName_CostRebate:  
 | 
                PlayerCostRebate.RefreshCostRebateActionInfo(actNum)  
 | 
                  
 | 
            elif actionName == ShareDefine.OperationActionName_TotalRecharge:  
 | 
                PlayerActTotalRecharge.RefreshTotalRechargeActionInfo(actNum)  
 | 
                  
 | 
            elif actionName == ShareDefine.OperationActionName_GarbageSorting:  
 | 
                PlayerActGarbageSorting.RefreshGarbageSortingActionInfo(actNum)  
 | 
                  
 | 
            elif actionName == ShareDefine.OperationActionName_XianXiaMJ:  
 | 
                PlayerActXianXiaMJ.RefreshXianXiaMJActionInfo(actNum)  
 | 
                  
 | 
            elif actionName == ShareDefine.OperationActionName_GodGift:  
 | 
                PlayerActGodGift.RefreshGodGiftActionInfo(actNum)  
 | 
                  
 | 
            elif actionName == ShareDefine.OperationActionName_ManyDayRecharge:  
 | 
                PlayerActManyDayRecharge.RefreshManyDayRechargeActionInfo(actNum)  
 | 
                  
 | 
            elif actionName == ShareDefine.OperationActionName_SingleRecharge:  
 | 
                PlayerActSingleRecharge.RefreshSingleRechargeActionInfo(actNum)  
 | 
                  
 | 
            elif actionName == ShareDefine.OperationActionName_Turntable:  
 | 
                PlayerActTurntable.RefreshTurntableActionInfo(actNum)  
 | 
                  
 | 
            elif actionName == ShareDefine.OperationActionName_SpringSale:  
 | 
                PlayerSpringSale.RefreshSpringSaleActionInfo(actNum)  
 | 
  
 | 
            elif actionName == ShareDefine.OperationActionName_BossReborn:  
 | 
                PlayerBossReborn.RefreshOperationAction_BossReborn()  
 | 
                  
 | 
            elif actionName == ShareDefine.OperationActionName_HorsePetFeast:  
 | 
                PlayerActHorsePetFeast.RefreshOperationAction_HorsePetFeast(actNum)  
 | 
                  
 | 
            elif actionName == ShareDefine.OperationActionName_FlashGiftbag:  
 | 
                PlayerFlashGiftbag.RefreshFlashGiftbagActionInfo(actNum)  
 | 
                  
 | 
            elif actionName == ShareDefine.OperationActionName_DailyGiftbag:  
 | 
                PlayerDailyGiftbag.RefreshDailyGiftbagActionInfo()  
 | 
                  
 | 
            elif actionName == ShareDefine.OperationActionName_BuyOne:  
 | 
                PlayerActBuyOne.RefreshBuyOneActionInfo(actNum)  
 | 
                  
 | 
            elif actionName == ShareDefine.OperationActionName_FairyCeremony:  
 | 
                PlayerFairyCeremony.RefreshOperationAction_FairyCeremony()  
 | 
                  
 | 
            elif actionName == ShareDefine.OperationActionName_NewFairyCeremony:  
 | 
                PlayerNewFairyCeremony.RefreshOperationAction_NewFairyCeremony()  
 | 
                  
 | 
            elif actionName == ShareDefine.OperationActionName_FlashSale:  
 | 
                PlayerFlashSale.RefreshflashSaleActionInfo(actNum)  
 | 
                  
 | 
            elif actionName == ShareDefine.OperationActionName_WishingWell:  
 | 
                PlayerWishingWell.RefreshWishingWellAction()  
 | 
                  
 | 
            elif actionName == ShareDefine.OperationActionName_CollectWords:  
 | 
                PlayerActCollectWords.RefreshActCollectWordsInfo(actNum)  
 | 
                  
 | 
            elif actionName == ShareDefine.OperationActionName_WeekParty:  
 | 
                PlayerWeekParty.RefreshOperationAction_WeekParty()  
 | 
                  
 | 
            elif actionName == ShareDefine.OperationActionName_LoginAward:  
 | 
                PlayerActLogin.RefreshOperationAction_LoginAward()  
 | 
                  
 | 
            elif actionName == ShareDefine.OperationActionName_FeastLogin:  
 | 
                PlayerFeastLogin.RefreshFeastLoginActionInfo()  
 | 
                  
 | 
            elif actionName == ShareDefine.OperationActionName_FeastWish:  
 | 
                PlayerFeastWish.RefreshFeastWishActionInfo()  
 | 
                  
 | 
            elif actionName == ShareDefine.OperationActionName_FeastTravel:  
 | 
                PlayerFeastTravel.RefreshFeastTravelActionInfo()  
 | 
                  
 | 
            elif actionName == ShareDefine.OperationActionName_FeastWeekParty:  
 | 
                PlayerFeastWeekParty.RefreshOperationAction_FeastWeekParty()  
 | 
                  
 | 
            elif actionName == ShareDefine.OperationActionName_FeastRedPacket:  
 | 
                PlayerFeastRedPacket.RefreshOperationAction_FeastRedPacket()  
 | 
                  
 | 
            elif actionName == ShareDefine.OperationActionName_LuckyTreasure:  
 | 
                PlayerLuckyTreasure.RefreshLuckyTreasureAction()  
 | 
                  
 | 
            elif actionName == ShareDefine.OperationActionName_RechargePrize:  
 | 
                PlayerActRechargePrize.RefreshRechargePrizeActionInfo()  
 | 
                  
 | 
            elif actionName == ShareDefine.OperationActionName_GrowupBuy:  
 | 
                PlayerActGrowupBuy.RefreshGrowupBuyActionInfo()  
 | 
                  
 | 
            elif actionName == ShareDefine.OperationActionName_RechargeRebateGold:  
 | 
                PlayerActRechargeRebateGold.RefreshRechargeRebateGoldActionInfo()  
 | 
                  
 | 
            return  
 | 
          
 | 
        if key.startswith(ShareDefine.Def_Notify_WorldKey_CrossActInfo[:-2]):  
 | 
            keyHead = ShareDefine.Def_Notify_WorldKey_CrossActInfo[:-2]  
 | 
            actionName = key[len(keyHead):]  
 | 
            if actionName not in PyGameData.g_crossActInfoDict:  
 | 
                PyGameData.g_crossActInfoDict[actionName] = {}  
 | 
            actInfoDict = PyGameData.g_crossActInfoDict[actionName]  
 | 
            actInfoDict.update(eval(msgValue))  
 | 
              
 | 
            if actionName == ShareDefine.CrossActName_CTGBillboard:  
 | 
                CrossActCTGBillboard.RefreshCrossActCTGBillboardInfo()  
 | 
                  
 | 
            elif actionName == ShareDefine.CrossActName_AllRecharge:  
 | 
                CrossActAllRecharge.RefreshCrossActAllRechargeInfo()  
 | 
                  
 | 
            return  
 | 
          
 | 
        if key == ShareDefine.Def_Notify_WorldKey_CrossZoneName:  
 | 
            PyGameData.g_crossZoneName = msgValue  
 | 
            return  
 | 
          
 | 
        if key == ShareDefine.Def_Notify_WorldKey_CrossServerTime:  
 | 
            PyGameData.g_crossServerTimeInfo = eval(msgValue)  
 | 
            playerManager = GameWorld.GetPlayerManager()  
 | 
            for index in xrange(playerManager.GetPlayerCount()):  
 | 
                curPlayer = playerManager.GetPlayerByIndex(index)  
 | 
                if curPlayer.GetID() == 0:  
 | 
                    continue  
 | 
                ChPlayer.Sync_PyServerDataTimeToClient(curPlayer)  
 | 
            return  
 | 
          
 | 
        # ÐÒÔËÔÆ¹º  
 | 
        if key == ShareDefine.Def_Notify_WorldKey_LuckyCloudBuyInfo:  
 | 
            PyGameData.g_luckyCloudBuyInfo = eval(msgValue)  
 | 
            PlayerLuckyCloudBuy.OnLuckyCloudBuyChange()  
 | 
            return  
 | 
          
 | 
        if key == ShareDefine.Def_Notify_WorldKey_CrossBattlefieldCallTeamInfo:  
 | 
            PyGameData.g_crossBattlefieldCallTeamInfo = eval(msgValue)  
 | 
            return  
 | 
          
 | 
        if msgValue.isdigit():  
 | 
            value = int(msgValue)  
 | 
        else:  
 | 
            GameWorld.ErrLog("GameServer_BroadcastMsg unKnowMsg: %s = %s" % (key, msgValue))  
 | 
            return  
 | 
          
 | 
    #ÌØÊâ´¦Àí  
 | 
    elif msg == 'ReloadConfig':  
 | 
        key = ShareDefine.Def_Notify_WorldKey_ReloadConfig  
 | 
        value = 1  
 | 
  
 | 
    else:  
 | 
        GameWorld.ErrLog('GameServer_BroadcastMsg unKnowMsg, msg = %s'%(msg))  
 | 
        return  
 | 
      
 | 
    gameWorldMgr = GameWorld.GetGameWorld()  
 | 
  
 | 
    #ÌØÊâÖ´ÐÐÂß¼--warning:ÕâÀï´¦ÀíµÄÂß¼»¹Ã»´ækey, Çø·ÖºÃ  
 | 
    if key == ShareDefine.Def_Notify_WorldKey_ReloadConfig:  
 | 
        __DoLogic_OtherReloadDict(gameWorldMgr, value)  
 | 
      
 | 
    #===============================================================================================  
 | 
    # #ÖØ¶Á½Å±¾  
 | 
    # elif key == ShareDefine.Def_Notify_WorldKey_MapServerScriptReloadVersion:  
 | 
    #    ReloadModule.DoMapServerScriptReload(value, tick)  
 | 
    #===============================================================================================  
 | 
      
 | 
    # ¿ç·þPK  
 | 
    elif key == ShareDefine.Def_Notify_WorldKey_CrossPKSeasonID:  
 | 
        PlayerCrossRealmPK.OnCrossRealmPKSeasonChange(value)  
 | 
          
 | 
    # ÊØÎÀÈË»Ê  
 | 
    elif key == ShareDefine.Def_Notify_WorldKey_FBFuncState % ChConfig.Def_FBMapID_FamilyInvade:  
 | 
        if gameWorldMgr.GetGameWorldDictByKey(key) != value:  
 | 
            GameLogic_FamilyInvade.OnFamilyInvadeStateChange(value, tick)  
 | 
    # ÉϹÅÕ½³¡  
 | 
    elif key == ShareDefine.Def_Notify_WorldKey_FBFuncState % ChConfig.Def_FBMapID_ElderBattlefield:  
 | 
        if gameWorldMgr.GetGameWorldDictByKey(key) != value:  
 | 
            GameLogic_ElderBattlefield.OnElderBattlefieldStateChange(value, tick)  
 | 
    # ¶àÏÉÃËBOSS  
 | 
    elif key in [ShareDefine.Def_Notify_WorldKey_DailyActionState % ShareDefine.DailyActionID_FamilyBoss1]:  
 | 
        if gameWorldMgr.GetGameWorldDictByKey(key) != value:  
 | 
            GameLogic_AllFamilyBoss.OnAllFamilyBossStateChange(value, tick)  
 | 
    # Æï³èBOSS  
 | 
    elif key == ShareDefine.Def_Notify_WorldKey_DailyActionState % ShareDefine.DailyActionID_HorsePetBoss:  
 | 
        if gameWorldMgr.GetGameWorldDictByKey(key) != value:  
 | 
            GameLogic_HorsePetBoss.OnHorsePetBossStateChange(value, tick)  
 | 
                  
 | 
    # ¿ç·þÑýħboss  
 | 
    elif key == ShareDefine.Def_Notify_WorldKey_CrossDailyActionState % ShareDefine.CrossDailyActionID_YaomoBoss:  
 | 
        if gameWorldMgr.GetGameWorldDictByKey(key) != value:  
 | 
            PlayerCrossYaomoBoss.OnYaomoBossStateChange(value, tick)  
 | 
              
 | 
    # OnDayEx  
 | 
    elif key == ShareDefine.Def_Notify_WorldKey_OnDayEx:  
 | 
        if value and gameWorldMgr.GetGameWorldDictByKey(key) != value:  
 | 
            __Func_GameServer_OnDayEx(tick)  
 | 
              
 | 
    # OnWeekEx  
 | 
    elif key == ShareDefine.Def_Notify_WorldKey_OnWeekEx:  
 | 
        if value and gameWorldMgr.GetGameWorldDictByKey(key) != value:  
 | 
            __Func_GameServer_OnWeekEx(tick)  
 | 
              
 | 
    # OnMonthEx  
 | 
    elif key == ShareDefine.Def_Notify_WorldKey_OnMonthEx:  
 | 
        if value and gameWorldMgr.GetGameWorldDictByKey(key) != value:  
 | 
            __Func_GameServer_OnMonthEx(tick)  
 | 
              
 | 
    # ÊÀ½çµÈ¼¶        
 | 
    elif key == ShareDefine.Def_Notify_WorldKey_WorldAverageLv:  
 | 
        if value and gameWorldMgr.GetGameWorldDictByKey(key) != value:  
 | 
            gameWorldMgr.SetGameWorldDict(key, value) # ÊÀ½çµÈ¼¶ÏȸüÐÂÔÙ´¦Àí  
 | 
            playerManager = GameWorld.GetPlayerManager()  
 | 
            for index in xrange(playerManager.GetPlayerCount()):  
 | 
                curPlayer = playerManager.GetPlayerByIndex(index)  
 | 
                if curPlayer.GetID() == 0:  
 | 
                    continue  
 | 
                PlayerWorldAverageLv.UpdatePlayerWorldAverageLv(curPlayer)  
 | 
              
 | 
    #ͨÓÃÉèÖà  
 | 
    befValue = gameWorldMgr.GetGameWorldDictByKey(key)  
 | 
    gameWorldMgr.SetGameWorldDict(key, value)  
 | 
      
 | 
    #-------ÔÚÉèÖÃÁË×ÖµäÖµÒÔºó´¦Àí---------------------------------  
 | 
    # Ë¢ÐÂÊÀ½çboss  
 | 
    if key.startswith('GameWorldBossReborn_'):  
 | 
        NPCCustomRefresh.ProcessAllNPCRefresh(tick)  
 | 
          
 | 
    # ÍõÕßÏÉÃË  
 | 
    elif key == ShareDefine.Def_Notify_WorldKey_ChampionFamilyID:  
 | 
        GameLogic_FamilyWar.OnChampionFamilyIDChange()  
 | 
          
 | 
    # ÏÉÃËÑç»á  
 | 
    elif key == ShareDefine.Def_Notify_WorldKey_DailyActionState % ShareDefine.DailyActionID_FamilyParty:  
 | 
        if befValue != value:  
 | 
            GameLogic_FamilyParty.OnFamilyPartyStateChange(value, tick)  
 | 
              
 | 
#===============================================================================  
 | 
#    ---ÐÞ¸ÄΪÉÏÊöµÄ Í³Ò»×ֵ䴦Àí  
 | 
#    if msg == ChConfig.Def_Notify_Key_PurTalk:  
 | 
#        #¼àÊÓÍæ¼ÒÁÄÌì  
 | 
#        gameWorld.SetGameWorldDict(ChConfig.Def_MapKey_LogInDBPlayerTalk , 1)  
 | 
#          
 | 
#    elif msg == ChConfig.Def_Notify_Key_UnPurTalk:  
 | 
#        #½â³ý¼àÊÓÍæ¼ÒÁÄÌì  
 | 
#        gameWorld.SetGameWorldDict(ChConfig.Def_MapKey_LogInDBPlayerTalk , 0)  
 | 
#      
 | 
#    elif msg == 'ReloadConfig':  
 | 
#        #ÖØ¶Á²ß»®ÅäÖÃ±í  
 | 
#        gameWorld.SetGameWorldDict(ChConfig.Def_ReloadConfig , 1)  
 | 
#          
 | 
#    elif msg.find('ActionAccept') != -1:  
 | 
#        #֪ͨ¿ªÆô»î¶¯  
 | 
#        ActionStateAccept(msg, tick)  
 | 
#===============================================================================  
 | 
    return  
 | 
  
 | 
##ÖØ¶Á¸÷ÖÖÅäÖÃ×Öµä¸ü¸Ä״̬  
 | 
# @param gameWorldMgr ÊÀ½ç¹ÜÀíÆ÷  
 | 
# @param value ×ÖµäÖµ  
 | 
# @return None    
 | 
def __DoLogic_OtherReloadDict(gameWorldMgr, value):  
 | 
    #texͼÐÎÑéÖ¤ÂëÖØ¶Á  
 | 
    gameWorldMgr.SetGameWorldDict(ShareDefine.Def_Notify_WorldKey_ReloadTexCaptcha, value)  
 | 
      
 | 
    #jpegͼÐÎÑéÖ¤ÂëÖØ¶Á  
 | 
    gameWorldMgr.SetGameWorldDict(ShareDefine.Def_Notify_WorldKey_ReloadJpegCaptcha, value)  
 | 
      
 | 
    IpyGameDataPY.IPYData.IpyDataClear()  
 | 
      
 | 
    #ÈÎÎñÖØ¶Á£¬Ðè·ÅÔÚÅäÖÃÖØ¶ÁºóÃæ£¬ÔÝʱĬÈϹرգ¬½öÓÐÐèÒªÖØ¶ÁÈÎÎñʱ¿ªÆôÅäÖà  
 | 
    if IpyGameDataPY.GetFuncCfg("ReloadQuests", 1):  
 | 
        tick = GameWorld.GetGameWorld().GetTick()  
 | 
        QuestManager.ReloadQuests(tick)  
 | 
        EventShell.DoReloadRefresh()  
 | 
    return  
 | 
  
 | 
#===============================================================================  
 | 
# ## Í¨Öª¿ªÆô»î¶¯  
 | 
# #  @param msg »î¶¯ÐÅÏ¢  
 | 
# #  @param tick µ±Ç°Ê±¼ä  
 | 
# #  @return None  
 | 
# #  @remarks º¯ÊýÏêϸ˵Ã÷.  
 | 
# def ActionStateAccept(msg, tick):  
 | 
#    msg = eval(msg.replace('ActionAccept', ''))  
 | 
#    GameWorld.GetGameWorld().SetGameWorldDict(msg[:-1] , int(msg[-1]))  
 | 
#    return  
 | 
#===============================================================================  
 | 
#---------------------------------------------------------------------  
 | 
  
 | 
## C++·â°ü´¥·¢Æ÷£¬³õʼ»¯·þÎñÆ÷°æ±¾ºÅ  
 | 
#  @param index Íæ¼ÒË÷Òý  
 | 
#  @param tick µ±Ç°Ê±¼ä  
 | 
#  @return None  
 | 
#  @remarks º¯ÊýÏêϸ˵Ã÷.  
 | 
def OnServerVersionSetting(index , tick):  
 | 
    FBLogic.OnInit(tick)  
 | 
    return  
 | 
#---------------------------------------------------------------------  
 | 
  
 | 
  
 |