xdh
2018-08-21 80f11b590ece01d82d2af052876366bd2c1df2eb
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCCommon.py
@@ -5332,6 +5332,7 @@
#  @param None
#  @param None
def SyncCollectionItemInfo(curPlayer, addExp, addMoney, addZhenQi, syncItemInfoList, collectNPCID=0):
    return #暂不同步
    if addExp <= 0 and addMoney <= 0 and addZhenQi <= 0 and not syncItemInfoList:
        return
    
@@ -5419,15 +5420,15 @@
        collectNPCIDTimeLimit = ReadChConfig.GetEvalChConfig('CollectNPCIDTimeLimit')
        npcIDList = collectNPCIDTimeLimit.keys()
    
    if funcTypeList:
        collection = ChPyNetSendPack.tagMCFuncNPCCollectionCnt()
        for fType in funcTypeList:
            todayCollTime = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_CollNpcCollTime % fType)
            collection.Clear()
            collection.FuncType = fType
            collection.CollectionCnt = todayCollTime
            collection.BuyCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_CollNpcBuyTime % fType)
            NetPackCommon.SendFakePack(curPlayer, collection)
#    if funcTypeList:
#        collection = ChPyNetSendPack.tagMCFuncNPCCollectionCnt()
#        for fType in funcTypeList:
#            todayCollTime = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_CollNpcCollTime % fType)
#            collection.Clear()
#            collection.FuncType = fType
#            collection.CollectionCnt = todayCollTime
#            collection.BuyCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_CollNpcBuyTime % fType)
#            NetPackCommon.SendFakePack(curPlayer, collection)
        
    if npcIDList:
        npcIDCollInfo = ChPyNetSendPack.tagMCNPCIDCollectionCntInfo()
@@ -5542,6 +5543,59 @@
    NetPackCommon.SendFakePack(curPlayer, npcInfoPack)
    return
## 获取本地图NPC数量
#  @param queryNPCIDList:查询的NPCID列表
#  @param tick
#  @return {NPCID:cnt}
def GetNPCCntInfo(queryNPCIDList, tick):
    npcCntDict = {}
    if not queryNPCIDList:
        return npcCntDict
    gameNPCManager = GameWorld.GetNPCManager()
    GameWorld.DebugLog("GetNPCCntInfo...queryNPCIDList=%s" % (str(queryNPCIDList)))
    for index in xrange(gameNPCManager.GetNPCCount()):
        curNPC = gameNPCManager.GetNPCByIndex(index)
        curID = curNPC.GetID()
        if curID == 0:
            continue
        curNPCID = curNPC.GetNPCID()
        if curNPCID not in queryNPCIDList:
            continue
        if curNPC.GetCurAction() == IPY_GameWorld.laNPCDie or not curNPC.IsAlive():
            continue
        npcCntDict[curNPCID] = npcCntDict.get(curNPCID, 0) + 1
    GameWorld.DebugLog("    npcCntDict=%s" % (str(npcCntDict)))
    return npcCntDict
## 同步地图NPC数量信息
#  @param curPlayer:采集玩家实例
#  @param mapID:
#  @param npcInfoDict:
#  @return None
def SyncNPCCntInfo(curPlayer, mapID, npcCntDict):
    npcInfoPack = ChPyNetSendPack.tagMCNPCCntList()
    npcInfoPack.Clear()
    npcInfoPack.MapID = mapID
    npcInfoPack.NPCInfoList = []
    for npcid, npcCnt in npcCntDict.items():
        npcInfo = ChPyNetSendPack.tagMCNPCCntInfo()
        npcInfo.Clear()
        npcInfo.NPCID = npcid
        npcInfo.Cnt = npcCnt
        npcInfoPack.NPCInfoList.append(npcInfo)
    npcInfoPack.NPCInfoCnt = len(npcInfoPack.NPCInfoList)
    NetPackCommon.SendFakePack(curPlayer, npcInfoPack)
    return
def SendGameServerGoodItemRecord(mapID, npcID, playerName, playerID, itemID, equipInfo=[]):
    # @param equipInfo: [equipPlace, itemClassLV, itemColor, itemQuality, itemUserData]
#    GameWorld.DebugLog("检查物品是否发送GameServer: mapID=%s, npcID=%s, playerName=%s, itemID=%s"