1
0

Added PrimaryServerVersion to the webadmin (patch contributed by STR_Warrior)

git-svn-id: http://mc-server.googlecode.com/svn/trunk@1088 0a769ca7-a7f5-676a-18bf-c427514a06d6
This commit is contained in:
madmaxoft@gmail.com 2012-12-21 11:13:43 +00:00
parent 912a1e7adc
commit 65aa72a2c3

View File

@ -9,9 +9,18 @@ end
local function HTML_Select_On_Off( name, defaultValue )
return [[<select name="]] .. name .. [[">]]
.. HTML_Option("1", "On", defaultValue == 1 )
.. HTML_Option("0", "Off", defaultValue == 0 )
.. [[</select>]]
.. HTML_Option("1", "On", defaultValue == 1 )
.. HTML_Option("0", "Off", defaultValue == 0 )
.. [[</select>]]
end
local function HTML_Select_Version( name, defaultValue )
return [[<select name="]] .. name .. [[">]]
.. HTML_Option("29", "1.2.5", defaultValue == 3 )
.. HTML_Option("39", "1.3.2", defaultValue == 2 )
.. HTML_Option("47", "1.4.2", defaultValue == 1 )
.. HTML_Option("49", "1.4.5", defaultValue == 0 )
.. [[</select>]]
end
@ -31,7 +40,10 @@ local function ShowGeneralSettings( Request )
SettingsIni:SetValue("Server", "MaxPlayers", Request.PostParams["Server_MaxPlayers"], false )
end
if( tonumber( Request.PostParams["Server_Port"] ) ~= nil ) then
SettingsIni:SetValue("Server", "Port", Request.PostParams["Server_Port"], false )
SettingsIni:SetValue("Server", "Port", Request.PostParams["Server_Port"], false )
end
if( tonumber( Request.PostParams["Server_Version"] ) ~= nil ) then
SettingsIni:SetValue("Server", "PrimaryServerVersion", Request.PostParams["Server_Version"], false )
end
if( tonumber( Request.PostParams["Authentication_Authenticate"] ) ~= nil ) then
SettingsIni:SetValue("Authentication", "Authenticate", Request.PostParams["Authentication_Authenticate"], false )
@ -60,6 +72,8 @@ local function ShowGeneralSettings( Request )
<td><input type="text" name="Server_MaxPlayers" value="]] .. SettingsIni:GetValue("Server", "MaxPlayers") .. [["></td></tr>
<tr><td>Port:</td>
<td><input type="text" name="Server_Port" value="]] .. SettingsIni:GetValue("Server", "Port") .. [["></td></tr>
<tr><td>Shown Version:</td>
<td>]] .. HTML_Select_Version("Server_Version", SettingsIni:GetValueI("Server", "PrimaryServerVersion") ) .. [[</td></tr>
</table><br>
<table>