functionrc.load(name,force)-- string boolean -- table -- Attempts to load service *name*, and if *force* is true, replaces the current instance.
ifnotpackage.loaded[name]orforcethen
fordinrc.paths:gmatch("[^\n]+")do
iffs.exists(d.."/"..name..".lua")then
service[name]=runfile(d.."/"..name..".lua")
end
end
end
ifservice[name]then
returnservice[name]
end
returnfalse,"unable to load service "..name
end
--[[
functionrc.load(name,force)-- string boolean -- table -- Attempts to load service *name*, and if *force* is true, replaces the current instance.
ifforcethen
rc.stop(name)
@ -39,6 +55,7 @@ function rc.load(name,force) -- string boolean -- table -- Attempts to load serv
f:close()
returnres
end
]]
functionrc.stop(name,...)-- string -- boolean string -- Stops service *name*, supplying *...* to the stop function. Returns false and a reason if this fails.
ifnotservice[name]thenreturnfalse,"service not found"end