mirror of
https://github.com/edubart/otclient.git
synced 2025-10-16 20:43:26 +02:00
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:
@@ -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()
|
||||
|
Reference in New Issue
Block a user