hwj35
4 天以前 e7caa14c21c59641065d23532b6716d1b2f66f85
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
82
83
84
#ic@s0ddlZddlZddlZddlZddlZddlZddlZddlZddlZdZ    dZ
dZ dZ dZ e gZd„Zd„Zd„Zd„Zd    „Zd
„Zejiedd „Zd „Zd „Zd„Zd„Zded„Zgd„Zgd„ZdS(iÿÿÿÿNiiicCs(x!tD]}t||dtƒqWdS(Nt
sysRefresh(tRefreshShopTypeListtDoRandRefreshShopItemtTrue(t    curPlayertshopType((sxD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Event\EventSrc\FunctionNPCCommon.pyt
DoShopOpenIs cCs,t|ƒxtD]}t||ƒqWdS(N(tSyncShopItemBuyCntInfoRtSyncShopRefreshItemInfo(RR((sxD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Event\EventSrc\FunctionNPCCommon.pytShopItemOnLoginNs
 cCshxQtD]I}|jtj|ƒs)qntj|tj|dƒt||ƒqWt|tgƒdS(Ni(    RtNomalDictGetPropertytChConfigtDef_PDict_ShopRefreshCntt PlayerControltNomalDictSetPropertyRtResetShopItemBuyCountt ResetType_Day(RR((sxD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Event\EventSrc\FunctionNPCCommon.pyt ShopItemOnDayTs cCst|tgƒdS(N(RtResetType_Week(R((sxD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Event\EventSrc\FunctionNPCCommon.pytShopItemOnWeek^scCsç|s
dSg}tjƒ}x®t|jƒƒD]š}|j|ƒ}|jƒsVq/n|jƒ|krnq/n|jƒ}|jt    j
|ƒ}|dkr¢q/nt j |t    j
|dƒ|j |ƒq/W|rãt||ƒndS(Ni(t IpyGameDataPYtIPY_Datatxranget GetStoreCounttGetStoreByIndext GetLimitCntt GetResetTypetGetIDR
R tDef_PDict_ShopBuyCntR RtappendR(Rt resetTypeListt
syncIDListt
ipyDataMgrtitshopItemtshopIDt    curBuyCnt((sxD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Event\EventSrc\FunctionNPCCommon.pyRbs&    cCsä|s
dSg}x·|D]¯}tjdi|d6ttƒ}|sHqnx{|D]s}|jƒsgqOn|jƒ}|jtj|ƒ}|dkr›qOntj    |tj|dƒ|j
|ƒqOWqW|ràt ||ƒndS(NtStoretShopTypei( RtGetIpyGameDataByConditionRRRR
R RR RRR(Rt shopTypeListRRt ipyDataListtipyDataR#R$((sxD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Event\EventSrc\FunctionNPCCommon.pytResetShopItemBuyCountByShopTypeys&     c Cs[i}d}x]|jƒD]O\}    }
|
dkr7qntjƒj|    ƒ} | sVdS|r‡|    |kr‡||    } tjd| ƒ} ntj|    |ƒ} | s£dS| jƒ} | j    ƒ}| j
ƒ}| j ƒ}| j ƒ}|rZ|j tj| ƒ}td||ƒ}||
krMtjd|| |    ||||
f|jƒƒdS|
|| <n||
|7}qW|dkr|dS|r•tj|||ƒStjd|||||f|jƒƒtj|||||ƒsÝdS|rWg}x[|jƒD]M\} }
|j tj| ƒ}tj|tj| ||
ƒ|j| ƒqöWt||ƒntS(s/ Ö§¸¶×Ô¶¯¹ºÂòÎïÆ·ÏûºÄ£¬´ÓÉ̳ÇÖйºÂò£¬Ö±½Ó¿ÛÇ®£¬²»²úÉúÎïÆ·
            Ò»°ãÓÃÓÚ»ù´¡É̵ê×Ô¶¯¹ºÂòÎïÆ·£¬²»¿¼ÂǸ´ÔÓµÄÏÞ¹ºÂß¼­
    @param isCheck: ÊÇ·ñÖ»ÊǼì²é£¬²»Ö´ÐÐʵ¼ÊÏûºÄÂß¼­
    @param shopItemIndexDict: Ö¸¶¨¹ºÂòµÄÉÌÆ·¶ÔÓ¦É̳DZíÉÌÆ·IDË÷Òý×ֵ䣬Èç¹ûûÓÐÖ¸¶¨ÉÌÆ·Ë÷Òý£¬Ôò°´ÏûºÄµÄ¼Û¸ñÀàÐÍ×Ô¶¯ËÑË÷É̳DZí
    iNR%s_×Ô¶¯¹ºÂò´ÎÊý²»×㣡shopType=%s,shopID=%s,itemID=%s,limitBuyCnt=%s,curBuyCnt=%s,canBuyCnt=%s < %ss]¿Û³ý×Ô¶¯¹ºÂòÏûºÄ: lackItemDict=%s,priceType=%s,totalMoney=%s,costType=%s,addLimitCountInfo=%s(titemst    GameWorldt GetGameDatatGetItemByTypeIDRtGetIpyGameDatat
ItemCommontGetShopItemPriceIpyDataRt GetShopTypet GetMoneyTypet GetMoneyNumRR
R RtmaxtLogt GetPlayerIDR t    HaveMoneytDebugLogtPayMoneyRRRR(Rt lackItemDictt    priceTypetcostTypetinfoDicttisChecktshopItemIndexDicttaddLimitCountInfot
totalMoneytitemIDtlackCnttcurItemR#R*Rt    itemMoneyt limitBuyCntR$t    canBuyCntR((sxD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Event\EventSrc\FunctionNPCCommon.pytPayAutoBuyItemsX 
          &       cCs;tjƒj|ƒ}|j}|j}t|||ƒdS(N(R-tGetPlayerManagertGetPlayerByIndextShopIDtBuyCountt    OnBuyItem(tindext
clientDatattickRR#tbuyCount((sxD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Event\EventSrc\FunctionNPCCommon.pyt    PyBuyItem×s
        c
Cs!tjd||fƒtjƒr'dS|dks?|dkrCdStjd|ƒ}|s_dS|jƒ}|jƒ}|dkrñ|jtj    |ƒ}t
d||ƒ}|dkrÙtjd||||fƒdS||krñ|}qñn|j ƒ|j ƒd}}    }
|j ƒ} g} |rF| j||    ||
gƒnx1| D])\} }}| j| |||gƒqMW| s¤tjd||f|jƒƒdS| dd}tjd||| fƒt|||||ƒstjd||f|jƒƒdS|jƒ|jƒ}}||9}i| d6|d    6|d
6|d 6|tj6}|r‰|r‰tj|||tj||ƒ r‰dS|dkrøt||tjƒ}tj|tj    ||ƒtjd |||||fƒt||gƒntj|| d dtigd|ƒdS(Ns)¹ºÂòÉ̳ÇÎïÆ·: shopID=%s,clientBuyCount=%siR%s:ÉÌÆ·ÏÞ¹º´ÎÊýÒÑÂú ! shopType=%s,shopID=%s,curBuyCnt=%s < %ss,Store shop item error! shopType=%s,shopID=%ss&shopType=%s,shopID=%s,totalItemList=%ss)Store shop item lock! shopID=%s,shopID=%st TotalItemListtClientBuyCountR&RMsN¸üÐÂÉ̳ÇÎïÆ·ÏÞ¹º´ÎÊý: shopID=%s,curBuyCnt=%s,clientBuyCount=%s,updBuyCnt=%s/%steventtBuyItemt notifyDataEx( R-R:t IsCrossServerRR0R3RR
R RR6t    GetItemIDt
GetItemCntt GetItemListExRtErrLogR8tCheckBuyItemUnlockR7R4R5tDef_Cost_Reason_SonKeyR R;tDef_Cost_BuyStoreItemtmintDef_UpperLimit_DWordRRt ItemControlertGivePlayerItemOrMailtFalse(RR#tclientBuyCountR*RRHR$RIRDt    itemCounttisBindt
itemListExt totalItemListtitemIDExt itemCountExtisBindExt
mainItemIDR=t    itemPriceR?t    updBuyCnt((sxD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Event\EventSrc\FunctionNPCCommon.pyROÞs^           
.     %cCsß|jƒ}|jƒ}|tkrŸ|jƒsEtjd|ƒdS|jƒ}|dkrr|jtj    ƒ}n||krÛtjd|||fƒdSn<|t
krÛtj |tj |ƒsÛtjd|ƒdSnt S(NsÎÞ¹«»áÎÞ·¨¹ºÂò! shopID=%sis3¹«»áµÈ¼¶²»×ãÎÞ·¨¹ºÂò! shopID=%s,curFamilyLV=%s < %ss%¸ÃÉÌÆ·Ã»ÓÐËæ»ú½âËøÎÞ·¨¹ºÂò! shopID=%s(t GetUnlockTypetGetUnlockValuetUnlockType_FamilyLVt GetFamilyIDR-R:t GetFamilyLVR
R tDef_Player_Dict_FamilyLVtUnlockType_RandRefreshtGetDictValueByBittDef_PDict_ShopRandUnlockR(RRR#RoR*t
unlockTypet unlockValuet curFamilyLV((sxD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Event\EventSrc\FunctionNPCCommon.pyR_s"        cCs/tjƒj|ƒ}|j}t||ƒdS(N(R-RKRLR&R(RPRQRRRR((sxD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Event\EventSrc\FunctionNPCCommon.pyt OnRefreshShop;s     ic Csntjdi|d6ttƒ}|s)dSi}g}x[|D]S}|jƒtkrZq<n|jƒ}|jƒ}    |j|    |gƒ|    ||<q<W|s®tj    d|ƒdS|j
t j |ƒ}
d\} } |t kr1tjddƒ}tjddƒ} | r1|
| kr1tjddƒ\} } q1ntjd    ||t|ƒ|
| | |fƒ|dkrmdS| r–| r–tj|| | d
ƒ r–dS|d }g}g}xí|r›t|ƒ|kr›|dkr›|d8}tj|ƒ}|søq¯n|j|ƒ|j|dƒ}    |    |g|kr?|j|    |gƒntj|t j|dƒ|j
t j|ƒr¯tj|t j|dƒ|j|ƒq¯q¯Wtjd t|ƒ|fƒtjd t|ƒ|fƒx-|D]%\}}tj|t j|dƒqÝW|sD|
d7}
tj|t j ||
ƒtjd|
ƒn|rZt||ƒnt|||ƒdS(NR%R&s+¸ÃÉ̵êûÓпÉËæ»úˢнâËøµÄÉÌÆ·! shopType=%sit StoreHeroSouliiisbËæ»úË¢ÐÂÉ̵êÉÌÆ·: shopType=%s,randCnt=%s/%s,refreshCnt=%s,moneyType=%s,moneyValue=%s,sysRefresh=%stRefreshShopItemi
sËæ»úË¢ÐÂÉÌÆ·Êý: %s,%ssÊ£ÓàËø¶¨ÉÌÆ·Êý: %s,%ss¸üÐÂË¢ÐÂÉ̵ê´ÎÊý=%s(ii(RR'RRrRxRRsRR-R^R
R R tShopType_HeroSoult
GetFuncCfgtGetFuncEvalCfgR:tlenR R;tGetResultByWeightListtgettremovetSetDictValueByBitRzRRRR(RRtrandCntRR)tshopIDWeightDicttrandWeightListR*R#t
randWeightt
refreshCntt    moneyTypet
moneyValuetfreeCnttdoCnttrandShopIDListtsyncBuyCntIDListt_((sxD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Event\EventSrc\FunctionNPCCommon.pyRAsp         # %
'
 
cCsü|s€g}tjdi|d6ttƒ}|s5dSxH|D]=}|jƒ}tj|tj|ƒslq<n|j|ƒq<Wn|sŠdSt    j
ƒj t j ƒ}||_t|jtj|ƒdƒ|_||_t|jƒ|_tj||ƒdS(NR%R&iú(RR'RRR-RyR RzRtObjPoolt
GetPoolMgrtacquiretChPyNetSendPackttagSCShopRefreshItemInfoR&RbR
R t
RefreshCntt
ShopIDListR„tCountt NetPackCommont SendFakePack(RRRR)R*R#t
clientPack((sxD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Event\EventSrc\FunctionNPCCommon.pyRŠs&      "    c Csgtjƒ}g}|rmx|D]G}|jtjƒ}||_|jtj|ƒ|_    |j
|ƒqWn¯t j ƒ}x t |jƒƒD]Œ}|j|ƒ}|jƒs³qŒn|jƒ}|jtj|ƒ}    |    dkrçqŒn|jtjƒ}||_|    |_    |j
|ƒqŒW|s&dS|jtjƒ}
||
_t|
jƒ|
_tj||
ƒdS(Ni(R•R–R—R˜ttagSCShopItemBuyCntRMR
R RtBuyCntRRRRRRRRttagSCShopItemBuyCntInfot
BuyCntListR„RœRRž( RRtobjPoolt
buyCntListR#tbuyInfoR R!R"tbuyCntRŸ((sxD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Event\EventSrc\FunctionNPCCommon.pyR s8                      ( R R-RRdR˜R RR1R•RRRtRxRRRR    RRRR+tDef_Cost_UnknownRftNoneRJRTROR_R~RRR(((sxD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Event\EventSrc\FunctionNPCCommon.pyt<module>2s8                         
            H        ;    "    I