From ad4a61ae0e9d8e43972f29eba539a23838cd8ab7 Mon Sep 17 00:00:00 2001 From: "nielsbreu@gmail.com" Date: Fri, 3 May 2013 20:22:01 +0000 Subject: Added lots of new options in the world config tab. git-svn-id: http://mc-server.googlecode.com/svn/trunk@1440 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- MCServer/Plugins/Core/web_serversettings.lua | 336 ++++++++++++++++++++++++++- 1 file changed, 335 insertions(+), 1 deletion(-) (limited to 'MCServer/Plugins/Core/web_serversettings.lua') diff --git a/MCServer/Plugins/Core/web_serversettings.lua b/MCServer/Plugins/Core/web_serversettings.lua index e256eb853..9e23ffaef 100644 --- a/MCServer/Plugins/Core/web_serversettings.lua +++ b/MCServer/Plugins/Core/web_serversettings.lua @@ -249,6 +249,14 @@ local function HTML_Select_Dimension( name, defaultValue ) .. [[]] end +local function HTML_Select_Scheme( name, defaultValue ) + return [[]] +end + local function HTML_Select_GameMode( name, defaultValue ) return [[]] + .. HTML_Option("Noise3D", "Noise3D", defaultValue == "Noise3D" ) .. HTML_Option("Biomal", "Biomal", defaultValue == "Biomal" ) .. HTML_Option("Classic", "Classic", defaultValue == "Classic" ) .. HTML_Option("Flat", "Flat", defaultValue == "Flat" ) @@ -285,6 +294,7 @@ end local function HTML_Select_CompositionGen( name, defaultValue ) return [[]] end +local function HTML_Select_Biome( name, defaultValue ) + return [[]] +end + function ShowWorldSettings( Request ) local Content = "" local InfoMsg = nil @@ -319,6 +356,10 @@ function ShowWorldSettings( Request ) WorldIni:DeleteValue( "General", "Dimension" ) WorldIni:SetValue( "General", "Dimension", Request.PostParams["World_Dimension"] ) end + if( tonumber( Request.PostParams["World_Schema"] ) ~= nil ) then + WorldIni:DeleteValue( "General", "Schema" ) + WorldIni:SetValue( "General", "Schema", Request.PostParams["World_Schema"] ) + end if( tonumber( Request.PostParams["World_SpawnX"] ) ~= nil ) then WorldIni:DeleteValue( "SpawnPosition", "X" ) WorldIni:SetValue( "SpawnPosition", "X", Request.PostParams["World_SpawnX"] ) @@ -415,14 +456,138 @@ function ShowWorldSettings( Request ) WorldIni:DeleteValue( "Generator", "BiomeGen" ) WorldIni:SetValue( "Generator", "BiomeGen", Request.PostParams["World_BiomeGen"] ) end + if( ( Request.PostParams["World_Biome"] ) ~= nil ) then + WorldIni:DeleteValue( "Generator", "ConstantBiome" ) + WorldIni:SetValue( "Generator", "ConstantBiome", Request.PostParams["World_Biome"] ) + end + if( ( Request.PostParams["World_MultiStepMapOceanCellSize"] ) ~= nil ) then + WorldIni:DeleteValue( "Generator", "MultiStepMapOceanCellSize" ) + WorldIni:SetValue( "Generator", "MultiStepMapOceanCellSize", Request.PostParams["World_MultiStepMapOceanCellSize"] ) + end + if( ( Request.PostParams["World_MultiStepMapMushroomIslandSize"] ) ~= nil ) then + WorldIni:DeleteValue( "Generator", "MultiStepMapMushroomIslandSize" ) + WorldIni:SetValue( "Generator", "MultiStepMapMushroomIslandSize", Request.PostParams["World_MultiStepMapMushroomIslandSize"] ) + end + if( ( Request.PostParams["World_MultiStepMapRiverCellSize"] ) ~= nil ) then + WorldIni:DeleteValue( "Generator", "MultiStepMapRiverCellSize" ) + WorldIni:SetValue( "Generator", "MultiStepMapRiverCellSize", Request.PostParams["World_MultiStepMapRiverCellSize"] ) + end + if( ( Request.PostParams["World_MultiStepMapRiverWidth"] ) ~= nil ) then + WorldIni:DeleteValue( "Generator", "MultiStepMapRiverWidth" ) + WorldIni:SetValue( "Generator", "MultiStepMapRiverWidth", Request.PostParams["World_MultiStepMapRiverWidth"] ) + end + if( ( Request.PostParams["World_MultiStepMapLandBiomeSize"] ) ~= nil ) then + WorldIni:DeleteValue( "Generator", "MultiStepMapLandBiomeSize" ) + WorldIni:SetValue( "Generator", "MultiStepMapLandBiomeSize", Request.PostParams["World_MultiStepMapLandBiomeSize"] ) + end + if( ( Request.PostParams["World_DistortedVoronoiCellSize"] ) ~= nil ) then + WorldIni:DeleteValue( "Generator", "DistortedVoronoiCellSize" ) + WorldIni:SetValue( "Generator", "DistortedVoronoiCellSize", Request.PostParams["World_DistortedVoronoiCellSize"] ) + end + if( ( Request.PostParams["World_DistortedVoronoiBiomes"] ) ~= nil ) then + WorldIni:DeleteValue( "Generator", "DistortedVoronoiBiomes" ) + WorldIni:SetValue( "Generator", "DistortedVoronoiBiomes", Request.PostParams["World_DistortedVoronoiBiomes"] ) + end + if( ( Request.PostParams["World_VoronoiCellSize"] ) ~= nil ) then + WorldIni:DeleteValue( "Generator", "VoronoiCellSize" ) + WorldIni:SetValue( "Generator", "VoronoiCellSize", Request.PostParams["World_VoronoiCellSize"] ) + end + if( ( Request.PostParams["World_VoronoiBiomesdVoronoiBiomes"] ) ~= nil ) then + WorldIni:DeleteValue( "Generator", "VoronoiBiomes" ) + WorldIni:SetValue( "Generator", "VoronoiBiomes", Request.PostParams["World_VoronoiBiomes"] ) + end + if( ( Request.PostParams["World_CheckerBoardBiomes"] ) ~= nil ) then + WorldIni:DeleteValue( "Generator", "CheckerBoardBiomes" ) + WorldIni:SetValue( "Generator", "CheckerBoardBiomes", Request.PostParams["World_CheckerBoardBiomes"] ) + end + if( ( Request.PostParams["World_CheckerBoardBiomeSize"] ) ~= nil ) then + WorldIni:DeleteValue( "Generator", "CheckerBoardBiomeSize" ) + WorldIni:SetValue( "Generator", "CheckerBoardBiomeSize", Request.PostParams["World_CheckerBoardBiomeSize"] ) + 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_FlatHeight"] ) ~= nil ) then + WorldIni:DeleteValue( "Generator", "FlatHeight" ) + WorldIni:SetValue( "Generator", "FlatHeight", Request.PostParams["World_FlatHeight"] ) + 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_Noise3DSeaLevel"] ) ~= nil ) then + WorldIni:DeleteValue( "Generator", "Noise3DSeaLevel" ) + WorldIni:SetValue( "Generator", "Noise3DSeaLevel", Request.PostParams["World_Noise3DSeaLevel"] ) + end + if( ( Request.PostParams["World_Noise3DHeightAmplification"] ) ~= nil ) then + WorldIni:DeleteValue( "Generator", "Noise3DHeightAmplification" ) + WorldIni:SetValue( "Generator", "Noise3DHeightAmplification", Request.PostParams["World_Noise3DHeightAmplification"] ) + end + if( ( Request.PostParams["World_Noise3DMidPoint"] ) ~= nil ) then + WorldIni:DeleteValue( "Generator", "Noise3DMidPoint" ) + WorldIni:SetValue( "Generator", "Noise3DMidPoint", Request.PostParams["World_Noise3DMidPoint"] ) + end + if( ( Request.PostParams["World_Noise3DFrequencyX"] ) ~= nil ) then + WorldIni:DeleteValue( "Generator", "Noise3DFrequencyX" ) + WorldIni:SetValue( "Generator", "Noise3DFrequencyX", Request.PostParams["World_Noise3DFrequencyX"] ) + end + if( ( Request.PostParams["World_Noise3DFrequencyY"] ) ~= nil ) then + WorldIni:DeleteValue( "Generator", "Noise3DFrequencyY" ) + WorldIni:SetValue( "Generator", "Noise3DFrequencyY", Request.PostParams["World_Noise3DFrequencyY"] ) + end + if( ( Request.PostParams["World_Noise3DFrequencyZ"] ) ~= nil ) then + WorldIni:DeleteValue( "Generator", "Noise3DFrequencyZ" ) + WorldIni:SetValue( "Generator", "Noise3DFrequencyZ", Request.PostParams["World_Noise3DFrequencyZ"] ) + end + if( ( Request.PostParams["World_Noise3DAirThreshold"] ) ~= nil ) then + WorldIni:DeleteValue( "Generator", "Noise3DAirThreshold" ) + WorldIni:SetValue( "Generator", "Noise3DAirThreshold", Request.PostParams["World_Noise3DAirThreshold"] ) + end + if( ( Request.PostParams["World_ClassicSeaLevel"] ) ~= nil ) then + WorldIni:DeleteValue( "Generator", "ClassicSeaLevel" ) + WorldIni:SetValue( "Generator", "ClassicSeaLevel", Request.PostParams["World_ClassicSeaLevel"] ) + end + if( ( Request.PostParams["World_ClassicBeachHeight"] ) ~= nil ) then + WorldIni:DeleteValue( "Generator", "ClassicBeachHeight" ) + WorldIni:SetValue( "Generator", "ClassicBeachHeight", Request.PostParams["World_ClassicBeachHeight"] ) + end + if( ( Request.PostParams["World_ClassicBeachDepth"] ) ~= nil ) then + WorldIni:DeleteValue( "Generator", "ClassicBeachDepth" ) + WorldIni:SetValue( "Generator", "ClassicBeachDepth", Request.PostParams["World_ClassicBeachDepth"] ) + end + if( ( Request.PostParams["World_ClassicBlockTop"] ) ~= nil ) then + WorldIni:DeleteValue( "Generator", "ClassicBlockTop" ) + WorldIni:SetValue( "Generator", "ClassicBlockTop", Request.PostParams["World_ClassicBlockTop"] ) + end + if( ( Request.PostParams["World_ClassicBlockMiddle"] ) ~= nil ) then + WorldIni:DeleteValue( "Generator", "ClassicBlockMiddle" ) + WorldIni:SetValue( "Generator", "ClassicBlockMiddle", Request.PostParams["World_ClassicBlockMiddle"] ) + end + if( ( Request.PostParams["World_ClassicBlockBottom"] ) ~= nil ) then + WorldIni:DeleteValue( "Generator", "ClassicBlockBottom" ) + WorldIni:SetValue( "Generator", "ClassicBlockBottom", Request.PostParams["World_ClassicBlockBottom"] ) + end + if( ( Request.PostParams["World_ClassicBlockBeach"] ) ~= nil ) then + WorldIni:DeleteValue( "Generator", "ClassicBlockBeach" ) + WorldIni:SetValue( "Generator", "ClassicBlockBeach", Request.PostParams["World_ClassicBlockBeach"] ) + end + if( ( Request.PostParams["World_ClassicBlockBeachBottom"] ) ~= nil ) then + WorldIni:DeleteValue( "Generator", "ClassicBlockBeachBottom" ) + WorldIni:SetValue( "Generator", "ClassicBlockBeachBottom", Request.PostParams["World_ClassicBlockBeachBottom"] ) + end + if( ( Request.PostParams["World_ClassicBlockSea"] ) ~= nil ) then + WorldIni:DeleteValue( "Generator", "ClassicBlockSea" ) + WorldIni:SetValue( "Generator", "ClassicBlockSea", Request.PostParams["World_ClassicBlockSea"] ) + end + if( ( Request.PostParams["World_SameBlockType"] ) ~= nil ) then + WorldIni:DeleteValue( "Generator", "SameBlockType" ) + WorldIni:SetValue( "Generator", "SameBlockType", Request.PostParams["World_SameBlockType"] ) + end + if( ( Request.PostParams["World_SameBlockBedrocked"] ) ~= nil ) then + WorldIni:DeleteValue( "Generator", "SameBlockBedrocked" ) + WorldIni:SetValue( "Generator", "SameBlockBedrocked", Request.PostParams["World_SameBlockBedrocked"] ) + end if( ( Request.PostParams["World_Structures"] ) ~= nil ) then WorldIni:DeleteValue( "Generator", "Structures" ) WorldIni:SetValue( "Generator", "Structures", Request.PostParams["World_Structures"] ) @@ -435,6 +600,39 @@ function ShowWorldSettings( Request ) WorldIni:DeleteValue( "Generator", "Generator" ) WorldIni:SetValue( "Generator", "Generator", Request.PostParams["World_Generator"] ) end + if( ( Request.PostParams["World_MineShaftsGridSize"] ) ~= nil ) then + WorldIni:DeleteValue( "Generator", "MineShaftsGridSize" ) + WorldIni:SetValue( "Generator", "MineShaftsGridSize", Request.PostParams["World_MineShaftsGridSize"] ) + end + if( ( Request.PostParams["World_MineShaftsMaxSystemSize"] ) ~= nil ) then + WorldIni:DeleteValue( "Generator", "MineShaftsMaxSystemSize" ) + WorldIni:SetValue( "Generator", "MineShaftsMaxSystemSize", Request.PostParams["World_MineShaftsMaxSystemSize"] ) + end + if( ( Request.PostParams["World_MineShaftsChanceCorridor"] ) ~= nil ) then + WorldIni:DeleteValue( "Generator", "MineShaftsChanceCorridor" ) + WorldIni:SetValue( "Generator", "MineShaftsChanceCorridor", Request.PostParams["World_MineShaftsChanceCorridor"] ) + end + if( ( Request.PostParams["World_MineShaftsChanceCrossing"] ) ~= nil ) then + WorldIni:DeleteValue( "Generator", "MineShaftsChanceCrossing" ) + WorldIni:SetValue( "Generator", "MineShaftsChanceCrossing", Request.PostParams["World_MineShaftsChanceCrossing"] ) + end + if( ( Request.PostParams["World_MineShaftsChanceStaircase"] ) ~= nil ) then + WorldIni:DeleteValue( "Generator", "MineShaftsChanceStaircase" ) + WorldIni:SetValue( "Generator", "MineShaftsChanceStaircase", Request.PostParams["World_MineShaftsChanceStaircase"] ) + end + if( ( Request.PostParams["World_LavaLakesProbability"] ) ~= nil ) then + WorldIni:DeleteValue( "Generator", "LavaLakesProbability" ) + WorldIni:SetValue( "Generator", "LavaLakesProbability", Request.PostParams["World_LavaLakesProbability"] ) + end + if( ( Request.PostParams["World_WaterLakesProbability"] ) ~= nil ) then + WorldIni:DeleteValue( "Generator", "WaterLakesProbability" ) + WorldIni:SetValue( "Generator", "WaterLakesProbability", Request.PostParams["World_WaterLakesProbability"] ) + end + if( ( Request.PostParams["World_BottomLavaLevel"] ) ~= nil ) then + WorldIni:DeleteValue( "Generator", "BottomLavaLevel" ) + WorldIni:SetValue( "Generator", "BottomLavaLevel", Request.PostParams["World_BottomLavaLevel"] ) + end + WorldIni:WriteFile() end Content = Content .. "

World for operations: " .. WORLD .. "

" @@ -461,6 +659,12 @@ function ShowWorldSettings( Request )
+ + + +
Storage
Schema:]] .. HTML_Select_Scheme("World_Schema", WorldIni:GetValueI("Storage", "Schema") ) .. [[
+
+ @@ -546,8 +750,138 @@ function ShowWorldSettings( Request )
Spawn Position
X:
]] .. HTML_Select_Generator("World_Generator", WorldIni:GetValue("Generator", "Generator") ) .. [[
- ]] +
+ +
+
Finetuning
+ + ]] + if WorldIni:GetValue( "Generator", "BiomeGen" ) == "Constant" then + Content = Content .. [[ + + + ]] + elseif WorldIni:GetValue( "Generator", "BiomeGen" ) == "MultiStepMap" then + Content = Content .. [[ + + + + + + + + + + + ]] + elseif WorldIni:GetValue( "Generator", "BiomeGen" ) == "DistortedVoronoi" then + Content = Content .. [[ + + + + + ]] + elseif WorldIni:GetValue( "Generator", "BiomeGen" ) == "Voronoi" then + Content = Content .. [[ + + + + + ]] + elseif WorldIni:GetValue( "Generator", "BiomeGen" ) == "CheckerBoard" then + Content = Content .. [[ + + + + + ]] + end + if WorldIni:GetValue( "Generator", "CompositionGen" ) == "Noise3D" then + Content = Content .. [[ + + + + + + + + + + + + + + + ]] + elseif WorldIni:GetValue( "Generator", "CompositionGen" ) == "Classic" then + Content = Content .. [[ + + + + + + + + + + + + + + + + + + + ]] + elseif WorldIni:GetValue( "Generator", "CompositionGen" ) == "SameBlock" then + Content = Content .. [[ + + + + + ]] + end + if WorldIni:GetValue( "Generator", "HeightGen" ) == "Flat" then + Content = Content .. [[ + + + ]] + end + if string.find( WorldIni:GetValue( "Generator", "Structures" ), "MineShafts" ) ~= nil then + Content = Content .. [[ + + + + + + + + + + + ]] + end + if string.find( WorldIni:GetValue( "Generator", "Structures" ), "LavaLakes" ) ~= nil then + Content = Content .. [[ + + + ]] + end + if string.find( WorldIni:GetValue( "Generator", "Structures" ), "WaterLakes" ) ~= nil then + Content = Content .. [[ + + + ]] + end + if string.find( WorldIni:GetValue( "Generator", "Finishers" ), "BottomLava" ) ~= nil then + Content = Content .. [[ + + + ]] + end + Content = Content .. [[
Biome Generator
ConstantBiome:]] .. HTML_Select_Biome( "World_Biome", WorldIni:GetValue("Generator", "ConstantBiome" ) ) .. [[
Biome Generator
MultiStepMapOceanCellSize:
MultiStepMapOceanCellSize:
MultiStepMapOceanCellSize:
MultiStepMapOceanCellSize:
MultiStepMapOceanCellSize:
Biome Generator
DistortedVoronoiCellSize:
DistortedVoronoiBiomes:
Biome Generator
VoronoiCellSize:
VoronoiBiomes:
Biome Generator
CheckerBoardBiomes:
CheckerBoardBiomeSize:
Composition Generator
Noise3DSeaLevel:
Noise3DHeightAmplification:
Noise3DMidPoint:
Noise3DFrequencyX:
Noise3DFrequencyY:
Noise3DFrequencyZ:
Noise3DAirThreshold:
Composition Generator
ClassicSeaLevel:
ClassicBeachHeight:
ClassicBeachDepth:
ClassicBlockTop:
ClassicBlockMiddle:
ClassicBlockBottom:
ClassicBlockBeach:
ClassicBlockBeachBottom:
ClassicBlockSea:
Composition Generator
SameBlockType:
SameBlockBedrocked:
Height Generator
FlatHeight:
MineShafts
MineShaftsGridSize:
MineShaftsMaxSystemSize:
MineShaftsChanceCorridor:
MineShaftsChanceCrossing:
MineShaftsChanceStaircase:
LavaLakes
LavaLakesProbability:
WaterLakes
WaterLakesProbability:
BottomLavaLevel
BottomLavaLevel:
]] Content = Content .. [[
WARNING: Any changes made here might require a server restart in order to be applied! -- cgit v1.2.3