8255 【后端】【主干】拍品可使用及上下架优化(拍品可下架)
| | |
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # B5 15 拍卖行下架拍品 #tagCMUnsellAuctionItem
|
| | |
|
| | | class tagCMUnsellAuctionItem(Structure):
|
| | | Head = tagHead()
|
| | | ItemGUID = "" #(char ItemGUID[40])
|
| | | data = None
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Head.Cmd = 0xB5
|
| | | self.Head.SubCmd = 0x15
|
| | | return
|
| | |
|
| | | def ReadData(self, _lpData, _pos=0, _Len=0):
|
| | | self.Clear()
|
| | | _pos = self.Head.ReadData(_lpData, _pos)
|
| | | self.ItemGUID,_pos = CommFunc.ReadString(_lpData, _pos,40)
|
| | | return _pos
|
| | |
|
| | | def Clear(self):
|
| | | self.Head = tagHead()
|
| | | self.Head.Clear()
|
| | | self.Head.Cmd = 0xB5
|
| | | self.Head.SubCmd = 0x15
|
| | | self.ItemGUID = ""
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | length = 0
|
| | | length += self.Head.GetLength()
|
| | | length += 40
|
| | |
|
| | | return length
|
| | |
|
| | | def GetBuffer(self):
|
| | | data = ''
|
| | | data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer())
|
| | | data = CommFunc.WriteString(data, 40, self.ItemGUID)
|
| | | return data
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''
|
| | | Head:%s,
|
| | | ItemGUID:%s
|
| | | '''\
|
| | | %(
|
| | | self.Head.OutputString(),
|
| | | self.ItemGUID
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagCMUnsellAuctionItem=tagCMUnsellAuctionItem()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCMUnsellAuctionItem.Head.Cmd,m_NAtagCMUnsellAuctionItem.Head.SubCmd))] = m_NAtagCMUnsellAuctionItem
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # B9 04 修改队伍相关审核状态 #tagCMChangeTeamCheckState
|
| | |
|
| | | class tagCMChangeTeamCheckState(Structure):
|
| | |
| | | AuctionRecordResult_BidOK, # 竞价成功
|
| | | AuctionRecordResult_BidFail, # 竞价失败
|
| | | AuctionRecordResult_MoveToWorld, # 仙盟拍品转移到全服拍品
|
| | | ) = range(6)
|
| | | AuctionRecordResult_Unsell, # 下架
|
| | | ) = range(7)
|
| | |
|
| | | # 当前拍品归类 0-全服拍品 1-仙盟私有拍品
|
| | | AuctionType_World = 0
|
| | |
| | | elif playerID:
|
| | | endType = "Return"
|
| | |
|
| | | # 流拍返还物品邮件
|
| | | # 返还物品邮件
|
| | | paramList = []
|
| | | detail = {"ItemGUID":itemGUID}
|
| | | addItemList = [{"ItemID":itemID, "Count":itemCount, "IsAuctionItem":True, "UserData":auctionItem.UserData}]
|
| | | # 下架
|
| | | if endEvent == "Unsell":
|
| | | PlayerCompensation.SendMailByKey("PaimaiMail9", [playerID], addItemList, paramList, detail=detail)
|
| | | AddAuctionRecord(auctionItem, AuctionRecordResult_Unsell)
|
| | | else:
|
| | | PlayerCompensation.SendMailByKey("PaimaiMail4", [playerID], addItemList, paramList, detail=detail)
|
| | | |
| | | AddAuctionRecord(auctionItem, AuctionRecordResult_SellFail)
|
| | | else:
|
| | | endType = "SystemDelete"
|
| | |
| | | drDict = {"ItemGUID":itemGUID, "BiddingPrice":biddingPrice, "ErrInfo":errInfo}
|
| | | DR_AuctionHouse(curPlayer, "BidAuctionItemError", drDict)
|
| | |
|
| | | return
|
| | | |
| | | # 下架拍品
|
| | | elif queryType == "UnsellAuctionItem":
|
| | | itemGUID = queryData[0]
|
| | | __DoUnsellAuctionItem(curPlayer, itemGUID)
|
| | | return
|
| | |
|
| | | elif queryType == "ClearAuctionItem":
|
| | |
| | | NetPackCommon.SendFakePack(player, infoPack)
|
| | | return
|
| | |
|
| | | def __DoUnsellAuctionItem(curPlayer, itemGUID):
|
| | | ## 下架拍品
|
| | | auctionItem = GetAuctionItem(itemGUID)
|
| | | if not auctionItem:
|
| | | # 拍品不存在
|
| | | PlayerControl.NotifyCode(curPlayer, "Paimai3")
|
| | | return
|
| | | playerID = curPlayer.GetPlayerID()
|
| | | itemID = auctionItem.ItemID
|
| | | if auctionItem.FamilyID:
|
| | | GameWorld.ErrLog("仙盟拍品无法下架!itemGUID=%s,itemID=%s,itemFamilyID=%s" |
| | | % (itemGUID, itemID, auctionItem.FamilyID), playerID)
|
| | | return
|
| | | if auctionItem.PlayerID != playerID:
|
| | | GameWorld.ErrLog("不是玩家自己的拍品无法下架!itemGUID=%s,itemID=%s,itemPlayerID=%s" |
| | | % (itemGUID, itemID, auctionItem.PlayerID), playerID)
|
| | | return
|
| | | if auctionItem.BidderPrice:
|
| | | # 竞价中的拍品不能下架
|
| | | PlayerControl.NotifyCode(curPlayer, "Paimai9")
|
| | | return
|
| | | |
| | | __EndAuctionItem([auctionItem], "Unsell")
|
| | | return
|
| | |
|
| | | def __DoPlayerBidAuctionItem(curPlayer, itemGUID, biddingPrice, tick, isOnlyCheck):
|
| | | ''' 玩家竞价物品
|
| | | @param curPlayer: 竞价的玩家
|
| | |
| | | Writer = hxp
|
| | | Releaser = hxp
|
| | | RegType = 0
|
| | | RegisterPackCount = 2
|
| | | RegisterPackCount = 3
|
| | |
|
| | | PacketCMD_1=0xB5
|
| | | PacketSubCMD_1=0x13
|
| | |
| | | PacketSubCMD_2=0x14
|
| | | PacketCallFunc_2=OnBiddingAuctionItem
|
| | |
|
| | | PacketCMD_3=0xB5
|
| | | PacketSubCMD_3=0x15
|
| | | PacketCallFunc_3=OnUnsellAuctionItem
|
| | |
|
| | | ;法宝
|
| | | [PlayerMagicWeapon]
|
| | | ScriptName = Player\PlayerMagicWeapon.py
|
| | |
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # B5 15 拍卖行下架拍品 #tagCMUnsellAuctionItem
|
| | |
|
| | | class tagCMUnsellAuctionItem(Structure):
|
| | | Head = tagHead()
|
| | | ItemGUID = "" #(char ItemGUID[40])
|
| | | data = None
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Head.Cmd = 0xB5
|
| | | self.Head.SubCmd = 0x15
|
| | | return
|
| | |
|
| | | def ReadData(self, _lpData, _pos=0, _Len=0):
|
| | | self.Clear()
|
| | | _pos = self.Head.ReadData(_lpData, _pos)
|
| | | self.ItemGUID,_pos = CommFunc.ReadString(_lpData, _pos,40)
|
| | | return _pos
|
| | |
|
| | | def Clear(self):
|
| | | self.Head = tagHead()
|
| | | self.Head.Clear()
|
| | | self.Head.Cmd = 0xB5
|
| | | self.Head.SubCmd = 0x15
|
| | | self.ItemGUID = ""
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | length = 0
|
| | | length += self.Head.GetLength()
|
| | | length += 40
|
| | |
|
| | | return length
|
| | |
|
| | | def GetBuffer(self):
|
| | | data = ''
|
| | | data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer())
|
| | | data = CommFunc.WriteString(data, 40, self.ItemGUID)
|
| | | return data
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''
|
| | | Head:%s,
|
| | | ItemGUID:%s
|
| | | '''\
|
| | | %(
|
| | | self.Head.OutputString(),
|
| | | self.ItemGUID
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagCMUnsellAuctionItem=tagCMUnsellAuctionItem()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCMUnsellAuctionItem.Head.Cmd,m_NAtagCMUnsellAuctionItem.Head.SubCmd))] = m_NAtagCMUnsellAuctionItem
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # B9 04 修改队伍相关审核状态 #tagCMChangeTeamCheckState
|
| | |
|
| | | class tagCMChangeTeamCheckState(Structure):
|
| | |
| | | __DoAddAuctionItem(None, auctionItemList)
|
| | | return
|
| | |
|
| | | #// B5 15 拍卖行下架拍品 #tagCMUnsellAuctionItem
|
| | | #
|
| | | #struct tagCMUnsellAuctionItem
|
| | | #{
|
| | | # tagHead Head;
|
| | | # char ItemGUID[40];
|
| | | #};
|
| | | def OnUnsellAuctionItem(index, clientData, tick):
|
| | | curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
|
| | | playerID = curPlayer.GetPlayerID()
|
| | | itemGUID = clientData.ItemGUID
|
| | | |
| | | # 直接发邮件,这里就不验证背包了
|
| | | # #验证背包空间
|
| | | # if not ItemCommon.CheckPackHasSpace(curPlayer, IPY_GameWorld.rptItem):
|
| | | # PlayerControl.NotifyCode(curPlayer, "GeRen_chenxin_998371")
|
| | | # return
|
| | | |
| | | QueryGameServer_AuctionHouse(playerID, "UnsellAuctionItem", [itemGUID])
|
| | | return
|
| | |
|
| | | def DR_AuctionHouse(curPlayer, eventName, drDict):
|
| | | accID = "" if not curPlayer else curPlayer.GetAccID()
|
| | | playerID = 0 if not curPlayer else curPlayer.GetPlayerID()
|