| | |
| | | ## 仙盟拍卖中的拍品列表
|
| | | return PyDataManager.GetAuctionItemManager().familyAuctionItemDict.get(familyID, [])
|
| | |
|
| | | def IsFamilyMemberBiddingAuctionItem(familyID, memberID):
|
| | | ## 仙盟成员是否最高竞价拍品中
|
| | | familyAuctionItemList = GetFamilyAuctionItemList(familyID)
|
| | | for auctionItem in familyAuctionItemList:
|
| | | if auctionItem.BidderID == memberID:
|
| | | return True
|
| | | return False
|
| | |
|
| | | def OnAuctionItemTimeProcess(curTime, tick):
|
| | | ## 拍卖行拍品定时处理,每秒触发一次
|
| | | allAuctionItemByEndTimeList = PyDataManager.GetAuctionItemManager().allAuctionItemByEndTimeList
|
| | |
| | | auctionItemMgr.allAuctionItemByEndTimeList.append(auctionItem)
|
| | | auctionItemMgr.worldAuctionItemList.append(auctionItem)
|
| | | notifyWorldAddItemList.append([itemGUID, itemID, playerID])
|
| | | |
| | | AddAuctionRecord(auctionItem, AuctionRecordResult_MoveToWorld)
|
| | |
|
| | | # 添加进我的关注
|
| | | for attentionPlayerID, attentionList in auctionItemMgr.myAttentionItemDict.items():
|
| | |
| | | @param curPlayer: 可能为None
|
| | | '''
|
| | |
|
| | | notifyWorldAddItemList = [] # 新增全服拍品通知 [[itemGUID, itemID, playerID], ...]
|
| | | isSortWorldItem = False
|
| | | notifyAddItemList = [] # 新增拍品通知 [[itemGUID, itemID, playerID], ...]
|
| | | notifyFamilyAddItemDict = {} # 新增仙盟拍品通知 {familyID:[auctionItem, ...], ...}
|
| | | for playerID, familyID, familyPlayerIDList, itemData in addAuctionItemList:
|
| | | if not playerID and not familyID:
|
| | |
| | | if not auctionItem:
|
| | | continue
|
| | |
|
| | | itemGUID = auctionItem.ItemGUID
|
| | | itemID = auctionItem.ItemID
|
| | | notifyAddItemList.append([itemGUID, itemID, playerID])
|
| | | if familyID:
|
| | | familyAddItemList = notifyFamilyAddItemDict.get(familyID, [])
|
| | | familyAddItemList.append(auctionItem)
|
| | | notifyFamilyAddItemDict[familyID] = familyAddItemList
|
| | | else:
|
| | | itemGUID = auctionItem.ItemGUID
|
| | | itemID = auctionItem.ItemID
|
| | | notifyWorldAddItemList.append([itemGUID, itemID, playerID])
|
| | | isSortWorldItem = True
|
| | |
|
| | | if notifyFamilyAddItemDict or notifyWorldAddItemList:
|
| | | isSortWorldItem = notifyWorldAddItemList != []
|
| | | if notifyAddItemList:
|
| | | __SortAuctionitem(isSortWorldItem=isSortWorldItem)
|
| | |
|
| | | # 通知新增仙盟拍品
|
| | | for familyID, familyAddItemList in notifyFamilyAddItemDict.items():
|
| | | Sync_FamilyAuctionItemInfo(None, familyID, familyAddItemList)
|
| | |
|
| | | # 通知全服拍品关注玩家
|
| | | __NotifyAuctionPlayerAddItem(notifyWorldAddItemList)
|
| | | # 通知拍品关注玩家
|
| | | __NotifyAuctionPlayerAddItem(notifyAddItemList)
|
| | | return
|
| | |
|
| | | def __DoAddAuctionItem(curPlayer, playerID, familyID, familyPlayerIDList, itemData):
|
| | |
| | | GameWorld.DebugLog("更新拍品数: %s" % len(auctionItemMgr.allAuctionItemDict))
|
| | | return auctionItem
|
| | |
|
| | | def __NotifyAuctionPlayerAddItem(notifyWorldAddItemList):
|
| | | def __NotifyAuctionPlayerAddItem(notifyAddItemList):
|
| | | ## 通知关注物品的玩家新上架物品了
|
| | | if not notifyWorldAddItemList:
|
| | | if not notifyAddItemList:
|
| | | return
|
| | | attentionMgr = PyDataManager.GetAuctionAttentionManager()
|
| | | playerManager = GameWorld.GetPlayerManager()
|
| | |
| | | if not playerAttentionIDList:
|
| | | continue
|
| | | infoPack = None
|
| | | for itemGUID, itemID, playerID in notifyWorldAddItemList:
|
| | | if playerID == player.GetPlayerID():
|
| | | for itemGUID, itemID, playerID in notifyAddItemList:
|
| | | if playerID and playerID == player.GetPlayerID():
|
| | | # 自己上架的物品不通知
|
| | | continue
|
| | | if itemID not in playerAttentionIDList:
|
| | |
| | | curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
|
| | | tagItemGUID = clientData.ItemGUID
|
| | | queryDir = 3
|
| | | __Sync_WorldAuctionItemQueryResult(curPlayer, fromItemGUID=tagItemGUID, queryDir=queryDir)
|
| | | __Sync_WorldAuctionItemQueryResult(curPlayer, fromItemGUID=tagItemGUID, queryDir=queryDir, isNotify=True)
|
| | | return
|
| | |
|
| | | def __Sync_WorldAuctionItemQueryResult(curPlayer, job=0, itemTypeList=[], classLV=0, specItemIDList=[], fromItemGUID="", queryDir=1, queryCount=10):
|
| | | def __Sync_WorldAuctionItemQueryResult(curPlayer, job=0, itemTypeList=[], classLV=0, specItemIDList=[], fromItemGUID="", queryDir=1, queryCount=10, isNotify=False):
|
| | | ## 根据过滤条件同步全服拍品列表,目前仅全服拍品需要通过查询服务器获得,个人拍品及仙盟拍品由于个数较少直接由上线或变更时主动同步
|
| | |
|
| | | fromAuctionItem = None
|
| | |
| | | fromAuctionItem = GetAuctionItem(fromItemGUID)
|
| | | if not fromAuctionItem:
|
| | | GameWorld.DebugLog("查询的目标拍品不存在! fromItemGUID=%s" % fromItemGUID)
|
| | | PlayerControl.NotifyCode(curPlayer, "Paimai5")
|
| | | if isNotify:
|
| | | PlayerControl.NotifyCode(curPlayer, "Paimai5")
|
| | | return
|
| | |
|
| | | # {(job, (itemType, ...), itemClassLV, (itemID, ...)):[tagDBAuctionItem, ...], ...}
|
| | |
| | | # 载入对应查询条件拍品缓存
|
| | | auctionItemQueryList = []
|
| | | for worldAuctionItem in auctionItemMgr.worldAuctionItemList:
|
| | | if job and worldAuctionItem.ItemJobLimit != job:
|
| | | if job and worldAuctionItem.ItemJobLimit != job and worldAuctionItem.ItemJobLimit:
|
| | | continue
|
| | | if itemTypeList and worldAuctionItem.ItemType not in itemTypeList:
|
| | | continue
|
| | |
| | | if fromAuctionItem:
|
| | | if fromAuctionItem not in auctionItemQueryList:
|
| | | GameWorld.ErrLog("查询的目标拍品不在所在的过滤的条件里! fromItemGUID=%s" % fromItemGUID)
|
| | | PlayerControl.NotifyCode(curPlayer, "Paimai5")
|
| | | if isNotify:
|
| | | PlayerControl.NotifyCode(curPlayer, "Paimai5")
|
| | | return
|
| | | fromIndex = auctionItemQueryList.index(fromAuctionItem)
|
| | |
|