#!/usr/bin/python
|
# -*- coding: GBK -*-
|
#-------------------------------------------------------------------------------
|
#
|
##@package GM.Commands.ClearStoreBuyCount
|
#
|
# @todo:Çå³ýÉ̵êÎïÆ·ÏÞ¹º´ÎÊý
|
# @author hxp
|
# @date 2018-05-09
|
# @version 1.0
|
#
|
# ÏêϸÃèÊö: Çå³ýÉ̵êÎïÆ·ÏÞ¹º´ÎÊý
|
#
|
#-------------------------------------------------------------------------------
|
#"""Version = 2018-05-09 15:00"""
|
#-------------------------------------------------------------------------------
|
|
import ChConfig
|
import IpyGameDataPY
|
import FunctionNPCCommon
|
import PlayerControl
|
import GameWorld
|
|
|
#---------------------------------------------------------------------
|
#Â߼ʵÏÖ
|
## GMÃüÁîÖ´ÐÐÈë¿Ú
|
# @param curPlayer µ±Ç°Íæ¼Ò
|
# @param list ²ÎÊýÁбí [npcID]
|
# @return None
|
# @remarks º¯ÊýÏêϸ˵Ã÷.
|
def OnExec(curPlayer, paramList):
|
syncIndexList = []
|
ipyDataMgr = IpyGameDataPY.IPY_Data()
|
for i in xrange(ipyDataMgr.GetStoreCount()):
|
shopItem = ipyDataMgr.GetStoreByIndex(i)
|
if not shopItem.GetLimitCnt():
|
continue
|
dayBuyCntKey = ChConfig.Def_PDict_ShopItemDayBuyCnt % shopItem.GetID()
|
curDayBuyCnt = curPlayer.NomalDictGetProperty(dayBuyCntKey)
|
if curDayBuyCnt <= 0:
|
continue
|
PlayerControl.NomalDictSetProperty(curPlayer, dayBuyCntKey, 0)
|
syncIndexList.append(shopItem.GetID())
|
if syncIndexList:
|
FunctionNPCCommon.SyncShopItemTodayBuyCount(curPlayer, syncIndexList, True)
|
GameWorld.DebugAnswer(curPlayer, "ÖØÖóɹ¦:%s" % syncIndexList)
|
return
|
|