| | |
| | | import PlayerControl
|
| | | import IpyGameDataPY
|
| | | import ItemCommon
|
| | | import ObjPool
|
| | |
|
| | | # 重置类型
|
| | | ResetType_Day = 1
|
| | |
| | | totalItemList = []
|
| | | if itemID:
|
| | | totalItemList.append([itemID, itemCount * clientBuyCount, isBind])
|
| | | for itemIDEx, itemCountEx, isBindEx in itemListEx:
|
| | | for itemEx in itemListEx:
|
| | | itemIDEx, itemCountEx = itemEx[:2]
|
| | | isBindEx = itemEx[2] if len(itemEx) > 2 else 0
|
| | | totalItemList.append([itemIDEx, itemCountEx * clientBuyCount, isBindEx])
|
| | | if not totalItemList:
|
| | | GameWorld.ErrLog("Store shop item error! shopType=%s,shopID=%s" % (shopType, shopID), curPlayer.GetPlayerID())
|
| | |
| | |
|
| | | GameWorld.SetDictValueByBit(curPlayer, ChConfig.Def_PDict_ShopRandUnlock, shopID, 1)
|
| | | if curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ShopBuyCnt % shopID):
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ShopBuyCnt % shopID, 0)
|
| | | syncBuyCntIDList.append(shopID)
|
| | |
|
| | | GameWorld.DebugLog("随机刷新商品数: %s,%s" % (len(randShopIDList), randShopIDList))
|
| | |
| | | syncIDList.append(shopID)
|
| | | if not syncIDList:
|
| | | return
|
| | | clientPack = ObjPool.GetPoolMgr().acquire(ChPyNetSendPack.tagSCShopRefreshItemInfo)
|
| | | clientPack = ChPyNetSendPack.tagSCShopRefreshItemInfo()
|
| | | clientPack.ShopType = shopType
|
| | | clientPack.RefreshCnt = min(curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ShopRefreshCnt % shopType), 250)
|
| | | clientPack.ShopIDList = syncIDList
|
| | |
| | | def SyncShopItemBuyCntInfo(curPlayer, syncIDList=[]):
|
| | | ##同步商品购买次数
|
| | |
|
| | | objPool = ObjPool.GetPoolMgr()
|
| | | buyCntList = []
|
| | | if syncIDList:
|
| | | for shopID in syncIDList:
|
| | | buyInfo = objPool.acquire(ChPyNetSendPack.tagSCShopItemBuyCnt)
|
| | | buyInfo = ChPyNetSendPack.tagSCShopItemBuyCnt()
|
| | | buyInfo.ShopID = shopID
|
| | | buyInfo.BuyCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ShopBuyCnt % shopID)
|
| | | buyCntList.append(buyInfo)
|
| | |
| | | buyCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ShopBuyCnt % shopID)
|
| | | if buyCnt <= 0:
|
| | | continue
|
| | | buyInfo = objPool.acquire(ChPyNetSendPack.tagSCShopItemBuyCnt)
|
| | | buyInfo = ChPyNetSendPack.tagSCShopItemBuyCnt()
|
| | | buyInfo.ShopID = shopID
|
| | | buyInfo.BuyCnt = buyCnt
|
| | | buyCntList.append(buyInfo)
|
| | |
| | | if not buyCntList:
|
| | | return
|
| | |
|
| | | clientPack = objPool.acquire(ChPyNetSendPack.tagSCShopItemBuyCntInfo)
|
| | | clientPack = ChPyNetSendPack.tagSCShopItemBuyCntInfo()
|
| | | clientPack.BuyCntList = buyCntList
|
| | | clientPack.Count = len(clientPack.BuyCntList)
|
| | | NetPackCommon.SendFakePack(curPlayer, clientPack)
|