Added the option of saving all the chunks of a world using the webadmin.

FS #354

git-svn-id: http://mc-server.googlecode.com/svn/trunk@1588 0a769ca7-a7f5-676a-18bf-c427514a06d6
master
nielsbreu@gmail.com 2013-06-13 17:05:53 +00:00
parent 03c6bb9f85
commit 1e6e39f10a
1 changed files with 20 additions and 9 deletions

View File

@ -6,19 +6,30 @@ function HandleRequest_ManageServer( Request )
cRoot:Get():GetPluginManager():ReloadPlugins() cRoot:Get():GetPluginManager():ReloadPlugins()
elseif( Request.PostParams["StopServer"] ~= nil ) then elseif( Request.PostParams["StopServer"] ~= nil ) then
cRoot:Get():ExecuteConsoleCommand("stop") cRoot:Get():ExecuteConsoleCommand("stop")
elseif( Request.PostParams["WorldSaveAllChunks"] ~= nil ) then
cRoot:Get():GetWorld(Request.PostParams["WorldSaveAllChunks"]):SaveAllChunks()
end end
Content = Content .. [[ Content = Content .. [[
<form method="POST">]] <form method="POST">
<table>
Content = Content .. [[<table> <th colspan="2">Manage Server</th>
<tr style="padding-top:5px;"> <tr><td><input type="submit" value="Restart Server" name="RestartServer"> restart the server</td></tr> <br />
<td><input type="submit" value="Restart Server" name="RestartServer"> <br /> restart the server</td> <tr><td><input type="submit" value="Reload Server" name="ReloadServer"> reload the server</td></tr> <br />
<td><input type="submit" value="Reload Server" name="ReloadServer"> <br /> reload the server</td> <tr><td><input type="submit" value="Stop Server" name="StopServer"> stop the server</td></tr> <br />
<td><input type="submit" value="Stop Server" name="StopServer"> <br /> stop the server</td> </th>
</tr>
</table> </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 return Content
end end