diff options
author | Justin Clark-Casey (justincc) | 2011-02-11 23:32:38 +0000 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2011-02-11 23:32:38 +0000 |
commit | 26727ee044f0be22abf070c7d320bce2da2c0d9a (patch) | |
tree | be16ad01ed868b3b48d4c5c0c16c5fde060d8ecc /OpenSim/Region/CoreModules/World | |
parent | In SQLiteSimulationData.RemoveLandObject(), don't manually remove the row fro... (diff) | |
download | opensim-SC-26727ee044f0be22abf070c7d320bce2da2c0d9a.zip opensim-SC-26727ee044f0be22abf070c7d320bce2da2c0d9a.tar.gz opensim-SC-26727ee044f0be22abf070c7d320bce2da2c0d9a.tar.bz2 opensim-SC-26727ee044f0be22abf070c7d320bce2da2c0d9a.tar.xz |
refactor: split out estate management commands into separate class
Diffstat (limited to 'OpenSim/Region/CoreModules/World')
-rw-r--r-- | OpenSim/Region/CoreModules/World/Estate/EstateManagementCommands.cs | 156 | ||||
-rw-r--r-- | OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs | 584 |
2 files changed, 400 insertions, 340 deletions
diff --git a/OpenSim/Region/CoreModules/World/Estate/EstateManagementCommands.cs b/OpenSim/Region/CoreModules/World/Estate/EstateManagementCommands.cs new file mode 100644 index 0000000..14f5b1e --- /dev/null +++ b/OpenSim/Region/CoreModules/World/Estate/EstateManagementCommands.cs | |||
@@ -0,0 +1,156 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSimulator Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | */ | ||
27 | |||
28 | using System; | ||
29 | using System.Collections.Generic; | ||
30 | using System.IO; | ||
31 | using System.Reflection; | ||
32 | using System.Security; | ||
33 | using log4net; | ||
34 | using Nini.Config; | ||
35 | using OpenMetaverse; | ||
36 | using OpenSim.Framework; | ||
37 | using OpenSim.Region.Framework.Interfaces; | ||
38 | using OpenSim.Region.Framework.Scenes; | ||
39 | |||
40 | namespace OpenSim.Region.CoreModules.World.Estate | ||
41 | { | ||
42 | public class EstateManagementCommands | ||
43 | { | ||
44 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | ||
45 | |||
46 | protected EstateManagementModule m_module; | ||
47 | |||
48 | public EstateManagementCommands(EstateManagementModule module) | ||
49 | { | ||
50 | m_module = module; | ||
51 | } | ||
52 | |||
53 | public void Initialise() | ||
54 | { | ||
55 | m_module.Scene.AddCommand(this, "set terrain texture", | ||
56 | "set terrain texture <number> <uuid> [<x>] [<y>]", | ||
57 | "Sets the terrain <number> to <uuid>, if <x> or <y> are specified, it will only " + | ||
58 | "set it on regions with a matching coordinate. Specify -1 in <x> or <y> to wildcard" + | ||
59 | " that coordinate.", | ||
60 | consoleSetTerrainTexture); | ||
61 | |||
62 | m_module.Scene.AddCommand(this, "set terrain heights", | ||
63 | "set terrain heights <corner> <min> <max> [<x>] [<y>]", | ||
64 | "Sets the terrain texture heights on corner #<corner> to <min>/<max>, if <x> or <y> are specified, it will only " + | ||
65 | "set it on regions with a matching coordinate. Specify -1 in <x> or <y> to wildcard" + | ||
66 | " that coordinate. Corner # SW = 0, NW = 1, SE = 2, NE = 3.", | ||
67 | consoleSetTerrainHeights); | ||
68 | } | ||
69 | |||
70 | protected void consoleSetTerrainTexture(string module, string[] args) | ||
71 | { | ||
72 | string num = args[3]; | ||
73 | string uuid = args[4]; | ||
74 | int x = (args.Length > 5 ? int.Parse(args[5]) : -1); | ||
75 | int y = (args.Length > 6 ? int.Parse(args[6]) : -1); | ||
76 | |||
77 | if (x == -1 || m_module.Scene.RegionInfo.RegionLocX == x) | ||
78 | { | ||
79 | if (y == -1 || m_module.Scene.RegionInfo.RegionLocY == y) | ||
80 | { | ||
81 | int corner = int.Parse(num); | ||
82 | UUID texture = UUID.Parse(uuid); | ||
83 | |||
84 | m_log.Debug("[ESTATEMODULE]: Setting terrain textures for " + m_module.Scene.RegionInfo.RegionName + | ||
85 | string.Format(" (C#{0} = {1})", corner, texture)); | ||
86 | |||
87 | switch (corner) | ||
88 | { | ||
89 | case 0: | ||
90 | m_module.Scene.RegionInfo.RegionSettings.TerrainTexture1 = texture; | ||
91 | break; | ||
92 | case 1: | ||
93 | m_module.Scene.RegionInfo.RegionSettings.TerrainTexture2 = texture; | ||
94 | break; | ||
95 | case 2: | ||
96 | m_module.Scene.RegionInfo.RegionSettings.TerrainTexture3 = texture; | ||
97 | break; | ||
98 | case 3: | ||
99 | m_module.Scene.RegionInfo.RegionSettings.TerrainTexture4 = texture; | ||
100 | break; | ||
101 | } | ||
102 | |||
103 | m_module.Scene.RegionInfo.RegionSettings.Save(); | ||
104 | m_module.TriggerRegionInfoChange(); | ||
105 | m_module.sendRegionInfoPacketToAll(); | ||
106 | } | ||
107 | } | ||
108 | } | ||
109 | |||
110 | protected void consoleSetTerrainHeights(string module, string[] args) | ||
111 | { | ||
112 | string num = args[3]; | ||
113 | string min = args[4]; | ||
114 | string max = args[5]; | ||
115 | int x = (args.Length > 6 ? int.Parse(args[6]) : -1); | ||
116 | int y = (args.Length > 7 ? int.Parse(args[7]) : -1); | ||
117 | |||
118 | if (x == -1 || m_module.Scene.RegionInfo.RegionLocX == x) | ||
119 | { | ||
120 | if (y == -1 || m_module.Scene.RegionInfo.RegionLocY == y) | ||
121 | { | ||
122 | int corner = int.Parse(num); | ||
123 | float lowValue = float.Parse(min, Culture.NumberFormatInfo); | ||
124 | float highValue = float.Parse(max, Culture.NumberFormatInfo); | ||
125 | |||
126 | m_log.Debug("[ESTATEMODULE]: Setting terrain heights " + m_module.Scene.RegionInfo.RegionName + | ||
127 | string.Format(" (C{0}, {1}-{2}", corner, lowValue, highValue)); | ||
128 | |||
129 | switch (corner) | ||
130 | { | ||
131 | case 0: | ||
132 | m_module.Scene.RegionInfo.RegionSettings.Elevation1SW = lowValue; | ||
133 | m_module.Scene.RegionInfo.RegionSettings.Elevation2SW = highValue; | ||
134 | break; | ||
135 | case 1: | ||
136 | m_module.Scene.RegionInfo.RegionSettings.Elevation1NW = lowValue; | ||
137 | m_module.Scene.RegionInfo.RegionSettings.Elevation2NW = highValue; | ||
138 | break; | ||
139 | case 2: | ||
140 | m_module.Scene.RegionInfo.RegionSettings.Elevation1SE = lowValue; | ||
141 | m_module.Scene.RegionInfo.RegionSettings.Elevation2SE = highValue; | ||
142 | break; | ||
143 | case 3: | ||
144 | m_module.Scene.RegionInfo.RegionSettings.Elevation1NE = lowValue; | ||
145 | m_module.Scene.RegionInfo.RegionSettings.Elevation2NE = highValue; | ||
146 | break; | ||
147 | } | ||
148 | |||
149 | m_module.Scene.RegionInfo.RegionSettings.Save(); | ||
150 | m_module.TriggerRegionInfoChange(); | ||
151 | m_module.sendRegionHandshakeToAll(); | ||
152 | } | ||
153 | } | ||
154 | } | ||
155 | } | ||
156 | } \ No newline at end of file | ||
diff --git a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs index 01f04d9..54d3c61 100644 --- a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs | |||
@@ -24,6 +24,7 @@ | |||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | */ | 26 | */ |
27 | |||
27 | using System; | 28 | using System; |
28 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
29 | using System.IO; | 30 | using System.IO; |
@@ -44,7 +45,9 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
44 | 45 | ||
45 | private delegate void LookupUUIDS(List<UUID> uuidLst); | 46 | private delegate void LookupUUIDS(List<UUID> uuidLst); |
46 | 47 | ||
47 | private Scene m_scene; | 48 | public Scene Scene { get; private set; } |
49 | |||
50 | protected EstateManagementCommands m_commands; | ||
48 | 51 | ||
49 | private EstateTerrainXferHandler TerrainUploader; | 52 | private EstateTerrainXferHandler TerrainUploader; |
50 | 53 | ||
@@ -58,89 +61,89 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
58 | { | 61 | { |
59 | uint sun = 0; | 62 | uint sun = 0; |
60 | 63 | ||
61 | if (!m_scene.RegionInfo.EstateSettings.UseGlobalTime) | 64 | if (!Scene.RegionInfo.EstateSettings.UseGlobalTime) |
62 | sun=(uint)(m_scene.RegionInfo.EstateSettings.SunPosition*1024.0) + 0x1800; | 65 | sun = (uint)(Scene.RegionInfo.EstateSettings.SunPosition * 1024.0) + 0x1800; |
63 | UUID estateOwner; | 66 | UUID estateOwner; |
64 | estateOwner = m_scene.RegionInfo.EstateSettings.EstateOwner; | 67 | estateOwner = Scene.RegionInfo.EstateSettings.EstateOwner; |
65 | 68 | ||
66 | if (m_scene.Permissions.IsGod(remote_client.AgentId)) | 69 | if (Scene.Permissions.IsGod(remote_client.AgentId)) |
67 | estateOwner = remote_client.AgentId; | 70 | estateOwner = remote_client.AgentId; |
68 | 71 | ||
69 | remote_client.SendDetailedEstateData(invoice, | 72 | remote_client.SendDetailedEstateData(invoice, |
70 | m_scene.RegionInfo.EstateSettings.EstateName, | 73 | Scene.RegionInfo.EstateSettings.EstateName, |
71 | m_scene.RegionInfo.EstateSettings.EstateID, | 74 | Scene.RegionInfo.EstateSettings.EstateID, |
72 | m_scene.RegionInfo.EstateSettings.ParentEstateID, | 75 | Scene.RegionInfo.EstateSettings.ParentEstateID, |
73 | GetEstateFlags(), | 76 | GetEstateFlags(), |
74 | sun, | 77 | sun, |
75 | m_scene.RegionInfo.RegionSettings.Covenant, | 78 | Scene.RegionInfo.RegionSettings.Covenant, |
76 | m_scene.RegionInfo.EstateSettings.AbuseEmail, | 79 | Scene.RegionInfo.EstateSettings.AbuseEmail, |
77 | estateOwner); | 80 | estateOwner); |
78 | 81 | ||
79 | remote_client.SendEstateList(invoice, | 82 | remote_client.SendEstateList(invoice, |
80 | (int)Constants.EstateAccessCodex.EstateManagers, | 83 | (int)Constants.EstateAccessCodex.EstateManagers, |
81 | m_scene.RegionInfo.EstateSettings.EstateManagers, | 84 | Scene.RegionInfo.EstateSettings.EstateManagers, |
82 | m_scene.RegionInfo.EstateSettings.EstateID); | 85 | Scene.RegionInfo.EstateSettings.EstateID); |
83 | 86 | ||
84 | remote_client.SendEstateList(invoice, | 87 | remote_client.SendEstateList(invoice, |
85 | (int)Constants.EstateAccessCodex.AccessOptions, | 88 | (int)Constants.EstateAccessCodex.AccessOptions, |
86 | m_scene.RegionInfo.EstateSettings.EstateAccess, | 89 | Scene.RegionInfo.EstateSettings.EstateAccess, |
87 | m_scene.RegionInfo.EstateSettings.EstateID); | 90 | Scene.RegionInfo.EstateSettings.EstateID); |
88 | 91 | ||
89 | remote_client.SendEstateList(invoice, | 92 | remote_client.SendEstateList(invoice, |
90 | (int)Constants.EstateAccessCodex.AllowedGroups, | 93 | (int)Constants.EstateAccessCodex.AllowedGroups, |
91 | m_scene.RegionInfo.EstateSettings.EstateGroups, | 94 | Scene.RegionInfo.EstateSettings.EstateGroups, |
92 | m_scene.RegionInfo.EstateSettings.EstateID); | 95 | Scene.RegionInfo.EstateSettings.EstateID); |
93 | 96 | ||
94 | remote_client.SendBannedUserList(invoice, | 97 | remote_client.SendBannedUserList(invoice, |
95 | m_scene.RegionInfo.EstateSettings.EstateBans, | 98 | Scene.RegionInfo.EstateSettings.EstateBans, |
96 | m_scene.RegionInfo.EstateSettings.EstateID); | 99 | Scene.RegionInfo.EstateSettings.EstateID); |
97 | } | 100 | } |
98 | 101 | ||
99 | private void estateSetRegionInfoHandler(bool blockTerraform, bool noFly, bool allowDamage, bool blockLandResell, int maxAgents, float objectBonusFactor, | 102 | private void estateSetRegionInfoHandler(bool blockTerraform, bool noFly, bool allowDamage, bool blockLandResell, int maxAgents, float objectBonusFactor, |
100 | int matureLevel, bool restrictPushObject, bool allowParcelChanges) | 103 | int matureLevel, bool restrictPushObject, bool allowParcelChanges) |
101 | { | 104 | { |
102 | if (blockTerraform) | 105 | if (blockTerraform) |
103 | m_scene.RegionInfo.RegionSettings.BlockTerraform = true; | 106 | Scene.RegionInfo.RegionSettings.BlockTerraform = true; |
104 | else | 107 | else |
105 | m_scene.RegionInfo.RegionSettings.BlockTerraform = false; | 108 | Scene.RegionInfo.RegionSettings.BlockTerraform = false; |
106 | 109 | ||
107 | if (noFly) | 110 | if (noFly) |
108 | m_scene.RegionInfo.RegionSettings.BlockFly = true; | 111 | Scene.RegionInfo.RegionSettings.BlockFly = true; |
109 | else | 112 | else |
110 | m_scene.RegionInfo.RegionSettings.BlockFly = false; | 113 | Scene.RegionInfo.RegionSettings.BlockFly = false; |
111 | 114 | ||
112 | if (allowDamage) | 115 | if (allowDamage) |
113 | m_scene.RegionInfo.RegionSettings.AllowDamage = true; | 116 | Scene.RegionInfo.RegionSettings.AllowDamage = true; |
114 | else | 117 | else |
115 | m_scene.RegionInfo.RegionSettings.AllowDamage = false; | 118 | Scene.RegionInfo.RegionSettings.AllowDamage = false; |
116 | 119 | ||
117 | if (blockLandResell) | 120 | if (blockLandResell) |
118 | m_scene.RegionInfo.RegionSettings.AllowLandResell = false; | 121 | Scene.RegionInfo.RegionSettings.AllowLandResell = false; |
119 | else | 122 | else |
120 | m_scene.RegionInfo.RegionSettings.AllowLandResell = true; | 123 | Scene.RegionInfo.RegionSettings.AllowLandResell = true; |
121 | 124 | ||
122 | m_scene.RegionInfo.RegionSettings.AgentLimit = (byte) maxAgents; | 125 | Scene.RegionInfo.RegionSettings.AgentLimit = (byte) maxAgents; |
123 | 126 | ||
124 | m_scene.RegionInfo.RegionSettings.ObjectBonus = objectBonusFactor; | 127 | Scene.RegionInfo.RegionSettings.ObjectBonus = objectBonusFactor; |
125 | 128 | ||
126 | if (matureLevel <= 13) | 129 | if (matureLevel <= 13) |
127 | m_scene.RegionInfo.RegionSettings.Maturity = 0; | 130 | Scene.RegionInfo.RegionSettings.Maturity = 0; |
128 | else if (matureLevel <= 21) | 131 | else if (matureLevel <= 21) |
129 | m_scene.RegionInfo.RegionSettings.Maturity = 1; | 132 | Scene.RegionInfo.RegionSettings.Maturity = 1; |
130 | else | 133 | else |
131 | m_scene.RegionInfo.RegionSettings.Maturity = 2; | 134 | Scene.RegionInfo.RegionSettings.Maturity = 2; |
132 | 135 | ||
133 | if (restrictPushObject) | 136 | if (restrictPushObject) |
134 | m_scene.RegionInfo.RegionSettings.RestrictPushing = true; | 137 | Scene.RegionInfo.RegionSettings.RestrictPushing = true; |
135 | else | 138 | else |
136 | m_scene.RegionInfo.RegionSettings.RestrictPushing = false; | 139 | Scene.RegionInfo.RegionSettings.RestrictPushing = false; |
137 | 140 | ||
138 | if (allowParcelChanges) | 141 | if (allowParcelChanges) |
139 | m_scene.RegionInfo.RegionSettings.AllowLandJoinDivide = true; | 142 | Scene.RegionInfo.RegionSettings.AllowLandJoinDivide = true; |
140 | else | 143 | else |
141 | m_scene.RegionInfo.RegionSettings.AllowLandJoinDivide = false; | 144 | Scene.RegionInfo.RegionSettings.AllowLandJoinDivide = false; |
142 | 145 | ||
143 | m_scene.RegionInfo.RegionSettings.Save(); | 146 | Scene.RegionInfo.RegionSettings.Save(); |
144 | TriggerRegionInfoChange(); | 147 | TriggerRegionInfoChange(); |
145 | 148 | ||
146 | sendRegionInfoPacketToAll(); | 149 | sendRegionInfoPacketToAll(); |
@@ -154,19 +157,19 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
154 | switch (corner) | 157 | switch (corner) |
155 | { | 158 | { |
156 | case 0: | 159 | case 0: |
157 | m_scene.RegionInfo.RegionSettings.TerrainTexture1 = texture; | 160 | Scene.RegionInfo.RegionSettings.TerrainTexture1 = texture; |
158 | break; | 161 | break; |
159 | case 1: | 162 | case 1: |
160 | m_scene.RegionInfo.RegionSettings.TerrainTexture2 = texture; | 163 | Scene.RegionInfo.RegionSettings.TerrainTexture2 = texture; |
161 | break; | 164 | break; |
162 | case 2: | 165 | case 2: |
163 | m_scene.RegionInfo.RegionSettings.TerrainTexture3 = texture; | 166 | Scene.RegionInfo.RegionSettings.TerrainTexture3 = texture; |
164 | break; | 167 | break; |
165 | case 3: | 168 | case 3: |
166 | m_scene.RegionInfo.RegionSettings.TerrainTexture4 = texture; | 169 | Scene.RegionInfo.RegionSettings.TerrainTexture4 = texture; |
167 | break; | 170 | break; |
168 | } | 171 | } |
169 | m_scene.RegionInfo.RegionSettings.Save(); | 172 | Scene.RegionInfo.RegionSettings.Save(); |
170 | TriggerRegionInfoChange(); | 173 | TriggerRegionInfoChange(); |
171 | sendRegionInfoPacketToAll(); | 174 | sendRegionInfoPacketToAll(); |
172 | } | 175 | } |
@@ -176,23 +179,23 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
176 | switch (corner) | 179 | switch (corner) |
177 | { | 180 | { |
178 | case 0: | 181 | case 0: |
179 | m_scene.RegionInfo.RegionSettings.Elevation1SW = lowValue; | 182 | Scene.RegionInfo.RegionSettings.Elevation1SW = lowValue; |
180 | m_scene.RegionInfo.RegionSettings.Elevation2SW = highValue; | 183 | Scene.RegionInfo.RegionSettings.Elevation2SW = highValue; |
181 | break; | 184 | break; |
182 | case 1: | 185 | case 1: |
183 | m_scene.RegionInfo.RegionSettings.Elevation1NW = lowValue; | 186 | Scene.RegionInfo.RegionSettings.Elevation1NW = lowValue; |
184 | m_scene.RegionInfo.RegionSettings.Elevation2NW = highValue; | 187 | Scene.RegionInfo.RegionSettings.Elevation2NW = highValue; |
185 | break; | 188 | break; |
186 | case 2: | 189 | case 2: |
187 | m_scene.RegionInfo.RegionSettings.Elevation1SE = lowValue; | 190 | Scene.RegionInfo.RegionSettings.Elevation1SE = lowValue; |
188 | m_scene.RegionInfo.RegionSettings.Elevation2SE = highValue; | 191 | Scene.RegionInfo.RegionSettings.Elevation2SE = highValue; |
189 | break; | 192 | break; |
190 | case 3: | 193 | case 3: |
191 | m_scene.RegionInfo.RegionSettings.Elevation1NE = lowValue; | 194 | Scene.RegionInfo.RegionSettings.Elevation1NE = lowValue; |
192 | m_scene.RegionInfo.RegionSettings.Elevation2NE = highValue; | 195 | Scene.RegionInfo.RegionSettings.Elevation2NE = highValue; |
193 | break; | 196 | break; |
194 | } | 197 | } |
195 | m_scene.RegionInfo.RegionSettings.Save(); | 198 | Scene.RegionInfo.RegionSettings.Save(); |
196 | TriggerRegionInfoChange(); | 199 | TriggerRegionInfoChange(); |
197 | sendRegionInfoPacketToAll(); | 200 | sendRegionInfoPacketToAll(); |
198 | } | 201 | } |
@@ -208,30 +211,30 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
208 | bool UseGlobal, bool EstateFixedSun, float EstateSunHour) | 211 | bool UseGlobal, bool EstateFixedSun, float EstateSunHour) |
209 | { | 212 | { |
210 | // Water Height | 213 | // Water Height |
211 | m_scene.RegionInfo.RegionSettings.WaterHeight = WaterHeight; | 214 | Scene.RegionInfo.RegionSettings.WaterHeight = WaterHeight; |
212 | 215 | ||
213 | // Terraforming limits | 216 | // Terraforming limits |
214 | m_scene.RegionInfo.RegionSettings.TerrainRaiseLimit = TerrainRaiseLimit; | 217 | Scene.RegionInfo.RegionSettings.TerrainRaiseLimit = TerrainRaiseLimit; |
215 | m_scene.RegionInfo.RegionSettings.TerrainLowerLimit = TerrainLowerLimit; | 218 | Scene.RegionInfo.RegionSettings.TerrainLowerLimit = TerrainLowerLimit; |
216 | 219 | ||
217 | // Time of day / fixed sun | 220 | // Time of day / fixed sun |
218 | m_scene.RegionInfo.RegionSettings.UseEstateSun = UseEstateSun; | 221 | Scene.RegionInfo.RegionSettings.UseEstateSun = UseEstateSun; |
219 | m_scene.RegionInfo.RegionSettings.FixedSun = UseFixedSun; | 222 | Scene.RegionInfo.RegionSettings.FixedSun = UseFixedSun; |
220 | m_scene.RegionInfo.RegionSettings.SunPosition = SunHour; | 223 | Scene.RegionInfo.RegionSettings.SunPosition = SunHour; |
221 | 224 | ||
222 | m_scene.TriggerEstateSunUpdate(); | 225 | Scene.TriggerEstateSunUpdate(); |
223 | 226 | ||
224 | //m_log.Debug("[ESTATE]: UFS: " + UseFixedSun.ToString()); | 227 | //m_log.Debug("[ESTATE]: UFS: " + UseFixedSun.ToString()); |
225 | //m_log.Debug("[ESTATE]: SunHour: " + SunHour.ToString()); | 228 | //m_log.Debug("[ESTATE]: SunHour: " + SunHour.ToString()); |
226 | 229 | ||
227 | sendRegionInfoPacketToAll(); | 230 | sendRegionInfoPacketToAll(); |
228 | m_scene.RegionInfo.RegionSettings.Save(); | 231 | Scene.RegionInfo.RegionSettings.Save(); |
229 | TriggerRegionInfoChange(); | 232 | TriggerRegionInfoChange(); |
230 | } | 233 | } |
231 | 234 | ||
232 | private void handleEstateRestartSimRequest(IClientAPI remoteClient, int timeInSeconds) | 235 | private void handleEstateRestartSimRequest(IClientAPI remoteClient, int timeInSeconds) |
233 | { | 236 | { |
234 | IRestartModule restartModule = m_scene.RequestModuleInterface<IRestartModule>(); | 237 | IRestartModule restartModule = Scene.RequestModuleInterface<IRestartModule>(); |
235 | if (restartModule != null) | 238 | if (restartModule != null) |
236 | { | 239 | { |
237 | List<int> times = new List<int>(); | 240 | List<int> times = new List<int>(); |
@@ -252,8 +255,8 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
252 | 255 | ||
253 | private void handleChangeEstateCovenantRequest(IClientAPI remoteClient, UUID estateCovenantID) | 256 | private void handleChangeEstateCovenantRequest(IClientAPI remoteClient, UUID estateCovenantID) |
254 | { | 257 | { |
255 | m_scene.RegionInfo.RegionSettings.Covenant = estateCovenantID; | 258 | Scene.RegionInfo.RegionSettings.Covenant = estateCovenantID; |
256 | m_scene.RegionInfo.RegionSettings.Save(); | 259 | Scene.RegionInfo.RegionSettings.Save(); |
257 | TriggerRegionInfoChange(); | 260 | TriggerRegionInfoChange(); |
258 | } | 261 | } |
259 | 262 | ||
@@ -261,17 +264,17 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
261 | { | 264 | { |
262 | // EstateAccessDelta handles Estate Managers, Sim Access, Sim Banlist, allowed Groups.. etc. | 265 | // EstateAccessDelta handles Estate Managers, Sim Access, Sim Banlist, allowed Groups.. etc. |
263 | 266 | ||
264 | if (user == m_scene.RegionInfo.EstateSettings.EstateOwner) | 267 | if (user == Scene.RegionInfo.EstateSettings.EstateOwner) |
265 | return; // never process EO | 268 | return; // never process EO |
266 | 269 | ||
267 | if ((estateAccessType & 4) != 0) // User add | 270 | if ((estateAccessType & 4) != 0) // User add |
268 | { | 271 | { |
269 | if (m_scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, true) || m_scene.Permissions.BypassPermissions()) | 272 | if (Scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, true) || Scene.Permissions.BypassPermissions()) |
270 | { | 273 | { |
271 | m_scene.RegionInfo.EstateSettings.AddEstateUser(user); | 274 | Scene.RegionInfo.EstateSettings.AddEstateUser(user); |
272 | m_scene.RegionInfo.EstateSettings.Save(); | 275 | Scene.RegionInfo.EstateSettings.Save(); |
273 | TriggerEstateInfoChange(); | 276 | TriggerEstateInfoChange(); |
274 | remote_client.SendEstateList(invoice, (int)Constants.EstateAccessCodex.AccessOptions, m_scene.RegionInfo.EstateSettings.EstateAccess, m_scene.RegionInfo.EstateSettings.EstateID); | 277 | remote_client.SendEstateList(invoice, (int)Constants.EstateAccessCodex.AccessOptions, Scene.RegionInfo.EstateSettings.EstateAccess, Scene.RegionInfo.EstateSettings.EstateID); |
275 | } | 278 | } |
276 | else | 279 | else |
277 | { | 280 | { |
@@ -281,13 +284,13 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
281 | } | 284 | } |
282 | if ((estateAccessType & 8) != 0) // User remove | 285 | if ((estateAccessType & 8) != 0) // User remove |
283 | { | 286 | { |
284 | if (m_scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, true) || m_scene.Permissions.BypassPermissions()) | 287 | if (Scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, true) || Scene.Permissions.BypassPermissions()) |
285 | { | 288 | { |
286 | m_scene.RegionInfo.EstateSettings.RemoveEstateUser(user); | 289 | Scene.RegionInfo.EstateSettings.RemoveEstateUser(user); |
287 | m_scene.RegionInfo.EstateSettings.Save(); | 290 | Scene.RegionInfo.EstateSettings.Save(); |
288 | TriggerEstateInfoChange(); | 291 | TriggerEstateInfoChange(); |
289 | 292 | ||
290 | remote_client.SendEstateList(invoice, (int)Constants.EstateAccessCodex.AccessOptions, m_scene.RegionInfo.EstateSettings.EstateAccess, m_scene.RegionInfo.EstateSettings.EstateID); | 293 | remote_client.SendEstateList(invoice, (int)Constants.EstateAccessCodex.AccessOptions, Scene.RegionInfo.EstateSettings.EstateAccess, Scene.RegionInfo.EstateSettings.EstateID); |
291 | } | 294 | } |
292 | else | 295 | else |
293 | { | 296 | { |
@@ -296,12 +299,12 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
296 | } | 299 | } |
297 | if ((estateAccessType & 16) != 0) // Group add | 300 | if ((estateAccessType & 16) != 0) // Group add |
298 | { | 301 | { |
299 | if (m_scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, true) || m_scene.Permissions.BypassPermissions()) | 302 | if (Scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, true) || Scene.Permissions.BypassPermissions()) |
300 | { | 303 | { |
301 | m_scene.RegionInfo.EstateSettings.AddEstateGroup(user); | 304 | Scene.RegionInfo.EstateSettings.AddEstateGroup(user); |
302 | m_scene.RegionInfo.EstateSettings.Save(); | 305 | Scene.RegionInfo.EstateSettings.Save(); |
303 | TriggerEstateInfoChange(); | 306 | TriggerEstateInfoChange(); |
304 | remote_client.SendEstateList(invoice, (int)Constants.EstateAccessCodex.AllowedGroups, m_scene.RegionInfo.EstateSettings.EstateGroups, m_scene.RegionInfo.EstateSettings.EstateID); | 307 | remote_client.SendEstateList(invoice, (int)Constants.EstateAccessCodex.AllowedGroups, Scene.RegionInfo.EstateSettings.EstateGroups, Scene.RegionInfo.EstateSettings.EstateID); |
305 | } | 308 | } |
306 | else | 309 | else |
307 | { | 310 | { |
@@ -310,13 +313,13 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
310 | } | 313 | } |
311 | if ((estateAccessType & 32) != 0) // Group remove | 314 | if ((estateAccessType & 32) != 0) // Group remove |
312 | { | 315 | { |
313 | if (m_scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, true) || m_scene.Permissions.BypassPermissions()) | 316 | if (Scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, true) || Scene.Permissions.BypassPermissions()) |
314 | { | 317 | { |
315 | m_scene.RegionInfo.EstateSettings.RemoveEstateGroup(user); | 318 | Scene.RegionInfo.EstateSettings.RemoveEstateGroup(user); |
316 | m_scene.RegionInfo.EstateSettings.Save(); | 319 | Scene.RegionInfo.EstateSettings.Save(); |
317 | TriggerEstateInfoChange(); | 320 | TriggerEstateInfoChange(); |
318 | 321 | ||
319 | remote_client.SendEstateList(invoice, (int)Constants.EstateAccessCodex.AllowedGroups, m_scene.RegionInfo.EstateSettings.EstateGroups, m_scene.RegionInfo.EstateSettings.EstateID); | 322 | remote_client.SendEstateList(invoice, (int)Constants.EstateAccessCodex.AllowedGroups, Scene.RegionInfo.EstateSettings.EstateGroups, Scene.RegionInfo.EstateSettings.EstateID); |
320 | } | 323 | } |
321 | else | 324 | else |
322 | { | 325 | { |
@@ -325,9 +328,9 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
325 | } | 328 | } |
326 | if ((estateAccessType & 64) != 0) // Ban add | 329 | if ((estateAccessType & 64) != 0) // Ban add |
327 | { | 330 | { |
328 | if (m_scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, false) || m_scene.Permissions.BypassPermissions()) | 331 | if (Scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, false) || Scene.Permissions.BypassPermissions()) |
329 | { | 332 | { |
330 | EstateBan[] banlistcheck = m_scene.RegionInfo.EstateSettings.EstateBans; | 333 | EstateBan[] banlistcheck = Scene.RegionInfo.EstateSettings.EstateBans; |
331 | 334 | ||
332 | bool alreadyInList = false; | 335 | bool alreadyInList = false; |
333 | 336 | ||
@@ -346,20 +349,20 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
346 | EstateBan item = new EstateBan(); | 349 | EstateBan item = new EstateBan(); |
347 | 350 | ||
348 | item.BannedUserID = user; | 351 | item.BannedUserID = user; |
349 | item.EstateID = m_scene.RegionInfo.EstateSettings.EstateID; | 352 | item.EstateID = Scene.RegionInfo.EstateSettings.EstateID; |
350 | item.BannedHostAddress = "0.0.0.0"; | 353 | item.BannedHostAddress = "0.0.0.0"; |
351 | item.BannedHostIPMask = "0.0.0.0"; | 354 | item.BannedHostIPMask = "0.0.0.0"; |
352 | 355 | ||
353 | m_scene.RegionInfo.EstateSettings.AddBan(item); | 356 | Scene.RegionInfo.EstateSettings.AddBan(item); |
354 | m_scene.RegionInfo.EstateSettings.Save(); | 357 | Scene.RegionInfo.EstateSettings.Save(); |
355 | TriggerEstateInfoChange(); | 358 | TriggerEstateInfoChange(); |
356 | 359 | ||
357 | ScenePresence s = m_scene.GetScenePresence(user); | 360 | ScenePresence s = Scene.GetScenePresence(user); |
358 | if (s != null) | 361 | if (s != null) |
359 | { | 362 | { |
360 | if (!s.IsChildAgent) | 363 | if (!s.IsChildAgent) |
361 | { | 364 | { |
362 | m_scene.TeleportClientHome(user, s.ControllingClient); | 365 | Scene.TeleportClientHome(user, s.ControllingClient); |
363 | } | 366 | } |
364 | } | 367 | } |
365 | 368 | ||
@@ -369,7 +372,7 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
369 | remote_client.SendAlertMessage("User is already on the region ban list"); | 372 | remote_client.SendAlertMessage("User is already on the region ban list"); |
370 | } | 373 | } |
371 | //m_scene.RegionInfo.regionBanlist.Add(Manager(user); | 374 | //m_scene.RegionInfo.regionBanlist.Add(Manager(user); |
372 | remote_client.SendBannedUserList(invoice, m_scene.RegionInfo.EstateSettings.EstateBans, m_scene.RegionInfo.EstateSettings.EstateID); | 375 | remote_client.SendBannedUserList(invoice, Scene.RegionInfo.EstateSettings.EstateBans, Scene.RegionInfo.EstateSettings.EstateID); |
373 | } | 376 | } |
374 | else | 377 | else |
375 | { | 378 | { |
@@ -378,9 +381,9 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
378 | } | 381 | } |
379 | if ((estateAccessType & 128) != 0) // Ban remove | 382 | if ((estateAccessType & 128) != 0) // Ban remove |
380 | { | 383 | { |
381 | if (m_scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, false) || m_scene.Permissions.BypassPermissions()) | 384 | if (Scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, false) || Scene.Permissions.BypassPermissions()) |
382 | { | 385 | { |
383 | EstateBan[] banlistcheck = m_scene.RegionInfo.EstateSettings.EstateBans; | 386 | EstateBan[] banlistcheck = Scene.RegionInfo.EstateSettings.EstateBans; |
384 | 387 | ||
385 | bool alreadyInList = false; | 388 | bool alreadyInList = false; |
386 | EstateBan listitem = null; | 389 | EstateBan listitem = null; |
@@ -393,20 +396,21 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
393 | listitem = banlistcheck[i]; | 396 | listitem = banlistcheck[i]; |
394 | break; | 397 | break; |
395 | } | 398 | } |
396 | |||
397 | } | 399 | } |
400 | |||
398 | if (alreadyInList && listitem != null) | 401 | if (alreadyInList && listitem != null) |
399 | { | 402 | { |
400 | m_scene.RegionInfo.EstateSettings.RemoveBan(listitem.BannedUserID); | 403 | Scene.RegionInfo.EstateSettings.RemoveBan(listitem.BannedUserID); |
401 | m_scene.RegionInfo.EstateSettings.Save(); | 404 | Scene.RegionInfo.EstateSettings.Save(); |
402 | TriggerEstateInfoChange(); | 405 | TriggerEstateInfoChange(); |
403 | } | 406 | } |
404 | else | 407 | else |
405 | { | 408 | { |
406 | remote_client.SendAlertMessage("User is not on the region ban list"); | 409 | remote_client.SendAlertMessage("User is not on the region ban list"); |
407 | } | 410 | } |
411 | |||
408 | //m_scene.RegionInfo.regionBanlist.Add(Manager(user); | 412 | //m_scene.RegionInfo.regionBanlist.Add(Manager(user); |
409 | remote_client.SendBannedUserList(invoice, m_scene.RegionInfo.EstateSettings.EstateBans, m_scene.RegionInfo.EstateSettings.EstateID); | 413 | remote_client.SendBannedUserList(invoice, Scene.RegionInfo.EstateSettings.EstateBans, Scene.RegionInfo.EstateSettings.EstateID); |
410 | } | 414 | } |
411 | else | 415 | else |
412 | { | 416 | { |
@@ -415,12 +419,12 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
415 | } | 419 | } |
416 | if ((estateAccessType & 256) != 0) // Manager add | 420 | if ((estateAccessType & 256) != 0) // Manager add |
417 | { | 421 | { |
418 | if (m_scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, true) || m_scene.Permissions.BypassPermissions()) | 422 | if (Scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, true) || Scene.Permissions.BypassPermissions()) |
419 | { | 423 | { |
420 | m_scene.RegionInfo.EstateSettings.AddEstateManager(user); | 424 | Scene.RegionInfo.EstateSettings.AddEstateManager(user); |
421 | m_scene.RegionInfo.EstateSettings.Save(); | 425 | Scene.RegionInfo.EstateSettings.Save(); |
422 | TriggerEstateInfoChange(); | 426 | TriggerEstateInfoChange(); |
423 | remote_client.SendEstateList(invoice, (int)Constants.EstateAccessCodex.EstateManagers, m_scene.RegionInfo.EstateSettings.EstateManagers, m_scene.RegionInfo.EstateSettings.EstateID); | 427 | remote_client.SendEstateList(invoice, (int)Constants.EstateAccessCodex.EstateManagers, Scene.RegionInfo.EstateSettings.EstateManagers, Scene.RegionInfo.EstateSettings.EstateID); |
424 | } | 428 | } |
425 | else | 429 | else |
426 | { | 430 | { |
@@ -429,13 +433,13 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
429 | } | 433 | } |
430 | if ((estateAccessType & 512) != 0) // Manager remove | 434 | if ((estateAccessType & 512) != 0) // Manager remove |
431 | { | 435 | { |
432 | if (m_scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, true) || m_scene.Permissions.BypassPermissions()) | 436 | if (Scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, true) || Scene.Permissions.BypassPermissions()) |
433 | { | 437 | { |
434 | m_scene.RegionInfo.EstateSettings.RemoveEstateManager(user); | 438 | Scene.RegionInfo.EstateSettings.RemoveEstateManager(user); |
435 | m_scene.RegionInfo.EstateSettings.Save(); | 439 | Scene.RegionInfo.EstateSettings.Save(); |
436 | TriggerEstateInfoChange(); | 440 | TriggerEstateInfoChange(); |
437 | 441 | ||
438 | remote_client.SendEstateList(invoice, (int)Constants.EstateAccessCodex.EstateManagers, m_scene.RegionInfo.EstateSettings.EstateManagers, m_scene.RegionInfo.EstateSettings.EstateID); | 442 | remote_client.SendEstateList(invoice, (int)Constants.EstateAccessCodex.EstateManagers, Scene.RegionInfo.EstateSettings.EstateManagers, Scene.RegionInfo.EstateSettings.EstateID); |
439 | } | 443 | } |
440 | else | 444 | else |
441 | { | 445 | { |
@@ -447,7 +451,7 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
447 | private void SendSimulatorBlueBoxMessage( | 451 | private void SendSimulatorBlueBoxMessage( |
448 | IClientAPI remote_client, UUID invoice, UUID senderID, UUID sessionID, string senderName, string message) | 452 | IClientAPI remote_client, UUID invoice, UUID senderID, UUID sessionID, string senderName, string message) |
449 | { | 453 | { |
450 | IDialogModule dm = m_scene.RequestModuleInterface<IDialogModule>(); | 454 | IDialogModule dm = Scene.RequestModuleInterface<IDialogModule>(); |
451 | 455 | ||
452 | if (dm != null) | 456 | if (dm != null) |
453 | dm.SendNotificationToUsersInRegion(senderID, senderName, message); | 457 | dm.SendNotificationToUsersInRegion(senderID, senderName, message); |
@@ -462,61 +466,62 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
462 | private void handleEstateDebugRegionRequest(IClientAPI remote_client, UUID invoice, UUID senderID, bool scripted, bool collisionEvents, bool physics) | 466 | private void handleEstateDebugRegionRequest(IClientAPI remote_client, UUID invoice, UUID senderID, bool scripted, bool collisionEvents, bool physics) |
463 | { | 467 | { |
464 | if (physics) | 468 | if (physics) |
465 | m_scene.RegionInfo.RegionSettings.DisablePhysics = true; | 469 | Scene.RegionInfo.RegionSettings.DisablePhysics = true; |
466 | else | 470 | else |
467 | m_scene.RegionInfo.RegionSettings.DisablePhysics = false; | 471 | Scene.RegionInfo.RegionSettings.DisablePhysics = false; |
468 | 472 | ||
469 | if (scripted) | 473 | if (scripted) |
470 | m_scene.RegionInfo.RegionSettings.DisableScripts = true; | 474 | Scene.RegionInfo.RegionSettings.DisableScripts = true; |
471 | else | 475 | else |
472 | m_scene.RegionInfo.RegionSettings.DisableScripts = false; | 476 | Scene.RegionInfo.RegionSettings.DisableScripts = false; |
473 | 477 | ||
474 | if (collisionEvents) | 478 | if (collisionEvents) |
475 | m_scene.RegionInfo.RegionSettings.DisableCollisions = true; | 479 | Scene.RegionInfo.RegionSettings.DisableCollisions = true; |
476 | else | 480 | else |
477 | m_scene.RegionInfo.RegionSettings.DisableCollisions = false; | 481 | Scene.RegionInfo.RegionSettings.DisableCollisions = false; |
478 | 482 | ||
479 | 483 | ||
480 | m_scene.RegionInfo.RegionSettings.Save(); | 484 | Scene.RegionInfo.RegionSettings.Save(); |
481 | TriggerRegionInfoChange(); | 485 | TriggerRegionInfoChange(); |
482 | 486 | ||
483 | m_scene.SetSceneCoreDebug(scripted, collisionEvents, physics); | 487 | Scene.SetSceneCoreDebug(scripted, collisionEvents, physics); |
484 | } | 488 | } |
485 | 489 | ||
486 | private void handleEstateTeleportOneUserHomeRequest(IClientAPI remover_client, UUID invoice, UUID senderID, UUID prey) | 490 | private void handleEstateTeleportOneUserHomeRequest(IClientAPI remover_client, UUID invoice, UUID senderID, UUID prey) |
487 | { | 491 | { |
488 | if (!m_scene.Permissions.CanIssueEstateCommand(remover_client.AgentId, false)) | 492 | if (!Scene.Permissions.CanIssueEstateCommand(remover_client.AgentId, false)) |
489 | return; | 493 | return; |
490 | 494 | ||
491 | if (prey != UUID.Zero) | 495 | if (prey != UUID.Zero) |
492 | { | 496 | { |
493 | ScenePresence s = m_scene.GetScenePresence(prey); | 497 | ScenePresence s = Scene.GetScenePresence(prey); |
494 | if (s != null) | 498 | if (s != null) |
495 | { | 499 | { |
496 | m_scene.TeleportClientHome(prey, s.ControllingClient); | 500 | Scene.TeleportClientHome(prey, s.ControllingClient); |
497 | } | 501 | } |
498 | } | 502 | } |
499 | } | 503 | } |
500 | 504 | ||
501 | private void handleEstateTeleportAllUsersHomeRequest(IClientAPI remover_client, UUID invoice, UUID senderID) | 505 | private void handleEstateTeleportAllUsersHomeRequest(IClientAPI remover_client, UUID invoice, UUID senderID) |
502 | { | 506 | { |
503 | if (!m_scene.Permissions.CanIssueEstateCommand(remover_client.AgentId, false)) | 507 | if (!Scene.Permissions.CanIssueEstateCommand(remover_client.AgentId, false)) |
504 | return; | 508 | return; |
505 | 509 | ||
506 | m_scene.ForEachScenePresence(delegate(ScenePresence sp) | 510 | Scene.ForEachScenePresence(delegate(ScenePresence sp) |
507 | { | 511 | { |
508 | if (sp.UUID != senderID) | 512 | if (sp.UUID != senderID) |
509 | { | 513 | { |
510 | ScenePresence p = m_scene.GetScenePresence(sp.UUID); | 514 | ScenePresence p = Scene.GetScenePresence(sp.UUID); |
511 | // make sure they are still there, we could be working down a long list | 515 | // make sure they are still there, we could be working down a long list |
512 | // Also make sure they are actually in the region | 516 | // Also make sure they are actually in the region |
513 | if (p != null && !p.IsChildAgent) | 517 | if (p != null && !p.IsChildAgent) |
514 | { | 518 | { |
515 | m_scene.TeleportClientHome(p.UUID, p.ControllingClient); | 519 | Scene.TeleportClientHome(p.UUID, p.ControllingClient); |
516 | } | 520 | } |
517 | } | 521 | } |
518 | }); | 522 | }); |
519 | } | 523 | } |
524 | |||
520 | private void AbortTerrainXferHandler(IClientAPI remoteClient, ulong XferID) | 525 | private void AbortTerrainXferHandler(IClientAPI remoteClient, ulong XferID) |
521 | { | 526 | { |
522 | if (TerrainUploader != null) | 527 | if (TerrainUploader != null) |
@@ -547,11 +552,11 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
547 | TerrainUploader = null; | 552 | TerrainUploader = null; |
548 | } | 553 | } |
549 | remoteClient.SendAlertMessage("Terrain Upload Complete. Loading...."); | 554 | remoteClient.SendAlertMessage("Terrain Upload Complete. Loading...."); |
550 | ITerrainModule terr = m_scene.RequestModuleInterface<ITerrainModule>(); | 555 | ITerrainModule terr = Scene.RequestModuleInterface<ITerrainModule>(); |
551 | 556 | ||
552 | if (terr != null) | 557 | if (terr != null) |
553 | { | 558 | { |
554 | m_log.Warn("[CLIENT]: Got Request to Send Terrain in region " + m_scene.RegionInfo.RegionName); | 559 | m_log.Warn("[CLIENT]: Got Request to Send Terrain in region " + Scene.RegionInfo.RegionName); |
555 | 560 | ||
556 | try | 561 | try |
557 | { | 562 | { |
@@ -597,7 +602,6 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
597 | 602 | ||
598 | private void handleUploadTerrain(IClientAPI remote_client, string clientFileName) | 603 | private void handleUploadTerrain(IClientAPI remote_client, string clientFileName) |
599 | { | 604 | { |
600 | |||
601 | if (TerrainUploader == null) | 605 | if (TerrainUploader == null) |
602 | { | 606 | { |
603 | 607 | ||
@@ -615,16 +619,16 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
615 | { | 619 | { |
616 | remote_client.SendAlertMessage("Another Terrain Upload is in progress. Please wait your turn!"); | 620 | remote_client.SendAlertMessage("Another Terrain Upload is in progress. Please wait your turn!"); |
617 | } | 621 | } |
618 | |||
619 | } | 622 | } |
623 | |||
620 | private void handleTerrainRequest(IClientAPI remote_client, string clientFileName) | 624 | private void handleTerrainRequest(IClientAPI remote_client, string clientFileName) |
621 | { | 625 | { |
622 | // Save terrain here | 626 | // Save terrain here |
623 | ITerrainModule terr = m_scene.RequestModuleInterface<ITerrainModule>(); | 627 | ITerrainModule terr = Scene.RequestModuleInterface<ITerrainModule>(); |
624 | 628 | ||
625 | if (terr != null) | 629 | if (terr != null) |
626 | { | 630 | { |
627 | m_log.Warn("[CLIENT]: Got Request to Send Terrain in region " + m_scene.RegionInfo.RegionName); | 631 | m_log.Warn("[CLIENT]: Got Request to Send Terrain in region " + Scene.RegionInfo.RegionName); |
628 | if (File.Exists(Util.dataDir() + "/terrain.raw")) | 632 | if (File.Exists(Util.dataDir() + "/terrain.raw")) |
629 | { | 633 | { |
630 | File.Delete(Util.dataDir() + "/terrain.raw"); | 634 | File.Delete(Util.dataDir() + "/terrain.raw"); |
@@ -635,7 +639,7 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
635 | byte[] bdata = new byte[input.Length]; | 639 | byte[] bdata = new byte[input.Length]; |
636 | input.Read(bdata, 0, (int)input.Length); | 640 | input.Read(bdata, 0, (int)input.Length); |
637 | remote_client.SendAlertMessage("Terrain file written, starting download..."); | 641 | remote_client.SendAlertMessage("Terrain file written, starting download..."); |
638 | m_scene.XferManager.AddNewFile("terrain.raw", bdata); | 642 | Scene.XferManager.AddNewFile("terrain.raw", bdata); |
639 | // Tell client about it | 643 | // Tell client about it |
640 | m_log.Warn("[CLIENT]: Sending Terrain to " + remote_client.Name); | 644 | m_log.Warn("[CLIENT]: Sending Terrain to " + remote_client.Name); |
641 | remote_client.SendInitiateDownload("terrain.raw", clientFileName); | 645 | remote_client.SendInitiateDownload("terrain.raw", clientFileName); |
@@ -645,35 +649,35 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
645 | private void HandleRegionInfoRequest(IClientAPI remote_client) | 649 | private void HandleRegionInfoRequest(IClientAPI remote_client) |
646 | { | 650 | { |
647 | RegionInfoForEstateMenuArgs args = new RegionInfoForEstateMenuArgs(); | 651 | RegionInfoForEstateMenuArgs args = new RegionInfoForEstateMenuArgs(); |
648 | args.billableFactor = m_scene.RegionInfo.EstateSettings.BillableFactor; | 652 | args.billableFactor = Scene.RegionInfo.EstateSettings.BillableFactor; |
649 | args.estateID = m_scene.RegionInfo.EstateSettings.EstateID; | 653 | args.estateID = Scene.RegionInfo.EstateSettings.EstateID; |
650 | args.maxAgents = (byte)m_scene.RegionInfo.RegionSettings.AgentLimit; | 654 | args.maxAgents = (byte)Scene.RegionInfo.RegionSettings.AgentLimit; |
651 | args.objectBonusFactor = (float)m_scene.RegionInfo.RegionSettings.ObjectBonus; | 655 | args.objectBonusFactor = (float)Scene.RegionInfo.RegionSettings.ObjectBonus; |
652 | args.parentEstateID = m_scene.RegionInfo.EstateSettings.ParentEstateID; | 656 | args.parentEstateID = Scene.RegionInfo.EstateSettings.ParentEstateID; |
653 | args.pricePerMeter = m_scene.RegionInfo.EstateSettings.PricePerMeter; | 657 | args.pricePerMeter = Scene.RegionInfo.EstateSettings.PricePerMeter; |
654 | args.redirectGridX = m_scene.RegionInfo.EstateSettings.RedirectGridX; | 658 | args.redirectGridX = Scene.RegionInfo.EstateSettings.RedirectGridX; |
655 | args.redirectGridY = m_scene.RegionInfo.EstateSettings.RedirectGridY; | 659 | args.redirectGridY = Scene.RegionInfo.EstateSettings.RedirectGridY; |
656 | args.regionFlags = GetRegionFlags(); | 660 | args.regionFlags = GetRegionFlags(); |
657 | args.simAccess = m_scene.RegionInfo.AccessLevel; | 661 | args.simAccess = Scene.RegionInfo.AccessLevel; |
658 | args.sunHour = (float)m_scene.RegionInfo.RegionSettings.SunPosition; | 662 | args.sunHour = (float)Scene.RegionInfo.RegionSettings.SunPosition; |
659 | args.terrainLowerLimit = (float)m_scene.RegionInfo.RegionSettings.TerrainLowerLimit; | 663 | args.terrainLowerLimit = (float)Scene.RegionInfo.RegionSettings.TerrainLowerLimit; |
660 | args.terrainRaiseLimit = (float)m_scene.RegionInfo.RegionSettings.TerrainRaiseLimit; | 664 | args.terrainRaiseLimit = (float)Scene.RegionInfo.RegionSettings.TerrainRaiseLimit; |
661 | args.useEstateSun = m_scene.RegionInfo.RegionSettings.UseEstateSun; | 665 | args.useEstateSun = Scene.RegionInfo.RegionSettings.UseEstateSun; |
662 | args.waterHeight = (float)m_scene.RegionInfo.RegionSettings.WaterHeight; | 666 | args.waterHeight = (float)Scene.RegionInfo.RegionSettings.WaterHeight; |
663 | args.simName = m_scene.RegionInfo.RegionName; | 667 | args.simName = Scene.RegionInfo.RegionName; |
664 | args.regionType = m_scene.RegionInfo.RegionType; | 668 | args.regionType = Scene.RegionInfo.RegionType; |
665 | 669 | ||
666 | remote_client.SendRegionInfoToEstateMenu(args); | 670 | remote_client.SendRegionInfoToEstateMenu(args); |
667 | } | 671 | } |
668 | 672 | ||
669 | private void HandleEstateCovenantRequest(IClientAPI remote_client) | 673 | private void HandleEstateCovenantRequest(IClientAPI remote_client) |
670 | { | 674 | { |
671 | remote_client.SendEstateCovenantInformation(m_scene.RegionInfo.RegionSettings.Covenant); | 675 | remote_client.SendEstateCovenantInformation(Scene.RegionInfo.RegionSettings.Covenant); |
672 | } | 676 | } |
673 | 677 | ||
674 | private void HandleLandStatRequest(int parcelID, uint reportType, uint requestFlags, string filter, IClientAPI remoteClient) | 678 | private void HandleLandStatRequest(int parcelID, uint reportType, uint requestFlags, string filter, IClientAPI remoteClient) |
675 | { | 679 | { |
676 | if (!m_scene.Permissions.CanIssueEstateCommand(remoteClient.AgentId, false)) | 680 | if (!Scene.Permissions.CanIssueEstateCommand(remoteClient.AgentId, false)) |
677 | return; | 681 | return; |
678 | 682 | ||
679 | Dictionary<uint, float> SceneData = new Dictionary<uint,float>(); | 683 | Dictionary<uint, float> SceneData = new Dictionary<uint,float>(); |
@@ -681,11 +685,11 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
681 | 685 | ||
682 | if (reportType == 1) | 686 | if (reportType == 1) |
683 | { | 687 | { |
684 | SceneData = m_scene.PhysicsScene.GetTopColliders(); | 688 | SceneData = Scene.PhysicsScene.GetTopColliders(); |
685 | } | 689 | } |
686 | else if (reportType == 0) | 690 | else if (reportType == 0) |
687 | { | 691 | { |
688 | SceneData = m_scene.SceneGraph.GetTopScripts(); | 692 | SceneData = Scene.SceneGraph.GetTopScripts(); |
689 | } | 693 | } |
690 | 694 | ||
691 | List<LandStatReportItem> SceneReport = new List<LandStatReportItem>(); | 695 | List<LandStatReportItem> SceneReport = new List<LandStatReportItem>(); |
@@ -693,7 +697,7 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
693 | { | 697 | { |
694 | foreach (uint obj in SceneData.Keys) | 698 | foreach (uint obj in SceneData.Keys) |
695 | { | 699 | { |
696 | SceneObjectPart prt = m_scene.GetSceneObjectPart(obj); | 700 | SceneObjectPart prt = Scene.GetSceneObjectPart(obj); |
697 | if (prt != null) | 701 | if (prt != null) |
698 | { | 702 | { |
699 | if (prt.ParentGroup != null) | 703 | if (prt.ParentGroup != null) |
@@ -765,7 +769,7 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
765 | { | 769 | { |
766 | // string lookupname = m_scene.CommsManager.UUIDNameRequestString(uuidarr[i]); | 770 | // string lookupname = m_scene.CommsManager.UUIDNameRequestString(uuidarr[i]); |
767 | 771 | ||
768 | IUserManagement userManager = m_scene.RequestModuleInterface<IUserManagement>(); | 772 | IUserManagement userManager = Scene.RequestModuleInterface<IUserManagement>(); |
769 | if (userManager != null) | 773 | if (userManager != null) |
770 | userManager.GetUserName(uuidarr[i]); | 774 | userManager.GetUserName(uuidarr[i]); |
771 | 775 | ||
@@ -780,7 +784,7 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
780 | 784 | ||
781 | public void sendRegionInfoPacketToAll() | 785 | public void sendRegionInfoPacketToAll() |
782 | { | 786 | { |
783 | m_scene.ForEachScenePresence(delegate(ScenePresence sp) | 787 | Scene.ForEachScenePresence(delegate(ScenePresence sp) |
784 | { | 788 | { |
785 | if (!sp.IsChildAgent) | 789 | if (!sp.IsChildAgent) |
786 | HandleRegionInfoRequest(sp.ControllingClient); | 790 | HandleRegionInfoRequest(sp.ControllingClient); |
@@ -791,99 +795,99 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
791 | { | 795 | { |
792 | RegionHandshakeArgs args = new RegionHandshakeArgs(); | 796 | RegionHandshakeArgs args = new RegionHandshakeArgs(); |
793 | 797 | ||
794 | args.isEstateManager = m_scene.RegionInfo.EstateSettings.IsEstateManager(remoteClient.AgentId); | 798 | args.isEstateManager = Scene.RegionInfo.EstateSettings.IsEstateManager(remoteClient.AgentId); |
795 | if (m_scene.RegionInfo.EstateSettings.EstateOwner != UUID.Zero && m_scene.RegionInfo.EstateSettings.EstateOwner == remoteClient.AgentId) | 799 | if (Scene.RegionInfo.EstateSettings.EstateOwner != UUID.Zero && Scene.RegionInfo.EstateSettings.EstateOwner == remoteClient.AgentId) |
796 | args.isEstateManager = true; | 800 | args.isEstateManager = true; |
797 | 801 | ||
798 | args.billableFactor = m_scene.RegionInfo.EstateSettings.BillableFactor; | 802 | args.billableFactor = Scene.RegionInfo.EstateSettings.BillableFactor; |
799 | args.terrainStartHeight0 = (float)m_scene.RegionInfo.RegionSettings.Elevation1SW; | 803 | args.terrainStartHeight0 = (float)Scene.RegionInfo.RegionSettings.Elevation1SW; |
800 | args.terrainHeightRange0 = (float)m_scene.RegionInfo.RegionSettings.Elevation2SW; | 804 | args.terrainHeightRange0 = (float)Scene.RegionInfo.RegionSettings.Elevation2SW; |
801 | args.terrainStartHeight1 = (float)m_scene.RegionInfo.RegionSettings.Elevation1NW; | 805 | args.terrainStartHeight1 = (float)Scene.RegionInfo.RegionSettings.Elevation1NW; |
802 | args.terrainHeightRange1 = (float)m_scene.RegionInfo.RegionSettings.Elevation2NW; | 806 | args.terrainHeightRange1 = (float)Scene.RegionInfo.RegionSettings.Elevation2NW; |
803 | args.terrainStartHeight2 = (float)m_scene.RegionInfo.RegionSettings.Elevation1SE; | 807 | args.terrainStartHeight2 = (float)Scene.RegionInfo.RegionSettings.Elevation1SE; |
804 | args.terrainHeightRange2 = (float)m_scene.RegionInfo.RegionSettings.Elevation2SE; | 808 | args.terrainHeightRange2 = (float)Scene.RegionInfo.RegionSettings.Elevation2SE; |
805 | args.terrainStartHeight3 = (float)m_scene.RegionInfo.RegionSettings.Elevation1NE; | 809 | args.terrainStartHeight3 = (float)Scene.RegionInfo.RegionSettings.Elevation1NE; |
806 | args.terrainHeightRange3 = (float)m_scene.RegionInfo.RegionSettings.Elevation2NE; | 810 | args.terrainHeightRange3 = (float)Scene.RegionInfo.RegionSettings.Elevation2NE; |
807 | args.simAccess = m_scene.RegionInfo.AccessLevel; | 811 | args.simAccess = Scene.RegionInfo.AccessLevel; |
808 | args.waterHeight = (float)m_scene.RegionInfo.RegionSettings.WaterHeight; | 812 | args.waterHeight = (float)Scene.RegionInfo.RegionSettings.WaterHeight; |
809 | args.regionFlags = GetRegionFlags(); | 813 | args.regionFlags = GetRegionFlags(); |
810 | args.regionName = m_scene.RegionInfo.RegionName; | 814 | args.regionName = Scene.RegionInfo.RegionName; |
811 | args.SimOwner = m_scene.RegionInfo.EstateSettings.EstateOwner; | 815 | args.SimOwner = Scene.RegionInfo.EstateSettings.EstateOwner; |
812 | 816 | ||
813 | args.terrainBase0 = UUID.Zero; | 817 | args.terrainBase0 = UUID.Zero; |
814 | args.terrainBase1 = UUID.Zero; | 818 | args.terrainBase1 = UUID.Zero; |
815 | args.terrainBase2 = UUID.Zero; | 819 | args.terrainBase2 = UUID.Zero; |
816 | args.terrainBase3 = UUID.Zero; | 820 | args.terrainBase3 = UUID.Zero; |
817 | args.terrainDetail0 = m_scene.RegionInfo.RegionSettings.TerrainTexture1; | 821 | args.terrainDetail0 = Scene.RegionInfo.RegionSettings.TerrainTexture1; |
818 | args.terrainDetail1 = m_scene.RegionInfo.RegionSettings.TerrainTexture2; | 822 | args.terrainDetail1 = Scene.RegionInfo.RegionSettings.TerrainTexture2; |
819 | args.terrainDetail2 = m_scene.RegionInfo.RegionSettings.TerrainTexture3; | 823 | args.terrainDetail2 = Scene.RegionInfo.RegionSettings.TerrainTexture3; |
820 | args.terrainDetail3 = m_scene.RegionInfo.RegionSettings.TerrainTexture4; | 824 | args.terrainDetail3 = Scene.RegionInfo.RegionSettings.TerrainTexture4; |
821 | 825 | ||
822 | remoteClient.SendRegionHandshake(m_scene.RegionInfo,args); | 826 | remoteClient.SendRegionHandshake(Scene.RegionInfo,args); |
823 | } | 827 | } |
824 | 828 | ||
825 | public void sendRegionHandshakeToAll() | 829 | public void sendRegionHandshakeToAll() |
826 | { | 830 | { |
827 | m_scene.ForEachClient(sendRegionHandshake); | 831 | Scene.ForEachClient(sendRegionHandshake); |
828 | } | 832 | } |
829 | 833 | ||
830 | public void handleEstateChangeInfo(IClientAPI remoteClient, UUID invoice, UUID senderID, UInt32 parms1, UInt32 parms2) | 834 | public void handleEstateChangeInfo(IClientAPI remoteClient, UUID invoice, UUID senderID, UInt32 parms1, UInt32 parms2) |
831 | { | 835 | { |
832 | if (parms2 == 0) | 836 | if (parms2 == 0) |
833 | { | 837 | { |
834 | m_scene.RegionInfo.EstateSettings.UseGlobalTime = true; | 838 | Scene.RegionInfo.EstateSettings.UseGlobalTime = true; |
835 | m_scene.RegionInfo.EstateSettings.SunPosition = 0.0; | 839 | Scene.RegionInfo.EstateSettings.SunPosition = 0.0; |
836 | } | 840 | } |
837 | else | 841 | else |
838 | { | 842 | { |
839 | m_scene.RegionInfo.EstateSettings.UseGlobalTime = false; | 843 | Scene.RegionInfo.EstateSettings.UseGlobalTime = false; |
840 | m_scene.RegionInfo.EstateSettings.SunPosition = (parms2 - 0x1800)/1024.0; | 844 | Scene.RegionInfo.EstateSettings.SunPosition = (parms2 - 0x1800)/1024.0; |
841 | } | 845 | } |
842 | 846 | ||
843 | if ((parms1 & 0x00000010) != 0) | 847 | if ((parms1 & 0x00000010) != 0) |
844 | m_scene.RegionInfo.EstateSettings.FixedSun = true; | 848 | Scene.RegionInfo.EstateSettings.FixedSun = true; |
845 | else | 849 | else |
846 | m_scene.RegionInfo.EstateSettings.FixedSun = false; | 850 | Scene.RegionInfo.EstateSettings.FixedSun = false; |
847 | 851 | ||
848 | if ((parms1 & 0x00008000) != 0) | 852 | if ((parms1 & 0x00008000) != 0) |
849 | m_scene.RegionInfo.EstateSettings.PublicAccess = true; | 853 | Scene.RegionInfo.EstateSettings.PublicAccess = true; |
850 | else | 854 | else |
851 | m_scene.RegionInfo.EstateSettings.PublicAccess = false; | 855 | Scene.RegionInfo.EstateSettings.PublicAccess = false; |
852 | 856 | ||
853 | if ((parms1 & 0x10000000) != 0) | 857 | if ((parms1 & 0x10000000) != 0) |
854 | m_scene.RegionInfo.EstateSettings.AllowVoice = true; | 858 | Scene.RegionInfo.EstateSettings.AllowVoice = true; |
855 | else | 859 | else |
856 | m_scene.RegionInfo.EstateSettings.AllowVoice = false; | 860 | Scene.RegionInfo.EstateSettings.AllowVoice = false; |
857 | 861 | ||
858 | if ((parms1 & 0x00100000) != 0) | 862 | if ((parms1 & 0x00100000) != 0) |
859 | m_scene.RegionInfo.EstateSettings.AllowDirectTeleport = true; | 863 | Scene.RegionInfo.EstateSettings.AllowDirectTeleport = true; |
860 | else | 864 | else |
861 | m_scene.RegionInfo.EstateSettings.AllowDirectTeleport = false; | 865 | Scene.RegionInfo.EstateSettings.AllowDirectTeleport = false; |
862 | 866 | ||
863 | if ((parms1 & 0x00800000) != 0) | 867 | if ((parms1 & 0x00800000) != 0) |
864 | m_scene.RegionInfo.EstateSettings.DenyAnonymous = true; | 868 | Scene.RegionInfo.EstateSettings.DenyAnonymous = true; |
865 | else | 869 | else |
866 | m_scene.RegionInfo.EstateSettings.DenyAnonymous = false; | 870 | Scene.RegionInfo.EstateSettings.DenyAnonymous = false; |
867 | 871 | ||
868 | if ((parms1 & 0x01000000) != 0) | 872 | if ((parms1 & 0x01000000) != 0) |
869 | m_scene.RegionInfo.EstateSettings.DenyIdentified = true; | 873 | Scene.RegionInfo.EstateSettings.DenyIdentified = true; |
870 | else | 874 | else |
871 | m_scene.RegionInfo.EstateSettings.DenyIdentified = false; | 875 | Scene.RegionInfo.EstateSettings.DenyIdentified = false; |
872 | 876 | ||
873 | if ((parms1 & 0x02000000) != 0) | 877 | if ((parms1 & 0x02000000) != 0) |
874 | m_scene.RegionInfo.EstateSettings.DenyTransacted = true; | 878 | Scene.RegionInfo.EstateSettings.DenyTransacted = true; |
875 | else | 879 | else |
876 | m_scene.RegionInfo.EstateSettings.DenyTransacted = false; | 880 | Scene.RegionInfo.EstateSettings.DenyTransacted = false; |
877 | 881 | ||
878 | if ((parms1 & 0x40000000) != 0) | 882 | if ((parms1 & 0x40000000) != 0) |
879 | m_scene.RegionInfo.EstateSettings.DenyMinors = true; | 883 | Scene.RegionInfo.EstateSettings.DenyMinors = true; |
880 | else | 884 | else |
881 | m_scene.RegionInfo.EstateSettings.DenyMinors = false; | 885 | Scene.RegionInfo.EstateSettings.DenyMinors = false; |
882 | 886 | ||
883 | m_scene.RegionInfo.EstateSettings.Save(); | 887 | Scene.RegionInfo.EstateSettings.Save(); |
884 | TriggerEstateInfoChange(); | 888 | TriggerEstateInfoChange(); |
885 | 889 | ||
886 | m_scene.TriggerEstateSunUpdate(); | 890 | Scene.TriggerEstateSunUpdate(); |
887 | 891 | ||
888 | sendDetailedEstateData(remoteClient, invoice); | 892 | sendDetailedEstateData(remoteClient, invoice); |
889 | } | 893 | } |
@@ -893,121 +897,21 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
893 | #region IRegionModule Members | 897 | #region IRegionModule Members |
894 | 898 | ||
895 | public void Initialise(Scene scene, IConfigSource source) | 899 | public void Initialise(Scene scene, IConfigSource source) |
896 | { | 900 | { |
897 | m_scene = scene; | 901 | Scene = scene; |
898 | m_scene.RegisterModuleInterface<IEstateModule>(this); | 902 | Scene.RegisterModuleInterface<IEstateModule>(this); |
899 | m_scene.EventManager.OnNewClient += EventManager_OnNewClient; | 903 | Scene.EventManager.OnNewClient += EventManager_OnNewClient; |
900 | m_scene.EventManager.OnRequestChangeWaterHeight += changeWaterHeight; | 904 | Scene.EventManager.OnRequestChangeWaterHeight += changeWaterHeight; |
901 | 905 | ||
902 | m_scene.AddCommand(this, "set terrain texture", | 906 | m_commands = new EstateManagementCommands(this); |
903 | "set terrain texture <number> <uuid> [<x>] [<y>]", | 907 | m_commands.Initialise(); |
904 | "Sets the terrain <number> to <uuid>, if <x> or <y> are specified, it will only " + | ||
905 | "set it on regions with a matching coordinate. Specify -1 in <x> or <y> to wildcard" + | ||
906 | " that coordinate.", | ||
907 | consoleSetTerrainTexture); | ||
908 | |||
909 | m_scene.AddCommand(this, "set terrain heights", | ||
910 | "set terrain heights <corner> <min> <max> [<x>] [<y>]", | ||
911 | "Sets the terrain texture heights on corner #<corner> to <min>/<max>, if <x> or <y> are specified, it will only " + | ||
912 | "set it on regions with a matching coordinate. Specify -1 in <x> or <y> to wildcard" + | ||
913 | " that coordinate. Corner # SW = 0, NW = 1, SE = 2, NE = 3.", | ||
914 | consoleSetTerrainHeights); | ||
915 | } | ||
916 | |||
917 | #region Console Commands | ||
918 | |||
919 | public void consoleSetTerrainTexture(string module, string[] args) | ||
920 | { | ||
921 | string num = args[3]; | ||
922 | string uuid = args[4]; | ||
923 | int x = (args.Length > 5 ? int.Parse(args[5]) : -1); | ||
924 | int y = (args.Length > 6 ? int.Parse(args[6]) : -1); | ||
925 | |||
926 | if (x == -1 || m_scene.RegionInfo.RegionLocX == x) | ||
927 | { | ||
928 | if (y == -1 || m_scene.RegionInfo.RegionLocY == y) | ||
929 | { | ||
930 | int corner = int.Parse(num); | ||
931 | UUID texture = UUID.Parse(uuid); | ||
932 | |||
933 | m_log.Debug("[ESTATEMODULE] Setting terrain textures for " + m_scene.RegionInfo.RegionName + | ||
934 | string.Format(" (C#{0} = {1})", corner, texture)); | ||
935 | |||
936 | switch (corner) | ||
937 | { | ||
938 | case 0: | ||
939 | m_scene.RegionInfo.RegionSettings.TerrainTexture1 = texture; | ||
940 | break; | ||
941 | case 1: | ||
942 | m_scene.RegionInfo.RegionSettings.TerrainTexture2 = texture; | ||
943 | break; | ||
944 | case 2: | ||
945 | m_scene.RegionInfo.RegionSettings.TerrainTexture3 = texture; | ||
946 | break; | ||
947 | case 3: | ||
948 | m_scene.RegionInfo.RegionSettings.TerrainTexture4 = texture; | ||
949 | break; | ||
950 | } | ||
951 | m_scene.RegionInfo.RegionSettings.Save(); | ||
952 | TriggerRegionInfoChange(); | ||
953 | sendRegionInfoPacketToAll(); | ||
954 | |||
955 | } | ||
956 | } | ||
957 | } | ||
958 | |||
959 | public void consoleSetTerrainHeights(string module, string[] args) | ||
960 | { | ||
961 | string num = args[3]; | ||
962 | string min = args[4]; | ||
963 | string max = args[5]; | ||
964 | int x = (args.Length > 6 ? int.Parse(args[6]) : -1); | ||
965 | int y = (args.Length > 7 ? int.Parse(args[7]) : -1); | ||
966 | |||
967 | if (x == -1 || m_scene.RegionInfo.RegionLocX == x) | ||
968 | { | ||
969 | if (y == -1 || m_scene.RegionInfo.RegionLocY == y) | ||
970 | { | ||
971 | int corner = int.Parse(num); | ||
972 | float lowValue = float.Parse(min, Culture.NumberFormatInfo); | ||
973 | float highValue = float.Parse(max, Culture.NumberFormatInfo); | ||
974 | |||
975 | m_log.Debug("[ESTATEMODULE] Setting terrain heights " + m_scene.RegionInfo.RegionName + | ||
976 | string.Format(" (C{0}, {1}-{2}", corner, lowValue, highValue)); | ||
977 | |||
978 | switch (corner) | ||
979 | { | ||
980 | case 0: | ||
981 | m_scene.RegionInfo.RegionSettings.Elevation1SW = lowValue; | ||
982 | m_scene.RegionInfo.RegionSettings.Elevation2SW = highValue; | ||
983 | break; | ||
984 | case 1: | ||
985 | m_scene.RegionInfo.RegionSettings.Elevation1NW = lowValue; | ||
986 | m_scene.RegionInfo.RegionSettings.Elevation2NW = highValue; | ||
987 | break; | ||
988 | case 2: | ||
989 | m_scene.RegionInfo.RegionSettings.Elevation1SE = lowValue; | ||
990 | m_scene.RegionInfo.RegionSettings.Elevation2SE = highValue; | ||
991 | break; | ||
992 | case 3: | ||
993 | m_scene.RegionInfo.RegionSettings.Elevation1NE = lowValue; | ||
994 | m_scene.RegionInfo.RegionSettings.Elevation2NE = highValue; | ||
995 | break; | ||
996 | } | ||
997 | m_scene.RegionInfo.RegionSettings.Save(); | ||
998 | TriggerRegionInfoChange(); | ||
999 | sendRegionHandshakeToAll(); | ||
1000 | } | ||
1001 | } | ||
1002 | } | 908 | } |
1003 | 909 | ||
1004 | #endregion | ||
1005 | |||
1006 | public void PostInitialise() | 910 | public void PostInitialise() |
1007 | { | 911 | { |
1008 | // Sets up the sun module based no the saved Estate and Region Settings | 912 | // Sets up the sun module based no the saved Estate and Region Settings |
1009 | // DO NOT REMOVE or the sun will stop working | 913 | // DO NOT REMOVE or the sun will stop working |
1010 | m_scene.TriggerEstateSunUpdate(); | 914 | Scene.TriggerEstateSunUpdate(); |
1011 | } | 915 | } |
1012 | 916 | ||
1013 | public void Close() | 917 | public void Close() |
@@ -1031,14 +935,14 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
1031 | public void changeWaterHeight(float height) | 935 | public void changeWaterHeight(float height) |
1032 | { | 936 | { |
1033 | setRegionTerrainSettings(height, | 937 | setRegionTerrainSettings(height, |
1034 | (float)m_scene.RegionInfo.RegionSettings.TerrainRaiseLimit, | 938 | (float)Scene.RegionInfo.RegionSettings.TerrainRaiseLimit, |
1035 | (float)m_scene.RegionInfo.RegionSettings.TerrainLowerLimit, | 939 | (float)Scene.RegionInfo.RegionSettings.TerrainLowerLimit, |
1036 | m_scene.RegionInfo.RegionSettings.UseEstateSun, | 940 | Scene.RegionInfo.RegionSettings.UseEstateSun, |
1037 | m_scene.RegionInfo.RegionSettings.FixedSun, | 941 | Scene.RegionInfo.RegionSettings.FixedSun, |
1038 | (float)m_scene.RegionInfo.RegionSettings.SunPosition, | 942 | (float)Scene.RegionInfo.RegionSettings.SunPosition, |
1039 | m_scene.RegionInfo.EstateSettings.UseGlobalTime, | 943 | Scene.RegionInfo.EstateSettings.UseGlobalTime, |
1040 | m_scene.RegionInfo.EstateSettings.FixedSun, | 944 | Scene.RegionInfo.EstateSettings.FixedSun, |
1041 | (float)m_scene.RegionInfo.EstateSettings.SunPosition); | 945 | (float)Scene.RegionInfo.EstateSettings.SunPosition); |
1042 | 946 | ||
1043 | sendRegionInfoPacketToAll(); | 947 | sendRegionInfoPacketToAll(); |
1044 | } | 948 | } |
@@ -1078,32 +982,32 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
1078 | 982 | ||
1079 | // Fully implemented | 983 | // Fully implemented |
1080 | // | 984 | // |
1081 | if (m_scene.RegionInfo.RegionSettings.AllowDamage) | 985 | if (Scene.RegionInfo.RegionSettings.AllowDamage) |
1082 | flags |= RegionFlags.AllowDamage; | 986 | flags |= RegionFlags.AllowDamage; |
1083 | if (m_scene.RegionInfo.RegionSettings.BlockTerraform) | 987 | if (Scene.RegionInfo.RegionSettings.BlockTerraform) |
1084 | flags |= RegionFlags.BlockTerraform; | 988 | flags |= RegionFlags.BlockTerraform; |
1085 | if (!m_scene.RegionInfo.RegionSettings.AllowLandResell) | 989 | if (!Scene.RegionInfo.RegionSettings.AllowLandResell) |
1086 | flags |= RegionFlags.BlockLandResell; | 990 | flags |= RegionFlags.BlockLandResell; |
1087 | if (m_scene.RegionInfo.RegionSettings.DisableCollisions) | 991 | if (Scene.RegionInfo.RegionSettings.DisableCollisions) |
1088 | flags |= RegionFlags.SkipCollisions; | 992 | flags |= RegionFlags.SkipCollisions; |
1089 | if (m_scene.RegionInfo.RegionSettings.DisableScripts) | 993 | if (Scene.RegionInfo.RegionSettings.DisableScripts) |
1090 | flags |= RegionFlags.SkipScripts; | 994 | flags |= RegionFlags.SkipScripts; |
1091 | if (m_scene.RegionInfo.RegionSettings.DisablePhysics) | 995 | if (Scene.RegionInfo.RegionSettings.DisablePhysics) |
1092 | flags |= RegionFlags.SkipPhysics; | 996 | flags |= RegionFlags.SkipPhysics; |
1093 | if (m_scene.RegionInfo.RegionSettings.BlockFly) | 997 | if (Scene.RegionInfo.RegionSettings.BlockFly) |
1094 | flags |= RegionFlags.NoFly; | 998 | flags |= RegionFlags.NoFly; |
1095 | if (m_scene.RegionInfo.RegionSettings.RestrictPushing) | 999 | if (Scene.RegionInfo.RegionSettings.RestrictPushing) |
1096 | flags |= RegionFlags.RestrictPushObject; | 1000 | flags |= RegionFlags.RestrictPushObject; |
1097 | if (m_scene.RegionInfo.RegionSettings.AllowLandJoinDivide) | 1001 | if (Scene.RegionInfo.RegionSettings.AllowLandJoinDivide) |
1098 | flags |= RegionFlags.AllowParcelChanges; | 1002 | flags |= RegionFlags.AllowParcelChanges; |
1099 | if (m_scene.RegionInfo.RegionSettings.BlockShowInSearch) | 1003 | if (Scene.RegionInfo.RegionSettings.BlockShowInSearch) |
1100 | flags |= RegionFlags.BlockParcelSearch; | 1004 | flags |= RegionFlags.BlockParcelSearch; |
1101 | 1005 | ||
1102 | if (m_scene.RegionInfo.RegionSettings.FixedSun) | 1006 | if (Scene.RegionInfo.RegionSettings.FixedSun) |
1103 | flags |= RegionFlags.SunFixed; | 1007 | flags |= RegionFlags.SunFixed; |
1104 | if (m_scene.RegionInfo.RegionSettings.Sandbox) | 1008 | if (Scene.RegionInfo.RegionSettings.Sandbox) |
1105 | flags |= RegionFlags.Sandbox; | 1009 | flags |= RegionFlags.Sandbox; |
1106 | if (m_scene.RegionInfo.EstateSettings.AllowVoice) | 1010 | if (Scene.RegionInfo.EstateSettings.AllowVoice) |
1107 | flags |= RegionFlags.AllowVoice; | 1011 | flags |= RegionFlags.AllowVoice; |
1108 | 1012 | ||
1109 | // Fudge these to always on, so the menu options activate | 1013 | // Fudge these to always on, so the menu options activate |
@@ -1125,32 +1029,32 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
1125 | { | 1029 | { |
1126 | RegionFlags flags = RegionFlags.None; | 1030 | RegionFlags flags = RegionFlags.None; |
1127 | 1031 | ||
1128 | if (m_scene.RegionInfo.EstateSettings.FixedSun) | 1032 | if (Scene.RegionInfo.EstateSettings.FixedSun) |
1129 | flags |= RegionFlags.SunFixed; | 1033 | flags |= RegionFlags.SunFixed; |
1130 | if (m_scene.RegionInfo.EstateSettings.PublicAccess) | 1034 | if (Scene.RegionInfo.EstateSettings.PublicAccess) |
1131 | flags |= (RegionFlags.PublicAllowed | | 1035 | flags |= (RegionFlags.PublicAllowed | |
1132 | RegionFlags.ExternallyVisible); | 1036 | RegionFlags.ExternallyVisible); |
1133 | if (m_scene.RegionInfo.EstateSettings.AllowVoice) | 1037 | if (Scene.RegionInfo.EstateSettings.AllowVoice) |
1134 | flags |= RegionFlags.AllowVoice; | 1038 | flags |= RegionFlags.AllowVoice; |
1135 | if (m_scene.RegionInfo.EstateSettings.AllowDirectTeleport) | 1039 | if (Scene.RegionInfo.EstateSettings.AllowDirectTeleport) |
1136 | flags |= RegionFlags.AllowDirectTeleport; | 1040 | flags |= RegionFlags.AllowDirectTeleport; |
1137 | if (m_scene.RegionInfo.EstateSettings.DenyAnonymous) | 1041 | if (Scene.RegionInfo.EstateSettings.DenyAnonymous) |
1138 | flags |= RegionFlags.DenyAnonymous; | 1042 | flags |= RegionFlags.DenyAnonymous; |
1139 | if (m_scene.RegionInfo.EstateSettings.DenyIdentified) | 1043 | if (Scene.RegionInfo.EstateSettings.DenyIdentified) |
1140 | flags |= RegionFlags.DenyIdentified; | 1044 | flags |= RegionFlags.DenyIdentified; |
1141 | if (m_scene.RegionInfo.EstateSettings.DenyTransacted) | 1045 | if (Scene.RegionInfo.EstateSettings.DenyTransacted) |
1142 | flags |= RegionFlags.DenyTransacted; | 1046 | flags |= RegionFlags.DenyTransacted; |
1143 | if (m_scene.RegionInfo.EstateSettings.AbuseEmailToEstateOwner) | 1047 | if (Scene.RegionInfo.EstateSettings.AbuseEmailToEstateOwner) |
1144 | flags |= RegionFlags.AbuseEmailToEstateOwner; | 1048 | flags |= RegionFlags.AbuseEmailToEstateOwner; |
1145 | if (m_scene.RegionInfo.EstateSettings.BlockDwell) | 1049 | if (Scene.RegionInfo.EstateSettings.BlockDwell) |
1146 | flags |= RegionFlags.BlockDwell; | 1050 | flags |= RegionFlags.BlockDwell; |
1147 | if (m_scene.RegionInfo.EstateSettings.EstateSkipScripts) | 1051 | if (Scene.RegionInfo.EstateSettings.EstateSkipScripts) |
1148 | flags |= RegionFlags.EstateSkipScripts; | 1052 | flags |= RegionFlags.EstateSkipScripts; |
1149 | if (m_scene.RegionInfo.EstateSettings.ResetHomeOnTeleport) | 1053 | if (Scene.RegionInfo.EstateSettings.ResetHomeOnTeleport) |
1150 | flags |= RegionFlags.ResetHomeOnTeleport; | 1054 | flags |= RegionFlags.ResetHomeOnTeleport; |
1151 | if (m_scene.RegionInfo.EstateSettings.TaxFree) | 1055 | if (Scene.RegionInfo.EstateSettings.TaxFree) |
1152 | flags |= RegionFlags.TaxFree; | 1056 | flags |= RegionFlags.TaxFree; |
1153 | if (m_scene.RegionInfo.EstateSettings.DenyMinors) | 1057 | if (Scene.RegionInfo.EstateSettings.DenyMinors) |
1154 | flags |= (RegionFlags)(1 << 30); | 1058 | flags |= (RegionFlags)(1 << 30); |
1155 | 1059 | ||
1156 | return (uint)flags; | 1060 | return (uint)flags; |
@@ -1158,38 +1062,38 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
1158 | 1062 | ||
1159 | public bool IsManager(UUID avatarID) | 1063 | public bool IsManager(UUID avatarID) |
1160 | { | 1064 | { |
1161 | if (avatarID == m_scene.RegionInfo.EstateSettings.EstateOwner) | 1065 | if (avatarID == Scene.RegionInfo.EstateSettings.EstateOwner) |
1162 | return true; | 1066 | return true; |
1163 | 1067 | ||
1164 | List<UUID> ems = new List<UUID>(m_scene.RegionInfo.EstateSettings.EstateManagers); | 1068 | List<UUID> ems = new List<UUID>(Scene.RegionInfo.EstateSettings.EstateManagers); |
1165 | if (ems.Contains(avatarID)) | 1069 | if (ems.Contains(avatarID)) |
1166 | return true; | 1070 | return true; |
1167 | 1071 | ||
1168 | return false; | 1072 | return false; |
1169 | } | 1073 | } |
1170 | 1074 | ||
1171 | protected void TriggerRegionInfoChange() | 1075 | public void TriggerRegionInfoChange() |
1172 | { | 1076 | { |
1173 | ChangeDelegate change = OnRegionInfoChange; | 1077 | ChangeDelegate change = OnRegionInfoChange; |
1174 | 1078 | ||
1175 | if (change != null) | 1079 | if (change != null) |
1176 | change(m_scene.RegionInfo.RegionID); | 1080 | change(Scene.RegionInfo.RegionID); |
1177 | } | 1081 | } |
1178 | 1082 | ||
1179 | protected void TriggerEstateInfoChange() | 1083 | public void TriggerEstateInfoChange() |
1180 | { | 1084 | { |
1181 | ChangeDelegate change = OnEstateInfoChange; | 1085 | ChangeDelegate change = OnEstateInfoChange; |
1182 | 1086 | ||
1183 | if (change != null) | 1087 | if (change != null) |
1184 | change(m_scene.RegionInfo.RegionID); | 1088 | change(Scene.RegionInfo.RegionID); |
1185 | } | 1089 | } |
1186 | 1090 | ||
1187 | protected void TriggerEstateMessage(UUID fromID, string fromName, string message) | 1091 | public void TriggerEstateMessage(UUID fromID, string fromName, string message) |
1188 | { | 1092 | { |
1189 | MessageDelegate onmessage = OnEstateMessage; | 1093 | MessageDelegate onmessage = OnEstateMessage; |
1190 | 1094 | ||
1191 | if (onmessage != null) | 1095 | if (onmessage != null) |
1192 | onmessage(m_scene.RegionInfo.RegionID, fromID, fromName, message); | 1096 | onmessage(Scene.RegionInfo.RegionID, fromID, fromName, message); |
1193 | } | 1097 | } |
1194 | } | 1098 | } |
1195 | } | 1099 | } |