cehua_ZWJ
2019-01-30 6afaa4408f4e09e3e95dbd92f0d1cd5a1fb2942b
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
x{[c@süddlZddlZddlZddlZddlZddlZddlZddlZddlZddl    Z    ddl
Z
ddl Z ddl Z ddl Z ddlZddlZdZiaedƒ\ZZZZZZd„Zd„Zd„Zd„Zd„Zd    „Zd
„Zd „Z d „Z!d „Z"d„Z#d„Z$d„Z%d„Z&id„Z'd„Z(d„Z)dd„Z*d„Z+d„Z,d„Z-d„Z.d„Z/d„Z0d„Z1e2d„Z3d„Z4d„Z5d „Z6dS(!iÿÿÿÿNiicCst|ƒ}|dS(Ni(t__GetShopDetailInfo(tshopIDtshopDetailInfo((sf.\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Event\EventSrc\ShopItemManage.pytGetShopItemCntCs cCst|ƒ}|dS(Ni(R(RR((sf.\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Event\EventSrc\ShopItemManage.pytGetPlayerBuyCntLimitIndexListJs cCst|ƒ}|dS(Ni(R(RR((sf.\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Event\EventSrc\ShopItemManage.pytGetServerBuyCntLimitIndexListQs cCs:|tkrt|ƒn|tkr2dgggSt|S(Ni(tg_shopDetailInfoDicttGetShopItemList(R((sf.\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Event\EventSrc\ShopItemManage.pyRXs
    c    CsØ|tkrÐg}g}xv|D]n}t|dƒ}t|dƒ}t|dƒ}|dkrq|j|ƒn|dkr|j|ƒqqWt|ƒ||g}tjd|t|ƒfƒ|t|<nt|S(Nt ItemShopIndext    MaxBuyCnttServerMaxBuyCntis)¸üÐÂÉ̵êÃ÷ϸͳ¼Æ: shopID=%s,shopDetail=%s(Rtinttappendtlent    GameWorldtDebugLogtstr(    Rt shopItemListtplayerBuyCntLimitIndexListtserverBuyCntLimitIndexListt itemInfoDictt itemShopIndext    maxBuyCnttserverMaxBuyCntt
shopDetail((sf.\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Event\EventSrc\ShopItemManage.pyt__UpdateShopDetailInfods     cCsb|dkrgStjdƒ}|jdt|ƒƒ}|sQtjd|ƒnt||ƒ|S(NitShopItemtShopIDs1ÕÒ²»µ½É̵êÎïÆ·ShopItem.txt not itemData shopID=%s(t
PyMapTablet GetPyMapTablet    GetRecordRRtErrLogR(Rt shopItemTablet itemDataList((sf.\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Event\EventSrc\ShopItemManage.pyR|s  cCs£i}tjdƒ}|jit|ƒd6t|ƒd6ƒ}|s_tjd||fƒ|St|ƒdkr•tjd||t|ƒfƒ|S|d}|S(NRRRs5ÕÒ²»µ½É̵êÎïÆ·ShopItem.txt,shopID=%s,itemShopIndex=%sis?É̵êÎïÆ·ÖØ¸´ShopItem.txt,shopID=%s,itemShopIndex=%s,Êý¾ÝÌõÊý=%si(RRtGetRecordByDicRRRR (RRRR R!((sf.\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Event\EventSrc\ShopItemManage.pytGetShopItemInfoDictŒs)    
cCs#tj||f}|j|dƒS(Ni(tChConfigtDef_PDict_ShopItemBuyCnttNomalDictGetProperty(t    curPlayerRt    itemIndextkey((sf.\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Event\EventSrc\ShopItemManage.pyt__GetPlayerShopItemBuyCnt¡scCs$tj|tj||f|ƒdS(N(t PlayerControltNomalDictSetPropertyR$R%(R'RR(tcnt((sf.\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Event\EventSrc\ShopItemManage.pyt__SetPlayerShopItemBuyCnt«s cCsUt|ƒ}xB|D]:}t|||ƒ}|dkrt|||dƒqqWdS(Ni(RR*R.(R'RtplayerBuyCntLimittindext    curBuyCnt((sf.\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Event\EventSrc\ShopItemManage.pytClearPlayerShopItemBuyCnt´s    c    Cs?|g}tjƒjddddd|tt|ƒƒƒdS(NitShopItemClearBuyCnts%s(RtGetPlayerManagertGameServer_QueryPlayerResultR R(RtmsgList((sf.\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Event\EventSrc\ShopItemManage.pytClearShopItemBuyCntÂs    cCsRtjƒj|ƒ}|j}t|ƒ}|s4dSt||ƒt||ƒdS(N(RR4tGetPlayerByIndexRRt Send_ShopItemtSync_ShopItemBuyCntInfo(R0t
clientPackttickR'RR((sf.\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Event\EventSrc\ShopItemManage.pyt QueryShopItemÏs       cCs‡tjƒ}|jƒg|_tjdƒ}x0|D](}tjƒ}t|dƒ|_t|dƒ|_    |j|kr›t
||j|j    ƒ r›q5nt |ƒ}t |ƒ|_ t|j ƒ|_t|dƒ|_t|dƒ|_t|dƒ|_t|dƒ|_t|dƒ|_t|d    ƒ|_t|d
ƒ|_|jj|ƒq5Wt|jƒ|_tj||ƒdS( NtTimeShopRefreshItemRRt    PriceTypetPricet OriginalPricet PlayerLVLimitt FamilyLVLimitR    R
(tChPyNetSendPackttagMCShopItemInfoListtCleart ShopItemListt ReadChConfigtGetEvalChConfigttagMCShopItemInfoR RRt__GetShopItemStatet__GetShopItemListRtItemListR tDataSizeR?R@RARBRCR    R
R tCountt NetPackCommont SendFakePack(R'titemListtshopPackR>RtitemInfot itemInfoList((sf.\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Event\EventSrc\ShopItemManage.pyR9às2 
       cCs€t|ƒ}|s8t|ƒ}|r4t||ƒndSdtj||g}tjƒj|jƒddd|t    |ƒƒdS(Ns%siR(
RRtSend_ShopItemAllBuyCntInfot ShareDefinetDef_ShopItem_QueryServerBuyCntRR4R5tGetIDR (R'RtserverBuyLimitIndexListR/tcmdStr((sf.\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Event\EventSrc\ShopItemManage.pyR:s  cCsit|ƒ}t|ƒ}x-|D]%}||kr7qn|j|ƒqW|sRdSt||||ƒdS(N(RRR tSend_ShopItemBuyCntInfo(R'RtserverBuyCntDictt sendIndexListtserverLimitIndexListR0((sf.\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Event\EventSrc\ShopItemManage.pyRVs    cCsôtjƒ}|jƒg|_tjdƒ}x|D]•}tjƒ}||_||_|j|kr‡t    ||j|jƒ r‡q5nd|_
t |||ƒ|_ |j |dƒ|_|jj|ƒq5Wt|jƒ|_tj||ƒdS(NR>i(RDttagMCShopItemBuyCntInfoListRFt
BuyCntListRHRIttagMCShopItemBuyCntInfoRRRKtItemIDR*tBuyCnttgett ServerBuyCntR R RORPRQ(R'RR^R]t
buyCntPackR>R(t
buyCntInfo((sf.\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Event\EventSrc\ShopItemManage.pyR\2s$ 
                  c
CsLtjƒj|ƒ}|j}|j}|j}tjd|||f|jƒƒtj    dƒ}||kr¤t
j ƒ}||kr¤tj dt |ƒƒdSnt||ƒ}    |    s½dSt|    dƒ}
t|    dƒ} t|    dƒ} t|    dƒ} t|    dƒ}t|    d    ƒ}t|    d
ƒ}|rytjƒ}tj|}|j|ƒ}|sytj d |ƒdSntj    d ƒ}||krËt|||ƒ rËtj d ||f|jƒƒdS|| }tj||
|ƒstjd|
| |fƒdS|jƒ| kr;tjd|jƒ| fƒdS|jƒ}|| krntjd|| fƒdSd}|dkrÞt|||ƒ}td||ƒ}|dks½||krÞtjd|||fƒdSn|dkr8dtj||||g}tjƒj|jƒddd|t|ƒƒdSt||    |ƒdS(Ns?¹ºÂòÉ̵êÎïÆ·ShopItem.txt,shopID=%s,itemShopIndex=%s,buyCount=%stTeHuiAction_DiscountShopIDs=    ²»ÊǻÖеÄÌØ»ÝÕÛ¿ÛµêID£¬ÎÞ·¨¹ºÂò!curActionShopIDList=%sR?R@RBRCR    R
t IsLimitTimes     ¸ÃÉ̵êûÓпª·Å¹ºÂò!shopID=%sR>sC    ÉñÃØÉÌµê£¬Íæ¼Òδˢ³ö¸ÃÎïÆ·!²»¿É¹ºÂò£¡shopID=%s,itemShopIndex=%ss:    »õ±Ò²»×㣬ÎÞ·¨¹ºÂò!priceType=%s,price=%s,totalPrice=%ss:    Íæ¼ÒµÈ¼¶²»×㣬ÎÞ·¨¹ºÂò!getPlayerLV=%s,playerLVLimit=%ss>    Õ½Ã˵ȼ¶²»×㣬ÎÞ·¨¹ºÂò!playerFamilyLV=%s, familyLVLimit=%siÿÿÿÿisB    ¸öÈËÏÞ¹º´ÎÊý²»×㣬ÎÞ·¨¹ºÂò!ÒѹºÂò´ÎÊý=%s,Óû¹ºÂò=%s,×î´ó´ÎÊý=%ss%sR( RR4R8RRtBuyCountRt GetPlayerIDRHRIt PlayerTeHuitGetCurActionShowIDListtLogRR#R t GetGameWorldRWtDef_Notify_WorldKey_ShopStatetGetGameWorldDictByKeyRKR+t    HaveMoneytGetLVt GetFamilyLVR*tmaxtDef_ShopItem_BuyItemR5RYR t DoBuyShopItem(R0R;R<R'RRtbuyCounttdiscountShopIDDicttcurActionShopIDListRt    priceTypetpricet playerLVLimitt familyLVLimitRRt isLimitTimet    gameWorldt shopStateKeyt
isShopOpenR>t
totalPricetplayerFamilyLVtplayerCanBuyCntt playerBuyCntR[((sf.\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Event\EventSrc\ShopItemManage.pyt BuyShopItemTs€                             
                    cCsdS(N((R'RRyt serverBuyCnt((sf.\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Event\EventSrc\ShopItemManage.pyRx®sbcCs”|jƒ}ttjdƒƒ}||kr1dS||}d|krZ|d\}}n#||kry||\}}ndStjd||ƒdS(NtBuyItemIndexNotifyiÿÿÿÿi(t GetPlayerNametevalRHt GetChConfigR+t WorldNotify(R'RRt
playerNametBuyItemIndexNotifyDicttnotifyItemDictt
notifyMarkt    paramList((sf.\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Event\EventSrc\ShopItemManage.pyt__BuyItemIndexNotifys  
  cCs»g}x®tddƒD]}|jd|ƒ}| sN|dksN|dkrRPnt|ƒ}t|d|ƒ}t|d|ƒ}t|d|ƒ}|j||||gƒqW|S(    Nii sItemID%ds-t0s ItemCount%dsIsBind%ds IsAppoint%d(trangeReR R (RRUtititemIDt    itemCounttisBindt    isAppoint((sf.\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Event\EventSrc\ShopItemManage.pyRL(s cCs”|jƒ}ttjdƒƒ}||kr1dS||}d|krZ|d\}}n#||kry||\}}ndStjd||ƒdS(Nt BuyItemNotifyi(R‹RŒRHRR+RŽ(R'RR˜RtBuyItemNotifyDictR‘R’R“((sf.\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Event\EventSrc\ShopItemManage.pyt__BuyItemNotify:s  
  c    Cstjdƒ}tjƒ}xü|jƒD]î}tj|}|j|ƒ}tj|}|j|ƒ}| st| r”tj    d|||fƒq(n|j
t j |ƒ}||kràt ||ƒtj    d||fƒq(ntj    d|||f|jƒƒt||||ƒq(WdS(NR>s:ÉñÃØÉ̵ê(%s)·Ç¿ªÆô״̬!shopState=%s,curWorldRefreshTime=%ss.ÉñÃØÉ̵ê(%s)curWorldRefreshTime=%sÓëÍæ¼ÒÏàͬ£¡s?µÇ¼ˢÐÂÉñÃØÉ̵ê(%s)playerRefreshTime=%s,curWorldRefreshTime=%s(RHRIRRptkeysRWRqRrt'Def_Notify_WorldKey_TimeShopRefreshTimeRR&R$t'Def_PDict_TimeShopLastGlobalRefreshTimetSync_ShopRefreshCntRlt__RefreshShopItemBySys(    R'R>RRR‚t    shopStatetcurWorldRefreshTimeKeytcurWorldRefreshTimetplayerRefreshTime((sf.\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Event\EventSrc\ShopItemManage.pyt    DoOnLoginQs(             c Cs„|ttjƒd}yt|ƒ}Wn#tk
rLtjd|ƒdSXtjƒ}tj|}|j|ƒ}||krœtj    d||fƒdSt
j dƒ}||krÌtjd|ƒdStj |}|j|ƒ}    |    s    tjd||fƒdStj    d|ƒtj ƒ}
xWtd|
jƒƒD]@} |
j| ƒ} | jƒdkriq<nt| |||ƒq<WdS(    Nis¶¨Ê±Ë¢ÐÂÉ̵êkey´íÎó, key=%ss@¶¨Ê±É̵êÓëÉÏ´ÎË¢ÐÂʱ¼äÏàͬ£¬²»´¦Àí£¡shopID=%s,lastRefreshTime=%sR>s#·Ç¶¨Ê±ÉñÃØÉ̵꣬²»ÄÜˢУ¡shopID=%ss1ÉÌµê¹Ø±Õ״̬£¬²»´¦ÀíÉ̵êÎïÆ·Ë¢Ð£¡key=%s,value=%ssÈ«·þË¢ÐÂÉñÃØÉ̵ê(%s)i(R RWR R t BaseExceptionRRRpRrRRHRIRqR4R–tGetPlayerCountR8RYR£( R)tvalueR<RRtlastRefreshTimeKeytlastRefreshTimeR>R‚R¤t playerManagerR0R'((sf.\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Event\EventSrc\ShopItemManage.pytOnTimeShopRefreshus<           cCs`t|||ƒ}|r\tj|tj|dƒtj|tj||ƒt||ƒndS(Ni(t__DoRefreshTimeShopItemR+R,R$tDef_PDict_TimeShopRefreshCntR¡R¢(R'RR>tsysValuetisOK((sf.\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Event\EventSrc\ShopItemManage.pyR£¡s c    CsÔtjƒj|ƒ}|j}tjdƒ}||krWtjd||jƒƒdStjƒ}t    j
|}|j |ƒ}|s£tjd||jƒƒdStj d||jƒƒt |||tƒdS(NR>s#·Ç¶¨Ê±ÉñÃØÉ̵꣬²»ÄÜˢУ¡shopID=%ss!ÉÌµê¹Ø±Õ״̬£¬²»ÄÜˢУ¡shopID=%ssÊÖ¶¯Ë¢ÐÂÉñÃØÉ̵ê(%s)(RR4R8RRHRIRRlRpRWRqRrRR°tTrue(    R0R;R<R'RR>RR‚R¤((sf.\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Event\EventSrc\ShopItemManage.pytRefreshShopItem¹s       cCs÷t|ƒ}|sdS||}t|ƒtkr6dSt|ƒ}t||ƒttj|dtƒƒ}x4t|ƒD]&}t    j
|t j ||fdƒqyW|t }    |t}
|t} |t} |t} g}|jt j|ƒ}|rÐt| ƒ}i|d6|d6|t j6}t    j|tj|t j|ƒsFdS|d7}t    j
|t j||ƒ|| krÀ| |}|j|ƒtjd||f|jƒƒt|||ƒnt||ƒn|    d}xÓ|dkr¯t|ƒ|    kr¯|d8}tj |
dƒ}||kr)qÝnt!}xQ| D]I}||krNq6nx$|D]}||krUt"}PqUqUW|r6Pq6q6W|rqÝn|j|ƒt|||ƒqÝWt#||ƒt$||ƒtjd|t%|ƒ|f|jƒƒt"S(    Ngð?it
RefreshCntRis'Ìí¼Ó±Ø³öË÷Òý:refreshCnt=%s,mustIndex=%sidsË¢ÐÂÉñÃØÉ̵ê(%s)%s,isUseGold=%s(&RR tDef_TimeShop_MaxR2R tmathtceiltPerDictKeyMaxCntR–R+R,R$tDef_PDict_ShopItemOpenStatetDef_TimeShop_RefreshCnttDef_TimeShop_RateListtDef_TimeShop_ExclusionListtDef_TimeShop_CostFormattDef_TimeShop_MustItemCntR&R±RŒtDef_Cost_Reason_SonKeytPayMoneyt IPY_GameWorldtTYPE_Price_Gold_MoneytDef_Cost_RefreshTimeShopR RRRlt__SetShopItemOpenStateR¢tGetResultByRandomListtFalseR´R9R:R(R'RR>t    isUseGoldRt refreshInfotitemCntt    maxKeyNumtkNumtneedCnttrateListt exclusionListt
costFormattmustItemCntDictt randIndexListt
refreshCnttneedGoldtinfoDictt    mustIndext maxProcessCnttcurIndextisInExclusionListtexclusionIndexListtexIndex((sf.\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Event\EventSrc\ShopItemManage.pyR°Òst 
  $
 
 
 
 
 
 
 
!
         cCsM|t}tj||f}|j|ƒ}|t}|td|ƒ@}|S(Ni(RºR$R»R&tpow(R'RR(tkeyNumtkeyNamet shopItemStatet curStateIndextisOpen((sf.\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Event\EventSrc\ShopItemManage.pyRK2s 
 
cCs`|t}tj||f}|j|ƒ}|t}|td|ƒB}tj|||ƒ|S(Ni(RºR$R»R&RÝR+R,(R'RR(RÞRßRàRátupdState((sf.\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Event\EventSrc\ShopItemManage.pyRÆ@s
 
cCsLtjƒ}|jƒ||_|jtj|ƒ|_tj    ||ƒdS(N(
RDttagMCShopRefreshCntRFRR&R$R±R¶RPRQ(R'RtrefreshCntPack((sf.\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Event\EventSrc\ShopItemManage.pyR¢Ns  
    (7RRRDRPR$R+t
ItemCommonRÃt ItemControlertDataRecordPackRWRHRmtPlayerActivityt
EventShellR¸RºRR–R¼R½R¾R¿RÀR·RRRRRRR#R*R.R2R7R=R9R:RVR\RˆRxR”RLRžR¨R¯R£RµRÈR°RKRÆR¢(((sf.\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Event\EventSrc\ShopItemManage.pyt<module> s^                
                                 
                         %         "    Z h                $    ,         `