Market my offers

This commit is contained in:
Łukasz Kurowski
2015-04-07 01:24:39 +02:00
parent ff0947c270
commit 01c107ba62
4 changed files with 294 additions and 26 deletions

View File

@@ -29,11 +29,12 @@ local function readMarketOffer(msg, action, var)
local state = MarketOfferState.Active
if var == MarketRequest.MyHistory then
state = msg:getU8()
elseif var == MarketRequest.MyOffers then
else
playerName = msg:getString()
end
return MarketOffer.new({timestamp, counter}, action, Item.create(itemId), amount, price, playerName, state)
return MarketOffer.new({timestamp, counter}, action, Item.create(itemId), amount, price, playerName, state, var)
end
-- parsing protocols
@@ -201,6 +202,10 @@ function MarketProtocol.sendMarketBrowse(browseId)
end
end
function MarketProtocol.sendMarketBrowseMyOffers()
MarketProtocol.sendMarketBrowse(MarketRequest.MyOffers)
end
function MarketProtocol.sendMarketCreateOffer(type, spriteId, amount, price, anonymous)
if g_game.getFeature(GamePlayerMarket) then
local msg = OutputMessage.create()