-- Some HTML helper functions local function HTML_Option( value, text, selected ) if( selected == true ) then return [[]] else return [["]] end end local function HTML_Select_On_Off( name, defaultValue ) return [[]] end local function ShowGeneralSettings( Request ) local Content = "" local InfoMsg = nil local SettingsIni = cIniFile("settings.ini") if( SettingsIni:ReadFile() == false ) then InfoMsg = "ERROR: Could not read settings.ini!" end if( Request.PostParams["general_submit"] ~= nil ) then SettingsIni:SetValue("Server", "Description",Request.PostParams["Server_Description"],false ) if( tonumber( Request.PostParams["Server_MaxPlayers"] ) ~= nil ) then 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 ) end if( tonumber( Request.PostParams["Authentication_Authenticate"] ) ~= nil ) then SettingsIni:SetValue("Authentication", "Authenticate", Request.PostParams["Authentication_Authenticate"], false ) end if( SettingsIni:WriteFile() == false ) then InfoMsg = [[ERROR: Could not write to settings.ini!]] else InfoMsg = [[INFO: Successfully saved changes to settings.ini]] end end Content = Content .. [[
]] return Content end local function ShowMonstersSettings( Request ) local Content = "" local InfoMsg = nil local SettingsIni = cIniFile("settings.ini") if( SettingsIni:ReadFile() == false ) then InfoMsg = "ERROR: Could not read settings.ini!" end if( Request.PostParams["monsters_submit"] ~= nil ) then if( tonumber( Request.PostParams["Monsters_AnimalsOn"] ) ~= nil ) then SettingsIni:SetValue("Monsters", "AnimalsOn", Request.PostParams["Monsters_AnimalsOn"], false ) end if( tonumber( Request.PostParams["Monsters_AnimalSpawnInterval"] ) ~= nil ) then SettingsIni:SetValue("Monsters", "AnimalSpawnInterval", Request.PostParams["Monsters_AnimalSpawnInterval"], false ) end SettingsIni:SetValue("Monsters", "Types", Request.PostParams["Monsters_Types"], false ) if( SettingsIni:WriteFile() == false ) then InfoMsg = "ERROR: Could not write to settings.ini!" else InfoMsg = "INFO: Successfully saved changes to settings.ini" end end Content = Content .. "]] return Content end local function ShowWorldsSettings( Request ) return "Worlds Settings
" end function HandleRequest_ServerSettings( Request ) local Content = "" Content = Content .. [[Server Settings
General | Monsters | Worlds |