From e3d34d9917bb2c341de3c7206e3021e916d3f706 Mon Sep 17 00:00:00 2001 From: Mattes D Date: Mon, 21 Mar 2016 09:58:15 +0100 Subject: Revert "Lua callback" --- Server/Plugins/APIDump/Classes/Plugins.lua | 7 +++---- Server/Plugins/APIDump/Classes/WebAdmin.lua | 8 -------- Server/Plugins/Debuggers/Debuggers.lua | 4 ++-- 3 files changed, 5 insertions(+), 14 deletions(-) (limited to 'Server/Plugins') diff --git a/Server/Plugins/APIDump/Classes/Plugins.lua b/Server/Plugins/APIDump/Classes/Plugins.lua index 610740fc0..e053c57e2 100644 --- a/Server/Plugins/APIDump/Classes/Plugins.lua +++ b/Server/Plugins/APIDump/Classes/Plugins.lua @@ -2,7 +2,7 @@ return { cPlugin = { - Desc = [[cPlugin describes a Lua plugin. This page is dedicated to new-style plugins and contain their functions. Each plugin has its own cPlugin object. + Desc = [[cPlugin describes a Lua plugin. This page is dedicated to new-style plugins and contain their functions. Each plugin has its own Plugin object. ]], Functions = { @@ -22,10 +22,10 @@ return cPluginLua = { - Desc = "(OBSOLETE) This class is no longer useful in the API and will be removed as soon as all core plugins are migrated away from it. The {{cPlugin}} class serves as the main plugin instance's interface.", + Desc = "", Functions = { - AddWebTab = { Params = "Title, HandlerFn", Return = "", Notes = "OBSOLETE - Use {{cWebAdmin}}:AddWebTab() instead." }, + AddWebTab = { Params = "", Return = "", Notes = "Adds a new webadmin tab" }, }, Inherits = "cPlugin", }, -- cPluginLua @@ -81,7 +81,6 @@ cPluginManager.AddHook(cPluginManager.HOOK_CHAT, OnChatMessage); GetNumLoadedPlugins = { Params = "", Return = "number", Notes = "Returns the number of loaded plugins (psLoaded only)" }, GetNumPlugins = { Params = "", Return = "number", Notes = "Returns the number of plugins, including the disabled, errored, unloaded and not-found ones" }, GetPlugin = { Params = "PluginName", Return = "{{cPlugin}}", Notes = "(DEPRECATED, UNSAFE) Returns a plugin handle of the specified plugin, or nil if such plugin is not loaded. Note thatdue to multithreading the handle is not guaranteed to be safe for use when stored - a single-plugin reload may have been triggered in the mean time for the requested plugin." }, - GetPluginFolderName = { Params = "PluginName", Return = "string", Notes = "Returns the name of the folder from which the plugin was loaded (without the \"Plugins\" part). Used as a plugin's display name." }, GetPluginsPath = { Params = "", Return = "string", Notes = "Returns the path where the individual plugin folders are located. Doesn't include the path separator at the end of the returned string." }, IsCommandBound = { Params = "Command", Return = "bool", Notes = "Returns true if in-game Command is already bound (by any plugin)" }, IsConsoleCommandBound = { Params = "Command", Return = "bool", Notes = "Returns true if console Command is already bound (by any plugin)" }, diff --git a/Server/Plugins/APIDump/Classes/WebAdmin.lua b/Server/Plugins/APIDump/Classes/WebAdmin.lua index a9d92b069..808335aea 100644 --- a/Server/Plugins/APIDump/Classes/WebAdmin.lua +++ b/Server/Plugins/APIDump/Classes/WebAdmin.lua @@ -5,15 +5,7 @@ return Desc = "", Functions = { - AddWebTab = { Params = "Title, UrlPath, HandlerFn", Return = "", Notes = "(STATIC) Adds a new web tab to webadmin. The tab uses \"Title\" as its display string and is identified in the URL using the UrlPath (https://server.domain.com/webadmin/{PluginName}/{UrlPath}). The HandlerFn is the callback function that is called when the admin accesses the page, it has the following signature:
function ({{a_Request|HTTPRequest}}, a_UrlPath)
return Content, ContentType
end
URLPath must not contain a '/', the recommendation is to use only 7-bit-clean ASCII character set." }, - GetAllWebTabs = { Params = "", Return = "array-table", Notes = "(STATIC) Returns an array-table with each item describing a web tab, for all web tabs registered in the WebAdmin, for all plugins. The returned table has the following format:
{
{
PluginName = \"Plugin's API name\",
UrlPath = \"UrlPath given to AddWebTab\",
Title = \"Title given to AddWebTab\",
},
...
}"}, - GetBaseURL = { Params = "URL", Return = "string", Notes = "(STATIC) Returns the string that is the path of the base webadmin (\"../../../webadmin\") relative to the given URL." }, - GetContentTypeFromFileExt = { Params = "FileExt", Return = "string", Notes = "(STATIC) Returns the content-type that should be used for files with the specified extension (without the dot), such as \"text/plain\" for the \"txt\" extension. If the extension is not known, returns an empty string." }, GetHTMLEscapedString = { Params = "string", Return = "string", Notes = "(STATIC) Gets the HTML-escaped representation of a requested string. This is useful for user input and game data that is not guaranteed to be escaped already." }, - GetPage = { Params = "{{Request|HTTPRequest}}", Return = "table", Notes = "(STATIC) Returns the (inner HTML) page contents for the specified request. Calls the appropriate WebTab handler registered via AddWebTab() and returns the information from that plugin wrapped in a table with the following structure:
{
Content = \"\", -- Content returned by the plugin
ContentType = \"\", -- Content type returned by the plugin, or \"text/html\" if none returned
UrlPath = \"\", -- UrlPath decoded from the request
TabTitle = \"\", -- Title of the tab that handled the request, as given to AddWebTab()
PluginName = \"\", -- API name of the plugin that handled the request
PluginFolder = \"\", -- Folder name (= display name) of the plugin that handled the request
}
This function is mainly used in the webadmin template file." }, - GetPorts = { Params = "", Return = "string", Notes = "Returns a comma-separated list of ports on which the webadmin is configured to listen. Note that this list does include ports that may currently be unavailable (another server was already listening on them prior to launching Cuberite)." }, - GetURLEncodedString = { Params = "string", Return = "string", Notes = "(STATIC) Returns the string given to it escaped by URL encoding, which makes the string suitable for transmission in an URL. Invalid characters are turned into \"%xy\" values." }, - Reload = { Params = "", Return = "", Notes = "Reloads the webadmin's config - the allowed logins, the template script and the login page. Note that reloading will not change the \"enabled\" state of the server, and it will not update listening ports. Existing WebTabs will be kept registered even after the reload." }, }, }, -- cWebAdmin diff --git a/Server/Plugins/Debuggers/Debuggers.lua b/Server/Plugins/Debuggers/Debuggers.lua index b9d1d1e41..422993932 100644 --- a/Server/Plugins/Debuggers/Debuggers.lua +++ b/Server/Plugins/Debuggers/Debuggers.lua @@ -1876,8 +1876,8 @@ end function HandleConsoleSchedule(a_Split) local prev = os.clock() - LOG("Scheduling a task for 5 seconds in the future (current os.clock is " .. prev .. ")") - cRoot:Get():GetDefaultWorld():ScheduleTask(5 * 20, + LOG("Scheduling a task for 2 seconds in the future (current os.clock is " .. prev .. ")") + cRoot:Get():GetDefaultWorld():ScheduleTask(40, function () local current = os.clock() local diff = current - prev -- cgit v1.2.3