cehua_hzl
2018-09-18 ed4a70b51a3ae5b8c5acd39c0522348eecc31fad
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
š:—[c@s¡ddlZddlmZddlZddlZddlmZddlZddl    Z    defd„ƒYZ
dd
d„ƒYZ da d„Zd    „ZdS( iÿÿÿÿN(t ProjectRobot(tThreadtAIThreadcBs#eZd„Zd„Zd„ZRS(cCsTtj|ddd|ƒ||_g|_d|_d|_d|_d|_dS(Ns AIThreadPy_%sii(    Rt__init__tNonetrobotMgrtAIListtlastTimet badRobotCnttProcessFindTJGTimet lastLoginTime(tselfRtindex((s.\\RobotMgr.pyRs                    c
Cs&tjd|jƒƒxtr!yºtjƒ}|jr2||j|jkr2||_|jjƒ}|jj    j
ƒ}g}xxt t |ƒƒD]d}|j ƒ}|d|krÆdG|dGHq‘n|jj|ƒ}|j|ƒ|dkr‘Pq‘q‘Wx6|D]+}|sqn|jƒs|jƒqqWnxst |jjƒƒD]\}||jjƒkrgPny|jj|ƒ}WnPnX|s”qHn|jƒjƒqHW|js½||_ntjdƒx¨t |jjƒƒD]‘}|jj|ƒ}|s&dGH|jj|ƒ|jd7_Pn|jƒràdGHtjd|jƒƒ|jj|ƒ|jd7_PqàqàWtjƒ}||jd    krÙd
|jjƒ|jjƒfGH||_|jrÙd |jGHqÙnWqtk
r}    tjd t |    ƒƒtjd t!j"ƒƒqXqWdS( Nsthread %s startisÕýÔڵǼÖÐ------i
g{®Gáz”?s====ûÓлúÆ÷ÈËs ++++++±»´Ý»ÙsGetNeedDestroy __peer:0x%08X i sÍÑ»ú¹ÒÍæ¼ÒÊýÁ¿: %s - %ss²Î¿¼-ÀúÊ·Òì³£ÍÑ»ú¹Ò´ÎÊý£º%ss AIThread: %s(#tloggingtinfotgetNametTruettimeR
R    RtGetRobotAccIDListtdbRobott GetTokenListtxrangetlentpoptAddRobottappendt IsConnectedt ReCreateRobott GetRobotCounttGetRobottGetAIMgrt    ProcessAItsleeptRemoveRtGetNeedDestroytdebugt GetPeerValueRtGetLoginOKRobotCountt    Exceptionterrortstrt    tracebackt    print_exc(
R tnowTimet logoningListt    tokenListt    robotListtit    tokenInfotrobotR te((s.\\RobotMgr.pyt    runThreadst                       !        cCs|j}|ƒdS(N(R3(R trunM((s.\\RobotMgr.pytrunps    (t__name__t
__module__RR3R5(((s.\\RobotMgr.pyRs         StRobotMgrcBskeZd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Z    d„Z
d    „Z d
„Z RS( cCsS||_d|_g|_g|_||_i|_t|dƒ}|jƒdS(Ni(t_RobotMgr__asioMgrt_RobotMgr__robotNumt_RobotMgr__robotst_RobotMgr__robotAccIDsRtTeamMgrRtstart(R tasioMgrRtth((s.\\RobotMgr.pyRys                        cCs>g|_x+|jD] }|jj|jƒdƒqW|jS(Ni(R<R;RtGetRobotConfig(R R1((s.\\RobotMgr.pyRˆs    cCs:tjd|fƒt|j|ƒ}|jj|ƒ|S(NsCreate Robot index:%s.....(R R#RR9R;R(R R0R1((s.\\RobotMgr.pyRŽscCs t|jƒS(N(RR;(R ((s.\\RobotMgr.pyR˜scCs7d}x*|jD]}|jƒr|d7}qqW|S(Nii(R;R(R tnR1((s.\\RobotMgr.pytGetConnectedRobotCountœs
 cCsMd}x@|jD]5}|jƒr/|d7}qtjd|jƒƒqW|S(Niis!!!not login :0x%08X(R;t GetIsLoginOKR R#R$(R RBR1((s.\\RobotMgr.pyR%¤s   cCs |j|S(N(R;(R R ((s.\\RobotMgr.pyR»scCs|jj|ƒdS(N(R;tremove(R R1((s.\\RobotMgr.pyR!ÀscCsP|jƒjƒ}tjd|ƒ|jƒ||jkrL|j|ƒndS(NsDisconnectServer for %s(t GetPlayerInfotGetAccIDR R#t DestroyRobotR;R!(R R1taccID((s.\\RobotMgr.pytDisconnectServerÄs
 
cCs.tjd|ƒ|j|ƒ}|s*tSdS(NsStartAI for %d(R R#RtFalse(R R R1((s.\\RobotMgr.pytStartAIÎscCs.tjd|ƒ|j|ƒ}|s*tSdS(Ns StopAI for %d(R R#RRK(R R R1((s.\\RobotMgr.pytStopAIÚs( R6R7RRRRRCR%RR!RJRLRM(((s.\\RobotMgr.pyR8ws            
                        
     cCstst||ƒandS(N(t __gRobotMgrR8(R?R((s.\\RobotMgr.pytCreateRobotMgrscCstS(N(RN(((s.\\RobotMgr.pyt GetRobotMgr s((R tProjectBinding.ProjectRobotRt&ConfigurationReader.RobotsConfigReadertConfigurationReadert#ConfigurationReader.ConfigIniReadert    threadingRR)RRR8RRNRORP(((s.\\RobotMgr.pyt<module>s     gŒ