#!/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 ReadCaptchaImage  
 | 
import PlayerGameWallow  
 | 
import ItemCommon  
 | 
import Operate_PlayerBuyZhenQi  
 | 
import PlayerSignDay  
 | 
import PlayerCoin  
 | 
import PlayerControl  
 | 
import PlayerWorldAverageLv  
 | 
import PlayerFamily  
 | 
import PlayerOnlinePrize  
 | 
import NPCCustomRefresh  
 | 
import PlayerHorse  
 | 
import PlayerLoginDayAward  
 | 
import NPCCommon  
 | 
import GameLogic_MergeBoss  
 | 
import GameLogic_ManorWar  
 | 
import FunctionNPCCommon  
 | 
import PlayerGoldGift  
 | 
import PlayerActivity  
 | 
import PlayerTeHui  
 | 
import HighLadderTube  
 | 
import PlayerAction  
 | 
import PlayerTruck  
 | 
import FBCommon  
 | 
import PlayerDienstgrad  
 | 
import PlayerSuccess  
 | 
import PlayerMixLoginDayAward  
 | 
import PlayerFreeGoods  
 | 
import PlayerMagicWeapon  
 | 
import ShopItemManage  
 | 
import ChItem  
 | 
import PlayerGoldInvest  
 | 
import PlayerNewGuyCard  
 | 
import PlayerMergeKing  
 | 
import PlayerMergePK  
 | 
import PlayerPet  
 | 
import ReloadModule  
 | 
import BossHurtMng  
 | 
import PlayerRecover  
 | 
import GameLogic_FamilyParty  
 | 
import PlayerFamilyRedPacket  
 | 
import GameLogic_FamilyInvade  
 | 
import GameLogic_ElderBattlefield  
 | 
import GameLogic_FamilyBoss  
 | 
import GameLogic_FamilyWar  
 | 
import GameLogic_Dogz  
 | 
import OpenServerCampaign  
 | 
import PlayerCostRebate  
 | 
import PlayerSpringSale  
 | 
import PlayerBossReborn  
 | 
import PlayerFlashGiftbag  
 | 
import PlayerFairyCeremony  
 | 
import PlayerVip  
 | 
import PlayerDiceEx  
 | 
import IpyGameDataPY  
 | 
import QuestManager  
 | 
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)  
 | 
      
 | 
    #ÖØÖÿç·þ»î¶¯¸±±¾ÈËÊý·ÖÅäÇé¿öÐÅÏ¢  
 | 
    PlayerControl.ResetMergeFBPlayerCntInfo(0)  
 | 
      
 | 
    #ɾ³ýËùÓеÄÈÎÎñ·¢²¼  
 | 
    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)  
 | 
    #֪ͨBServer×Ô¼ºOKÁË  
 | 
    curPlayer.SendToBServerServerInitOK()  
 | 
    ChPlayer.OnAllServerInitOK(curPlayer, tick)  
 | 
  
 | 
#--------------------------------------------------------  
 | 
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 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)  
 | 
          
 | 
        #------------------------------------------------------------------------------   
 | 
          
 | 
        # ×øÆïOnDay  
 | 
        PlayerHorse.HorseOnDay(curPlayer)  
 | 
          
 | 
        PlayerVip.VipOnDay(curPlayer)  
 | 
          
 | 
        PlayerCoin.OnDay(curPlayer)  
 | 
          
 | 
        #³É¾Í  
 | 
        PlayerSuccess.SuccOnDay(curPlayer)  
 | 
          
 | 
        # ÏÉÃ˺ì°üOnDay  
 | 
        PlayerFamilyRedPacket.RedPacketOnDay(curPlayer)  
 | 
          
 | 
        # ÐÂÊÖ¿¨  
 | 
        PlayerNewGuyCard.NewGuyCardOnday(curPlayer)  
 | 
          
 | 
        PlayerTJG.TJGOnDay(curPlayer)  
 | 
        #Ͷ×Ê  
 | 
        PlayerGoldInvest.OnDay(curPlayer)  
 | 
          
 | 
        #·¨±¦  
 | 
        PlayerMagicWeapon.OnDay(curPlayer)  
 | 
        PlayerGoldGift.OnDay(curPlayer)  
 | 
          
 | 
    # ÌØÊâʱ¼äµãXµã¹ýÌì  
 | 
    elif onEventType == ShareDefine.Def_OnEventTypeEx:  
 | 
        #´¥·¢Ã¿ÈÕÈÎÎñÖØÖýű¾  
 | 
        EventShell.EventResponse_OnDay(curPlayer)  
 | 
        #¹ºÂò´ÎÊýÇå¿Õ  
 | 
        Operate_PlayerBuyZhenQi.PlayerOnDay(curPlayer)  
 | 
        # ÊÀ½çboss  
 | 
        BossHurtMng.OnDay(curPlayer)  
 | 
        #ÎÒҪ̫¼«¹ýÌì  
 | 
        PlayerDiceEx.OnDay(curPlayer)  
 | 
        # ×ÊÔ´ÕÒ»Ø  
 | 
        PlayerRecover.RecoverOnDay(curPlayer)  
 | 
        # ÏÉÃ˹ýÌì  
 | 
        PlayerFamily.FamilyPlayerOnDay(curPlayer)  
 | 
        # ÖØÖÃÎïÆ·Ã¿ÈÕʹÓôÎÊý  
 | 
        ChItem.ResetItemUseCntToday(curPlayer)  
 | 
        # ¼«Æ·°×Äà  
 | 
        PlayerFreeGoods.OnDay(curPlayer)  
 | 
        #²É¼¯´ÎÊýÖØÖà  
 | 
        NPCCommon.CollNPCTimeOnDay(curPlayer)  
 | 
          
 | 
      
 | 
    # ÒÔÏÂΪ֧³ÖÁ½ÖÖÖØÖÃģʽÇл»ÅäÖÃµÄ  
 | 
    FBCommon.FBOnDay(curPlayer, onEventType)  
 | 
      
 | 
    #ÈÕ³£»î¶¯OnDay  
 | 
    PlayerActivity.OnDay(curPlayer, onEventType)  
 | 
          
 | 
    # É̵êÎïÆ·¹ºÂò¶Ò»»OnDay  
 | 
    FunctionNPCCommon.ShopItemOnDay(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 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)  
 | 
        PlayerFamily.OnWeekEx(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 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)  
 | 
    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[:-2]):  
 | 
        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_BossShuntDeadLine:  
 | 
            PyGameData.g_bossShuntDeadLine = eval(msgValue)  
 | 
            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.startswith(ShareDefine.Def_Notify_WorldKey_OperationActionInfo[:-2]):   
 | 
            keyHead = ShareDefine.Def_Notify_WorldKey_OperationActionInfo[:-2]  
 | 
            actionName = key[len(keyHead):]  
 | 
            PyGameData.g_operationActionDict[actionName] = eval(msgValue)  
 | 
              
 | 
            if actionName == ShareDefine.OperationActionName_ExpRate:  
 | 
                PlayerControl.RefreshOperationAction_ExpRate()  
 | 
                  
 | 
            elif actionName == ShareDefine.OperationActionName_CostRebate:  
 | 
                PlayerCostRebate.RefreshCostRebateActionInfo()  
 | 
  
 | 
            elif actionName == ShareDefine.OperationActionName_SpringSale:  
 | 
                PlayerSpringSale.RefreshSpringSaleActionInfo()  
 | 
  
 | 
            elif actionName == ShareDefine.OperationActionName_BossReborn:  
 | 
                PlayerBossReborn.RefreshOperationAction_BossReborn()  
 | 
                  
 | 
            elif actionName == ShareDefine.OperationActionName_FlashGiftbag:  
 | 
                PlayerFlashGiftbag.RefreshFlashGiftbagActionInfo()  
 | 
              
 | 
            elif actionName == ShareDefine.OperationActionName_FairyCeremony:  
 | 
                PlayerFairyCeremony.RefreshOperationAction_FairyCeremony()  
 | 
            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)  
 | 
    #===============================================================================================  
 | 
      
 | 
    #ÁìµØÕù¶áÕ½  
 | 
    elif key == ShareDefine.Def_Notify_WorldKey_ManorWar:  
 | 
        GameLogic_ManorWar.OnManorWarStateChange(value, tick)  
 | 
  
 | 
    #¶¨Ê±É̵êˢР 
 | 
    elif key.startswith(ShareDefine.Def_Notify_WorldKey_TimeShopRefreshTime[:-2]):  
 | 
        ShopItemManage.OnTimeShopRefresh(key, value, tick)  
 | 
          
 | 
    #¿ç·þboss  
 | 
    elif key == ShareDefine.Def_Notify_WorldKey_MergeBoss:  
 | 
        GameLogic_MergeBoss.OnMergeBossStateChange(value, tick)  
 | 
          
 | 
    # ¿ç·þPK, Èü¼¾¿ªÊ¼Ê±¼ä²»Óô¦Àí£¬½ö´æ´¢¼´¿É  
 | 
    elif key in [ShareDefine.Def_Notify_WorldKey_MergePKDayID, ShareDefine.Def_Notify_WorldKey_MergePKSeasonID]:  
 | 
        PlayerMergePK.OnMergePKActionChange(key, value)  
 | 
          
 | 
    # ¿ç·þÍõÕßÕù°Ô  
 | 
    elif key in [ShareDefine.Def_Notify_WorldKey_Merge_KingStartID, ShareDefine.Def_Notify_WorldKey_Merge_KingOverID]:  
 | 
        PlayerMergeKing.OnMergeKingActionChange(key, value)  
 | 
          
 | 
    # ÏÉÃËÑç»á  
 | 
    elif key == ShareDefine.Def_Notify_WorldKey_FBFuncState % ChConfig.Def_FBMapID_FamilyParty:  
 | 
        if gameWorldMgr.GetGameWorldDictByKey(key) != value:  
 | 
            GameLogic_FamilyParty.OnFamilyPartyStateChange(value, tick)  
 | 
    # ÊØÎÀÈË»Ê  
 | 
    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)  
 | 
    # 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)  
 | 
              
 | 
    # ÈÕ³£»î¶¯  
 | 
    elif key.startswith(ShareDefine.Def_Notify_WorldKey_DailyActionState[:-2]):  
 | 
        if value and gameWorldMgr.GetGameWorldDictByKey(key) != value:  
 | 
            NPCCustomRefresh.ResetActivityBossRefreshCount()  
 | 
              
 | 
    #ͨÓÃÉèÖà  
 | 
    gameWorldMgr.SetGameWorldDict(key, value)  
 | 
      
 | 
    #-------ÔÚÉèÖÃÁË×ÖµäÖµÒÔºó´¦Àí---------------------------------  
 | 
    # Ë¢ÐÂÊÀ½çboss  
 | 
    if key.startswith('GameWorldBossReborn_'):  
 | 
        NPCCustomRefresh.ProcessAllNPCRefresh(tick)  
 | 
          
 | 
    # ÍõÕßÏÉÃË  
 | 
    elif key == ShareDefine.Def_Notify_WorldKey_ChampionFamilyID:  
 | 
        GameLogic_FamilyWar.OnChampionFamilyIDChange()  
 | 
                  
 | 
    # Ìػݻ  
 | 
    elif key in ShareDefine.TeHuiTypeKeyDict.values():  
 | 
        PlayerTeHui.ChangeTeHuiActionState(key)  
 | 
  
 | 
    # »î¶¯buff״̬±ä¸ü  
 | 
    elif key.startswith(ShareDefine.Def_Notify_WorldKey_ActionBuffState[:-2]):              
 | 
        PlayerAction.OnActionBuffStateChange(key, tick)  
 | 
    #bossË¢ÐÂʱ¼ä²ÎÊý  
 | 
    elif key.startswith(ShareDefine.Def_Notify_WorldKey_BossOnlineHeroCnt[:-2]):  
 | 
        GameLogic_Dogz.OnOnlineCntChange(key, 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  
 | 
#---------------------------------------------------------------------  
 | 
  
 | 
  
 |