summaryrefslogtreecommitdiffstats
path: root/Core/web_manageserver.lua
diff options
context:
space:
mode:
authorAlexander Harkness <bearbin@gmail.com>2013-07-27 17:16:04 +0200
committerAlexander Harkness <bearbin@gmail.com>2013-07-27 17:16:04 +0200
commit0623a4f9be1c21651ea212f7b4d86136a67ddffe (patch)
tree5a96f13f72fa394bf74d10839a76ec7a1eac9275 /Core/web_manageserver.lua
parentRemoved all the pre-exising core files. (diff)
downloadcuberite-0623a4f9be1c21651ea212f7b4d86136a67ddffe.tar
cuberite-0623a4f9be1c21651ea212f7b4d86136a67ddffe.tar.gz
cuberite-0623a4f9be1c21651ea212f7b4d86136a67ddffe.tar.bz2
cuberite-0623a4f9be1c21651ea212f7b4d86136a67ddffe.tar.lz
cuberite-0623a4f9be1c21651ea212f7b4d86136a67ddffe.tar.xz
cuberite-0623a4f9be1c21651ea212f7b4d86136a67ddffe.tar.zst
cuberite-0623a4f9be1c21651ea212f7b4d86136a67ddffe.zip
Diffstat (limited to 'Core/web_manageserver.lua')
-rw-r--r--Core/web_manageserver.lua35
1 files changed, 35 insertions, 0 deletions
diff --git a/Core/web_manageserver.lua b/Core/web_manageserver.lua
new file mode 100644
index 000000000..a2936c1a8
--- /dev/null
+++ b/Core/web_manageserver.lua
@@ -0,0 +1,35 @@
+function HandleRequest_ManageServer( Request )
+ local Content = ""
+ if (Request.PostParams["RestartServer"] ~= nil) then
+ cRoot:Get():QueueExecuteConsoleCommand("restart");
+ elseif (Request.PostParams["ReloadServer"] ~= nil) then
+ cRoot:Get():GetPluginManager():ReloadPlugins();
+ elseif (Request.PostParams["StopServer"] ~= nil) then
+ cRoot:Get():QueueExecuteConsoleCommand("stop");
+ elseif (Request.PostParams["WorldSaveAllChunks"] ~= nil) then
+ cRoot:Get():GetWorld(Request.PostParams["WorldSaveAllChunks"]):SaveAllChunks();
+ end
+ Content = Content .. [[
+ <form method="POST">
+ <table>
+ <th colspan="2">Manage Server</th>
+ <tr><td><input type="submit" value="Restart Server" name="RestartServer"> restart the server</td></tr> <br />
+ <tr><td><input type="submit" value="Reload Server" name="ReloadServer"> reload the server</td></tr> <br />
+ <tr><td><input type="submit" value="Stop Server" name="StopServer"> stop the server</td></tr> <br />
+ </th>
+ </table>
+ <table>
+ <th colspan="2">Manage Worlds</th>
+ ]]
+ local LoopWorlds = function( World )
+ Content = Content .. [[
+ <tr><td><input type="submit" value="]] .. World:GetName() .. [[" name="WorldSaveAllChunks"> Save all the chunks of world ]] .. World:GetName() .. [[</td></tr> <br />
+
+ ]]
+ end
+ cRoot:Get():ForEachWorld( LoopWorlds )
+ Content = Content .. "</th></table>"
+
+ return Content
+end
+