hxp
2025-12-12 9686b06e1a3c883f14ecb4e5dd44a4e4c8456ed3
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
/%0ic@sqddlZddlZddlZddlZddlZddlZddlZddlZddlZddl    Z    ddl
Z
ddl Z dZ dZ d„Zd„Zeed„Zd„Zd„Zd    „Zd
„Zd „Zd „Zd „Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Z d„Z!d„Z"d„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%„Z0d&„Z1d'„Z2d(„Z3d)„Z4d*„Z5d+„Z6d,„Z7d-„Z8d.„Z9d/d0„Z:d1d2„Z;d3Z<d4„Z=d5„Z>d/d6„Z?d7„Z@dS(8iÿÿÿÿ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.pytHexToBin8s
 6+csbtj|ƒ‰|r$ˆjƒ‰n|r^dj‡fd†tdtˆƒdƒDƒƒ‰nˆS(Ns c3s |]}ˆ||d!VqdS(iN((t.0R (thex_str(s`D:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\CommFunc.pys    <genexpr>Fsii(tbinasciitb2a_hextuppertjoinRR(tbufRtspace((Rs`D:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\CommFunc.pytB2Hex?s 4cCsddl}|jƒS(Niÿÿÿÿ(t    tracebackt
format_exc(R((s`D:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\CommFunc.pytGetExceptionInfoNs 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.pytRunCmdXs cBs,|jddƒ}d|d}|dU|S(Ns's\'sdesStr='(treplace(tsrcStrtdesStrR((s`D:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\CommFunc.pyt
GetCodeStrhscCs-tjd||ƒ}|d7}|d|fS(NtBii(tstructt unpack_from(RtpostcurValue((s`D:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\CommFunc.pytReadBYTE•s
cCs-tjd||ƒ}|d7}|d|fS(NtHii(R0R1(RR2R3((s`D:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\CommFunc.pytReadWORDžs
cCs-tjd||ƒ}|d7}|d|fS(NtIii(R0R1(RR2R3((s`D:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\CommFunc.pyt    ReadDWORD§s
cCs-tjd||ƒ}|d7}|d|fS(Ntfii(R0R1(RR2R3((s`D:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\CommFunc.pyt    ReadFloat°s
cCs-tjd||ƒ}|d7}|d|fS(Ntdii(R0R1(RR2R3((s`D:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\CommFunc.pyt
ReadDouble¹s
cCs1tjd|||ƒ}||7}|d|fS(Ns%dsi(R0R1(RR2t_lenR3((s`D:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\CommFunc.pyt
ReadStringÂs
cCs7|dkr|jƒ}n |jƒ}tj||ƒS(Ni(tlowerRR0tpack(tsigntvalue((s`D:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\CommFunc.pytPackÍs  cCs|td|ƒ7}|S(NR/(RC(RRB((s`D:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\CommFunc.pyt    WriteBYTEÛscCs|td|ƒ7}|S(NR5(RC(RRB((s`D:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\CommFunc.pyt    WriteWORDäscCs|td|ƒ7}|S(NR7(RC(RRB((s`D:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\CommFunc.pyt
WriteDWORDìscCs|tjd|ƒ7}|S(NR9(R0R@(RRB((s`D:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\CommFunc.pyt
WriteFloatôscCs|tjd|ƒ7}|S(NR;(R0R@(RRB((s`D:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\CommFunc.pyt WriteDoubleüscCs|tjd||ƒ7}|S(Ns%ds(R0R@(RRRB((s`D:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\CommFunc.pyt WriteStringscCs+tjt||dƒt||dƒƒS(Ni(tmathtsqrttpow(tsrcXtsrcYtdestXtdestY((s`D:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\CommFunc.pyt GetDistance scCsƒ|dkr||fSt||||ƒ}|dkrA||fS|t|ƒ|||}|t|ƒ|||}||fS(Ni(RQtfloat(RMRNRORPt 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(R[RXtstrptime(ttimeStr((s`D:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\CommFunc.pytGetDateTimeByStr7sicCs-yt|ƒ}|SWntk
r(|SXdS(N(tintt
ValueError(tinputtdefValuetresult((s`D:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\CommFunc.pytToIntDefBs
  cCs©d|dd!}tj|d |dd!ddƒ}tj|d |dd!ddƒ}tj|d |dd    !ddƒ}t|ƒd
t|ƒd
t|ƒ}|S( Nt0xiiiitbaseiiis,(RRRZ(thtredtgreentbluetcStr((s`D:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\CommFunc.pytHcToScOs $$$(cCsŽttj|jdƒdƒƒd}ttj|jdƒdƒƒd}ttj|jdƒdƒƒd}dt|||ƒ}|S(Ns,iiis#(thexRRR[RZ(tsRkRlRmthStr((s`D:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\CommFunc.pytScToHc\s
&&&cCs¡tj|dd!|dd!ddƒ}tj|dd!|dd!ddƒ}tj|dd!|dd!ddƒ}t|ƒdt|ƒdt|ƒ}|S(    NiiiRiiiis,(RRRZ(RjRkRlRmRn((s`D:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\CommFunc.pytHdToSdis
'''(cCsŽttj|jdƒdƒƒd}ttj|jdƒdƒƒd}ttj|jdƒdƒƒd}dt|||ƒ}|S(Ns,iiiRh(RpRRR[RZ(RqRkRlRmRr((s`D:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\CommFunc.pytSdToHdus
&&&cCs^y2|rtj|ƒ}ntj|dƒ}|SWn%tjdttjƒƒƒdSXdS(s›Ñ¹ËõÊý¾Ý
    @param use_hex: ¿ÉѡʮÁù½øÖÆ×ª»»£¨·Ç±ØÒª²»½¨Ò飩µ¼ÖÂѹËõЧÂʽµµÍ£¨Ìå»ý¿ÉÄÜ·­±¶£©£¬ÇÒÔö¼Óת»»³ö´í·çÏÕ¡£
    @return: None or compresseData
    i    sѹËõÊý¾Ý  - > %sN(    RRtzlibtcompresst    GameWorldtErrLogRZRR(tdatatuse_hext compresseData((s`D:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\CommFunc.pytCompress|scCst|ƒ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½âѹʧ°Ü -> ÎÞЧµÄÊ®Áù½øÖÆÊý¾Ý.(    RRxRyRvt
decompressterrorRta2b_hext    TypeError(tcompressed_datat
expect_hexRz((s`D:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\CommFunc.pyt
DecompressŠs*     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(RB((s`D:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\CommFunc.pytSafeEval¼s cCstj|dtƒS(Nt ensure_ascii(tjsontdumpsR"(tdumpObj((s`D:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\CommFunc.pytJsonDumpÂscCs„t|tƒsdS|jdƒ}|d}xQtdt|ƒƒD]:}|d||7}tjj|ƒsBtj|ƒqBqBWdS(Ns\ii(    t
isinstanceRZR[RRR†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–RZR[RRtopenR%R†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ˆRZRXRYR[R—(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 ShareDefinetmatchRbtDef_Game_Character_EncodingRŽRptencode(tU_STRR«R¬tRegularExpressiont
UnicodeNumtCODECtunicode_stringtGBK_str((s`D:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\CommFunc.pytUnicodeStrToGBKStr#s      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(R"RRtordtTrue(R,RAtdesSignt
isContinueR-R ((s`D:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\CommFunc.pytReplaceBig5AppointSign8s, &T  cCstj|ƒ}|d@S(Niÿÿÿ(Rtcrc32(tmsgtcrc((s`D:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\CommFunc.pyt    GetStrCrciscs‡fd†}|S(Ncs~ddl}|jƒ}yA|jƒˆj}ˆ||Ž}|j|ƒ|jƒ|SWntk
rytjdƒnXdS(NiÿÿÿÿsDoCProfile Err!(    tcProfiletProfiletenablet__name__t
dump_statstdisablet BaseExceptionRxRy(targstkwargsRÀtprofiletfuncNameRf(tfunc(s`D:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\CommFunc.pyt Profiled_functs  
     
 ((RËRÌ((RËs`D:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\CommFunc.pyt
DoCProfilerscCsyddl}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(RRRZtendswithRb(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ÊýÖµ
    (RbRJtceiltround(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(tnumberRf((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(tnumber64RBtdigit((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átcLenRq((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 
 (AR†R0RRJRXR RRxRR‰RvR’t MODULE_NAMEtVERRRR¸RRR*R.R4R6R8R:R<R>RCRDRERFRGRHRIRQRWR^RaRgRoRsRtRuR"R}R…R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>s|                            
        -                                                                                                                    #                                 1