* Added set water height <height> [<x>] [<y>] console command following the set terrain heights console command as an example.

0.7.6-extended
teravus 2013-08-07 23:33:23 -05:00
parent 99a4a91488
commit 4e86674a3a
1 changed files with 30 additions and 1 deletions

View File

@ -76,6 +76,13 @@ namespace OpenSim.Region.CoreModules.World.Estate
" that coordinate. Corner # SW = 0, NW = 1, SE = 2, NE = 3, all corners = -1.", " that coordinate. Corner # SW = 0, NW = 1, SE = 2, NE = 3, all corners = -1.",
consoleSetTerrainHeights); consoleSetTerrainHeights);
m_module.Scene.AddCommand("Regions", m_module, "set water height",
"set water height <height> [<x>] [<y>]",
"Sets the water height in meters. If <x> and <y> are specified, it will only set it on regions with a matching coordinate. " +
"Specify -1 in <x> or <y> to wildcard that coordinate.",
consoleSetWaterHeight);
m_module.Scene.AddCommand( m_module.Scene.AddCommand(
"Estates", m_module, "estate show", "estate show", "Shows all estates on the simulator.", ShowEstatesCommand); "Estates", m_module, "estate show", "estate show", "Shows all estates on the simulator.", ShowEstatesCommand);
} }
@ -121,7 +128,29 @@ namespace OpenSim.Region.CoreModules.World.Estate
} }
} }
} }
protected void consoleSetWaterHeight(string module, string[] args)
{
string heightstring = args[3];
int x = (args.Length > 4 ? int.Parse(args[4]) : -1);
int y = (args.Length > 5 ? int.Parse(args[5]) : -1);
if (x == -1 || m_module.Scene.RegionInfo.RegionLocX == x)
{
if (y == -1 || m_module.Scene.RegionInfo.RegionLocY == y)
{
double selectedheight = double.Parse(heightstring);
m_log.Debug("[ESTATEMODULE]: Setting water height in " + m_module.Scene.RegionInfo.RegionName + " to " +
string.Format(" {0}", selectedheight));
m_module.Scene.RegionInfo.RegionSettings.WaterHeight = selectedheight;
m_module.Scene.RegionInfo.RegionSettings.Save();
m_module.TriggerRegionInfoChange();
m_module.sendRegionHandshakeToAll();
}
}
}
protected void consoleSetTerrainHeights(string module, string[] args) protected void consoleSetTerrainHeights(string module, string[] args)
{ {
string num = args[3]; string num = args[3];