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
¹}Ãic@sZddlTddlmZmZddlmZddlZddlZddlZddlZddl    Z    ddl
m Z ddl m Z ddlTddlmZmZddlmZmZdd    lmZd
„Zed ƒdad „Zd „Zddd„ƒYZddd„ƒYZd„Zd„Zd„Z ddd„Z!d„Z"dS(iÿÿÿÿ(t*(tGlobalFunctionst CommonDefine(tGMCommonN(tfix_incomingText(tDataServerPlayerData(t
CommFuncExtmylog(t
MMORPGPacktRecvPackProtocol(t ServersConfigc    Csôtjƒ}xátjd||fƒD]Æ\}}}x´|D]¬}tjj||ƒ}|j|dƒ}|dt|ƒ!}|jdƒdkr—q<n|j    dƒ}|d}|d}|d
krÌq<n|jd    dƒ}t
|ƒq<Wq&WdS( Ns%s\%stit__init__is.tpyctpys\(R R( Rt
getAppPathtostwalktpathtjointreplacetlentfindtsplitt
__import__(    t    importDirtcurPathtroottdirstfilestfiletfileNamet curFileListtext((sw.\ServersRoute\TCode\TeamServer\Server4\Servers\PyMongoDataServer\ServersRoute\GMToolLogicProcess\ProjSpecialProcess.pytImportCommandAll4s ) 
 
 sGMToolLogicProcess\Commandsc Cs¥tjdƒ|j}|j}|j}|j}|j}|j}|j}tjd||fƒd}    yÜt    |ƒ}
|
j
t j dƒ}    |    dkr§t|ƒdSt|
ƒ} | ikrÖt||
t jƒdStƒ} | | _|    | _|| _|| _tj|ƒ| _|
| _|| _tƒj|| ƒ| jƒWnLtk
r“tjdt j!ƒƒtƒj"|ƒt||    t j#ƒdSXtjdƒdS(Ns%ProjSpecialProcess OnGMToolCommand INsGM Tool Cmd->%s,orderId->%sR sGM cmd error - > %ss'ProjSpecialProcess OnGMToolCommand Done($RtinfotOrderLentOrderIdtCmdLentCmdt UserDataLentUserDatat
ServerListtevaltgetRtDef_GMKey_TypetNonetSendGMToolCommandToGameServertChangeEncodIngtGMCommandResulttDef_EncodeFailt GMCmdMangert    gmCmdDicttfuncNametorderIdtuserDatatcopytdeepcopytpacktgmCmdDictUnEncodetserverIDt GetGMOrderMgrtAddCmdt GMToolCommandt BaseExceptiont    tracebackt
format_exctPopCmdtDef_GMDBEntranceFail( R:trecvPacktorderLenR6tcmdLentcmdt
uerDataLenR7t
serverListR5R4tcmdDictt gmCmdManger((sw.\ServersRoute\TCode\TeamServer\Server4\Servers\PyMongoDataServer\ServersRoute\GMToolLogicProcess\ProjSpecialProcess.pytOnGMToolCommandQsJ                               
                                cCs|S(N((R:((sw.\ServersRoute\TCode\TeamServer\Server4\Servers\PyMongoDataServer\ServersRoute\GMToolLogicProcess\ProjSpecialProcess.pytOnGMToolCommandResults    R3cBs,eZd„Zd„Zd„Zd„ZRS(cCs|jƒdS(N(tClear(tself((sw.\ServersRoute\TCode\TeamServer\Server4\Servers\PyMongoDataServer\ServersRoute\GMToolLogicProcess\ProjSpecialProcess.pyR ¦s
cCsCi|_d|_d|_d|_d|_i|_d|_dS(NR i(R4R5R6R.R7R:R;RJ(RP((sw.\ServersRoute\TCode\TeamServer\Server4\Servers\PyMongoDataServer\ServersRoute\GMToolLogicProcess\ProjSpecialProcess.pyRO®s                            cCs‚ttd|jdfƒ}tj}d}t}|dkrÍ||j|jƒ}t    |t
ƒrj|}qÍt    |t ƒrÍ|d}t |ƒdkrŸ|dnd}t |ƒdkrÁ|dnt}qÍn|j ||ƒ|r~tjtjƒ}tjd|ƒ|r~tjƒ}|j|jjƒƒt|jƒƒ|_t |jƒ|_|jj|jƒƒt|jƒq~ndS(Ns%s.%stOnExecR iiisserverIDMapDict:%s( t GetExecFunctCommandsR5RtDef_SendToGameServertFalseR.R4RJt
isinstancetintttupleRtGMCmdExecuteResultR
tGetServerDictByTheGroupNammeRtserverType_BattleRR#R    t tagGMCommandtReadDataR:t    getBuffertstrtkeysR*t    ServerLent    setBuffert    GetBufferR/(RPtcallFunctexecTypetexecInfotsendToBatServertrettserverIDMapDictRE((sw.\ServersRoute\TCode\TeamServer\Server4\Servers\PyMongoDataServer\ServersRoute\GMToolLogicProcess\ProjSpecialProcess.pyR?»s0         
"( cCsb|tjkr2t|jƒtƒj|jƒn,tƒj|jƒt|j|j||ƒdS(N(    RRTR/R:R=RCR6R1R5(RPReRf((sw.\ServersRoute\TCode\TeamServer\Server4\Servers\PyMongoDataServer\ServersRoute\GMToolLogicProcess\ProjSpecialProcess.pyRYäs  (t__name__t
__module__R ROR?RY(((sw.\ServersRoute\TCode\TeamServer\Server4\Servers\PyMongoDataServer\ServersRoute\GMToolLogicProcess\ProjSpecialProcess.pyR3¡s             )t GMCmdOrderMgrcBs,eZd„Zd„Zd„Zd„ZRS(cCs i|_dS(N(t_GMCmdOrderMgr__CmdOrderdict(RP((sw.\ServersRoute\TCode\TeamServer\Server4\Servers\PyMongoDataServer\ServersRoute\GMToolLogicProcess\ProjSpecialProcess.pyR ùs    cCsD||jjƒkr3tjd||jfƒtS||j|<tS(Ns(orderId = %s already exists,New cmd = %d(RmR`RtwarningR5RUtTrue(RPR6t    cmdManger((sw.\ServersRoute\TCode\TeamServer\Server4\Servers\PyMongoDataServer\ServersRoute\GMToolLogicProcess\ProjSpecialProcess.pyR>s
 cCs|jj|dƒS(N(RmtpopR.(RPR6((sw.\ServersRoute\TCode\TeamServer\Server4\Servers\PyMongoDataServer\ServersRoute\GMToolLogicProcess\ProjSpecialProcess.pyRCscCs|jj|dƒS(N(RmR,R.(RPR6((sw.\ServersRoute\TCode\TeamServer\Server4\Servers\PyMongoDataServer\ServersRoute\GMToolLogicProcess\ProjSpecialProcess.pytGetCmds(RjRkR R>RCRr(((sw.\ServersRoute\TCode\TeamServer\Server4\Servers\PyMongoDataServer\ServersRoute\GMToolLogicProcess\ProjSpecialProcess.pyRlôs                 cCstdkrtStƒatS(N(t_GMCmdOrderMgrR.Rl(((sw.\ServersRoute\TCode\TeamServer\Server4\Servers\PyMongoDataServer\ServersRoute\GMToolLogicProcess\ProjSpecialProcess.pyR=s     cCsb|jdƒ}t|ƒdkr%dSx6|D].}t||ƒtkrKdSt||ƒ}q,W|S(Ns.i(RRR.thasattrRotgetattr(t
curCallObjtcallNametcallListt curCallName((sw.\ServersRoute\TCode\TeamServer\Server4\Servers\PyMongoDataServer\ServersRoute\GMToolLogicProcess\ProjSpecialProcess.pytParseNameGetObj*s cCs9t||ƒ}|dkrdSt|ƒtkr5dS|S(N(RzR.tcallableRo(RvRw((sw.\ServersRoute\TCode\TeamServer\Server4\Servers\PyMongoDataServer\ServersRoute\GMToolLogicProcess\ProjSpecialProcess.pyRR=s  R cCsyi|tj6|tj6|tj6}tj|dtƒ}tjd|ƒt    t
|ƒ|t
|ƒ|t
|ƒ|ƒdS(Nt ensure_asciis gm result:%s( RR-tDef_GMKey_ResultTypetDef_GMKey_ResultMsgtjsontdumpsRURR#tSendToGMToolCommandResultR(R6tgmCmdt
resultTypetstrMsgtuseDatat
resultDcitt    resultMsg((sw.\ServersRoute\TCode\TeamServer\Server4\Servers\PyMongoDataServer\ServersRoute\GMToolLogicProcess\ProjSpecialProcess.pyR1Qs 
 +cCsÑi}|jddƒ}|dkr(|Sx¢|jƒD]”\}}t|tƒsVq5nyG|jddƒ}|jddƒ}td|ƒ}|j|ƒ}Wntjdt    |ƒƒ|SX|||<q5W|S(    NtcodingR s
s`rs's\'su'%s's translateStr error! srcStr = %s (
R,titemsRVR_RR+tencodeRR#trepr(R4RKRˆtkeytvaluet translateStr((sw.\ServersRoute\TCode\TeamServer\Server4\Servers\PyMongoDataServer\ServersRoute\GMToolLogicProcess\ProjSpecialProcess.pyR0`s" (((#tGMToolPyInterfacetDBCommonRRRSRR8RRARt MangoDBCommonRt CollectionsRtCollections.CollectionDefinetCommonRRtProtocolRR    tConfigR
R"R.RsRMRNR3RlR=RzRRR1R0(((sw.\ServersRoute\TCode\TeamServer\Server4\Servers\PyMongoDataServer\ServersRoute\GMToolLogicProcess\ProjSpecialProcess.pyt<module>s2
 
        
    <    S(