hxp
3 天以前 8e76a6859474df07c12e0b4ff0ea3bfd321675eb
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
ã…ic@súddlZddlZddlZddlZddlZddlZddlZddlZddlZddl    Z    dZ
e
dZ ddd„ƒYZ ddd„ƒYZ d„Zd    „Zd
„Zd „Zd „Zdejd „Zd„ZdS(iÿÿÿÿNi
itSSServercBs_eZdZd„Zd„Zd„Zd„Zd„Zd„Zd„Z    d„Z
d    „Z RS(
s4 ÆäËû·þÎñÆ÷¶ÔÏ󣬿ÉÒÔÊÇ¿ç·þ·þÎñÆ÷¡¢ÆäËûÓÎÏ··þµÈ
    cCs(||_d|_d|_d|_dS(Ni(t    _serverIDt _serverTypet
_connStatet _heartCurTime(tselftserverID((soD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\GameWorldLogic\CrossMgr.pyt__init__As
                cCs|jS(N(R(R((soD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\GameWorldLogic\CrossMgr.pyt GetServerIDHscCs|jS(N(R(R((soD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\GameWorldLogic\CrossMgr.pyt GetServerTypeIscCs ||_dS(N(R(Rt
serverType((soD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\GameWorldLogic\CrossMgr.pyt SetServerTypeJscCs|jS(N(R(R((soD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\GameWorldLogic\CrossMgr.pyt GetConnStateKscCs ||_dS(N(R(Rt    connState((soD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\GameWorldLogic\CrossMgr.pyt SetConnStateLscCs|jS(N(R(R((soD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\GameWorldLogic\CrossMgr.pytGetHeartCurTimeMscCs ||_dS(N(R(RtcurTime((soD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\GameWorldLogic\CrossMgr.pytSetHeartCurTimeNscCs|jtjkrtStS(N(Rt ShareDefinet ssConn_NormaltFalsetTrue(R((soD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\GameWorldLogic\CrossMgr.pyt IsServerOpenOs( t__name__t
__module__t__doc__RRR    R R RRRR(((soD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\GameWorldLogic\CrossMgr.pyR=s                                t SSServerMgrcBs\eZd„Zd„Zd„Zd„Zd„Zdd„Zd„Zd„Z    d    „Z
RS(
cCsCi|_d|_d|_g|_d|_d|_d|_dS(Ni(t _ssServerDictt
_heartTimet_disconnectedCheckTimet_crossServerIDListt_crossCenterIDt
_crossTimet_crossTimeCurTime(R((soD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\GameWorldLogic\CrossMgr.pyR]s                            cCs<||jkr|j|}nt|ƒ}||j|<|S(N(RR(RRtssServer((soD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\GameWorldLogic\CrossMgr.pyt GetSSServeris
  cCs›tjƒsdS|jr?||jkr?||jtkr?dS||_tjƒ}tjƒjƒ|_tj    ƒ|_
||_ t j |dtjƒdS(NtdirType(t    GameWorldt IsCrossServerRt
HeartBreattChServerToServerPyPackt
tagSSHeartt GetGameWorldRtServerIDR    t
ServerTypet
ServerTimet NetPackCommontSendCrossServerToServerPackRtdirType_MainAndCross(RRtpack((soD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\GameWorldLogic\CrossMgr.pyt DoHeartbeatqs +         c Cs    ttjƒƒ}|j|ƒ}|j|ƒ|j|ƒ|jƒ}|tjkrþ|jsk||_n|}|j    ƒ}|j
||ƒ||}    t |    ƒdkrþt j d|    ƒt j dt j|ƒƒt j dt j|ƒƒtjƒqþn|tjkrdS|jtjƒ|tjkr6tnt}
|tjtjgkr×|tjkr‰t j d||
t j|ƒfƒn)|tjkr²t j d||
fƒn||jkrõ|jj|ƒqõnt j d|||
fƒdSt|||
ƒdS(Nis<±¾·þµÄ¿ç·þʱ¼äÓë¿ç·þʵ¼Êʱ¼äÎó²î¹ý´óͬ²½Ç°¶Ë! diffSeconds=%sscurCrossTime=%ssupdCrossTime=%ssCÁ¬ÉÏ¿ç·þÖÐÐÄ·þÎñÆ÷: crossServerID=%s,isReconn=%s,crossServerTime=%ss0Á¬Éϳ£¹æ¿ç·þ·þÎñÆ÷: crossServerID=%s,isReconn=%ss5Á¬ÉÏÆäËû·þÎñÆ÷: serverID=%s,serverType=%s,isReconn=%s(tintttimeR#R RR RtserverType_CrossCenterRt GetCrossTimet SetCrossTimetabsR%tLogtChangeTimeNumToStrtChPlayertSync_PyServerDataTimeToClientRRtssConn_DisconnectedRRtserverType_CrossRtappendtOnConnCrossServer( RRR
t
serverTimeRR"t befConnStatet updCrossTimet curCrossTimet diffSecondstisReconn((soD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\GameWorldLogic\CrossMgr.pyt OnServerHeartˆs@         
&cCsNttjƒƒ}|js|S|jtd||jƒ7_||_|jS(Ni(R3R4R tmaxR!(RR((soD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\GameWorldLogic\CrossMgr.pyR6¼s         icCs.||_|r|nttjƒƒ|_|S(N(R R3R4R!(RRAR((soD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\GameWorldLogic\CrossMgr.pyR7Æs    !cCs|jS(N(R(R((soD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\GameWorldLogic\CrossMgr.pytGetCrossCenterIDÌscCs|jS(N(R(R((soD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\GameWorldLogic\CrossMgr.pytGetCrossServerIDListÍscCs'|j s||jkr&||_dS||jdkr=dS||_xÚ|jjƒD]É}|jƒtjkrwqVn|jƒ}|sqVn||kr¡qVn||tkr·qVn|jtj    ƒ|j
ƒ}|j ƒ}|tj krt jd||fƒqVt jd||fƒqVWdS(Ni
s+Óë¿ç·þ·þÎñÆ÷¶Ï¿ª: serverID=%s,serverType=%ss+ÓëÆäËû·þÎñÆ÷¶Ï¿ª: serverID=%s,serverType=%s(RRtvaluesR RRRtDisconnectedTimeRR=RR    R>R%R9(RRR"t lastHeartTimeRR
((soD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\GameWorldLogic\CrossMgr.pytCheckSSServerDisconnectedÏs.            ( RRRR#R2RGR6R7RIRJRN(((soD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\GameWorldLogic\CrossMgr.pyRZs                 4    
        cCs(tj}|s$tƒ}|t_n|S(N(t
PyGameDatat g_ssServerMgrR(tssMgr((soD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\GameWorldLogic\CrossMgr.pytGetSSServerMgrós
         cCs'tƒ}|j|ƒ|j|ƒdS(N(RRRNR2(ttickRRQ((soD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\GameWorldLogic\CrossMgr.pytOnSecondProcessús      cCs^|j}|j}|j}|tjƒjƒkr7dStjsDdStƒj    |||ƒdS(N(
R+R,R-R%R*RROtg_serverInitOKRRRG(tnetPackRR
RA((soD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\GameWorldLogic\CrossMgr.pyRG
s                cCsxtjƒ}tjƒ}tjƒjƒ|_||_||_t    j
||gd|ƒtj ƒrtt j |ƒndS(NR
(R%R    R(ttagSSServerConnOKR*RR+R,tIsReconnR.R/t IsMainServerR;tSyncOnlinePlayerToCross(R
RRFt curServerTypeR1((soD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\GameWorldLogic\CrossMgr.pyR@s           cCs½|j}|j}|j}tjƒ}tjd||||fƒ|tjkr‚t|gdt    j
|ƒƒt j ||ƒn|tj kr¹|tjtjgkr¹t j|ƒndS(NsJÊÕµ½·þÎñÆ÷Á¬½Ó³É¹¦: serverID=%s,serverType=%s,isReconn=%s,curServerType=%sR$(R+R,RXR%R    R9RR5tSendCrossServerEventR.tGetSSPackDirTypetDBFamilytSync_CenterToCross_FamilyInfotserverType_MainR>tSync_CrossToServer_FamilyInfo(RVRR
RFR[((soD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\GameWorldLogic\CrossMgr.pytOnServerConnOK0s             'cCsbtjƒ}tjƒjƒ|_tjƒ|_tj    ƒj
t j ƒ|_ tj|||ƒdS(N(R(ttagSSCrossCenterEventR%R*RR+R    R,t    DBDataMgrtGetEventTrigMgrtGetValueRtDef_CrossCenterEventt
EventValueR.R/(t serverIDListR$R1((soD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\GameWorldLogic\CrossMgr.pyR\Js  cCs\|j}|j}|j}tjd|||fƒ|tjkrHdStj||ƒdS(Ns?ÊÕµ½·þÎñÆ÷ʼþ±ä¸üͬ²½: serverID=%s,serverType=%s,eventValue=%s(    R+R,RhR%R9RR5tGameWorldEventtDoLogic_CrossCenterEvent(RVRR
t
eventValue((soD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\GameWorldLogic\CrossMgr.pytOnCrossCenterEvent\s            (((R%RORjR(R.RRdR^R;R4R'RLRRRRRTRGR@RbtNoneR0R\Rm(((soD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\GameWorldLogic\CrossMgr.pyt<module>s(          
™