1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
ÿ
×ic@sVddlZddlZddlZddlZddlZddlZddlZddlZddlZddl    Z    ddl
Z
ddl Z ddl Z ddl Z ddlZddlZddlZddlZddlZddlZddlZddlZd„Zd„Zd„Zd„Zd„Zd„Zd„Zd    „Zd
„Zd „Zd „Z d „Z!d„Z"d„Z#d„Z$d„Z%d„Z&d„Z'd„Z(d„Z)d„Z*d„Z+d„Z,d„Z-d„Z.d„Z/d„Z0d„Z1d„Z2d„Z3d „Z4d!„Z5d"d#d$„Z6d%„Z7d&„Z8d'„Z9dS((iÿÿÿÿNcCstjƒjtjƒS(N(t    DBDataMgrtGetEventTrigMgrtGetValuet ShareDefinetDef_Server_Year(((suD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\GameWorldLogic\GameWorldEvent.pytGet_Server_Year*scCs)tjƒjtjtjjƒjƒdS(N(RRtSetValueRRtdatetimettodaytyear(((suD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\GameWorldLogic\GameWorldEvent.pytSet_Server_Year+s%cCstjƒjtjƒS(N(RRRRtDef_Server_Month(((suD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\GameWorldLogic\GameWorldEvent.pytGet_Server_Month.scCs)tjƒjtjtjjƒjƒdS(N(RRRRR RRtmonth(((suD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\GameWorldLogic\GameWorldEvent.pytSet_Server_Month/s%cCstjƒjtjƒS(N(RRRRtDef_Server_Week(((suD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\GameWorldLogic\GameWorldEvent.pytGet_Server_Week2scCs6tjƒjtjtjjtjjƒƒdƒdS(Ni(RRRRRRt isocalendarR(((suD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\GameWorldLogic\GameWorldEvent.pytSet_Server_Week3s2cCstjƒjtjƒS(N(RRRRtDef_Server_Day(((suD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\GameWorldLogic\GameWorldEvent.pytGet_Server_Day6scCs)tjƒjtjtjjƒjƒdS(N(RRRRRRRtday(((suD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\GameWorldLogic\GameWorldEvent.pytSet_Server_Day7s%cCstjƒjtjƒS(N(RRRRtDef_Server_Hour(((suD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\GameWorldLogic\GameWorldEvent.pytGet_Server_Hour:scCs)tjƒjtjtjjƒjƒdS(N(RRRRRRRthour(((suD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\GameWorldLogic\GameWorldEvent.pytSet_Server_Hour;s%cCs^tƒs<tƒtƒtƒtƒtƒtjdƒntƒt    ƒt
ƒt ƒtƒfS(Ns!###·þÎñÆ÷пª, ³õʼ»¯·þÎñÆ÷ʱ¼ä !( RRRRRR
t    GameWorldtLogRRRR (((suD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\GameWorldLogic\GameWorldEvent.pytInitServerTime?s    cCstjƒt|ƒdS(N(t PyMongoMaintStartDBt InitGameWorld(ttick((suD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\GameWorldLogic\GameWorldEvent.pyRLs
 
cCsEtjr dStjƒjƒ}tjƒ}tjd||fƒtjƒt    ƒt
t j ƒƒt_ tj ƒtjƒjtjƒr³tjƒjtjdƒtjdƒntjƒjtjƒ}tjƒjtjƒ}|dksû|dkr t|r
|nt
t j ƒƒƒntƒtjƒtt_tƒdS(Ns8·þÎñÆ÷Æô¶¯³õʼ»¯InitGameWorld: serverID=%s,serverType=%sis%Æô¶¯·þÎñÆ÷Ê±ÖØÖÿç·þ¹«»á´«ÊäÊý¾Ý״̬!(t
PyGameDatatg_initGameWorldOKRt GetGameWorldt GetServerIDt GetServerTypeRRt OnServerStartt LoadDBPlayertintttimetg_initGameTimetCheckCrossCenterUniquenessErrRRRtDef_FamilyTransDataTimeRtDef_InitOpenServerTimetDef_OpenServerWeekdaytSetInitOpenServerTimet__DoMixServerInittGameLogic_QunyingtTruetOnServerInitOK(R!tserverIDt
serverTypetinitOpenServerTimetopenServerWeekday((suD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\GameWorldLogic\GameWorldEvent.pyR Ss*     
 
%
    cCsRtj stj rdStjr%dStt_tjƒjƒ}tjƒjƒ}t    |ƒt
|ƒtj dƒtj ƒ}|t jkr¨tj d||fƒn™|t jkrÑtj d||fƒnptjƒjt jƒd}tjƒjt jƒ}tjƒjt jƒd}tj d|||||fƒtjdƒdS(sŠ·þÎñÆ÷ÍêÈ«Æô¶¯³õʼ»¯³É¹¦ºóµÄ´¦Àí£¬ÈçdbÊý¾Ý¼ÓÔØ¼°¾²Ì¬ÎïÆ·Êý¾ÝµÈ¶¼¼ÓÔØÍê±ÏÁË
    Èç¿ç·þ¼äÏà¹ØÂß¼­Í¨Ñ¶ÐèÒªµÈ·þÎñÆ÷ÍêÈ«Æô¶¯Íê±Ïºó²Å¿É½øÐÐ
    NsR=============================== ·þÎñÆ÷Æô¶¯³É¹¦ ===================================s+¿ç·þÖÐÐÄÆô¶¯³É¹¦: serverType=%s,serverID=%ss-¿ç·þ·þÎñÆ÷Æô¶¯³É¹¦: serverType=%s,serverID=%sisYÓÎÏ··þÎñÆ÷Æô¶¯³É¹¦: serverType=%s,serverID=%s,serverDay=%s,isMixServer=%s,mixServerDay=%strestart(R"R#t g_initPyItemtg_serverInitOKR3RR$tGetTickR%t OnHighProcesstOnMinuteRR&RtserverType_CrossCentertserverType_CrossRRRt Def_ServerDaytDef_IsMixServertDef_MixServerDaytDataRecordPackt    DR_Reload(R!R5R6t    serverDayt isMixServert mixServerDay((suD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\GameWorldLogic\GameWorldEvent.pyR4ys,        
 
       cCsdS(N((R!((suD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\GameWorldLogic\GameWorldEvent.pytAllMapServerInitOKœscCsdS(N((((suD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\GameWorldLogic\GameWorldEvent.pyR(ŸscCsztjƒjtjƒ}|s"dStjƒjtjƒ}||krJdSttjƒƒ}||krldSt|ƒdS(N(    RRRRtDef_SetOpenServerTimeR.R)R*tOnNewServerOpen(R!tsetOpenServerTimetcurOpenServerTimetcurTime((suD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\GameWorldLogic\GameWorldEvent.pytDoCheckNewServerOpen£s  
cCstjƒjƒ}tjd|ƒtjƒjtjƒ}|sEdStj    tjg}tjƒj
|ƒtj ƒj ƒtj ƒj ƒtjƒjƒtjƒjƒtjƒjƒtjƒjtjdƒt|ƒt|ƒtjdtƒtjdƒdS(sзþ¿ªÆôÐèÒª´¦ÀíµÄÂß¼­s#Ö´ÐÐÕýʽ¿ª·þÖØÖÃÂß¼­... serverID=%sNitsaveToDBtClearOpenServerOK(RR$R%RRRRRRJR.t    DelAllKeytGetBillboardMgrt
DelAllDatat GetGameRecMgrt GetFamilyMgrt DelAllFamilyt
GetMailMgrt
DelAllMailtGetPlayerViewCacheMgrt DelAllCacheRt Def_CanCrossR0RItBackupGameWorldDataR3t SendGameError(R!R5RLt excludeList((suD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\GameWorldLogic\GameWorldEvent.pyRK³s$
 
 cCsÆtj|ƒ}|jƒd}tjƒjtj|ƒtjƒjtj|ƒtj    d|||fƒtjƒj
tj ƒ}|rÂ||krÂtjƒjtj |ƒtj    d|ƒndS(NisÉèÖÿª·þʱ¼ä: %s(%s), ÖÜ%ss%    Í¬²½¸üРDef_SetOpenServerTime=%s( RtChangeTimeNumToDatetimetweekdayRRRRR.R/RRRJ(tinitTimet openDatetimeR8RL((suD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\GameWorldLogic\GameWorldEvent.pyR0ÕscCs½tjƒjtjƒ}|s"dStjƒjtjƒ}|rQtjdƒdStjdƒtjƒj    tjdƒtjƒjtj
ƒ}tjƒj    tj |ƒtjd|ƒdS(NsºÏ·þÊ×´ÎÆô¶¯¼ÓÔØÒѾ­´¦Àí¹ý£¡sºÏ·þÊ×´ÎÆô¶¯¼ÓÔØ´¦Àí...is&    ºÏ·þÊ×´ÎÆô¶¯¼ÓÔØ³É¹¦! serverDay=%s( RRRRRBtDef_IsMixServerInitOKRtDebugLogRRRAtDef_LastMixServerDay(RGtisMixServerInitOKRF((suD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\GameWorldLogic\GameWorldEvent.pyR1âs  cCstjs dSttjƒƒ}tjs4|t_n|tjkrstjdtjtjƒƒ|t_tƒn|tj}|dkrdS|dkrÉtjd|tjtjƒfƒtƒn|t_tj    ræt
ƒdSt j ƒj ƒtj||ƒt|ƒdS(Nsʱ¼ä»Øµ÷ÁË: lastProcessTime=%sii
s/ʱ¼äÎó²î¹ý´ó: passSeconds=%s,lastProcessTime=%s(R"R;R)R*tg_highProcessTimeRRtChangeTimeNumToStrtOnFixServerTimeProcesstg_serverClosingtCheckCloseMapOKRt GetUserCtrlDBtonSecondProcesstCrossMgrtOnSecondProcessR>(R!RNt passSeconds((suD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\GameWorldLogic\GameWorldEvent.pyR=s.             
   #
        
cCsktjƒ}xXt|jƒƒD]D}|j|ƒ}tj|ƒsIqntj|ƒtj|ƒqWdS(N(    RtGetPlayerManagertxrangetGetPlayerCounttGetPlayerByIndextIsNormalPlayertChPlayertSync_PyServerDataTimeToClienttSync_OpenServerDay(t playerManagertit    curPlayer((suD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\GameWorldLogic\GameWorldEvent.pyRj's  cCsÒtjƒ}|j}|tjkr(dS|t_t|ƒtj|ƒt|ƒt    j
|ƒ|ddkrt ||ƒnt j|ƒt jƒtjƒtjƒtj|ƒtj|ƒt|ƒdS(Nii(RtGetCurrentTimetminuteR"tg_minuteProcessRORR>tDoLogic_GameWorldEvenByTimetGameWorldActiontOnProcessGameActiont
OnMinute_5t PlayerControlt PlayerFamilyt PlayerOnlinet    BattleObjtObjPoolR2t__CheckIpyDataRecycle(R!RNt    curMinute((suD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\GameWorldLogic\GameWorldEvent.pyR>6s&         
 
 
 
 
 
cCst||ƒdS(N(tDisposeGameActivePlayer(RNR!((suD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\GameWorldLogic\GameWorldEvent.pyRƒSs cCsg|j}tjƒ}|jdƒ}||kr4dS|jd|ƒtjƒjƒ}tj|ƒdS(Nt
OnlineCntM(    R~RR$tGetGameWorldDictByKeytSetGameWorldDictRrt OnlineCountRDtDR_OnLinePlayerCount(RNR!RŠt    gameWorldtnoteDatatactivePlayerCount((suD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\GameWorldLogic\GameWorldEvent.pyR‹Xs       cCsQtjƒsdStjƒjtjƒ}t|d|ƒrMtj    d|ƒndS(NtgmEvent(
Rt IsCrossCenterRRRRtDef_CrossCenterEventtDoLogic_CrossCenterEventRotSendCrossServerEvent(R”tserverEventValue((suD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\GameWorldLogic\GameWorldEvent.pytOnGM_CrossCenterEventds  c Cs°tjƒrStjtjttjƒƒtjƒƒ}t|ƒrOt    j
ƒndStj ƒscdSt j j ƒ}|j}|j}t j j|ƒd}|j}|j}tƒ\}}    }
} } ||ksô|    |ksô| |ksô| |krtƒt|ƒn|    |ks,| |ks,| |kr@tƒt|ƒn|
|kr`tƒt|ƒn| |ksx| |krŒtƒt|ƒn| |kr¬tƒt|ƒndS(sö¿ç·þʼþÓÉ¿ç·þÖÐÐÄ·þÎñÆ÷Çý¶¯£¬ÓÎÏ··þʹÓÃÔ­·½Ê½
    ¿ç·þÖÐÐÄOnEvent -> ÆäËû·þÎñÆ÷OnEvent (°üº¬¸ö³£¹æ¿ç·þ·þÎñÆ÷¼°ÓÎÏ··þ£¬²»±£Ö¤Ë­ÏÈÖ´ÐÐ)
        ¸ö±ð¹¦ÄÜÈç¹ûÐèҪȷ±£¿ç·þÏÈÖ´ÐÐEvent£¬ÔÙ´¦ÀíÓÎÏ··þEvent£¬¿ÉÒÔÓɹ¦ÄÜÇý¶¯¿ç·þÏÈÖ´ÐУ¬ÔÙͬ²½ÓÎÏ··þÖ´ÐÐ
    Ni(RR•tToIntDefRiR)R*tChConfigtTYPE_Time_Format_YmdHR—RoR˜t IsMainServerRRRRRR R    RRtOnHourRtOnDayRtOnWeekRtOnMonthR
tOnYear( R!t
eventValueRNt curTimeHourt
curTimeDayt curTimeWeekt curTimeMontht curTimeYeart
serverHourRFt
serverWeekt serverMontht
serverYear((suD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\GameWorldLogic\GameWorldEvent.pyR€ls< *                   0 $      cCstjdƒtj|ƒdS(NsServer -> OnHour!(RRtPlayerEventCountertDoLogic_OnHour(R!((suD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\GameWorldLogic\GameWorldEvent.pyRŸ¢s  cCs‘tjdƒtjƒ}|jtjƒ}|jtjƒ}d}|r^|jtj    ƒ}ntjd|d||dfƒt
j |ƒdS(NsServer -> OnDay!is4OnDay -> serverDay=%s,isMixServer=%s,mixServerDay=%si( RRRRtSetValueIncrementRRARRBRCR®t DoLogic_OnDay(R!teventMgrRFRGRH((suD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\GameWorldLogic\GameWorldEvent.pyR §s  " cCs:tjdƒtjƒ}|jtjƒtj|ƒdS(NsServer -> OnWeek!(    RRRRR°RtDef_ServerWeekR®tDoLogic_OnWeek(R!R²((suD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\GameWorldLogic\GameWorldEvent.pyR¡µs
   cCstjdƒtj|ƒdS(NsServer -> OnMonth!(RRR®tDoLogic_OnMonth(R!((suD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\GameWorldLogic\GameWorldEvent.pyR¢½s  cCstjdƒtj|ƒdS(NsServer -> OnYear!(RRR®tDoLogic_OnYear(R!((suD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\GameWorldLogic\GameWorldEvent.pyR£Âs  itcCs“tjƒjtjƒ}||krR| rR|rNtjd|||fƒndS|rxtjd||||fƒntjd|||fƒtjd|tj    ƒ}tjd|tj    ƒ}|j
}|j }t j j |ƒd}|j}    |j}
|j
} |j } t j j |ƒd} |j}|j}tjƒjtj|ƒt}|| ks“|| ks“|    |ks“|
|ks“|d
kr©t}tj|ƒn|| ksÙ|    |ksÙ|
|ksÙ|d krït}tj|ƒn|| ks|d krt}tj|ƒntjƒrtjƒ}xWt|jƒƒD]@}|j|ƒ}tj|ƒsrqHntj||d    |ƒqHWn|S( NsY±¾·þÓë¿ç·þÖÐÐÄʼþÖµÏàͬ²»´¦Àí! serverEventValue=%s,centerEventValue=%s,centerServerID=%ss^±¾·þÓë¿ç·þÖÐÐÄʼþÖµ±ä»¯! serverEventValue=%s,centerEventValue=%s,centerServerID=%s,gmEvent=%ssL¿ç·þÖÐÐÄ·þÎñÆ÷ʼþÖµ±ä»¯! serverEventValue=%s,centerEventValue=%s,gmEvent=%ss%sitGMOnHourtGMOnDaytGMOnWeekR”(R¸R¹Rº(R¹Rº(Rº(RRRRR–RRtChangeStrToDatetimeRœRRRRRR R    RtFalseR3R®tDoLogic_CrossCenterOnHourtDoLogic_CrossCenterOnDaytDoLogic_CrossCenterOnWeekRžRrRsRtOnlineAtRvtPlayerOnCrossCenterEvent(tcenterEventValuetcenterServerIDR”R™tserverEventTimetcenterEventTimeRªRFR«R¬R­t
centerHourt    centerDayt
centerWeekt centerMontht
centerYeartisEventRzR{R|((suD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\GameWorldLogic\GameWorldEvent.pyR—ÇsN                                 <0  cCsŽtjƒjƒ}|r%dt_dStj|ƒ}tjsJ|t_dStjdkr]dS|tjdkrtdSdt_tjjƒdS(Niiiii€Q(    RRrRR"tg_ipyDataRecycleCheckTimetChangeDatetimeToNumt IpyGameDataPYtIPYDatatRecycle(ttimeNowt playerCountRN((suD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\GameWorldLogic\GameWorldEvent.pyR‰s                 cCsÌtjƒjƒ}tjd|ƒdt_tjƒ}xƒt|jƒƒD]o}|j    |ƒ}| sK|j
ƒdksK|j ƒr‹qKntj |ƒrªt j|ƒqK|jtjƒqKWtjƒdS(Ns'µØÍ¼·þÎñÆ÷¹Ø±Õ¿ªÊ¼±£´æÊý¾Ý! serverID=%sii(RR$R%RR"RkRrRsRtRutGetIDtIsEmptytIsMirrorPlayerR„t DeleteMirrortKickt IPY_GameWorldtdisMapServerCloseRt OnServerClose(R!R5RzR{R|((suD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\GameWorldLogic\GameWorldEvent.pytCloseMap*s     %
cCs«tjdkrdStjs dStjƒjƒr6dStjƒddlm    }ddl
m }d}|j ||j ƒ}tj|t|ƒƒtjdƒdt_dS(    sB¼ì²éµÈ´ý¹Ø·þÊý¾Ý´¦ÀíÍê±Ï
    Ã»ÓÐÍæ¼ÒÁË£¬ÇÒ¹«¹²Êý¾ÝÒÑÈë¿âÍê±Ï
    iNiÿÿÿÿ(t CommonDefine(tCommFuncR·spython ÒÑ´¦ÀíµØÍ¼¹Ø±ÕÂß¼­i(R"Rktg_closeSaveDataOKRRrRRtClearBackupFiletPyMongoDB.DBCommonRÜtPyMongoDB.CommonRÝt    WriteBYTEtdgPlayerSaveGameServerDatat NetPackCommontSendPyPackToMapServerSelftlenR(RÜRÝtdata((suD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\GameWorldLogic\GameWorldEvent.pyRl>s    
     (:RoRœRRRR…RÎRØRDR®R2RR„RäR†RR"R‡RwRˆRR*RR
R RRRRRRRRRR R4RIR(RORKR0R1R=RjR>RƒR‹RšR€RŸR R¡R¢R£R—R‰RÛRl(((suD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\GameWorldLogic\GameWorldEvent.pyt<module>sr                                                                           &    #                "              %                         6                    G