29 using System.Collections.Generic;
31 using System.Reflection;
32 using System.Security;
37 using OpenSim.Framework;
38 using OpenSim.Framework.Console;
39 using OpenSim.Region.CoreModules.Framework.InterfaceCommander;
40 using OpenSim.Region.Framework.Interfaces;
41 using OpenSim.Region.Framework.Scenes;
42 using OpenSim.Services.Interfaces;
51 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
64 m_module.Scene.AddCommand(
"Regions", m_module,
"set terrain texture",
65 "set terrain texture <number> <uuid> [<x>] [<y>]",
66 "Sets the terrain <number> to <uuid>, if <x> or <y> are specified, it will only " +
67 "set it on regions with a matching coordinate. Specify -1 in <x> or <y> to wildcard" +
69 consoleSetTerrainTexture);
71 m_module.Scene.AddCommand(
"Regions", m_module,
"set terrain heights",
72 "set terrain heights <corner> <min> <max> [<x>] [<y>]",
73 "Sets the terrain texture heights on corner #<corner> to <min>/<max>, if <x> or <y> are specified, it will only " +
74 "set it on regions with a matching coordinate. Specify -1 in <x> or <y> to wildcard" +
75 " that coordinate. Corner # SW = 0, NW = 1, SE = 2, NE = 3, all corners = -1.",
76 consoleSetTerrainHeights);
78 m_module.Scene.AddCommand(
"Regions", m_module,
"set water height",
79 "set water height <height> [<x>] [<y>]",
80 "Sets the water height in meters. If <x> and <y> are specified, it will only set it on regions with a matching coordinate. " +
81 "Specify -1 in <x> or <y> to wildcard that coordinate.",
82 consoleSetWaterHeight);
84 m_module.Scene.AddCommand(
85 "Estates", m_module,
"estate show",
"estate show",
"Shows all estates on the simulator.", ShowEstatesCommand);
90 #region CommandHandlers
94 string uuid = args[4];
95 int x = (args.Length > 5 ? int.Parse(args[5]) : -1);
96 int y = (args.Length > 6 ? int.Parse(args[6]) : -1);
98 if (x == -1 || m_module.Scene.RegionInfo.RegionLocX == x)
100 if (y == -1 || m_module.Scene.RegionInfo.RegionLocY == y)
102 int corner = int.Parse(num);
103 UUID texture = UUID.Parse(uuid);
105 m_log.Debug(
"[ESTATEMODULE]: Setting terrain textures for " + m_module.Scene.RegionInfo.RegionName +
106 string.Format(
" (C#{0} = {1})", corner, texture));
111 m_module.Scene.RegionInfo.RegionSettings.TerrainTexture1 = texture;
114 m_module.Scene.RegionInfo.RegionSettings.TerrainTexture2 = texture;
117 m_module.Scene.RegionInfo.RegionSettings.TerrainTexture3 = texture;
120 m_module.Scene.RegionInfo.RegionSettings.TerrainTexture4 = texture;
124 m_module.Scene.RegionInfo.RegionSettings.Save();
125 m_module.TriggerRegionInfoChange();
126 m_module.sendRegionHandshakeToAll();
132 string heightstring = args[3];
134 int x = (args.Length > 4 ? int.Parse(args[4]) : -1);
135 int y = (args.Length > 5 ? int.Parse(args[5]) : -1);
137 if (x == -1 || m_module.Scene.RegionInfo.RegionLocX == x)
139 if (y == -1 || m_module.Scene.RegionInfo.RegionLocY == y)
141 double selectedheight = double.Parse(heightstring);
143 m_log.Debug(
"[ESTATEMODULE]: Setting water height in " + m_module.Scene.RegionInfo.RegionName +
" to " +
144 string.Format(
" {0}", selectedheight));
145 m_module.Scene.RegionInfo.RegionSettings.WaterHeight = selectedheight;
147 m_module.Scene.RegionInfo.RegionSettings.Save();
148 m_module.TriggerRegionInfoChange();
149 m_module.sendRegionHandshakeToAll();
155 string num = args[3];
156 string min = args[4];
157 string max = args[5];
158 int x = (args.Length > 6 ? int.Parse(args[6]) : -1);
159 int y = (args.Length > 7 ? int.Parse(args[7]) : -1);
161 if (x == -1 || m_module.Scene.RegionInfo.RegionLocX == x)
163 if (y == -1 || m_module.Scene.RegionInfo.RegionLocY == y)
165 int corner = int.Parse(num);
166 float lowValue = float.Parse(min, Culture.NumberFormatInfo);
167 float highValue = float.Parse(max, Culture.NumberFormatInfo);
169 m_log.Debug(
"[ESTATEMODULE]: Setting terrain heights " + m_module.Scene.RegionInfo.RegionName +
170 string.Format(
" (C{0}, {1}-{2}", corner, lowValue, highValue));
175 m_module.Scene.RegionInfo.RegionSettings.Elevation1SW = lowValue;
176 m_module.Scene.RegionInfo.RegionSettings.Elevation2SW = highValue;
177 m_module.Scene.RegionInfo.RegionSettings.Elevation1NW = lowValue;
178 m_module.Scene.RegionInfo.RegionSettings.Elevation2NW = highValue;
179 m_module.Scene.RegionInfo.RegionSettings.Elevation1SE = lowValue;
180 m_module.Scene.RegionInfo.RegionSettings.Elevation2SE = highValue;
181 m_module.Scene.RegionInfo.RegionSettings.Elevation1NE = lowValue;
182 m_module.Scene.RegionInfo.RegionSettings.Elevation2NE = highValue;
185 m_module.Scene.RegionInfo.RegionSettings.Elevation1SW = lowValue;
186 m_module.Scene.RegionInfo.RegionSettings.Elevation2SW = highValue;
189 m_module.Scene.RegionInfo.RegionSettings.Elevation1NW = lowValue;
190 m_module.Scene.RegionInfo.RegionSettings.Elevation2NW = highValue;
193 m_module.Scene.RegionInfo.RegionSettings.Elevation1SE = lowValue;
194 m_module.Scene.RegionInfo.RegionSettings.Elevation2SE = highValue;
197 m_module.Scene.RegionInfo.RegionSettings.Elevation1NE = lowValue;
198 m_module.Scene.RegionInfo.RegionSettings.Elevation2NE = highValue;
202 m_module.Scene.RegionInfo.RegionSettings.Save();
203 m_module.TriggerRegionInfoChange();
204 m_module.sendRegionHandshakeToAll();
211 StringBuilder report =
new StringBuilder();
215 report.AppendFormat(
"Estate information for region {0}\n", ri.RegionName);
217 "{0,-20} {1,-7} {2,-20}\n",
223 "{0,-20} {1,-7} {2,-20}\n",
224 es.EstateName, es.EstateID, m_module.UserManager.GetUserName(es.EstateOwner));
226 MainConsole.Instance.Output(report.ToString());
void consoleSetTerrainHeights(string module, string[] args)
OpenSim.Framework.RegionInfo RegionInfo
void consoleSetTerrainTexture(string module, string[] args)
void ShowEstatesCommand(string module, string[] cmd)
EstateManagementCommands(EstateManagementModule module)
EstateManagementModule m_module
Interactive OpenSim region server
void consoleSetWaterHeight(string module, string[] args)
Estate management console commands.