INFO: " .. Content .. "
" - else - return "" - end -end - -function HandleRequest_ManagePlugins( Request ) - local Content = "" - - if( Request.PostParams["reload"] ~= nil ) then - Content = Content .. "" - Content = Content .. "Reloading plugins... This can take a while depending on the plugins you're using.
" - cRoot:Get():GetPluginManager():ReloadPlugins() - return Content - end - - local SettingsIni = cIniFile("settings.ini") - if( SettingsIni:ReadFile() == true ) then - Content = Content .. HandlePluginListChanges( Request, SettingsIni ) - else - Content = Content .. "Cannot find/modify settings.ini" - end - - local PluginManager = cRoot:Get():GetPluginManager() - PluginManager:FindPlugins() -- Refreshes the plugin list - local PluginList = PluginManager:GetAllPlugins() - - Content = Content .. "".. ActivePluginsName[i] .." | " - Content = Content .. "" .. ActivePluginsName[i] .. " V. " .. ActivePluginVersion[i] .. " | " .. Button_DisablePlugin(ActivePluginsName[i]) .. " | " - Content = Content .. "
".. InactivePlugins[i] .." | " - Content = Content .. "" .. Button_EnablePlugin(InactivePlugins[i]) .. " | " - Content = Content .. "
INFO: " .. Content .. "
" + else + return "" + end +end + +function HandleRequest_ManagePlugins( Request ) + local Content = "" + + if( Request.PostParams["reload"] ~= nil ) then + Content = Content .. "" + Content = Content .. "Reloading plugins... This can take a while depending on the plugins you're using.
" + cRoot:Get():GetPluginManager():ReloadPlugins() + return Content + end + + local SettingsIni = cIniFile("settings.ini") + if( SettingsIni:ReadFile() == true ) then + Content = Content .. HandlePluginListChanges( Request, SettingsIni ) + else + Content = Content .. "Cannot find/modify settings.ini" + end + + local PluginManager = cRoot:Get():GetPluginManager() + PluginManager:FindPlugins() -- Refreshes the plugin list + local PluginList = PluginManager:GetAllPlugins() + + Content = Content .. "".. ActivePluginsName[i] .." | " + Content = Content .. "" .. ActivePluginsName[i] .. " V. " .. ActivePluginVersion[i] .. " | " .. Button_DisablePlugin(ActivePluginsName[i]) .. " | " + Content = Content .. "
".. InactivePlugins[i] .." | " + Content = Content .. "" .. Button_EnablePlugin(InactivePlugins[i]) .. " | " + Content = Content .. "
User | Groups | |
---|---|---|
" .. i .. ". | " - Content = Content .. "" .. UserName .. " | " - Content = Content .. "" - Content = Content .. UsersIni:GetValue( UserName, "Groups", "-" ) - Content = Content .. " | " - Content = Content .. "
None |
Name | Permissions | Color | |
---|---|---|---|
" .. i .. ". | " - Content = Content .. "" .. GroupName .. " | " - Content = Content .. "" - Content = Content .. GroupsIni:GetValue( GroupName, "Permissions", "-" ) - Content = Content .. " | " - Content = Content .. "" - Content = Content .. GroupsIni:GetValue( GroupName, "Color", "-" ) - Content = Content .. " | " - Content = Content .. "
None |
" .. InfoMsg .. "
" - end - - Content = Content .. [[ - ]] - return Content -end - -local function SelectWorldButton( WorldName ) - return "" -end - -local function HTML_Select_Dimension( name, defaultValue ) - return [[]] -end - -local function HTML_Select_Scheme( 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 - -local function HTML_Select_Biome( 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_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"] ) - 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_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"] ) - 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 - 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 .. "" .. WorldNum .. ". | " - Content = Content .. "" .. World:GetName() .. " | " - Content = Content .. "" .. SelectWorldButton(World:GetName()) .. " | " - Content = Content .. "
Storage | -|
---|---|
Schema: | -]] .. HTML_Select_Scheme("World_Schema", WorldIni:GetValueI("Storage", "Schema") ) .. [[ |
Spawn Position | -|
---|---|
X: | -|
Y: | -|
Z: | -
Seed | -|
---|---|
Seed: | -
PVP | -|
---|---|
PVP: | -]] .. HTML_Select_On_Off("World_PVP", WorldIni:GetValueI("PVP", "Enabled") ) .. [[ |
GameMode | -|
---|---|
GameMode: | -]] .. HTML_Select_GameMode("World_GameMode", WorldIni:GetValueI("GameMode", "GameMode") ) .. [[ |
Physics | -|
---|---|
DeepSnow: | -]] .. HTML_Select_On_Off("World_DeepSnow", WorldIni:GetValueI("Physics", "DeepSnow") ) .. [[ |
SandInstantFall: | -]] .. HTML_Select_On_Off("World_SandInstantFall", WorldIni:GetValueI("Physics", "SandInstantFall") ) .. [[ |
WaterSimulator: | -]] .. HTML_Select_Simulator("World_WaterSimulator", WorldIni:GetValue("Physics", "WaterSimulator") ) .. [[ |
LavaSimulator: | -]] .. HTML_Select_Simulator("World_LavaSimulator", WorldIni:GetValue("Physics", "LavaSimulator") ) .. [[ |
Plants | -|
---|---|
MaxCactusHeight: | -|
MaxSugarcaneHeigh: | -|
CarrotsBonemealable: | -]] .. HTML_Select_On_Off("World_CarrotsBonemealable", WorldIni:GetValueI("Plants", "IsCarrotsBonemealable") ) .. [[ |
CropsBonemealable: | -]] .. HTML_Select_On_Off("World_CropsBonemealable", WorldIni:GetValueI("Plants", "IsCropsBonemealable") ) .. [[ |
GrassBonemealabl: | -]] .. HTML_Select_On_Off("World_GrassBonemealable", WorldIni:GetValueI("Plants", "IsGrassBonemealable") ) .. [[ |
SaplingBonemealable: | -]] .. HTML_Select_On_Off("World_SaplingBonemealable", WorldIni:GetValueI("Plants", "IsSaplingBonemealable") ) .. [[ |
MelonStemBonemealable: | -]] .. HTML_Select_On_Off("World_MelonStemBonemealable", WorldIni:GetValueI("Plants", "IsMelonStemBonemealable") ) .. [[ |
MelonBonemealable: | -]] .. HTML_Select_On_Off("World_MelonBonemealable", WorldIni:GetValueI("Plants", "IsMelonBonemealable") ) .. [[ |
PotatoesBonemealable: | -]] .. HTML_Select_On_Off("World_PotatoesBonemealable", WorldIni:GetValueI("Plants", "IsPotatoesBonemealable") ) .. [[ |
PumpkinStemBonemealable: | -]] .. HTML_Select_On_Off("World_PumpkinStemBonemealable", WorldIni:GetValueI("Plants", "IsPumpkinStemBonemealable") ) .. [[ |
PumpkinBonemealable: | -]] .. HTML_Select_On_Off("World_PumpkinBonemealable", WorldIni:GetValueI("Plants", "IsPumpkinBonemealable") ) .. [[ |
SugarcaneBonemealabl: | -]] .. HTML_Select_On_Off("World_SugarcaneBonemealable", WorldIni:GetValueI("Plants", "IsSugarcaneBonemealable") ) .. [[ |
CactusBonemealable: | -]] .. HTML_Select_On_Off("World_CactusBonemealable", WorldIni:GetValueI("Plants", "IsCactusBonemealable") ) .. [[ |
Generator | -|
---|---|
BiomeGen: | -]] .. HTML_Select_BiomeGen("World_BiomeGen", WorldIni:GetValue("Generator", "BiomeGen") ) .. [[ |
HeightGen: | -]] .. HTML_Select_HeightGen("World_HeightGen", WorldIni:GetValue("Generator", "HeightGen") ) .. [[ |
CompositionGen: | -]] .. HTML_Select_CompositionGen("World_CompositionGen", WorldIni:GetValue("Generator", "CompositionGen") ) .. [[ |
Structures: | -|
Finishers: | -|
Generator: | -]] .. HTML_Select_Generator("World_Generator", WorldIni:GetValue("Generator", "Generator") ) .. [[ |
Finetuning |
---|
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: | -
Server Settings
-General | -Monsters | -Worlds | -World | -
" .. InfoMsg .. "
" + end + + Content = Content .. [[ + ]] + return Content +end + +local function SelectWorldButton( WorldName ) + return "" +end + +local function HTML_Select_Dimension( name, defaultValue ) + return [[]] +end + +local function HTML_Select_Scheme( 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 + +local function HTML_Select_Biome( 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_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"] ) + 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_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"] ) + 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 + 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 .. "" .. WorldNum .. ". | " + Content = Content .. "" .. World:GetName() .. " | " + Content = Content .. "" .. SelectWorldButton(World:GetName()) .. " | " + Content = Content .. "
Storage | +|
---|---|
Schema: | +]] .. HTML_Select_Scheme("World_Schema", WorldIni:GetValueI("Storage", "Schema") ) .. [[ |
Spawn Position | +|
---|---|
X: | +|
Y: | +|
Z: | +
Seed | +|
---|---|
Seed: | +
PVP | +|
---|---|
PVP: | +]] .. HTML_Select_On_Off("World_PVP", WorldIni:GetValueI("PVP", "Enabled") ) .. [[ |
GameMode | +|
---|---|
GameMode: | +]] .. HTML_Select_GameMode("World_GameMode", WorldIni:GetValueI("GameMode", "GameMode") ) .. [[ |
Physics | +|
---|---|
DeepSnow: | +]] .. HTML_Select_On_Off("World_DeepSnow", WorldIni:GetValueI("Physics", "DeepSnow") ) .. [[ |
SandInstantFall: | +]] .. HTML_Select_On_Off("World_SandInstantFall", WorldIni:GetValueI("Physics", "SandInstantFall") ) .. [[ |
WaterSimulator: | +]] .. HTML_Select_Simulator("World_WaterSimulator", WorldIni:GetValue("Physics", "WaterSimulator") ) .. [[ |
LavaSimulator: | +]] .. HTML_Select_Simulator("World_LavaSimulator", WorldIni:GetValue("Physics", "LavaSimulator") ) .. [[ |
Plants | +|
---|---|
MaxCactusHeight: | +|
MaxSugarcaneHeigh: | +|
CarrotsBonemealable: | +]] .. HTML_Select_On_Off("World_CarrotsBonemealable", WorldIni:GetValueI("Plants", "IsCarrotsBonemealable") ) .. [[ |
CropsBonemealable: | +]] .. HTML_Select_On_Off("World_CropsBonemealable", WorldIni:GetValueI("Plants", "IsCropsBonemealable") ) .. [[ |
GrassBonemealabl: | +]] .. HTML_Select_On_Off("World_GrassBonemealable", WorldIni:GetValueI("Plants", "IsGrassBonemealable") ) .. [[ |
SaplingBonemealable: | +]] .. HTML_Select_On_Off("World_SaplingBonemealable", WorldIni:GetValueI("Plants", "IsSaplingBonemealable") ) .. [[ |
MelonStemBonemealable: | +]] .. HTML_Select_On_Off("World_MelonStemBonemealable", WorldIni:GetValueI("Plants", "IsMelonStemBonemealable") ) .. [[ |
MelonBonemealable: | +]] .. HTML_Select_On_Off("World_MelonBonemealable", WorldIni:GetValueI("Plants", "IsMelonBonemealable") ) .. [[ |
PotatoesBonemealable: | +]] .. HTML_Select_On_Off("World_PotatoesBonemealable", WorldIni:GetValueI("Plants", "IsPotatoesBonemealable") ) .. [[ |
PumpkinStemBonemealable: | +]] .. HTML_Select_On_Off("World_PumpkinStemBonemealable", WorldIni:GetValueI("Plants", "IsPumpkinStemBonemealable") ) .. [[ |
PumpkinBonemealable: | +]] .. HTML_Select_On_Off("World_PumpkinBonemealable", WorldIni:GetValueI("Plants", "IsPumpkinBonemealable") ) .. [[ |
SugarcaneBonemealabl: | +]] .. HTML_Select_On_Off("World_SugarcaneBonemealable", WorldIni:GetValueI("Plants", "IsSugarcaneBonemealable") ) .. [[ |
CactusBonemealable: | +]] .. HTML_Select_On_Off("World_CactusBonemealable", WorldIni:GetValueI("Plants", "IsCactusBonemealable") ) .. [[ |
Generator | +|
---|---|
BiomeGen: | +]] .. HTML_Select_BiomeGen("World_BiomeGen", WorldIni:GetValue("Generator", "BiomeGen") ) .. [[ |
HeightGen: | +]] .. HTML_Select_HeightGen("World_HeightGen", WorldIni:GetValue("Generator", "HeightGen") ) .. [[ |
CompositionGen: | +]] .. HTML_Select_CompositionGen("World_CompositionGen", WorldIni:GetValue("Generator", "CompositionGen") ) .. [[ |
Structures: | +|
Finishers: | +|
Generator: | +]] .. HTML_Select_Generator("World_Generator", WorldIni:GetValue("Generator", "Generator") ) .. [[ |
Finetuning |
---|
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: | +
Server Settings
+General | +Monsters | +Worlds | +World | +
Whitelist is currently disabled! Click here to enable.
" - end - - - Content = Content .. "" .. PlayerName .. " | " .. HTMLDeleteButton( PlayerName ) .. " |
None |
Whitelist is currently enabled, click here to disable.
" - end - - return Content +local function HTMLDeleteButton( name ) + return "" +end + +function HandleRequest_WhiteList( Request ) + local UpdateMessage = "" + if( Request.PostParams["whitelist-add"] ~= nil ) then + local PlayerName = Request.PostParams["whitelist-add"] + + if( WhiteListIni:GetValueB("WhiteList", PlayerName, false) == true ) then + UpdateMessage = "".. PlayerName.." is already on the whitelist" + else + WhiteListIni:SetValueB("WhiteList", PlayerName, true ) + UpdateMessage = "Added " .. PlayerName .. " to whitelist." + WhiteListIni:WriteFile() + end + elseif( Request.PostParams["whitelist-delete"] ~= nil ) then + local PlayerName = Request.PostParams["whitelist-delete"] + WhiteListIni:DeleteValue( "WhiteList", PlayerName ) + UpdateMessage = "Removed " .. PlayerName .. " from whitelist." + WhiteListIni:WriteFile() + elseif( Request.PostParams["whitelist-reload"] ~= nil ) then + WhiteListIni:Erase() -- Empty entire loaded ini first, otherwise weird shit goes down + WhiteListIni:ReadFile() + UpdateMessage = "Loaded from disk" + elseif( Request.Params["whitelist-setenable"] ~= nil ) then + local Enabled = Request.Params["whitelist-setenable"] + local CreateNewValue = false + if( WhiteListIni:FindValue( WhiteListIni:FindKey("WhiteListSettings"), "WhiteListOn" ) == cIniFile.noID ) then -- Find out whether the value is in the ini + CreateNewValue = true + end + + if( Enabled == "1" ) then + WhiteListIni:SetValueB("WhiteListSettings", "WhiteListOn", true, CreateNewValue ) + else + WhiteListIni:SetValueB("WhiteListSettings", "WhiteListOn", false, CreateNewValue ) + end + WhiteListIni:WriteFile() + end + + + local Content = "" + + local WhiteListEnabled = WhiteListIni:GetValueB("WhiteListSettings", "WhiteListOn", false) + if( WhiteListEnabled == false ) then + Content = Content .. "Whitelist is currently disabled! Click here to enable.
" + end + + + Content = Content .. "" .. PlayerName .. " | " .. HTMLDeleteButton( PlayerName ) .. " |
None |
Whitelist is currently enabled, click here to disable.
" + end + + return Content end \ No newline at end of file diff --git a/MCServer/Plugins/Core/onplayermoving.lua b/MCServer/Plugins/Core/worldlimiter.lua similarity index 97% rename from MCServer/Plugins/Core/onplayermoving.lua rename to MCServer/Plugins/Core/worldlimiter.lua index c95eb0c5a..8bd9b5509 100644 --- a/MCServer/Plugins/Core/onplayermoving.lua +++ b/MCServer/Plugins/Core/worldlimiter.lua @@ -1,21 +1,21 @@ -function OnPlayerMoving( Player ) - if LimitWorld == true then - local World = Player:GetWorld() - local SpawnX = math.floor(World:GetSpawnX() / 16) - local SpawnZ = math.floor(World:GetSpawnZ() / 16) - local X = math.floor(Player:GetPosX() / 16) - local Z = math.floor(Player:GetPosZ() / 16) - if ( (SpawnX + LimitWorldWidth - 1) < X ) then - Player:TeleportToCoords(Player:GetPosX() - 1, Player:GetPosY(), Player:GetPosZ()) - end - if ( (SpawnX - LimitWorldWidth + 1) > X ) then - Player:TeleportToCoords(Player:GetPosX() + 1, Player:GetPosY(), Player:GetPosZ()) - end - if ( (SpawnZ + LimitWorldWidth - 1) < Z ) then - Player:TeleportToCoords(Player:GetPosX(), Player:GetPosY(), Player:GetPosZ() - 1) - end - if ( (SpawnZ - LimitWorldWidth + 1) > Z ) then - Player:TeleportToCoords(Player:GetPosX(), Player:GetPosY(), Player:GetPosZ() + 1) - end - end +function OnPlayerMoving( Player ) + if LimitWorld == true then + local World = Player:GetWorld() + local SpawnX = math.floor(World:GetSpawnX() / 16) + local SpawnZ = math.floor(World:GetSpawnZ() / 16) + local X = math.floor(Player:GetPosX() / 16) + local Z = math.floor(Player:GetPosZ() / 16) + if ( (SpawnX + LimitWorldWidth - 1) < X ) then + Player:TeleportToCoords(Player:GetPosX() - 1, Player:GetPosY(), Player:GetPosZ()) + end + if ( (SpawnX - LimitWorldWidth + 1) > X ) then + Player:TeleportToCoords(Player:GetPosX() + 1, Player:GetPosY(), Player:GetPosZ()) + end + if ( (SpawnZ + LimitWorldWidth - 1) < Z ) then + Player:TeleportToCoords(Player:GetPosX(), Player:GetPosY(), Player:GetPosZ() - 1) + end + if ( (SpawnZ - LimitWorldWidth + 1) > Z ) then + Player:TeleportToCoords(Player:GetPosX(), Player:GetPosY(), Player:GetPosZ() + 1) + end + end end \ No newline at end of file