Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions [admin]/admin/server/admin_servermaps.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@

function getServerMaps (loadList)
if checkClient( true, source, 'getServerMaps' ) then return end
local tableOut
local tableOut = {}

-- It will check if the feature is enabled.
if not stateResourceName("mapmanager", "running") then return end

-- Check if 'mapmanager' resource exists
if ( not getResourceFromName("mapmanager") ) then
Expand All @@ -20,7 +23,6 @@ function getServerMaps (loadList)
end

if loadList then
tableOut = {}
-- local deletedMaps = {}
local gamemodes = {}
gamemodes = call(getResourceFromName("mapmanager"), "getGamemodes")
Expand Down Expand Up @@ -158,3 +160,15 @@ function sortCompareFunction(s1, s2)
return false
end
end

function stateResourceName(resourceName, state)
if resourceName then
local resourceFromName = getResourceFromName(resourceName);

if getResourceState(resourceFromName) == tostring(state) then
return true;
else
return false;
end
end
end