+
WARNING: Any changes made here might require a server restart in order to be applied!
]]
@@ -151,7 +151,7 @@ local function ShowMonstersSettings( Request )
Monster Types:
-
+
WARNING: Any changes made here might require a server restart in order to be applied!
]]
@@ -174,7 +174,7 @@ local function ShowWorldsSettings( Request )
local KeyIdx = SettingsIni:FindKey("Worlds")
local WorldName = SettingsIni:GetValue( KeyIdx, WorldIdx )
if( SettingsIni:DeleteValueByID( KeyIdx, WorldIdx ) == true ) then
- InfoMsg = "INFO: Successfully removed world " .. WorldName .. "! "
+ InfoMsg = "INFO: Successfully removed world " .. WorldName .. "! "
bSaveIni = true
end
end
@@ -182,7 +182,7 @@ local function ShowWorldsSettings( Request )
if( Request.PostParams["AddWorld"] ~= nil ) then
if( Request.PostParams["WorldName"] ~= nil and Request.PostParams["WorldName"] ~= "" ) then
SettingsIni:SetValue("Worlds", "World", Request.PostParams["WorldName"], true )
- InfoMsg = "INFO: Successfully added world " .. Request.PostParams["WorldName"] .. "! "
+ InfoMsg = "INFO: Successfully added world " .. Request.PostParams["WorldName"] .. "! "
bSaveIni = true
end
end
@@ -214,7 +214,7 @@ local function ShowWorldsSettings( Request )
Worlds
Default World:
-
]]
+
]]
local KeyIdx = SettingsIni:FindKey("Worlds")
local NumValues = SettingsIni:GetNumValues( KeyIdx )
@@ -230,13 +230,333 @@ local function ShowWorldsSettings( Request )
Content = Content .. [[
Add World:
-
+
WARNING: Any changes made here might require a server restart in order to be applied!
]]
return Content
end
+local function SelectWorldButton( WorldName )
+ return ""
+end
+
+local function HTML_Select_Dimension( name, defaultValue )
+ return [[]]
+end
+
+local function HTML_Select_GameMode( name, defaultValue )
+ return [[]]
+end
+
+local function HTML_Select_Simulator( name, defaultValue )
+ return [[]]
+end
+
+local function HTML_Select_BiomeGen( name, defaultValue )
+ return [[]]
+end
+
+local function HTML_Select_HeightGen( name, defaultValue )
+ return [[]]
+end
+
+local function HTML_Select_CompositionGen( name, defaultValue )
+ return [[]]
+end
+
+local function HTML_Select_Generator( name, defaultValue )
+ return [[]]
+end
+
+function ShowWorldSettings( 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["SelectWorld"] ~= nil and Request.PostParams["WorldName"] ~= nil) then -- World is selected!
+ WORLD = Request.PostParams["WorldName"]
+ SelectedWorld = cRoot:Get():GetWorld(WORLD)
+ elseif SelectedWorld == nil then
+ WORLD = SettingsIni:GetValue("Worlds", "DefaultWorld")
+ SelectedWorld = cRoot:Get():GetWorld( WORLD )
+ end
+ local WorldIni = cIniFile(SelectedWorld:GetName() .. "/world.ini")
+ WorldIni:ReadFile()
+ if (Request.PostParams["world_submit"]) ~= nil then
+ if( tonumber( Request.PostParams["World_Dimension"] ) ~= nil ) then
+ WorldIni:DeleteValue( "General", "Dimension" )
+ WorldIni:SetValue( "General", "Dimension", Request.PostParams["World_Dimension"] )
+ end
+ if( tonumber( Request.PostParams["World_SpawnX"] ) ~= nil ) then
+ WorldIni:DeleteValue( "SpawnPosition", "X" )
+ WorldIni:SetValue( "SpawnPosition", "X", Request.PostParams["World_SpawnX"] )
+ end
+ if( tonumber( Request.PostParams["World_SpawnY"] ) ~= nil ) then
+ WorldIni:DeleteValue( "SpawnPosition", "Y" )
+ WorldIni:SetValue( "SpawnPosition", "Y", Request.PostParams["World_SpawnY"] )
+ end
+ if( tonumber( Request.PostParams["World_SpawnZ"] ) ~= nil ) then
+ WorldIni:DeleteValue( "SpawnPosition", "Z" )
+ WorldIni:SetValue( "SpawnPosition", "Z", Request.PostParams["World_SpawnZ"] )
+ end
+ if( tonumber( Request.PostParams["World_Seed"] ) ~= nil ) then
+ WorldIni:DeleteValue( "Seed", "Seed" )
+ WorldIni:SetValue( "Seed", "Seed", Request.PostParams["World_Seed"] )
+ end
+ if( tonumber( Request.PostParams["World_PVP"] ) ~= nil ) then
+ WorldIni:DeleteValue( "PVP", "Enabled" )
+ WorldIni:SetValue( "PVP", "Enabled", Request.PostParams["World_PVP"] )
+ end
+ if( tonumber( Request.PostParams["World_GameMode"] ) ~= nil ) then
+ WorldIni:DeleteValue( "GameMode", "GameMode" )
+ WorldIni:SetValue( "GameMode", "GameMode", Request.PostParams["World_GameMode"] )
+ end
+ if( tonumber( Request.PostParams["World_DeepSnow"] ) ~= nil ) then
+ WorldIni:DeleteValue( "Physics", "DeepSnow" )
+ WorldIni:SetValue( "Physics", "DeepSnow", Request.PostParams["World_DeepSnow"] )
+ end
+ if( tonumber( Request.PostParams["World_SandInstantFall"] ) ~= nil ) then
+ WorldIni:DeleteValue( "Physics", "SandInstantFall" )
+ WorldIni:SetValue( "Physics", "SandInstantFall", Request.PostParams["World_SandInstantFall"] )
+ end
+ if( tonumber( Request.PostParams["World_WaterSimulator"] ) ~= nil ) then
+ WorldIni:DeleteValue( "Physics", "WaterSimulator" )
+ WorldIni:SetValue( "Physics", "WaterSimulator", Request.PostParams["World_WaterSimulator"] )
+ end
+ if( tonumber( Request.PostParams["World_LavaSimulator"] ) ~= nil ) then
+ WorldIni:DeleteValue( "Physics", "LavaSimulator" )
+ WorldIni:SetValue( "Physics", "LavaSimulator", Request.PostParams["World_LavaSimulator"] )
+ end
+ if( tonumber( Request.PostParams["World_MaxSugarcaneHeight"] ) ~= nil ) then
+ WorldIni:DeleteValue( "Plants", "MaxSugarcaneHeight" )
+ WorldIni:SetValue( "Plants", "MaxSugarcaneHeight", Request.PostParams["World_MaxSugarcaneHeight"] )
+ end
+ if( tonumber( Request.PostParams["World_MaxCactusHeight"] ) ~= nil ) then
+ WorldIni:DeleteValue( "Plants", "MaxCactusHeight" )
+ WorldIni:SetValue( "Plants", "MaxCactusHeight", Request.PostParams["World_MaxCactusHeight"] )
+ end
+ if( tonumber( Request.PostParams["World_CarrotsBonemealable"] ) ~= nil ) then
+ WorldIni:DeleteValue( "Plants", "IsCarrotsBonemealable" )
+ WorldIni:SetValue( "Plants", "IsCarrotsBonemealable", Request.PostParams["World_CarrotsBonemealable"] )
+ end
+ if( tonumber( Request.PostParams["World_CropsBonemealable"] ) ~= nil ) then
+ WorldIni:DeleteValue( "Plants", "IsCropsBonemealable" )
+ WorldIni:SetValue( "Plants", "IsCropsBonemealable", Request.PostParams["World_CropsBonemealable"] )
+ end
+ if( tonumber( Request.PostParams["World_GrassBonemealable"] ) ~= nil ) then
+ WorldIni:DeleteValue( "Plants", "IsGrassBonemealable" )
+ WorldIni:SetValue( "Plants", "IsGrassBonemealable", Request.PostParams["World_GrassBonemealable"] )
+ end
+ if( tonumber( Request.PostParams["World_SaplingBonemealable"] ) ~= nil ) then
+ WorldIni:DeleteValue( "Plants", "IsSaplingBonemealable" )
+ WorldIni:SetValue( "Plants", "IsSaplingBonemealable", Request.PostParams["World_SaplingBonemealable"] )
+ end
+ if( tonumber( Request.PostParams["World_MelonStemBonemealable"] ) ~= nil ) then
+ WorldIni:DeleteValue( "Plants", "IsMelonStemBonemealable" )
+ WorldIni:SetValue( "Plants", "IsMelonStemBonemealable", Request.PostParams["World_MelonStemBonemealable"] )
+ end
+ if( tonumber( Request.PostParams["World_MelonBonemealable"] ) ~= nil ) then
+ WorldIni:DeleteValue( "Plants", "IsMelonBonemealable" )
+ WorldIni:SetValue( "Plants", "IsMelonBonemealable", Request.PostParams["World_MelonBonemealable"] )
+ end
+ if( tonumber( Request.PostParams["World_PotatoesBonemealable"] ) ~= nil ) then
+ WorldIni:DeleteValue( "Plants", "IsPotatoesBonemealable" )
+ WorldIni:SetValue( "Plants", "IsPotatoesBonemealable", Request.PostParams["World_PotatoesBonemealable"] )
+ end
+ if( tonumber( Request.PostParams["World_PumpkinStemBonemealable"] ) ~= nil ) then
+ WorldIni:DeleteValue( "Plants", "IsPumpkinStemBonemealable" )
+ WorldIni:SetValue( "Plants", "IsPumpkinStemBonemealable", Request.PostParams["World_PumpkinStemBonemealable"] )
+ end
+ if( tonumber( Request.PostParams["World_PumpkinBonemealable"] ) ~= nil ) then
+ WorldIni:DeleteValue( "Plants", "IsPumpkinBonemealable" )
+ WorldIni:SetValue( "Plants", "IsPumpkinBonemealable", Request.PostParams["World_PumpkinBonemealable"] )
+ end
+ if( tonumber( Request.PostParams["World_SugarCaneBonemealable"] ) ~= nil ) then
+ WorldIni:DeleteValue( "Plants", "IsSugarCaneBonemealable" )
+ WorldIni:SetValue( "Plants", "IsSugarCaneBonemealable", Request.PostParams["World_SugarCaneBonemealable"] )
+ end
+ if( tonumber( Request.PostParams["World_CactusBonemealable"] ) ~= nil ) then
+ WorldIni:DeleteValue( "Plants", "IsCactusBonemealable" )
+ WorldIni:SetValue( "Plants", "IsCactusBonemealable", Request.PostParams["World_CactusBonemealable"] )
+ end
+ if( ( Request.PostParams["World_BiomeGen"] ) ~= nil ) then
+ WorldIni:DeleteValue( "Generator", "BiomeGen" )
+ WorldIni:SetValue( "Generator", "BiomeGen", Request.PostParams["World_BiomeGen"] )
+ end
+ if( ( Request.PostParams["World_HeightGen"] ) ~= nil ) then
+ WorldIni:DeleteValue( "Generator", "HeightGen" )
+ WorldIni:SetValue( "Generator", "HeightGen", Request.PostParams["World_HeightGen"] )
+ end
+ if( ( Request.PostParams["World_CompositionGen"] ) ~= nil ) then
+ WorldIni:DeleteValue( "Generator", "CompositionGen" )
+ WorldIni:SetValue( "Generator", "CompositionGen", Request.PostParams["World_CompositionGen"] )
+ end
+ if( ( Request.PostParams["World_Structures"] ) ~= nil ) then
+ WorldIni:DeleteValue( "Generator", "Structures" )
+ WorldIni:SetValue( "Generator", "Structures", Request.PostParams["World_Structures"] )
+ end
+ if( ( Request.PostParams["World_Finishers"] ) ~= nil ) then
+ WorldIni:DeleteValue( "Generator", "Finishers" )
+ WorldIni:SetValue( "Generator", "Finishers", Request.PostParams["World_Finishers"] )
+ end
+ if( ( Request.PostParams["World_Generator"] ) ~= nil ) then
+ WorldIni:DeleteValue( "Generator", "Generator" )
+ WorldIni:SetValue( "Generator", "Generator", Request.PostParams["World_Generator"] )
+ end
+ WorldIni:WriteFile()
+ end
+ Content = Content .. "
+ ]]
+
+
+ Content = Content .. [[
+ WARNING: Any changes made here might require a server restart in order to be applied!
+ ]]
+ return Content
+end
+
+
+
function HandleRequest_ServerSettings( Request )
local Content = ""
@@ -247,14 +567,17 @@ function HandleRequest_ServerSettings( Request )