mirror of
https://github.com/OTCv8/otclientv8.git
synced 2025-10-22 15:35:55 +02:00
Version 2.5.6 - http://otclient.net/showthread.php?tid=373
This commit is contained in:
@@ -39,15 +39,31 @@ end
|
||||
|
||||
-- parsing protocols
|
||||
local function parseMarketEnter(protocol, msg)
|
||||
local items
|
||||
if g_game.getClientVersion() < 944 then
|
||||
items = {}
|
||||
local itemsCount = msg:getU16()
|
||||
for i = 1, itemsCount do
|
||||
local itemId = msg:getU16()
|
||||
local category = msg:getU8()
|
||||
local name = msg:getString()
|
||||
table.insert(items, {
|
||||
id = itemId,
|
||||
category = category,
|
||||
name = name
|
||||
})
|
||||
end
|
||||
end
|
||||
|
||||
local balance
|
||||
if g_game.getClientVersion() >= 981 then
|
||||
if g_game.getClientVersion() >= 981 or g_game.getClientVersion() < 944 then
|
||||
balance = msg:getU64()
|
||||
else
|
||||
balance = msg:getU32()
|
||||
end
|
||||
|
||||
local vocation = -1
|
||||
if g_game.getClientVersion() < 950 then
|
||||
if g_game.getClientVersion() >= 944 and g_game.getClientVersion() < 950 then
|
||||
vocation = msg:getU8() -- get vocation id
|
||||
end
|
||||
local offers = msg:getU8()
|
||||
@@ -61,7 +77,7 @@ local function parseMarketEnter(protocol, msg)
|
||||
depotItems[itemId] = itemCount
|
||||
end
|
||||
|
||||
signalcall(Market.onMarketEnter, depotItems, offers, balance, vocation)
|
||||
signalcall(Market.onMarketEnter, depotItems, offers, balance, vocation, items)
|
||||
return true
|
||||
end
|
||||
|
||||
@@ -134,7 +150,7 @@ local function parseMarketBrowse(protocol, msg)
|
||||
table.insert(offers, readMarketOffer(msg, MarketAction.Sell, var))
|
||||
end
|
||||
|
||||
signalcall(Market.onMarketBrowse, offers)
|
||||
signalcall(Market.onMarketBrowse, offers, var)
|
||||
return true
|
||||
end
|
||||
|
||||
@@ -215,6 +231,10 @@ function MarketProtocol.sendMarketBrowseMyOffers()
|
||||
MarketProtocol.sendMarketBrowse(MarketRequest.MyOffers)
|
||||
end
|
||||
|
||||
function MarketProtocol.sendMarketBrowseMyHistory()
|
||||
MarketProtocol.sendMarketBrowse(MarketRequest.MyHistory)
|
||||
end
|
||||
|
||||
function MarketProtocol.sendMarketCreateOffer(type, spriteId, amount, price, anonymous)
|
||||
if g_game.getFeature(GamePlayerMarket) then
|
||||
local msg = OutputMessage.create()
|
||||
|
Reference in New Issue
Block a user