hch
2025-10-14 ea3377678e9179f4265bcc0d749c4686a69be158
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
œÔíhc@séddlmZddlZddlmZddlZddlmZddlZddl    m
Z
ddlm Z ddl    m Z m
Z
m Z ddlZddlZedƒZd    ejfd
„ƒYZdad „Zd „ZdS( iÿÿÿÿ(tAsyncoreClientN(tmylog(tMergeServerRecvProtocol(t CommonDefine(t
MMORPGPack(tSingletonObjectRterrorsConfig.DBConfigtServerRouteClientcBs‰eZdZdZd„Zd„Zd„Zd„Zd„Zd„Z    d„Z
d    „Z d
„Z d „Z d „Zd „Zd„ZRS(iicCs~tjj|ƒ||_||_|j||fƒt|_tjƒ|_tjƒ|_    tjƒ|_
t j ƒ|_ dS(N( Rt__init__tiptporttconnecttTruet is_reconnectttimetlastReconnectTimetlast_heartbeat_timetlast_ServerHeartbeat_timetQueuet_ServerRouteClient__recvQueue(tselfR    R
((s$.\\ServersRoute\ServerRouteClient.pyRs            cCs|jtƒ|jƒdS(N(t    SetActiveR tLogin(R((s$.\\ServersRoute\ServerRouteClient.pythandle_connect(s cCsÑtjr&tjdtj|ƒƒntjƒjƒ}d|j    |ƒkr‰t
j dt
j dƒ}tj
|ƒtjƒj |ƒdStjd|jjƒƒ|jj|ƒtjd|jjƒƒdS(s»ñµÃ²ð½âºóµÄ·â°üsbuf = %siÿÿÿÿRserror in pack.readDataNsbefore put:recv queue cnt = %ssafter put:recv queue cnt = %s(Rt
DUMPPACKETRtdebugtbinasciitb2a_hexRt getPackPooltalloctreadDataRt    formatMsgt ERROR_NO_135tfreeRtqsizetput(Rtbuftpacktmsg((s$.\\ServersRoute\ServerRouteClient.pyt    onGetPack-s     cCstjd|j|jfƒtjƒ|_tjƒ|_t|_t    j
ƒ}t j |_ tt j ƒ|_tttjƒƒƒ|_t|jƒ|_tjƒ}|j|j |jƒ|jƒ}||_t|ƒ|_t j |_ tt j ƒ|_|j|jƒƒdS(sÁ¬½Ó³É¹¦ºóµÄ´¦ÀísConnected to %s:%s now loginN(RtinfoR    R
RRRtFalseR RttagLPLoginPacktDBConfigt    GroupNamet
ClientGUIDtlentGUIDLentstrtintt    TimeStamptTimeLentmd5tnewtupdatet    hexdigestt
VerifyCodetCodeLentNameLent
SendStringt    GetBuffer(RR%tmd5Objtresult((s$.\\ServersRoute\ServerRouteClient.pyR@s"             cCs[tjƒjƒ}tj|jƒ_|j|ƒ|j|j    ƒƒtjƒj
|ƒdS(N( RRRRt
atMergeSyst getPackHeadttypet    setBuffertpushSendt getPackDataR!(RR$tsendPack((s$.\\ServersRoute\ServerRouteClient.pyR;[s
 cCs|j|jƒƒdS(N(RCRD(RR%((s$.\\ServersRoute\ServerRouteClient.pytSendPackescCs$|jƒt|_tjdƒdS(s¶Ï¿ªÁ¬½ÓºóµÄ´¦Àít DisconnectedN(t
disconnectR R RR((R((s$.\\ServersRoute\ServerRouteClient.pyt handle_closeis
    cCs/y|jjƒ}Wntjk
r*dSX|S(N(Rt
get_nowaitRtEmptytNone(RR%((s$.\\ServersRoute\ServerRouteClient.pytrecvQueuePopNoWaitqs
cCs|jƒ|jƒdS(s¸üз½·¨N(t    ReConnecttsend_heartbeat(R((s$.\\ServersRoute\ServerRouteClient.pytUpdate{s
cCs¡|js dStjƒ|j|jkr-dStjƒ|_tjdƒ|jr_|jƒn|jtj    tj
ƒ|j |j |j fƒtjƒ|_dS(s
ÖØÁ¬½Ó·½·¨Nt Reconnecting(R RRtReconnectIntervalRR(tsockettcloset create_sockettAF_INETt SOCK_STREAMR R    R
R(R((s$.\\ServersRoute\ServerRouteClient.pyRNs          cCstjƒ|_dS(N(RR(R((s$.\\ServersRoute\ServerRouteClient.pytRefreshServerHeartbeat’scCsÎ|jr dStjƒ|j|jkr-dStjdƒtjƒ}|j|j    ƒƒtjƒ|_tjƒ|j
|jdkrÊtj dƒtj ƒ}|j|j    ƒƒ|j ƒt|_ndS(s
·¢ËÍÐÄÌø°üNisServer heartbeat timeout(R RRtHeartbeatIntervalRRRttagLPHeartbeatR;R<RR(ttagLPLogoutPackRHR (RR%((s$.\\ServersRoute\ServerRouteClient.pyRO–s         
cCs#tjƒ}|j|jƒƒdS(N(RR[R;R<(RR%((s$.\\ServersRoute\ServerRouteClient.pytLogOut¬s (t__name__t
__module__RYRRRRR'RR;RFRIRMRPRNRXROR\(((s$.\\ServersRoute\ServerRouteClient.pyRs                     
            
                cCs
|adS(N(t__ServersRouteChild(R((s$.\\ServersRoute\ServerRouteClient.pytSetServersRouteChild²scCstS(N(R_(((s$.\\ServersRoute\ServerRouteClient.pytGetServersRouteChild¶s(tNetCoreRRtCommonRRStProtocolRR4tDBCommonRRRRRRt
__import__R+RRLR_R`Ra(((s$.\\ServersRoute\ServerRouteClient.pyt<module>s      š