Checked off some Market TODO's.

* Added some market offer constraints: offer creation exhaustion and now checks balance to validate sell offers.
* Fixed the depot updating issue (no longer requires updateDepotItemCount function)
* Can now silence the MarketProtocol messages.
* Few minor market fixes.
This commit is contained in:
BeniS
2012-08-15 03:43:48 +12:00
parent 150059a561
commit b93ea86260
5 changed files with 60 additions and 74 deletions

View File

@@ -2,11 +2,12 @@ MarketProtocol = {}
-- private functions
local silent
local protocol
local statistics = runinsandbox('offerstatistic.lua')
local function send(msg)
if protocol then
if protocol and not silent then
protocol:send(msg)
end
end
@@ -130,6 +131,8 @@ function initProtocol()
if g_game.isOnline() then
MarketProtocol.registerProtocol()
end
MarketProtocol.silent(false)
end
function terminateProtocol()
@@ -165,6 +168,10 @@ function MarketProtocol.unregisterProtocol()
MarketProtocol.updateProtocol(nil)
end
function MarketProtocol.silent(mode)
silent = mode
end
-- sending protocols
function MarketProtocol.sendMarketLeave()