8319 【恺英】邮件购买物品默认放入背包(一口价才放入背包,背包满发邮件)
| | |
| | | auctionItemMgr.sysBuyoutItemByTimeList.sort(key=operator.attrgetter("SysBuyTime"))
|
| | | return
|
| | |
|
| | | def __EndAuctionItem(endItemList, endEvent, funcAutoBuyout=False):
|
| | | def __EndAuctionItem(endItemList, endEvent, funcAutoBuyout=False, buyPlayer=None):
|
| | | ''' 结束拍品竞拍
|
| | | @param delItemStateDict: 删除的拍品竞拍状态
|
| | | '''
|
| | |
| | |
|
| | | # 竞拍成功邮件,发放物品
|
| | | if bidderID:
|
| | | mailTypeKey = "PaimaiMail3"
|
| | | paramList = [bidderPrice]
|
| | | detail = {"ItemGUID":itemGUID}
|
| | | addItemList = [{"ItemID":itemID, "Count":itemCount, "IsAuctionItem":False, "UserData":auctionItem.UserData}]
|
| | | if funcAutoBuyout:
|
| | | # 功能自动购买的不给物品,由功能根据功能需求处理
|
| | | pass
|
| | | ## 如果有玩家的,直接给到背包
|
| | | elif buyPlayer and buyPlayer.GetPlayerID() == bidderID:
|
| | | mailInfo = [mailTypeKey, addItemList, paramList, detail]
|
| | | resultMsg = str([itemGUID, itemID, itemCount, auctionItem.UserData, mailInfo])
|
| | | buyPlayer.MapServer_QueryPlayerResult(0, 0, "AuctionHouseGiveItem", resultMsg, len(resultMsg))
|
| | | else:
|
| | | paramList = [bidderPrice]
|
| | | detail = {"ItemGUID":itemGUID}
|
| | | addItemList = [{"ItemID":itemID, "Count":itemCount, "IsAuctionItem":False, "UserData":auctionItem.UserData}]
|
| | | PlayerCompensation.SendMailByKey("PaimaiMail3", [bidderID], addItemList, paramList, detail=detail)
|
| | | PlayerCompensation.SendMailByKey(mailTypeKey, [bidderID], addItemList, paramList, detail=detail)
|
| | | AddAuctionRecord(auctionItem, AuctionRecordResult_BidOK)
|
| | |
|
| | | # 拍卖成功收益,都以玩家收益向上取整
|
| | |
| | | #GameWorld.DebugLog("拍品有人竞价了,移除系统一口价拍品列表!")
|
| | |
|
| | | if isBuyout:
|
| | | __EndAuctionItem([auctionItem], "Buyout", funcAutoBuyout)
|
| | | __EndAuctionItem([auctionItem], "Buyout", funcAutoBuyout, buyPlayer=curPlayer)
|
| | | else:
|
| | | if __AddAuctionItemEndTimeByBid(auctionItem):
|
| | | __SortAuctionitem(isSortWorldItem=False)
|
New file |
| | |
| | | #!/usr/bin/python
|
| | | # -*- coding: GBK -*-
|
| | | #-------------------------------------------------------------------------------
|
| | | #
|
| | | ##@package Player.RemoteQuery.GY_Query_AuctionHouseGiveItem
|
| | | #
|
| | | # @todo:拍卖行直接给玩家物品
|
| | | # @author hxp
|
| | | # @date 2019-10-29
|
| | | # @version 1.0
|
| | | #
|
| | | # 详细描述: 拍卖行直接给玩家物品
|
| | | #
|
| | | #-------------------------------------------------------------------------------
|
| | | #"""Version = 2019-10-29 19:00"""
|
| | | #-------------------------------------------------------------------------------
|
| | |
|
| | | import GameWorld
|
| | | import ItemCommon
|
| | | import ItemControler
|
| | | import IPY_GameWorld
|
| | | import PlayerControl
|
| | | import ChConfig
|
| | |
|
| | |
|
| | | ## 请求逻辑
|
| | | # @param query_Type 请求类型
|
| | | # @param query_ID 请求的玩家ID
|
| | | # @param packCMDList 发包命令 [ ]
|
| | | # @param tick 当前时间
|
| | | # @return resultDisc
|
| | | def DoLogic(query_Type, query_ID, packCMDList, tick):
|
| | | return
|
| | | |
| | | #---------------------------------------------------------------------
|
| | | ## 执行结果
|
| | | # @param curPlayer 发出请求的玩家
|
| | | # @param callFunName 功能名称
|
| | | # @param funResult 查询的结果
|
| | | # @param tick 当前时间
|
| | | # @return None
|
| | | # @remarks 函数详细说明.
|
| | | def DoResult(curPlayer, callFunName, funResult, tick):
|
| | | playerID = curPlayer.GetPlayerID()
|
| | | try:
|
| | | funResultList = eval(funResult)
|
| | | except:
|
| | | GameWorld.ErrLog("GY_Query_AuctionHouseGiveItem %s eval Error" % funResult, playerID)
|
| | | return
|
| | | |
| | | GameWorld.DebugLog("GY_Query_AuctionHouseGiveItem ResultList=%s" % funResult, playerID)
|
| | | itemGUID, itemID, itemCount, userData, mailInfo = funResultList
|
| | | curCreateItem = ItemCommon.CreateSingleItem(itemID, itemCount)
|
| | | if not curCreateItem:
|
| | | GameWorld.ErrLog("GY_Query_AuctionHouseGiveItem %s CreateSingleItem Error" % funResult, playerID)
|
| | | return
|
| | | |
| | | if userData:
|
| | | curCreateItem.SetUserData(userData, len(userData))
|
| | | ItemCommon.MakeEquipGS(curCreateItem)
|
| | | |
| | | drDict = {"ItemGUID":itemGUID, "ItemID":itemID, "ItemCount":itemCount, "UserData":userData}
|
| | | isOK = ItemControler.DoLogic_PutItemInPack(curPlayer, curCreateItem, event=[ChConfig.ItemGive_BourseItem, True, drDict], |
| | | packIndexList=[IPY_GameWorld.rptItem])
|
| | | if not isOK:
|
| | | mailTypeKey, addItemList, paramList, detail = mailInfo
|
| | | PlayerControl.SendMailByKey(mailTypeKey, [playerID], addItemList, paramList, detail=detail)
|
| | | PlayerControl.NotifyCode(curPlayer, "PaimaiGiveItemMail")
|
| | | else:
|
| | | PlayerControl.NotifyCode(curPlayer, "PaimaiGiveItemOK")
|
| | | |
| | | return
|
| | |
|
| | |
|
| | |
|