hxp
2025-06-12 59331b7135fb10c24382d76fb0a3d721dddca7ee
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
S†-hc@sMddlZddlZddlZddlZddlZddlZddlZddlZddlZddl    Z    ddl
Z
dZ dZ d„Z d„Zd„Zd„Zd„Zd    „Zd
„Zd „Zd „Zd „Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Z d„Z!d„Z"dd„Z#d„Z$d„Z%d„Z&d„Z'e(d „Z)e(d!„Z*e(d"„Z+d#„Z,d$„Z-d%„Z.d&„Z/d'„Z0d(„Z1d)„Z2d*„Z3d+„Z4d,„Z5d-d.„Z6d/d0„Z7d1Z8d2„Z9d3„Z:d-d4„Z;d5„Z<dS(6iÿÿÿÿNtcmd_mails2014-12-15 11:00cCs|dkr|S|dS(Nil((tnum((s`D:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\CommFunc.pytToDWORD.s cCswd}t|ƒ}x^gt|ƒD]}|ddkr"|^q"D]-}|ttj|||d!dƒƒ7}qBW|S(Ntiii(tlentrangetchrtstringtatoi(thexStrt    returnStrt    hexStrLentjti((s`D:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\CommFunc.pytHexToBin7s
 6+cCsddl}|jƒS(Niÿÿÿÿ(t    tracebackt
format_exc(R((s`D:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\CommFunc.pytGetExceptionInfoCs c
Cs‚tjddgdtdtjdtjdtjƒ}|jjd|ƒ|jjƒ|jjƒ}||j    jƒ7}|GH|S(NtcmdRtshelltstdintstdouttstderrs%s
(
t
subprocesstPopentFalsetPIPERtwritetcloseRtreadR(tcurCmdtpipetretStr((s`D:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\CommFunc.pytRunCmdMs cBs,|jddƒ}d|d}|dU|S(Ns's\'sdesStr='(treplace(tsrcStrtdesStrR((s`D:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\CommFunc.pyt
GetCodeStr]scCs-tjd||ƒ}|d7}|d|fS(NtBii(tstructt unpack_from(tbuftpostcurValue((s`D:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\CommFunc.pytReadBYTEŠs
cCs-tjd||ƒ}|d7}|d|fS(NtHii(R'R((R)R*R+((s`D:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\CommFunc.pytReadWORD“s
cCs-tjd||ƒ}|d7}|d|fS(NtIii(R'R((R)R*R+((s`D:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\CommFunc.pyt    ReadDWORDœs
cCs-tjd||ƒ}|d7}|d|fS(Ntfii(R'R((R)R*R+((s`D:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\CommFunc.pyt    ReadFloat¥s
cCs-tjd||ƒ}|d7}|d|fS(Ntdii(R'R((R)R*R+((s`D:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\CommFunc.pyt
ReadDouble®s
cCs1tjd|||ƒ}||7}|d|fS(Ns%dsi(R'R((R)R*t_lenR+((s`D:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\CommFunc.pyt
ReadString·s
cCs7|dkr|jƒ}n |jƒ}tj||ƒS(Ni(tlowertupperR'tpack(tsigntvalue((s`D:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\CommFunc.pytPackÂs  cCs|td|ƒ7}|S(NR&(R<(R)R;((s`D:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\CommFunc.pyt    WriteBYTEÐscCs|td|ƒ7}|S(NR-(R<(R)R;((s`D:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\CommFunc.pyt    WriteWORDÙscCs|td|ƒ7}|S(NR/(R<(R)R;((s`D:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\CommFunc.pyt
WriteDWORDáscCs|tjd|ƒ7}|S(NR1(R'R9(R)R;((s`D:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\CommFunc.pyt
WriteFloatéscCs|tjd|ƒ7}|S(NR3(R'R9(R)R;((s`D:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\CommFunc.pyt WriteDoubleñscCs|tjd||ƒ7}|S(Ns%ds(R'R9(R)RR;((s`D:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\CommFunc.pyt WriteStringùscCs+tjt||dƒt||dƒƒS(Ni(tmathtsqrttpow(tsrcXtsrcYtdestXtdestY((s`D:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\CommFunc.pyt GetDistancescCsƒ|dkr||fSt||||ƒ}|dkrA||fS|t|ƒ|||}|t|ƒ|||}||fS(Ni(RJtfloat(RFRGRHRIt curMoveDistt    totalDisttresultXtresultY((s`D:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\CommFunc.pytMovePoss 
 
cCs2tjjƒ}t|ƒ}|jdƒd}|S(Ns.i(tdatetimettodaytstrtsplit(tcurTimet
curTimeStr((s`D:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\CommFunc.pytGetCurrentDataTimeStr!s cCs&|jdƒd}tjj|dƒS(Ns.is%Y-%m-%d %H:%M:%S(RTRQtstrptime(ttimeStr((s`D:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\CommFunc.pytGetDateTimeByStr,sicCs-yt|ƒ}|SWntk
r(|SXdS(N(tintt
ValueError(tinputtdefValuetresult((s`D:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\CommFunc.pytToIntDef7s
  cCs©d|dd!}tj|d |dd!ddƒ}tj|d |dd!ddƒ}tj|d |dd    !ddƒ}t|ƒd
t|ƒd
t|ƒ}|S( Nt0xiiiitbaseiiis,(RRRS(thtredtgreentbluetcStr((s`D:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\CommFunc.pytHcToScDs $$$(cCsŽttj|jdƒdƒƒd}ttj|jdƒdƒƒd}ttj|jdƒdƒƒd}dt|||ƒ}|S(Ns,iiis#(thexRRRTRS(tsRdReRfthStr((s`D:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\CommFunc.pytScToHcQs
&&&cCs¡tj|dd!|dd!ddƒ}tj|dd!|dd!ddƒ}tj|dd!|dd!ddƒ}t|ƒdt|ƒdt|ƒ}|S(    NiiiRbiiis,(RRRS(RcRdReRfRg((s`D:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\CommFunc.pytHdToSd^s
'''(cCsŽttj|jdƒdƒƒd}ttj|jdƒdƒƒd}ttj|jdƒdƒƒd}dt|||ƒ}|S(Ns,iiiRa(RiRRRTRS(RjRdReRfRk((s`D:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\CommFunc.pytSdToHdjs
&&&cCs^y2|rtj|ƒ}ntj|dƒ}|SWn%tjdttjƒƒƒdSXdS(s›Ñ¹ËõÊý¾Ý
    @param use_hex: ¿ÉѡʮÁù½øÖÆ×ª»»£¨·Ç±ØÒª²»½¨Ò飩µ¼ÖÂѹËõЧÂʽµµÍ£¨Ìå»ý¿ÉÄÜ·­±¶£©£¬ÇÒÔö¼Óת»»³ö´í·çÏÕ¡£
    @return: None or compresseData
    i    sѹËõÊý¾Ý  - > %sN(    tbinasciitb2a_hextzlibtcompresst    GameWorldtErrLogRSRR(tdatatuse_hext compresseData((s`D:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\CommFunc.pytCompressqscCst|ƒdkr#tjdƒdSytj|ƒ}Wnftjk
ržtjdƒytj|ddƒ}WqŸtjk
rštj|ddƒ}qŸXnX|ry8t|ƒddkrÏtjd    ƒdStj|ƒSWqtk
rþtjd
ƒdSXn|S( sr½âѹÊý¾Ý£¬´¦Àí¸ñʽºÍÍêÕûÐÔ¼ì²é
    @param use_hex: ¿ÉѡʮÁù½øÖÆ×ª»»£¬ÓëѹËõ²ÎÊýÒ»ÖÂ
    @return: None or data
    is½âѹʧ°Ü -> Ñ¹ËõÊý¾Ý³¤¶ÈÒì³£.Ns½âѹʧ°Ü£¨³¢ÊÔµ÷Õû²ÎÊý£©.twbitsiiñÿÿÿis%½âѹʧ°Ü -> Ê®Áù½øÖÆ×Ö·û´®³¤¶È·ÇżÊý.s½âѹʧ°Ü -> ÎÞЧµÄÊ®Áù½øÖÆÊý¾Ý.(    RRsRtRqt
decompressterrorRota2b_hext    TypeError(tcompressed_datat
expect_hexRu((s`D:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\CommFunc.pyt
Decompresss*     cCs<tjj|ƒr8tj|ƒ|r8tj|ƒq8ndS(N(tostpathtexiststshutiltrmtreetmakedirs(R‚tmakeDir((s`D:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\CommFunc.pyt    DelFolder¢s
 cCs'yt|ƒSWntk
r"dSXdS(NsDivision is Zero(tevaltZeroDivisionError(R;((s`D:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\CommFunc.pytSafeEval±s cCs„t|tƒsdS|jdƒ}|d}xQtdt|ƒƒD]:}|d||7}tjj|ƒsBtj|ƒqBqBWdS(Ns\ii(    t
isinstanceRSRTRRRR‚Rƒtmkdir(tpartpathListR‚R ((s`D:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\CommFunc.pytMakeAppointDirËs
cCs¶t|tƒsdS|jdƒ}|d}xƒtdt|ƒƒD]l}|d||7}|t|ƒdkrŒt|dƒ}|jƒqBtjj    |ƒsBtj
|ƒqBqBWdS(Ns\iitw( RŒRSRTRRtopenRRR‚RƒR(RŽRR‚R tfile((s`D:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\CommFunc.pytMakeAppointFileÚs
 cCsctjj|ƒsdS|dttjjƒƒjƒd}tjj|ƒs_tj|ƒndS(Ns\i(RR‚RƒRSRQRRRTR(RŽR‚((s`D:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\CommFunc.pytMakeCurTimeDirís
'cGsºd|kr|St|ƒ}|}d|krC|jddƒ}n|jdƒ}||kr¢t|ƒ}x%t||ƒD]}|jdƒq{Wt|ƒ}dSt|| ƒ}||S(Ns%s%%Ris0func:GetReplaceString();error:the parameter lack(RR"tcounttlistRtappendttuple(Rtvarlistt repalceCounttnewStrtneedReplaceCountttempListR t replaceTuple((s`D:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\CommFunc.pytGetReplaceStringûs      cCs‰ddl}ddl}d}|j||ƒs4|St|dƒ}|j}y-tdt|ƒdƒ}|j|ƒ}Wn|SX|S(Niÿÿÿÿs#[0-9]+isu'\u%s'i(tret ShareDefinetmatchR[tDef_Game_Character_EncodingR‰Ritencode(tU_STRR¡R¢tRegularExpressiont
UnicodeNumtCODECtunicode_stringtGBK_str((s`D:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\CommFunc.pytUnicodeStrToGBKStrs      c
Csut}d}xbtt|ƒƒD]N}|r7t}qn|t|ƒdkr||||krj||}n|||}Pndt||ƒkodknrBdt||dƒkoÇdknsödt||dƒkoñdknrt}||||d!}qm|||kr1||}qm|||}q|||kr_||}q|||}qW|S(    NRiiiþi@i~i¡i(RRRtordtTrue(R#R:tdesSignt
isContinueR$R ((s`D:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\CommFunc.pytReplaceBig5AppointSign*s, &T  cCstj|ƒ}|d@S(Niÿÿÿ(Rotcrc32(tmsgtcrc((s`D:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\CommFunc.pyt    GetStrCrc[scs‡fd†}|S(Ncs~ddl}|jƒ}yA|jƒˆj}ˆ||Ž}|j|ƒ|jƒ|SWntk
rytjdƒnXdS(NiÿÿÿÿsDoCProfile Err!(    tcProfiletProfiletenablet__name__t
dump_statstdisablet BaseExceptionRsRt(targstkwargsR¶tprofiletfuncNameR_(tfunc(s`D:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\CommFunc.pyt Profiled_funcfs  
     
 ((RÁRÂ((RÁs`D:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\CommFunc.pyt
DoCProfiledscCsyddl}t|ƒ|kr"|S|| }xFtdƒD]8}y(||| j|jƒj|jƒSWq9q9Xq9WdS(Niÿÿÿÿi
R(R¢RtxrangetdecodeR¤R¥(R#tmaxLenR¢t tempCommentR ((s`D:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\CommFunc.pyt GetStrCutoffƒs 
(icCs3|t|ƒ}t|ƒjdƒr/t|ƒS|S(scoinת»¯ÎªÔª
    s.0(RKRStendswithR[(t    orderCointratetyuan((s`D:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\CommFunc.pyt
CoinToYuan‘s
idcCsttjt||ƒƒƒS(sؠԪתΪcoin£¬Í³Ò»º¯Êý£¬·½±ãÐ޸ļ°ËÑË÷
    @param floatRMB: µ¥Î»Ôª£¬float ÀàÐÍ£¬Ö§³Ö RMB »ò ÃÀÔª
    @param rate: ×ª»¯±ÈÀý£¬Ô½Äϰ汾Åä±í¼°coin¾ùʹÓÃÔ½Ä϶ÜÔ­Öµ£¬¼´±ÈÀýΪ1:1£¬¹ÊĬÈÏÖµ¸Ä1
    @return: ×ª»¯ÎªcoinÊýÖµ
    (R[RCtceiltround(tfloatRMBRË((s`D:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\CommFunc.pyt    RMBToCoin™ss@0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ+/cCsZ|dkrt|ƒ}nd}x,|dkrOt|d|}|d}q$W|pYdS(s½«Ê®½øÖÆÊýת»»Îª64½øÖÆiRi@t0(tabst    symbols64(tnumberR_((s`D:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\CommFunc.pyt Convert10To64¤s cCs2d}x%|D]}|dtj|ƒ}q W|S(s½«64½øÖÆÊýת»»ÎªÊ®½øÖÆii@(RÔtindex(tnumber64R;tdigit((s`D:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\CommFunc.pyt Convert64To10®s cCs7||||!}|jddƒ}|s-dSt|ƒS(s½âÎöÍæ¼ÒÉèÖô洢s*Ri(R"RÚ(t playerSettingR×tcLenRj((s`D:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\CommFunc.pyt ParseSettingµs
c
Cs°g}t|ddƒ}d|d}d}x}t||dƒD]h}|}t||dƒ}|rq|d}n|t|ƒkr‡Pn||}    |j|    ƒ|d7}q@W|S(s~½âÎöÍæ¼ÒÉèÖà - ×Ô¶¯Êͷż¼ÄÜ˳ÐòÁбí
    @param playerSetting: Íæ¼ÒÉèÖñ£´æ´®
    @param skillOrderList: ¼¼ÄÜĬÈÏ˳ÐòÁбí
    iii ii(RÝRRR˜(
RÛtdefaultSkillListtplayerSkillSetListtSkillMatchPaget    fromIndextindexNumR×t
skillIndextvtskillID((s`D:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\CommFunc.pytParseSetting_AutoSkillList½s 
 (=RR'RRCRQRRoRsRR„Rqt MODULE_NAMEtVERRRRR!R%R,R.R0R2R4R6R<R=R>R?R@RARBRJRPRWRZR`RhRlRmRnRRxR€RˆR‹RR”R•R R¬R±RµRÃRÈRÍRÑRÔRÖRÚRÝRæ(((s`D:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\CommFunc.pyt<module>sv                            
        -                                                                                                                    #                             1