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
b‰ic@svdZddlZddlmZddlmZdZdZdZdd d    „ƒYZd
„Z    d „Z
d „Z dS(s/
¿Í»§¶Ë¹ÜÀíÆ÷
ÓÃÓÚ¹ÜÀí¿Í»§¶ËÁ¬½Ó״̬ºÍµÇ¼״̬
iÿÿÿÿN(tLOGIN_MAGIC_CODE(t packet_loggeriiit
ClientsMgrcBs‰eZdZd ZejƒZd„Ze    d„ƒZ
d„Z d„Z d„Z d„Zd„Zd„Zd    „Zd
„Zd „ZRS( s¿Í»§¶Ë¹ÜÀíÆ÷µ¥ÀýÀàcCsb|jdkr[|j>|jdkrRtt|ƒj|ƒ|_t|j_nWdQXn|jS(N(t    _instancetNonet_locktsuperRt__new__tFalset _initialized(tcls((s#.\\EventServerPY\clients_manager.pyRs 
cCs%|jdkr|ƒ|_n|jS(s »ñÈ¡µ¥ÀýʵÀýN(RR(R
((s#.\\EventServerPY\clients_manager.pytinstance!scCsDt|dtƒrdSt|_i|_i|_tjƒ|_dS(NR    (    tgetattrRtTrueR    t
status_mapt server_id_mapt    threadingtLocktmap_lock(tself((s#.\\EventServerPY\clients_manager.pyt__init__(s             cCs!|j||j|<WdQXdS(sÉèÖÿͻ§¶Ë״̬N(RR(Rtcidtstatus((s#.\\EventServerPY\clients_manager.pytset_client_status1s
cCs'|j|jj|tƒSWdQXdS(s»ñÈ¡¿Í»§¶Ë״̬N(RRtgettCLIENT_STATUS_NOT_CONNECT(RR((s#.\\EventServerPY\clients_manager.pytget_client_status6s
cCs!|j||j|<WdQXdS(sÉèÖÿͻ§¶Ë¶ÔÓ¦µÄServer IDN(RR(RRt    server_id((s#.\\EventServerPY\clients_manager.pytset_client_server_id;s
cCs'|j|jj|dƒSWdQXdS(s»ñÈ¡¿Í»§¶Ë¶ÔÓ¦µÄServer IDiN(RRR(RR((s#.\\EventServerPY\clients_manager.pytget_client_server_id@s
cCsL|j=||jkr&|j|=n||jkrB|j|=nWdQXdS(sɾ³ý¿Í»§¶Ë»º´æÊý¾ÝN(RRR(RR((s#.\\EventServerPY\clients_manager.pytdel_client_cacheEs
 
 cCs|j|ƒdS(s¿Í»§¶Ë¶Ï¿ªÁ¬½Óʱµ÷ÓÃN(R(RR((s#.\\EventServerPY\clients_manager.pyton_client_disconnectMscCsF|j7g|jjƒD]\}}|tkr|^qSWdQXdS(s»ñÈ¡ËùÓÐÒѵǼµÄ¿Í»§¶ËIDÁбíN(RRtitemstCLIENT_STATUS_LOGIN(RRR((s#.\\EventServerPY\clients_manager.pytget_logged_in_clientsQs
cCs.|j|jjƒ|jjƒWdQXdS(sÇå¿ÕËùÓпͻ§¶ËÊý¾ÝN(RRtclearR(R((s#.\\EventServerPY\clients_manager.pyR#Vs
 N(t__name__t
__module__t__doc__RRRRRRt classmethodR RRRRRRRR"R#(((s#.\\EventServerPY\clients_manager.pyRs                                         cCsƒtjƒ}|jtkr?tjd|t|jfdƒtS|j||jƒ|j    |t
ƒtjd||jfdƒt S(s´¦Àí¿Í»§¶ËµÇ¼ÇëÇós>Invalid magic code from client %d, expected 0x%08X, got 0x%08XtERRORs Client %d logged in - Server: %dtINFO( RR t
magic_codeRRtlog_textRRRRR!R (Rtpackett clients_mgr((s#.\\EventServerPY\clients_manager.pyt handle_login]s     cCs1tjƒ}|j|ƒtjd|dƒdS(s´¦Àí¿Í»§¶ËµÇ³öÇëÇósClient %d logged outR)N(RR RRR+(RR,R-((s#.\\EventServerPY\clients_manager.pyt handle_logoutms  cCs.tjƒ}|j|ƒ}|tkr*ndS(s´¦Àí¿Í»§¶ËÐÄÌø°üN(RR RR!(RR,R-R((s#.\\EventServerPY\clients_manager.pythandle_heartbeatts
  (( R&RtprotocolRRRtCLIENT_STATUS_NOT_LOGINR!RR.R/R0(((s#.\\EventServerPY\clients_manager.pyt<module>s J