From 7dd98f30943f66e7f0c4c63db1190fad2f437185 Mon Sep 17 00:00:00 2001 From: Adam Frisby Date: Tue, 24 Apr 2007 18:01:37 +0000 Subject: Moved console input-handling function "RunTerrainCmd" into BasicTerrain itself, this allows independent versions of BasicTerrain to have different functionality exposed directly. --- OpenSim.RegionServer/OpenSimMain.cs | 85 +++---------------------------------- 1 file changed, 5 insertions(+), 80 deletions(-) (limited to 'OpenSim.RegionServer') diff --git a/OpenSim.RegionServer/OpenSimMain.cs b/OpenSim.RegionServer/OpenSimMain.cs index 1c3454d..151ac51 100644 --- a/OpenSim.RegionServer/OpenSimMain.cs +++ b/OpenSim.RegionServer/OpenSimMain.cs @@ -522,7 +522,11 @@ namespace OpenSim break; case "terrain": - RunTerrainCmd(cmdparams); + string result = ""; + if (!LocalWorld.Terrain.RunTerrainCmd(cmdparams,ref result)) + { + m_console.WriteLine(result); + } break; case "shutdown": @@ -536,85 +540,6 @@ namespace OpenSim } /// - /// Processes a terrain-specific command - /// - /// TODO: Move this into BasicTerrain directly (no need to hard limit what each terrain engine can support) - /// - public void RunTerrainCmd(string[] args) - { - string command = args[0]; - switch (command) - { - case "help": - m_console.WriteLine("terrain regenerate - rebuilds the sims terrain using a default algorithm"); - m_console.WriteLine("terrain seed - sets the random seed value to "); - m_console.WriteLine("terrain load - loads a terrain from disk, type can be 'F32', 'F64' or 'IMG'"); - m_console.WriteLine("terrain save - saves a terrain to disk, type can be 'F32' or 'F64'"); - m_console.WriteLine("terrain rescale - rescales a terrain to be between and meters high"); - m_console.WriteLine("terrain multiply - multiplies a terrain by "); - break; - - case "seed": - LocalWorld.Terrain.setSeed(Convert.ToInt32(args[1])); - break; - - case "regenerate": - LocalWorld.Terrain.hills(); - break; - - case "rescale": - LocalWorld.Terrain.setRange(Convert.ToSingle(args[1]), Convert.ToSingle(args[2])); - break; - - case "multiply": - LocalWorld.Terrain *= Convert.ToDouble(args[1]); - break; - - case "load": - switch (args[1].ToLower()) - { - case "f32": - LocalWorld.Terrain.loadFromFileF32(args[2]); - break; - - case "f64": - LocalWorld.Terrain.loadFromFileF64(args[2]); - break; - - case "img": - m_console.WriteLine("Error - IMG mode is presently unsupported."); - break; - - default: - m_console.WriteLine("Unknown image or data format"); - break; - } - break; - - case "save": - switch (args[1].ToLower()) - { - case "f32": - LocalWorld.Terrain.writeToFileF32(args[2]); - break; - - case "f64": - LocalWorld.Terrain.writeToFileF64(args[2]); - break; - - default: - m_console.WriteLine("Unknown image or data format"); - break; - } - break; - - default: - m_console.WriteLine("Unknown terrain command"); - break; - } - } - - /// /// Outputs to the console information about the region /// /// What information to display (valid arguments are "uptime", "users") -- cgit v1.1